• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 20:07
CET 02: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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
ComeBackTV's documentary on Byun's Career !10Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15
StarCraft 2
General
ComeBackTV's documentary on Byun's Career ! Micro Lags When Playing SC2? When will we find out if there are more tournament Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win RSL Revival - 2025 Season Finals Preview
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament $100 Prize Pool - Winter Warp Gate Masters Showdow Winter Warp Gate Amateur Showdown #1 RSL Offline Finals Info - Dec 13 and 14!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Klaucher discontinued / in-game color settings Anyone remember me from 2000s Bnet EAST server? How Rain Became ProGamer in Just 3 Months FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[BSL21] LB QuarterFinals - Sunday 21:00 CET Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Beyond All Reason Stormgate/Frost Giant Megathread Path of Exile General RTS Discussion Thread Nintendo Switch Thread
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 Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
The Games Industry And ATVI US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1174 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
Hyrule19180 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
Poland17542 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
Hyrule19180 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
Poland17542 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
Poland17542 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
Next event in 7h 53m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
elazer 235
ProTech131
CosmosSc2 72
StarCraft: Brood War
Artosis 590
Shuttle 140
Hm[arnc] 2
Dota 2
NeuroSwarm108
Counter-Strike
summit1g8636
fl0m1275
minikerr31
Heroes of the Storm
Khaldor227
Other Games
Grubby4495
JimRising 335
Maynarde149
XaKoH 94
Guitarcheese15
Organizations
Other Games
gamesdonequick1337
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Hupsaiya 69
• davetesta33
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota22528
League of Legends
• Doublelift5321
Other Games
• imaqtpie2132
• Scarra1843
Upcoming Events
Replay Cast
7h 53m
Wardi Open
10h 53m
Monday Night Weeklies
15h 53m
WardiTV Invitational
2 days
Replay Cast
3 days
WardiTV Invitational
3 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Replay Cast
4 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

YSL S2
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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.