• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 01:03
CEST 07:03
KST 14:03
  • 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
[ASL22] Ro16 Preview: Rough Waters10[ASL22] Ro24 Preview: Siren's Call8[ASL22] Ro24 Preview: Summer's End9Serral wins HomeStory Cup 2915Serral wins Maestros of the Game 244
Community News
StarCraft open world shooter announced at BlizzCon54Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism10Official StarCraft website teases new content ahead of BlizzCon?162Stellar Fest TWO the Moon (Dec 16-20)9Weekly Cups (August 24-30): Patches' balance mod takes over3
StarCraft 2
General
How do you feel about the StarCraft shooter announcement at BlizzCon 2026? StarCraft open world shooter announced at BlizzCon Balance hotfix patch 5.0.16b (July 16) Team Liquid Map Contest #22: Results and Winners Weekly Cups (Aug 30-Sep 7): herO thrives amid growing schism
Tourneys
RSL goes to London! 2026 Offline Finals Nov 21-22 KSL Week #92 IntoTheTV X SOOP SC2 League : Weekly & Monthly 2026 GSTL Announcement Sparkling Tuna Cup - Weekly Open Tournament
Strategy
[G] Having the right mentality to improve
Custom Maps
Nexus Wars 2021 GUIDE [M] (2) Industrial Park
External Content
Mutation # 542 The Ascended Mutation # 541 Binary Choice The PondCast: SC2 News & Results Mutation # 540 Dodge This
Brood War
General
Official StarCraft website teases new content ahead of BlizzCon? BGH Auto Balance -> http://bghmmr.eu/ Broodwar Prediction Market Practice Partners (Official) [D] Brainstorming a balance patch for Brood war
Tourneys
[ASL22] Ro16 Group A [ASL22] Ro16 Group B Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Replay Review Process - What do you do? Simple Questions, Simple Answers Odyssey Mineral Stack Saturation Game Theory for Starcraft
Other Games
General Games
EVE Corporation Diablo IV Nintendo Switch Thread [Maplestory Hardcore] Let's Play~!! General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
[TL LoL EUW IHs] Teemo shall perish TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
Trading/Investing Thread US Politics Mega-thread UK Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread
Fan Clubs
MarineLorD Fan Club The Creator Fan Club The ShoWTimE Fan Club
Media & Entertainment
Diablo Animated Series on Netflix Movie Discussion!
Sports
Football (Soccer) Thread TeamLiquid Health and Fitness Initiative For 2023 MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Northern Ireland Global Starcraft
Blogs
Virtual Romance, Real-Life C…
TrAiDoS
Regacy Esports:Our Goa…
regacyesports
Dreaming of BW patches (mod…
c3rberUs
LOCKPICKING NOOB
LUCKY_NOOB
Customize Sidebar...

Website Feedback

Closed Threads



Active: 6002 users

The Big Programming Thread - Page 531

Forum Index > General Forum
Post a Reply
Prev 1 529 530 531 532 533 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.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
October 18 2014 03:09 GMT
#10601
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.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
October 18 2014 08:37 GMT
#10602
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
Profile Blog Joined February 2011
United States1599 Posts
October 18 2014 09:02 GMT
#10603
I'm starting to mess around with some machine learning stuff and I'm looking for resources to learn about business implementations of the various models. More specifically using polynomial linear regression to predict customer behavior in an e-commerce platform based on past activity.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
October 18 2014 11:04 GMT
#10604
--- Nuked ---
Manit0u
Profile Blog Joined August 2004
Poland17843 Posts
Last Edited: 2014-10-18 11:19:50
October 18 2014 11:17 GMT
#10605
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.
Time is precious. Waste it wisely.
MinoMoto
Profile Joined June 2011
Latvia107 Posts
October 18 2014 12:02 GMT
#10606
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.
[image loading]
JD.
Profile Joined September 2014
Australia250 Posts
October 18 2014 13:10 GMT
#10607
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
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-10-18 14:02:34
October 18 2014 13:46 GMT
#10608
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.
[image loading]


Pseudo code.


int iteration = 0;
int maxIterations;
int sum = 0;
int inputValue;

maxIterations := <take value>

do
inputValue := <take value>
Print Sum[iteration]=sum+inputValue
sum += inputValue
++iteration
while iteration < maxIterations

Print Sum[iteration]=sum


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
Profile Blog Joined April 2013
44300 Posts
October 18 2014 15:47 GMT
#10609
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.
this is a quote
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-10-18 15:53:28
October 18 2014 15:51 GMT
#10610
--- Nuked ---
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-10-18 16:06:30
October 18 2014 16:05 GMT
#10611
On October 19 2014 00:51 Nesserev wrote:
Show nested quote +
On October 18 2014 22:46 darkness wrote:
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.
[image loading]


Pseudo code.


int iteration = 0;
int maxIterations;
int sum = 0;
int inputValue;

maxIterations := <take value>

do
inputValue := <take value>
Print Sum[iteration]=sum+inputValue
sum += inputValue
++iteration
while iteration < maxIterations

Print Sum[iteration]=sum


+ Show Spoiler +
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..


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
Profile Blog Joined August 2007
New Zealand4438 Posts
October 18 2014 19:59 GMT
#10612
On October 18 2014 20:04 Nesserev wrote:
Show nested quote +
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.



notEqual :: Eq a => [ a ] -> [ a ]
notEqual [] = []
notEqual (x:xs) | xs == [] = [ x ]
| x /= next = [ x ] ++ notEqual(xs)
| x == next = notEqual(xs)
where
{ next = head(xs)
}

- 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.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Liebig
Profile Joined August 2010
France738 Posts
October 18 2014 20:13 GMT
#10613
On October 19 2014 04:59 Birdie wrote:
Show nested quote +
On October 18 2014 20:04 Nesserev wrote:
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.



notEqual :: Eq a => [ a ] -> [ a ]
notEqual [] = []
notEqual (x:xs) | xs == [] = [ x ]
| x /= next = [ x ] ++ notEqual(xs)
| x == next = notEqual(xs)
where
{ next = head(xs)
}

- 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.

notEqual l = concat $ map head $ group l

?
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
October 18 2014 20:26 GMT
#10614
On October 19 2014 05:13 Liebig wrote:
Show nested quote +
On October 19 2014 04:59 Birdie wrote:
On October 18 2014 20:04 Nesserev wrote:
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.



notEqual :: Eq a => [ a ] -> [ a ]
notEqual [] = []
notEqual (x:xs) | xs == [] = [ x ]
| x /= next = [ x ] ++ notEqual(xs)
| x == next = notEqual(xs)
where
{ next = head(xs)
}

- 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.

notEqual l = concat $ map head $ group l

?

I could be wrong but does that actually remove anything from the list?
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Liebig
Profile Joined August 2010
France738 Posts
Last Edited: 2014-10-18 20:52:06
October 18 2014 20:44 GMT
#10615
On October 19 2014 05:26 Birdie wrote:
Show nested quote +
On October 19 2014 05:13 Liebig wrote:
On October 19 2014 04:59 Birdie wrote:
On October 18 2014 20:04 Nesserev wrote:
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.



notEqual :: Eq a => [ a ] -> [ a ]
notEqual [] = []
notEqual (x:xs) | xs == [] = [ x ]
| x /= next = [ x ] ++ notEqual(xs)
| x == next = notEqual(xs)
where
{ next = head(xs)
}

- 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.

notEqual l = concat $ map head $ group l

?

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
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-10-18 21:04:56
October 18 2014 20:56 GMT
#10616
--- Nuked ---
delHospital
Profile Blog Joined December 2010
Poland261 Posts
October 18 2014 23:05 GMT
#10617
If you really want to use list comprehensions, you could do something like

notEqual [] = []
notEqual (x:xs) = x : [cur | (prev, cur) <- zip (x:xs) xs, prev /= cur]

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
Profile Blog Joined August 2007
New Zealand4438 Posts
Last Edited: 2014-10-18 23:44:13
October 18 2014 23:43 GMT
#10618
On October 19 2014 05:44 Liebig wrote:
Show nested quote +
On October 19 2014 05:26 Birdie wrote:
On October 19 2014 05:13 Liebig wrote:
On October 19 2014 04:59 Birdie wrote:
On October 18 2014 20:04 Nesserev wrote:
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.



notEqual :: Eq a => [ a ] -> [ a ]
notEqual [] = []
notEqual (x:xs) | xs == [] = [ x ]
| x /= next = [ x ] ++ notEqual(xs)
| x == next = notEqual(xs)
where
{ next = head(xs)
}

- 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.

notEqual l = concat $ map head $ group l

?

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.

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 [] = []
notEqual (x:xs) = x : [cur | (prev, cur) <- zip (x:xs) xs, prev /= cur]

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
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Hug-A-Hydralisk
Profile Joined February 2012
United States174 Posts
Last Edited: 2014-10-20 01:32:37
October 19 2014 06:01 GMT
#10619
Get your PC gaming fix here: http://www.youtube.com/cinicraft YOU KNOW YOU WANT TO!!
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
October 19 2014 07:59 GMT
#10620
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)
Prev 1 529 530 531 532 533 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
20:30
Masters Cup #151
davetesta41
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
FoxeR 41
ProTech24
StarCraft: Brood War
Aegong 87
yabsab 21
Icarus 7
Dota 2
ODPixel243
NeuroSwarm215
LuMiX1
Other Games
summit1g12073
JimRising 536
PiGStarcraft299
Organizations
Other Games
BasetradeTV190
[ Show 13 non-featured ]
StarCraft 2
• Sammyuel 3
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• Migwel
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21914
League of Legends
• Lourlo756
• Stunt288
• Jankos238
Upcoming Events
Sparkling Tuna Cup
4h 58m
WardiTV Invitational
5h 58m
ByuN vs Percival
Cure vs Classic
Shopify Rebellion Sundays
9h 58m
Spirit vs Mixu
Clem vs TBD
RSL Revival
10h 58m
Serral vs Rogue
BlizzCon
13h 28m
IdrA vs MC
Replay Cast
18h 58m
Afreeca Starleague
1d 4h
Light vs JyJ
Soulkey vs hero
WardiTV Weekly
1d 5h
Monday Night Weeklies
1d 10h
Afreeca Starleague
2 days
Snow vs Shinee
Shine vs EffOrt
[ Show More ]
GSL
2 days
PiGosaur Cup
2 days
The PondCast
3 days
Kung Fu Cup
3 days
Replay Cast
3 days
KCM Race Survival
4 days
IntoTheTV X SOOP
4 days
Replay Cast
4 days
IntoTheTV X SOOP
5 days
Replay Cast
5 days
GSL
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Acropolis #5 - TRS
PiG Sty Festival 8.0
Big Dog Cup 2026 Div 1

Ongoing

KCM Race Survival 2026 Season 3
K-JUNGMAN
ASL Season 22
Super Anchor Qualifying S3
CSL 2026 AUTUMN (S22)
Acropolis #5
Blizzard Classic Cup 2026
Blizzard Classic Cup 2026
RSL Revival: Season 6
Calamity Invitational
FISSURE Playground #3
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026

Upcoming

Acropolis #5 - GSA
Acropolis #5 - GSB
Acropolis #5 - GSC
SC4ALL II: Brood War
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals Fall 2026
IEM Beijing 2026
Stake Ranked Episode 5
PGL Masters Bucharest 2026
1win Private Club #2
Thunderpick World Champ. '26
ESL Pro League Season 24
Stake Ranked Episode 4
1win Private Club #1
Logitech G Play Connect 2026
SL StarSeries Fall 2026
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 © 2026 TLnet. All Rights Reserved.