• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:39
CEST 19:39
KST 02:39
  • 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
Code S Season 2 (2026) - RO8 Preview4[ASL21] Finals Preview: Two Legacies21Code S Season 2 (2026) - RO12 Preview2herO wins GSL Code S Season 1 (2026)7Code S Season 1 (2026) - RO4 & Finals Preview5
Community News
Weekly Cups (May 18-25): MaxPax wins doubles0Crank Gathers Season 4: BW vs SC2 Team League4Weekly Cups (May 11-17): Classic wins double0Code S Season 1 (2026) - RO8 Results2Weekly Cups (May 4-10): Clem, MaxPax, herO win1
StarCraft 2
General
herO wins GSL Code S Season 1 (2026) Code S Season 2 (2026) - RO8 Preview Weekly Cups (May 18-25): MaxPax wins doubles Code S Season 2 (2026) - RO12 Preview Weekly Cups (May 11-17): Classic wins double
Tourneys
GSL Code S Season 2 (2026) Sparkling Tuna Cup - Weekly Open Tournament Crank Gathers Season 4: BW vs SC2 Team League GSL Code S Season 1 (2026) Maestros of The Game 2 announcement and schedule !
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players
External Content
Welcome to the External Content forum Mutation # 527 Hell Train The PondCast: SC2 News & Results Mutation # 526 Rubber and Glue
Brood War
General
Pros React To: ASL S21 Finals Every Matchup's Top 5 Winrates (all ASLs & KSLs) BW General Discussion Very long shot - StarCraft x A7X video Pros React to: TvT Masterclass in FlaSh vs Light
Tourneys
[ASL21] Grand Finals Escore Tournament StarCraft Season 2 [BSL22] WB Final & LB Semis - Saturday 21:00 CEST [Megathread] Daily Proleagues
Strategy
Any training maps people recommend? Muta micro map competition [G] Hydra ZvZ: An Introduction Fighting Spirit mining rates
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread ZeroSpace Megathread Path of Exile Dawn of War IV
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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread Five o'clock TL Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread Dating: How's your luck? European Politico-economics QA Mega-thread
Fan Clubs
The herO Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread McBoner: A hockey love story TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion
World Cup 2022
Tech Support
Facing Challenges in Mobile App Development streaming software
TL Community
The Automated Ban List
Blogs
Customization Drives Loyalty…
TrAiDoS
Why RTS gamers make better f…
gosubay
ramps on octagon
StaticNine
ASL S21 English Commentary…
namkraft
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2644 users

The Big Programming Thread - Page 853

Forum Index > General Forum
Post a Reply
Prev 1 851 852 853 854 855 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.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
February 25 2017 20:03 GMT
#17041
On February 26 2017 04:30 DickMcFanny wrote:
Sorry if that's a stupid question, but how do I express iteration in JS?

Let's say I have a quadratic formula, f(x) = x^2 + 1. f(0) = 1, so the next step is to find out f(1), which is 2, so the next step is to find f(2), which is 5, so the next step is to find f(5), which is 26, so the next step is to find f(26) and so on.

I'm not sure what I should even google, neither in German nor English.

This isn't even a recursive function declaration. What exactly are you trying to do? If you want to calculate f for a single given x, just write r = x*x + 1. No need to iterate anything. If you want the result for ALL x in {0, 1, 2, ...}, then use a for/while loop. Though I don't see a reason why you would want that.
If you have a good reason to disagree with the above, please tell me. Thank you.
DickMcFanny
Profile Blog Joined September 2015
Ireland1076 Posts
February 25 2017 20:24 GMT
#17042
Well I'm not interested in {0, 1, 2, 3... } for x, I'm interested in {0, 1, 2, 5...}.

You're suggesting I just let it calculate every value of x, but I'm interested to see how iteration works in the quadratic formula. So f(3) would be of no interest because 3=x is not the result of a former function.
| (• ◡•)|╯ ╰(❍ᴥ❍ʋ)
shz
Profile Blog Joined October 2010
Germany2687 Posts
February 25 2017 20:37 GMT
#17043
I'm not sure I understand, but you can try this:


const f = (n) => Math.pow(n, 2) + 1

let x = 0

while (x < 10) {
x = f(x)
console.log(x)
}
Liquipedia
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
February 25 2017 22:17 GMT
#17044
On February 26 2017 05:24 DickMcFanny wrote:
Well I'm not interested in {0, 1, 2, 3... } for x, I'm interested in {0, 1, 2, 5...}.

