• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 17:19
CET 23:19
KST 07:19
  • 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
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread ZeroSpace Megathread Nintendo Switch Thread The Perfect Game Path of Exile
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 TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1696 users

The Big Programming Thread - Page 466

Forum Index > General Forum
Post a Reply
Prev 1 464 465 466 467 468 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.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-04-12 00:10:12
April 12 2014 00:09 GMT
#9301
--- Nuked ---
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
Last Edited: 2014-04-12 00:38:45
April 12 2014 00:14 GMT
#9302
So, i spawn a new UI thread with

Messung = new Thread(messen);
Messung.IsBackground = true;
Messung.SetApartmentState(ApartmentState.STA);
Messung.Start();
Messung.Join();

private void messen()
{
dialog = new Form1();
dialog.Show();
Application.Run();




}

(just quick example)


from my thread. (dont ask -.-)

Is there a way to stop that thread and unload the form that runs in it when the parent thread in terminating?



Its a test application that runs tests on hardware and i want to pop up insctructorial pictures in my form, i got thato work.
Once they press a button, which raises some digital line in a device connected by USB, the window goes away. and the thread ends. This works now.

But i also want the window to go away when someone aborts the test, which means the parent thread terminates.
I thought the background property would do that for me.
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
April 12 2014 02:27 GMT
#9303
Hi,
I have the following C++ code:


string input;
do
getline(cin,input);
while (gtp_process_command(input));


