• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:58
CEST 03:58
KST 10:58
  • 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] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy18ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book20
Community News
$5,000 WardiTV TLMC tournament - Presented by Monster Energy1GSL CK: More events planned pending crowdfunding0Weekly Cups (May 30-Apr 5): herO, Clem, SHIN win0[BSL22] RO32 Group Stage4Weekly Cups (March 23-29): herO takes triple6
StarCraft 2
General
BGE Stara Zagora 2026 cancelled Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Weekly Cups (May 30-Apr 5): herO, Clem, SHIN win Rongyi Cup S3 - Preview & Info Team Liquid Map Contest #22 - Presented by Monster Energy
Tourneys
RSL Season 4 announced for March-April $5,000 WardiTV TLMC tournament - Presented by Monster Energy Sea Duckling Open (Global, Bronze-Diamond) GSL CK: More events planned pending crowdfunding Sparkling Tuna Cup - Weekly Open Tournament
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 # 520 Moving Fees Mutation # 519 Inner Power Mutation # 518 Radiation Zone
Brood War
General
so ive been playing broodwar for a week straight. Gypsy to Korea ASL21 General Discussion Pros React To: JaeDong vs Queen [BSL22] RO32 Group Stage
Tourneys
[BSL22] RO32 Group B - Sunday 21:00 CEST [BSL22] RO32 Group A - Saturday 21:00 CEST 🌍 Weekly Foreign Showmatches [Megathread] Daily Proleagues
Strategy
Muta micro map competition Fighting Spirit mining rates What's the deal with APM & what's its true value Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game General RTS Discussion Thread Nintendo Switch Thread Darkest Dungeon
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine European Politico-economics QA Mega-thread Canadian Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Loot Boxes—Emotions, And Why…
TrAiDoS
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
ASL S21 English Commentary…
namkraft
Electronics
mantequilla
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1872 users

The Big Programming Thread - Page 340

Forum Index > General Forum
Post a Reply
Prev 1 338 339 340 341 342 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.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
August 11 2013 00:12 GMT
#6781
Thanks for providing discussion to the non-discussion.
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2013-08-11 00:21:09
August 11 2013 00:14 GMT
#6782
For most cases where you would see hard-coded bounds in code though, I feel like you would need to tell the programmer about variables first, and confuse his poor mind with Big O notations second :D.

And I raise my glass to some temporal model checking algorithm I saw in class like a year ago. Mofo had a complexity in towers of exponential, couldn't get him to end from N=3 on, or something.
Computer science.
It works.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
August 11 2013 00:19 GMT
#6783
.. the original argument was simply that removing the overhead on the loop made the code look more awkward because instead of (0,1), (0,2) ... (10,1), (10,2).... you would see like (0,1) (1,0), (0,2), (2,0) which sacrifices easy readability and more modular code for something that didn't really make sense to optimize for, especially since there were no issues in the first place.

Then someone used big-O and we went way off the end. ^^


As it stands my point still holds - it's a bit more convoluted to do it the second way, but it makes a lot of sense intuitively, and has a decent performance benefit to switching over.
There is no one like you in the universe.
one-one-one
Profile Joined November 2011
Sweden551 Posts
August 11 2013 00:19 GMT
#6784
On August 11 2013 09:14 ZenithM wrote:
For most cases where you would see hard-coded bounds in code though, I feel like you would need to tell the programmer about variables first, and confuse his poor mind with Big O notations second :D.


Yeah.

In real projects you rarely see "textbook examples" of a known complexity class. In reality the situation is way more complex.
To do it properly you have to consider the complexity of any data structure you use and any function you call in your algorithm. And as I pointed out before, big O notation is all about asymptotical behavior, which might be completely irrelevant anyways.
http://www.youtube.com/watch?feature=player_embedded&v=1BFY4R7IIP4#t=1710s
3FFA
Profile Blog Joined February 2010
United States3931 Posts
August 11 2013 00:21 GMT
#6785
Why do I feel like this would be a perfect way to confuse someone in an interview? "here, look at this excerpt from a website's forum. Read what they say, then explain to me what they just said post by post."
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2013-08-11 01:03:14
August 11 2013 01:02 GMT
#6786
Situations like this make me think Computer Science isn't ready to be considered science yet. I may be wrong though, it just feels to me CS isn't hardcore science because lots of things can be interpreted as you like.
DeltaX
Profile Joined August 2011
United States287 Posts
August 11 2013 02:17 GMT
#6787
I see computer science being much closer to mathematics and engineering than natural sciences. I see "science" as more of a method of discovery and search for the unknown. CS does not really look for the unknown in that way. Computer science just feel more like math in that you look to prove things like complexity of algorithms, and look for ways to improve them which is basically engineering.

