The Big Programming Thread - Page 531
| 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. | ||
|
Birdie
New Zealand4438 Posts
| ||
|
Shield
Bulgaria4824 Posts
On October 18 2014 04:49 FFGenerations wrote: any of you guys use a saddle style chair? this looks like the affordable UK website (150-165) what the fuck is up with this website design tho? who makes a website like this?? http://www.beautelle.co.uk/company/ direct link http://www.beautelle.co.uk/water/ergonomic posture saddle stools.htm maybe this one is better http://www.tronus.eu/en/saddlestool-standard.html?id=8538440 Even though it assures it's good for back, I'd still go with a simple office chair. | ||
|
CatNzHat
United States1599 Posts
| ||
|
Nesserev
Belgium2760 Posts
| ||
|
Manit0u
Poland17496 Posts
On October 18 2014 12:09 Birdie wrote: Homework question for Haskell. I'm trying to take a list and return a new list of every value which is not the same as the next value, e.g. notEqual [1,1,2,3,4,4,5,6] returns [1,2,3,4,5,6]. The trick is I have to do it only using list comprehension and inbuilt library functions. I can do it using recursion easily enough but I guess I don't understand list comprehension well enough to know how to do it. Can't you just use the filter function? You could also do it recursively by checking head[list] against head[tail[list]] and then simply doing it recursively on tail[list]. I'm no good with Haskell though. Lisp is there to work with lists ![]() Edit: beat me to it. | ||
|
MinoMoto
Latvia107 Posts
I need to create program using "do...while" in C# 1 program is asking you to enter a number(how much times it will do match) 2 program is asking you to enter a number, what will sum with previously entered sum. ![]() | ||
|
JD.
Australia250 Posts
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. | ||
|
Shield
Bulgaria4824 Posts
On October 18 2014 21:02 MinoMoto wrote: Guys i need help again I need to create program using "do...while" in C# 1 program is asking you to enter a number(how much times it will do match) 2 program is asking you to enter a number, what will sum with previously entered sum. ![]() Pseudo code.
Bonus: check if maxIterations' value is negative. It's very easy to do it on your own, and part of that assignment is to teach you C# not math. You may also use arrays instead but I don't find it nice with a do-while loop when you depend on a previous iteration.. | ||
|
goody153
44236 Posts
Me and my friends are planning to put some kind of website that has a drawing app inbound. And i am planning to code a drawing application for the website. I did some googling and there are i found the HTML canvass + Javascript is an easy way to code such tool. However i am not sure if this is enough for the long run since we may want to build a more powerful and flexible drawing app than our current plans. Is there any language, library or framework or something that i should know that is for this certain task drawing webapp and should work better than the html5 + javascript ? Thanks .. my current knowledge for web development are html, css, js , php and mysql. I'm also not an expert of those. | ||
|
Nesserev
Belgium2760 Posts
| ||
|
Shield
Bulgaria4824 Posts
On October 19 2014 00:51 Nesserev wrote: Well, only problem with using a do-while loop in this case is that you only check for the amount of iterations after asking for the first value. So, when the user wants zero iterations, he/she still has to give input; it won't work as intended, it's semantically incorrect. That's correct and one of the reasons I never use do-while loops. Do-while seems like an incorrect approach for this assignment. Otherwise, you have to pollute your code with 'if (maxIterations > 0)' or do that when you take user's input just before do-while loop. I understand there are cases when do-while lines up with a task nicely but I don't think I've encountered many such scenarios. | ||
|
Birdie
New Zealand4438 Posts
On October 18 2014 20:04 Nesserev wrote:
- Use the (x:xs) notation to split head and tail (just like prolog). - There's a wide range of list functions that are really nice, like head(), tail(), etc. - '++' operator is used for appending lists The first case is to handle empty lists, the second case has three more subcases: - deal with last number (when tail is an empty list) - when head != next number - when head == next number I'm trying to do it without recursion, only using list comprehension and built in functions. I've already done it using recursion. | ||
|
Liebig
France738 Posts
On October 19 2014 04:59 Birdie wrote: I'm trying to do it without recursion, only using list comprehension and built in functions. I've already done it using recursion. notEqual l = concat $ map head $ group l ? | ||
|
Birdie
New Zealand4438 Posts
I could be wrong but does that actually remove anything from the list? | ||
|
Liebig
France738 Posts
On October 19 2014 05:26 Birdie wrote: I could be wrong but does that actually remove anything from the list? Made a mistake. notEqual = map head . group λ map head $ group [1,1,2,3,4,4,5,6] [1,2,3,4,5,6] Basically, it just groups consecutive things that are equal, then you just take the first element of each new list and it makes the new list. | ||
|
Nesserev
Belgium2760 Posts
| ||
|
delHospital
Poland261 Posts
notEqual [] = [] This walks through two copies of the same list, but one of them (xs) is always one step ahead of the other (x:xs). It yields an element every time the heads of these lists differ. | ||
|
Birdie
New Zealand4438 Posts
On October 19 2014 05:44 Liebig wrote: Made a mistake. notEqual = map head . group λ map head $ group [1,1,2,3,4,4,5,6] [1,2,3,4,5,6] Basically, it just groups consecutive things that are equal, then you just take the first element of each new list and it makes the new list. I didn't know how group worked, thanks for introducing me to that function! map head (group list) worked for me. On October 19 2014 08:05 delHospital wrote: If you really want to use list comprehensions, you could do something like notEqual [] = [] This walks through two copies of the same list, but one of them (xs) is always one step ahead of the other (x:xs). It yields an element every time the heads of these lists differ. I was trying something of this style yesterday but didn't know about zip, thanks also to you <3 | ||
|
Hug-A-Hydralisk
United States174 Posts
| ||
|
CatNzHat
United States1599 Posts
On October 19 2014 00:47 goody153 wrote: Hello Sir's, Me and my friends are planning to put some kind of website that has a drawing app inbound. And i am planning to code a drawing application for the website. I did some googling and there are i found the HTML canvass + Javascript is an easy way to code such tool. However i am not sure if this is enough for the long run since we may want to build a more powerful and flexible drawing app than our current plans. Is there any language, library or framework or something that i should know that is for this certain task drawing webapp and should work better than the html5 + javascript ? Thanks .. my current knowledge for web development are html, css, js , php and mysql. I'm also not an expert of those. You will not be limited by javascript, it's only option as far as client-side in browser applications are concerned, and there are various photoshop like web-apps that have very complicated painting engines that all run in the browser (js, canvas) | ||
| ||

![[image loading]](http://i.imgur.com/ZEs40GF.png?1)