• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:16
CET 17:16
KST 01:16
  • 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
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies1ComeBackTV's documentary on Byun's Career !10Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2
StarCraft 2
General
Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies ComeBackTV's documentary on Byun's Career ! Micro Lags When Playing SC2? When will we find out if there are more tournament Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win
Tourneys
$5,000+ WardiTV 2025 Championship Sparkling Tuna Cup - Weekly Open Tournament $100 Prize Pool - Winter Warp Gate Masters Showdow Winter Warp Gate Amateur Showdown #1 RSL Offline Finals Info - Dec 13 and 14!
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Klaucher discontinued / in-game color settings Anyone remember me from 2000s Bnet EAST server? How Rain Became ProGamer in Just 3 Months FlaSh on: Biggest Problem With SnOw's Playstyle
Tourneys
[BSL21] LB QuarterFinals - Sunday 21:00 CET Small VOD Thread 2.0 [Megathread] Daily Proleagues [BSL21] WB SEMIFINALS - Saturday 21:00 CET
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile General RTS Discussion Thread 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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine YouTube 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
TL+ Announced Where to ask questions and add stream?
Blogs
The (Hidden) Drug Problem in…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1662 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
Poland17542 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
Poland17542 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
Spain18158 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
Wardi Open
12:00
Monday #66
WardiTV1542
TKL 355
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 355
ProTech125
Liquid`VortiX 94
DivinesiaTV 8
StarCraft: Brood War
Bisu 2376
Sea 2203
Mini 1067
Larva 1061
Light 781
Soma 631
Stork 452
Snow 339
firebathero 247
Rush 189
[ Show more ]
ggaemo 169
Sharp 136
PianO 98
hero 94
Mong 57
Aegong 45
Yoon 42
sorry 41
Bale 37
Movie 32
Terrorterran 23
910 23
soO 22
Shinee 20
Sacsri 13
Dota 2
singsing4870
syndereN1123
XcaliburYe549
Counter-Strike
adren_tv81
Heroes of the Storm
Khaldor208
Other Games
Grubby5992
B2W.Neo1039
crisheroes359
Fuzer 323
Lowko312
hiko273
RotterdaM247
QueenE91
Mew2King81
nookyyy 58
Trikslyr22
RushiSC15
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV1071
League of Legends
• Nemesis2624
• TFBlade918
Upcoming Events
Monday Night Weeklies
44m
WardiTV Invitational
1d 19h
Replay Cast
2 days
WardiTV Invitational
2 days
ByuN vs Solar
Clem vs Classic
Cure vs herO
Reynor vs MaxPax
Replay Cast
4 days
Sparkling Tuna Cup
5 days
Replay Cast
6 days
Wardi Open
6 days
Liquipedia Results

Completed

YSL S2
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
BSL Season 21
Slon Tour Season 2
CSL Season 19: Qualifier 2
eXTREMESLAND 2025
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

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
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 © 2025 TLnet. All Rights Reserved.