• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:18
CET 22:18
KST 06:18
  • 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
Team Liquid Map Contest #22 - Presented by Monster Energy5ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13
Community News
Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool30Weekly Cups (March 9-15): herO, Clem, ByuN win42026 KungFu Cup Announcement6BGE Stara Zagora 2026 cancelled12Blizzard Classic Cup - Tastosis announced as captains18
StarCraft 2
General
Potential Updates Coming to the SC2 CN Server Weekly Cups (March 2-8): ByuN overcomes PvT block Weekly Cups (August 25-31): Clem's Last Straw? Weekly Cups (March 9-15): herO, Clem, ByuN win Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool
Tourneys
RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament WardiTV Team League Season 10 KSL Week 87 [GSL CK] #2: Team Classic vs. Team Solar
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 517 Distant Threat Mutation # 516 Specter of Death Mutation # 515 Together Forever
Brood War
General
Buy weed dexies in Australia (WhatsApp 0480852135) BGH Auto Balance -> http://bghmmr.eu/ ASL21 General Discussion Gypsy to Korea JaeDong's form before ASL
Tourneys
Buy coke in Brisbane (WhatsApp 0480852135) [BSL22] Open Qualifiers & Ladder Tours [Megathread] Daily Proleagues Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates
Other Games
General Games
(Telegram@povopackz) - BUY COKE speed 3mmc POLAND General RTS Discussion Thread Nintendo Switch Thread Path of Exile Stormgate/Frost Giant Megathread
Dota 2
Official 'what is Dota anymore' discussion The Story of Wings Gaming
League of Legends
G2 just beat GenG in First stand
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
Five o'clock TL Mafia Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread Russo-Ukrainian War Thread Mexico's Drug War
Fan Clubs
The IdrA Fan Club
Media & Entertainment
Movie Discussion! [Req][Books] Good Fantasy/SciFi books [Manga] One Piece
Sports
Formula 1 Discussion 2024 - 2026 Football Thread Tokyo Olympics 2021 Thread General nutrition recommendations Cricket [SPORT]
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Funny Nicknames
LUCKY_NOOB
Money Laundering In Video Ga…
TrAiDoS
Iranian anarchists: organize…
XenOsky
FS++
Kraekkling
Shocked by a laser…
Spydermine0240
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1762 users

The Big Programming Thread - Page 887

Forum Index > General Forum
Post a Reply
Prev 1 885 886 887 888 889 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.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
June 03 2017 18:38 GMT
#17721
oh, that's smart but obvious after hearing it
thanks!
Manit0u
Profile Blog Joined August 2004
Poland17695 Posts
Last Edited: 2017-06-06 14:24:50
June 06 2017 10:49 GMT
#17722


Very interesting presentation for anyone who's into web dev.

Edit:

Uh, oh! Someone had to have a lot of fun writing that


def call(*args, &block)
tuples =
if hooks?
prepared =
if curried?
apply_hooks(before_hooks, *(curry_args + args))
else
apply_hooks(before_hooks, *args)
end

result = prepared ? execute(prepared, &block) : execute(&block)

if curried?
if args.size > 0
apply_hooks(after_hooks, result, *args)
elsif curry_args.size > 1
apply_hooks(after_hooks, result, curry_args[1])
else
apply_hooks(after_hooks, result)
end
else
apply_hooks(after_hooks, result, *args[1..args.size-1])
end
else
execute(*(curry_args + args), &block)
end

if one?
tuples.first
else
tuples
end
end
Time is precious. Waste it wisely.
Thaniri
Profile Blog Joined March 2011
1264 Posts
June 07 2017 18:55 GMT
#17723
Just got a DevOps job starting in September. I've got about 3 months to become a master of Linux/Bash. Company uses Ubuntu so that's what I'm gonna be installing on my PC.

Anyone have any advice on how to learn this shit as fast as possible?
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
June 07 2017 22:45 GMT
#17724
the current homework im doing is probably the hardest anything ive ever done, lmao

gonna upload it if any brave souls are willing to review in a couple hours
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-06-08 00:00:25
June 07 2017 23:51 GMT
#17725
okay i actually don't want to upload my pdfs right now, but I can put what answers I got

i didn't do the challenge question (yet)

http://www.cs.umd.edu/class/summer2017/cmsc351/hwk2.pdf

my solutions

+ Show Spoiler +

1a: n-1

