• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 03:53
CET 09:53
KST 17:53
  • 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
RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12Intel X Team Liquid Seoul event: Showmatches and Meet the Pros10
Community News
Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3RSL Season 3: RO16 results & RO8 bracket13
StarCraft 2
General
Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced Weekly Cups (Nov 24-30): MaxPax, Clem, herO win SC2 Proleague Discontinued; SKT, KT, SGK, CJ disband
Tourneys
RSL Offline Finals Info - Dec 13 and 14! StarCraft Evolution League (SC Evo Biweekly) RSL Offline FInals Sea Duckling Open (Global, Bronze-Diamond) $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night Mutation # 499 Chilling Adaptation
Brood War
General
BW General Discussion Which season is the best in ASL? Data analysis on 70 million replays BGH Auto Balance -> http://bghmmr.eu/ [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[BSL21] RO16 Group D - Sunday 21:00 CET [BSL21] RO16 Group A - Saturday 21:00 CET [Megathread] Daily Proleagues [BSL21] RO16 Group B - Sunday 21:00 CET
Strategy
Current Meta Game Theory for Starcraft How to stay on top of macro? PvZ map balance
Other Games
General Games
Nintendo Switch Thread ZeroSpace Megathread Stormgate/Frost Giant Megathread The Perfect Game Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Big Programming Thread Artificial Intelligence Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Where to ask questions and add stream? The Automated Ban List
Blogs
Physical Exertion During Gam…
TrAiDoS
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1712 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
Poland17496 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
44236 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
Replay Cast
00:00
WardiTV Mondays #62
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 148
-ZergGirl 64
StarCraft: Brood War
Britney 12724
Tasteless 282
BeSt 230
Pusan 110
Sacsri 97
Killer 94
Sharp 59
Dewaltoss 56
sorry 43
Shine 37
[ Show more ]
ToSsGirL 31
Shinee 31
ZergMaN 27
Bale 23
ggaemo 7
Hm[arnc] 6
Dota 2
febbydoto161
NeuroSwarm114
canceldota43
League of Legends
JimRising 544
C9.Mang0266
Reynor76
Counter-Strike
shoxiejesuss350
Super Smash Bros
Westballz32
Other Games
summit1g10971
WinterStarcraft559
crisheroes376
Happy253
ceh972
Mew2King37
Organizations
Other Games
gamesdonequick605
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• LUISG 21
• Light_VIP 13
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota212
League of Legends
• Lourlo1114
Upcoming Events
The PondCast
1h 7m
OSC
7h 7m
Demi vs Mixu
Nicoract vs TBD
Babymarine vs MindelVK
ForJumy vs TBD
Shameless vs Percival
Replay Cast
15h 7m
Korean StarCraft League
1d 18h
CranKy Ducklings
2 days
WardiTV 2025
2 days
SC Evo League
2 days
BSL 21
2 days
Sziky vs OyAji
Gypsy vs eOnzErG
OSC
2 days
Solar vs Creator
ByuN vs Gerald
Percival vs Babymarine
Moja vs Krystianer
EnDerr vs ForJumy
sebesdes vs Nicoract
Sparkling Tuna Cup
3 days
[ Show More ]
WardiTV 2025
3 days
OSC
3 days
BSL 21
3 days
Bonyth vs StRyKeR
Tarson vs Dandy
Replay Cast
4 days
Wardi Open
4 days
StarCraft2.fi
4 days
Monday Night Weeklies
4 days
Replay Cast
4 days
WardiTV 2025
5 days
StarCraft2.fi
5 days
PiGosaur Monday
5 days
StarCraft2.fi
6 days
Tenacious Turtle Tussle
6 days
Liquipedia Results

Completed

Proleague 2025-11-30
RSL Revival: Season 3
Light HT

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
CSCL: Masked Kings S3
Slon Tour Season 2
Acropolis #4 - TS3
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
Kuram Kup
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
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 © 2025 TLnet. All Rights Reserved.