• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 04:53
CEST 10:53
KST 17:53
  • 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
[ASL21] Ro8 Preview Pt1: Inheritors11[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists17[ASL21] Ro16 Preview Pt1: Fresh Flow9[ASL21] Ro24 Preview Pt2: News Flash10
Community News
2026 GSL Season 1 Qualifiers19Maestros of the Game 2 announced92026 GSL Tour plans announced15Weekly Cups (April 6-12): herO doubles, "Villains" prevail1MaNa leaves Team Liquid25
StarCraft 2
General
Team Liquid Map Contest #22 - The Finalists MaNa leaves Team Liquid Maestros of the Game 2 announced 2026 GSL Tour plans announced Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament 2026 GSL Season 1 Qualifiers INu's Battles#14 <BO.9 2Matches> GSL CK: More events planned pending crowdfunding RSL Revival: Season 5 - Qualifiers and Main Event
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base Mutation # 521 Memorable Boss
Brood War
General
[ASL21] Ro8 Preview Pt1: Inheritors FlaSh: This Will Be My Final ASL【ASL S21 Ro.16】 Leta's ASL S21 Ro.16 review BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion
Tourneys
[ASL21] Ro8 Day 1 [Megathread] Daily Proleagues [ASL21] Ro16 Group D Escore Tournament StarCraft Season 2
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Diablo IV Nintendo Switch Thread Dawn of War IV Total Annihilation Server - TAForever
Dota 2
The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread 3D technology/software discussion European Politico-economics QA Mega-thread Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Sexual Health Of Gamers
TrAiDoS
lurker extra damage testi…
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2026 users

The Big Programming Thread - Page 611

Forum Index > General Forum
Post a Reply
Prev 1 609 610 611 612 613 1032 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.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2015-04-08 23:46:57
April 08 2015 23:31 GMT
#12201
On April 09 2015 08:04 bardtown wrote:
At the moment I do a little bit of C++/Python programming and I think I have potential. I'm pretty good at understanding complicated structures etc, but I am aware that my programming is just functional and I don't really understand what is going on at a very fundamental level. That's pretty disconcerting for me. Even things that should be really basic, like pointers, I'm not comfortable with because I don't know how/why/when they are efficient. Does anybody have a book recommendation that builds up from technical fundamentals? Maybe a computer science textbook is what I need, but I'd prefer something a bit more readable. It doesn't need to be a comprehensive book, obviously I can research things in more detail, but it needs to give me a sense of structure.


Pointers are just what they really are... pointers to memory. So you don't have to copy or work with temporary objects, but reference them instead. That is why they're efficient. If you work with heap memory (one that you have to manually allocate and deallocate, you're not bound to a function/method scope), but pointers can work with stack and heap. Nowadays, C++ uses references instead because in general they're safer (as in they're assumed not to be null unlike pointers).

Good C++ books:

Beginner: C++ Primer
Advanced: More Effective C++ (1995), Effective C++ 3rd edition, Effective STL, also the new Effective C++ for C++11/14 (newest standard)

Edit: I'll give you an example of why pointers are efficient. Let's have a function such as this one:


void swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
}


Two problems:

1. Parameters 'a' and 'b' are copied under the cover. They're not referenced, even if you pass variables.
2. Numbers are swapped, but because of the above (variables are copied), swap is lost once you get out of scope, that is, when you exit execution of the function.

Solution:


void swap(int* a, int* b)
{
int temp = *a;
*a = *b;
*b = temp;
}


You solve all the two problems above. No extra copies are created. And swap isn't lost after function is executed. But what if you say:

swap(NULL, NULL)
? Undefined behaviour.

So, you can achieve much better syntax with somewhat null safety:


void swap(int& a, int& b)
{
int temp = a;
a = b;
b = temp;
}
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
April 08 2015 23:36 GMT
#12202
Honestly I don't like books and prefer to do projects.

Choose something that sounds cool and figure out how to do it in pure C. Every time you finish and start a new project you'll learn a shitton of new stuff. Like implement linked lists in C using pointers, with push/pop methods. That should challenge your fundamentals hard.
There is no one like you in the universe.
bardtown
Profile Joined June 2011
England2313 Posts
Last Edited: 2015-04-09 00:06:14
April 08 2015 23:48 GMT
#12203
I think it is less the language that I have problems with and more the way in which languages in general relate to hardware, etc. Something like C++ Primer goes: here's how you define variables, here's how you create loops, then suddenly it is talking about things like you do above. Stack and heap? What is unsafe about null pointers? What is the difference between references and pointers? I'm definitely missing a lot of knowledge here because I just learnt things as and when I needed them for functional programming. I'm looking at Elements of Programming, but I think that is too advanced for where I am at right now. I may try Introduction to Computation and Programming With Python to start.

Thanks for the example. It does help clarify things for me in terms of usage but I'm still feeling the need for a bottom-up relearning of concepts. It's silly that I've got this far without really thinking at all about values/addresses.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2015-04-09 00:20:52
April 08 2015 23:58 GMT
#12204
On April 09 2015 08:48 bardtown wrote:
I think it is less the language that I have problems with and more the way in which languages in general relate to hardware, etc. Something like C++ Primer goes: here's how you define variables, here's how you create loops, then suddenly it is talking about things like you do above. Stack and heap? What is unsafe about null pointers? What is the difference between references and pointers? I'm definitely missing a lot of knowledge here because I just learnt things as and when I needed them for functional programming. I'm looking at Elements of Programming, but I think that is too advanced for where I am at right now. I may try Introduction to Computation and Programming With Python to start.


There are two kinds of memory (actually three if you include static, but forget that for now): heap and stack.
Stack is faster, but smaller, yet you should prefer it whenever you can. It's also subject to scope rules. Heap memory is dynamic, slower than stack, but it doesn't care if you exit a method. It remains, but you have to manually delete heap based objects in C++. You don't care about that in Java/C# though.

Further reading: http://stackoverflow.com/questions/5836309/stack-memory-vs-heap-memory

Null pointers are unsafe as they don't point to anything. Example:


int* test = NULL; // or nullptr in C++11


And if you use 'test' before you initialise it, you're in the world of undefined, incorrect behaviour. Anyway, a lot of your questions can be googled. I think Effective C++ answers some of your questions, too. C++ Primer should definitely explain all of what you're asking as far as I remember.

Edit: I think references are just like pointers under the cover, but they're just like 'aliases'. Another name for an existing object, thus you don't have to check for:

if (!object)

or
if (object == NULL)


Both checks are the same btw.

On April 09 2015 08:36 Blisse wrote:
Honestly I don't like books and prefer to do projects.

Choose something that sounds cool and figure out how to do it in pure C. Every time you finish and start a new project you'll learn a shitton of new stuff. Like implement linked lists in C using pointers, with push/pop methods. That should challenge your fundamentals hard.


You can't start building proper houses before you learn how to do it. You can certainly build one, more likely a bad one though. I think books are a good way to learn stuff without having years of experience. It's all about best practices. One certainly needs practice not just theory, too.
bardtown
Profile Joined June 2011
England2313 Posts
April 09 2015 00:48 GMT
#12205
Thanks again for explaining. I could find everything online but that is a piecemeal approach which could leave me missing information I didn't even know I needed, hence looking for a structured book. I know of all the books you are recommending, just worry that a) they're very long and dense and b) they often assume basic knowledge that I don't have. May get a few different ones out the library and see if any have the approach I'm after
Ropid
Profile Joined March 2009
Germany3557 Posts
April 09 2015 01:08 GMT
#12206
Perhaps see if you can find some sort of rough overview about what the CPU and its assembly language can actually do and how C translates into that. It could be illuminating to see what actually happens when a function in C gets called and when it returns, what the parameters and variables actually are, what happens when there's an "if" or "while".

I tried to find something short but failed, instead found this book here which seems to be good but explains too much, enough to be actually useful if you'd wanted to start learning x86 Assembly: http://www.drpaulcarter.com/pcasm/
"My goal is to replace my soul with coffee and become immortal."
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2015-04-09 02:17:58
April 09 2015 02:17 GMT
#12207
--- Nuked ---
Mr. Wiggles
Profile Blog Joined August 2010
Canada5894 Posts
April 09 2015 14:40 GMT
#12208
I'd second 'Computer Organization and Design'.

One of the books I've found quite valuable for learning was Silberschatz, Galvin, and Gagne's 'Operating System Concepts'.

I'm on my phone right now, so I can't give a blurb, but I'd say to check them out.
you gotta dance
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2015-04-12 11:17:36
April 12 2015 11:13 GMT
#12209
--- Nuked ---
Prillan
Profile Joined August 2011
Sweden350 Posts
April 12 2015 11:33 GMT
#12210
On April 12 2015 20:13 Nesserev wrote:
Hey guys,

I'm currently looking into scraping data from websites, and a little bit of front-end development; something that I've never actively done before, so I was wondering...

If you go to the following link, or almost any other hotel booking page on expedia.com, hotels.com, etc. a message pops up with 'X amount of persons are watching this page right now'. What would be the best way to extract this information ('X')?
http://www.expedia.com/Bruges-Center-Hotels-Hotel-Dukes-Palace.h1853344.Hotel-Information?chkin=12/04/2015&chkout=13/04/2015

EDIT: Now that I'm at it; does anyone recommend any books/online tutorials regarding web scraping?

First you have to figure out if the data is included in the HTML source or received as an external file. Clicking "View Source" and searching for the term yields, in this case, no results. So the data must be loaded from JS. Using Chrome's (or Opera's in my case) dev tools allows you to capture any files transmitted. By filtering for XHR I found this file:
Remote Address:23.54.3.53:80
Request URL:http://www.expedia.se/Hotels/Offers?[...]
Request Method:GET
Status Code:200 OK

