• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 00:07
CET 06:07
KST 14:07
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
StarCraft Evolution League (SC Evo Biweekly) RSL Offline Finals Info - Dec 13 and 14! RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
ZeroSpace Megathread Stormgate/Frost Giant Megathread Nintendo Switch Thread The Perfect Game Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
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
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
James Bond movies ranking - pa…
Topin
Esports Earnings: Bigger Pri…
TrAiDoS
Thanks for the RSL
Hildegard
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1422 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
Poland17496 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
Poland17496 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
Replay Cast
00:00
WardiTV Mondays #62
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 201
trigger 54
StarCraft: Brood War
Tasteless 159
Shine 145
Bale 46
NaDa 34
Icarus 6
Dota 2
monkeys_forever684
NeuroSwarm125
League of Legends
JimRising 768
Counter-Strike
Coldzera 1487
Super Smash Bros
C9.Mang0377
Other Games
summit1g12538
shahzam539
WinterStarcraft456
ViBE170
Mew2King63
Organizations
Other Games
gamesdonequick998
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 104
• Berry_CruncH54
• practicex 19
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• RayReign 19
• Azhi_Dahaki3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Lourlo808
Upcoming Events
The PondCast
4h 53m
OSC
10h 53m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
18h 53m
Korean StarCraft League
1d 21h
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.