Software Development and Programming Careers (Official Discussion Thread)

KritNC

All Star
Joined
Jun 5, 2012
Messages
3,440
Reputation
610
Daps
4,085
Reppin
Costa Rica
So I have always been really into sports betting and have followed this guys model for a while.

I decided to write a program that would grab his data, grab the vegas line, compare the two and point out the largest discrepancies between the two.

I originally had it as just a command line tool where you would enter a url and it would output your info but I decided to build it out into a full web app.

Here is the command line version
1vfQDsW.png



Here is the webapp version
JwetvPV.png


I am about to upload it to heroku

Here is the main code that parses the ratings and returns the results

class Games::Import < Less::Interaction
expects :url
expects :sport
# Massey Ratings
# Games::Import.run(url: 'Massey Ratings', sport: 'ncaa_football' )

def run
html = get_massey_html
fetch_and_save_team_data(html)
end

private

def save_game(game_hash)
unless Game.where(home_team_name: game_hash[:home_team_name], away_team_name: game_hash["away_team_name"]).present?
Game.create!(game_hash)
end
end

def get_massey_html
browser = Watir::Browser.new :phantomjs
browser.goto url
browser.button(id: 'showVegas').click
doc = Nokogiri::HTML(browser.html)
browser.close
doc.css('.bodyrow')
end

def fetch_and_save_team_data(html)
html.each do |row|
unless invalid_data(row)
game_hash = set_game_hash(row)

save_game(game_hash)
end
end
end

def invalid_data(row)
if row.css('.fscore')[1].children.first.text == "---"
true
elsif row.css('.fscore')[1].children.last.text == "---"
true
elsif row.css('.fscore').last.children.first.text == "---"
true
else
false
end
end

def set_game_hash(row)
{
home_team_massey_line: get_home_team_massey_line(row),
away_team_massey_line: -get_home_team_massey_line(row),
away_team_name: row.css('.fteam').first.css('a').first.children.text,
home_team_name: row.css('.fteam').first.css('a').last.children.text,
home_team_vegas_line: get_home_team_vegas_line(row),
away_team_vegas_line: -get_home_team_vegas_line(row),
vegas_over_under: row.css('.fscore').last.children.first.text.to_f,
massey_over_under: row.css('.fscore').last.children.last.text.to_f,
date: format_date(row),
sport: sport,
line_diff: (get_home_team_massey_line(row) - get_home_team_vegas_line(row)).abs,
over_under_diff: (row.css('.fscore').last.children.first.text.to_f - row.css('.fscore').last.children.last.text.to_f).abs,
team_to_bet: find_team_to_bet(row),
over_under_pick: pick_over_under(row)
}
end

def pick_over_under(row)
if row.css('.fscore').last.children.last.text.to_f - row.css('.fscore').last.children.first.text.to_f > 0
"Over"
else
"Under"
end
end

def find_team_to_bet(row)
if get_home_team_massey_line(row) - get_home_team_vegas_line(row) > 0
row.css('.fteam').first.css('a').first.children.text
else
row.css('.fteam').first.css('a').last.children.text
end
end

def format_date(row)
Date.parse(row.css('.fdate').first.children.first.children.first.text)
end

def get_home_team_massey_line(row)
game_array = row.css('.fscore')[1].children.to_a
return -1 * game_array.first.text.to_f if game_array.first.attributes["class"].value == 'ltgreen'
return game_array.last.text.to_f if game_array.last.attributes["class"].value == ' ltgreen'
end

def get_home_team_vegas_line(row)
game_array = row.css('.fscore')[1].children.to_a
return -1 * game_array.first.text.to_f if game_array.first.attributes["class"].value == 'ltred'
return game_array.last.text.to_f if game_array.last.attributes["class"].value == 'ltred'
end

