• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 13:57
CEST 19:57
KST 02:57
  • 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
[ASL20] Ro8 Preview Pt1: Mile High3Team TLMC #5 - Finalists & Open Tournaments2[ASL20] Ro16 Preview Pt2: Turbulence10Classic Games #3: Rogue vs Serral at BlizzCon10[ASL20] Ro16 Preview Pt1: Ascent10
Community News
StarCraft II 5.0.15 PTR Patch Notes186BSL 2025 Warsaw LAN + Legends Showmatch2Weekly Cups (Sept 8-14): herO & MaxPax split cups4WardiTV TL Team Map Contest #5 Tournaments1SC4ALL $6,000 Open LAN in Philadelphia8
StarCraft 2
General
StarCraft II 5.0.15 PTR Patch Notes Why Storm Should NOT Be Nerfed – A Core Part of Pr #1: Maru - Greatest Players of All Time SC4ALL: A North American StarCraft LAN Team TLMC #5 - Finalists & Open Tournaments
Tourneys
SC2's Safe House 2 - October 18 & 19 RSL: Revival, a new crowdfunded tournament series Stellar Fest KSL Week 80 StarCraft Evolution League (SC Evo Biweekly)
Strategy
Custom Maps
External Content
Mutation # 491 Night Drive Mutation # 490 Masters of Midnight Mutation # 489 Bannable Offense Mutation # 488 What Goes Around
Brood War
General
[ASL20] Ro8 Preview Pt1: Mile High BGH Auto Balance -> http://bghmmr.eu/ ASL ro8 Upper Bracket HYPE VIDEO BW General Discussion StarCraft Stellar Forces had bad maps
Tourneys
SC4ALL $1,500 Open Bracket LAN [ASL20] Ro16 Group D BSL 2025 Warsaw LAN + Legends Showmatch [ASL20] Ro16 Group C
Strategy
Simple Questions, Simple Answers Muta micro map competition
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Borderlands 3 General RTS Discussion Thread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread The Big Programming Thread UK Politics Mega-thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s)
TL Community
BarCraft in Tokyo Japan for ASL Season5 Final The Automated Ban List
Blogs
The Dark Side of South Kore…
Peanutsc
Too Many LANs? Tournament Ov…
TrAiDoS
I <=> 9
KrillinFromwales
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2261 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
Poland17350 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
Online Event
16:00
PSC2L September 2025
CranKy Ducklings189
Liquipedia
BSL Open LAN 2025 - War…
08:00
Day 2 - Play Off & Finals Stage
ZZZero.O269
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 202
JuggernautJason175
StarCraft: Brood War
Sea 1431
Flash 1246
Shuttle 1041
Larva 454
ZZZero.O 269
Mong 120
Movie 83
Dewaltoss 71
Backho 64
sorry 56
[ Show more ]
Hyun 41
Aegong 35
Free 29
sas.Sziky 29
IntoTheRainbow 10
Dota 2
Gorgc7581
qojqva3849
Dendi1582
resolut1ontv 312
XcaliburYe271
Counter-Strike
fl0m661
Stewie2K250
Heroes of the Storm
Khaldor269
Other Games
tarik_tv9993
FrodaN4136
Grubby815
B2W.Neo586
KnowMe346
Mew2King101
QueenE53
NeuroSwarm52
MindelVK18
Organizations
Other Games
EGCTV1473
gamesdonequick566
StarCraft 2
angryscii 19
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 9
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 2816
Other Games
• imaqtpie569
• Shiphtur253
• WagamamaTV226
Upcoming Events
Afreeca Starleague
16h 3m
Barracks vs Mini
Wardi Open
17h 3m
Monday Night Weeklies
22h 3m
Sparkling Tuna Cup
1d 16h
Afreeca Starleague
1d 16h
Snow vs EffOrt
LiuLi Cup
2 days
The PondCast
3 days
CranKy Ducklings
4 days
Maestros of the Game
5 days
Clem vs Reynor
[BSL 2025] Weekly
6 days
[ Show More ]
[BSL 2025] Weekly
6 days
Liquipedia Results

Completed

Proleague 2025-09-18
Chzzk MurlocKing SC1 vs SC2 Cup #2
HCC Europe

Ongoing

BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
LASL Season 20
BSL World Championship of Poland 2025
RSL Revival: Season 2
Maestros of the Game
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1

Upcoming

IPSL Winter 2025-26
BSL Season 21
SC4ALL: Brood War
BSL 21 Team A
Stellar Fest
SC4ALL: StarCraft II
EC S1
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
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.