• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 15:58
CET 21:58
KST 05: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
[ASL22] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down21ISSL (IntoTheTV x SOOP SC2 League): Premier6Weekly Cups (October 12-18): 5.0.17 era begins1[$1250] International ShieldBattery League99
StarCraft 2
General
No more SC2 streamers on team liquid? Evil Geniuses - shutting down Behind the Blue - Team Liquid History Book SC2 Power Rank: epic29 Weekly Cups (October 19-25): Clem triples first in 5.0.17
Tourneys
Stellar Fest TWO the Moon (Dec 16-20) Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 ISSL (IntoTheTV x SOOP SC2 League): Premier RSL 2026 Offline Finals LCQ Sign-Ups
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[D] the control group Simple Questions/Answers [G] How to playtest arcade maps [A] Nemrods 1/4 players
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
Mathematicians needed to calc "Low Econ Epicness" BW General Discussion Rollback Netcode in Brood War SCHNAIL now supports Remastered Ziemie's Starcraft 1 Prequel Campaign
Tourneys
[Megathread] Daily Proleagues [IPSL] IPSL Winter 26-27 Ro24 is HERE! [$1250] International ShieldBattery League [ASL22] Grand Finals
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Deus Ex 3!? Stormgate/Frost Giant Megathread Nintendo Switch Thread Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread European Politico-economics QA Mega-thread
Fan Clubs
Reynor Fan Club The Flash Fan Club Serral Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
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
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7933 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
BSL
20:00
RO24 Group D
Ret vs DragOn
Doodle vs Dienmax
ZZZero.O306
Liquipedia
IPSL
17:00
Ro24 Group C
Artosis vs RiceHat
Kyrie vs Sony
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
EmSc Tv 27
StarCraft: Brood War
Bisu 1279
ZZZero.O 321
ProTech135
Dewaltoss 128
White-Ra 66
ToSsGirL 20
Dota 2
febbydoto8
Counter-Strike
dupreeh595
Super Smash Bros
C9.Mang01145
Heroes of the Storm
Grubby4346
Liquid`Hasu727
Other Games
tarik_tv7406
Liquid`RaSZi2503
FrodaN2410
Mlord472
XaKoH 435
PiGStarcraft253
ToD240
RotterdaM100
JuggernautJason38
Organizations
Other Games
gamesdonequick1330
Counter-Strike
PGL1015
StarCraft 2
angryscii 37
EmSc Tv 27
EmSc2Tv 27
[ Show 16 non-featured ]
StarCraft 2
• Hinosc 113
• StrangeGG 49
• Adnapsc2 16
• Reevou 7
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• ChaeLyn 9
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Other Games
• imaqtpie888
• Shiphtur674
Upcoming Events
Replay Cast
2h 2m
WardiTV Weekly
15h 2m
Ultimate Battle
15h 2m
Rush vs BeSt
Replay Cast
1d 2h
Rogue vs Classic
Patches Events
1d 16h
PiGosaur Cup
2 days
Kung Fu Cup
2 days
Replay Cast
3 days
The PondCast
3 days
KCM Race Survival
3 days
[ Show More ]
IntoTheTV X SOOP
5 days
herO vs Rogue
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
WardiTV Invitational
5 days
IPSL
5 days
WorsT vs nOmaD
Dewalt vs andersOn
IntoTheTV X SOOP
6 days
WardiTV Invitational
6 days
IPSL
6 days
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Liquipedia Results

Completed

Proleague 2026-10-30
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
PGL Masters Bucharest 2026
Stake Ranked Episode 5
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
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026

Upcoming

1xBet Invitational
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 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.