• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:02
CET 01:02
KST 09:02
  • 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
[ASL22] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win0Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down23ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1
StarCraft 2
General
[D] Hacker peak in sc2 ? No more SC2 streamers on team liquid? Liquibets sc2 season 30 Evil Geniuses - shutting down Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win
Tourneys
SC4ALL: II Venue Change Announcement! Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20)
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[G] How to playtest arcade maps Starcraft 2 Advance [D] the control group Simple Questions/Answers
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Rollback Netcode in Brood War SC4ALL: II Venue Change Announcement! Ziemie's Starcraft 1 Prequel Campaign 🇺🇦 Ukrainian StarCraft:BroodWar community reborn
Tourneys
[$1250] International ShieldBattery League [Megathread] Daily Proleagues Small VOD Thread 2.0 KCM Race Survival 2026 Season 4
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Dating: How's your luck? Trading/Investing Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 9419 users

The Big Programming Thread - Page 546

Forum Index > General Forum
Post a Reply
Prev 1 544 545 546 547 548 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.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 12 2014 20:18 GMT
#10901
My problem is that you're trading off readability for compiler debugging. Since we spent 2 pages talking about the Hungarian notation I would still prefer x == false to false == x because reading x is false is much more intuitive than false is x.
There is no one like you in the universe.
MysteryMeat1
Profile Blog Joined June 2011
United States3292 Posts
November 12 2014 20:43 GMT
#10902
So i started learning ruby on my own and was doing just a basic 9 hour course to introduce syntax and stuff one of the erros that I ran into in this code

+ Show Spoiler +

print "Gimme the string boy:"
user_input = gets.chomp.downcase!
if user_input.include? "s"
user_input.gsub!(/s/, "th")
else
puts "no 's' in your string"
end
puts "adios, #{user_input}!"


was that if i put in a lower case string it would give an error that said include? not defined which didn't make any sense to me but it would work if the string was uppercase to begin with. Am i gonna learn why this occurs later or am i missing something basic?
"Cause ya know, Style before victory." -The greatest mafia player alive
supereddie
Profile Joined March 2011
Netherlands151 Posts
November 12 2014 21:19 GMT
#10903
Just use google to find the answer?

+ Show Spoiler +

http://www.ruby-doc.org/core-2.1.4/String.html#method-i-downcase-21
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
Alzadar
Profile Blog Joined April 2010
Canada5009 Posts
November 12 2014 21:25 GMT
#10904
Ugh Ruby.

mystery = 4

def mystery
return 2
end

puts mystery
I am the Town Medic.
MysteryMeat1
Profile Blog Joined June 2011
United States3292 Posts
November 13 2014 00:32 GMT
#10905
On November 13 2014 06:19 supereddie wrote:
Just use google to find the answer?

+ Show Spoiler +

http://www.ruby-doc.org/core-2.1.4/String.html#method-i-downcase-21


I don't think thats quite it, the downcase method works and prints out a downcase version of my string and then goes through the program correctly. Its when my string is already downcased that I get an error and nothing happens.
"Cause ya know, Style before victory." -The greatest mafia player alive
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
Last Edited: 2014-11-13 01:35:52
November 13 2014 01:25 GMT
#10906
On November 13 2014 09:32 MysteryMeat1 wrote:
Show nested quote +
On November 13 2014 06:19 supereddie wrote:
Just use google to find the answer?

+ Show Spoiler +

http://www.ruby-doc.org/core-2.1.4/String.html#method-i-downcase-21


I don't think thats quite it, the downcase method works and prints out a downcase version of my string and then goes through the program correctly. Its when my string is already downcased that I get an error and nothing happens.


What happens if you put this after downcasing your string and before the rest of the code?


unless user_input.nil?


Obviously, you'll need an end there too
Time is precious. Waste it wisely.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 13 2014 01:32 GMT
#10907
On November 13 2014 03:25 sabas123 wrote:
(false == somevar) makes no logical sense in normal langauges?

