• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:06
CEST 16:06
KST 23:06
  • 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!17Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)84Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!18
StarCraft 2
General
August World Ranking Watchlist: Serral back to #1? 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
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War HomeStory Cup 29
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
Animated Gateway BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion 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
Path of Exile ZeroSpace Early Access is Now Live! General RTS Discussion Thread ZeroSpace at Steam NextFest - Last free demo Nintendo Switch Thread
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: 13193 users

The Big Programming Thread - Page 463

Forum Index > General Forum
Post a Reply
Prev 1 461 462 463 464 465 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.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
April 04 2014 07:59 GMT
#9241
On April 04 2014 14:26 phar wrote:
Show nested quote +
On April 04 2014 13:17 CatNzHat wrote:
On April 04 2014 09:53 darkness wrote:
I've been reading a bit of that "Clean Code" book. One of the suggestions is not to return null but to throw an exception or return a special case object. Is that how you guys do it as well? I've recently got annoyed at some bits of my code that are if (object == null).

But then, do you have to catch those exceptions? Can't they go silently like "return" in a void method? What about int/boolean methods though? "return" is insufficient there, but if you write "return -1", then whether you check for (object == null) or (object != -1) kind of has the same purpose.

recent example I ran into was an accessor method for a signed cookie. If it successfully unsigns the cookie then it will return the value, otherwise it will return nil (which could be caused by bad cookie value or no cookie at all). This creates a clean encapsulation for accessing the signed cookie values that is easy to test.


In cases like these you can consider using Optional<T> instead of @Nullable T.

I forgot to say these examples were in the context of ruby so there is no optional or nullable unless you're talking about an activerecord model with constraints, in which case you could implement something of the sort and I would encourage it. validates_presence_of vs an attribute_reader that implements a coalesce or whatever the desired behavior for the null (not present) case.

The implementation is contextual (as it always will be) but the principal is the same: make your code clearly represent itself, don't hide logic.

It's better to have less DRY code that is easy to read than very DRY code that is difficult to maintain. If your code is readable but wet, then your abstraction is poor and that can be fixed. Whiteboarding is your friend.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-04-05 21:04:33
April 05 2014 21:03 GMT
#9242
In regard to some air flight news lately, I'm wondering what languages and techniques companies use to build the embedded systems on board. C? C++? Are Formal Methods still a thing for this kind of business?
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
April 06 2014 04:03 GMT
#9243
On April 06 2014 06:03 darkness wrote:
In regard to some air flight news lately, I'm wondering what languages and techniques companies use to build the embedded systems on board. C? C++? Are Formal Methods still a thing for this kind of business?

Given the nature of the software it has to run in realtime, meaning no language with automatic GC is going to be used, so C/C++ are prevalent.
supereddie
Profile Joined March 2011
Netherlands151 Posts
April 06 2014 08:24 GMT
#9244
What does automatic GC have to do with whether a language can be used for 'real time' software? And 'real time' is just relative anyway ('real time' for a ship different from 'real time' for a plane)
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-04-06 09:41:35
April 06 2014 09:41 GMT
#9245
On April 06 2014 17:24 supereddie wrote:
What does automatic GC have to do with whether a language can be used for 'real time' software? And 'real time' is just relative anyway ('real time' for a ship different from 'real time' for a plane)


real time means the same for a ship and for a plane:
any information processing activity or system which has to respond to externally generated input stimuli within a finite and specified delay - Burns / Wellings

the 'real time' is the same too, but the systems are different. automatic/manual memory management is less complex, but if auto gc is optional and easily disabled in the language it's not an issue.

ada f.ex, from its wiki
Though the semantics of the language allow automatic garbage collection of inaccessible objects, most implementations do not support it by default, as it would cause unpredictable behaviour in real-time systems.
wiki
conspired against by a confederacy of dunces.
bangsholt
Profile Joined June 2011
Denmark138 Posts
April 06 2014 11:19 GMT
#9246
The simple reason you don't use a GC in real time systems is that you can no longer prove that a piece of code will execute in at most N <timeunit>.

An example, that is a bit exaggerated

Lets say it takes 10 ms to run a garbage collection.
The requirement for a rudder to move on a plane is 25 ms after a movement has been detected.
It will at most take 15 ms to move the rudder to the wanted place.
The calculation that is needed to figure out how much to move the rudder takes 5 ms.

Going from one extreme position to the other -> 5 ms (calc) + (15 ms movement). Got 5 ms spare.
Going from one extreme position to the other - GC decides to start cleaning while in the calculation -> 2 ms (calc) -> 10 ms (GC) -> 3 ms(calc) -> 15 ms movement = 30 ms, and you may end up with a crashed plane in the most extremely unthinkable situation.

It's basically this way that all safety systems are made. You have strict requirements made from a combination of physical properties, electronic properties and how it's coded.
phar
Profile Joined August 2011
United States1080 Posts
April 06 2014 17:29 GMT
#9247
On April 06 2014 17:24 supereddie wrote:
What does automatic GC have to do with whether a language can be used for 'real time' software? And 'real time' is just relative anyway ('real time' for a ship different from 'real time' for a plane)

