• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 07:53
CEST 13:53
KST 20:53
  • 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] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244
Community News
StarCraft open world shooter announced at BlizzCon63Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?168Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
StarCraft open world shooter announced at BlizzCon How do you feel about the StarCraft shooter announcement at BlizzCon 2026? Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 542 The Ascended Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market Practice Partners (Official) [D] Brainstorming a balance patch for Brood war
Tourneys
[ASL22] Ro16 Group B [ASL22] Ro16 Group A Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
Nintendo Switch Thread Diablo IV EVE Corporation [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Trading/Investing Thread UK Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Movie Discussion! Diablo Animated Series on Netflix
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
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7012 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
Poland17843 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
Poland17843 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
WardiTV Invitational
11:00
Pre Blizzcon Cup
ByuN vs Percival
Cure vs Classic
IntoTheiNu 816
WardiTV537
Liquipedia
Sparkling Tuna Cup
10:00
Weekly #146
herO vs SHINLIVE!
CranKy Ducklings136
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Rex 108
MindelVK 35
StarCraft: Brood War
Britney 29134
Calm 9449
PianO 3901
Jaedong 2290
Pusan 612
firebathero 415
Mini 242
Hyun 224
Last 167
ZerO 81
[ Show more ]
Mong 61
Sharp 52
Killer 47
sSak 44
HiyA 40
Aegong 37
Sea.KH 34
Shinee 29
Trap 25
ggaemo 22
Hm[arnc] 22
NaDa 21
Shine 18
SilentControl 14
ajuk12(nOOB) 14
JulyZerg 12
Rock 12
Dota 2
ODPixel601
Fuzer 183
Counter-Strike
zeus1449
x6flipin518
edward228
Other Games
summit1g16669
Pyrionflax288
DeMusliM220
KnowMe49
ZerO(Twitch)5
Organizations
Other Games
BasetradeTV206
StarCraft: Brood War
UltimateBattle 28
lovetv 8
[ Show 13 non-featured ]
StarCraft 2
• StrangeGG 104
• CranKy Ducklings SOOP26
• Adnapsc2 13
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV270
League of Legends
• Jankos2009
Upcoming Events
Shopify Rebellion Sundays
3h 7m
Spirit vs Mixu
Clem vs TBD
RSL Revival
4h 7m
Serral vs Rogue
BlizzCon
6h 37m
IdrA vs MC
Afreeca Starleague
22h 7m
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
23h 7m
Monday Night Weeklies
1d 4h
Afreeca Starleague
1d 22h
Snow vs Shinee
Shine vs EffOrt
GSL
1d 23h
PiGosaur Cup
2 days
The PondCast
2 days
[ Show More ]
Kung Fu Cup
2 days
Replay Cast
3 days
KCM Race Survival
3 days
IntoTheTV X SOOP
3 days
Replay Cast
4 days
IntoTheTV X SOOP
4 days
Replay Cast
5 days
GSL
5 days
Replay Cast
6 days
GSL
6 days
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Blizzard Classic Cup 2026
Blizzard Classic Cup 2026
RSL Revival: Season 6
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
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
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.