• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 19:37
CET 01:37
KST 09:37
  • 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] Finals Preview: Sweet Victory!12[ASL22] Ro4 Preview: Mirror Mirror6[ASL22] Ro8 Preview: Within Reach5[ASL22] Ro8 Preview: In A Tizzy11[ASL22] Ro16 Preview: Holy Diver5
Community News
Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win0Weekly Cups (October 19-25): Clem triples first in 5.0.175Evil Geniuses - shutting down23ISSL (IntoTheTV x SOOP SC2 League): Premier7Weekly Cups (October 12-18): 5.0.17 era begins1
StarCraft 2
General
[D] Hacker peak in sc2 ? No more SC2 streamers on team liquid? Liquibets sc2 season 30 Evil Geniuses - shutting down Weekly Cups (Oct 26 - Nov 1): MaxPax, herO, Solar win
Tourneys
SC4ALL: II Venue Change Announcement! Sparkling Tuna Cup - Weekly Open Tournament WardiTV Mondays ISSL (IntoTheTV x SOOP SC2 League): Premier Stellar Fest TWO the Moon (Dec 16-20)
Strategy
[H] ZvP Mid-Late Game: Stalkers Collossi HT
Custom Maps
[G] How to playtest arcade maps Starcraft 2 Advance [D] the control group Simple Questions/Answers
External Content
Mutation # 550 Graveyard Shift The PondCast: SC2 News & Results Mutation # 549 Endless Sparkles Mutation # 548 Shining Bright
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Rollback Netcode in Brood War SC4ALL: II Venue Change Announcement! Ziemie's Starcraft 1 Prequel Campaign 🇺🇦 Ukrainian StarCraft:BroodWar community reborn
Tourneys
[$1250] International ShieldBattery League [Megathread] Daily Proleagues Small VOD Thread 2.0 KCM Race Survival 2026 Season 4
Strategy
50,000-Word Terran Builds Memo 2026-10-22 Cliff Jump Revisited (1 in a 1000 strategy) Simple Questions, Simple Answers
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Deus Ex 3!? Mobile Legends: Bang Bang Armies of Exigo - YesYes?
Dota 2
Dota 2 Champions League Season 3 Begins April 25!
League of Legends
[TL LoL EUW IHs] Teemo shall perish
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Dating: How's your luck? Trading/Investing Thread Things Aren’t Peaceful in Palestine Canadian Politics Mega-thread
Fan Clubs
Fan Club Resource Thread Reynor Fan Club The Flash Fan Club
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece
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
Recent Gifted Posts
Blogs
Why I built Repalyzer (1.1.…
BlueStar
Innovate or Game Over?
TrAiDoS
ShieldBattery on Mac
Kraekkling
[ASL22] Ro4 Day1 Ticket Giv…
bITt.mAN
Can Bots Beat Pros?? Starcr…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 10465 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
Poland17871 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
44313 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
PSISTORM Gaming Misc
09:00
FSL season 12 opener: HM vs ST
Freeedom74
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SpeCial 39
StarCraft: Brood War
Britney 7687
Dota 2
PGG 213
League of Legends
Doublelift4873
JimRising 739
Counter-Strike
jkaem63
Other Games
gofns14930
summit1g8824
Grubby2065
Day[9].tv523
shahzam424
PiGStarcraft326
XaKoH 285
C9.Mang0283
syndereN178
Maynarde66
Fuzer 59
NeuroSwarm55
ViBE48
PPMD23
Railgan20
KnowMe15
JuggernautJason4
Organizations
Other Games
gamesdonequick512
Counter-Strike
PGL86
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 77
• RyuSc2 24
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• Laughngamez YouTube
• Migwel
StarCraft: Brood War
• HerbMon 38
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3381
• Jankos3336
• Scarra898
Other Games
• imaqtpie613
• Day9tv523
• Shiphtur174
Upcoming Events
IntoTheTV X SOOP
10h 23m
Reynor vs Solar
ByuN vs SHIN
Clem vs MaxPax
herO vs Rogue
IPSL
16h 23m
WorsT vs nOmaD
Dewalt vs andersOn
AI Arena Tournament
18h 23m
IntoTheTV X SOOP
1d 10h
IPSL
1d 16h
Azhi_Dahaki vs ggnore13
Double vs WIZARD
Replay Cast
1d 22h
Replay Cast
2 days
Sparkling Tuna Cup
3 days
WardiTV Invitational
3 days
YoungYakov vs Lambo
SHIN vs TBD
Percival vs Shameless
Solar vs TBD
PiGosaur Cup
4 days
[ Show More ]
The PondCast
5 days
KCM Race Survival
5 days
WardiTV Invitational
5 days
Liquipedia Results

Completed

Proleague 2026-11-05
Blizzard Classic Cup 2026
HCC Season 3

Ongoing

Acropolis #5
KCM Race Survival 2026 Season 4
International ShieldBattery League
BSL Season 23
IPSL Winter 2026-27
Calamity Cup Div. A Season 8
IEM Beijing 2026
PGL Masters Bucharest 2026
Stake Ranked Episode 5
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
FISSURE Playground #3
BLAST Open Fall 2026

Upcoming

Sector 951
SC4ALL II: Brood War
BSL 23: Non-Korean Championship
HSC XXX
Stellar Fest 2: Lunar Cup
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
RSL Offline Finals
Underdog Cup 2026 Div 2-3
PGL Bucharest 2027
BLAST Bounty Winter 2027
eXTREMESLAND 2026
PGL Major Singapore 2026
Stake Ranked Episode 6
BLAST Rivals 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.