Yea some background here may be necessary. When people say real time systems, it has a very, very specific meaning:

http://en.wikipedia.org/wiki/Real-time_computing

I.e. "The main event loop absolutely cannot take longer than 10ms, under any circumstances whatsoever."

In a situation like this, you cannot use GC, because GC does not have a hard latency guarantee - you can't know how long it will take. (This is a bit of a simplification, but that's sort of how it is).
Who after all is today speaking about the destruction of the Armenians?
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
April 06 2014 23:36 GMT
#9248
you dont even need a plane as an example.

Even simple things from normal companies cant have this. For example last month i had to work on a simple embedded microprozessor that tests wether or not a light switched properly from normal elictricity to emergency battery by measuring an electrical impulse the light sends when it does that.


This requires millisecond accuracy, but is not some extreme plane scenario.
It is later used in a test system for quality assurance, operated by minimum wage people.
Its also used in big builings as an intermediate between a row of lights and the controlling main system.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
April 07 2014 00:56 GMT
#9249
On April 07 2014 08:36 LaNague wrote:
Even simple things from normal companies cant have this. For example last month i had to work on a simple embedded microprozessor that tests wether or not a light switched properly from normal elictricity to emergency battery by measuring an electrical impulse the light sends when it does that.

I'm curious, how does this light impulse work? You have a sensor in the system that detects electrical signals and when the backup generator comes online it sends a distinct signal for x seconds?
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.
TimKim0713
Profile Joined June 2012
Korea (South)221 Posts
April 07 2014 01:19 GMT
#9250
What is a "client class"?

I see them on comp sci multiple choice, and got a little confused...
how is it different from a normal class?

Cheren
Profile Blog Joined September 2013
United States2911 Posts
April 07 2014 01:55 GMT
#9251
http://bettertwitchvods.s3-website-us-west-1.amazonaws.com/

Made a quick Javascript API call project to browse twitch VODs in a less annoying way, it's not really an improvement for tournaments but it works pretty well for going through old recordings of personal streamers.

Code is really ugly btw.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-04-07 08:45:44
April 07 2014 08:41 GMT
#9252
On April 07 2014 10:19 TimKim0713 wrote:
What is a "client class"?

I see them on comp sci multiple choice, and got a little confused...
how is it different from a normal class?



Maybe this question is about the client-server architecture. You have a server class (e.g. Java RMI, IRCd, Skype, etc), and a client class to connect to the server (e.g. Java RMI, XChat/mIRC, Skype client, etc). This is a bit simplified because their clients may not use only one class, but in the case of RMI it's posible to have only one client class. Actually, it may not be required to have only one client class. I suppose it's acceptable to call many classes "client" per application.

Example (Java RMI): http://web.cs.wpi.edu/~rek/DCS/D04/JavaRMI.html
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
April 07 2014 11:31 GMT
#9253
On April 07 2014 09:56 obesechicken13 wrote:
Show nested quote +
On April 07 2014 08:36 LaNague wrote:
Even simple things from normal companies cant have this. For example last month i had to work on a simple embedded microprozessor that tests wether or not a light switched properly from normal elictricity to emergency battery by measuring an electrical impulse the light sends when it does that.

I'm curious, how does this light impulse work? You have a sensor in the system that detects electrical signals and when the backup generator comes online it sends a distinct signal for x seconds?


When you switch AC/DC, the monitor card registers that, so do the lights, which have their own microprozessors (but cheap small ones).
Then the monitor switches into a mode where it collects informations about how the lights it is responsible for reacted to the situation.
The lights (up to 50 connected to 1 monitor) will send an impulse of 40ms length and 100mA height on a seperate cable.
then the monitor sends the collected data to its controlling unit.


Especially in the test-system you have to measure the impulse accurately, plus 50 come in rapid succession when deployed by customers and you cant miss one because your program was dicking around.



Its a very nice example of how much we use computers these days. The lights have a processor, they send to a controlling device that controls 50 lights, which again sends to a central light system, which then probably is connected to a main security/control system.


It was interesting to program, as i usually program mathy things that are much more about algorithms and dont have to so much attention to hardware capabilities. Catching the start of the signal with milliseconds accuracy and then doing as many hight measurements as possible without missing the stop of the signal was kind of interesting to do.
ambikalx
Profile Joined September 2011
United States30 Posts
Last Edited: 2014-04-07 12:37:03
April 07 2014 11:33 GMT
#9254
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-04-07 22:59:24
April 07 2014 22:57 GMT
#9255
I'm pleasantly surprised with Java's JTable and TableModel. They remind me of Objective-C's table view.
However, Java's Date class seems to have too many deprecated methods which isn't nice. I've found some library that more or less enhances it.
Shikada
Profile Joined May 2012
Serbia976 Posts
April 07 2014 23:27 GMT
#9256
Never use Java's Date class. Use joda time instead and save yourself a lot of trouble
3FFA
Profile Blog Joined February 2010
United States3931 Posts
April 08 2014 12:04 GMT
#9257
I have a problem where my words[] array of strings fails to be accessed by another class that needs to use it. Switching which class has extends(to experiment if that was the problem) failed. Anyone have any ideas for how to fix this? Some code is below:+ Show Spoiler +

