• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 02:58
CEST 08:58
KST 15:58
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL61Weekly Cups (June 23-29): Reynor in world title form?13FEL Cracov 2025 (July 27) - $8000 live event20Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
Statistics for vetoed/disliked maps Program: SC2 / XSplit / OBS Scene Switcher The SCII GOAT: A statistical Evaluation Weekly Cups (June 23-29): Reynor in world title form? PiG Sty Festival #5: Playoffs Preview + Groups Recap
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event RSL: Revival, a new crowdfunded tournament series Korean Starcraft League Week 77 Master Swan Open (Global Bronze-Master 2) [GSL 2025] Code S: Season 2 - Semi Finals & Finals
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Flash Announces Hiatus From ASL Player “Jedi” cheat on CSL ASL20 Preliminary Maps SC uni coach streams logging into betting site BGH Mineral Boosts Tutorial Video
Tourneys
[BSL20] Grand Finals - Sunday 20:00 CET [Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Nintendo Switch Thread What do you want from future RTS games? 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
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread Things Aren’t Peaceful in Palestine The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread Formula 1 Discussion NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 527 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
Spain17970 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
Norway8046 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
Norway8046 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
Norway8046 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 3h 2m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Leta 594
Larva 324
Barracks 53
Dota 2
XaKoH 608
League of Legends
JimRising 745
Counter-Strike
Stewie2K1027
Heroes of the Storm
Khaldor237
Other Games
WinterStarcraft650
SortOf103
kaitlyn77
ProTech53
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH367
• Hupsaiya 91
• Sammyuel 42
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• intothetv
• Migwel
• IndyKCrew
StarCraft: Brood War
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• lizZardDota2175
League of Legends
• Lourlo1363
• masondota2816
• Stunt507
Upcoming Events
RSL Revival
3h 2m
Clem vs Classic
SHIN vs Cure
FEL
5h 2m
WardiTV European League
5h 2m
BSL: ProLeague
11h 2m
Dewalt vs Bonyth
Replay Cast
1d 17h
Sparkling Tuna Cup
2 days
WardiTV European League
2 days
The PondCast
3 days
Replay Cast
3 days
RSL Revival
4 days
[ Show More ]
Replay Cast
4 days
RSL Revival
5 days
FEL
5 days
RSL Revival
6 days
FEL
6 days
FEL
6 days
Liquipedia Results

Completed

BSL 2v2 Season 3
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
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
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
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
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.