• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:03
CET 17:03
KST 01:03
  • 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
TL.net Map Contest #21: Winners8Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
Starcraft, SC2, HoTS, WC3, returning to Blizzcon!33$5,000+ WardiTV 2025 Championship6[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win9
StarCraft 2
General
RotterdaM "Serral is the GOAT, and it's not close" TL.net Map Contest #21: Winners Starcraft, SC2, HoTS, WC3, returning to Blizzcon! 5.0.15 Patch Balance Hotfix (2025-10-8) Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
BW General Discussion [ASL20] Ask the mapmakers — Drop your questions [BSL21] RO32 Group Stage BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group B - Sunday 21:00 CET [BSL21] RO32 Group A - Saturday 21:00 CET
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread ZeroSpace Megathread General RTS Discussion Thread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread Dating: How's your luck?
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Why we need SC3
Hildegard
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1685 users

The Big Programming Thread - Page 22

Forum Index > General Forum
Post a Reply
Prev 1 20 21 22 23 24 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.
Fujitsi
Profile Joined April 2010
Belgium65 Posts
October 28 2010 13:23 GMT
#421

Thanks for the reply. I have one question about this advice though. What should I practice on?


Try writing programs that make your own life easier.
Now I'm in the middle of writing a prog that tracks which series/animes I have watched, provides some additional info and whatsoever.

I know there are sites that do this for you but once you get your own program working, you'll be very proud of yourself ^^
tofucake
Profile Blog Joined October 2009
Hyrule19151 Posts
October 28 2010 13:34 GMT
#422
One thing you can do to practice is go find some FOSS project, get the code, and try to fix bugs in the bug tracker. Also, you can try to break it. Some companies (Google) will pay you if you find a bug [that nobody else has reported], so not only will you learn but you can make some money.

Before I started taking classes, I learned to program because I wanted to do something. So the very first thing I did was download VB6 and some random bot source (I think it was Feanor's Fyrebot or something, but I don't remember) and I started figuring out what everything did, how, and why. I learned so much.
Liquipediaasante sana squash banana
pinke
Profile Blog Joined October 2010
United States56 Posts
October 28 2010 15:51 GMT
#423
On October 28 2010 21:51 Klesky wrote:
Show nested quote +
On October 28 2010 21:43 pinke wrote:
does anyone know a good place to learn unity?


http://unity3d.com/support/resources/tutorials/

I sincerely hope you found that before me.
Go learn C++, it's more valuable than this, imo.


i agree, but a particular internship is looking for unity
but then I think that rain is wet, so who am I to judge?
VIB
Profile Blog Joined November 2007
Brazil3567 Posts
October 28 2010 15:57 GMT
#424
I wanna learn how to code on the server side. I'm already decent at C++, Java and Python on client side. So I figured I would learn how to code Java Servlets or maybe Python for server.

I'm a complete newbie to client/server, I have no idea what sockets are or how http requests work. I've been reading Google's GWT and App Engine basic tutorials but most of the stuff that mentions server code there are way over my head. When they start talking about configuring Apache I'm like "...wut?" So I spend more time reading the definitions of everything on wikipidia than actually doing the tutorials, it's pretty confusing.

If I google for tutorials most of the stuff I click seem to be way over my head as well. So does anyone have any tips to begin learning client/server communications via http using Java or Python?
Great people talk about ideas. Average people talk about things. Small people talk about other people.
tofucake
Profile Blog Joined October 2009
Hyrule19151 Posts
October 28 2010 16:18 GMT
#425
You should probably just read up on HTTP itself. It's a fairly straightforward protocol, and it's text based so it's easy to understand what's what (unlike something like BNCS, for example).
Liquipediaasante sana squash banana
fabiano
Profile Blog Joined August 2009
Brazil4644 Posts
October 28 2010 16:43 GMT
#426
What do you mean by client/server communications?

If you want to setup a communication between a client and a server that you have created, take a look at the Socket class in Java. If you google for sockets in Java you will find a lot of easy to follow tutorials on how to setup a simple distributed system. If you want add fault tolerance it gets a lot nasty and I think you wont be able to set a decent fault tolerant system without taking a course at the University.

If you want to create a (or an?) web service to feed client requests just look for Glassfish tutorials or google for "java web service tutorials". I am also lost when it comes to deploying web services because I've never done it before, but as far as I remember, at least on Netbeans, all you need to create a web service is to add the annotation @webservice to segments of your code and voilá, you have your web service.

I see that you are a countryman fella, so take a look at www.guj.com.br they probably can help you in our native language.
"When the geyser died, a probe came out" - SirJolt
VIB
Profile Blog Joined November 2007
Brazil3567 Posts
Last Edited: 2010-10-28 18:01:52
October 28 2010 17:23 GMT
#427
I wanna make webapps. I wanna make a website that makes queries to the server then write the server code which would respond to that. Like handling user database and stuff like that. Java web services is probably what I'm looking for, but most tutorials I find by googling are way over my head. All I know is that (or I think I know that) I need something like Apache to make a computer understand http. But I'm not sure how does Java or Python fits into that or how to install it or how to start learning about any of it.

I have a paid host computer with apache which says it supports Python but not Java. And I have no idea why. So right now I'm trying to install apache with java on a virtual machine with ubuntu on my home computer. Just to see how stuff works. But I'm kinda lost here.

Anyway I'll take a look at that website. Thanks a lot

Edit: btw to run Java Servlets on the server. Do I need to install Apache Web Server, Apache Tomcat, or both, or neither?
Great people talk about ideas. Average people talk about things. Small people talk about other people.
G3CKO
Profile Blog Joined March 2009
Canada1430 Posts
October 28 2010 17:49 GMT
#428
I am a second year electrical engineer with knowledge in C and java. Although I can offer general programming help as well.
┌⋉⊳∀⊲) ☆ If your soul has not truly given up, then you can hear the sound that races through the end of the world.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
November 11 2010 11:40 GMT
#429
I am a second year Computer Science major and i'd like to ask for some help on checking on my homework, my professor on Data Structures asked us to make an algorithm on how you can insert data at the end of a given list, middle of the list and at the beginning. Here's my algo:
+ Show Spoiler +

