• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 09:38
CEST 15:38
KST 22:38
  • 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] Ro4 Preview: On Course10Code S Season 1 - RO8 Preview7[ASL21] Ro8 Preview Pt2: Progenitors8Code S Season 1 - RO12 Group A: Rogue, Percival, Solar, Zoun13[ASL21] Ro8 Preview Pt1: Inheritors16
Community News
Maestros of The Game 2 announcement and schedule !8Weekly Cups (April 27-May 4): Clem takes triple0RSL Revival: Season 5 - Qualifiers and Main Event12Code S Season 1 (2026) - RO12 Results12026 GSL Season 1 Qualifiers25
StarCraft 2
General
Code S Season 1 - RO8 Preview Behind the Blue - Team Liquid History Book Weekly Cups (April 27-May 4): Clem takes triple Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool Code S Season 1 (2026) - RO12 Results
Tourneys
Master Swan Open (Global Bronze-Master 2) 2026 GSL Season 2 Qualifiers Maestros of The Game 2 announcement and schedule ! GSL Code S Season 1 (2026) WardiTV Mondays
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Mutation # 525 Wheel of Misfortune The PondCast: SC2 News & Results Mutation # 524 Death and Taxes Mutation # 523 Firewall
Brood War
General
ASL Tickets to Live Event Finals? [ASL21] Ro4 Preview: On Course Quality of life changes in BW that you will like ? Why there arent any 256x256 pro maps? RepMastered™: replay sharing and analyzer site
Tourneys
[ASL21] Semifinals A [BSL22] RO16 Group Stage - 02 - 10 May [Megathread] Daily Proleagues [ASL21] Ro8 Day 3
Strategy
Simple Questions, Simple Answers Fighting Spirit mining rates Muta micro map competition What's the deal with APM & what's its true value
Other Games
General Games
Warcraft III: The Frozen Throne Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Daigo vs Menard Best of 10
Dota 2
The Story of Wings Gaming
League of Legends
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 UK Politics Mega-thread The Letting Off Steam 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 McBoner: A hockey love story Formula 1 Discussion
World Cup 2022
Tech Support
streaming software Strange computer issues (software) [G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How EEG Data Can Predict Gam…
TrAiDoS
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1276 users

The Big Programming Thread - Page 502

Forum Index > General Forum
Post a Reply
Prev 1 500 501 502 503 504 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.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
July 23 2014 18:00 GMT
#10021
Logging is one of these odd things that are orthogonal to the normal architecture. Logging is needed almost everywhere, across all layers and boundaries. I suggest that you find some sources on how to provide logging in a clean, hopefully nonintrusive way and then decide which option fits your architecture best.
If you have a good reason to disagree with the above, please tell me. Thank you.
bakesale
Profile Blog Joined August 2008
United States187 Posts
July 23 2014 21:26 GMT
#10022
On July 23 2014 23:57 MelChizm wrote:
Show nested quote +
On July 23 2014 10:22 bakesale wrote:
On July 21 2014 19:14 MelChizm wrote:
What is the most the most efficient way in R to get values from a table. By which I mean I have a list of ID's, I have a table in which there is one column with each ID exactly once, and one column with the number that belongs to the ID. So now I want in my big list, with multiple occurences of the ID's, I want to add after each occurence the number from the table.

I use now lapply on the ID's and a function that indexes on the ID and returns the number, but I have the feeling this lapply function is not so efficient, it takes a long time to compute. Does somebody know a more efficient method?

dummy data:
ID
1
1
2
1
2
3
...

table
ID Number
1 384835
2 435393
3 239493
...

Can you clarify what the goal is? I think from what you've said, and using that sample data, that the output would be:

ID Number
1 384835
1 384835
2 435393
1 384835
2 435393
3 239493

Is that correct?


Yes Exactly, that is the result I am looking for.


Here you go:

> a
ID Number
1 1 384835
2 2 435393
3 3 239493
> b
ID
1 1
2 1
3 2
4 1
5 2
6 3
> b$Number <- a[b$ID, 2]
> b
ID Number
1 1 384835
2 1 384835
3 2 435393
4 1 384835
5 2 435393
6 3 239493
phar
Profile Joined August 2011
United States1080 Posts
July 24 2014 04:09 GMT
#10023
You might want to first ask why you need some parts of your code to know about the logging from other parts of your code.
Who after all is today speaking about the destruction of the Armenians?
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-07-24 06:08:52
July 24 2014 06:07 GMT
#10024
On July 24 2014 13:09 phar wrote:
You might want to first ask why you need some parts of your code to know about the logging from other parts of your code.


I think that's a good question. Usually you introduce logging for debugging and testing purposes. I don't think I've ever introduced code that would access the logs. Unless you consider saving object state logging...
Time is precious. Waste it wisely.
MelChizm
Profile Joined November 2010
Netherlands15 Posts
Last Edited: 2014-07-24 09:39:52
July 24 2014 09:19 GMT
#10025
On July 24 2014 06:26 bakesale wrote:
Show nested quote +
On July 23 2014 23:57 MelChizm wrote:
On July 23 2014 10:22 bakesale wrote:
On July 21 2014 19:14 MelChizm wrote:
What is the most the most efficient way in R to get values from a table. By which I mean I have a list of ID's, I have a table in which there is one column with each ID exactly once, and one column with the number that belongs to the ID. So now I want in my big list, with multiple occurences of the ID's, I want to add after each occurence the number from the table.

I use now lapply on the ID's and a function that indexes on the ID and returns the number, but I have the feeling this lapply function is not so efficient, it takes a long time to compute. Does somebody know a more efficient method?

dummy data:
ID
1
1
2
1
2
3
...

table
ID Number
1 384835
2 435393
3 239493
...

Can you clarify what the goal is? I think from what you've said, and using that sample data, that the output would be:

ID Number
1 384835
1 384835
2 435393
1 384835
2 435393
3 239493

Is that correct?


Yes Exactly, that is the result I am looking for.


Here you go:

> a
ID Number
1 1 384835
2 2 435393
3 3 239493
> b
ID
1 1
2 1
3 2
4 1
5 2
6 3
> b$Number <- a[b$ID, 2]
> b
ID Number
1 1 384835
2 1 384835
3 2 435393
4 1 384835
5 2 435393
6 3 239493


tnx it works!
boon2537
Profile Blog Joined October 2010
United States905 Posts
July 24 2014 20:21 GMT
#10026
Hey, guys. I'm a junior C.S. major student but I'm still a noob at everything.
My first language is python, then I learned some C++ and made some basic data structure with it, and after that I mostly use java. And now, I'm making simple Unity game for fun in C#.

To be more marketable, is it worth learning and getting good at C or should I just focus on C# and java? I feel besides optimizing systems, the benefit of being good at C is understanding low-level issues which most people wouldn't care. But, then again, I know nothing.

What do you guys think about this?
Manit0u
Profile Blog Joined August 2004
Poland17743 Posts
Last Edited: 2014-07-24 21:29:18
July 24 2014 21:27 GMT
#10027
C++ is sufficiently low-level for most of todays things. If you already know some C basics or intermediate concepts that should be good enough (as sometimes you'll get to see some pieces of code for high-level frameworks written in C and it's good to know what's going on under the hood). Unless you want to do stuff like programming drivers for small machines (heart pacers etc.) or work with system kernels - then you need deep knowledge of C.

It's really a question of what direction you want to take. It's definitely easier to find a job in high-level languages just because there are more offers (depends on the language though, there will be more offers for Java than Haskell or Scala). If you're just starting out and not really sure what direction to take I'd stick with Java because it is very widely used (this includes both Java SE and EE, especially the Spring framework and Hibernate, they're required in almost every single Java job I've seen so far) and start moving towards Scala when you feel a bit more confident. This way you'll have more job offers to choose from and getting this first job is the most important (each next job comes easier).
Time is precious. Waste it wisely.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-07-24 23:59:27
July 24 2014 23:58 GMT
#10028
--- Nuked ---
berated-
Profile Blog Joined February 2007
United States1134 Posts
Last Edited: 2014-07-25 00:57:21
July 25 2014 00:55 GMT
#10029
On July 25 2014 08:58 Nesserev wrote:
I don't remember where I read it, but I really liked the logic behind a certain author's thinking. He basically said to stay away from Java if you want to be competitive and marketable. I'll try to paraphrase what he said as best as possible, basically, it came down to:
Show nested quote +
There are a lot of Java jobs, also a lot of Java programmers. A decent portion of these programmers are one-trick java ponies, people that (almost exclusively) have programmed in Java, hobby programmers, etc.

Due to the nature of Java jobs (mostly just programming and software dev), and the Java language itself, the required skill level for Java jobs is generally not that high. They don't need a CS major, they just need a programmer, and there will probably be no practical difference between you or the next programmer in that line of work.

The problem is that, Java jobs attract a lot of people (including those one-trick ponies, because it's the only type of job that they can apply for) and almost all of those people are more than qualified for the job; there's almost no room to 'shine'. If you're going for a Java job, you can't be competitive, you'll just be the next one in line.

And well, outside of getting a job... there's no real use for Java. There's almost always a language that'll do it "better". And well, you can always apply for a Java job without knowing Java...

But let's get to the point:
If you really want to be competitive and marketable, knowing a certain language probably won't help you get any further. Your code and experience will. Get some prestige projects going, show a wide variety of interests, and go deep in a couple of projects. Use the right languages for every project, don't just swiss-knife your projects with Java.

For example: instead of using Unity and C# to make a game, why don't you pick up a simple media library, and code a game together from scratch, implement features like animations yourself??


I really don't understand anything about this post. At all. Don't learn the most sought after skill in programming? Don't learn a language that offers stable jobs than can pay $100000+. No use for java outside of the job? I suppose this conclusion is based on the fact that android is a fad.

From as stupid as the author (or your interpretation of the author) tries to make all the one trick ponies out to be, why wouldn't you go into the sector of the field? Should be a piece of cake to walk in and wipe the floor with them, since they're just hobbyist. It also seems contradictory that so many one trick ponies leave no place to shine, but then state that knowing a language won't help on getting the job. How are the one trick ponies shining if they only know a single language and that doesn't matter?

Maybe I'm just confused, is every person in this thread working for or applying to one of the biggest tech companies in the world?

Personally, I think so much of what you should be doing should be about the specifics of what you want in life. Where do you want to live? Different areas have different language demands. What type of work is going to keep you engaged? Do you like web dev, game dev, mobile development? Do you want to work for a big company or small company? If these questions lead you to wanting to work for a company that needs you to do a lot of prep work to get hired, then you should definitely do so to give you the best chance.

If all you want is a job, I'm thinking java isn't looking so shabby.
berated-
Profile Blog Joined February 2007
United States1134 Posts
Last Edited: 2014-07-25 00:57:43
July 25 2014 00:56 GMT
#10030
oops -- quote != edit. must be cause i'm a java dev
phar
Profile Joined August 2011
United States1080 Posts
July 25 2014 03:06 GMT
#10031
Don't obsess too much about being dedicated to a given language. Just learn good practices, most of it will transfer between languages. Any (sufficiently large*) company that is at all honest about its hiring practices is not going to turn you away simply because you haven't been using their language of choice. You can pick up a new language without much problem. Three of my best co-workers had never used the language they're currently using before joining, it's not an issue.

Also the idea that java programmers are one-trick ponies is ridiculous. Some of the best places to work in the world use java.

* this may not be the case for some smaller companies, because they may just not have the time & manpower to spend getting someone up to speed
Who after all is today speaking about the destruction of the Armenians?
broodbucket
Profile Joined July 2013
Australia963 Posts
July 25 2014 03:39 GMT
#10032
I'm writing a shell. Anyone have any advice on how to handle foreground/background processes? Pipes and redirection seem pretty easy.
Ben...
Profile Joined January 2011
Canada3485 Posts
July 25 2014 04:01 GMT
#10033
On July 25 2014 12:06 phar wrote:
Don't obsess too much about being dedicated to a given language. Just learn good practices, most of it will transfer between languages. Any (sufficiently large*) company that is at all honest about its hiring practices is not going to turn you away simply because you haven't been using their language of choice. You can pick up a new language without much problem. Three of my best co-workers had never used the language they're currently using before joining, it's not an issue.

Also the idea that java programmers are one-trick ponies is ridiculous. Some of the best places to work in the world use java.

* this may not be the case for some smaller companies, because they may just not have the time & manpower to spend getting someone up to speed

This is what all of the more senior devs (a couple who do hiring included. Yay for programming forums that are mostly populated with older people) I've talked to have said. They would much rather have a smart junior dev that they can teach if need be that doesn't know a language but demonstrates good programming practices than find someone who is knowledgeable but is stubborn or could cause issues (of course being smart and being knowledgeable are two different things). One said in particular that the things he looks for most when hiring are that someone shows that they can learn (and is open-minded enough to learn, doesn't have too much of an ego to take criticism, will take advice, etc.), and that they are personable (he said if he could see himself going for drinks or lunch with the person).
"Cliiiiiiiiiiiiiiiiide" -Tastosis
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
July 25 2014 06:07 GMT
#10034
--- Nuked ---
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-07-25 08:54:48
July 25 2014 08:11 GMT
#10035
Honestly how I look at it (I'm in 3rd year so ymmv) is that it's multitudes more important to be interested in what you're doing, and the programming language you become most familiar with is just what language you had to learn to pursue your interest. The advice I always give people who ask, is to think of something software-y they're interested in or just plain like, then find out how they can make it. Your marketability, and honestly your growth as a programmer is highly dependent on doing and making software things, and you're going to struggle at making those things if you're not as interested.

It's a bit different once you get a job, in that you can not be absolutely floored by the project but still enjoy the process, because while you're going to learn at a job, getting it done takes precedence, whereas with a project learning and having fun is the goal.

tldr; learning a language is secondary to making something you're interested in. What you are interested in will narrow and essentially choose your choice of languages. If you want to build embedded systems, learn C. If you want to build Android apps or monolithic enterprise systems learn Java. If you want to build a game, choose what kind of game you want and what you want to learn, every language has the resources available for that, choose Unity if you care more about making games than programming games. If you want to go into Microsoft's stack or build .net applications, learn C#. And so on and so forth.

However, if you want me to make a choice, I work at Microsoft so I'm going to say C# Java feels poorer in comparison
There is no one like you in the universe.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 25 2014 08:36 GMT
#10036
If anyone is familiar with MVVM, how would you approach dispatching tasks on the UI thread from the view model? I get lots of thread access exceptions that I solve with the dispatcher, but it requires me to make a static global variable which I'm always a bit iffy about.


Also still wondering about this,

http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/

I'm a bit confused as to what this guy is saying. The only thing that holds weight in my eyes is that your services are dependent on a service locator implementation and he doesn't even mention that. Do you guys understand/agree?
There is no one like you in the universe.
boon2537
Profile Blog Joined October 2010
United States905 Posts
July 25 2014 08:51 GMT
#10037
Based on the responses, I'm gonna stick with C# and java for now. I'll have to learn C for some of my classes anyway. I'm really enjoying Unity so far, as I'm more interested in making fun gameplay than creating a good engine from scratch. So my current side project's goal is to publish a kickass Unity game then.

Thanks for the responses guys :D
berated-
Profile Blog Joined February 2007
United States1134 Posts
July 25 2014 11:16 GMT
#10038
On July 25 2014 17:36 Blisse wrote:
Also still wondering about this,

Show nested quote +
http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/

I'm a bit confused as to what this guy is saying. The only thing that holds weight in my eyes is that your services are dependent on a service locator implementation and he doesn't even mention that. Do you guys understand/agree?


It feels to me that the author is trying to use the service locator problem to solve the wrong problems. In the java world, using OSGi or JNDI appear to me to be implementations of the service locator problem -- both of which are extremely strong and necessary tools. This isn't to say that because I found an example that the pattern is amazing and should be used all the time. Like languages, patterns cannot be applied to every situation and a perfect outcome be expected. There are times that one pattern is going to be better suited than another.

I do not understand the comments about intellisense or not knowing that you need dependencies. This feels to me to be more about good API design and documentation rather than a limitation of a pattern. If your library requires you to register something to a service locator, and then also register all of its dependencies...I'm starting to wonder what the point of hiding the service behind a locator is getting you.

From my perspective, the service locator pattern feels to me more about the boundaries of accessing an external modules rather than hiding your own code from yourself. Let some other complicated service declare its own dependencies and its own implementation while still providing a service who can execute a contract.

What's bizarre is if you read through the comments, the guy seems to be well spoken and know his stuff -- so I'm not sure as to why it feels like he's deliberately trolling on this post.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
July 25 2014 16:00 GMT
#10039
what do you guys use for energy refuel on those long days of intermittent productivity?
need to change up my banana and coffee regime.
conspired against by a confederacy of dunces.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-07-25 16:12:31
July 25 2014 16:07 GMT
#10040
--- Nuked ---
Prev 1 500 501 502 503 504 1032 Next
Please log in or register to reply.
Live Events Refresh
Wardi Open
12:00
#86
WardiTV732
Rex105
Liquipedia
GSL
08:00
2026 Season 2: Qualifiers
SHIN vs CreatorLIVE!
Zoun vs Cure
IntoTheiNu 1122
CranKy Ducklings SOOP111
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
OGKoka 301
Rex 105
MaxPax 95
ProTech56
StarCraft: Brood War
Calm 8822
Bisu 2698
Sea 1895
Jaedong 1483
Leta 1252
Horang2 976
EffOrt 620
Hyuk 486
BeSt 375
Mini 312
[ Show more ]
actioN 299
ggaemo 234
ZerO 226
firebathero 193
Soulkey 189
Larva 183
Snow 173
Rush 167
Mind 113
Hyun 91
Pusan 85
Sharp 75
Sea.KH 63
HiyA 55
Aegong 45
Mong 43
Killer 35
Barracks 29
soO 28
sorry 26
[sc1f]eonzerg 22
SilentControl 16
Hm[arnc] 15
IntoTheRainbow 15
Bale 13
Movie 8
Terrorterran 7
Icarus 7
Dota 2
Gorgc2373
XcaliburYe274
syndereN34
NeuroSwarm10
Counter-Strike
byalli357
Other Games
B2W.Neo918
hiko820
Lowko387
crisheroes193
monkeys_forever131
ArmadaUGS113
elazer93
Livibee45
Happy40
ZerO(Twitch)8
Hui .0
Organizations
Counter-Strike
PGL35555
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 45
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis4422
• TFBlade1235
Other Games
• WagamamaTV437
Upcoming Events
Monday Night Weeklies
2h 22m
OSC
10h 22m
CranKy Ducklings
20h 22m
Afreeca Starleague
20h 22m
Light vs Flash
PiGosaur Cup
1d 10h
Replay Cast
1d 19h
Replay Cast
2 days
The PondCast
2 days
OSC
2 days
Replay Cast
3 days
[ Show More ]
RSL Revival
3 days
OSC
3 days
Korean StarCraft League
4 days
RSL Revival
4 days
BSL
5 days
GSL
5 days
Cure vs TBD
TBD vs Maru
BSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL 2026 SPRING (S20)
WardiTV TLMC #16
Nations Cup 2026

Ongoing

BSL Season 22
ASL Season 21
IPSL Spring 2026
KCM Race Survival 2026 Season 2
Acropolis #4
KK 2v2 League Season 1
BSL 22 Non-Korean Championship
SCTL 2026 Spring
RSL Revival: Season 5
2026 GSL S1
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
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

Upcoming

Escore Tournament S2: W7
YSL S3
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
BLAST Bounty Summer 2026: Closed Qualifier
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 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.