• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 09:20
CET 15:20
KST 23:20
  • 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
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)10Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns6[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises3
StarCraft 2
General
Spontaneous hotkey change zerg Chinese SC2 server to reopen; live all-star event in Hangzhou Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns SC2 All-Star Invitational: Jan 17-18 Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises
Tourneys
$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026 OSC Season 13 World Championship
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes Mutation # 504 Retribution
Brood War
General
Potential ASL qualifier breakthroughs? BGH Auto Balance -> http://bghmmr.eu/ I would like to say something about StarCraft BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Mechabellum Beyond All Reason Stormgate/Frost Giant Megathread Awesome Games Done Quick 2026! General RTS Discussion 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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread European Politico-economics QA Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Psychological Factors That D…
TrAiDoS
James Bond movies ranking - pa…
Topin
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1818 users

The Big Programming Thread - Page 884

Forum Index > General Forum
Post a Reply
Prev 1 882 883 884 885 886 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.
TMG26
Profile Joined July 2012
Portugal2017 Posts
May 24 2017 13:57 GMT
#17661
Why are you applying for front end anyway?
Supporter of the situational Blink Dagger on Storm.
shz
Profile Blog Joined October 2010
Germany2687 Posts
Last Edited: 2017-05-24 18:46:42
May 24 2017 18:46 GMT
#17662
I applied for front end and have my interview on Monday. React <3
Liquipedia
TheEmulator
Profile Blog Joined July 2010
28095 Posts
Last Edited: 2017-05-24 18:48:52
May 24 2017 18:48 GMT
#17663
On May 25 2017 03:46 shz wrote:
I applied for front end and have my interview on Monday. React <3

GL. Have you always been in front end or something else?
Administrator
shz
Profile Blog Joined October 2010
Germany2687 Posts
May 24 2017 22:14 GMT
#17664
Thanks!

I'm kinda full-stack atm. Doing freelance work for one company where I do a couple of projects as the sole programmer. So I use node for backend stuff and React on the front end.
Liquipedia
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
May 25 2017 06:49 GMT
#17665
Good luck!

Started a new job a month ago, thought I was going to do iOS but turned out to be Android. Still good though, things are going well.
There is no one like you in the universe.
SoSexy
Profile Blog Joined February 2011
Italy3725 Posts
May 26 2017 10:50 GMT
#17666
I don't know if this is the right thread, so sorry in advance. I suck hard at science and my knowledge stops to quadratic equations. Would I be able to program an app that displays events in my town, maybe divided into categories such as concerts/dance clubs/etc.? Where do I start and how long would it take?
Dating thread on TL LUL
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2017-05-27 05:37:35
May 27 2017 05:36 GMT
#17667
On May 26 2017 19:50 SoSexy wrote:
I don't know if this is the right thread, so sorry in advance. I suck hard at science and my knowledge stops to quadratic equations. Would I be able to program an app that displays events in my town, maybe divided into categories such as concerts/dance clubs/etc.? Where do I start and how long would it take?


Calculus has nothing to do with 99% of programming. It's all about problem solving - breaking complex tasks into smaller, simpler chunks - and knowing what to look for - mostly just good Google skills. (plus maybe lots of learning/understanding new things)

Fetching events from an API and displaying them in a list would take 1 day for an experienced developer. Starting from zero, maybe 1 week following good tutorials if you've programmed before, up to 1 month if you've never touched code. It all depends on how far you're expecting to take the app.

First addressing the "why would you do this" when this exists in a million ways already - Facebook events, Eventbrite, Bandsintown, Resident Advisor, Songkick, even Ticketmaster, infinitely better than any app you'd be able to make yourself.

To actually make the app...

First choose a platform, Android, iOS, or mixed Xamarin/React Native.
Then Google and follow tutorials for the following:
1. Finding a web api for events - Eventbrite or Eventful
2. Setting up the appropriate IDE
3. Fetching data from the web api
4. Showing the data in a list
5. Making filters for the data for different categories
There is no one like you in the universe.
SoSexy
Profile Blog Joined February 2011
Italy3725 Posts
May 27 2017 22:34 GMT
#17668
Thanks!
Dating thread on TL LUL
bangsholt
Profile Joined June 2011
Denmark138 Posts
May 28 2017 17:42 GMT
#17669
On May 27 2017 14:36 Blisse wrote:
First addressing the "why would you do this" when this exists in a million ways already - Facebook events, Eventbrite, Bandsintown, Resident Advisor, Songkick, even Ticketmaster, infinitely better than any app you'd be able to make yourself.


Did you not just answer your own question there, why do it?
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
May 29 2017 12:09 GMT
#17670
--- Nuked ---
TheEmulator
Profile Blog Joined July 2010
28095 Posts
Last Edited: 2017-05-30 04:12:35
May 30 2017 04:12 GMT
#17671
Finally switched to Arch Linux and surprisingly I got a full basic build together in a little over an hour (thought it would be more difficult). Anyone else use Arch and have any tips that might not be obvious from the wiki?
Administrator
Manit0u
Profile Blog Joined August 2004
Poland17588 Posts
May 30 2017 07:30 GMT
#17672
On May 30 2017 13:12 TheEmulator wrote:
Finally switched to Arch Linux and surprisingly I got a full basic build together in a little over an hour (thought it would be more difficult). Anyone else use Arch and have any tips that might not be obvious from the wiki?


It depends what you want with it. I was using it back in the day but I've found out that I no longer have time or desire to configure everything so I'm just rolling with Debian and pretty much default everything (so stoked for Debian 9, the rumor has it that even Battle.net is working on it without a hitch).
Time is precious. Waste it wisely.
YourGoodFriend
Profile Blog Joined June 2010
United States2197 Posts
May 30 2017 12:58 GMT
#17673
On May 25 2017 03:46 shz wrote:
I applied for front end and have my interview on Monday. React <3


React is a great library but when I am building large heavy frontend apps I prefer Angular 2 over react. Speed is basically the same and you don't get into npm dependency hell.
anonymous is the most famous author that anyone can be
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-05-30 18:26:36
May 30 2017 18:25 GMT
#17674
Had my first lecture of 31 for my algorithms class.

Professor is disheveled, apparently often late and hard to get a hold of, and basically comes out saying that he is old school and stubborn to a fault and will never change.

I think I like him though, and I think I will like this class. First class just introduction (syllabus and stuff) but he gave us a few problems to try to solve for next lecture. They are ungraded, most of the class is ungraded. The 2 exams are worth 87% of the grade, which is insane.

Here are the problems he gave us.

Problem 1 (I thought this was pretty easy)

Given an even n amount of teams in a tournament, write an algorithm to ensure that each team plays every other team 1 time, in n-1 steps.

(I made the assumption that the teams are given to us in an array).


Problem 2 (a little less easy but I still think I got this one without too much trouble)

Given an array of random positive and negative integers, write an algorithm that will return the subset of continuous indexes that has the maximum value in the array. as time efficient as possible
example: [5][-3][-1][2][3][-8][6] will return indexes 0 to 5, which sums to 6.


problem 3: dunno where to start this one

you have 100 dorm rooms assigned to 100 people. they show up 1 by 1. the first person forgets his assigned room and takes a random room.
any following person who shows up and has a room that is taken will also take a random room. otherwise they will take the assigned room.
what is the odds that the last person who shows up ends up in their assigned room?
slmw
Profile Blog Joined October 2010
Finland233 Posts
Last Edited: 2017-05-30 19:35:12
May 30 2017 19:32 GMT
#17675
I think there might be a really really intuitive solution for problem 3 but I just couldn't think of it on the spot, so I wrote it the long way.

Define f(x) as the solution for having x rooms and x people. Let's think about f(100). If the first guy chooses his own room, we're good. If he chooses the 2nd guy's room, then we have 99 rooms and 99 people. Then the 2nd guy won't be able to choose his own room, but choosing the 1st guy's room is effectively the same: it's a room nobody that's remaining will care about.

If the 1st guy chooses the 3rd guys room, 2nd guy will choose his own, and now we have 98 rooms and 98 people - with the same situation again as the 3rd guy can choose the 1st guy's room and everyone else remaining will have their room available. On every f(x) (down to f(2)) there will be one extra room for the first guy in the remaining line and all the rooms of the remaining people.

The recurrence relation is therefore + Show Spoiler +
f(x) = 1/x + 1/x * sum[i=2->x-1](f(x)) with f(2) = 1/2 obviously.

A little bit of induction will tell us + Show Spoiler +
that if all the previous values of f are 1/2, then f(x)=1/2 as well. Therefore f(100)=1/2.
Eiii
Profile Blog Joined April 2009
United States2566 Posts
May 30 2017 20:31 GMT
#17676
On May 30 2017 13:12 TheEmulator wrote:
Finally switched to Arch Linux and surprisingly I got a full basic build together in a little over an hour (thought it would be more difficult). Anyone else use Arch and have any tips that might not be obvious from the wiki?


I switched to arch recently, and I've basically been kicking myself for waiting so long to do it.

My suggestion is to make sure any scripts, specific configurations, or utilities you develop for your machine get integrated into the package manager. I didn't think about doing this when I started building out the stuff I wanted post-install, and now that I'm looking to do a full reinstall to switch up how it's using its disks it's kind of a pain to go back and get this stuff figured out after the fact.
:3
Manit0u
Profile Blog Joined August 2004
Poland17588 Posts
Last Edited: 2017-05-30 23:26:25
May 30 2017 22:53 GMT
#17677
On May 31 2017 04:32 slmw wrote:
I think there might be a really really intuitive solution for problem 3 but I just couldn't think of it on the spot, so I wrote it the long way.

Define f(x) as the solution for having x rooms and x people. Let's think about f(100). If the first guy chooses his own room, we're good. If he chooses the 2nd guy's room, then we have 99 rooms and 99 people. Then the 2nd guy won't be able to choose his own room, but choosing the 1st guy's room is effectively the same: it's a room nobody that's remaining will care about.

If the 1st guy chooses the 3rd guys room, 2nd guy will choose his own, and now we have 98 rooms and 98 people - with the same situation again as the 3rd guy can choose the 1st guy's room and everyone else remaining will have their room available. On every f(x) (down to f(2)) there will be one extra room for the first guy in the remaining line and all the rooms of the remaining people.

The recurrence relation is therefore + Show Spoiler +
f(x) = 1/x + 1/x * sum[i=2->x-1](f(x)) with f(2) = 1/2 obviously.

A little bit of induction will tell us + Show Spoiler +
that if all the previous values of f are 1/2, then f(x)=1/2 as well. Therefore f(100)=1/2.


I think you simplify it a bit too much...

The code to simulate this behavior is pretty much this:


def fill_rooms
available_rooms = *(0..99)
taken_rooms = []

100.times do |n|
chosen_room = random_room(available_rooms)

if n == 0
take_room(chosen_room, available_rooms, taken_rooms)

next
end

redo if taken_rooms.include?(chosen_room)

if available_rooms.include?(n)
take_room(n, available_rooms, taken_rooms)

next
end

take_room(chosen_room, available_rooms, taken_rooms)
end
end

def take_room(n, from, to)
to << from.delete(n)
end

def random_room(from)
from.sample
end


Sorry, but Ruby has taken my heart and soul recently...

Just need to figure out how to calculate that

It's late and I'm drunk. Don't want to think about it any more.

Edit:

I'm fucking lazy...


success_count = 0

100_000.times do
success_count += 1 if fill_rooms.last == 99
end

puts 100 * success_count / 100_000


Results:

49
50
49


So, it's pretty much 50/50 based on dumb example.
Time is precious. Waste it wisely.
Hanh
Profile Joined June 2016
146 Posts
Last Edited: 2017-05-31 10:38:29
May 31 2017 10:20 GMT
#17678
The last guy can only pick between his room or the first one because if he could pick another room, it means that room is still vacant. That's not possible because it should have been taken by the guy who is assigned to it.

All the possible scenarios are symmetric if you swap the first and last guy rooms. Because the other guys don't care about who is occupying these rooms.

As a consequence, you have exactly as many successes as you have failures and the probability is 1/2.

Acrofales
Profile Joined August 2010
Spain18178 Posts
May 31 2017 12:57 GMT
#17679
On May 31 2017 19:20 Hanh wrote:
The last guy can only pick between his room or the first one because if he could pick another room, it means that room is still vacant. That's not possible because it should have been taken by the guy who is assigned to it.

All the possible scenarios are symmetric if you swap the first and last guy rooms. Because the other guys don't care about who is occupying these rooms.

As a consequence, you have exactly as many successes as you have failures and the probability is 1/2.


Yes, but the point was to come up with an algorithmic solution (I think), and not solve the problem using logic.
Hanh
Profile Joined June 2016
146 Posts
May 31 2017 16:00 GMT
#17680
What would an algorithmic solution be?
Prev 1 882 883 884 885 886 1032 Next
Please log in or register to reply.
Live Events Refresh
WardiTV Invitational
14:00
Group A
ByuN vs Percival
Percival vs Rogue
Percival vs Classic
ByuN vs Classic
ByuN vs Rogue
Classic vs Rogue
IndyStarCraft 77
LiquipediaDiscussion
RongYI Cup
11:00
Qualifier 1
WardiTV1389
TKL 274
Rex142
3DClanTV 47
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 274
Rex 142
IndyStarCraft 77
Railgan 23
SC2Nice 13
StarCraft: Brood War
Britney 51766
Horang2 2975
Shuttle 1791
Mini 1297
Stork 800
Larva 776
ZerO 699
EffOrt 648
Soma 535
Light 429
[ Show more ]
Zeus 383
Rush 307
ggaemo 288
firebathero 221
hero 205
Leta 165
BeSt 136
Last 124
Pusan 118
Hyun 113
Sharp 110
Barracks 92
Sea.KH 51
Mind 51
sorry 44
Movie 33
Aegong 32
Free 31
HiyA 29
ToSsGirL 27
Terrorterran 27
yabsab 23
Sacsri 18
Shine 13
Bale 13
GoRush 7
Dota 2
Gorgc4867
qojqva2377
XcaliburYe450
ODPixel147
syndereN145
BananaSlamJamma107
Counter-Strike
byalli641
Super Smash Bros
Mew2King114
Heroes of the Storm
Khaldor327
Other Games
singsing2709
B2W.Neo2291
Hui .248
DeMusliM180
ZerO(Twitch)29
Organizations
Other Games
BasetradeTV36
StarCraft: Brood War
Kim Chul Min (afreeca) 5
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• Berry_CruncH209
• intothetv
• Kozan
• AfreecaTV YouTube
• sooper7s
• Migwel
• LaughNgamezSOOP
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 3171
• lizZardDota2124
• HappyZerGling61
League of Legends
• Nemesis5328
• Jankos3515
Upcoming Events
IPSL
5h 41m
DragOn vs Sziky
Replay Cast
18h 41m
Wardi Open
21h 41m
Monday Night Weeklies
1d 2h
WardiTV Invitational
1d 21h
WardiTV Invitational
2 days
The PondCast
3 days
OSC
3 days
OSC
4 days
All Star Teams
5 days
INnoVation vs soO
sOs vs Scarlett
[ Show More ]
uThermal 2v2 Circuit
5 days
All Star Teams
6 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
6 days
OSC
6 days
Liquipedia Results

Completed

Proleague 2026-01-10
Big Gabe Cup #3
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
OSC Championship Season 13
Underdog Cup #3
NA Kuram Kup
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League Season 23
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 © 2026 TLnet. All Rights Reserved.