def game_params(game_data)
{
sport: sport,
home_team_name: game_data[:home_team_ame],
away_team_name: game_data[:away_team_name],
home_team_massey_line: game_data[:homw_team_massey_line],
away_team_massey_line: game_data[:away_team_massey_line],
home_team_vegas_line: game_data[:home_team_vegas_line],
away_team_vegas_line: game_data[:away_team_vegas_line],
vegas_over_under: game_data[:vegas_over_under],
massey_over_under: game_data[:massey_over_under],
line_diff: (game_data[:home_team_massey_line] - game_data[:home_team_vegas_line]).abs,
date: game_data[:date]
}
end
end


As the season goes on I am going to track the results and see how it performs.

It is always good to combine coding with something you are interested in. It's good practice and you get to learn new shyt.
 

MrPentatonic

Superstar
Joined
May 2, 2012
Messages
4,226
Reputation
670
Daps
14,068
Reppin
NULL
I finished the c# Microsoft virtual academy course now I finally understand what Im reading lol.

Imma do the pluralsight c# pathway noe and supplement it with a text heavy book that has practice projects so i can cement all that in Alot of the books get way easier to read once you have the fundamentals down. Thank God for video resources.

Hopefully I can get that done in a 1-2 months or two and just get my head into little practice projects and carry on learning.

Thanks to the people in this thread for the help!
 
Joined
Jan 30, 2016
Messages
1,645
Reputation
150
Daps
3,069
So I have always been really into sports betting and have followed this guys model for a while.

I decided to write a program that would grab his data, grab the vegas line, compare the two and point out the largest discrepancies between the two.

I originally had it as just a command line tool where you would enter a url and it would output your info but I decided to build it out into a full web app.

Here is the command line version
1vfQDsW.png



Here is the webapp version
JwetvPV.png


I am about to upload it to heroku

Here is the main code that parses the ratings and returns the results

class Games::Import < Less::Interaction
expects :url
expects :sport
# Massey Ratings
# Games::Import.run(url: 'Massey Ratings', sport: 'ncaa_football' )

def run
html = get_massey_html
fetch_and_save_team_data(html)
end

private

def save_game(game_hash)
unless Game.where(home_team_name: game_hash[:home_team_name], away_team_name: game_hash["away_team_name"]).present?
Game.create!(game_hash)
end
end

def get_massey_html
browser = Watir::Browser.new :phantomjs
browser.goto url
browser.button(id: 'showVegas').click
doc = Nokogiri::HTML(browser.html)
browser.close
doc.css('.bodyrow')
end

def fetch_and_save_team_data(html)
html.each do |row|
unless invalid_data(row)
game_hash = set_game_hash(row)

save_game(game_hash)
end
end
end

def invalid_data(row)
if row.css('.fscore')[1].children.first.text == "---"
true
elsif row.css('.fscore')[1].children.last.text == "---"
true
elsif row.css('.fscore').last.children.first.text == "---"
true
else
false
end
end

def set_game_hash(row)
{
home_team_massey_line: get_home_team_massey_line(row),
away_team_massey_line: -get_home_team_massey_line(row),
away_team_name: row.css('.fteam').first.css('a').first.children.text,
home_team_name: row.css('.fteam').first.css('a').last.children.text,
home_team_vegas_line: get_home_team_vegas_line(row),
away_team_vegas_line: -get_home_team_vegas_line(row),
vegas_over_under: row.css('.fscore').last.children.first.text.to_f,
massey_over_under: row.css('.fscore').last.children.last.text.to_f,
date: format_date(row),
sport: sport,
line_diff: (get_home_team_massey_line(row) - get_home_team_vegas_line(row)).abs,
over_under_diff: (row.css('.fscore').last.children.first.text.to_f - row.css('.fscore').last.children.last.text.to_f).abs,
team_to_bet: find_team_to_bet(row),
over_under_pick: pick_over_under(row)
}
end

def pick_over_under(row)
if row.css('.fscore').last.children.last.text.to_f - row.css('.fscore').last.children.first.text.to_f > 0
"Over"
else
"Under"
end
end

def find_team_to_bet(row)
if get_home_team_massey_line(row) - get_home_team_vegas_line(row) > 0
row.css('.fteam').first.css('a').first.children.text
else
row.css('.fteam').first.css('a').last.children.text
end
end

