• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 18:13
CET 00:13
KST 08:13
  • 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 Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
Sparkling Tuna Cup - Weekly Open Tournament RSL Offline Finals Info - Dec 13 and 14! StarCraft Evolution League (SC Evo Biweekly) Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night
Brood War
General
The top three worst maps of all time Foreign Brood War BGH Auto Balance -> http://bghmmr.eu/ Data analysis on 70 million replays BW General Discussion
Tourneys
Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile ZeroSpace Megathread The Perfect Game
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 TL Mafia Community Thread
Community
General
European Politico-economics QA Mega-thread US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming 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
Where to ask questions and add stream? The Automated Ban List
Blogs
I decided to write a webnov…
DjKniteX
Physical Exertion During Gam…
TrAiDoS
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1468 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
28094 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
28094 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
Poland17507 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
Poland17507 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
Spain18142 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
Patches Events
23:00
5.4k Patch Clash #9
Liquipedia
BSL 21
20:00
RO16: Group D
Bonyth vs StRyKeR
Tarson vs Dandy
ZZZero.O310
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft333
Liquid`TLO 253
elazer 188
ProTech121
CosmosSc2 117
SpeCial 7
StarCraft: Brood War
Shuttle 570
Artosis 317
ZZZero.O 310
NaDa 18
Terrorterran 1
Dota 2
Dendi1253
syndereN578
LuMiX1
League of Legends
Nathanias28
Heroes of the Storm
Khaldor191
Other Games
Grubby6587
shahzam509
XaKoH 83
Mew2King64
Maynarde30
fpsfer 2
Organizations
Other Games
EGCTV2335
gamesdonequick1752
BasetradeTV40
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Hupsaiya 55
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• Ler86
League of Legends
• Doublelift3902
Other Games
• imaqtpie2207
• Shiphtur245
Upcoming Events
Replay Cast
9h 47m
Wardi Open
12h 47m
StarCraft2.fi
16h 47m
Monday Night Weeklies
17h 47m
Replay Cast
1d
WardiTV 2025
1d 12h
StarCraft2.fi
1d 16h
PiGosaur Monday
2 days
StarCraft2.fi
2 days
Tenacious Turtle Tussle
3 days
[ Show More ]
The PondCast
3 days
WardiTV 2025
3 days
StarCraft2.fi
3 days
WardiTV 2025
4 days
StarCraft2.fi
5 days
RSL Revival
5 days
IPSL
5 days
Sziky vs JDConan
RSL Revival
6 days
Classic vs TBD
herO vs Zoun
WardiTV 2025
6 days
IPSL
6 days
Tarson vs DragOn
Liquipedia Results

Completed

Proleague 2025-12-04
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
Acropolis #4 - TS3
WardiTV 2025
META Madness #9
Kuram Kup
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

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
RSL Offline Finals
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 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.