• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 17:43
CEST 23:43
KST 06:43
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
[BSL20] Non-Korean Championship 4x BSL + 4x China1Flash Announces Hiatus From ASL63Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event22Esports World Cup 2025 - Final Player Roster16
StarCraft 2
General
Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays Korean Starcraft League Week 77
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
SC uni coach streams logging into betting site Player “Jedi” cheat on CSL Flash Announces Hiatus From ASL BW General Discussion Practice Partners (Official)
Tourneys
[BSL20] Non-Korean Championship 4x BSL + 4x China CSL Xiamen International Invitational The Casual Games of the Week Thread [BSL20] Grand Finals - Sunday 20:00 CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? Beyond All Reason
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Summer Games Done Quick 2025! Trading/Investing Thread Things Aren’t Peaceful in Palestine
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 606 users

The Big Programming Thread - Page 884

Forum Index > General Forum
Post a Reply
Prev 1 882 883 884 885 886 1031 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
28087 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
28087 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
Poland17243 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
Poland17243 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
Spain17971 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 1031 Next
Please log in or register to reply.
Live Events Refresh
BSL: ProLeague
18:00
Grand Finals - bo9
Dewalt vs Bonyth
ZZZero.O615
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Livibee 95
ProTech91
StarCraft: Brood War
ZZZero.O 615
Terrorterran 40
League of Legends
Grubby4687
Dendi1473
Counter-Strike
fl0m1811
Super Smash Bros
Mew2King164
Chillindude91
Westballz56
Heroes of the Storm
Khaldor803
Liquid`Hasu661
Other Games
summit1g5438
FrodaN2965
tarik_tv1289
mouzStarbuck321
Pyrionflax203
ViBE126
elazer103
Organizations
Other Games
gamesdonequick44472
EGCTV1741
BasetradeTV46
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 18 non-featured ]
StarCraft 2
• musti20045 67
• Adnapsc2 25
• Kozan
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
StarCraft: Brood War
• 3DClanTV 104
• blackmanpl 6
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• Ler137
League of Legends
• masondota2742
Other Games
• imaqtpie2236
• Shiphtur346
Upcoming Events
Wardi Open
13h 17m
Replay Cast
1d 2h
Sparkling Tuna Cup
1d 12h
WardiTV European League
1d 18h
MaNa vs sebesdes
Mixu vs Fjant
ByuN vs HeRoMaRinE
ShoWTimE vs goblin
Gerald vs Babymarine
Krystianer vs YoungYakov
PiGosaur Monday
2 days
The PondCast
2 days
WardiTV European League
2 days
Jumy vs NightPhoenix
Percival vs Nicoract
ArT vs HiGhDrA
MaxPax vs Harstem
Scarlett vs Shameless
SKillous vs uThermal
Replay Cast
3 days
RSL Revival
3 days
ByuN vs SHIN
Clem vs Reynor
Replay Cast
4 days
[ Show More ]
RSL Revival
4 days
Classic vs Cure
FEL
4 days
RSL Revival
5 days
FEL
5 days
FEL
5 days
Sparkling Tuna Cup
6 days
RSL Revival
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #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...

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.