You're suggesting I just let it calculate every value of x, but I'm interested to see how iteration works in the quadratic formula. So f(3) would be of no interest because 3=x is not the result of a former function.

Ok, I see. Your function should then be defined as
f(n) = f(n-1)^2 + 1
f(0) = 0

Which makes it a proper recursive function. Which you can evaluate with both a loop that replaces the value of some variable with each iteration, or with an actual recursive function call. Both have been posted before.
If you have a good reason to disagree with the above, please tell me. Thank you.
DickMcFanny
Profile Blog Joined September 2015
Ireland1076 Posts
Last Edited: 2017-02-25 23:17:35
February 25 2017 23:15 GMT
#17045
Yeah, both of the suggestions that have been posted work, thanks. Got some really interesting numbers, will come in handy when I learn more about fractals.

Where would I start if I wanted to take these figures and display them in an XY plane?
| (• ◡•)|╯ ╰(❍ᴥ❍ʋ)
shz
Profile Blog Joined October 2010
Germany2687 Posts
February 25 2017 23:54 GMT
#17046
I'd try https://d3js.org/
Liquipedia
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
February 26 2017 00:13 GMT
#17047
I've had success using chart.js as well
There is no one like you in the universe.
aRyuujin
Profile Blog Joined January 2011
United States5049 Posts
February 26 2017 03:02 GMT
#17048
anyone know a good flask/django alternative in Haskell?
can i get my estro logo back pls
Hanh
Profile Joined June 2016
146 Posts
February 26 2017 06:16 GMT
#17049
You tried Yesod?
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
Last Edited: 2017-02-26 09:48:51
February 26 2017 09:00 GMT
#17050
whats up with the new thread name?:O

EDIT: Nvm, this thread name couldn't have been more accurate.
The harder it becomes, the more you should focus on the basics.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-02-26 14:54:08
February 26 2017 13:31 GMT
#17051
I need help with a C issue

I am using strstr to find a substring

and I am replacing that substring with the same string, except in brackets

so like, I find "how" in the sentence: "I wonder how do I do this"

and I replace it with [how]:

"I wonder [how] I do this"

the problem is that I am sometimes replacing it multiple times in a string, so I need to loop through and do it again
but strstr just immediately finds the "how" inside of "[how]" and then my code makes the sentence

"I wonder [[how]] I do this"



edit: I guess I can set a pointer as a marker to the end of the last correction, and if my marker isn't null then I move to the end of my marker for the next strstr ?

pointers are pretty weird. I've decided to use 2 pointer "markers.
I'll start with them both null, and then deal with 3 cases

case 1: the yare both null. then I will set the first market to strstr(my string, my target)
case 2: 2nd marker is null. then set marker 2 to strstr(marker 1, target)
case 3: 1st marker is null. then set marker 1 to strstr(marker 2, target)

I think this should work.

edit2: OMFG I GOT IT TO WORK. IVE BEEN WORKING ON THIS FOR SO LONG, LOL
Prillan
Profile Joined August 2011
Sweden350 Posts
Last Edited: 2017-02-26 15:29:43
February 26 2017 15:29 GMT
#17052
On February 26 2017 12:02 aRyuujin wrote:
anyone know a good flask/django alternative in Haskell?

As Hanh said, Yesod is a good django replacement. Scotty and spock seem closer to flask though.
TheBB's sidekick, aligulac.com | "Reality is frequently inaccurate." - Douglas Adams
aRyuujin
Profile Blog Joined January 2011
United States5049 Posts
February 26 2017 18:56 GMT
#17053
On February 27 2017 00:29 Prillan wrote:
Show nested quote +
On February 26 2017 12:02 aRyuujin wrote:
anyone know a good flask/django alternative in Haskell?

As Hanh said, Yesod is a good django replacement. Scotty and spock seem closer to flask though.


I've heard of Yesod before (could never find a working pdf of the oreilly book), but Scotty seems to be what I need.

Thanks to both of you
can i get my estro logo back pls
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 26 2017 20:45 GMT
#17054
Don't forget snap as a web framework for haskell.

The harder it becomes, the more you should focus on the basics.
Manit0u
Profile Blog Joined August 2004
Poland17752 Posts
February 27 2017 11:59 GMT
#17055
On February 27 2017 05:45 sabas123 wrote:
Don't forget snap as a web framework for haskell.



