• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:24
CEST 07:24
KST 14:24
  • 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
[ASL21] Ro24 Preview Pt2: News Flash8[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy13ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book20
Community News
Weekly Cups (March 23-29): herO takes triple5Aligulac acquired by REPLAYMAN.com/Stego Research6Weekly Cups (March 16-22): herO doubles, Cure surprises3Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool49Weekly Cups (March 9-15): herO, Clem, ByuN win4
StarCraft 2
General
Aligulac acquired by REPLAYMAN.com/Stego Research Team Liquid Map Contest #22 - Presented by Monster Energy What mix of new & old maps do you want in the next ladder pool? (SC2) herO wins SC2 All-Star Invitational Weekly Cups (March 23-29): herO takes triple
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL Season 4 announced for March-April StarCraft Evolution League (SC Evo Biweekly) WardiTV Mondays World University TeamLeague (500$+) | Signups Open
Strategy
Custom Maps
[M] (2) Frigid Storage Publishing has been re-enabled! [Feb 24th 2026]
External Content
Mutation # 519 Inner Power The PondCast: SC2 News & Results Mutation # 518 Radiation Zone Mutation # 517 Distant Threat
Brood War
General
BW General Discussion Build Order Practice Maps [ASL21] Ro24 Preview Pt2: News Flash BGH Auto Balance -> http://bghmmr.eu/ Pros React To: SoulKey vs Ample
Tourneys
[ASL21] Ro24 Group E [ASL21] Ro24 Group F 🌍 Weekly Foreign Showmatches [ASL21] Ro24 Group B
Strategy
Fighting Spirit mining rates What's the deal with APM & what's its true value Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread Starcraft Tabletop Miniature Game Nintendo Switch Thread General RTS Discussion Thread Darkest Dungeon
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
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 Five o'clock TL Mafia
Community
General
US Politics Mega-thread Canadian Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI European Politico-economics QA Mega-thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread General nutrition recommendations
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6695 users

The Big Programming Thread - Page 739

Forum Index > General Forum
Post a Reply
Prev 1 737 738 739 740 741 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.
tofucake
Profile Blog Joined October 2009
Hyrule19200 Posts
June 28 2016 12:37 GMT
#14761
step one is to use 4 spaces, not 2
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17707 Posts
Last Edited: 2016-06-28 14:53:16
June 28 2016 14:48 GMT
#14762
On June 28 2016 21:37 tofucake wrote:
step one is to use 4 spaces, not 2


I'm using defaults from RubyMine for now.

Anyway, here's how my code evolved today as I tested some stuff and I didn't like it:


class ItemLocation < ActiveRecord::Base
IN_STOCK = 'in_stock'.freeze
INBOUND = 'inbound'.freeze
OUTBOUND = 'outbound'.freeze
RESERVED = 'reserved'.freeze

belongs_to :item, inverse_of: :item_locations
belongs_to :warehouse, inverse_of: :item_locations

scope :in_state, ->(warehouse, state) { where(warehouse: warehouse, state: state) }

def self.available_states
[ IN_STOCK, INBOUND, OUTBOUND, RESERVED ]
end
end



class Item < ActiveRecord::Base
has_many :item_locations, inverse_of: :item, dependent: :delete_all
has_many :warehouses, through: :item_locations

def quantities
data = {}

self.warehouses.each do |warehouse|
key = warehouse.presentation
location = {}

ItemLocation.available_states.each do |state|
location[state] = self.item_locations.in_state(warehouse, state).sum(:quantity)
end

data[key] = location
end

data
end
end


Much easier to manage this way.
Time is precious. Waste it wisely.
Aerisky
Profile Blog Joined May 2012
United States12129 Posts
June 30 2016 06:58 GMT
#14763
On June 28 2016 21:37 tofucake wrote:
step one is to use 4 spaces, not 2

huh i thought rails was generally 2 spaces? didn't know that that was convention.
Jim while Johnny had had had had had had had; had had had had the better effect on the teacher.
Djagulingu
Profile Blog Joined December 2010
Germany3605 Posts
June 30 2016 12:20 GMT
#14764
On June 27 2016 15:05 amazingxkcd wrote:
has anyone played with this? https://www.stockfighter.io/


not that i am searching for a job (already have a kickass one atm), but i thought it is a cool recruiting idea

Saw this shit on Dzone and been playing it here and there. Not a bad game imo.
"windows bash is a steaming heap of shit" tofucake
tofucake
Profile Blog Joined October 2009
Hyrule19200 Posts
June 30 2016 13:02 GMT
#14765
On June 30 2016 15:58 Aerisky wrote:
Show nested quote +
On June 28 2016 21:37 tofucake wrote:
step one is to use 4 spaces, not 2

huh i thought rails was generally 2 spaces? didn't know that that was convention.

I have issues with 2 spaces.
Liquipediaasante sana squash banana
Cyx.
Profile Joined November 2010
Canada806 Posts
June 30 2016 19:03 GMT
#14766
On June 30 2016 22:02 tofucake wrote:
Show nested quote +
On June 30 2016 15:58 Aerisky wrote:
On June 28 2016 21:37 tofucake wrote:
step one is to use 4 spaces, not 2

huh i thought rails was generally 2 spaces? didn't know that that was convention.

I have issues with 2 spaces.

Rails devs have issues with you
Mary007
Profile Joined July 2016
1 Post
July 01 2016 02:58 GMT
#14767
--- Nuked ---
Manit0u
Profile Blog Joined August 2004
Poland17707 Posts
July 04 2016 13:19 GMT
#14768
http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

Pure awesome. Recommended reading for everyone.
Time is precious. Waste it wisely.
RoomOfMush
Profile Joined March 2015
1296 Posts
July 04 2016 14:10 GMT
#14769
On July 04 2016 22:19 Manit0u wrote:
http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

Pure awesome. Recommended reading for everyone.

Its well written, but I dont see the point of it.
emperorchampion
Profile Blog Joined December 2008
Canada9496 Posts
July 04 2016 14:18 GMT
#14770
On July 04 2016 22:19 Manit0u wrote:
http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

Pure awesome. Recommended reading for everyone.


This is great.


Compilation is one of the denser subjects in computer science, because the lower down you go, the more opportunities there are to do deep, weird things that can speed up code significantly—and faster is cheaper and better. You can write elegant, high-level code like F. Scott Fitzgerald, and the computer will compile you into Ernest Hemingway. But compilers often do several passes, turning code into simpler code, then simpler code still, from Fitzgerald, to Hemingway, to Stephen King, to Stephenie Meyer, all the way down to Dan Brown, each phase getting less readable and more repetitive as you go.
TRUEESPORTS || your days as a respected member of team liquid are over
Cynry
Profile Blog Joined August 2010
810 Posts
July 04 2016 16:16 GMT
#14771
On July 04 2016 22:19 Manit0u wrote:
http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

Pure awesome. Recommended reading for everyone.

Thanks for sharing, had a good time reading that.
Also, the "no meeting where 2 pizzas can't feed the whole group" rule ? YES PLEASE !
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
July 04 2016 17:27 GMT
#14772
On July 05 2016 01:16 Cynry wrote:
Show nested quote +
On July 04 2016 22:19 Manit0u wrote:
http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

Pure awesome. Recommended reading for everyone.

Thanks for sharing, had a good time reading that.
Also, the "no meeting where 2 pizzas can't feed the whole group" rule ? YES PLEASE !

So you get to have larger meetings if you raise the female to male ratio?
If you have a good reason to disagree with the above, please tell me. Thank you.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
July 04 2016 17:37 GMT
#14773
On July 05 2016 02:27 spinesheath wrote:
Show nested quote +
On July 05 2016 01:16 Cynry wrote:
Also, the "no meeting where 2 pizzas can't feed the whole group" rule ? YES PLEASE !

So you get to have larger meetings if you raise the female to male ratio?


Do people with lactose intolerance or real/imagined gluten intolerance not count in this metric?
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
July 04 2016 17:48 GMT
#14774
--- Nuked ---
Manit0u
Profile Blog Joined August 2004
Poland17707 Posts
July 04 2016 18:33 GMT
#14775
On July 05 2016 01:16 Cynry wrote:
Show nested quote +
On July 04 2016 22:19 Manit0u wrote:
http://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/

Pure awesome. Recommended reading for everyone.

Thanks for sharing, had a good time reading that.
Also, the "no meeting where 2 pizzas can't feed the whole group" rule ? YES PLEASE !


2-pizza teams are quite popular now in the agile model.
Time is precious. Waste it wisely.
Cynry
Profile Blog Joined August 2010
810 Posts
July 04 2016 18:37 GMT
#14776
Well, those are valid concerns, but my plan was simply to bring my dog in meetings, give him the leftover pizza, and have us both do a better job at deciding stuff than our current roster.
Just kidding. I don't have a dog. One can dream though.
Aerisky
Profile Blog Joined May 2012
United States12129 Posts
July 04 2016 20:09 GMT
#14777
Allergic to dairy reporting in
Jim while Johnny had had had had had had had; had had had had the better effect on the teacher.
Cyx.
Profile Joined November 2010
Canada806 Posts
July 04 2016 22:44 GMT
#14778
On July 05 2016 05:09 Aerisky wrote:
Allergic to dairy reporting in

Why the sad face? You provide infinitely more value per slice of pizza than otherwise equivalent programmers!
Requizen
Profile Blog Joined March 2011
United States33802 Posts
July 05 2016 21:46 GMT
#14779
Company is having a Hack Day coming up. I don't really have a project in mind since I just started, but I think it'll be an interesting opportunity to learn Functional Programming since I never got into it and have been interested for a while. Was thinking about doing F# since I'm a Microsoft shill fanboy, but Haskell and Scala looked interesting as well. Any suggestions?
It's your boy Guzma!
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
July 05 2016 21:59 GMT
#14780
--- Nuked ---
Prev 1 737 738 739 740 741 1032 Next
Please log in or register to reply.
Live Events Refresh
PiGosaur Cup
00:00
#75
PiGStarcraft251
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft251
RuFF_SC2 194
Nina 130
StarCraft: Brood War
GuemChi 5893
Horang2 2023
PianO 701
Tasteless 75
Dewaltoss 35
Noble 12
Icarus 8
Dota 2
monkeys_forever646
Counter-Strike
Coldzera 1563
Other Games
summit1g8767
WinterStarcraft368
C9.Mang0278
Organizations
Other Games
gamesdonequick731
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• practicex 48
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush999
• Lourlo995
Upcoming Events
Replay Cast
3h 37m
Afreeca Starleague
4h 37m
BeSt vs Leta
Queen vs Jaedong
Kung Fu Cup
5h 37m
Replay Cast
18h 37m
The PondCast
1d 4h
OSC
1d 18h
RSL Revival
2 days
TriGGeR vs Cure
ByuN vs Rogue
Replay Cast
2 days
RSL Revival
3 days
Maru vs MaxPax
BSL
3 days
[ Show More ]
RSL Revival
4 days
uThermal 2v2 Circuit
4 days
BSL
4 days
Replay Cast
5 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

CSL Season 20: Qualifier 1
WardiTV Winter 2026
NationLESS Cup

Ongoing

BSL Season 22
CSL Elite League 2026
ASL Season 21
CSL Season 20: Qualifier 2
RSL Revival: Season 4
Nations Cup 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

Escore Tournament S2: W1
CSL 2026 SPRING (S20)
Acropolis #4
IPSL Spring 2026
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
StarCraft2 Community Team League 2026 Spring
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
IEM Atlanta 2026
Asian Champions League 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 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.