• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 17:19
CET 23:19
KST 07:19
  • 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
RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship Constellation Cup - Main Event - Stellar Fest RSL Revival: Season 3
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
[Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET [BSL21] RO16 Group C - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Game Theory for Starcraft How to stay on top of macro? Current Meta PvZ map balance
Other Games
General Games
Stormgate/Frost Giant Megathread ZeroSpace 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: 1673 users

The Big Programming Thread - Page 467

Forum Index > General Forum
Post a Reply
Prev 1 465 466 467 468 469 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.
Manit0u
Profile Blog Joined August 2004
Poland17495 Posts
Last Edited: 2014-04-12 21:48:33
April 12 2014 21:44 GMT
#9321
I use it all the time in MUD development (MMO without graphics) so I guess it'll be useful practically anywhere where you need multiple objects derived from the same base class but being distinct in some way (sword and axe are both weapons but they're completely different in the terms of mechanics, just like helmet needs different stuff than chainmail or shield even though they're all armours and further down the line they're all objects (not in the sense of program objects, literal objects like candle, coin etc.)).
Time is precious. Waste it wisely.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
April 13 2014 01:35 GMT
#9322
On April 13 2014 05:23 Nesserev wrote:
Show nested quote +
On April 13 2014 04:10 obesechicken13 wrote:
All right. I've got a Software Engineering Exam on Tuesday. Can someone explain to me what an Abstract Factory is?

I was reading page 32 here and what I understand so far is that it uses abstractions. But I don't understand the diagram below page 32. If this can be explained with skype, I'll pm you my skype id.

Also the examples they give for Interface segregation are kind of confusing. (Page 14). Can someone explain that too? Does that mean that the different client interfaces are for different users like how an educational website might have interface classes for a teacher, student, and administrator (assuming the server side language was object oriented)?

http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)

In this source they say that it's better to have one responsibility per class. I can agree with this. But why don't they have one class for drawing shapes and one class for defining rectangles. Instead they have one class for drawing only rectangles and one class for defining a rectangle's geometry.

Doesn't that mean they would be making a different drawer for every shape?



After that I'll probably need some help with Cascading (Is this similar to cascading deletes for DB?) and Facade but I'll ask later after I've done more reading.
Are there any good videos I need to watch about creational patterns, structural design patterns, or behavioral patterns?

Secondly, the Interface Segregation:
So, basically, what it comes down to, is that in the first example, every method that is used by the clients is part of one big Service class.

In the second example, every method that is used by a certain type of client, is put in a client specific class/interface. In the end, the Service class inherits all those specific classes/interfaces.

Thanks for all the help guys. This part is still bugging me, shouldn't the client derive its functionality from some contract with the server/service? Because there is only one service and many clients.
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-04-13 02:37:39
April 13 2014 02:29 GMT
#9323
--- Nuked ---
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2014-04-13 04:07:09
April 13 2014 04:06 GMT
#9324
On April 13 2014 11:29 Nesserev wrote:
Show nested quote +
On April 13 2014 10:35 obesechicken13 wrote:
On April 13 2014 05:23 Nesserev wrote:
Secondly, the Interface Segregation:
So, basically, what it comes down to, is that in the first example, every method that is used by the clients is part of one big Service class.

In the second example, every method that is used by a certain type of client, is put in a client specific class/interface. In the end, the Service class inherits all those specific classes/interfaces.

Thanks for all the help guys. This part is still bugging me, shouldn't the client derive its functionality from some contract with the server/service? Because there is only one service and many clients.

Well, that's what happens, the client derives its functionality from ITS contract with the server/service, BUT the service derives its interface from ALL of its contracts with clients.

I'll try to explain this in an abstract way via browsers (client) and servers(service), but I only have a basic understanding of how browsers work, so I hope I don't make (m)any mistakes:

Not all browsers support the same features, should this be a reason for all of them to use different services?
For example:
- All browsers are able to get pages, ofc.
- Browsers A and B both support text
- Browser A also supports images, while Browser B doesn't
- Browser A doesn't support videos, but Browser B does

