• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:15
CEST 18:15
KST 01:15
  • 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] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16[ASL21] Ro16 Preview Pt2: All Star10Team Liquid Map Contest #22 - The Finalists22
Community News
Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event11Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25Maestros of the Game 2 announced9
StarCraft 2
General
Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun Team Liquid Map Contest #22 - The Finalists
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL Revival: Season 5 - Qualifiers and Main Event StarCraft Evolution League (SC Evo Biweekly) 2026 GSL Season 2 Qualifiers $1,400 SEL Season 3 Ladder Invitational
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
Mutation # 524 Death and Taxes The PondCast: SC2 News & Results Mutation # 523 Firewall Mutation # 522 Flip My Base
Brood War
General
AI Question ASL21 General Discussion Using AI to optimize marketing campaigns [ASL21] Ro8 Preview Pt2: Progenitors Why there arent any 256x256 pro maps?
Tourneys
[ASL21] Ro8 Day 4 [ASL21] Ro8 Day 3 [Megathread] Daily Proleagues [ASL21] Ro8 Day 2
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates What's the deal with APM & what's its true value Any training maps people recommend?
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV OutLive 25 (RTS Game) Daigo vs Menard Best of 10 Nintendo Switch Thread
Dota 2
The Story of Wings Gaming
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread 3D technology/software discussion Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread Formula 1 Discussion McBoner: A hockey love story
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Movie Stars In Video Games: …
TrAiDoS
ramps on octagon
StaticNine
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 860 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 7h 46m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Britney 44440
Calm 5726
Bisu 3106
Horang2 777
Mini 743
Light 604
Soma 507
EffOrt 458
ggaemo 416
actioN 297
[ Show more ]
ZerO 214
Snow 163
hero 105
Sharp 99
PianO 94
Hyun 78
Dewaltoss 78
Killer 75
Zeus 65
Leta 59
Mind 58
Pusan 54
Aegong 40
ToSsGirL 34
Shinee 26
Hm[arnc] 24
sorry 23
Backho 23
Rock 20
Terrorterran 19
Movie 19
Bale 17
sSak 16
IntoTheRainbow 16
Sacsri 9
ajuk12(nOOB) 8
zelot 7
Dota 2
Gorgc4487
qojqva726
syndereN419
Counter-Strike
fl0m1649
zeus793
byalli523
edward83
pashabiceps29
Other Games
singsing2064
B2W.Neo1363
hiko969
Liquid`RaSZi855
Beastyqt823
FrodaN808
Hui .203
ArmadaUGS169
KnowMe155
QueenE104
monkeys_forever95
Mew2King83
Livibee60
Trikslyr46
ZerO(Twitch)18
DeMusliM9
Organizations
Dota 2
PGL Dota 2 - Main Stream48
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 37
• Azhi_Dahaki1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Other Games
• WagamamaTV408
• Shiphtur232
Upcoming Events
PiGosaur Cup
7h 46m
GSL
17h 16m
Classic vs Cure
Maru vs Rogue
GSL
1d 17h
SHIN vs Zoun
ByuN vs herO
OSC
1d 18h
OSC
1d 20h
Replay Cast
2 days
Escore
2 days
The PondCast
2 days
WardiTV Invitational
2 days
Zoun vs Ryung
Lambo vs ShoWTimE
OSC
3 days
[ Show More ]
Replay Cast
3 days
CranKy Ducklings
3 days
RSL Revival
3 days
SHIN vs Bunny
ByuN vs Shameless
WardiTV Invitational
3 days
Krystianer vs TriGGeR
Cure vs Rogue
uThermal 2v2 Circuit
3 days
BSL
4 days
Replay Cast
4 days
Sparkling Tuna Cup
4 days
RSL Revival
4 days
Cure vs Zoun
Clem vs Lambo
WardiTV Invitational
4 days
BSL
5 days
GSL
5 days
Afreeca Starleague
5 days
Monday Night Weeklies
5 days
Afreeca Starleague
6 days
CranKy Ducklings
6 days
Liquipedia Results

Completed

Proleague 2026-05-02
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
BLAST Rivals Spring 2026
IEM Rio 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

Upcoming

YSL S3
Escore Tournament S2: W6
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
Escore Tournament S2: W7
Escore Tournament S2: W8
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
2026 GSL S2
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 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.