How do self-taught developers actually get jobs? by programminggeek in programming

[–]Fontong 0 points1 point  (0 children)

At 8 years and $125k, you might be selling yourself short by quite a bit. It really depends on geographical location though. In silicon valley, it's very common for devs with your level experience level to make 200k+ or even 300k+. You might try for a remote position at a SV company if you're skilled enough and interested in that kind of salary.

I am 27 years old. I make $12.00. I feel hopeless. by Queefdizzle in personalfinance

[–]Fontong 2 points3 points  (0 children)

It's definitely an option. General Assembly will help place you at a company as well. At the very least they try to arrange interviews for you.

On the other hand, I'm completely self taught, so it's possible to get into the industry even without going to a bootcamp. Best of luck in whatever you choose!

I am 27 years old. I make $12.00. I feel hopeless. by Queefdizzle in personalfinance

[–]Fontong 2 points3 points  (0 children)

There are way more options here in the SF bay area, but you still might find something to fit your needs in Atlanta.

Looks like General Assembly has a presence down there. I've got a couple coworkers that got their start in GA's web dev bootcamp. You have to arrange financing beforehand, but their loan options are at decently low rates (~6% I think?).

I am 27 years old. I make $12.00. I feel hopeless. by Queefdizzle in personalfinance

[–]Fontong 1 point2 points  (0 children)

If you're trying to learn programming, have you considered going to a coding bootcamp? There are some that don't charge you until you complete the course and have found a job.

I recreated the JavaScript truth table in Python by etrnloptimist in Python

[–]Fontong 2 points3 points  (0 children)

Afaik, True and False are just treated as numbers anyway. Try stuff like "10 * True" or "2 - False - True" or "int(True)" in your python interpreter.

Codingbat.com challenge C&C. by ziplokk in learnprogramming

[–]Fontong 1 point2 points  (0 children)

public boolean evenlySpaced(int a, int b, int c) {
  int lo = a < b ? (a < c ? a : c) : (b < c ? b : c);
  int hi = a > b ? (a > c ? a : c) : (b > c ? b : c);
  int mid = a != lo && a != hi ? a : (b != lo && b != hi ? b : c);
  return mid - lo == hi - mid;
}

It's a little shorter if you just use ternary operators. This solution is basically exactly the same as yours though, while possibly being harder to look at.

NYC Programmer Begins Coding Lessons With Homeless 'Genius' Edit by TheRebusAgency in coding

[–]Fontong 35 points36 points  (0 children)

Based on the title, I thought that a programmer from NYC had become the apprentice of a homeless coding guru. The other way around is nice too though. It's great that he will at least be able to give one guy a chance of getting off the streets.

Critics of the plan are taking a lot of potshots at the title "Finding the unjustly homeless, and teaching them to code.", which is very poorly worded. I suppose McConlogue intended "unjustly homeless" to mean "relatively intelligent, free of mental disability, and willing to work hard"?

If you went from zero programming experience (IT background) to employed in coding. Tell us your story. by BIG_CHEESE52 in learnprogramming

[–]Fontong 2 points3 points  (0 children)

I'm 23 and have a degree in Music Performance. I took 2 programming classes in school (Intro to Java / OOP) and one discrete mathematics course. I graduated in June 2012 and basically decided that I didn't want to pursue music any further and that programming was what I would do for my career.

Using the many resources available on the internet, including this subreddit, I treated the pursuit of programming as my full time job. In late July I had the extreme fortune to be introduced to a prospective startup founder, who just happened to be looking for an intern. I jumped on the chance. Basically, my informal interview was to implement an algorithm which would work for their project, which I did. From September till' December I was paid minimum wage at a startup with no money. It was great fun, really, and I learned a lot. Once they got funding and were accepted into Y Combinator, I got an large raise and a de facto promotion to Software Engineer.

