• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:50
CEST 19:50
KST 02:50
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro24 Preview Pt1: Runway122v2 & SC: Evo Complete: Weekend Double Feature3Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18Serral wins EWC 202549
Community News
Maestros of The Game—$20k event w/ live finals in Paris1Weekly Cups (Aug 11-17): MaxPax triples again!10Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195Weekly Cups (Jul 28-Aug 3): herO doubles up6
StarCraft 2
General
RSL Revival patreon money discussion thread I made a 5.0.12/5.0.13 replay fix Geoff 'iNcontroL' Robinson has passed away #1: Maru - Greatest Players of All Time Is it ok to advertise SC EVO Mod streaming here?
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris Master Swan Open (Global Bronze-Master 2) $5,100+ SEL Season 2 Championship (SC: Evo) Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series
Strategy
Custom Maps
External Content
Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below Mutation # 484 Magnetic Pull
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL New season has just come in ladder BW General Discussion [ASL20] Ro24 Preview Pt1: Runway ASL 20 HYPE VIDEO!
Tourneys
Cosmonarchy Pro Showmatches [ASL20] Ro24 Group B [ASL20] Ro24 Group C [Megathread] Daily Proleagues
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting Muta micro map competition
Other Games
General Games
General RTS Discussion Thread Beyond All Reason Stormgate/Frost Giant Megathread Nintendo Switch Thread Total Annihilation Server - TAForever
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread The Games Industry And ATVI
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
High temperatures on bridge(s) Gtx660 graphics card replacement Installation of Windows 10 suck at "just a moment"
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
The Biochemical Cost of Gami…
TrAiDoS
[Girl blog} My fema…
artosisisthebest
Sharpening the Filtration…
frozenclaw
ASL S20 English Commentary…
namkraft
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2195 users

The Big Programming Thread - Page 353

Forum Index > General Forum
Post a Reply
Prev 1 351 352 353 354 355 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Millitron
Profile Blog Joined August 2010
United States2611 Posts
September 15 2013 19:05 GMT
#7041
On September 16 2013 03:39 darkness wrote:
I've been wondering how one can keep record of unlimited number of users in a struct way fashion in Java.

For example,


class Person {
private String name;
private String surname;
private int age;

Person(String name, String surname, int age) {
this.name = name;
this.surname = surname;
this.age = age;
}

// some getter methods
public int getAge() {
return age;
}

// etc... and setter methods too
public void setAge(int age) {
this.age = age;
}
}


I know I can have a single record by having:

Person bill = new Person("Bill", "Gates", 57);

How can I have an unlimited number of people though? Is it possible without creating individual objects manually?

Its absolutely possible, how do you think Starcraft handles training troops?

The following code assumes there's some other code generating names and ages:

Person list[] = new Person[n]
for (int i = 0; i < n; i++)
{
Person temp = new Person(generateFirstName(), generateLastName(), generateAge());
list[i] = temp;
}


This code gives you an array "list" containing n Persons. As you can see, none of them are manually created.
Who called in the fleet?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-09-15 19:19:11
September 15 2013 19:18 GMT
#7042
Awesome. Thank you! I have additional questions if you don't mind. Is ArrayList the way to go in this case? If there's frequent insert/remove, is LinkedList better? How can I use one if needed?

Maybe like this?

Person list[] = new LinkedList();


Or is that not valid?

Thanks!
sur_reaL
Profile Joined April 2010
Canada278 Posts
Last Edited: 2013-09-15 19:34:16
September 15 2013 19:25 GMT
#7043
Yeah ArrayList is the way to go since you want "unlimited" and not up to "n" elements using just an array.

For example:
List<Person> myList = new ArrayList<Person>();


Runtime Analysis
http://www.youtube.com/watch?v=lH3hrtp1T84
lolmlg
Profile Joined November 2011
619 Posts
September 15 2013 19:27 GMT
#7044
On September 16 2013 04:18 darkness wrote:
If there's frequent insert/remove, is LinkedList better?