https://github.com/snapframework/snap-core/blob/b5ca1f086f8cd49a8f139e2547d597a87ddc3ef1/src/Snap/Internal/Util/FileServe.hs#L667

They have css and html directly in the code? Not a fan.
Time is precious. Waste it wisely.
Deleted User 3420
Profile Blog Joined May 2003
24492 Posts
Last Edited: 2017-02-27 20:34:16
February 27 2017 20:32 GMT
#17056
I am pretty frustrated
For my interview with amazon, I was sent an email and had to RSVP to a 2.5 hour coding assessment. I assume they invite however many students through it, and it's a series of challenges.

I followed the link to the RSVP and filled stuff out, and then when it was time to click if I could make the time or not, I somehow clicked "I can't make this time". I really don't know how... I really feel like I clicked the right thing but whatever.

So anyways it takes me to the next page, and i want to go back, and there was literally no way to go back in the form. The only option I had was to fill out as my reason for not making it "I do want to RSVP, I misclicked and can't go back in the form."

I emailed the recruiter about it but I just have this bad feeling he's never gonna check the email and I am going to miss the event.

You're supposed to have RSVP'd by the end of the day today, too..
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 27 2017 21:58 GMT
#17057
On February 27 2017 20:59 Manit0u wrote:
Show nested quote +
On February 27 2017 05:45 sabas123 wrote:
Don't forget snap as a web framework for haskell.



https://github.com/snapframework/snap-core/blob/b5ca1f086f8cd49a8f139e2547d597a87ddc3ef1/src/Snap/Internal/Util/FileServe.hs#L667

They have css and html directly in the code? Not a fan.

Thats quite shitty, AFAIK you don't have to but I never really used it.
The harder it becomes, the more you should focus on the basics.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2017-02-27 23:40:00
February 27 2017 23:37 GMT
#17058
On February 27 2017 20:59 Manit0u wrote:
Show nested quote +
On February 27 2017 05:45 sabas123 wrote:
Don't forget snap as a web framework for haskell.



https://github.com/snapframework/snap-core/blob/b5ca1f086f8cd49a8f139e2547d597a87ddc3ef1/src/Snap/Internal/Util/FileServe.hs#L667



module Snap.Internal.Util.FileServe
( -- * Helper functions
getSafePath
-- * Configuration for directory serving
, MimeMap
, HandlerMap
, DirectoryConfig(..)
, simpleDirectoryConfig
, defaultDirectoryConfig
, fancyDirectoryConfig
, defaultIndexGenerator
, defaultMimeTypes
, fileType
-- * File servers
, serveDirectory
, serveDirectoryWith
, serveFile
, serveFileAs
-- * Internal functions
, decodeFilePath
) where


I forgot where but I remember reading or watching something where someone got mad at how so many programmers seem to have random coding preferences, like putting the comma in front. I get why, but I still find it hilarious to look at.




On February 28 2017 05:32 travis wrote:
I am pretty frustrated
For my interview with amazon, I was sent an email and had to RSVP to a 2.5 hour coding assessment. I assume they invite however many students through it, and it's a series of challenges.

I followed the link to the RSVP and filled stuff out, and then when it was time to click if I could make the time or not, I somehow clicked "I can't make this time". I really don't know how... I really feel like I clicked the right thing but whatever.

So anyways it takes me to the next page, and i want to go back, and there was literally no way to go back in the form. The only option I had was to fill out as my reason for not making it "I do want to RSVP, I misclicked and can't go back in the form."

I emailed the recruiter about it but I just have this bad feeling he's never gonna check the email and I am going to miss the event.

You're supposed to have RSVP'd by the end of the day today, too..


First off, nice job on getting something with Amazon. Hope it still goes well.

To be frank though, besides Amazon being an extremely hit or miss software opportunity, Amazon also has consistently one of the worst recruiting departments out of every technology company you could encounter. That includes lots of anecdotes from interviewees such as: recruiters taking 3 weeks to respond to emails, receiving offers and declines up to 3 months after interviewing, weeks before feedback from the coding assessment, and more.

While it is your first? big job opportunity, I would honestly not even consider interviewing for Amazon, let alone working there, given all these problems. So while it does suck messing up somewhat, I wouldn't take it too hard for a company like Amazon.
There is no one like you in the universe.
Hanh
Profile Joined June 2016
146 Posts
February 27 2017 23:59 GMT
#17059