Full link: + Show Spoiler +
Request URL:http://www.expedia.se/Hotels/Offers?action=getAndUpdateHotelProductActivity&hotelIds=1853344&durationForViews=1800000&durationForBookings=172800000


Then it's just a matter of extracting the data from JSON:

{
"ViewStatus":0,
"BookingStatus":0,
"HotelProductActivityList":
[
{
"ViewCount":8,
"BookingCount":22,
"HotelId":1853344,
"isValidViewCount":true,
"isValidBookingCount":true
}
]
}


This is usually the method I follow.

If it's in the source code, use a html parser or regex to extract the value (regex for small things, html for big).
If it's in a json file, find out a way to retrieve the file and then grab the value.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
April 12 2015 11:39 GMT
#12211
--- Nuked ---
Manit0u
Profile Blog Joined August 2004
Poland17733 Posts
April 13 2015 11:47 GMT
#12212
On April 09 2015 08:31 darkness wrote:
Show nested quote +
On April 09 2015 08:04 bardtown wrote:
At the moment I do a little bit of C++/Python programming and I think I have potential. I'm pretty good at understanding complicated structures etc, but I am aware that my programming is just functional and I don't really understand what is going on at a very fundamental level. That's pretty disconcerting for me. Even things that should be really basic, like pointers, I'm not comfortable with because I don't know how/why/when they are efficient. Does anybody have a book recommendation that builds up from technical fundamentals? Maybe a computer science textbook is what I need, but I'd prefer something a bit more readable. It doesn't need to be a comprehensive book, obviously I can research things in more detail, but it needs to give me a sense of structure.