What other operations do you expect to be performed "frequently"? Search? Sorting?
Nerv3
Profile Joined March 2011
Germany36 Posts
Last Edited: 2013-09-15 19:30:37
September 15 2013 19:29 GMT
#7045
The advantage of ArrayList is that you can get an element in O(1), while with a Linked List you need O(n) time. However deleting an element while iterating the list only needs O(1) for a Linked List but O(n) for an Array List.

Both lists are "unlimited" as far as memory goes.
More gg more skill :)
Sluggy
Profile Joined June 2010
United States128 Posts
September 15 2013 19:38 GMT
#7046
On September 16 2013 04:18 darkness wrote:
Awesome. Thank you! I have additional questions if you don't mind. Is ArrayList the way to go in this case? If there's frequent insert/remove, is LinkedList better? How can I use one if needed?

Maybe like this?

Person list[] = new LinkedList();


Or is that not valid?

Thanks!


Similar to the post above me, you're going to want to do something like

List<Person> = new LinkedList<Person>()

I'm not sure about the standard java generic library but that is the general idea
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2013-09-15 20:03:11
September 15 2013 20:00 GMT
#7047
On September 16 2013 04:18 darkness wrote:
Awesome. Thank you! I have additional questions if you don't mind. Is ArrayList the way to go in this case? If there's frequent insert/remove, is LinkedList better? How can I use one if needed?

Maybe like this?

Person list[] = new LinkedList();


Or is that not valid?

Thanks!


Usually the best way to store a potentially unlimited amount of data is a database, but if you need it in the code, there is a lot to think about when choosing the correct data type to store it in.

The easiest are arrays, which have the advantage that you can instantly access any element as long as you know the index. However, they are slow when inserting/deleting elements somewhere in the middle as every element after the inserted/deleted element has to be moved (which happens behind the scenes but still consumes time). They also are relatively slow if you want to search for a specific element since you have to move through each element until you find the one you search for. This can be compensated for by using a sorted list, which speeds up searching but requires the overhead of keeping the array sorted after every change of data. They are the fastest choice if you always have the index to the elements you are looking and when the dataset stays mostly constant and any inserts/deletes are usually near the end of the array.

Another option are linked lists, which have the advantage that inserting/deleting is very fast. However, accessing a specific element always requires searching through all of them to find it, you can't access it directly. Like normal arrays, searching for a specific element also takes time as you need to search through all of them and keeping a sorted list does not speed up searching since you can't look ahead, you have to move through every single element to find the element after it. They are the fastest choice if you insert/delete a lot but don't often search for elements.

A third option are hashmaps/associative arrays, which allow quick access to any element according to the chosen keys and depending on the implementation usually have an insert/delete time close to that of a linked list. Performance wise they are roughly half way between arrays and linked lists in most situations with the advantage that you can search elements very fast if you chose the right keys. A disadvantage is that the order of elements is not guaranteed, so if you just iterate through the data, you might get it in a different order than you created it in. They are good choices if you know what you are usually searching for, e.g. in your case it might be a Lastname + Firstname key which allows you to find a user very fast if you have his name. They are not a good choice if you need your data in a specific order.

The best pick always depends on the use-case and it's impossible to say "X is always better than Y".
artynko
Profile Joined November 2010
Slovakia86 Posts
Last Edited: 2013-09-15 20:06:49
September 15 2013 20:04 GMT
#7048
However in general unless you are trying to launch a rocket into space it is not a good practice to obsess about optimalization so early into development, it is nice to pick a correct list implementation but in the end, the time you can save by having O(1) somewhere instead of Log(n) is usually negligible compared to the access times that will be created by network or database.
Far more important then picking a correct implementation is having a good architecture that can scale easily.
Manit0u
Profile Blog Joined August 2004
Poland17278 Posts
Last Edited: 2013-09-15 20:15:13
September 15 2013 20:14 GMT
#7049
You should really read some on mappings (associative array data structures). This way you can not only have nice arrays for multiple things but also store and access data in a much more coherent way. Also, getter and setter methods are bad and should be avoided, more on that here: http://www.javaworld.com/javaworld/jw-09-2003/jw-0905-toolbox.html (there's also a link explaining why "extends" is evil).
Time is precious. Waste it wisely.
Holy_AT
Profile Joined July 2010
Austria978 Posts
September 15 2013 20:28 GMT
#7050
On September 16 2013 03:39 darkness wrote:
I've been wondering how one can keep record of unlimited number of users in a struct way fashion in Java.