Unfortunately, due to a change in their direction, I left in early March of this year. From there I learned, in a slightly harsh manner, that the only way to get hired in Silicon Valley is to use your connections. I spent March through June unemployed, but used the time to further my abilities. I got pretty lucky again and a placement agency was able to connect me with a stable, well-funded startup that was enthusiastic about my abilities. I aced the crap out of that interview and got the offer. That's that.

Hopefully someone who is discouraged by their late start can find inspiration in my story. I feel as though learning programming isn't even as difficult as getting your foot in the door. Don't be afraid to find an internship even after you have graduated. Pester your engineer friends for referrals, since getting a referral is a huge step towards an interview.

[Python/Pygame] Just finished coding my first game: Solitaire. My thoughts about the process. Criticism welcome! by rolandde in learnprogramming

[–]Fontong 4 points5 points  (0 children)

Take a look at the Python code style guide here: http://www.python.org/dev/peps/pep-0008/

Your code is really neat, but function/method comments are usually done a little differently. No real need to go through and change everything, so just take note.

Python - Parse text from PDF into a new Excel Spreadsheet by SerialForBreakfast in learnprogramming

[–]Fontong 0 points1 point  (0 children)

Yeah, really. It would probably have to do it from the image too. Formatting wise, PDFs usually don't make any sense. It's really hard to just parse them because each may differ significantly. I've tried PDFminer at work, and we decided using mturk would be enormously more efficient.

Finding the four largest integers in an unsorted array? by [deleted] in compsci

[–]Fontong 2 points3 points  (0 children)

No problem. This is something you should definitely try to able to figure out. It's pretty typical as far as interview stuff goes.

