The Big Programming Thread - Page 884
Forum Index > General Forum |
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
Portugal2017 Posts
| ||
![]()
shz
Germany2686 Posts
| ||
![]()
TheEmulator
28079 Posts
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? | ||
![]()
shz
Germany2686 Posts
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. | ||
Blisse
Canada3710 Posts
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. | ||
SoSexy
Italy3725 Posts
| ||
Blisse
Canada3710 Posts
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 | ||
SoSexy
Italy3725 Posts
| ||
bangsholt
Denmark138 Posts
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
Belgium2760 Posts
| ||
![]()
TheEmulator
28079 Posts
| ||
Manit0u
Poland17196 Posts
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). | ||
YourGoodFriend
United States2197 Posts
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. | ||
Deleted User 3420
24492 Posts
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
Finland233 Posts
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
United States2566 Posts
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. | ||
Manit0u
Poland17196 Posts
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:
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...
Results:
So, it's pretty much 50/50 based on dumb example. | ||
Hanh
146 Posts
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
Spain17849 Posts
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
146 Posts
| ||
| ||