So, the interfaces of browsers A and B should look like this:
Browser A: getPage, getText, getImage
Browser B: getPage, getText, getVideo

The interfaces serverside for every client individually would be (these are separate classes, will function as base classes)
Interface for A: sendPage, sendText, sendImage
Interface for B: sendPage, sendText, sendVideo

Now we unite those serverside interfaces into one service (Service class is derived from those base classes)
Service : sendPage, sendText, sendImage, sendVideo

I hope this helps a bit?

DISCLAIMER: I'm tired; it's 4:XX am in the morning; I don't want a technical discussion like the one 20-30 pages ago about multiple inheritance and the "dreaded" diamond of dead, because I used an example to explain the concept and nothing more.

I think this makes sense. I'm still trying to wrap my head around concrete classes inheriting from abstract classes and this whole dependency inversion principle. Every little bit helps.
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.
Manit0u
Profile Blog Joined August 2004
Poland17495 Posts
April 13 2014 18:45 GMT
#9325
Ok, I've run into some stupid C# problem. I'm a complete newbie with C# so please bear that in mind before laughing too hard:


public string Date {get; set;} // this is being set externally to either YYYY-MM-DD or " "-" "-" " (whitespace in place of numbers)
private string[] dateCheck;

public void Configure() // being invoked externally, it sets the Date first then calls this method
{
dateCheck = Date.Split('-'); // this gives me a null reference error so I can't proceed

if (String.IsNullorWhitespace(dateCheck[0]))
{
Date = String.Empty; // get rid of whitespace and hyphens if there's nothing to show
}
}


I'm aware that my if check is probably complete garbage and will have to change it but I have no idea why does it throw an error when assigning the value to dateCheck (I have code that does exactly the same thing in another class and it works flawlessly).

Any help is appreciated.
Time is precious. Waste it wisely.
Ame
Profile Joined October 2009
United States246 Posts
April 13 2014 18:46 GMT
#9326
So I'm running Sieve of Eratosthenes and notice it takes a big hit to speed (on my laptop, was 'average' about 5 years ago) as the number to search to rises.

for (int i = 0; i < primeSieve.length; i++)
{
if (!marked[i])
{
primeList.add(primeSieve[i]);
//conditional print statement goes here sometimes
if (primeSieve[i] < Math.sqrt(n))
{
for (int j = primeSieve[i]*primeSieve[i]; j <= n; j+=2*primeSieve[i])
{
marked[(j/2)-1] = true;
}
}
}
}


It's where the slowdown occurs that confuses me. With a cap of around n = 400m, it starts to really slow down around primeSieve[i] ~ 350m. At this point primeSieve[i] is way larger than sqrt(400m), so all that should be happening is check if marked[i] is true/false (boolean array) and then adding it to primeList (ArrayList<Integer>, size() at {primeSieve[i] = 350m} around 19m, init to be such that it never needs to be resized).

If I throw a 'print last prime' statement, it looks the program starts stuttering (prints out blocks of primes, freezes/waits about 5 seconds, prints out another block, etc) with the blocks printing out shrinking in size (towards the end before I stopped the program, it would only print out blocks of about 50 primes before freezing). Task Manager during runtime shows CPU usage ~99% and Physical Memory ~95% :|

It works fine up to n = 350m, ~doubling in run time between n = 150m (15 seconds) and n = 350m (30 seconds). But at 400m it goes LOLNO and runs for over 5-10 minutes before I cut it off. During the 400m run it still spits out primes through 350m fairly quickly (under a minute) before afking past 350m. JVM ran with heap size arguments to handle arrays and ArrayList.

Any idea what this might be or what I should be googling to find out more? Is this some crazy memory access thing?
Millitron
Profile Blog Joined August 2010
United States2611 Posts
April 13 2014 19:29 GMT
#9327
I'm not familiar with the Sieve of Eratosthenes, but is it possible that at around 350m primeSieve is over 2 billion? If primeSieve rolls over, you're screwed and stuck in the second for loop forever.

