• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 22:08
CET 04:08
KST 12:08
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
RSL Season 3: RO16 results & RO8 bracket12Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA12
StarCraft 2
General
RSL Season 3: RO16 results & RO8 bracket SC: Evo Complete - Ranked Ladder OPEN ALPHA RSL Season 3 - Playoffs Preview Mech is the composition that needs teleportation t GM / Master map hacker and general hacking and cheating thread
Tourneys
RSL Revival: Season 3 $5,000+ WardiTV 2025 Championship StarCraft Evolution League (SC Evo Biweekly) Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
Data analysis on 70 million replays A cwal.gg Extension - Easily keep track of anyone soO on: FanTaSy's Potential Return to StarCraft [ASL20] Ask the mapmakers — Drop your questions FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] GosuLeague T1 Ro16 - Tue & Thu 22:00 CET [BSL21] RO16 Tie Breaker - Group B - Sun 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread EVE Corporation Path of Exile [Game] Osu! Should offensive tower rushing be viable in RTS games?
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
Mafia Game Mode Feedback/Ideas
Community
General
Russo-Ukrainian War Thread The Games Industry And ATVI US Politics Mega-thread Things Aren’t Peaceful in Palestine About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread Korean Music Discussion
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
The Health Impact of Joining…
TrAiDoS
Dyadica Evangelium — Chapt…
Hildegard
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1492 users

The Big Programming Thread - Page 166

Forum Index > General Forum
Post a Reply
Prev 1 164 165 166 167 168 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.
tofucake
Profile Blog Joined October 2009
Hyrule19158 Posts
September 11 2012 19:54 GMT
#3301
That sounds more like a placement firm than a consulting company. But go for it if it's free. Free training and someone getting you interviews is good.
Liquipediaasante sana squash banana
Craton
Profile Blog Joined December 2009
United States17269 Posts
September 12 2012 00:44 GMT
#3302
Seems a bit shady that you'd get a call out of the blue offering to train and then place you for free.
twitch.tv/cratonz
billy5000
Profile Blog Joined December 2010
United States865 Posts
September 12 2012 05:48 GMT
#3303
I'm thinking about pre-ordering Hacker's Delight 2nd edition because I've heard so many good things about it in terms of optimizing code. But I'm not too sure if I'm experienced enough to get the most out of it. I took a semester's worth of cs class using java and taught myself C using learncodethehardway. I've also been keeping up with algorithms and data structures course on coursera, so I'm pretty familiar with basic java implementations of basic data structures. Would you recommend this book?
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
SiPa
Profile Joined July 2010
Germany129 Posts
Last Edited: 2012-09-12 15:04:24
September 12 2012 13:09 GMT
#3304
Havent done a question in a while... well here it goes:
+ Show Spoiler +

I'm working a c++ Project with Microsoft Visual Studio 2010.
I want to use System::Diagnostics::Stopwatch(http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx).
What do I have to include/change in my project to use that? Any properties? It doesnt know "System" :S

It's .Net, but I've successfully included ppl. (.net library)...


Edit: Let me rephrase that (and nvm the above part):
I need to compare 2 Programs on how long they take. For that, any processes/threads running in the background should be taken into consideration, meaning no matter how many threads run in the background, the 2 programs (and their time taken til completion) should be comparable. Any suggestions, or what words i should google/what frameworks to use? (CPU time? processing time?)

Edit2:http://evilzone.org/code-library/%28c%29-timing-cpu-usage/

Edit3: I hope some1 will still read this! I tried the link in Edit2, but it looks like it's not working the way I want. I want it to display the same time, no matter how busy the CPU is when i execute my program. (Meaning: only Program and Windows are running, program outputs: "i took 2 seconds". Program and Windows and a Hundred other Programs are running, program outputs: "i took 2 seconds".)
Glowbox
Profile Joined June 2010
Netherlands330 Posts
September 12 2012 13:19 GMT
#3305
Are you using managed C++ or native C++? In case of native C++, you can't use that. There are plenty of stopwatch classes available online....
heishe
Profile Blog Joined June 2009
Germany2284 Posts
September 12 2012 13:26 GMT
#3306
Also, in Native C++, there's also std::chrono (#include <chrono>).
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
SiPa
Profile Joined July 2010
Germany129 Posts
September 13 2012 07:41 GMT
#3307
On September 12 2012 22:09 SiPa wrote:
Havent done a question in a while... well here it goes:
+ Show Spoiler +

