• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:03
CEST 16:03
KST 23:03
  • 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
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
BSL Team A vs Koreans - Sat-Sun 16:00 CET6Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)80Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition32
StarCraft 2
General
The New Patch Killed Mech! TL.net Map Contest #21: Voting Revisiting the game after10 years and wow it's bad Stellar Fest: StarCraft II returns to Canada herO Talks: Poor Performance at EWC and more...
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament SC2's Safe House 2 - October 18 & 19 $1,200 WardiTV October (Oct 21st-31st) WardiTV Mondays RSL Offline Finals Dates + Ticket Sales!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers Mutation # 492 Get Out More
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ BW caster Sayle BSL Team A vs Koreans - Sat-Sun 16:00 CET BW General Discussion Question regarding recent ASL Bisu vs Larva game
Tourneys
[ASL20] Semifinal B SC4ALL $1,500 Open Bracket LAN [Megathread] Daily Proleagues [ASL20] Semifinal A
Strategy
Current Meta BW - ajfirecracker Strategy & Training Relatively freeroll strategies Siegecraft - a new perspective
Other Games
General Games
Stormgate/Frost Giant Megathread Dawn of War IV Path of Exile Nintendo Switch Thread ZeroSpace Megathread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Series you have seen recently... Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Heroism of Pepe the Fro…
Peanutsc
Rocket League: Traits, Abili…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1518 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
Hyrule19144 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
Poland17384 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
Hyrule19144 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
Poland17384 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
Poland17384 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
Sparkling Tuna Cup
10:00
Weekly #110
herO vs ByuNLIVE!
CranKy Ducklings419
IndyStarCraft 272
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
LamboSC2 338
IndyStarCraft 272
Railgan 77
ProTech63
MindelVK 31
StarCraft: Brood War
Horang2 1947
Barracks 1128
Soma 1009
Larva 745
ZerO 664
firebathero 468
Stork 452
Hyun 450
Mini 429
actioN 404
[ Show more ]
Light 354
sSak 255
PianO 191
hero 180
Last 138
Pusan 116
ggaemo 113
Mong 102
Backho 100
Sharp 84
Rush 69
Sea.KH 58
sorry 49
JulyZerg 42
ToSsGirL 31
Sacsri 29
zelot 27
Terrorterran 15
scan(afreeca) 11
ajuk12(nOOB) 10
Icarus 6
Dota 2
Gorgc7693
qojqva2141
Fuzer 297
Counter-Strike
olofmeister1409
Heroes of the Storm
Khaldor323
Other Games
singsing2549
B2W.Neo1162
DeMusliM380
Happy232
Hui .146
oskar112
KnowMe88
ArmadaUGS60
Trikslyr29
ZerO(Twitch)18
Organizations
StarCraft: Brood War
lovetv 10
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• Adnapsc2 16
• Gemini_19 15
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 3384
League of Legends
• Jankos3228
Upcoming Events
Safe House 2
2h 57m
IPSL
4h 57m
Sziky vs Havi
Artosis vs Klauso
Monday Night Weeklies
1d 1h
WardiTV Invitational
1d 20h
WardiTV Invitational
2 days
Tenacious Turtle Tussle
3 days
The PondCast
3 days
WardiTV Invitational
4 days
Online Event
5 days
RSL Revival
5 days
[ Show More ]
RSL Revival
5 days
WardiTV Invitational
5 days
Afreeca Starleague
6 days
Snow vs Soma
Sparkling Tuna Cup
6 days
WardiTV Invitational
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
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

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
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.