For example,


class Person {
private String name;
private String surname;
private int age;

Person(String name, String surname, int age) {
this.name = name;
this.surname = surname;
this.age = age;
}

// some getter methods
public int getAge() {
return age;
}

// etc... and setter methods too
public void setAge(int age) {
this.age = age;
}
}


I know I can have a single record by having:

Person bill = new Person("Bill", "Gates", 57);

How can I have an unlimited number of people though? Is it possible without creating individual objects manually?


You seem to be missing several basics in object oriented programming if you do not know that you can simply use Lists of objects or arrays of objects.
There are several good basic guides for starting java and c# programmers that would be really useful to you. I suggest you use google or maybe someone can recommend you a good guide he/she him/herself used.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
September 15 2013 20:35 GMT
#7051
On September 16 2013 05:28 Holy_AT wrote:
Show nested quote +
On September 16 2013 03:39 darkness wrote:
I've been wondering how one can keep record of unlimited number of users in a struct way fashion in Java.

For example,


class Person {
private String name;
private String surname;
private int age;

Person(String name, String surname, int age) {
this.name = name;
this.surname = surname;
this.age = age;
}

// some getter methods
public int getAge() {
return age;
}

// etc... and setter methods too
public void setAge(int age) {
this.age = age;
}
}


I know I can have a single record by having:

Person bill = new Person("Bill", "Gates", 57);

How can I have an unlimited number of people though? Is it possible without creating individual objects manually?


You seem to be missing several basics in object oriented programming if you do not know that you can simply use Lists of objects or arrays of objects.
There are several good basic guides for starting java and c# programmers that would be really useful to you. I suggest you use google or maybe someone can recommend you a good guide he/she him/herself used.


Yeah, it didn't come to my mind that collections and data structures are built as generic. Then again, I have no experience (or should I say, I didn't have to do it until now), so yeah.. I'm still learning.

I'm definitely up for some revision of my OOP understanding.

If the 'Java, Java, Java' book is ok, then I can have a look at it tomorrow.

Book: http://books.google.bg/books/about/Java_Java_Java.html?id=k_a0pVRrFVkC&redir_esc=y
Manit0u
Profile Blog Joined August 2004
Poland17278 Posts
September 15 2013 20:37 GMT
#7052
On September 16 2013 05:28 Holy_AT wrote:
Show nested quote +
On September 16 2013 03:39 darkness wrote:
I've been wondering how one can keep record of unlimited number of users in a struct way fashion in Java.

For example,


class Person {
private String name;
private String surname;
private int age;

Person(String name, String surname, int age) {
this.name = name;
this.surname = surname;
this.age = age;
}

// some getter methods
public int getAge() {
return age;
}

// etc... and setter methods too
public void setAge(int age) {
this.age = age;
}
}


I know I can have a single record by having:

Person bill = new Person("Bill", "Gates", 57);

How can I have an unlimited number of people though? Is it possible without creating individual objects manually?


You seem to be missing several basics in object oriented programming if you do not know that you can simply use Lists of objects or arrays of objects.
There are several good basic guides for starting java and c# programmers that would be really useful to you. I suggest you use google or maybe someone can recommend you a good guide he/she him/herself used.


I'd suggest Symphony in C++ standard by Jerzy Grebosz (if it's available in English) and Code Complete, 2nd edition by Steve McConnell. This 2 books have truly opened my eyes.
Time is precious. Waste it wisely.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2013-09-15 21:10:20
September 15 2013 21:05 GMT
#7053
Honestly, there are a lot of decent books for your purposes, just pick whatever you have available. Regardless of which source you go for, remain critical. Books aren't full of absolute undeniable truth. Sometimes they are partially outdated, sometimes they advocate debatable things more than appropriate. Books are written by humans after all.

There mainly are two things you are looking for in books:
- what you can do
- what you should or should not do

The latter is where you should be most careful. Words like "never" or "always" should ring alarm bells: Absolutes usually are out of place in the "what you should do" department.