I forgot where but I remember reading or watching something where someone got mad at how so many programmers seem to have random coding preferences, like putting the comma in front. I get why, but I still find it hilarious to look at.


What is funny? The people who get mad or the comma in front?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
February 28 2017 01:02 GMT
#17060
On February 28 2017 08:59 Hanh wrote:
Show nested quote +

I forgot where but I remember reading or watching something where someone got mad at how so many programmers seem to have random coding preferences, like putting the comma in front. I get why, but I still find it hilarious to look at.


What is funny? The people who get mad or the comma in front?


The thing I referenced was a funny rant.

I personally think commas in front look hilarious.
There is no one like you in the universe.
Prev 1 851 852 853 854 855 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 21m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 389
mouzHeroMarine 266
elazer 213
UpATreeSC 111
ProTech82
BRAT_OK 58
StarCraft: Brood War
Britney 16034
BeSt 285
ggaemo 266
Rush 259
firebathero 163
Dewaltoss 101
Mind 47
sorry 32
Rock 26
IntoTheRainbow 22
[ Show more ]
Sacsri 20
Shine 19
Sexy 12
Dota 2
qojqva1734
Counter-Strike
fl0m1802
byalli455
edward18
Heroes of the Storm
XaKoH 115
MindelVK3
Other Games
Grubby2899
Liquid`RaSZi1091
Beastyqt607
Dendi483
ceh9336
Hui .219
ArmadaUGS114
C9.Mang095
Mew2King81
KnowMe72
QueenE69
Trikslyr57
Organizations
Counter-Strike
PGL262
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 18 non-featured ]
StarCraft 2
• intothetv
• Kozan
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• IndyKCrew
StarCraft: Brood War
• 80smullet 23
• Michael_bg 9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota250
League of Legends
• Nemesis3872
• Jankos2384
• TFBlade1120
Other Games
• imaqtpie830
• Shiphtur108
Upcoming Events
OSC
1h 21m
Cham vs Percival
ShoWTimE vs Lambo
Krystianer vs sebesdes
Cure vs Babymarine
SKillous vs Arrogfire
Gerald vs MindelVK
goblin vs TBD
Jumy vs HonMonO
Replay Cast
6h 21m
Maestros of the Game
19h 21m
Big Brain Bouts
22h 21m
Shino vs Scarlett
Bly vs DnS
Serral vs ByuN
Replay Cast
1d 6h
RSL Revival
1d 13h
Lambo vs SHIN
Solar vs Rogue
herO vs Clem
Maestros of the Game
1d 17h
IPSL
1d 22h
ZZZero vs WorsT
Julia vs eOnzErG
BSL
2 days
TerrOr vs Dewalt
Bonyth vs eOnzErG
Replay Cast
2 days
[ Show More ]
RSL Revival
2 days
Maestros of the Game
2 days
OSC
2 days
IPSL
2 days
Dragon vs Artosis
dxtr13 vs Hawk
BSL
3 days
Wardi Open
3 days
Monday Night Weeklies
3 days
Replay Cast
4 days
Sparkling Tuna Cup
4 days
WardiTV Spring Champion…
4 days
Maestros of the Game
4 days
The PondCast
5 days
Maestros of the Game
5 days
Replay Cast
6 days
Replay Cast
6 days
WardiTV Spring Champion…
6 days
Maestros of the Game
6 days
Liquipedia Results

Completed

ASL Season 21
2026 GSL S1
Heroes Pulsing #1

Ongoing

2026 KK StarCraft Pro League
BSL Season 22
IPSL Spring 2026
KCM Race Survival 2026 Season 2
KK 2v2 League Season 1
Acropolis #4
CSCL: Masked Kings S4
SCTL 2026 Spring
WardiTV Spring 2026
2026 GSL S2
RSL Revival: Season 5
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals

Upcoming

Escore Tournament S2: King of Kings
YSL S3
BSL 22 Non-Korean Championship
CSLAN 4
Blizzard Classic Cup 2026
Kung Fu Cup 2026 Grand Finals
CranK Gathers Season 4: BW vs SC2 Team League
HSC XXIX
uThermal 2v2 2026 Main Event
Maestros of the Game 2
Bounty Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 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.