As for the weird printing, I think that's an artifact of system.out.print. Printing to the screen is horribly slow compared to doing math.
Who called in the fleet?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-04-13 19:35:50
April 13 2014 19:33 GMT
#9328
On April 14 2014 03:45 Manit0u wrote:
Ok, I've run into some stupid C# problem. I'm a complete newbie with C# so please bear that in mind before laughing too hard:


public string Date {get; set;} // this is being set externally to either YYYY-MM-DD or " "-" "-" " (whitespace in place of numbers)
private string[] dateCheck;

public void Configure() // being invoked externally, it sets the Date first then calls this method
{
dateCheck = Date.Split('-'); // this gives me a null reference error so I can't proceed

if (String.IsNullorWhitespace(dateCheck[0]))
{
Date = String.Empty; // get rid of whitespace and hyphens if there's nothing to show
}
}


I'm aware that my if check is probably complete garbage and will have to change it but I have no idea why does it throw an error when assigning the value to dateCheck (I have code that does exactly the same thing in another class and it works flawlessly).

Any help is appreciated.




if (Date != null) {
dateCheck = Date.split('-');
...
} else {
Console.WriteLine("Date not set.");
}



Your Date value is not being set. Should probably put a breakpoint there and check all your values to see if everything's what you expect..
There is no one like you in the universe.
Manit0u
Profile Blog Joined August 2004
Poland17495 Posts
April 13 2014 19:42 GMT
#9329
The thing is, the date was being set. I solved it by making the check in a different class though (before strings are joined with -).
Time is precious. Waste it wisely.
whiteLotus
Profile Blog Joined July 2009
1833 Posts
Last Edited: 2014-04-13 20:05:50
April 13 2014 19:58 GMT
#9330
just a dumb question, is it theoretically possible to actually learn programming through google, various online courses and tutorials, like lets say java,php,jq, maybe some python or C, and actually get a job as a web programmer or smth at some shitty ass company, or you would still ideally need some university courses like advanced math and shit? i dont mean anything like software developer at Blizzard or anything like that lol.
The bird of Hermes is my name, eating my wings to make me tame
cha0
Profile Joined March 2010
Canada507 Posts
April 13 2014 20:15 GMT
#9331
On April 14 2014 04:58 whiteLotus wrote:
just a dumb question, is it theoretically possible to actually learn programming through google, various online courses and tutorials, like lets say java,php,jq, maybe some python or C, and actually get a job as a web programmer or smth at some shitty ass company, or you would still ideally need some university courses like advanced math and shit? i dont mean anything like software developer at Blizzard or anything like that lol.


Anything is possible, even the word impossible is just saying "I'm possible"

On a serious note, yes you can. It is hard and you'll need to have a lot of your own work to show to get noticed since most companies will always look for a degree but with a well maintained portfolio along with really knowing your stuff (Going through the online courses properly and not just skimming through them) you could learn to program and get webdev job. It won't be a walk in the park, but neither is finding a job even with a CS degree.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
April 13 2014 20:23 GMT
#9332
On April 14 2014 04:58 whiteLotus wrote:
just a dumb question, is it theoretically possible to actually learn programming through google, various online courses and tutorials, like lets say java,php,jq, maybe some python or C, and actually get a job as a web programmer or smth at some shitty ass company, or you would still ideally need some university courses like advanced math and shit? i dont mean anything like software developer at Blizzard or anything like that lol.

You certainly can become good enough, the question is whether you can get an invitation to an interview. The majority of my knowledge is from the internet and books, university was a painful waste of time.
Proof techniques, combinatorics and matrices are pretty much the only things I learnt at univeristy and consider relevant. For comp sci stuff, it was far more efficient to just read it up myself.

But I don't know how good universities are where you live, and having a piece of paper saying "I provably spent some time on learning moderately relevant stuff" is rather effective for getting a job.
If you have a good reason to disagree with the above, please tell me. Thank you.
Cyx.
Profile Joined November 2010
Canada806 Posts
Last Edited: 2014-04-13 20:35:00
April 13 2014 20:34 GMT
#9333
On April 14 2014 03:46 Ame wrote:
So I'm running Sieve of Eratosthenes and notice it takes a big hit to speed (on my laptop, was 'average' about 5 years ago) as the number to search to rises.

