• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 03:33
CET 09:33
KST 17:33
  • 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
RSL Season 3: RO16 results & RO8 bracket0Weekly Cups (Nov 10-16): Reynor, Solar lead Zerg surge1[TLMC] Fall/Winter 2025 Ladder Map Rotation14Weekly Cups (Nov 3-9): Clem Conquers in Canada4SC: Evo Complete - Ranked Ladder OPEN ALPHA9
StarCraft 2
General
GM / Master map hacker and general hacking and cheating thread RSL Season 3: RO16 results & RO8 bracket Mech is the composition that needs teleportation t SC: Evo Complete - Ranked Ladder OPEN ALPHA RotterdaM "Serral is the GOAT, and it's not close"
Tourneys
Constellation Cup - Main Event - Stellar Fest 2025 RSL Offline Finals Dates + Ticket Sales! $5,000+ WardiTV 2025 Championship RSL Revival: Season 3 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 500 Fright night Mutation # 499 Chilling Adaptation Mutation # 498 Wheel of Misfortune|Cradle of Death Mutation # 497 Battle Haredened
Brood War
General
FlaSh on: Biggest Problem With SnOw's Playstyle What happened to TvZ on Retro? BGH Auto Balance -> http://bghmmr.eu/ SnOw's ASL S20 Finals Review BW General Discussion
Tourneys
[BSL21] GosuLeague T1 Ro16 - Tue & Thu 22:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL21] RO32 Group D - Sunday 21:00 CET
Strategy
Current Meta How to stay on top of macro? PvZ map balance Simple Questions, Simple Answers
Other Games
General Games
Clair Obscur - Expedition 33 Beyond All Reason Stormgate/Frost Giant Megathread Should offensive tower rushing be viable in RTS games? Path of Exile
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
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI About SC2SEA.COM
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion
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
TL Community
The Automated Ban List
Blogs
Dyadica Evangelium — Chapt…
Hildegard
Coffee x Performance in Espo…
TrAiDoS
Saturation point
Uldridge
DnB/metal remix FFO Mick Go…
ImbaTosS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2239 users

The Big Programming Thread - Page 925

Forum Index > General Forum
Post a Reply
Prev 1 923 924 925 926 927 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.
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 04 2017 04:55 GMT
#18481
That video is pretty good.

Say I have a class in Android, Account, instanced to represent the current user's account. This shows up everywhere. I could pass it through Intents. I could put it in a subclassed Application. I could used Shared Preferences. If we assume that just about every activity will need it what is the best approach?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
December 04 2017 06:17 GMT
#18482
Use a dependency injection framework and keep the Account object alive as long as the user is logged in.
There is no one like you in the universe.
Bog
Profile Blog Joined September 2010
Netherlands49 Posts
December 04 2017 10:00 GMT
#18483
On December 03 2017 06:52 shz wrote:
Show nested quote +
On November 30 2017 18:11 Liebig wrote:
Advent of Code starts tomorrow.

Who's going to do it ?


Let's get a TL leaderboard going:

+ Show Spoiler +

http://adventofcode.com/2017/leaderboard/private

Code:
136507-44389d8e



Joined. Didn't know about the existence of this event. I really liked Project Euler as well.

I find it amazing to see how some people can solve these problems in under a minute. The Memory Spiral problem (day3) took me at least two hours.
shz
Profile Blog Joined October 2010
Germany2687 Posts
December 04 2017 13:37 GMT
#18484
On December 04 2017 19:00 Bog wrote:
Show nested quote +
On December 03 2017 06:52 shz wrote:
On November 30 2017 18:11 Liebig wrote:
Advent of Code starts tomorrow.

Who's going to do it ?


Let's get a TL leaderboard going:

+ Show Spoiler +

http://adventofcode.com/2017/leaderboard/private

Code:
136507-44389d8e



Joined. Didn't know about the existence of this event. I really liked Project Euler as well.

I find it amazing to see how some people can solve these problems in under a minute. The Memory Spiral problem (day3) took me at least two hours.



