• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:02
CEST 16:02
KST 23:02
  • 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 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed10Weekly Cups (July 7-13): Classic continues to roll4Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
The GOAT ranking of GOAT rankings RSL Revival patreon money discussion thread Who will win EWC 2025? Weekly Cups (July 7-13): Classic continues to roll Esports World Cup 2025 - Brackets Revealed
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Starcraft in widescreen A cwal.gg Extension - Easily keep track of anyone
Tourneys
[Megathread] Daily Proleagues Cosmonarchy Pro Showmatches CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Nintendo Switch Thread Stormgate/Frost Giant Megathread CCLP - Command & Conquer League Project The PlayStation 5
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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Future of Porn Russo-Ukrainian War Thread Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 2024 - 2025 Football Thread NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 627 users

The Big Programming Thread - Page 925

Forum Index > General Forum
Post a Reply
Prev 1 923 924 925 926 927 1031 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
Spain17976 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
Norway8060 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
Norway8060 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
Norway8060 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 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 58m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Vindicta 226
StarCraft: Brood War
Britney 43700
Rain 6184
EffOrt 1564
BeSt 1244
Larva 604
firebathero 471
Stork 404
Mini 318
PianO 247
Rush 216
[ Show more ]
Light 205
Mind 155
Pusan 72
Aegong 67
GoRush 67
sSak 54
JulyZerg 54
Movie 53
sas.Sziky 45
Noble 37
Shinee 36
yabsab 26
scan(afreeca) 16
SilentControl 10
Shine 8
Bale 5
ivOry 3
Dota 2
qojqva3798
XcaliburYe294
Fuzer 210
canceldota123
League of Legends
Dendi1494
Counter-Strike
sgares646
byalli359
Super Smash Bros
Mew2King96
amsayoshi42
Other Games
B2W.Neo2479
singsing2029
DeMusliM464
crisheroes404
Lowko401
ArmadaUGS84
markeloff59
QueenE50
Pyrionflax42
Trikslyr29
ToD12
Organizations
Other Games
gamesdonequick3822
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 1021
League of Legends
• Nemesis2809
• Jankos1295
Upcoming Events
WardiTV European League
1h 58m
ShoWTimE vs sebesdes
Percival vs NightPhoenix
Shameless vs Nicoract
Krystianer vs Scarlett
ByuN vs uThermal
Harstem vs HeRoMaRinE
PiGosaur Monday
9h 58m
uThermal 2v2 Circuit
1d 1h
Replay Cast
1d 9h
The PondCast
1d 19h
WardiTV European League
2 days
Replay Cast
2 days
Epic.LAN
2 days
CranKy Ducklings
3 days
Epic.LAN
3 days
[ Show More ]
CSO Contender
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
4 days
Online Event
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Esports World Cup
6 days
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
ESL Pro League S22
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
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.