Pointers are just what they really are... pointers to memory. So you don't have to copy or work with temporary objects, but reference them instead. That is why they're efficient. If you work with heap memory (one that you have to manually allocate and deallocate, you're not bound to a function/method scope), but pointers can work with stack and heap. Nowadays, C++ uses references instead because in general they're safer (as in they're assumed not to be null unlike pointers).

Good C++ books:

Beginner: C++ Primer
Advanced: More Effective C++ (1995), Effective C++ 3rd edition, Effective STL, also the new Effective C++ for C++11/14 (newest standard)


For the fundamentals isn't it better to simply read K&R? It's short, easy to understand and should give anyone really good basic knowledge. I know it's C and not C++, but when speaking of the most basic stuff that's pretty much irrelevant.
Time is precious. Waste it wisely.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
Last Edited: 2015-04-13 13:04:17
April 13 2015 13:02 GMT
#12213
OOP in php is giving me such a fcking headacke

 
$clients //I make this an array in the constructor

//this will return an array with $somevalue in it
public function getClient(){
$this->clients[] = $somevalue;
return $this->clients;
}

//this returns an empty array, Ill call setClient somewhere first at then Ill call getClient

public function setClient($somevalue){
$this->clients[] = $somevalue;
}


public function getClient(){
return $this->clients;
}



ps this is just some write up code. but youll get the idea.
The harder it becomes, the more you should focus on the basics.
Manit0u
Profile Blog Joined August 2004
Poland17733 Posts
Last Edited: 2015-04-13 14:07:26
April 13 2015 13:55 GMT
#12214
On April 13 2015 22:02 sabas123 wrote:
OOP in php is giving me such a fcking headacke

 
$clients //I make this an array in the constructor

//this will return an array with $somevalue in it
public function getClient(){
$this->clients[] = $somevalue;
return $this->clients;
}

//this returns an empty array, Ill call setClient somewhere first at then Ill call getClient

public function setClient($somevalue){
$this->clients[] = $somevalue;
}


public function getClient(){
return $this->clients;
}



ps this is just some write up code. but youll get the idea.



class Client
{
protected $clients;

public function __construct()
{
$this->clients = array();
}

public function getClient()
{
$this->clients[] = $somevalue;

return $this->clients;
}
}

$clients = new Client;

print_r($clients->getClient());


Result:


Array
(
[0] =>
)



// var_dump instead of print_r

array(1) {
[0]=>
NULL
}


Despite pushing the uninitialized variable to the array everything works as intended.

What exactly was your problem?

Also, if you want full OOP you can always use ArrayObject instead of regular array
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18278 Posts
April 13 2015 13:59 GMT
#12215
On April 13 2015 22:02 sabas123 wrote:
OOP in php is giving me such a fcking headacke

 
$clients //I make this an array in the constructor

//this will return an array with $somevalue in it
public function getClient(){
$this->clients[] = $somevalue;
return $this->clients;
}

//this returns an empty array, Ill call setClient somewhere first at then Ill call getClient

public function setClient($somevalue){
$this->clients[] = $somevalue;
}


public function getClient(){
return $this->clients;
}



ps this is just some write up code. but youll get the idea.


What exactly is your problem with it? Other than your first method, which seems both superfluous and wrong: firstly, it is overwritten immediately by the second declaration of getClient() and secondly, $somevalue is not initialized in this bit of code, so presumably it is null, but you definitely don't want to add it to your client array.

Other than that first method, it seems like completely standard getter and setter code, so unless you have a problem in general with getters and setters (which I agree can be quite a tedious design pattern, but makes UPKEEP of the code much easier), what specifically is your problem with OOP in PHP?
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
April 13 2015 14:15 GMT
#12216
$somevalue is a value that I will use some where else in the script

the problem is that I apperntly cant set the value or get the setted value back.
The harder it becomes, the more you should focus on the basics.
Manit0u
Profile Blog Joined August 2004
Poland17733 Posts
Last Edited: 2015-04-13 14:31:38
April 13 2015 14:29 GMT
#12217
What is the value?

How do you set it?

How do you get it?

It really looks like you're trying to create the most basic collection class. Those aren't hard at all...

http://www.sitepoint.com/collection-classes-in-php/
Time is precious. Waste it wisely.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
April 13 2015 14:32 GMT
#12218
On April 13 2015 23:29 Manit0u wrote:
What is the value?

How do you set it?

How do you get it?

I set it with

public function setClient($input){
$this->clients[$input];
}


and then I get it with


public function getClient(){
return $this->clients;
}


and the value is a string.
The harder it becomes, the more you should focus on the basics.
Acrofales
Profile Joined August 2010
Spain18278 Posts
Last Edited: 2015-04-13 18:26:41
April 13 2015 18:24 GMT
#12219
On April 13 2015 23:32 sabas123 wrote:
Show nested quote +
On April 13 2015 23:29 Manit0u wrote:
What is the value?

How do you set it?

How do you get it?

I set it with

public function setClient($input){
$this->clients[$input];
}


and then I get it with


public function getClient(){
return $this->clients;
}


and the value is a string.


$this->clients[$input] does not set anything... it gets the value at the array index $input. Been a while since I programmed php, but pretty sure this throws an error unless you have somehow initialized your array already and there is an actual value at index $input. In that case it will return that value, but your method does not return, so in the end it will simply do nothing.

Use

public function setClient($input){
$this->clients[]=$input;
}


To be completely correct, you should probably not call this setClient, but addClient. You should also call your getClient() method getClients(), because it is returning the list of clients as a whole, and not just one specific client. But the naming convention of your methods seems to be a smaller problem than the fact that your basic code is wrong.


EDIT: if what getClient() returns is a string, you are either initializing $this->clients wrong (as a string instead of an array), or you are casting it to a string somewhere along the line.
boon2537
Profile Blog Joined October 2010
United States905 Posts
April 13 2015 19:56 GMT
#12220
I chose to do a simple tic-tac-toe with an A.I. in Lisp as a project for my programming language class. Since I'm a noob with functional stuff, I just abuse progn make life easy for myself. I just hope my professor doesn't mind that too much >.<
Prev 1 609 610 611 612 613 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 8m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech124
SortOf 106
StarCraft: Brood War
Sea 2647
Mind 1429
Horang2 1031
Hyuk 712
EffOrt 348
Jaedong 265
910 172
Larva 157
Killer 145
PianO 134
[ Show more ]
actioN 108
ToSsGirL 82
yabsab 36
Aegong 31
Nal_rA 23
Shine 19
Bale 14
ajuk12(nOOB) 13
SilentControl 10
Light 0
Dota 2
XaKoH 521
NeuroSwarm447
resolut1ontv 178
XcaliburYe81
League of Legends
JimRising 526
Counter-Strike
shoxiejesuss1745
olofmeister1539
allub323
Heroes of the Storm
Khaldor161
Other Games
ceh9533
Pyrionflax71
Mew2King67
Organizations
StarCraft: Brood War
Kim Chul Min (afreeca) 12
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH216
• LUISG 25
• CranKy Ducklings SOOP3
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• TFBlade1174
• Stunt705
Other Games
• WagamamaTV172
Upcoming Events
Replay Cast
8m
CranKy Ducklings4
Afreeca Starleague
1h 8m
Soma vs hero
Wardi Open
2h 8m
Monday Night Weeklies
7h 8m
Replay Cast
15h 8m
Replay Cast
1d
Afreeca Starleague
1d 1h
Leta vs YSC
GSL
2 days
Replay Cast
2 days
GSL
3 days
[ Show More ]
The PondCast
3 days
KCM Race Survival
3 days
Replay Cast
3 days
Replay Cast
4 days
Escore
4 days
Replay Cast
4 days
Replay Cast
5 days
IPSL
5 days
Ret vs Art_Of_Turtle
Radley vs TBD
BSL
5 days
Replay Cast
5 days
uThermal 2v2 Circuit
6 days
BSL
6 days
IPSL
6 days
eOnzErG vs TBD
G5 vs Nesh
Liquipedia Results

Completed

Escore Tournament S2: W4
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
StarCraft2 Community Team League 2026 Spring
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026

Upcoming

Escore Tournament S2: W5
KK 2v2 League Season 1
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
RSL Revival: Season 5
2026 GSL S1
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
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 © 2026 TLnet. All Rights Reserved.