Yeah that is astonishing. I only glanced over day 3 and I'll probably need more than that. We'll see when I find time.
Liquipedia
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
December 04 2017 16:41 GMT
#18485
The first part of day3 needs about less than a minute using the calculator of your choice... Any programming is unnecessary for this.
If you have no troubles doing squares of 3 digit numbers in your head you can even do it without any tools.

For the second part i admit i wrote a rather brute forcish solution, but unlike project euler problrms those problems here are not performance sensitive do it still solves it instantly.
LightTemplar
Profile Blog Joined August 2011
Ireland481 Posts
Last Edited: 2017-12-04 18:32:59
December 04 2017 18:28 GMT
#18486
I used a mathmatical approach to day 3 p1 so I didnt have to generate the spiral, looks like the second part makes a similar approach impossible. Is there something more elegant than drawing the whole spiral out I'm missing?
"Thoughts are always there, the mind can't stop" - Grubby
Bog
Profile Blog Joined September 2010
Netherlands49 Posts
December 04 2017 20:12 GMT
#18487
On December 05 2017 03:28 LightTemplar wrote:
I used a mathmatical approach to day 3 p1 so I didnt have to generate the spiral, looks like the second part makes a similar approach impossible. Is there something more elegant than drawing the whole spiral out I'm missing?


I did the same for the first part (under the assumption the travel distance should be calculable for any positive index number), but ended up rewriting all new code for the second part where I just generate the spiral. I don't think a generalized sequence can be extracted from the second spiral
Acrofales
Profile Joined August 2010
Spain18125 Posts
December 04 2017 20:16 GMT
#18488
Haven't done anything yet (and probably won't at all), but isn't the spiral solvable using straightforward dynamic programming?
Excludos
Profile Blog Joined April 2010
Norway8179 Posts
December 04 2017 20:34 GMT
#18489
On December 05 2017 05:16 Acrofales wrote:
Haven't done anything yet (and probably won't at all), but isn't the spiral solvable using straightforward dynamic programming?


it's solvable by just using some basic algorithms. However part 2 is not solvable like that. So if you end up programming part 1 (which I did) you only have to do some small adjustments to finish part 2.

That said my solution was rather crude. I'm not sure "30 seconds of code running" counts as "below 1 millisecond"
Liebig
Profile Joined August 2010
France738 Posts
December 04 2017 21:12 GMT
#18490
What programming language are you guys using for the AoC ?
I'm using OCaml myself
mahrgell
Profile Blog Joined December 2009
Germany3943 Posts
December 04 2017 21:18 GMT
#18491
On December 05 2017 06:12 Liebig wrote:
What programming language are you guys using for the AoC ?
I'm using OCaml myself


Julia

For Project Euler I went with C++ for most of the time, but also switched to mostly Julia lately, except for stuff where it felt easier to create performant solutions in C++.
Excludos
Profile Blog Joined April 2010
Norway8179 Posts
December 04 2017 21:18 GMT
#18492
On December 05 2017 06:12 Liebig wrote:
What programming language are you guys using for the AoC ?
I'm using OCaml myself


I was considering doing it in Fortran or lisp because I hate myself, but there isn't enough hours in the day. Ended up doing it in good ol' c++.
shz
Profile Blog Joined October 2010
Germany2687 Posts
December 04 2017 21:35 GMT
#18493
Using JS atm, but thinking about trying ReasonML afterwards.
Liquipedia
raNazUra
Profile Joined December 2012
United States10 Posts
December 04 2017 21:50 GMT
#18494
On December 03 2017 06:52 shz wrote:
Show nested quote +
On November 30 2017 18:11 Liebig wrote:
Advent of Code starts tomorrow.

Who's going to do it ?


Let's get a TL leaderboard going:

+ Show Spoiler +

http://adventofcode.com/2017/leaderboard/private

Code:
136507-44389d8e


Joined. Thanks for pointing this out, I hadn't seen it before.