1b: [sum of k=1 to n (sum of i=1 to k: of k-i)] + n-1
eventually after a lot of simplifying and some tricks I had to find online I arrived at 1/6(n-1)n(n+1)


2a: n

2b sum of i=1 to n-1 of i + sum of i=1 to n-2 of i + n-1
after simplifcation = 2n(n-1)

2c: still working on it, having some trouble. I have a formula for a given case i,j where i is the left index and j is the right index, but the problem is I need to generalize it for the average i, j
gotta figure out how to do that... but have a pounding headache



can I generalize it with the sum of j=2 to n of the sum of i=1 to j-1 of: whatever the rest of my work is
and then divide all of that by the total number of combinations [i think n(n-1)/2 ?... yeah, n choose 2]

CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
Last Edited: 2017-06-08 00:08:32
June 08 2017 00:07 GMT
#17726
read post wrong
Manit0u
Profile Blog Joined August 2004
Poland17695 Posts
Last Edited: 2017-06-08 06:42:25
June 08 2017 06:30 GMT
#17727
On June 08 2017 03:55 Thaniri wrote:
Just got a DevOps job starting in September. I've got about 3 months to become a master of Linux/Bash. Company uses Ubuntu so that's what I'm gonna be installing on my PC.

Anyone have any advice on how to learn this shit as fast as possible?


I don't think you can become master of anything in 3 months... Especially DevOps...

I don't want to discourage you but you'll have to acquire a TON of knowledge. It's not just Linux and Bash, you'll most likely need to also know how to set up routers, firewalls (entire network stack basically, from intranet to distributed cloud systems), automated backups, databases, Docker, ssh, LDAP, continuous integration, continuous delivery, high availability, high recoverability and what not. Also, working on servers is quite different than working on desktop in Linux.

A good starting point would be setting up another comp that would work as a server and playing around with that. You might also learn some Python/Ruby for scripting purposes and vi/vim because you'll almost exclusively work from a console and you might need a good editor (nano just doesn't cut it in the long run).

Here are some books for starters:
https://www.amazon.com/Phoenix-Project-DevOps-Helping-Business/dp/0988262592
https://www.amazon.com/DevOps-Handbook-World-Class-Reliability-Organizations/dp/1942788002
https://www.amazon.com/DevOps-2-0-Toolkit-Containerized-Microservices-ebook/dp/B01BJ4V66M
https://www.amazon.com/Practical-Vim-Edit-Speed-Thought/dp/1680501275

More resources:
https://github.com/Leo-G/DevopsWiki
https://www.fullstackpython.com/devops.html

I think you should start here: https://github.com/Leo-G/DevopsWiki/wiki/Devops-Interview-Questions

Just work the list and educate yourself on each topic.

[image loading]
Time is precious. Waste it wisely.
Acrofales
Profile Joined August 2010
Spain18239 Posts
June 08 2017 07:58 GMT
#17728
On June 08 2017 08:51 travis wrote:
okay i actually don't want to upload my pdfs right now, but I can put what answers I got

i didn't do the challenge question (yet)

http://www.cs.umd.edu/class/summer2017/cmsc351/hwk2.pdf

my solutions

+ Show Spoiler +

1a: n-1

1b: [sum of k=1 to n (sum of i=1 to k: of k-i)] + n-1
eventually after a lot of simplifying and some tricks I had to find online I arrived at 1/6(n-1)n(n+1)


2a: n

2b sum of i=1 to n-1 of i + sum of i=1 to n-2 of i + n-1
after simplifcation = 2n(n-1)

2c: still working on it, having some trouble. I have a formula for a given case i,j where i is the left index and j is the right index, but the problem is I need to generalize it for the average i, j
gotta figure out how to do that... but have a pounding headache



can I generalize it with the sum of j=2 to n of the sum of i=1 to j-1 of: whatever the rest of my work is
and then divide all of that by the total number of combinations [i think n(n-1)/2 ?... yeah, n choose 2]


Your answers seem right.

Re 2c: the average case is that they are half a list apart... that should help
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
June 08 2017 11:36 GMT
#17729
On June 08 2017 16:58 Acrofales wrote:
Show nested quote +
On June 08 2017 08:51 travis wrote:
okay i actually don't want to upload my pdfs right now, but I can put what answers I got

i didn't do the challenge question (yet)

http://www.cs.umd.edu/class/summer2017/cmsc351/hwk2.pdf

my solutions

+ Show Spoiler +

1a: n-1