(false == somevar) can make sense in some situations where you're similar sanity checks at the start of functions and the operand is predictable. Instead of having to read
if(somevar == 
before I get to the actual information I care about on that line I can simply read
if(condition
and know what the rest of the line will be.

Just playing devil's advocate, though I have run into this pattern from time to time when contributing to open source javascript libraries.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 13 2014 01:37 GMT
#10908
On November 13 2014 06:25 Alzadar wrote:
Ugh Ruby.

mystery = 4

def mystery
return 2
end

puts mystery

Ruby looks for variables first, then functions.

You should never have variables with the same name as functions within the same scope.
Also, no need for the return keyword.
phar
Profile Joined August 2011
United States1080 Posts
November 13 2014 01:44 GMT
#10909
yoda code is not useful unless your coding environment has shit static analysis that won't catch assignment errors.

If you have shit static checking that won't catch assignment errors, first see if that can be improved, because it will catch other things which yoda code doesn't help.
Who after all is today speaking about the destruction of the Armenians?
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 13 2014 01:46 GMT
#10910
On November 13 2014 05:43 MysteryMeat1 wrote:
So i started learning ruby on my own and was doing just a basic 9 hour course to introduce syntax and stuff one of the erros that I ran into in this code

+ Show Spoiler +

print "Gimme the string boy:"
user_input = gets.chomp.downcase!
if user_input.include? "s"
user_input.gsub!(/s/, "th")
else
puts "no 's' in your string"
end
puts "adios, #{user_input}!"


was that if i put in a lower case string it would give an error that said include? not defined which didn't make any sense to me but it would work if the string was uppercase to begin with. Am i gonna learn why this occurs later or am i missing something basic?


downcase!
returns nil if it doesn't change anything (if the string is all lowercase already).
You're also assigning results of destructive (bang!) operations to variables when you appear to be expecting the results of the non-destructive versions.

Here's a simplified version that utilizes destructive methods:
user_input = gets.chomp.downcase
puts "no 's's' in your string." unless user_input.gsub!(/s/, "th")
puts "adios, #{user_input}!"
ThatGuy
Profile Blog Joined April 2008
Canada695 Posts
Last Edited: 2014-11-13 02:30:50
November 13 2014 02:30 GMT
#10911
I've actually seen (false == somevar) before and found that curious, and asked the person why that was their style. They told me that writing the statement in that order can force the compiler to prevent a potential logical error due to a typo. For example, writing (somevar = false) instead of (somevar == false) will still compile, unlike (false = somevar).

EDIT: Yerch, apparently already been said >_>
nunez
Profile Blog Joined February 2011
Norway4003 Posts
November 13 2014 03:07 GMT
#10912
the function overload type_trait trick appears and is explained here ~4.09. even incoorporates ellipsis to get default behaviour, that's pretty nifty.
conspired against by a confederacy of dunces.
ZenithM
Profile Joined February 2011
France15952 Posts
Last Edited: 2014-11-13 03:07:48
November 13 2014 03:07 GMT
#10913
Does someone here know of cheap solutions for personal cloud computing with by hour pricing and which can provide at least 8 (better with 16) cores, and more than 30 GB of RAM? I looked at Google Computing Platform, Amazon EC2 and stuff like that, does anyone have feedback on that?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 13 2014 03:14 GMT
#10914
On November 13 2014 12:07 ZenithM wrote:
Does someone here know of cheap solutions for personal cloud computing with by hour pricing and which can provide at least 8 (better with 16) cores, and more than 30 GB of RAM? I looked at Google Computing Platform, Amazon EC2 and stuff like that, does anyone have feedback on that?


http://azure.microsoft.com/en-us/pricing/details/cloud-services/

not cheap but if you want ram and 16 cores
There is no one like you in the universe.
ZenithM
Profile Joined February 2011
France15952 Posts
November 13 2014 03:30 GMT
#10915
Oh yeah, I forgot Azure, I did check that, but thank you.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 13 2014 03:37 GMT
#10916
ah, check https://www.digitalocean.com/pricing/ too then
There is no one like you in the universe.
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
November 13 2014 04:58 GMT
#10917
On November 13 2014 12:07 ZenithM wrote:
Does someone here know of cheap solutions for personal cloud computing with by hour pricing and which can provide at least 8 (better with 16) cores, and more than 30 GB of RAM? I looked at Google Computing Platform, Amazon EC2 and stuff like that, does anyone have feedback on that?


Amazon EC2 and S3 services are decent.
Time is precious. Waste it wisely.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 13 2014 05:17 GMT
#10918
Spot EC2 instances are the cheapest per power, but they can cease to exist at any point in time as supply/demand fluctuates.

If you're doing distributed fault tolerant computing with like a Spark cluster or something then Spot instances can be the way to go.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 13 2014 05:21 GMT
#10919
Depending on what you're trying to do and how much 'ops' work you want to do Digital Ocean could be a good option, the setup is super easy and you can add/remove resources from a 'droplet' without having to power it down.
Manit0u
Profile Blog Joined August 2004
Poland17871 Posts
November 13 2014 08:45 GMT
#10920
Have any of you tried Rust yet? Looks pretty awesome at first glance.
Time is precious. Waste it wisely.
Prev 1 544 545 546 547 548 1032 Next
Please log in or register to reply.
Live Events Refresh
PSISTORM Gaming Misc
09:00
FSL season 12 opener: HM vs ST
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nathanias 145
SpeCial 11
StarCraft: Brood War
Britney 7870
Dota 2
PGG 171
League of Legends
Doublelift4573
JimRising 713
Counter-Strike
jkaem74
Other Games
gofns9101
summit1g8895
Grubby2342
shahzam428
PiGStarcraft301
C9.Mang0265
syndereN186
XaKoH 103
Fuzer 66
NeuroSwarm53
ZombieGrub47
Maynarde46
ViBE45
PPMD27
Railgan22
KnowMe19
JuggernautJason5
Day[9].tv0
Organizations
Other Games
BasetradeTV187
gamesdonequick168
Counter-Strike
PGL80
[ Show 19 non-featured ]
StarCraft 2
• Hupsaiya 59
• RyuSc2 25
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• HerbMon 38
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV698
League of Legends
• Nemesis3197
• Jankos3150
• Scarra926
Other Games
• imaqtpie656
• Shiphtur181
• Day9tv0
Upcoming Events
IntoTheTV X SOOP
10h 59m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
16h 59m
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
18h 59m
IntoTheTV X SOOP
1d 10h
IPSL
1d 16h
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
1d 22h
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Invitational
3 days
YoungYakov vs Lambo
SHIN vs TBD
Percival vs Shameless
Solar vs TBD
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Invitational
5 days
Liquipedia Results

Completed

Proleague 2026-11-05
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #3
BLAST Open Fall 2026

Upcoming

Sector 951
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Underdog Cup 2026 Div 2-3
PGL Bucharest 2027
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 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.