for (int i = 0; i < primeSieve.length; i++)
{
if (!marked[i])
{
primeList.add(primeSieve[i]);
//conditional print statement goes here sometimes
if (primeSieve[i] < Math.sqrt(n))
{
for (int j = primeSieve[i]*primeSieve[i]; j <= n; j+=2*primeSieve[i])
{
marked[(j/2)-1] = true;
}
}
}
}


It's where the slowdown occurs that confuses me. With a cap of around n = 400m, it starts to really slow down around primeSieve[i] ~ 350m. At this point primeSieve[i] is way larger than sqrt(400m), so all that should be happening is check if marked[i] is true/false (boolean array) and then adding it to primeList (ArrayList<Integer>, size() at {primeSieve[i] = 350m} around 19m, init to be such that it never needs to be resized).

If I throw a 'print last prime' statement, it looks the program starts stuttering (prints out blocks of primes, freezes/waits about 5 seconds, prints out another block, etc) with the blocks printing out shrinking in size (towards the end before I stopped the program, it would only print out blocks of about 50 primes before freezing). Task Manager during runtime shows CPU usage ~99% and Physical Memory ~95% :|

It works fine up to n = 350m, ~doubling in run time between n = 150m (15 seconds) and n = 350m (30 seconds). But at 400m it goes LOLNO and runs for over 5-10 minutes before I cut it off. During the 400m run it still spits out primes through 350m fairly quickly (under a minute) before afking past 350m. JVM ran with heap size arguments to handle arrays and ArrayList.

Any idea what this might be or what I should be googling to find out more? Is this some crazy memory access thing?


So wild guess - I might be really wrong - but on an old system with 2GB of RAM the max you'd be able to fit in RAM even with nothing else happening at all would be like 500 million ints or so, meaning that other things could reasonably eat up a couple hundred million of those spaces, leaving you with room for 300 million ints in memory before you started requiring a LOT of disk accesses, which would totally destroy your performance.
Ame
Profile Joined October 2009
United States246 Posts
April 13 2014 21:03 GMT
#9334
On April 14 2014 04:29 Millitron wrote:
I'm not familiar with the Sieve of Eratosthenes, but is it possible that at around 350m primeSieve is over 2 billion? If primeSieve rolls over, you're screwed and stuck in the second for loop forever.

As for the weird printing, I think that's an artifact of system.out.print. Printing to the screen is horribly slow compared to doing math.


Whoops, some clarity: by 350m primeSieve, I meant the integer is ~350,000,000, so not worried about overflow yet, at least I don't think. And yea, I've run into the system.out.print being slow a bit back when I noticed run time went from minutes to seconds or something ridic by cutting out printing during steps the first time I tried to throw together a prime generator. :p

Still ran for over 5 minutes of nothing before I cut out without the print statements, so I don't think it was printing alone. I mainly threw in printing to make sure the ranges were still in values expected for the loop (checking for overflow) and to see where performance started taking a hit (the 350m figure).

On April 14 2014 05:34 Cyx. wrote:
So wild guess - I might be really wrong - but on an old system with 2GB of RAM the max you'd be able to fit in RAM even with nothing else happening at all would be like 500 million ints or so, meaning that other things could reasonably eat up a couple hundred million of those spaces, leaving you with room for 300 million ints in memory before you started requiring a LOT of disk accesses, which would totally destroy your performance.


I had a vague notion that it might have been a reason like this, but before now haven't read too much into RAM vs disk access/etc.. With your guess I will be doing so now.

+ Show Spoiler [Ramblings] +

Other details for fun: laptop system claims 4GB, but no idea how much of that Java can probably access. Having to use <Integer> in ArrayList instead of being able to use int probably adds decent bit of memory overhead, and other inefficiencies I have sound enough to push things out of RAM into disk anyways. Without some trickery (reading up on partitioned sieves and stuff), looks like I'm actually approaching the limit of how many primes I can generate gg.