I also am trying to only talk about computer science and not programming in general here.
tec27
Profile Blog Joined June 2004
United States3702 Posts
August 11 2013 02:47 GMT
#6788
On August 11 2013 09:19 Blisse wrote:
.. the original argument was simply that removing the overhead on the loop made the code look more awkward because instead of (0,1), (0,2) ... (10,1), (10,2).... you would see like (0,1) (1,0), (0,2), (2,0) which sacrifices easy readability and more modular code for something that didn't really make sense to optimize for, especially since there were no issues in the first place.

Then someone used big-O and we went way off the end. ^^


As it stands my point still holds - it's a bit more convoluted to do it the second way, but it makes a lot of sense intuitively, and has a decent performance benefit to switching over.

Its convoluted and there's absolutely zero point to ever doing it. The compiler can unroll loops just fine on its own, I'm not sure why you would want to half-unroll it. Not to mention that it was already said that the application wasn't time critical. In such situations, clearer code should *always* be preferred.
Can you jam with the console cowboys in cyberspace?
phar
Profile Joined August 2011
United States1080 Posts
August 11 2013 03:16 GMT
#6789
On August 11 2013 10:02 darkness wrote:
Situations like this make me think Computer Science isn't ready to be considered science yet. I may be wrong though, it just feels to me CS isn't hardcore science because lots of things can be interpreted as you like.

There is real computer science. That's mostly restricted to academia. Most people who study computer science in school end up doing software engineering/dev, not computer science.
Who after all is today speaking about the destruction of the Armenians?
nunez
Profile Blog Joined February 2011
Norway4003 Posts
August 11 2013 03:27 GMT
#6790
On August 11 2013 09:06 Morfildur wrote:
Oh my god, what have i started.

Does it really matter? Let's just agree that it's O(N) with N being 1 and both sides are right.


1-1-1 is right, the rest is wrong. your algorithm does not have a variable, n, just because it has some hard coded loop in it...
conspired against by a confederacy of dunces.
One Student
Profile Joined April 2011
73 Posts
August 11 2013 05:08 GMT
#6791
I just graduated with BS in CS and started working with a company. Thing is they threw me in the deep end and expect a lot from me because of my gpa. My colleagues who have been working on the project for months are cashing in their days off and are leaving for a month or two. We have a deadline in two months and I got stuck with everything. Basically we are working on machine learning/data mining to come up with a model to predict the failure of a particular device in the field. I have no idea how to go on about this as the only thing close I took in college was AI and Fundamental Statistics. Because of the tight deadline I'm not sure if I should read this book:

http://www.amazon.com/gp/product/1600490069

I wonder if anyone here has any advice on how to deal with this. Another problem is no one at my company has a lot of experience with this, I think it's their first time with machine learning and data modeling.
Depression is what you get for leading a repetitive life.
Kambing
Profile Joined May 2010
United States1176 Posts
August 11 2013 05:14 GMT
#6792
On August 11 2013 12:16 phar wrote:
Show nested quote +
On August 11 2013 10:02 darkness wrote:
Situations like this make me think Computer Science isn't ready to be considered science yet. I may be wrong though, it just feels to me CS isn't hardcore science because lots of things can be interpreted as you like.

There is real computer science. That's mostly restricted to academia. Most people who study computer science in school end up doing software engineering/dev, not computer science.


Virtually all software developers employ computer science skills on some level whether it be deep specializations in machine learning, algorithms, etc. or broadly exercising computational thinking skills.

"Real" computer science is vaguely defined because the field is so damn big. Some people practice pure theory that resembles mathematics more than a science. Others treat computers and software systems as physical phenomena, amendable to experimentation and explorative reason (e.g., hardware folk, practice-oriented security researchers).
Kambing
Profile Joined May 2010
United States1176 Posts
August 11 2013 05:16 GMT
#6793
On August 11 2013 14:08 One Student wrote:
I just graduated with BS in CS and started working with a company. Thing is they threw me in the deep end and expect a lot from me because of my gpa. My colleagues who have been working on the project for months are cashing in their days off and are leaving for a month or two. We have a deadline in two months and I got stuck with everything. Basically we are working on machine learning/data mining to come up with a model to predict the failure of a particular device in the field. I have no idea how to go on about this as the only thing close I took in college was AI and Fundamental Statistics. Because of the tight deadline I'm not sure if I should read this book:

http://www.amazon.com/gp/product/1600490069

I wonder if anyone here has any advice on how to deal with this. Another problem is no one at my company has a lot of experience with this, I think it's their first time with machine learning and data modeling.


Good luck with that. Machine learning is difficult but rewarding. You can also try Andrew Ng's course on coursera:

https://www.coursera.org/course/ml