End of the list:
while (list[i] is not null)
do i++
end do
list[i] = data

Beginning of the list:
while (list[i] is not null)
do i++
end do
while (i is not zero)
do list[i+1] = list[i]
i--
end do
list[i] = data

Middle of the list:
while (list[i] is not null)
do i++
end do
while (i is not i/2)
do list[i+1] = list[i]
i--
end do
list[i] = data

Is this correct?
I'd like to improve on it as well but that's all i've got. Thanks a lot
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
swat
Profile Blog Joined January 2008
Australia142 Posts
November 11 2010 13:57 GMT
#430
On November 11 2010 20:40 icystorage wrote:
+ Show Spoiler +

End of the list:
while (list[i] is not null)
do i++
end do
list[i] = data

Beginning of the list:
while (list[i] is not null)
do i++
end do
while (i is not zero)
do list[i+1] = list[i]
i--
end do
list[i] = data

Middle of the list:
while (list[i] is not null)
do i++
end do
while (i is not i/2)
do list[i+1] = list[i]
i--
end do
list[i] = data

Is this correct?
I'd like to improve on it as well but that's all i've got. Thanks a lot


For your beginning algorithm:

Assuming kinda pseudo code, allowed arrays of undefined length (so undefined length javascript arrays possibly), in this array there is no such thing as the terminating element \0 and cannot use an STL a better beginning algorithm is:

var prev = list[0];
var current;
var i=1; //so we skip the first item.
do while(list[i] is not null)
current = list[i];
list[i] = prev;
prev = current;
i++;
end do
list[i]=current
list[0] = newdata.

note: I also assume the array will at least have 2 elements (cbf error checking).

