• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:58
CEST 07:58
KST 14: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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
ZeroSpace Early Access is Now Live!18Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)87Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!18
StarCraft 2
General
How would you feel about frequent/monthly balance patches for SC2? Balance hotfix patch 5.0.16b (July 16) Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters [D] Wireframe Casting Removed
Tourneys
IntoTheTV X SOOP SC2 League : Weekly & Monthly INu's Battles#18 - Cure, herO, Rogue & ByuN RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Animated Gateway HORROR STARCRAFT MOVIE How Famous was FlaSh before his Debut?
Tourneys
[Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
Nintendo Switch Thread ZeroSpace Early Access is Now Live! Path of Exile General RTS Discussion Thread Diablo IV
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Artificial Intelligence Thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Hello guys!
LIN1s
Role of Gaming on Mental Hea…
TrAiDoS
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Customize Sidebar...

Website Feedback

Closed Threads



Active: 3940 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
OSC
00:00
OSC Elite Rising Star #20
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 120
Nina 94
StarCraft: Brood War
GuemChi 3417
Shuttle 641
Leta 89
Mind 73
Aegong 54
ZergMaN 40
Bale 26
Icarus 9
League of Legends
JimRising 686
Counter-Strike
summit1g8210
Super Smash Bros
hungrybox443
Other Games
WinterStarcraft685
NeuroSwarm86
Trikslyr16
Organizations
Other Games
gamesdonequick1216
StarCraft: Brood War
UltimateBattle 94
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH300
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota297
League of Legends
• Lourlo1203
• Stunt466
• HappyZerGling97
Upcoming Events
CrankTV Team League
5h 2m
Replay Cast
18h 2m
CrankTV Team League
1d 5h
Big Brain Bouts
1d 10h
Soulspirit vs goblin
TriGGeR vs Bunny
Korean StarCraft League
1d 21h
Afreeca Starleague
1d 22h
RSL Revival
2 days
Serral vs SHIN
herO vs Solar
Online Event
2 days
Replay Cast
2 days
RSL Revival
3 days
Clem vs ByuN
Rogue vs Lambo
[ Show More ]
OSC
3 days
WardiTV Weekly
4 days
Sparkling Tuna Cup
5 days
INu's Battles
5 days
Cure vs herO
ByuN vs Rogue
PiGosaur Cup
5 days
The PondCast
6 days
Kung Fu Cup
6 days
Patches Events
6 days
Liquipedia Results

Completed

Proleague 2026-07-22
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 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.