I'm using Python, none of these first 4 problems were close to performance dependent enough for me to leave my comfort language.
Speak the truth, even if your voice shakes
Hanh
Profile Joined June 2016
146 Posts
December 05 2017 01:33 GMT
#18495
Does anyone know what the Ascii art on the main page is?
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
December 05 2017 03:24 GMT
#18496
On December 04 2017 15:17 Blisse wrote:
Use a dependency injection framework and keep the Account object alive as long as the user is logged in.

I've been reading about dependency injection for the last little bit and I fail to see how it lets me implement a session any differently than just creating a regular object would. Could you clarify that?
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
NovemberstOrm
Profile Blog Joined September 2011
Canada16217 Posts
Last Edited: 2017-12-05 03:38:09
December 05 2017 03:37 GMT
#18497
I have to take a programming test on testdome any clue as to what I should expect? Never done one on testdome before.

The test is 1 hour and 5 minutes
Moderatorlickypiddy
Excludos
Profile Blog Joined April 2010
Norway8179 Posts
December 05 2017 11:31 GMT
#18498
On December 05 2017 10:33 Hanh wrote:
Does anyone know what the Ascii art on the main page is?

I believe it represents a maze that you walk through as you complete each step
shz
Profile Blog Joined October 2010
Germany2687 Posts
December 05 2017 14:43 GMT
#18499
Looks like a CPU or something.

This years flavor text:
+ Show Spoiler +
The night before Christmas, one of Santa's Elves calls you in a panic. "The printer's broken! We can't print the Naughty or Nice List!" By the time you make it to sub-basement 17, there are only a few minutes until midnight. "We have a big problem," she says; "there must be almost fifty bugs in this system, but nothing else can print The List. Stand in this square, quick! There's no time to explain; if you can convince them to pay you in stars, you'll be able to--" She pulls a lever and the world goes blurry.

When your eyes can focus again, everything seems a lot more pixelated than before. She must have sent you inside the computer! You check the system clock: 25 milliseconds until midnight. With that much time, you should be able to collect all fifty stars by December 25th.
Liquipedia
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
December 05 2017 19:18 GMT
#18500
On December 05 2017 12:24 WarSame wrote:
Show nested quote +
On December 04 2017 15:17 Blisse wrote:
Use a dependency injection framework and keep the Account object alive as long as the user is logged in.

I've been reading about dependency injection for the last little bit and I fail to see how it lets me implement a session any differently than just creating a regular object would. Could you clarify that?


Are you unsure about dependency injection or dependency injection as it relates to scoping?




Just got this Google coding challenge terminal thing in the browser, it's weird.
There is no one like you in the universe.
Prev 1 923 924 925 926 927 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 27m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
ProTech122
SortOf 116
Trikslyr29
StarCraft: Brood War
Hyuk 1544
Free 396
BeSt 379
Killer 322
Zeus 224
EffOrt 184
Sharp 57
ToSsGirL 39
Aegong 32
NotJumperer 22
[ Show more ]
Shinee 17
Hm[arnc] 16
Mind 16
Dota 2
monkeys_forever497
League of Legends
JimRising 1065
Counter-Strike
shoxiejesuss276
Other Games
summit1g11405
C9.Mang0205
Happy189
ceh9184
Fuzer 136
Organizations
Dota 2
PGL Dota 2 - Main Stream8582
Other Games
gamesdonequick593
StarCraft: Brood War
UltimateBattle 99
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• Berry_CruncH98
• LUISG 10
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 1
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Rush1673
• HappyZerGling75
Upcoming Events
The PondCast
1h 27m
Replay Cast
14h 27m
RSL Revival
22h 57m
herO vs Zoun
Classic vs Reynor
Maru vs SHIN
MaxPax vs TriGGeR
BSL: GosuLeague
1d 12h
RSL Revival
1d 22h
WardiTV Korean Royale
2 days
RSL Revival
2 days
WardiTV Korean Royale
3 days
IPSL
3 days
Julia vs Artosis
JDConan vs DragOn
RSL Revival
3 days
[ Show More ]
Wardi Open
4 days
IPSL
4 days
StRyKeR vs OldBoy
Sziky vs Tarson
Replay Cast
4 days
Monday Night Weeklies
5 days
Replay Cast
5 days
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2025-11-16
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.