• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:02
CEST 23:02
KST 06:02
  • 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
[ASL22] Ro16 Preview: Holy Diver3[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915
Community News
StarCraft open world shooter announced at BlizzCon75Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?174Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
StarCraft open world shooter announced at BlizzCon How do you feel about the StarCraft shooter announcement at BlizzCon 2026? Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event RSL goes to London! 2026 Offline Finals Nov 21-22 Sparkling Tuna Cup - Weekly Open Tournament KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 543 Enhanced Defenses The PondCast: SC2 News & Results Mutation # 542 The Ascended Mutation # 541 Binary Choice
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? [ASL22] Ro16 Preview: Holy Diver ASL22 General Discussion BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market
Tourneys
[ASL22] Ro16 Group C [ASL22] Ro16 Group B [ASL22] Ro16 Group A Escore Tournament - Season 3
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
Diablo IV Nintendo Switch Thread EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread UK Politics Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Diablo Animated Series on Netflix
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4150 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
BlizzCon
18:30
Blizzard Classic Cup 2026
StarCraft2613
RotterdaM812
ComeBackTV 640
IndyStarCraft 201
EnkiAlexander 85
CosmosSc2 72
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 812
IndyStarCraft 201
StarCraft: Brood War
Britney 15529
Calm 2250
Shuttle 1152
Artosis 836
Dewaltoss 89
CosmosSc2 72
sSak 15
Dota 2
Pyrionflax185
LuMiX1
League of Legends
Doublelift4653
JimRising 258
goblin8
Counter-Strike
byalli1352
Fnx 731
Super Smash Bros
C9.Mang0351
hungrybox249
Mew2King174
Chillindude14
Heroes of the Storm
Liquid`Hasu508
Other Games
summit1g9774
Liquid`RaSZi2558
B2W.Neo1539
fl0m842
Tasteless625
Livibee121
XaKoH 120
Organizations
Other Games
gamesdonequick2422
Heroes of the Storm
Heroes of the Storm711
StarCraft: Brood War
Afreeca ASL 533
[ Show 14 non-featured ]
StarCraft 2
• Berry_CruncH469
• Hupsaiya 68
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• Azhi_Dahaki42
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3102
• masondota21871
Other Games
• Shiphtur213
Upcoming Events
Afreeca Starleague
12h 58m
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
13h 58m
Monday Night Weeklies
18h 58m
Afreeca Starleague
1d 12h
Snow vs Shinee
Shine vs EffOrt
GSL
1d 13h
PiGosaur Cup
2 days
The PondCast
2 days
Kung Fu Cup
2 days
Replay Cast
3 days
KCM Race Survival
3 days
[ Show More ]
IntoTheTV X SOOP
3 days
Replay Cast
4 days
IntoTheTV X SOOP
4 days
Replay Cast
5 days
GSL
5 days
Replay Cast
6 days
GSL
6 days
Shopify Rebellion Sundays
6 days
Spirit vs Mixu
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Blizzard Classic Cup 2026
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 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.