this will complete in 1 iteration of the array (while yours did 2 iterations forward, then backwards), so it is better performance wise, but not memory wise (as I use 2 temp variables which you wouldn't of). but the use of 2 more variables will be moot compared to the performance savings when you get to larger arrays.

Your middle of the array will not work either because of these 2 lines:
while (i is not i/2)
i--
your i variable would be changing constantly... so if you started at lets say 20 it would be like...
20 /2 = 10 i is at 20 is its fine...
by the time it got to 10 it would be
10/2 = 5 i is at 10 so were fine.
etc etc.

to make yours work you would need to do
while (list[i] is not null)
do i++
end do
n = i/2
while (i > n)
do list[i+1] = list[i]
i--
end do
list[i] = data

I changed your 2nd while to > because if you had a odd number array (lets say 11) and did n/2 you would get 5.5 (unless it went to all full numbers then it wouldn't matter) the loop would go on forever.

Hope this helps.
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
November 11 2010 14:05 GMT
#431
i have taken note on your corrections especially on my 'middle' algorithm, i/2 shouldve been n/2 where n is the number of elements on the array and also on the 2nd while,and also on my beginning algo, i never thought of it that way, thank you very much
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
BisuDagger
Profile Blog Joined October 2009
Bisutopia19297 Posts
November 11 2010 14:31 GMT
#432
Hoping to be Helpful. PM me if u ever need my help or if u want me to address your code on this forum. I"m a C++ programmer.
ModeratorFormer Afreeca Starleague Caster: http://afreeca.tv/ASL2ENG2
catamorphist
Profile Joined May 2010
United States297 Posts
November 11 2010 14:39 GMT
#433
On November 11 2010 20:40 icystorage wrote:
I am a second year Computer Science major and i'd like to ask for some help on checking on my homework, my professor on Data Structures asked us to make an algorithm on how you can insert data at the end of a given list, middle of the list and at the beginning. Here's my algo:


Tip on clarity -- it looks like you're using an automatically-resizing array with efficient random access; the term of art for that is "vector." When you say "list" that might imply multiple things, a linked list foremost among them.
http://us.battle.net/sc2/en/profile/281144/1/catamorphist/
mcc
Profile Joined October 2010
Czech Republic4646 Posts
November 11 2010 14:39 GMT
#434
On November 11 2010 20:40 icystorage wrote:
I am a second year Computer Science major and i'd like to ask for some help on checking on my homework, my professor on Data Structures asked us to make an algorithm on how you can insert data at the end of a given list, middle of the list and at the beginning. Here's my algo:
+ Show Spoiler +

End of the list:
while (list[i] is not null)
do i++
end do
list[i] = data

Beginning of the list:
while (list[i] is not null)
do i++
end do
while (i is not zero)
do list[i+1] = list[i]
i--
end do
list[i] = data

Middle of the list:
while (list[i] is not null)
do i++
end do
while (i is not i/2)
do list[i+1] = list[i]
i--
end do
list[i] = data

Is this correct?
I'd like to improve on it as well but that's all i've got. Thanks a lot


Well do you have to implement the list as array ? If not you can use more memory intensive structure where each element has the value and a pointer to the next element. You just need to keep pointers to first and last element of the list in 2 variables. In this case adding to the beginning of the list and at the end of the list are "atomic" operations that do not require traversing the array, and only inserting in the middle requires that(you will need 3rd variable to keep the length of the list to do that easily).

Pseudocode will be something like :
+ Show Spoiler +

var beginning;
var end;
var len;

//adding in the beginning
var temp = new node(data);
temp.next = beginning;
beginning = temp;
len++;
if (temp.next == null) end=beginning; //it was the first element on the list

//adding at the end
var temp = new node(data);
if (end != null) end.next = temp;
end = temp;
len++;
if (beginning == null) beginning =end; //it was the first element on the list

//adding in the middle (just a structure, needs to be polished to actually work)
var iter = beginning;
for (i = 0; i < len/2; i++)
{
iter = iter.next;
}
var temp = new node(data);
var nnode = iter.next;
iter.next = temp;
temp.next = nnode;

mcc
Profile Joined October 2010
Czech Republic4646 Posts
November 11 2010 14:45 GMT
#435
Actually now that I think about it, you don't need len variable , just add new variable that points to the middle of the list and all your operations will be O(1), total win )
icystorage
Profile Blog Joined November 2008
Jollibee19350 Posts
November 11 2010 14:53 GMT
#436
the term in my uni is just starting so i think we're just on the basics of data structures but i really appreciate the help you guys give!
LiquidDota StaffAre you ready for a Miracle-? We are! The International 2017 Champions!
catamorphist
Profile Joined May 2010
United States297 Posts
November 11 2010 18:20 GMT
#437
On November 11 2010 23:45 mcc wrote:
Actually now that I think about it, you don't need len variable , just add new variable that points to the middle of the list and all your operations will be O(1), total win )


Inserting into the middle of a linked list isn't constant time. You need to traverse it one node at a time until you get to the position in the middle at which you want to insert.
http://us.battle.net/sc2/en/profile/281144/1/catamorphist/
Craton
Profile Blog Joined December 2009
United States17264 Posts
November 11 2010 19:08 GMT
#438
Yeah, newbie!

+ Show Spoiler +
One of these days I'll actually learn myself the time thingys. :-P
twitch.tv/cratonz
mcc
Profile Joined October 2010
Czech Republic4646 Posts
November 11 2010 20:17 GMT
#439
On November 12 2010 03:20 catamorphist wrote:
Show nested quote +
On November 11 2010 23:45 mcc wrote:
Actually now that I think about it, you don't need len variable , just add new variable that points to the middle of the list and all your operations will be O(1), total win )


Inserting into the middle of a linked list isn't constant time. You need to traverse it one node at a time until you get to the position in the middle at which you want to insert.

If you are adding always exactly in the middle I do not think you really need to traverse. If you keep a pointer to the middle node and after it is done move that pointer to the new node or keep it at the same node depending if the length of the list is even or not. But I was wrong about not needing a length variable, you need it to determine if you need to move the middle pointer or not. You do not really need a length, a bit flag for even/not even would suffice.

You need to traverse only if you search for values, or you want sorted list and staff like that. Inserting at a fixed given position is I think O(1).
catamorphist
Profile Joined May 2010
United States297 Posts
Last Edited: 2010-11-11 21:46:10
November 11 2010 21:45 GMT
#440
On November 12 2010 05:17 mcc wrote:
Show nested quote +
On November 12 2010 03:20 catamorphist wrote:
On November 11 2010 23:45 mcc wrote:
Actually now that I think about it, you don't need len variable , just add new variable that points to the middle of the list and all your operations will be O(1), total win )


Inserting into the middle of a linked list isn't constant time. You need to traverse it one node at a time until you get to the position in the middle at which you want to insert.

If you are adding always exactly in the middle I do not think you really need to traverse. If you keep a pointer to the middle node and after it is done move that pointer to the new node or keep it at the same node depending if the length of the list is even or not. But I was wrong about not needing a length variable, you need it to determine if you need to move the middle pointer or not. You do not really need a length, a bit flag for even/not even would suffice.

You need to traverse only if you search for values, or you want sorted list and staff like that. Inserting at a fixed given position is I think O(1).


OK, yeah, it would be constant time if you decided to keep track of the middle. Sorry for misreading.
http://us.battle.net/sc2/en/profile/281144/1/catamorphist/
Prev 1 20 21 22 23 24 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 57m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 572
BRAT_OK 90
Codebar 45
Livibee 33
StarCraft: Brood War
Jaedong 1495
GuemChi 1465
EffOrt 1325
Stork 698
Light 607
Larva 417
Snow 411
Mini 356
Rush 223
Barracks 222
[ Show more ]
Leta 119
hero 112
sSak 111
Sea.KH 51
JYJ47
Aegong 37
Backho 34
sorry 29
zelot 26
soO 23
HiyA 15
Terrorterran 14
scan(afreeca) 12
Bale 9
Dota 2
qojqva3387
420jenkins258
syndereN218
Other Games
singsing2113
Sick375
DeMusliM361
crisheroes346
Lowko284
Hui .257
Liquid`VortiX154
oskar118
KnowMe99
XcaliburYe58
QueenE30
Trikslyr12
Organizations
Counter-Strike
PGL195
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Michael_bg 4
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2399
• WagamamaTV457
League of Legends
• Nemesis4222
• Jankos3067
• TFBlade809
Upcoming Events
LAN Event
1h 57m
Lambo vs Harstem
FuturE vs Maplez
Scarlett vs FoxeR
Gerald vs Mixu
Zoun vs TBD
Clem vs TBD
ByuN vs TBD
TriGGeR vs TBD
Korean StarCraft League
10h 57m
CranKy Ducklings
17h 57m
IPSL
1d 1h
dxtr13 vs OldBoy
Napoleon vs Doodle
LAN Event
1d 1h
BSL 21
1d 3h
Gosudark vs Kyrie
Gypsy vs Sterling
UltrA vs Radley
Dandy vs Ptak
Replay Cast
1d 6h
Sparkling Tuna Cup
1d 17h
WardiTV Korean Royale
1d 19h
IPSL
2 days
JDConan vs WIZARD
WolFix vs Cross
[ Show More ]
LAN Event
2 days
BSL 21
2 days
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
Replay Cast
2 days
Wardi Open
2 days
WardiTV Korean Royale
3 days
Replay Cast
4 days
Kung Fu Cup
4 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
5 days
The PondCast
5 days
RSL Revival
5 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
6 days
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
Stellar Fest: Constellation Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual

Upcoming

BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
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.