def format_date(row)
Date.parse(row.css('.fdate').first.children.first.children.first.text)
end

def get_home_team_massey_line(row)
game_array = row.css('.fscore')[1].children.to_a
return -1 * game_array.first.text.to_f if game_array.first.attributes["class"].value == 'ltgreen'
return game_array.last.text.to_f if game_array.last.attributes["class"].value == ' ltgreen'
end

def get_home_team_vegas_line(row)
game_array = row.css('.fscore')[1].children.to_a
return -1 * game_array.first.text.to_f if game_array.first.attributes["class"].value == 'ltred'
return game_array.last.text.to_f if game_array.last.attributes["class"].value == 'ltred'
end

def game_params(game_data)
{
sport: sport,
home_team_name: game_data[:home_team_ame],
away_team_name: game_data[:away_team_name],
home_team_massey_line: game_data[:homw_team_massey_line],
away_team_massey_line: game_data[:away_team_massey_line],
home_team_vegas_line: game_data[:home_team_vegas_line],
away_team_vegas_line: game_data[:away_team_vegas_line],
vegas_over_under: game_data[:vegas_over_under],
massey_over_under: game_data[:massey_over_under],
line_diff: (game_data[:home_team_massey_line] - game_data[:home_team_vegas_line]).abs,
date: game_data[:date]
}
end
end


As the season goes on I am going to track the results and see how it performs.

It is always good to combine coding with something you are interested in. It's good practice and you get to learn new shyt.

are you the same guy who made that kanye tweets web app? this is real good. i do stuff like this from time to time. but sometimes i feel like i've lost a lil bit of the passion for programming, because it feels like im forcing myself to do a bunch of shyt just for career advancement, not necessarily because i want to learn it. if it was really up to me i would mess around with really esoteric stuff because that's just me, I get bored quickly and i want to move on. I've really wanted to learn Haskell for the longest time but haven't come up with a justification to put in the time. I've also really wanted to dikk around with the real wild west stuff like Brainfukk and Piet, a programming language based not on words, syntax but images (DM's Esoteric Programming Languages - Piet).

keep sharing your stuff here dude. this is great.
 

PikaDaDon

Thunderbolt Them Suckers
Joined
Oct 13, 2012
Messages
9,361
Reputation
2,335
Daps
25,316
Reppin
NULL
So I see nobody's stepped up to the plate to organize that open source video game venture we said we were going to do - should I start PMing ppl and setting things up?

Yeah my fault. I want to setup the base code for 3 projects (beginner, intermediate, advanced) before I make the thread and....I just made a free github account.....like seconds ago. There might be limitations on what I can do with it but I'll stick with it I guess.

Also my initiative isn't just about 'video games'. It could be about anything. A video game is a bit more complex and would involve music composers, concept artists, 3d artists, writers, etc. Though I somehow got the feeling that the coli has all of these people here. Would be cool if we can draw in non-programmers into this.

I'm still up for it. I actually have more free time now since I dropped my art class( straight boring ).

I think the problem is, people want to use different languages( which is understandable ).

Yeah......am I the only c++ guy here? I get the impression that c++ is a relic and a thing of the past. I see lots of people fukking with c# and python mainly.

If we are using Unity we are pretty muched locked in to C# (and Python I think) though. It's not really going to work out if everyone is out doing their own thing in whatever language they like.