Original problem was actually just to check if a list of arbitrary large numbers were prime, so turns out using BigInteger.probablePrime() ending up being a way faster solution (well not really arbitrary and there's probably some really fancy mathematical way to do it, but math). Now just to code my own version of Miller Rabin, hue.

bangsholt
Profile Joined June 2011
Denmark138 Posts
April 13 2014 21:39 GMT
#9335
On April 14 2014 04:42 Manit0u wrote:
The thing is, the date was being set. I solved it by making the check in a different class though (before strings are joined with -).


Why are you not converting the string date into a DateTime or something similar as soon as you can? You can always get the string representation at a later point - or even use Humanizer, if it's to show for a user.

http://www.hanselman.com/blog/NuGetPackageOfTheWeekHumanizerMakesNETDataTypesMoreHuman.aspx
Manit0u
Profile Blog Joined August 2004
Poland17495 Posts
Last Edited: 2014-04-13 23:52:33
April 13 2014 21:43 GMT
#9336
On April 14 2014 05:23 spinesheath wrote:
Show nested quote +
On April 14 2014 04:58 whiteLotus wrote:
just a dumb question, is it theoretically possible to actually learn programming through google, various online courses and tutorials, like lets say java,php,jq, maybe some python or C, and actually get a job as a web programmer or smth at some shitty ass company, or you would still ideally need some university courses like advanced math and shit? i dont mean anything like software developer at Blizzard or anything like that lol.

You certainly can become good enough, the question is whether you can get an invitation to an interview. The majority of my knowledge is from the internet and books, university was a painful waste of time.
Proof techniques, combinatorics and matrices are pretty much the only things I learnt at univeristy and consider relevant. For comp sci stuff, it was far more efficient to just read it up myself.

But I don't know how good universities are where you live, and having a piece of paper saying "I provably spent some time on learning moderately relevant stuff" is rather effective for getting a job.


It all depends. I have a friend who quit uni because he couldn't be bothered with this kind of stuff and now is a top notch programmer working for big companies (Symantec, Oracle and such). What's most important in this business is the experience, nothing beats that. You can learn all you want from books/courses/studies but at the end of the day it all comes down to 'Are you experienced enough to do it without really thinking about it?'. That's the feeling I get when I'm asking my friends who are established programmers for some help. They're able to solve the problems that take me several hours in 5 minutes and do it way more efficiently and elegantly than I could ever hope to do now. Because they all have 10+ years in doing this stuff under their belts they know the realities, all the design patterns and best ways to do things inside out.

I'm pretty much in your position right now. I want to change my job and move to a completely different sector. I know some general OOP, I understand the code pretty well and can do most of the basic/intermediate stuff in any of the C-family languages (C, C#, C++, Java, PHP, Python, LPC - I did some minor freelance stuff in all of them) but getting a real job is a different story entirely.

Stuff you MUST know (because that's what they'll ask you for in 90% of job interviews even for an internship):
- at least one framework (in case of PHP/Python)
- UML and design patterns
- at least one version control system (git and svn are the most common)
- pretty good overall knowledge of the language, associated libraries etc.
- in case of PHP/Python they'll also require some knowledge of JS/CSS/HTML most of the time and SQL every time

During my interviews I've found out that they're not really interested in 'if you can do it' but rather 'if you can do it the way they want you to'.

That's actually a lot of stuff to learn by yourself, but it's doable if you don't go too broad (like I did) but instead pick something popular and go deep with that first, branching out will be easier when you've mastered it.

For PHP/webdev you would need:
0. General PHP - including PDO, MVC and OO stuff in PHP
1. Zend framework - pretty popular and relatively easy to get into, unlike say Symfony
2. MySQL - databases are a must
3. Some JS/CSS/HTML - CSS/HTML are pretty easy, JS shouldn't be much of a trouble if you get a hang on PHP
4. GIT
5. Design patterns for PHP

This package should get you a job no problem. After the first job it should be easier since you'll be able to score some experience and build up your portfolio.

Just some food for thought.
Time is precious. Waste it wisely.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
April 14 2014 07:12 GMT
#9337
On April 14 2014 04:58 whiteLotus wrote:
just a dumb question, is it theoretically possible to actually learn programming through google, various online courses and tutorials, like lets say java,php,jq, maybe some python or C, and actually get a job as a web programmer or smth at some shitty ass company, or you would still ideally need some university courses like advanced math and shit? i dont mean anything like software developer at Blizzard or anything like that lol.

Not a dumb question, and it is most certainly possible as I did it myself. Ideally you would take some math and data structures/algorithms courses (as I did at a local junior college). I'm working alongside some ivy league graduates (Cornell), we get paid on the same scale.

As far as working for Blizzard or other corporate companies it's just a bit trickier to get started. For the last 5 years I've worked at startups around the bay area, so it's easier for me to get interviews at other startups than at big companies like Google/Apple/LinkedIn.

You absolutely need to know your data structures and algorithms to be a successful software engineer anywhere. Learning languages, frameworks and APIs is secondary to that. I've done phone screens with a ton of engineers with good looking resumes that list relevant technologies, but then when I ask them a stupidly simple question (like what's the difference between a stack and a queue, or hash vs array) and they can't come up with anything.

