• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 14:06
CET 20:06
KST 04:06
  • 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: Winners8Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting12[ASL20] Ro4 Preview: Descent11
Community News
Starcraft, SC2, HoTS, WC3, returning to Blizzcon!33$5,000+ WardiTV 2025 Championship6[BSL21] RO32 Group Stage4Weekly Cups (Oct 26-Nov 2): Liquid, Clem, Solar win; LAN in Philly2Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win9
StarCraft 2
General
5.0.15 Patch Balance Hotfix (2025-10-8) RotterdaM "Serral is the GOAT, and it's not close" TL.net Map Contest #21: Winners Starcraft, SC2, HoTS, WC3, returning to Blizzcon! Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Merivale 8 Open - LAN - Stellar Fest Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace
Brood War
General
[ASL20] Ask the mapmakers — Drop your questions BW General Discussion [BSL21] RO32 Group Stage BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review
Tourneys
[Megathread] Daily Proleagues [ASL20] Grand Finals [BSL21] RO32 Group B - Sunday 21:00 CET [BSL21] RO32 Group A - Saturday 21:00 CET
Strategy
Current Meta PvZ map balance How to stay on top of macro? Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Should offensive tower rushing be viable in RTS games? Path of Exile Stormgate/Frost Giant Megathread Dawn of War IV 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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine YouTube Thread Dating: How's your luck?
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
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
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Why we need SC3
Hildegard
Reality "theory" prov…
perfectspheres
Our Last Hope in th…
KrillinFromwales
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1531 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
28092 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
28092 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
Poland17420 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
Poland17420 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
Spain18109 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
LAN Event
18:00
Stellar Fest: Day 1
Lambo vs Harstem
FuturE vs Maplez
Scarlett vs FoxeR
Gerald vs Mixu
Zoun vs TBD
Clem vs TBD
ByuN vs TBD
TriGGeR vs TBD
ComeBackTV 883
UrsaTVCanada632
IndyStarCraft 192
CranKy Ducklings135
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
IndyStarCraft 192
White-Ra 167
UpATreeSC 93
JuggernautJason41
MindelVK 34
StarCraft: Brood War
GuemChi 1027
Jaedong 862
Mini 260
Leta 95
Backho 51
scan(afreeca) 45
sas.Sziky 39
soO 16
Bale 9
HiyA 7
Dota 2
qojqva4039
League of Legends
Trikslyr42
Counter-Strike
ScreaM1341
pashabiceps684
byalli560
Other Games
Grubby1955
Beastyqt826
B2W.Neo366
KnowMe162
C9.Mang090
ToD60
QueenE57
Organizations
Counter-Strike
PGL163
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• Kozan
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• IndyKCrew
• intothetv
StarCraft: Brood War
• HerbMon 7
• 80smullet 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 4380
• Noizen60
League of Legends
• Nemesis4602
• imaqtpie1388
• TFBlade747
Other Games
• WagamamaTV260
• Shiphtur250
• tFFMrPink 13
Upcoming Events
Korean StarCraft League
7h 54m
CranKy Ducklings
14h 54m
IPSL
22h 54m
dxtr13 vs OldBoy
Napoleon vs Doodle
LAN Event
22h 54m
BSL 21
1d
Gosudark vs Kyrie
Gypsy vs Sterling
UltrA vs Radley
Dandy vs Ptak
Replay Cast
1d 3h
Sparkling Tuna Cup
1d 14h
WardiTV Korean Royale
1d 16h
IPSL
1d 22h
JDConan vs WIZARD
WolFix vs Cross
LAN Event
1d 22h
[ Show More ]
BSL 21
2 days
spx vs rasowy
HBO vs KameZerg
Cross vs Razz
dxtr13 vs ZZZero
Replay Cast
2 days
Wardi Open
2 days
WardiTV Korean Royale
3 days
Replay Cast
4 days
Kung Fu Cup
4 days
Classic vs Solar
herO vs Cure
Reynor vs GuMiho
ByuN vs ShoWTimE
Tenacious Turtle Tussle
5 days
The PondCast
5 days
RSL Revival
5 days
Solar vs Zoun
MaxPax vs Bunny
Kung Fu Cup
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
Classic vs Creator
Cure vs TriGGeR
Kung Fu Cup
6 days
Liquipedia Results

Completed

BSL 21 Points
SC4ALL: StarCraft II
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
Stellar Fest: Constellation Cup
IEM Chengdu 2025
PGL Masters Bucharest 2025
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

Upcoming

BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 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.