• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 22:39
CEST 04:39
KST 11:39
  • 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
TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3[ASL20] Ro8 Preview Pt2: Holding On9Maestros of the Game: Live Finals Preview (RO4)5
Community News
BSL Team A vs Koreans - Sat-Sun 16:00 CET6Weekly Cups (Oct 6-12): Four star herO85.0.15 Patch Balance Hotfix (2025-10-8)80Weekly Cups (Sept 29-Oct 5): MaxPax triples up3PartinG joins SteamerZone, returns to SC2 competition32
StarCraft 2
General
Revisiting the game after10 years and wow it's bad The New Patch Killed Mech! TL.net Map Contest #21: Voting Stellar Fest: StarCraft II returns to Canada herO Talks: Poor Performance at EWC and more...
Tourneys
Tenacious Turtle Tussle SC2's Safe House 2 - October 18 & 19 Sparkling Tuna Cup - Weekly Open Tournament $1,200 WardiTV October (Oct 21st-31st) WardiTV Mondays
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment Mutation # 493 Quick Killers
Brood War
General
BW General Discussion BSL Season 21 BGH Auto Balance -> http://bghmmr.eu/ BW caster Sayle BSL Team A vs Koreans - Sat-Sun 16:00 CET
Tourneys
Azhi's Colosseum - Anonymous Tournament [ASL20] Semifinal B [Megathread] Daily Proleagues SC4ALL $1,500 Open Bracket LAN
Strategy
Current Meta BW - ajfirecracker Strategy & Training Relatively freeroll strategies Siegecraft - a new perspective
Other Games
General Games
Path of Exile Stormgate/Frost Giant Megathread Dawn of War IV Nintendo Switch Thread ZeroSpace Megathread
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread US Politics Mega-thread Men's Fashion Thread Sex and weight loss
Fan Clubs
The herO Fan Club! The Happy Fan Club!
Media & Entertainment
Series you have seen recently... Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
Formula 1 Discussion 2024 - 2026 Football Thread MLB/Baseball 2023 NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
The Heroism of Pepe the Fro…
Peanutsc
Rocket League: Traits, Abili…
TrAiDoS
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1173 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
Spain18093 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
Norway8125 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
Norway8125 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
Norway8125 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
Safe House 2
17:00
Playoffs
TriGGeR vs Cham
Astrea vs TBD
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft473
WinterStarcraft426
Nathanias 91
StarCraft: Brood War
Artosis 692
Icarus 4
Dota 2
monkeys_forever452
League of Legends
JimRising 745
Cuddl3bear6
Super Smash Bros
hungrybox556
Heroes of the Storm
Khaldor141
Other Games
summit1g13848
ViBE140
fpsfer 2
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• Berry_CruncH106
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV404
League of Legends
• Doublelift4938
Upcoming Events
Replay Cast
7h 21m
Monday Night Weeklies
13h 21m
Replay Cast
20h 21m
WardiTV Invitational
1d 8h
WardiTV Invitational
1d 11h
PiGosaur Monday
1d 21h
Replay Cast
2 days
Tenacious Turtle Tussle
2 days
The PondCast
3 days
WardiTV Invitational
4 days
[ Show More ]
Online Event
4 days
RSL Revival
4 days
RSL Revival
5 days
WardiTV Invitational
5 days
Afreeca Starleague
6 days
Snow vs Soma
Sparkling Tuna Cup
6 days
WardiTV Invitational
6 days
CrankTV Team League
6 days
RSL Revival
6 days
Liquipedia Results

Completed

Acropolis #4 - TS2
WardiTV TLMC #15
HCC Europe

Ongoing

BSL 21 Points
ASL Season 20
CSL 2025 AUTUMN (S18)
C-Race Season 1
IPSL Winter 2025-26
EC S1
Thunderpick World Champ.
CS Asia Championships 2025
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

Upcoming

SC4ALL: Brood War
BSL Season 21
BSL 21 Team A
BSL 21 Non-Korean Championship
RSL Offline Finals
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
CranK Gathers Season 2: SC II Pro Teams
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 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.