• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:07
CEST 03:07
KST 10:07
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
[BSL20] Non-Korean Championship 4x BSL + 4x China1Flash Announces Hiatus From ASL63Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event22Esports World Cup 2025 - Final Player Roster16
StarCraft 2
General
Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
Player “Jedi” cheat on CSL SC uni coach streams logging into betting site Flash Announces Hiatus From ASL BW General Discussion Practice Partners (Official)
Tourneys
[BSL20] Non-Korean Championship 4x BSL + 4x China CSL Xiamen International Invitational The Casual Games of the Week Thread [BSL20] Grand Finals - Sunday 20:00 CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Summer Games Done Quick 2025! Trading/Investing Thread Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 627 users

The Big Programming Thread - Page 739

Forum Index > General Forum
Post a Reply
Prev 1 737 738 739 740 741 1031 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
Hyrule19031 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
Poland17243 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
Hyrule19031 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
Poland17243 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
Poland17243 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 9h 53m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Livibee 237
Nina 214
RuFF_SC2 96
ProTech74
StarCraft: Brood War
Artosis 992
Icarus 5
Dota 2
monkeys_forever667
Counter-Strike
tarik_tv7163
Fnx 1821
Stewie2K1147
Super Smash Bros
Mew2King133
Heroes of the Storm
Khaldor195
Other Games
summit1g10102
fl0m778
ViBE246
Maynarde184
JuggernautJason23
Organizations
Other Games
gamesdonequick46739
BasetradeTV56
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• davetesta35
• Berry_CruncH32
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• Ler56
League of Legends
• masondota2795
Upcoming Events
Wardi Open
9h 53m
Replay Cast
22h 53m
Sparkling Tuna Cup
1d 8h
WardiTV European League
1d 14h
MaNa vs sebesdes
Mixu vs Fjant
ByuN vs HeRoMaRinE
ShoWTimE vs goblin
Gerald vs Babymarine
Krystianer vs YoungYakov
PiGosaur Monday
1d 22h
The PondCast
2 days
WardiTV European League
2 days
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
uThermal 2v2 Circuit
2 days
Replay Cast
2 days
RSL Revival
3 days
ByuN vs SHIN
Clem vs Reynor
[ Show More ]
Replay Cast
3 days
RSL Revival
4 days
Classic vs Cure
FEL
4 days
RSL Revival
5 days
FEL
5 days
FEL
5 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
FEL
6 days
Liquipedia Results

Completed

BSL Season 20
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.