• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:05
CET 16:05
KST 00:05
  • 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 - 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[ASL20] Finals Preview: Arrival13
Community News
[TLMC] Fall/Winter 2025 Ladder Map Rotation12Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA8StarCraft, SC2, HotS, WC3, Returning to Blizzcon!45$5,000+ WardiTV 2025 Championship7
StarCraft 2
General
Mech is the composition that needs teleportation t RotterdaM "Serral is the GOAT, and it's not close" RSL Season 3 - RO16 Groups C & D Preview [TLMC] Fall/Winter 2025 Ladder Map Rotation TL.net Map Contest #21: Winners
Tourneys
RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament Constellation Cup - Main Event - Stellar Fest Tenacious Turtle Tussle Master Swan Open (Global Bronze-Master 2)
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened Mutation # 496 Endless Infection
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle BW General Discussion What happened to TvZ on Retro? Brood War web app to calculate unit interactions [ASL20] Ask the mapmakers — Drop your questions
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET [BSL21] RO32 Group C - Saturday 21:00 CET
Strategy
PvZ map balance Current Meta Simple Questions, Simple Answers How to stay on top of macro?
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread Clair Obscur - Expedition 33 Beyond All Reason
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 SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread Artificial Intelligence Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
2024 - 2026 Football Thread Formula 1 Discussion NBA General Discussion MLB/Baseball 2023 TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Dyadica Gospel – a Pulp No…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2289 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
Poland17432 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 55m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
TKL 370
SteadfastSC 346
Reynor 49
mcanning 46
StarCraft: Brood War
Britney 33170
Rain 4067
actioN 1777
Horang2 1531
Jaedong 1212
Shuttle 535
Stork 467
EffOrt 291
firebathero 269
Leta 120
[ Show more ]
Barracks 105
ggaemo 93
Shinee 91
Hyun 86
PianO 73
LaStScan 67
JYJ49
Shine 48
Mong 31
Rock 24
Movie 24
ToSsGirL 23
Bale 19
zelot 14
soO 10
HiyA 9
sorry 8
Sacsri 6
Dota 2
Gorgc5504
qojqva1754
Dendi1127
XcaliburYe145
LuMiX0
Counter-Strike
oskar107
Heroes of the Storm
Khaldor113
Other Games
FrodaN4271
B2W.Neo1782
DeMusliM470
Hui .329
Lowko301
Pyrionflax236
Fuzer 206
febbydoto6
Organizations
Dota 2
PGL Dota 2 - Main Stream8720
PGL Dota 2 - Secondary Stream3207
Other Games
EGCTV67
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH154
• StrangeGG 72
• IndyKCrew
• AfreecaTV YouTube
• intothetv
• Kozan
• sooper7s
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• Michael_bg 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2112
• Ler59
League of Legends
• Nemesis3149
Other Games
• WagamamaTV236
Upcoming Events
IPSL
1h 55m
ZZZero vs rasowy
Napoleon vs KameZerg
OSC
3h 55m
BSL 21
4h 55m
Tarson vs Julia
Doodle vs OldBoy
eOnzErG vs WolFix
StRyKeR vs Aeternum
Sparkling Tuna Cup
18h 55m
RSL Revival
18h 55m
Reynor vs sOs
Maru vs Ryung
Kung Fu Cup
20h 55m
Cure vs herO
Reynor vs TBD
WardiTV Korean Royale
20h 55m
BSL 21
1d 4h
JDConan vs Semih
Dragon vs Dienmax
Tech vs NewOcean
TerrOr vs Artosis
IPSL
1d 4h
Dewalt vs WolFix
eOnzErG vs Bonyth
Replay Cast
1d 7h
[ Show More ]
Wardi Open
1d 20h
Monday Night Weeklies
2 days
WardiTV Korean Royale
2 days
BSL: GosuLeague
3 days
The PondCast
3 days
Replay Cast
4 days
RSL Revival
4 days
BSL: GosuLeague
5 days
RSL Revival
5 days
WardiTV Korean Royale
5 days
RSL Revival
6 days
WardiTV Korean Royale
6 days
Liquipedia Results

Completed

Proleague 2025-11-14
Stellar Fest: Constellation Cup
Eternal Conflict S1

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
YSL S2
BSL Season 21
CSCL: Masked Kings S3
SLON Tour Season 2
RSL Revival: Season 3
META Madness #9
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
BLAST Open Fall 2025

Upcoming

BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
HSC XXVIII
RSL Offline Finals
WardiTV 2025
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 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.