By the way, is "Code Complete" the book where the author says about checked exceptions that "the discussion is over"? Because that sure is a debatable statement (even though there are no satisfying implementations of the concept in popular languages).
If you have a good reason to disagree with the above, please tell me. Thank you.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-09-15 22:02:11
September 15 2013 21:58 GMT
#7054
On September 16 2013 06:05 spinesheath wrote:
Honestly, there are a lot of decent books for your purposes, just pick whatever you have available. Regardless of which source you go for, remain critical. Books aren't full of absolute undeniable truth. Sometimes they are partially outdated, sometimes they advocate debatable things more than appropriate. Books are written by humans after all.

There mainly are two things you are looking for in books:
- what you can do
- what you should or should not do

The latter is where you should be most careful. Words like "never" or "always" should ring alarm bells: Absolutes usually are out of place in the "what you should do" department.

By the way, is "Code Complete" the book where the author says about checked exceptions that "the discussion is over"? Because that sure is a debatable statement (even though there are no satisfying implementations of the concept in popular languages).


To add to your criticism about books, 'Java, Java, Java' suggests ignoring the 0 index of arrays for the sake of readability. I've done this on my own in year 1 at university, and I got marked down for it. I didn't follow this book's advice back then. Feedback was like "do not waste memory" or something.

In other words, you only use the range from index[1] to index[n].

I mean this edition: http://archive.org/details/JavaJavaJavaObject-orientedProblemSolving

PDF, Page: 449/865
Nerv3
Profile Joined March 2011
Germany36 Posts
September 15 2013 22:19 GMT
#7055
Actually arrays in the Starcraft 2 Editor are one larger than you declare them. :D
More gg more skill :)
Manit0u
Profile Blog Joined August 2004
Poland17278 Posts
Last Edited: 2013-09-15 22:39:49
September 15 2013 22:39 GMT
#7056
On September 16 2013 06:58 darkness wrote:
Show nested quote +
On September 16 2013 06:05 spinesheath wrote:
Honestly, there are a lot of decent books for your purposes, just pick whatever you have available. Regardless of which source you go for, remain critical. Books aren't full of absolute undeniable truth. Sometimes they are partially outdated, sometimes they advocate debatable things more than appropriate. Books are written by humans after all.

There mainly are two things you are looking for in books:
- what you can do
- what you should or should not do

The latter is where you should be most careful. Words like "never" or "always" should ring alarm bells: Absolutes usually are out of place in the "what you should do" department.

By the way, is "Code Complete" the book where the author says about checked exceptions that "the discussion is over"? Because that sure is a debatable statement (even though there are no satisfying implementations of the concept in popular languages).


To add to your criticism about books, 'Java, Java, Java' suggests ignoring the 0 index of arrays for the sake of readability. I've done this on my own in year 1 at university, and I got marked down for it. I didn't follow this book's advice back then. Feedback was like "do not waste memory" or something.

In other words, you only use the range from index[1] to index[n].

I mean this edition: http://archive.org/details/JavaJavaJavaObject-orientedProblemSolving

PDF, Page: 449/865


Why would you ignore index[0]? You should always be counting from 0, not 1... It's actually worse for readability if you start with 1 all the time because people who are accustomed to 0 being the beginning of the array (99.9% of coders I believe) will be confused and are going to waste time by checking all the code to see what you use index[0] for (and not finding it).

Personally, I'd be baffled if I came across such a solution.
Time is precious. Waste it wisely.
DeltaX
Profile Joined August 2011
United States287 Posts
Last Edited: 2013-09-15 22:52:32
September 15 2013 22:50 GMT
#7057
Another downside is that by ignoring the first index, you can get some odd behavior if you try to access the array with an iterator instead of a standard for loop. (for (int myInt : myArray) vs for(int i = 1; i < myArray.length + 1; i++) ) For example, an array of ints initilizes with all values as zero (it seems), so if you then iterate over them, but never did anything with the first index, you will have n+1 elements instead of n, plus an extra 0.

You will also confuse people quite a lot. Sometimes you just do things not because one way is better than the other, but just because that is the way everyone will expect it to work, and may not notice you did it differently, causing problems.
Yoshi-
Profile Joined October 2008
Germany10227 Posts
September 15 2013 22:53 GMT
#7058
Also if you want to initialize an array of size 5 you need to do sth like this
int array[5+1];