package sorter;

public class Sorter extends Word {

public static void main(String[] args) {

//declare variables
String words[] = {"hi", "pie", "schoolmaster", "theclassroom", "meteor", "remote", "racecar", "racecar", "nap", "pan", "God", "dog"};}}


package sorter;

public class Word{

private String word;

public void setWord(String w)
{
word = w;
}

public String getWord(int i)
{
return words[i]; //asks for me to create the local variable words.
}
"As long as it comes from a pure place and from a honest place, you know, you can write whatever you want."
DeltaX
Profile Joined August 2011
United States287 Posts
April 08 2014 12:25 GMT
#9258
Your variable names and types seem off. You declare a string "word" and try to reference "words[]" and "words". You want it to be a String[] instead of a string, decide if you want your variable name to be singular or plural and don't use [] on variable names unless you want to reference a specific element in the array.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-04-08 21:59:32
April 08 2014 21:55 GMT
#9259
Does anyone have experience with JTable? I'm trying to display a unique ComboBox for each row, but what is displayed is ComboBox.toString() instead. I've found some examples but 1) they use the same ComboBox for every row or 2) code doesn't work for me. I understand I need to set Cell editor and renderer, but I'm not doing it right I guess.

Overall, the ComboBox is supposed to be a drop-down list that is read-only. I only want the user to view items per list with no modification.

Edit: ComboBox isn't required exactly. I just want to display an array of items.
misirlou
Profile Joined June 2010
Portugal3306 Posts
April 09 2014 00:16 GMT
#9260
Not exactly programming but think it's the best place to post this:

I was testing teamliquid.net against the Heartbleed bug when I noticed that TL doesn't use HTTPS at all. Could you please make atleast www.teamliquid.net/mytlnet/login.php forceably run over https so I don't have my password (atleast it's a generic one that i use for minor stuff) flying around in plain text?

Onto the Heartbleed discussion:
This is a pretty major exploit, that allows you to read some (maybe all of it?) ram from the host running openSSL, 64kB at a time. This exploit can very easily retrieve a host's private key to be used in impersonation attacks, read a lot of confidential content and even hijack web server user sessions. The bug was made public yesterday yet it took some companies like yahoo almost 24hours to fix it (was simply updating/downgrading openSSL on their servers or manually disabling the module causing the bug) and others still haven't reacted. Seeing so much info out on what can be done with this exploit just studied in 24hours makes me wonder how much of it was already thought out before public awareness and how much entities (hello NSA) have exploited this for the last 2 years (bug was deployed in 2012)
Prev 1 461 462 463 464 465 1032 Next
Please log in or register to reply.
Live Events Refresh
Kung Fu Cup
11:00
2026 Week 16
IntoTheiNu 1493
WardiTV643
RotterdaM548
Ryung 479
TKL 218
Rex141
SteadfastSC134
EnkiAlexander 33
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Serral 1119
RotterdaM 548
Ryung 479
TKL 218
Rex 141
SteadfastSC 134
BRAT_OK 53
RushiSC 10
trigger 7
StarCraft: Brood War
Calm 4822
Rain 2806
Jaedong 1627
Horang2 1202
EffOrt 624
BeSt 513
Light 426
firebathero 422
Soulkey 347
Rush 246
[ Show more ]
hero 233
Stork 228
Snow 208
ggaemo 194
ZerO 189
Soma 178
Last 137
Zeus 124
Mong 104
Hyun 88
sorry 85
Dewaltoss 82
Pusan 76
Leta 64
[sc1f]eonzerg 54
NaDa 49
ToSsGirL 35
Movie 33
JYJ 31
JulyZerg 28
yabsab 22
Hm[arnc] 19
GoRush 19
Sacsri 17
Sexy 17
Aegong 16
Noble 16
Nal_rA 16
Rock 14
IntoTheRainbow 13
ajuk12(nOOB) 12
zelot 8
Terrorterran 6
Dota 2
qojqva1678
XaKoH 311
syndereN265
XcaliburYe181
420jenkins13
League of Legends
KnowMe42
Counter-Strike
fl0m3376
Other Games
FrodaN4246
B2W.Neo725
hiko668
Lowko575
Mlord384
uThermal293
Liquid`LucifroN170
Pyrionflax141
ArmadaUGS127
DeMusliM125
ToD93
CosmosSc2 25
Trikslyr21
ZerO(Twitch)14
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 16 non-featured ]
StarCraft 2
• StrangeGG 39
• poizon28 2
• Kozan
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2123
• WagamamaTV374
League of Legends
• Nemesis2262
• TFBlade693
Upcoming Events
OSC
9h 55m
CrankTV Team League
20h 55m
Replay Cast
1d 9h
CrankTV Team League
1d 20h
Korean StarCraft League
2 days
Afreeca Starleague
2 days
RSL Revival
2 days
Serral vs SHIN
herO vs Solar
Online Event
3 days
Replay Cast
3 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
PiGosaur Cup
6 days
The PondCast
6 days
Kung Fu Cup
6 days
Liquipedia Results

Completed

Proleague 2026-07-21
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.