I think what will happen is that everyone will post their own project. The most interesting projects will probably have the most contribution (people don't want to work on boring things). I'd imagine a 2D side scrolling beat 'em up in c# would get more people interested than say a word processor or an mp3 player.

Cool. I was thinking about doing a First person shooter now. I feel it's better to start from scratch than use one of Unity Assets.

If everybody is cool with that, I have a good tutorial from Unity website( very basic ) I can post later.

A FPS would be cool. Personally I plan on starting with a simpler game project like a pong, a breakout clone, a space shooter, or maybe a puzzle game.

yea a lot of ppl underestimate how long good games can take to create, especially if it's just a side thing and you are not dedicating a huge amount of time to it. another good example is the dude who created Axiom Verge (Axiom Verge on Steam). took him 5 years. but the most impressive thing to me is he created the sprites, music, programmed everything, did it all. i can code but on the artistic side i'm not so skilled so it's always been an issue anytime i've started on a project.

I used to be somewhat competent with 3ds max and photoshop years ago until I lost motivation. I follow lynda.com tutorials. Very good site.
 
Last edited:

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,291
Reputation
5,551
Daps
83,482
Yeah my fault. I want to setup the base code for 3 projects (beginner, intermediate, advanced) before I make the thread and....I just made a free github account.....like seconds ago. There might be limitations on what I can do with it but I'll stick with it I guess.

Also my initiative isn't just about 'video games'. It could be about anything. A video game is a bit more complex and would involve music composers, concept artists, 3d artists, writers, etc. Though I somehow got the feeling that the coli has all of these people here. Would be cool if we can draw in non-programmers into this.



Yeah......am I the only c++ guy here? I get the impression that c++ is a relic and a thing of the past. I see lots of people fukking with c# and python mainly.



I think what will happen is that everyone will post their own project. The most interesting projects will probably have the most contribution (people don't want to work on boring things). I'd imagine a 2D side scrolling beat 'em up in c# would get more people interested than say a word processor or an mp3 player.



A FPS would be cool. Personally I plan on starting with a simpler game project like a pong, a breakout clone, a space shooter, or maybe a puzzle game.



I used to be somewhat competent with 3ds max and photoshop years ago until I lost motivation. I follow lynda.com tutorials. Very good site.

I wouldn't mind eventually learning C++ to get a better idea of what's going on underneath the hood. It's something I actually planned on doing, but unfortunately, I don't have the time right now with all of the other things I've been learning. C++ is a must if you want to get in the mainstream game industry (non-indie), but it seems like a lot of industries that employ programmers have moved away from C++ to some of the languages you talked about above like C# or Python.
 

kevm3

follower of Jesus
Supporter
Joined
May 2, 2012
Messages
16,291
Reputation
5,551
Daps
83,482
Something I've found as a programmer is that you just have to pick a few core technologies and roll with it. I've been spreading myself around by trying to learn too many different technologies and it becomes hard to grasp what's going on at a deeper level with any one technology because of it. For example, in the Javascript front-end world, there are 10,000 different libraries or frameworks you could dabble with. It's simply impossible to know them all. You simply have to pick one and roll with it. For me, that's angular 2. In terms of back-end, I'll probably start focusing on Node.js. Ruby on rails is nice, but it's easier to integrate Angular 2 and other JS libraries/frameworks with node.
 

semtex

:)
Joined
May 1, 2012
Messages
20,311
Reputation
3,386
Daps
46,185
Something I've found as a programmer is that you just have to pick a few core technologies and roll with it. I've been spreading myself around by trying to learn too many different technologies and it becomes hard to grasp what's going on at a deeper level with any one technology because of it. For example, in the Javascript front-end world, there are 10,000 different libraries or frameworks you could dabble with. It's simply impossible to know them all. You simply have to pick one and roll with it. For me, that's angular 2. In terms of back-end, I'll probably start focusing on Node.js. Ruby on rails is nice, but it's easier to integrate Angular 2 and other JS libraries/frameworks with node.
absolutely. Might as well throw MongoDB in there as well and get rolling with the whole MEAN stack.
 

Data-Hawk

I have no strings on me.
Joined
May 6, 2012
Messages
8,419
Reputation
1,985
Daps
16,285
Reppin
Oasis
A FPS would be cool. Personally I plan on starting with a simpler game project like a pong, a breakout clone, a space shooter, or maybe a puzzle game.

Cool. I guess when somebody has a project up and something basic. We can all take a look.

Also if anybody is working on a personal HTML/Javascript project. Please share. I'm working on a HTML reporter at work. So anything to look at would be helpful.

I guess a platformer or something of that short would be the easiest/less frustrating project to start off with. I'll see if i can get the ball rolling ( my work talk lingo :laff::laff:) and post it here.

I'll look for some videos to post shortly.

what do you think @craz_eddy ? drop the FPS and do something simpler? 2D games don't involve the Z-Axis, so there's less work right off the bat.

Here's another game developed by one person( He said he did everything except the music )
 
Joined
Jan 30, 2016
Messages
1,645
Reputation
150
Daps
3,069
Yeah......am I the only c++ guy here? I get the impression that c++ is a relic and a thing of the past. I see lots of people fukking with c# and python mainly.

C++ just isn't as popular as it used to be. These days if you want to stay employed the best languages to have under your belt are Java, C#, Python and Javascript. C++ is very niche. Even in game development it's really only used when you are building game engines, and majority of people working at game development studios don't do that. Unity pretty much caused the indie video game scene to blow up and you mainly use C# there. I know a few companies where even the majority of employees are artists / designers and the few programmers that are there program with C# on Unity. Dynamics of the industry have changed. I would strongly recomment you focus on and master at least one of the languages I've mentioned so that you don't feel so out of place. C++ is good but it's really niche so you are pigeonholing to only a few developer roles (you might even get paid less on average).
 
Joined
Jan 30, 2016
Messages
1,645
Reputation
150
Daps
3,069
absolutely. Might as well throw MongoDB in there as well and get rolling with the whole MEAN stack.

Before comitting to MongoDB I'd suggest to everyone that they research the relative advantages NoSQL databases have over RDBMs. Thing with MongoDB is that it's good when relationships between entities are not so clear cut (let's say you are just starting out and still not sure how your data will be structured). However, it doesn't scale as well when everything is clear cut AND you need the relations to be robust. For large sites with lots of traffic, MongoDB could end up fukking you over big time. If you are just whipping up a quick web app MEAN stack is alright, but if you want to scale you will probably be forced to use a relational database and a classical object oriented statically typed language in the backend like Java or C#. There's a reason why these two languages are popular at banks and really large corporations rather than Python and Javascript.

Basically my point is before committing to a whole technology stack it would be wise to evaluate its merits (compared to what other technologies are doing) and make your decision accordingly. Don't just learn what's being hyped just because .... you will end up wasting a lot of your time. The software / web world is in turmoil where a lot of the new devs are basically repeating the mistakes of the past and every couple of years people are re-writing entire web apps just cause a new thing has come on the scene.
 

semtex

:)
Joined
May 1, 2012
Messages
20,311
Reputation
3,386
Daps
46,185
Before comitting to MongoDB I'd suggest to everyone that they research the relative advantages NoSQL databases have over RDBMs. Thing with MongoDB is that it's good when relationships between entities are not so clear cut (let's say you are just starting out and still not sure how your data will be structured). However, it doesn't scale as well when everything is clear cut AND you need the relations to be robust. For large sites with lots of traffic, MongoDB could end up fukking you over big time. If you are just whipping up a quick web app MEAN stack is alright, but if you want to scale you will probably be forced to use a relational database and a classical object oriented statically typed language in the backend like Java or C#. There's a reason why these two languages are popular at banks and really large corporations rather than Python and Javascript.

Basically my point is before committing to a whole technology stack it would be wise to evaluate its merits (compared to what other technologies are doing) and make your decision accordingly. Don't just learn what's being hyped just because .... you will end up wasting a lot of your time. The software / web world is in turmoil where a lot of the new devs are basically repeating the mistakes of the past and every couple of years people are re-writing entire web apps just cause a new thing has come on the scene.
Great post. Spoken like a true architect or VP of engineering.

I'm a full stack dev professionally and we use C# as the server side language and of course SQL databases for persistence. At home I like to dabble in MEAN stack because it's so easy to get up and running with it. But yes it's very important to note that companies will rarely be on the bleeding edge of technology and will have tons of legacy shyt so folks shouldn't spend to much energy chasing the moving targets that are js frameworks.
 
Top