• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 05:37
CET 11:37
KST 19:37
  • 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 Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets0$21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7)12Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns7[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822
StarCraft 2
General
SC2 Spotted on the EWC 2026 list? Weekly Cups (Jan 5-11): Clem wins big offline, Trigger upsets Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns Spontaneous hotkey change zerg Chinese SC2 server to reopen; live all-star event in Hangzhou
Tourneys
$25,000 Streamerzone StarCraft Pro Series announced $21,000 Rongyi Cup Season 3 announced (Jan 22-Feb 7) WardiTV Winter Cup WardiTV Mondays SC2 AI Tournament 2026
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 508 Violent Night Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes
Brood War
General
Potential ASL qualifier breakthroughs? BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion StarCraft & BroodWar Campaign Speedrun Quest Data analysis on 70 million replays
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Game Theory for Starcraft Simple Questions, Simple Answers Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Beyond All Reason Nintendo Switch Thread Awesome Games Done Quick 2026! Mechabellum Stormgate/Frost Giant 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
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread European Politico-economics QA Mega-thread Things Aren’t Peaceful in Palestine Trading/Investing Thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread
Sports
2024 - 2026 Football Thread
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
My 2025 Magic: The Gathering…
DARKING
Physical Exercise (HIIT) Bef…
TrAiDoS
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
James Bond movies ranking - pa…
Topin
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2313 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
Spain18179 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
Norway8230 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
Norway8230 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
Norway8230 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 23m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
SortOf 132
StarCraft: Brood War
Sea 4554
Rain 3153
Horang2 1105
Shuttle 558
Larva 463
Mini 433
Hyuk 423
Stork 353
actioN 274
ZerO 264
[ Show more ]
Leta 197
Mong 178
EffOrt 150
Soma 136
Zeus 120
Nal_rA 96
Hyun 95
ggaemo 87
Rush 79
JulyZerg 72
Light 71
910 71
Killer 69
hero 49
zelot 34
Mind 33
Sharp 33
Free 22
Terrorterran 18
soO 18
Sexy 18
scan(afreeca) 16
Noble 12
ajuk12(nOOB) 12
Sacsri 10
Bale 9
Dota 2
NeuroSwarm108
XcaliburYe107
ODPixel92
League of Legends
C9.Mang0449
JimRising 445
Counter-Strike
olofmeister1829
shoxiejesuss803
allub230
Super Smash Bros
Mew2King95
Other Games
summit1g7548
ceh9596
Pyrionflax273
Fuzer 176
ZerO(Twitch)10
Organizations
Other Games
gamesdonequick3084
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 14 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2311
• Lourlo1090
• Stunt519
Upcoming Events
WardiTV Invitational
1h 23m
PiGosaur Cup
14h 23m
WardiTV Invitational
1d 1h
The PondCast
1d 23h
OSC
2 days
OSC
3 days
All Star Teams
3 days
INnoVation vs soO
sOs vs Scarlett
uThermal 2v2 Circuit
4 days
All Star Teams
4 days
MMA vs DongRaeGu
Rogue vs Oliveira
Sparkling Tuna Cup
4 days
[ Show More ]
OSC
5 days
Replay Cast
5 days
Wardi Open
6 days
Liquipedia Results

Completed

Proleague 2026-01-12
Big Gabe Cup #3
NA Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
OSC Championship Season 13
Underdog Cup #3
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W4
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Rongyi Cup S3
Thunderfire SC2 All-star 2025
Nations Cup 2026
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 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.