You might find the content there more digestible than what the book offers (in addition to references to other top-notch resources).
ZenithM
Profile Joined February 2011
France15952 Posts
August 11 2013 09:52 GMT
#6794
On August 11 2013 10:02 darkness wrote:
Situations like this make me think Computer Science isn't ready to be considered science yet. I may be wrong though, it just feels to me CS isn't hardcore science because lots of things can be interpreted as you like.

Don't worry, CS is a science alright. You just don't see it on Teamliquid.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
August 11 2013 10:17 GMT
#6795
How about we just make everyone happy and actually specify what N is whenever we write O(f(N))?

If N is the length/height of the image, it's O(N^2), if N is the number of pixels, it's O(N), and if we assume a fixed image size it's O(1).

Saying something is O(f(N)) without specifying N is nonsense anyways. You usually can't omit it "because it's obvious" because there are many possible interpretations (as shown above).
If you have a good reason to disagree with the above, please tell me. Thank you.
one-one-one
Profile Joined November 2011
Sweden551 Posts
August 11 2013 11:24 GMT
#6796
On August 11 2013 19:17 spinesheath wrote:
How about we just make everyone happy and actually specify what N is whenever we write O(f(N))?

If N is the length/height of the image, it's O(N^2), if N is the number of pixels, it's O(N), and if we assume a fixed image size it's O(1).

Saying something is O(f(N)) without specifying N is nonsense anyways. You usually can't omit it "because it's obvious" because there are many possible interpretations (as shown above).


Yeah.

It is also important to not bring up asymptotic complexity when uncalled for.

This is a programming thread.
In most cases you care about raw performance. To express yourself in more fine grained terms you might use execution time, number of instructions, etc. which might be depend on one or more variable quantities.

When saying that something is O(n) or O(n log n), or whatever, you have most certainly made a number of idealizations that don't reflect how a modern computer actually works.
So instead of worrying about theoretical complexity you should focus on writing simple, reasonable code with good cache access patterns.

Or in the words of Linus Torvalds:
https://lkml.org/lkml/2008/5/7/456
http://www.youtube.com/watch?feature=player_embedded&v=1BFY4R7IIP4#t=1710s
Abominous
Profile Joined March 2013
Croatia1625 Posts
Last Edited: 2013-08-11 11:49:26
August 11 2013 11:47 GMT
#6797
On August 11 2013 14:08 One Student wrote:
I just graduated with BS in CS and started working with a company. Thing is they threw me in the deep end and expect a lot from me because of my gpa. My colleagues who have been working on the project for months are cashing in their days off and are leaving for a month or two. We have a deadline in two months and I got stuck with everything. Basically we are working on machine learning/data mining to come up with a model to predict the failure of a particular device in the field. I have no idea how to go on about this as the only thing close I took in college was AI and Fundamental Statistics. Because of the tight deadline I'm not sure if I should read this book:

http://www.amazon.com/gp/product/1600490069

I wonder if anyone here has any advice on how to deal with this. Another problem is no one at my company has a lot of experience with this, I think it's their first time with machine learning and data modeling.

My friend is in Machine Learning and he bought that book. He says he's satisfied with it however he says it does not come close to Yaser's lectures.

I think he has them on youtube, the entire course and he used to give certificates of completion, not anymore I think.

Also as someone suggested Ng's course on coursera is very helpful too. The thing is, they teach you mostly basics with easy implementation(At least the Ng's course). I think that real life implementation is a bit harder but a lot of people skip the basics and look ridiculous to experts then.

I'm not sure how much help will they provide you with that certain project (versus the time invested) but they will educate you really, really well and you can't put a pricetag on good education.