1b: [sum of k=1 to n (sum of i=1 to k: of k-i)] + n-1
eventually after a lot of simplifying and some tricks I had to find online I arrived at 1/6(n-1)n(n+1)


2a: n

2b sum of i=1 to n-1 of i + sum of i=1 to n-2 of i + n-1
after simplifcation = 2n(n-1)

2c: still working on it, having some trouble. I have a formula for a given case i,j where i is the left index and j is the right index, but the problem is I need to generalize it for the average i, j
gotta figure out how to do that... but have a pounding headache



can I generalize it with the sum of j=2 to n of the sum of i=1 to j-1 of: whatever the rest of my work is
and then divide all of that by the total number of combinations [i think n(n-1)/2 ?... yeah, n choose 2]


Your answers seem right.

Re 2c: the average case is that they are half a list apart... that should help


You sure?
That's not what I found.

For example, list {1, 2, 3, 4}

There are 3 ways for numbers 1 apart to swap
2 ways for numbers 2 apart to swap
1 way for numbers 3 apart to swap

3+4+3 = 10
10/6 = 5/3 apart, but half a list would be 2 apart


even for 3 numbers
1, 2, 3

2 ways 1 apart
1 ways 2 apart
=4/3 but half a list is 1.5

I ended up just doing the sum of all left indexes to all possible right index:

(j is right index, i is left index, inner sums are using the same idea as 2b)
the sum of j=2 to n of:
the sum of i=1 to j-1:
(the sum of z=i to j-1 of z + the sum of z=i to j-2 of z + (n-1))

this eventually ended up simplifying to 1/6n(n^3+n^2-4n+2)
then I divided by that (n choose 2) combinations

and was left with (n^3+n^2+4n+2)/(3n-3)

which looks about right but I don't know how to possible verify it
Acrofales
Profile Joined August 2010
Spain18239 Posts
Last Edited: 2017-06-08 12:58:54
June 08 2017 12:54 GMT
#17730
Err yeah. I derped. The expected distance between two points is (n + 1)/3, not (n +1)/2 as I derpingly thought for a sec.

E: and here is a stackoverflow explanation of why. Just replace the integrals with summations, and because your minimum is 1 and not 0, you will get the +1 in there. https://math.stackexchange.com/questions/195245/average-distance-between-random-points-on-a-line
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
June 08 2017 12:58 GMT
#17731
Ah I didn't even put that together actually. I probably could have done it easier with that.
Manit0u
Profile Blog Joined August 2004
Poland17695 Posts
June 08 2017 15:32 GMT
#17732
Can we have a separate thread for math please? Surely more people could contribute there and we wouldn't mix concerns here...
Time is precious. Waste it wisely.
Thaniri
Profile Blog Joined March 2011
1264 Posts
June 08 2017 15:33 GMT
#17733
Thanks Manitou, super helpful.

It's an entry level job, so I got in on the basis that I know routing/switching, Bash, and programming.

I don't want to show up and make a fool of myself though.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
June 08 2017 18:52 GMT
#17734
Looks like the time has come. My math is no longer wanted here

I suppose I'll make a big math thread.
CecilSunkure
Profile Blog Joined May 2010
United States2829 Posts
June 08 2017 19:10 GMT
#17735
I really like the sound of the big math thread. Please make it.
bardtown
Profile Joined June 2011
England2313 Posts
June 08 2017 22:22 GMT
#17736
I feel like learning a new language, maybe Haskell or Rust, but I can't justify it except as a purely 'for fun' distraction. For game development there's basically no substitute for C++ and for AI/Biology there's nothing as good as Python. Any ideas for a fun project that makes proper use of Haskell's featureset?
Manit0u
Profile Blog Joined August 2004
Poland17695 Posts
Last Edited: 2017-06-09 05:43:12
June 09 2017 05:42 GMT
#17737
On June 09 2017 07:22 bardtown wrote:
I feel like learning a new language, maybe Haskell or Rust, but I can't justify it except as a purely 'for fun' distraction. For game development there's basically no substitute for C++ and for AI/Biology there's nothing as good as Python. Any ideas for a fun project that makes proper use of Haskell's featureset?