I'm working a c++ Project with Microsoft Visual Studio 2010.
I want to use System::Diagnostics::Stopwatch(http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx).
What do I have to include/change in my project to use that? Any properties? It doesnt know "System" :S

It's .Net, but I've successfully included ppl. (.net library)...


Edit: Let me rephrase that (and nvm the above part):
I need to compare 2 Programs on how long they take. For that, any processes/threads running in the background should be taken into consideration, meaning no matter how many threads run in the background, the 2 programs (and their time taken til completion) should be comparable. Any suggestions, or what words i should google/what frameworks to use? (CPU time? processing time?)

Edit2:http://evilzone.org/code-library/%28c%29-timing-cpu-usage/

Edit3: I hope someone will still read this! I tried the link in Edit2, but it looks like it's not working the way I want. I want it to display the same time, no matter how busy the CPU is when i execute my program. (Meaning: only program and windows are running, program outputs: "i took 2 seconds". Program and Windows and a hundred other programs are running, program outputs: "i took 2 seconds".)


Kinda need to bump this, since I havent found an answer yet.
darmousseh
Profile Blog Joined May 2010
United States3437 Posts
September 13 2012 08:11 GMT
#3308
Have any of you guys started using NodeJs yet? It looks really exciting. Coming from the ruby on rails world, nodejs looks to me like it's the next Big Thing in the web developer world. What are your guy's thoughts?
Developer for http://mtgfiddle.com
tec27
Profile Blog Joined June 2004
United States3702 Posts
September 13 2012 09:01 GMT
#3309
On September 13 2012 17:11 darmousseh wrote:
Have any of you guys started using NodeJs yet? It looks really exciting. Coming from the ruby on rails world, nodejs looks to me like it's the next Big Thing in the web developer world. What are your guy's thoughts?

I use it for basically everything that I can. I really enjoy it, but I don't think its for everyone. I also don't know that its really the 'Next Big Thing'. The nice thing about node is that the core libraries are kept really small and clean, so you can keep really fine-grained control over what you're using and how you're using it. Can't really say the same for Rails, which has become pretty bloated and large at this point.

Node's like this weird mix of low-level programming with a high level language. Seems really strange, but I really love using it.

PS: Not sure how in-depth you've gotten into node, but if you ever need something to listen to, the NodeUp podcast is quite excellent and educational to boot!: http://nodeup.com/
Can you jam with the console cowboys in cyberspace?
heishe
Profile Blog Joined June 2009
Germany2284 Posts
Last Edited: 2012-09-13 11:31:27
September 13 2012 11:29 GMT
#3310
On September 13 2012 16:41 SiPa wrote:
Show nested quote +
On September 12 2012 22:09 SiPa wrote:
Havent done a question in a while... well here it goes:
+ Show Spoiler +

I'm working a c++ Project with Microsoft Visual Studio 2010.
I want to use System::Diagnostics::Stopwatch(http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx).
What do I have to include/change in my project to use that? Any properties? It doesnt know "System" :S

It's .Net, but I've successfully included ppl. (.net library)...


Edit: Let me rephrase that (and nvm the above part):
I need to compare 2 Programs on how long they take. For that, any processes/threads running in the background should be taken into consideration, meaning no matter how many threads run in the background, the 2 programs (and their time taken til completion) should be comparable. Any suggestions, or what words i should google/what frameworks to use? (CPU time? processing time?)

Edit2:http://evilzone.org/code-library/%28c%29-timing-cpu-usage/

Edit3: I hope someone will still read this! I tried the link in Edit2, but it looks like it's not working the way I want. I want it to display the same time, no matter how busy the CPU is when i execute my program. (Meaning: only program and windows are running, program outputs: "i took 2 seconds". Program and Windows and a hundred other programs are running, program outputs: "i took 2 seconds".)


Kinda need to bump this, since I havent found an answer yet.


Have you read what I wrote? Just use the stuff in std::chrono (cplusplus.com as a reference) and measure the time manually in each thread.

edit: Of course, this only works if you're not using C++/CLI.
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
SiPa
Profile Joined July 2010
Germany129 Posts
Last Edited: 2012-09-13 12:09:22
September 13 2012 12:03 GMT
#3311
Ok nvm the PMs.
I've tried chrono now.
Empty project in Visual Studio 2010 --> Included the Inlcude-Folder from Visual Studio 2012 (since there was a chrono in there) --> tried to use chrono --> compiler errors.
Compiled it with Visual Studio 2012 now, lets see if it does what I want it to do...

