The Big Programming Thread - Page 504
| 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. | ||
|
Blisse
Canada3710 Posts
| ||
|
Shenghi
167 Posts
On July 27 2014 14:56 raNazUra wrote: Question: Do you guys have any recommendations for coding competition websites? I realize a lot of people don't really care about them, so this may be a miss, but I've done the Google Code Jam for the last few years and really enjoyed it as for-fun algorithms puzzles, but it only rolls around once a year. The following list is not exhaustive by a long shot, but ought to get you started. For competitions on a regular basis: For practice:
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
CatNzHat
United States1599 Posts
On July 27 2014 12:27 obesechicken13 wrote: Say you're making a forum: Should you use the user's id or username to match their post details? One of my groupmembers linked two tables with username and I feel like there's something wrong with this but can't say why. I tried googling but that didn't return the right results. Table1 Users ID username 1 Blisse 2 icystorage 5 obesechicken13 7 RoyGBiv_13 Table Posts ID User_ID Thread Post 1 1 Big%20Programming%20Thread blah%20blah%20blah 2 1 ... 3 2 ... 4 5 ... Or ID Username Thread Post 1 Blisse Big%20Programming%20Thread blah%20blah%20blah 2 Blisse ... 3 icystorage ... 4 obesechicken13 ... ? I guess it'd be faster to use user_id but I don't think that'd be noticeable for a small project. And when a user changes their username, the posts would all have to change too. Don't denormalize the username to the post, or don't let them change their username. Indexing by an INT id is faster than a TEXT username, and in most cases page render time is not going to be bottlenecked by having an extra join in your query. If it becomes a problem you can address it then. | ||
|
Morphage
France492 Posts
On July 27 2014 17:13 Nesserev wrote: Ty for this post <3 Gonna have a lot of fun with this ![]() There's also CodeEval and HackerRank. | ||
|
HaRuHi
1220 Posts
| ||
|
Blisse
Canada3710 Posts
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
HaRuHi
1220 Posts
| ||
|
Blisse
Canada3710 Posts
| ||
|
HaRuHi
1220 Posts
On July 27 2014 20:01 Nesserev wrote: Nope, just tested it... it doesn't compile with any version. The reason is probably, because it isn't parsed correctly by the compiler, which is a good thing lol... and if it does, you should report it to the author of the compiler. I was surprised at first, because you made it sound like it was possible in 'normal' C++. Besides, it's really bad, ugly code; where did you get the idea from that this should be possible?? ^^, sorry, didn't want to imply that it should be possible on any standard. This beautiful piece of code is right out of the most recent edition of the primer, but they changed the chapter that introduces variables and they don't explain why this should be illigal, but still ask for it. Think I just gonna read a chapter about variables online somewhere^^. | ||
|
spinesheath
Germany8679 Posts
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
HaRuHi
1220 Posts
http://dl.e-book-free.com/2013/07/c_primer_5th_edition.pdf It is question (a) on Page 75. | ||
|
obesechicken13
United States10467 Posts
On July 27 2014 18:31 CatNzHat wrote: Don't denormalize the username to the post, or don't let them change their username. Indexing by an INT id is faster than a TEXT username, and in most cases page render time is not going to be bottlenecked by having an extra join in your query. If it becomes a problem you can address it then. I'd call it denormalization but it wasn't long enough to be normalized in the first place lol. Kk thanks. I didn't notice the cheeky change to Blisse's threads too ![]() | ||
|
Shield
Bulgaria4824 Posts
If there are more "must read" books, please let me know. I also plan to read Code Complete in the future.On July 26 2014 04:49 spinesheath wrote: It really doesn't matter a whole lot what language you learn. Your focus is what matters, and your focus certainly shouldn't be on language-specific stuff. C# isn't going to go away for the next couple of years, so it's as good of a starting point as any language. Learning functional languages like haskell and scala is a good investment into the future. Functional programming is on the rise for very solid reasons. Multithreaded environments being the major one. Generally, languages are volatile and you might want to switch to a completely new language a year or two down the road. Especially now that commonplace large scale multithreading is on the horizon, which few current languages are particluarly good at. I don't know about functional programming but there is this Actor Model theory that helps concurrent programming, which I have studied at university. However, I don't know how viable it is in practice. | ||
|
aksfjh
United States4853 Posts
there's another value, "pn," that I'm not sure of. I have an initial guess, but wanted some consensus on the subject before moving forward. Examples:
Also, if anybody has knowledge of any documentation on ecl (Embedded Check Language), it would be greatly appreciated. My initial Google searches didn't yield any good results. | ||
|
spinesheath
Germany8679 Posts
On July 28 2014 23:18 darkness wrote: Thanks for recommending the Clean Code book to me in the past. It's really worth reading it. If there are more "must read" books, please let me know. I also plan to read Code Complete in the future.I don't know about functional programming but there is this Actor Model theory that helps concurrent programming, which I have studied at university. However, I don't know how viable it is in practice. The nice thing about (pure) functional programming is that it deals with one of the most problematic issue in concurrent programming by definition. Immutability is awesome, and even though I don't really do functional programming I do try to take advantage of immutability wherever I can. And I do plan to get more into functional programming in the not-to-far-away future. I'd put TDD by example on the must read list. | ||
|
Nesserev
Belgium2760 Posts
| ||
|
falconfan02
United States231 Posts
| ||
| ||