Which doesn't make any sense at all
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-09-15 22:59:58
September 15 2013 22:59 GMT
#7059
Well, I didn't think much like a programmer in year 1. index[1] is more natural to humans than index[0] imho, so my approach was like that back then. I don't do it anymore though. It happened only once anyway.

I am surprised that a book recommended by universities suggests ignoring the 0 index.
Cyx.
Profile Joined November 2010
Canada806 Posts
September 15 2013 23:25 GMT
#7060
On September 16 2013 07:59 darkness wrote:
Well, I didn't think much like a programmer in year 1. index[1] is more natural to humans than index[0] imho, so my approach was like that back then. I don't do it anymore though. It happened only once anyway.

I am surprised that a book recommended by universities suggests ignoring the 0 index.


Lua (which was originally designed for non-programmers) starts its string indices at 1 for this exact reason ^^ I was so confused when I started learning Lua but you get used to it pretty quickly, and it IS way more natural. I totally agree with the design decision from the people who designed Lua that way.

That being said, it still confuses the shit out of people who've been learning it with 0 all the time - so while it is probably nicer and easier to pick up for someone who's never programmed before, it's not gonna fly in any workplace =P
Prev 1 351 352 353 354 355 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 6h 10m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 273
Hui .143
Codebar 97
BRAT_OK 80
ProTech41
MindelVK 18
StarCraft: Brood War
Britney 36766
Bisu 2921
Jaedong 1225
EffOrt 501
ZerO 404
BeSt 388
Light 253
Stork 220
ggaemo 195
hero 189
[ Show more ]
Dewaltoss 135
Rush 117
Snow 95
Mind 82
sas.Sziky 54
sorry 46
Backho 30
Aegong 22
Rock 16
Sacsri 15
Terrorterran 15
scan(afreeca) 15
IntoTheRainbow 7
Dota 2
Gorgc8910
qojqva3441
XcaliburYe244
Counter-Strike
olofmeister581
Stewie2K177
Heroes of the Storm
Trikslyr60
Other Games
FrodaN1214
Beastyqt923
KnowMe141
ArmadaUGS112
markeloff71
QueenE69
ZerO(Twitch)16
Organizations
Other Games
BasetradeTV10
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• davetesta30
• Kozan
• sooper7s
• AfreecaTV YouTube
• Migwel
• LaughNgamezSOOP
• intothetv
• IndyKCrew
StarCraft: Brood War
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2977
League of Legends
• Jankos1533
• TFBlade924
Counter-Strike
• Shiphtur209
Other Games
• imaqtpie482
• WagamamaTV261
Upcoming Events
Online Event
6h 10m
The PondCast
16h 10m
WardiTV Summer Champion…
17h 10m
Zoun vs Bunny
herO vs Solar
Replay Cast
1d 6h
LiuLi Cup
1d 17h
BSL Team Wars
2 days
Team Hawk vs Team Dewalt
Korean StarCraft League
2 days
CranKy Ducklings
2 days
SC Evo League
2 days
WardiTV Summer Champion…
2 days
Classic vs Percival
Spirit vs NightMare
[ Show More ]
CSO Cup
2 days
[BSL 2025] Weekly
3 days
Sparkling Tuna Cup
3 days
SC Evo League
3 days
BSL Team Wars
4 days
Team Bonyth vs Team Sziky
Afreeca Starleague
4 days
Queen vs HyuN
EffOrt vs Calm
Wardi Open
4 days
Replay Cast
5 days
Afreeca Starleague
5 days
Rush vs TBD
Jaedong vs Mong
Afreeca Starleague
6 days
herO vs TBD
Royal vs Barracks
Liquipedia Results

Completed

Jiahua Invitational
uThermal 2v2 Main Event
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
CSL Season 18: Qualifier 1
SEL Season 2 Championship
WardiTV Summer 2025
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSLAN 3
CSL Season 18: Qualifier 2
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
PGL Masters Bucharest 2025
MESA Nomadic Masters Fall
Thunderpick World Champ.
CS Asia Championships 2025
Roobet Cup 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.