Edit: Just tested. Worked just as good as ctime (clock_t) meaning it didnt do, what I wanted it to do, meaning the time (or whatever elapsed.count() returns) differs, depending on how many instances of this program are running at one time.
Also I've tried Steady_clock, system_clock and highres_clock
heishe
Profile Blog Joined June 2009
Germany2284 Posts
September 13 2012 12:53 GMT
#3312
Oh, I totally misread what you want to do.

But now I don't understand what you want to do. Why don't you just print " I took 2 seconds" then?

Or are you having the program that one instance needs longer than the other?
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
September 13 2012 14:28 GMT
#3313
On September 13 2012 21:03 SiPa wrote:
Ok nvm the PMs.
I've tried chrono now.
Empty project in Visual Studio 2010 --> Included the Inlcude-Folder from Visual Studio 2012 (since there was a chrono in there) --> tried to use chrono --> compiler errors.
Compiled it with Visual Studio 2012 now, lets see if it does what I want it to do...

Edit: Just tested. Worked just as good as ctime (clock_t) meaning it didnt do, what I wanted it to do, meaning the time (or whatever elapsed.count() returns) differs, depending on how many instances of this program are running at one time.
Also I've tried Steady_clock, system_clock and highres_clock


So what you want is the actual time the CPU worked on this instance of your program, not the time it was running in total?

I only know how to do that on Linux in a non-portable way, so i googled it for windows and found this:
http://nadeausoftware.com/articles/2012/03/c_c_tip_how_measure_cpu_time_benchmarking
which pointed me to
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683223(v=vs.85).aspx

I don't know if that does the job but it sounds more like it.
SiPa
Profile Joined July 2010
Germany129 Posts
September 13 2012 14:33 GMT
#3314
For anyone who cares: I will try out
http://www.philosophicalgeek.com/2009/01/03/determine-cpu-usage-of-current-process-c-and-c/
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683223(v=vs.85).aspx
http://nadeausoftware.com/articles/2012/03/c_c_tip_how_measure_cpu_time_benchmarking
tomorrow. Will tell you more by then. Thx for answers!
SiPa
Profile Joined July 2010
Germany129 Posts
September 14 2012 10:07 GMT
#3315
Ok. So far I've tried GetCurrentProcess and GetCurrentThread with little results. (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms683237(v=vs.85).aspx)
atm i'm getting Zeros in lpExitTime, whenever I call GetThreadTimes.
I guess it's because the thread specified with
HANDLE self;
self = GetCurrentThread();
has not ended yet. How do I get a thread to end thou?
Have tried the same with GetProcessTimes and got the same result.
Fyi: I'm parallelizing some stuff and have alot of loops. If I want the Threads used in a Loop, where do I have to put the self=GetCurrentThread() or =GetCurrentProcess() to represent the loop-thread/process?
Andin
Profile Joined September 2012
United States6 Posts
September 14 2012 12:35 GMT
#3316
What music do you guys like to listen to when you code?

Personally, if it sounds good and doesn't have lyrics I'll play it. The general trend for me is something electronic.

Albums/Artists I've been writing to recently:
>> Tron: Legacy soundtrack
>> Kavinsky (all of his work)
>> Ocean's 13 soundtrack
>> Portal 2 soundtrack
>> Team Fortress 2 menu music
>> Explosions in the Sky

And for you Doctor Who fans, forty minutes of sweet epicness.
We have a saying for that in Beldur...
heishe
Profile Blog Joined June 2009
Germany2284 Posts
September 14 2012 13:15 GMT
#3317
On September 14 2012 19:07 SiPa wrote:
Ok. So far I've tried GetCurrentProcess and GetCurrentThread with little results. (http://msdn.microsoft.com/en-us/library/windows/desktop/ms683179%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/ms683237(v=vs.85).aspx)
atm i'm getting Zeros in lpExitTime, whenever I call GetThreadTimes.
I guess it's because the thread specified with
HANDLE self;
self = GetCurrentThread();
has not ended yet. How do I get a thread to end thou?
Have tried the same with GetProcessTimes and got the same result.
Fyi: I'm parallelizing some stuff and have alot of loops. If I want the Threads used in a Loop, where do I have to put the self=GetCurrentThread() or =GetCurrentProcess() to represent the loop-thread/process?


