• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:43
CEST 21:43
KST 04:43
  • 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
[ASL21] Ro24 Preview Pt2: News Flash10[ASL21] Ro24 Preview Pt1: New Chaos0Team Liquid Map Contest #22 - Presented by Monster Energy19ByuL: The Forgotten Master of ZvT30Behind the Blue - Team Liquid History Book20
Community News
$5,000 WardiTV TLMC tournament - Presented by Monster Energy3GSL CK: More events planned pending crowdfunding6Weekly Cups (May 30-Apr 5): herO, Clem, SHIN win0[BSL22] RO32 Group Stage5Weekly Cups (March 23-29): herO takes triple6
StarCraft 2
General
comprar pods para vapeo Team Liquid Map Contest #22 - Presented by Monster Energy Quebec Clan still alive ? BGE Stara Zagora 2026 cancelled Blizzard Classic Cup @ BlizzCon 2026 - $100k prize pool
Tourneys
$5,000 WardiTV TLMC tournament - Presented by Monster Energy GSL CK: More events planned pending crowdfunding Sea Duckling Open (Global, Bronze-Diamond) Sparkling Tuna Cup - Weekly Open Tournament RSL Season 4 announced for March-April
Strategy
Custom Maps
[D]RTS in all its shapes and glory <3 [A] Nemrods 1/4 players [M] (2) Frigid Storage
External Content
The PondCast: SC2 News & Results Mutation # 520 Moving Fees Mutation # 519 Inner Power Mutation # 518 Radiation Zone
Brood War
General
ASL21 General Discussion [BSL22] RO32 Group Stage BW General Discussion so ive been playing broodwar for a week straight. Gypsy to Korea
Tourneys
Escore Tournament StarCraft Season 2 [Megathread] Daily Proleagues [ASL21] Ro24 Group F [BSL22] RO32 Group B - Sunday 21:00 CEST
Strategy
Fighting Spirit mining rates Muta micro map competition What's the deal with APM & what's its true value Simple Questions, Simple Answers
Other Games
General Games
Stormgate/Frost Giant Megathread General RTS Discussion Thread Starcraft Tabletop Miniature Game Nintendo Switch Thread Darkest Dungeon
Dota 2
The Story of Wings Gaming Official 'what is Dota anymore' discussion
League of Legends
G2 just beat GenG in First stand
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 The China Politics Thread European Politico-economics QA Mega-thread Trading/Investing Thread
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Manga] One Piece [Req][Books] Good Fantasy/SciFi books Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion Cricket [SPORT] Tokyo Olympics 2021 Thread
World Cup 2022
Tech Support
[G] How to Block Livestream Ads
TL Community
The Automated Ban List
Blogs
How Streamers Inspire Gamers…
TrAiDoS
Broowar part 2
qwaykee
Funny Nicknames
LUCKY_NOOB
Iranian anarchists: organize…
XenOsky
ASL S21 English Commentary…
namkraft
StarCraft improvement
iopq
Electronics
mantequilla
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2709 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
Poland17719 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
BSL
19:00
RO32 Group A
n0maD vs perroflaco
TerrOr vs ZZZero
MadiNho vs WolFix
DragOn vs LancerX
ZZZero.O165
LiquipediaDiscussion
PSISTORM Gaming Misc
15:55
FSL s10 code A/B Championships
Freeedom35
Liquipedia
uThermal 2v2 Circuit
15:00
Season 2 - Bonus Cup 7
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
BRAT_OK 96
Ketroc 62
PattyMac 55
CosmosSc2 2
StarCraft: Brood War
Britney 16618
Mini 505
Shuttle 403
firebathero 190
ZZZero.O 165
Dewaltoss 136
Soulkey 75
ggaemo 50
Rock 43
Sexy 37
[ Show more ]
910 26
NaDa 9
Dota 2
monkeys_forever433
ROOTCatZ5
Counter-Strike
pashabiceps2325
Heroes of the Storm
Liquid`Hasu284
Khaldor237
MindelVK9
Other Games
summit1g6439
Grubby3147
FrodaN2046
B2W.Neo807
crisheroes232
QueenE69
Trikslyr65
Organizations
Other Games
gamesdonequick740
StarCraft 2
CranKy Ducklings88
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 20 non-featured ]
StarCraft 2
• printf 71
• Adnapsc2 17
• CranKy Ducklings SOOP9
• OhrlRock 4
• sooper7s
• Migwel
• LaughNgamezSOOP
• IndyKCrew
• Kozan
• intothetv
• AfreecaTV YouTube
StarCraft: Brood War
• 3DClanTV 16
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV1437
League of Legends
• TFBlade2400
Other Games
• imaqtpie1251
• Shiphtur252
• tFFMrPink 15
Upcoming Events
Sparkling Tuna Cup
14h 17m
WardiTV Team League
15h 17m
OSC
17h 17m
BSL
23h 17m
Sterling vs Azhi_Dahaki
Napoleon vs Mazur
Jimin vs Nesh
spx vs Strudel
IPSL
23h 17m
Artosis vs TBD
Napoleon vs TBD
Replay Cast
1d 13h
Wardi Open
1d 14h
Afreeca Starleague
1d 14h
Soma vs YSC
Sharp vs sSak
Monday Night Weeklies
1d 20h
Afreeca Starleague
2 days
Snow vs PianO
hero vs Rain
[ Show More ]
GSL
2 days
Replay Cast
3 days
Kung Fu Cup
3 days
The PondCast
4 days
Escore
5 days
Korean StarCraft League
6 days
CranKy Ducklings
6 days
IPSL
6 days
WolFix vs nOmaD
dxtr13 vs Razz
BSL
6 days
Liquipedia Results

Completed

Escore Tournament S2: W2
RSL Revival: Season 4
NationLESS Cup

Ongoing

BSL Season 22
ASL Season 21
CSL 2026 SPRING (S20)
IPSL Spring 2026
StarCraft2 Community Team League 2026 Spring
Nations Cup 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026

Upcoming

Escore Tournament S2: W3
Acropolis #4
BSL 22 Non-Korean Championship
CSLAN 4
Kung Fu Cup 2026 Grand Finals
HSC XXIX
uThermal 2v2 2026 Main Event
RSL Revival: Season 5
WardiTV TLMC #16
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 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.