If you really think that you want to be a software engineer then I recommend you find an intro to CS class online (I think UC Berkeley has published a video version of theirs, as has MIT). Follow along with every exercise, use google to figure out how things work if you don't understand, and then find yourself the data structures and algorithms class and do the same.

After if you're still interested you should have a better idea of a direction you want to go, and some things that you want to learn. If you're leaning to the web side then take a class on databases. There's a lot to learn there about mapping out an application to a relational database, and how to ensure performance and scalability. You should be able to build yourself a neat little Rails/Django/Express app afterwards, maybe integrate with some web APIs. If you're really engaged with this then you'll probably find yourself wanting to learn more about javascript, one of the better books to read on the subject is Douglas Crockford's Javascript: The good parts.

If you're interested in the mobile application development side then find a class on objective C or java for android and build yourself a neat little app.

I'd recommend you test cover your personal projects, you'll force yourself to write better code (untestable code is bad code) and when you go to show it off in an interview you'll get big bonus points. I've interviewed people who say they like testing and have experience with TDD, but then show us personal projects with zero test coverage. It's a big turn off to see someone talk the talk but not walk the walk, and even more so since we require everyone to test cover their code.

TL;DR: Yes, I did it.
LaNague
Profile Blog Joined April 2010
Germany9118 Posts
Last Edited: 2014-04-14 12:16:21
April 14 2014 12:13 GMT
#9338
On April 14 2014 04:58 whiteLotus wrote:
just a dumb question, is it theoretically possible to actually learn programming through google, various online courses and tutorials, like lets say java,php,jq, maybe some python or C, and actually get a job as a web programmer or smth at some shitty ass company, or you would still ideally need some university courses like advanced math and shit? i dont mean anything like software developer at Blizzard or anything like that lol.


i dont know how it is in other countries, but "programmer" is actually not a university profession in germany, its an apprenticeship thing on a school level.
You can learn programming with books for sure, i did when i was a kid.


But the whole design part and scientific thinking that you need for complex problems is hard to aquire without someone teaching you.
misirlou
Profile Joined June 2010
Portugal3241 Posts
April 14 2014 13:04 GMT
#9339
On April 14 2014 06:03 Ame wrote:
Show nested quote +
On April 14 2014 04:29 Millitron wrote:
I'm not familiar with the Sieve of Eratosthenes, but is it possible that at around 350m primeSieve is over 2 billion? If primeSieve rolls over, you're screwed and stuck in the second for loop forever.

As for the weird printing, I think that's an artifact of system.out.print. Printing to the screen is horribly slow compared to doing math.


