• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 22:36
CET 04:36
KST 12:36
  • 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
Behind the Blue - Team Liquid History Book15Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8herO wins SC2 All-Star Invitational14
Community News
ACS replaced by "ASL Season Open" - Starts 21/0220LiuLi Cup: 2025 Grand Finals (Feb 10-16)26Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2Nexon's StarCraft game could be FPS, led by UMS maker10PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar)14
StarCraft 2
General
How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Nexon's StarCraft game could be FPS, led by UMS maker Terran Scanner Sweep Behind the Blue - Team Liquid History Book Weekly Cups (Jan 12-18): herO, MaxPax, Solar win
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) LiuLi Cup: 2025 Grand Finals (Feb 10-16) RSL Season 4 announced for March-April RSL Revival: Season 4 Korea Qualifier (Feb 14) Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
The PondCast: SC2 News & Results Mutation # 512 Overclocked Mutation # 511 Temple of Rebirth Mutation # 510 Safety Violation
Brood War
General
Which units you wish saw more use in the game? ACS replaced by "ASL Season Open" - Starts 21/02 StarCraft player reflex TE scores [ASL21] Potential Map Candidates Gypsy to Korea
Tourneys
[Megathread] Daily Proleagues Escore Tournament StarCraft Season 1 Small VOD Thread 2.0 KCM Race Survival 2026 Season 1
Strategy
Fighting Spirit mining rates Zealot bombing is no longer popular? Simple Questions, Simple Answers Current Meta
Other Games
General Games
Path of Exile Nintendo Switch Thread Diablo 2 thread Battle Aces/David Kim RTS Megathread ZeroSpace Megathread
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
TL Mafia Community Thread Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia
Community
General
US Politics Mega-thread Ask and answer stupid questions here! European Politico-economics QA Mega-thread The Games Industry And ATVI Russo-Ukrainian War Thread
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
ADHD And Gaming Addiction…
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2184 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
Poland17661 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
Replay Cast
00:00
HomeStory Cup 28 - Group C
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RuFF_SC2 241
NeuroSwarm 202
StarCraft: Brood War
JulyZerg 45
910 37
Icarus 3
Dota 2
monkeys_forever589
LuMiX2
League of Legends
JimRising 800
Super Smash Bros
C9.Mang01263
Mew2King65
Other Games
summit1g15387
tarik_tv5678
ToD115
Moletrap11
Organizations
Other Games
gamesdonequick1227
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• davetesta55
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Stunt357
Upcoming Events
Sparkling Tuna Cup
6h 24m
LiuLi Cup
7h 24m
Maru vs Reynor
Serral vs Rogue
Ladder Legends
14h 24m
Replay Cast
20h 24m
Replay Cast
1d 5h
Wardi Open
1d 8h
Monday Night Weeklies
1d 13h
OSC
1d 20h
WardiTV Winter Champion…
2 days
Replay Cast
3 days
[ Show More ]
WardiTV Winter Champion…
3 days
Replay Cast
3 days
PiG Sty Festival
4 days
The PondCast
4 days
KCM Race Survival
4 days
WardiTV Winter Champion…
4 days
Replay Cast
4 days
PiG Sty Festival
5 days
Epic.LAN
5 days
Replay Cast
5 days
PiG Sty Festival
6 days
CranKy Ducklings
6 days
Epic.LAN
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-02-14
Rongyi Cup S3
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
LiuLi Cup: 2025 Grand Finals
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

Escore Tournament S1: King of Kings
[S:21] ASL SEASON OPEN 1st Round
[S:21] ASL SEASON OPEN 1st Round Qualifier
[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
WardiTV Winter 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
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.