If you have experience with gamedev in C++ you could try it out in Rust. Easier transition than to Haskell in my opinion and more opportunities to do something that's actually useful outside of purely academic field. If you want to do some AI stuff than you could also go with Lisp or Prolog.
Time is precious. Waste it wisely.
Liquid`Jinro
Profile Blog Joined September 2002
Sweden33719 Posts
June 09 2017 06:08 GMT
#17738
OK, I've gotta ask because it's driving me a little insane:
I'm taking a python course @ edx (python for data science to be specific), and the instructor keeps creating variables named after built in functions (for example: list = [1,2,3], or sorted = np.array(unsorted)).

.... I thought this was a very basic "don't do this" thing? Or am I wrong and it's not a big deal at all?
Moderatortell the guy that interplanatar interaction is pivotal to terrans variety of optionitudals in the pre-midgame preperatories as well as the protosstinal deterriggation of elite zergling strikes - Stimey n | Formerly FrozenArbiter
Acrofales
Profile Joined August 2010
Spain18239 Posts
June 09 2017 06:33 GMT
#17739
On June 09 2017 15:08 Liquid`Jinro wrote:
OK, I've gotta ask because it's driving me a little insane:
I'm taking a python course @ edx (python for data science to be specific), and the instructor keeps creating variables named after built in functions (for example: list = [1,2,3], or sorted = np.array(unsorted)).

.... I thought this was a very basic "don't do this" thing? Or am I wrong and it's not a big deal at all?

Definitely a big don't do this. It'll work in Python as long as you don't use a reserved word, because of scoping, but it's horrific coding practice.
dsyxelic
Profile Joined May 2010
United States1417 Posts
June 09 2017 06:57 GMT
#17740
would cs algorithm/problem discussion go in the math thread?

say.. for example leetcode/interview-esque problems

asking for the future since I feel like there is programming thread -> math thread with a missing 'CS thread' in the middle which would better suit that
TL/SKT
Prev 1 885 886 887 888 889 1032 Next
Please log in or register to reply.
Live Events Refresh
BSL
20:00
S22 - Ladder Tour #2
ZZZero.O73
LiquipediaDiscussion
LAN Event
16:30
StarCraft Madness
Airneanach95
Liquipedia
PSISTORM Gaming Misc
15:55
FSL semifinals: PTB vs ASH
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
elazer 367
Nathanias 84
JuggernautJason70
CosmosSc2 64
Ketroc 61
Vindicta 55
StarCraft: Brood War
Shuttle 309
Dewaltoss 107
ZZZero.O 73
Dota 2
monkeys_forever282
LuMiX1
Counter-Strike
fl0m4613
shoxiejesuss1416
Heroes of the Storm
Khaldor370
Other Games
Grubby2936
FrodaN2152
JimRising 455
byalli384
ToD255
ceh9220
Hui .71
Trikslyr43
Organizations
Other Games
gamesdonequick959
Dota 2
PGL Dota 2 - Main Stream116
StarCraft 2
angryscii 41
Other Games
BasetradeTV33
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• Adnapsc2 19
• Reevou 5
• intothetv
• sooper7s
• AfreecaTV YouTube
• Migwel
• Kozan
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• Azhi_Dahaki22
• Michael_bg 4
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21380
• WagamamaTV876
League of Legends
• Doublelift518
Other Games
• imaqtpie1052
• Shiphtur195
Upcoming Events
RSL Revival
12h 42m
herO vs MaxPax
Rogue vs TriGGeR
BSL
22h 42m
Replay Cast
1d 2h
Replay Cast
1d 11h
Afreeca Starleague
1d 12h
Sharp vs Scan
Rain vs Mong
Wardi Open
1d 14h
Monday Night Weeklies
1d 19h
Sparkling Tuna Cup
2 days
Afreeca Starleague
2 days
Soulkey vs Ample
JyJ vs sSak
Replay Cast
3 days
[ Show More ]
Afreeca Starleague
3 days
hero vs YSC
Larva vs Shine
Kung Fu Cup
3 days
Replay Cast
4 days
KCM Race Survival
4 days
The PondCast
4 days
WardiTV Team League
4 days
Replay Cast
5 days
WardiTV Team League
5 days
RSL Revival
6 days
Cure vs Zoun
WardiTV Team League
6 days
BSL
6 days
Liquipedia Results

Completed

Proleague 2026-03-20
WardiTV Winter 2026
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
BSL Season 22
CSL Elite League 2026
RSL Revival: Season 4
Nations Cup 2026
NationLESS Cup
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual

Upcoming

ASL Season 21
Acropolis #4 - TS6
2026 Changsha Offline CUP
CSL 2026 SPRING (S20)
CSL Season 20: Qualifier 1
Acropolis #4
IPSL Spring 2026
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 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...

Disclosure: This page contains affiliate marketing links that support TLnet.

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.