• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 16:14
CET 22:14
KST 06:14
  • 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
Clem wins HomeStory Cup 286HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info3herO wins SC2 All-Star Invitational14SC2 All-Star Invitational: Tournament Preview5
Community News
Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win2RSL Season 4 announced for March-April7Weekly Cups (Jan 19-25): Bunny, Trigger, MaxPax win3Weekly Cups (Jan 12-18): herO, MaxPax, Solar win0BSL Season 2025 - Full Overview and Conclusion8
StarCraft 2
General
Clem wins HomeStory Cup 28 HomeStory Cup 28 - Info & Preview Stellar Fest "01" Jersey Charity Auction StarCraft 2 Not at the Esports World Cup 2026 Weekly Cups (Jan 26-Feb 1): herO, Clem, ByuN, Classic win
Tourneys
HomeStory Cup 28 $5,000 WardiTV Winter Championship 2026 RSL Season 4 announced for March-April PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) StarCraft Evolution League (SC Evo Biweekly)
Strategy
Custom Maps
[A] Starcraft Sound Mod
External Content
Mutation # 511 Temple of Rebirth The PondCast: SC2 News & Results Mutation # 510 Safety Violation Mutation # 509 Doomsday Report
Brood War
General
StarCraft player reflex TE scores [ASL21] Potential Map Candidates Can someone share very abbreviated BW cliffnotes? 2024 BoxeR's birthday message Liquipedia.net NEEDS editors for Brood War
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Diablo 2 thread Battle Aces/David Kim RTS Megathread EVE Corporation Nintendo Switch Thread 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 Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread YouTube Thread The Games Industry And ATVI Things Aren’t Peaceful in Palestine
Fan Clubs
The herO Fan Club! The IdrA Fan Club
Media & Entertainment
[Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
Play, Watch, Drink: Esports …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1403 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
Hyrule19192 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
Poland17652 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
Hyrule19192 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
Poland17652 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
Poland17652 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
The PiG Daily
20:50
Best Games
Maru vs Solar
Reynor vs TriGGeR
herO vs Solar
Clem vs TriGGeR
Maru vs TBD
PiGStarcraft113
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 275
UpATreeSC 159
PiGStarcraft113
ForJumy 50
Nathanias 36
EmSc Tv 30
StarCraft: Brood War
Rain 1671
Shuttle 213
Hyuk 55
IntoTheRainbow 11
NaDa 10
ivOry 6
League of Legends
C9.Mang0116
Counter-Strike
fl0m2209
Super Smash Bros
Mew2King101
Other Games
FrodaN4576
summit1g4014
Grubby3982
Beastyqt1022
RotterdaM518
ToD284
mouzStarbuck267
KnowMe233
Liquid`Hasu187
shahzam153
Harstem133
ArmadaUGS124
Trikslyr56
ZombieGrub25
JuggernautJason10
Organizations
Other Games
gamesdonequick1489
BasetradeTV120
StarCraft 2
EmSc Tv 30
EmSc2Tv 30
angryscii 26
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• StrangeGG 49
• davetesta28
• musti20045 8
• Hupsaiya 8
• Kozan
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• 80smullet 31
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• imaqtpie2857
• TFBlade1401
• Shiphtur485
• Stunt472
Upcoming Events
Replay Cast
2h 47m
RongYI Cup
13h 47m
herO vs Maru
Replay Cast
1d 2h
uThermal 2v2 Circuit
1d 14h
Replay Cast
2 days
Wardi Open
2 days
Monday Night Weeklies
2 days
Sparkling Tuna Cup
3 days
The PondCast
5 days
Liquipedia Results

Completed

Proleague 2026-02-05
HSC XXVIII
Underdog Cup #3

Ongoing

CSL 2025 WINTER (S19)
KCM Race Survival 2026 Season 1
Acropolis #4 - TS4
Escore Tournament S1: W7
Rongyi Cup S3
Nations Cup 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8

Upcoming

Escore Tournament S1: W8
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 2026
LiuLi Cup: 2025 Grand Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 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.