(In his course, Ng keeps repeating that people in Silicon Valley implement lots of learning techniques wrong and that by completion of his course you'd probably know more Machine Learning than most of the "experts" in Silicon Valley. Don't kid yourself, I think he's just being nice and trying to encourage you But I do think a lot of machine learning techniques are implemented in a wrong way due to poor understanding of the field itself.)
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2013-08-11 11:59:15
August 11 2013 11:59 GMT
#6798
On August 11 2013 11:47 tec27 wrote:
Show nested quote +
On August 11 2013 09:19 Blisse wrote:
.. the original argument was simply that removing the overhead on the loop made the code look more awkward because instead of (0,1), (0,2) ... (10,1), (10,2).... you would see like (0,1) (1,0), (0,2), (2,0) which sacrifices easy readability and more modular code for something that didn't really make sense to optimize for, especially since there were no issues in the first place.

Then someone used big-O and we went way off the end. ^^


As it stands my point still holds - it's a bit more convoluted to do it the second way, but it makes a lot of sense intuitively, and has a decent performance benefit to switching over.

Its convoluted and there's absolutely zero point to ever doing it. The compiler can unroll loops just fine on its own, I'm not sure why you would want to half-unroll it. Not to mention that it was already said that the application wasn't time critical. In such situations, clearer code should *always* be preferred.




It's not that convoluted to do half the iterations where on each iteration you two twice the actions and flip the x and y?

Then again, the grid doesn't seem to be a square, so I'm not certain it works this way, and I can't tell if it even works properly, which is the biggest problem with writing like that I guess.


Wait actually, I don't think that even offers any benefit. Hah you're right, yeah it doesn't. Statements retracted.
There is no one like you in the universe.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2013-08-11 15:52:14
August 11 2013 15:51 GMT
#6799
I need some help deciding whether to use a linked list or a dynamic array (or some other data structure).

Basically I have a config file that looks like this:

cat1
item1
item2
item3
#comment
cat2
item1
item2
....
catN
item1
...
itemN


Eventually I'll consider putting this in a db, though if I want the program I'm making to be shareable I may keep it like this since not everyone has MySQL installed on their machines.

I read the program in line by line, and right now I want a way to manipulate the contents of the config file.
Obviously, while I'm the only one using the program, I can edit the config file by hand and restart the app. But in the future if I want to share it, it'd be nice to give people a gui to edit and use the file dynamically.
[image loading]


I'm just not sure if this is the best approach. Maybe there's a simpler solution? Maybe Linked lists fail to address a performance issue?
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2013-08-11 16:06:43
August 11 2013 16:03 GMT
#6800
On August 12 2013 00:51 obesechicken13 wrote:
I need some help deciding whether to use a linked list or a dynamic array (or some other data structure).

Basically I have a config file that looks like this:

cat1
item1
item2
item3
#comment
cat2
item1
item2
....
catN
item1
...
itemN

+ Show Spoiler +

Eventually I'll consider putting this in a db, though if I want the program I'm making to be shareable I may keep it like this since not everyone has MySQL installed on their machines.

I read the program in line by line, and right now I want a way to manipulate the contents of the config file.
Obviously, while I'm the only one using the program, I can edit the config file by hand and restart the app. But in the future if I want to share it, it'd be nice to give people a gui to edit and use the file dynamically.
[image loading]


I'm just not sure if this is the best approach. Maybe there's a simpler solution? Maybe Linked lists fail to address a performance issue?


How many items are in the config file?
The correct answer is most likely: It does not matter, just pick the easy solution.

I usually go with a Dictionary/Associative array of arrays, e.g. (C#) "Dictionary<String, List<String>>" or something similar.
Prev 1 338 339 340 341 342 1032 Next
Please log in or register to reply.
Live Events Refresh
Replay Cast
00:00
WardiTV Mondays #77
CranKy Ducklings133
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ViBE206
RuFF_SC2 155
ROOTCatZ 80
StarCraft: Brood War
GuemChi 6288
Artosis 670
NaDa 16
Dota 2
monkeys_forever488
capcasts245
NeuroSwarm96
League of Legends
JimRising 669
Counter-Strike
taco 619
Super Smash Bros
hungrybox425
Other Games
summit1g15947
Day[9].tv427
C9.Mang0419
Maynarde137
Mew2King59
Organizations
Other Games
gamesdonequick1204
BasetradeTV115
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• EnkiAlexander 64
• davetesta15
• CranKy Ducklings SOOP4
• IndyKCrew
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• LaughNgamezSOOP
• Kozan
StarCraft: Brood War
• HerbMon 34
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Doublelift4477
Other Games
• Scarra1137
• Day9tv427
Upcoming Events
The PondCast
8h 2m
CranKy Ducklings
22h 2m
WardiTV Team League
1d 9h
Replay Cast
1d 22h
CranKy Ducklings
2 days
WardiTV Team League
2 days
uThermal 2v2 Circuit
2 days
BSL
2 days
n0maD vs perroflaco
TerrOr vs ZZZero
MadiNho vs WolFix
DragOn vs LancerX
Sparkling Tuna Cup
3 days
WardiTV Team League
3 days
[ Show More ]
OSC
3 days
BSL
3 days
Sterling vs Azhi_Dahaki
Napoleon vs Mazur
Jimin vs Nesh
spx vs Strudel
Replay Cast
3 days
Replay Cast
4 days
Wardi Open
4 days
GSL
5 days
Replay Cast
6 days
Kung Fu Cup
6 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL Elite League 2026
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
StarCraft2 Community Team League 2026 Spring
Nations Cup 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
IEM Kraków 2026
BLAST Bounty Winter 2026

Upcoming

Escore Tournament S2: W2
IPSL Spring 2026
Escore Tournament S2: W3
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
RSL Revival: Season 5
WardiTV TLMC #16
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 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...

Disclosure: This page contains affiliate marketing links that support TLnet.

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.