Whoops, some clarity: by 350m primeSieve, I meant the integer is ~350,000,000, so not worried about overflow yet, at least I don't think. And yea, I've run into the system.out.print being slow a bit back when I noticed run time went from minutes to seconds or something ridic by cutting out printing during steps the first time I tried to throw together a prime generator. :p

Still ran for over 5 minutes of nothing before I cut out without the print statements, so I don't think it was printing alone. I mainly threw in printing to make sure the ranges were still in values expected for the loop (checking for overflow) and to see where performance started taking a hit (the 350m figure).

Show nested quote +
On April 14 2014 05:34 Cyx. wrote:
So wild guess - I might be really wrong - but on an old system with 2GB of RAM the max you'd be able to fit in RAM even with nothing else happening at all would be like 500 million ints or so, meaning that other things could reasonably eat up a couple hundred million of those spaces, leaving you with room for 300 million ints in memory before you started requiring a LOT of disk accesses, which would totally destroy your performance.


I had a vague notion that it might have been a reason like this, but before now haven't read too much into RAM vs disk access/etc.. With your guess I will be doing so now.

+ Show Spoiler [Ramblings] +

Other details for fun: laptop system claims 4GB, but no idea how much of that Java can probably access. Having to use <Integer> in ArrayList instead of being able to use int probably adds decent bit of memory overhead, and other inefficiencies I have sound enough to push things out of RAM into disk anyways. Without some trickery (reading up on partitioned sieves and stuff), looks like I'm actually approaching the limit of how many primes I can generate gg.

Original problem was actually just to check if a list of arbitrary large numbers were prime, so turns out using BigInteger.probablePrime() ending up being a way faster solution (well not really arbitrary and there's probably some really fancy mathematical way to do it, but math). Now just to code my own version of Miller Rabin, hue.



I made a sieve with some optimizations, source at https://github.com/Misirlou/CparParallelSieve/blob/master/single.c
There are 3 different functions, named 1,2 and 3 . The first function is terribly slow for anything greater than n=2^27, that is computing all primes lower than 2^27. I can get the other ones to run till 2^33 under a minute. The 3rd function takes an extra argument that defines a block size. This is used to split the sieve into little pieces so the array gets stored in cache instead of RAM, which is a much faster memory, as the results I collected can prove, on google spreadsheet
I also stored the primes not as an int array but in a char array. Every bit of a char represents a number, so one char can hold 8 "numbers". If it's unmarked when the computation is finished, it means that number is a prime. I also don't have a position for even numbers, I skip them entirely because the only even number that is prime is 2. All of this was done in an effort to use the least amount of memory. The code gets a little more tricky and it takes more operations to access an element but these operations are meaningless compared to what I save in memory access.

On your code shouldn't marked and sieve be the same array?




aksfjh
Profile Joined November 2010
United States4853 Posts
April 14 2014 17:28 GMT
#9340
I created a heartbleed detection script for Perl. Figured I would share it with you guys and answer any questions or comments about the vulnerability or Perl.

http://www.github.com/aksfjh/heartbleed
Prev 1 465 466 467 468 469 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 41m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
CosmosSc2 5
StarCraft: Brood War
Calm 2206
Shuttle 427
Larva 174
Dewaltoss 112
Dota 2
syndereN1139
Counter-Strike
fl0m1282
Foxcn262
Heroes of the Storm
Liquid`Hasu531
Other Games
Grubby6670
FrodaN989
RotterdaM185
ArmadaUGS99
C9.Mang096
Maynarde67
ZombieGrub27
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• HeavenSC 68
• musti20045 21
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• RayReign 0
• ZZZeroYoutube
• BSLYoutube
Dota 2
• Ler129
League of Legends
• Doublelift2275
• TFBlade1191
Other Games
• imaqtpie1374
• Scarra645
• Shiphtur160
Upcoming Events
Replay Cast
1h 41m
The PondCast
11h 41m
OSC
17h 41m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
1d 1h
Korean StarCraft League
2 days
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
[ Show More ]
Sparkling Tuna Cup
3 days
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
5 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
6 days
StarCraft2.fi
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.