For a program-to-program communication (GTP - http://www.lysator.liu.se/~gunnar/gtp/) protocol I thought the above inputreader would be enough. In short all commands by the the other program (the controller) come in form of a full line, and gtp_process_command is able to process those properly. All responses from my program are full lines as well.
When doing tests on a console, this also works fine... (the program discards faulty lines, properly responds to all commands given to it, etc)

But when I connect my program to a controller, an the controller sends multiple commands at once, my program simply ignores the 2nd command.

My guess is, that the second input line from the controller comes before my program is done processing the first line, and thus getline() somehow fails to catch the second input line...
If it is this, how to fix this problem?
If this can't be the case, and above code should under all circumstances catch all lines... well... then I at least know I have to search the bug elsewhere...

PS: of course gtp_process_command always gives back true, except the quit command was called, which wasn't the case here
Zocat
Profile Joined April 2010
Germany2229 Posts
Last Edited: 2014-04-12 04:57:54
April 12 2014 04:56 GMT
#9304
On April 12 2014 09:14 LaNague wrote:
So, i spawn a new UI thread with
+ Show Spoiler +

Messung = new Thread(messen);
Messung.IsBackground = true;
Messung.SetApartmentState(ApartmentState.STA);
Messung.Start();
Messung.Join();

private void messen()
{
dialog = new Form1();
dialog.Show();
Application.Run();




}


(just quick example)


from my thread. (dont ask -.-)

Is there a way to stop that thread and unload the form that runs in it when the parent thread in terminating?


I haven't done a lot of stuff with Forms recently.

Parent keeps a list of all spawned child threads? Then when parent closes (FormClosed, FormClosing, ...) you terminate them.
Children subscribe to parent closing event. Delegates.
You can look at Form.OwnedForms / Form.Owner properties. "When a form is owned by another form, it is closed or hidden with the owner form." (For some reason I didn't use that the last time I had a similar problem with Windows.)
Mr. Wiggles
Profile Blog Joined August 2010
Canada5894 Posts
April 12 2014 05:13 GMT
#9305
For those of you who aren't aware, Google Code Jam 2014 started earlier today. Google Code Jam is a programming contest put on by Google every year. In each round, you're given a set of problems, and you need to code a solution to those problems within the allotted time, and then test them against different inputs. It's pretty fun and there's not much pressure in the first round, so I'd recommend trying some of the problems if you're interested.

There's still something like 20 hours left in the qualifying round, so plenty of time to do a few problems and qualify.

code.google.com/codejam/
you gotta dance
billy5000
Profile Blog Joined December 2010
United States865 Posts
April 12 2014 07:14 GMT
#9306
I have a question regarding using copyrighted material. For example, I have an idea for an app and want to use a pokemon character. And the app will be free (if that changes anything). Would I be safe to do this?
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
MaGariShun
Profile Joined May 2010
Austria305 Posts
April 12 2014 08:12 GMT
#9307
On April 12 2014 16:14 billy5000 wrote:
I have a question regarding using copyrighted material. For example, I have an idea for an app and want to use a pokemon character. And the app will be free (if that changes anything). Would I be safe to do this?

I'm not that familiar with US law, but I don't think that it's legal except when it falls under Fair Use.
At least in the copyright I'm familiar with, the copyright holder holds all rights about use, reproduction and work integrity.

So I guess it depends on how you use it in your app. If it falls under fair use, you should be safe
Ethenielle
Profile Blog Joined December 2005
Norway1006 Posts
April 12 2014 09:24 GMT
#9308
4 minutes for that google codejam is insane.. the language you choose has to be pretty much in your fingertips for that.

Maybe I can excuse myself as being a hobbyist.... I saw the solution fast, but no way I could code it in time. No way.
Theres a fine line between fishing and just standing on the shore like an idiot.
japro
Profile Joined August 2010
172 Posts
April 12 2014 09:46 GMT
#9309
Uh it's not 4 minutes to write the program... You write the program, and then you get the input and have 4 minutes to feed it back the output you got.
Ethenielle
Profile Blog Joined December 2005
Norway1006 Posts
April 12 2014 10:06 GMT
#9310
Oh, haha... reading comprehension > me. Back to coding then!
Theres a fine line between fishing and just standing on the shore like an idiot.
norlock
Profile Joined March 2010
Netherlands918 Posts
April 12 2014 10:27 GMT
#9311
https://play.google.com/store/apps/details?id=nl.rvoortman.jerandtommy <-- our first project in android. We are very proud of it, of course it is not that good. But keep in mind this is first year stuff . I hopy some of you try it out.
Are you human?
teamamerica
Profile Blog Joined July 2010
United States958 Posts
Last Edited: 2014-04-12 11:46:10
April 12 2014 11:09 GMT
#9312
+ Show Spoiler +
For the Google Code Jam, in the number 3 example (Minesweeper): I can't understand how come the input case
2 2 1
Is impossible.

To my understanding of the problem, with a 2x2 grid and one mine, you'll automatically win if you don't click on the mine, right? Can't figure out what part of the problem I'm misunderstanding.

Wait nm I'm dumb.
RIP GOMTV. RIP PROLEAGUE.
Zocat
Profile Joined April 2010
Germany2229 Posts
April 12 2014 13:11 GMT
#9313
On April 12 2014 16:14 billy5000 wrote:
I have a question regarding using copyrighted material. For example, I have an idea for an app and want to use a pokemon character. And the app will be free (if that changes anything). Would I be safe to do this?


Short version: You should avoid such situations, so no.

Long version: Normally you are not allowed to use it. But there is this thing called "Fair Use". These are some guidelines (non profit, educational, academic, news reporting, criticism, ...) in which you can use copyrighted materials. Sadly they're just guidelines and you have no idea if your product is under Fair Use until you're in a court case.

Free isn't really relevant since the Fair Use clause is "Non Profit". What about ads i.e.? And even if it's completely non profit it might still not be Fair Use (only a court knows). And if it is for profit it might still be Fair Use .

The thing is, basically no one will care about your app, and in the case of it being really popular you might suddenly have a court case. Are you willing to risk that?
And if you really want to risk it you should probably talk to a lawyer in person, or at least ask in a forum which has lawyers frequenting
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
April 12 2014 14:14 GMT
#9314
On April 12 2014 22:11 Zocat wrote:
Show nested quote +
On April 12 2014 16:14 billy5000 wrote:
I have a question regarding using copyrighted material. For example, I have an idea for an app and want to use a pokemon character. And the app will be free (if that changes anything). Would I be safe to do this?


Short version: You should avoid such situations, so no.

Long version: Normally you are not allowed to use it. But there is this thing called "Fair Use". These are some guidelines (non profit, educational, academic, news reporting, criticism, ...) in which you can use copyrighted materials. Sadly they're just guidelines and you have no idea if your product is under Fair Use until you're in a court case.

Free isn't really relevant since the Fair Use clause is "Non Profit". What about ads i.e.? And even if it's completely non profit it might still not be Fair Use (only a court knows). And if it is for profit it might still be Fair Use .

The thing is, basically no one will care about your app, and in the case of it being really popular you might suddenly have a court case. Are you willing to risk that?
And if you really want to risk it you should probably talk to a lawyer in person, or at least ask in a forum which has lawyers frequenting


It sounds very vague indeed from what I've read on wikipedia as well. It's just a never ending way to earn/lose some money depending on which side you're. I think the best case is to ask author(s).
klo8
Profile Joined August 2010
Austria1960 Posts
April 12 2014 18:54 GMT
#9315
Alright, my Haskell thing now works, mostly. (it draws a Dragon curve) What really surprised me was how quickly I got the simulate function to work. It took me a while to wrap my mind around how to write the stepWorld and especially the draw (World -> Picture) function, but once I had those functions working, I just plugged them into simulate and everything worked instantly.
This post is clearly not a hurr, as you can see from the graph, the durr never intersects with the derp.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2014-04-12 19:42:12
April 12 2014 19:10 GMT
#9316
All right. I've got a Software Engineering Exam on Tuesday. Can someone explain to me what an Abstract Factory is?

I was reading page 32 here and what I understand so far is that it uses abstractions. But I don't understand the diagram below page 32. If this can be explained with skype, I'll pm you my skype id.

Also the examples they give for Interface segregation are kind of confusing. (Page 14). Can someone explain that too? Does that mean that the different client interfaces are for different users like how an educational website might have interface classes for a teacher, student, and administrator (assuming the server side language was object oriented)?

http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

In this source they say that it's better to have one responsibility per class. I can agree with this. But why don't they have one class for drawing shapes and one class for defining rectangles. Instead they have one class for drawing only rectangles and one class for defining a rectangle's geometry.

Doesn't that mean they would be making a different drawer for every shape?



After that I'll probably need some help with Cascading (Is this similar to cascading deletes for DB?) and Facade but I'll ask later after I've done more reading.
Are there any good videos I need to watch about creational patterns, structural design patterns, or behavioral patterns?
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.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
April 12 2014 19:30 GMT
#9317
there's a whole chapter on it in modern c++ design by alexandrescu (chapter 9):
src
so if you're apt in c++ this is a really nice documentation.
conspired against by a confederacy of dunces.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
April 12 2014 19:48 GMT
#9318
On April 13 2014 04:30 nunez wrote:
there's a whole chapter on it in modern c++ design by alexandrescu (chapter 9):
src
so if you're apt in c++ this is a really nice documentation.

Thanks. This is helping!
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.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-04-12 20:41:52
April 12 2014 20:23 GMT
#9319
--- Nuked ---
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-04-12 21:30:14
April 12 2014 21:27 GMT
#9320
I've noticed you are discussing the Factory pattern. I know it leads to abstraction to create an object based on some input, but how often do you need this pattern at workplace? And if you do, what is it for most of the time? Just curious about applications other than the ones you find on wikipedia, internet, etc.

Also, to the guy asking about the Factory pattern, here is a more concrete pattern than that. It's called the Builder Pattern, further reading. It's good if you have a constructor with too many parameters or you do not want to make an excessive number of constructors. You also don't have to remember a specific order for values, so that's nice too. While the Factory pattern generates an object for you, the Builder pattern allows you to refine it. Just in case you would like to learn more.
Prev 1 464 465 466 467 468 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 41m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
CosmosSc2 5
StarCraft: Brood War
Calm 2206
Shuttle 427
Larva 174
Dewaltoss 112
Dota 2
syndereN1139
Counter-Strike
fl0m1282
Foxcn262
Heroes of the Storm
Liquid`Hasu531
Other Games
Grubby6670
FrodaN989
RotterdaM185
ArmadaUGS99
C9.Mang096
Maynarde67
ZombieGrub27
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• HeavenSC 68
• musti20045 21
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• RayReign 0
• ZZZeroYoutube
• BSLYoutube
Dota 2
• Ler129
League of Legends
• Doublelift2275
• TFBlade1191
Other Games
• imaqtpie1374
• Scarra645
• Shiphtur160
Upcoming Events
Replay Cast
1h 41m
The PondCast
11h 41m
OSC
17h 41m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 1h
Korean StarCraft League
2 days
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
[ Show More ]
Sparkling Tuna Cup
3 days
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
5 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
6 days
StarCraft2.fi
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
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
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 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.