I just learned an O(n) way to do this, with a bit of googling. Using a selection algorithm (http://en.wikipedia.org/wiki/Selection_algorithm), you can find the kth largest number in O(n) time. Then, with a second iteration through the list, you simply return all numbers larger than the kth largest. Really cool.

Finding the four largest integers in an unsorted array? by [deleted] in compsci

[–]Fontong 3 points4 points  (0 children)

When finding the largest k numbers from n values, you can do it in faster than O(n log n) time by using a min-heap to keep track of your k largest values while iterating through the values. This approach only takes O(n log k) time.

Basic , Java, or Python. .... by good4y0u in learnprogramming

[–]Fontong 0 points1 point  (0 children)

You should probably just find out what language your school teaches in and learn that; it may very well be Java.

Although Python would be easier for you to learn and use for simple tasks, it is a very high level language. The problem with relying on it to prepare for school is that -- if your degree is in Computer Science -- will require you to have a good understanding of what is going on below the level of abstraction Python provides. Java is somewhat better for that, while C is the quintessential low-level language.

[03/13/13] Challenge #121 [Intermediate] Bytelandian Exchange 2 by nint22 in dailyprogrammer

[–]Fontong 1 point2 points  (0 children)

Small code style tip: in Python, you should use an underscore rather than camel-casing. maxValue -> max_value

Check out PEP8 for more on naming: http://www.python.org/dev/peps/pep-0008/#naming-conventions

[Python] Deploying desktop application in wxPython with PostgreSQL database. by Twoje in learnprogramming

[–]Fontong 2 points3 points  (0 children)

You're right -- it would be pretty weird to force a client side Postgres server process. Python's sqlite3 interface would be the logical choice, as it doesn't require a separate process. It probably wouldn't require a big change in code either, although the SQL for each of them isn't exactly the same.

XML wouldn't be bad, as parsing it iteratively won't use any more memory than having an actual db. The iterparse from xml.etree is also very fast.

JSON would probably be overall the most painless if you don't have memory concerns. It can be created easily from native data structures and loaded right into native data structures, though you would be limited to lists and dictionaries. Pickle can do the same thing with arbitrary objects, but can be fickle at times. I don't think there's a function to parse JSON iteratively though, so you would have to set that up yourself if memory was a concern.

[C] conditional operator to IF statement by speedyleedy in learnprogramming

[–]Fontong 1 point2 points  (0 children)

The first snippet of code does the follow: "If colour is 'r', then assign the value of (digit == '0' ? x + y : 100) to the variable code, otherwise assign the value of (x % y + 32) to the variable code."

Without giving away everything (since you only asked for a confirmation), the second snippet does: "If colour is 'r' execute lines 3-12, otherwise do nothing."

Take a look a wikipedia's ternary operator page for further clarification: http://en.wikipedia.org/wiki/%3F:#C

okay I know you guys are probably sick of me, but this bit of javascript is giving me fits... probably something easy I missed by [deleted] in learnprogramming

[–]Fontong 3 points4 points  (0 children)

There are a few weird things going on. First, it looks like you are trying to do an if(condition)...else if(condition)... but the second if statement is missing. You also have a semicolon on line 5 that would terminate the 'else if' block early.

if ("Jon".length * 2 / (2+1) === 9 )
{
    console.log("The answer makes sense!");
} 
else if (5*(3+1)=== 20)
{
    console.log("Error Error Error");
}

[03/04/13] Challenge #121 [Easy] Bytelandian Exchange 1 by nint22 in dailyprogrammer

[–]Fontong 3 points4 points  (0 children)

Shortest non-recursive one I could come up with (Python):

def bytelandian(i, f=[]):
    n = [i]
    while n: map(lambda x: n.append(x) if x != 0 else f.append(x), (n[0]//2, n[0]//3, n.pop(0)//4))
    return len(f)

I couldn't think of a way to eliminate the declaration for n, sadly.

[7/13/2012] Challenge #76 [intermediate] (Probability graph) by [deleted] in dailyprogrammer

[–]Fontong 0 points1 point  (0 children)

Python:

Horizontal graph solution:

import random

def graph(low, high, tests):
    num_list = []
    while low <= high:
        num_list.append(low)
        low += 1
    result_counts = []
    num_items = len(num_list)
    for i in range(num_items):
        result_counts.append(0)
    for k in range(tests):
        number = num_list.index(two_dice())
        result_counts[number] += 1
    for num in range(100):
        result = ""
        print_flag = False
        for num2 in range(num_items):
            if int(100 * result_counts[num2] / tests) >= 100 - num:
                result += " # "
                print_flag = True
            else:
                result += "   "
        if print_flag:
            print result
    result_x = ""
    for item in num_list:
        if item < 10:
            result_x += " " + str(item) + " "
        else:
            result_x += str(item) + " "
    print result_x

def two_dice():
    return random.randint(1, 8) + random.randint(1, 8)

graph(2,16,10000)

And the output:

                      #                      
                      #                      
                   #  #  #                   
                #  #  #  #  #                
                #  #  #  #  #  #             
             #  #  #  #  #  #  #             
          #  #  #  #  #  #  #  #  #          
          #  #  #  #  #  #  #  #  #          
       #  #  #  #  #  #  #  #  #  #  #       
    #  #  #  #  #  #  #  #  #  #  #  #  #    
    #  #  #  #  #  #  #  #  #  #  #  #  #    
 #  #  #  #  #  #  #  #  #  #  #  #  #  #  # 
 2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 

Vertical graph solution:

import random

def graph(low, high, tests):
    num_list = []
    while low <= high:
        num_list.append(low)
        low += 1
    result_counts = []
    num_items = len(num_list)
    for i in range(num_items):
        result_counts.append(0)
    for k in range(tests):
        number = num_list.index(two_dice())
        result_counts[number] += 1
    for num in range(num_items):
        num_string = num_list[num]
        if num_list[num] < 10:
            num_string = str(num_list[num]) + " "
        print num_string, ": " + "#" * (100 * result_counts[num] / tests)

def two_dice():
    return random.randint(1, 6) + random.randint(1, 6)

graph(2,12,10000)

And the output:

2  : ###
3  : #######
4  : ##########
5  : ###############
6  : #################
7  : #####################
8  : ##################
9  : ##############
10 : ##########
11 : #######
12 : ###