You could try explaining why you need to do the thing you want to do. Maybe there's another way than to use the scheduled time that the process gets (I can't think of anything where you might need that).
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
SiPa
Profile Joined July 2010
Germany129 Posts
September 14 2012 13:53 GMT
#3318
I basically need "time program takes to get from line a to line b".
This time should never change, no matter how many other programs i execute at the same time.
I might have already mentioned, that I will try/am trying to use System::Diagnostics::Stopwatch.
Wish me luck
tofucake
Profile Blog Joined October 2009
Hyrule19158 Posts
September 14 2012 13:58 GMT
#3319
On September 14 2012 21:35 Andin wrote:
What music do you guys like to listen to when you code?

Personally, if it sounds good and doesn't have lyrics I'll play it. The general trend for me is something electronic.

Albums/Artists I've been writing to recently:
>> Tron: Legacy soundtrack
>> Kavinsky (all of his work)
>> Ocean's 13 soundtrack
>> Portal 2 soundtrack
>> Team Fortress 2 menu music
>> Explosions in the Sky

And for you Doctor Who fans, forty minutes of sweet epicness.

I run a pandora station comprised of Electronica, Classic Rock, occasional Dubstep.
Liquipediaasante sana squash banana
phar
Profile Joined August 2011
United States1080 Posts
Last Edited: 2012-09-14 22:39:06
September 14 2012 22:32 GMT
#3320
On September 13 2012 17:11 darmousseh wrote:
Have any of you guys started using NodeJs yet? It looks really exciting. Coming from the ruby on rails world, nodejs looks to me like it's the next Big Thing in the web developer world. What are your guy's thoughts?

If you are looking to write server or backend code, I strongly suggest you use something that is more scalable, and offers better concurrency and performance than NodeJs. While I can appreciate the need for javascript on the frontend, using it elsewhere does not seem like a good idea.

If you want to use something new and shiny, I suppose you could take a look at Go. There'll be a bit of a learning curve to get used to the syntax & style if you're coming from a js/RoR background, but it'd be worth it in the end.

NodeJs will certainly be easier for you if you're used to ruby on rails, so if you're just messing around with personal projects, it'll work just fine.

On September 14 2012 21:35 Andin wrote:What music do you guys like to listen to when you code?

When I'm doing something that actually requires design and thought? Nothing.
When I'm cranking out code or tests that I've already got "finished" in my head, or going through debugging? Anything from Stravinsky to Brother Ali.

Now that you mention it, Pandora has apparently bugged out on me and is playing A Tribe Called Quest followed by Cut Chemist at the same time as Liszt. It sounds... not good.
Who after all is today speaking about the destruction of the Armenians?
Prev 1 164 165 166 167 168 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 4h 22m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 254
PiLiPiLi 4
EnDerr 1
StarCraft: Brood War
PianO 431
Sexy 49
NaDa 31
Leta 26
Noble 18
Dota 2
NeuroSwarm101
canceldota27
LuMiX1
League of Legends
JimRising 599
Super Smash Bros
C9.Mang0305
Other Games
summit1g14434
fl0m648
WinterStarcraft410
ViBE173
Trikslyr68
kaitlyn33
ToD16
Organizations
Other Games
gamesdonequick884
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 108
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• Azhi_Dahaki33
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota22294
League of Legends
• Doublelift4785
• Rush1019
Other Games
• Scarra1347
Upcoming Events
RSL Revival
4h 22m
Classic vs MaxPax
SHIN vs Reynor
herO vs Maru
WardiTV Korean Royale
8h 52m
SC Evo League
9h 22m
IPSL
13h 52m
Julia vs Artosis
JDConan vs DragOn
OSC
13h 52m
BSL 21
16h 52m
TerrOr vs Aeternum
HBO vs Kyrie
RSL Revival
1d 4h
Wardi Open
1d 10h
IPSL
1d 16h
StRyKeR vs OldBoy
Sziky vs Tarson
BSL 21
1d 16h
StRyKeR vs Artosis
OyAji vs KameZerg
[ Show More ]
OSC
1d 19h
OSC
2 days
Monday Night Weeklies
2 days
OSC
2 days
Wardi Open
3 days
Replay Cast
4 days
Wardi Open
4 days
Tenacious Turtle Tussle
4 days
The PondCast
5 days
Replay Cast
5 days
LAN Event
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-11-16
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 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.