Wikipost is Locked  
Old Dec 31, 2021, 9:43 am
FlyerTalk Forums Expert How-Tos and Guides
Last edit by: tcook052
This new annual thread has been carved out of the previous thread in an effort to reduce the number of megathreads on the AC forum. For those interested previous versions are the original 2004 - 2014 thread , 2015 edition, 2016 edition , 2017 edition, 2018 edition, 2019 edition, 2020 edition and 2021 edition.

The original thread started by accident but quickly became a popular place to come and discuss off topic things such as hockey, new movies, or almost anything that wouldn't fit into existing AC forum threads. Air Canada or Aeroplan topics such as flight feedback, in-flight services issues, status or mileage earning/redemption are all topics that should go into existing AC forum threads so others can benefit from this information. Topics about hotels or airlines and/or their loyalty programs, destinations, in-flight travel tech. or anything best discussed elsewhere on FT may be relocated to that forum as this thread isn't meant to import travel topics to this forum that are better discussed on other forums. FT is an amazingly diverse and large community so members are encouraged to seek out all of its resources.

While the conversation is more relaxed as it would be in a lounge that doesn't mean however that the FT rules don't apply here as they definitely do so please refrain from controversial topics such as politics or religion, avoid profanities and treat other lounge patrons with the same respect you expect.

Adam Smith & tcook052
AC Forum Co-Moderators
Print Wikipost

The Forum Lounge Thread (2022)

Old Dec 4, 2022, 11:04 am
  #976  
 
Join Date: Dec 2011
Location: YYZ
Programs: AC SEMM / HH Diamond
Posts: 3,144
Originally Posted by canadiancow
7 minutes

Edit:

The difference in my code for part 1 and 2 was so negligible. I almost didn't rename the variable because it was a bigger change than actually handling the difference.

You & this kotlin thing

Java doesn't have an Integer Range class - so I had to create one. It wasn't hard, and at the end the main method I created was pretty much equivalent to yours ... but it took some time to create a range class ...

At least that's my story, and I'm sticking to it

Spoiler
 
Bohemian1 likes this.
canopus27 is offline  
Old Dec 4, 2022, 11:06 am
  #977  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,282
Oh you're actually reading from files. You can see what I'm doing in GitHub. Much faster to do it that way (though I can't recall if Java allows multi-line string literals), and to swap between the test data and my real data.
canadiancow is offline  
Old Dec 4, 2022, 11:10 am
  #978  
 
Join Date: Dec 2011
Location: YYZ
Programs: AC SEMM / HH Diamond
Posts: 3,144
Originally Posted by canadiancow
Oh you're actually reading from files. You can see what I'm doing in GitHub. Much faster to do it that way (though I can't recall if Java allows multi-line string literals), and to swap between the test data and my real data.
Meh. The file reading thing is easy ... there's just some boilerplate code I use for that which is basically the same for every day.

Anyway, these are fun little exercises
canopus27 is offline  
Old Dec 4, 2022, 11:42 am
  #979  
 
Join Date: Jan 2017
Location: Halifax
Programs: AC SE100K, Marriott Lifetime Platinum Elite. NEXUS
Posts: 4,552
Ruby has inline data, too. Handy for this.

We've all come up with essentially same algorithm, and using set theory, at least. I'm sure someone is doing the searching by hand.

https://github.com/jeffwarnica/Adven...master/Day4.rb
canadiancow likes this.
RangerNS is offline  
Old Dec 4, 2022, 12:25 pm
  #980  
 
Join Date: Aug 2013
Location: YVR - MILLS Waypoint (It's the third house on the left)
Programs: AC*SE100K, wood level status in various other programs
Posts: 6,206
Originally Posted by expert7700
14yroldsuperelite took 1hr 15 min for day 2.

​​​​​​Perhaps not twitter 2.0 coding material yet, but a great way to pad the work hours.

Imagine how much quicker Boeing could have "solved" MCAS if they outsourced it to a public contest.
expert7700 - maybe you should join in the fun.

But since you are older and wiser, I'm guessing you'd want something like this to better utilize your valuable time.
canadiancow likes this.

Last edited by Bohemian1; Dec 4, 2022 at 1:01 pm
Bohemian1 is online now  
Old Dec 4, 2022, 4:48 pm
  #981  
 
Join Date: Sep 2015
Posts: 1,168
Originally Posted by Adam Smith
If only all this coding effort could be put towards improving cowtools, or developing canopustools or Rangertools...
Or AC backend...
smallmj likes this.
vancouver25k is online now  
Old Dec 5, 2022, 5:46 am
  #982  
 
Join Date: Jan 2017
Location: Halifax
Programs: AC SE100K, Marriott Lifetime Platinum Elite. NEXUS
Posts: 4,552
Day 5.
1:21

Dammit. there is a
Code:
.rotate
. Because of course there is.
RangerNS is offline  
Old Dec 5, 2022, 6:14 am
  #983  
Moderator, Air Canada; FlyerTalk Evangelist
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,718
Originally Posted by Bohemian1
That's kinda my point - it's the ultimate game.
I was hoping someone would disagree and say...
​​​​​

Originally Posted by King Chung Huang
I just came across this and thought of you! 😄

The World Cup of Microsoft Excel
@YYC3722 sent me something about a previous year's version a while back. Those guys are nuts.

The truth is that while I'm probably better at Excel than 99.9% of the world, it's a very part-time tool for me these days. I recently took on a project where I had to build most of a financial model from scratch and it was... not very enjoyable. I'm still perfectly capable with it, but it's not where I add most of my value.
smallmj likes this.
Adam Smith is offline  
Old Dec 5, 2022, 8:15 am
  #984  
 
Join Date: Dec 2011
Location: YYZ
Programs: AC SEMM / HH Diamond
Posts: 3,144
Originally Posted by RangerNS
Day 5.
1:21

Dammit. there is a
Code:
.rotate
. Because of course there is.
It took me 58 minutes today.

I'm pleased that the time for part two was only about 2 minutes ... almost half of which was just reading the instructions ... but I'm not at all pleased that the time for part one was 56 minutes ...
canopus27 is offline  
Old Dec 5, 2022, 10:07 am
  #985  
A FlyerTalk Posting Legend
 
Join Date: Sep 2012
Location: SFO
Programs: AC SE MM, BA Gold, SQ Silver, Bonvoy Tit LTG, Hyatt Glob, HH Diamond
Posts: 44,282
Yeah, I was 32 minutes today (I included a ".reversed()" on the move instructions when I hastily copy-pasted code from an earlier part, and it took me quite a while to identify that, because the test input produces the same result whether you process the instructions forward or backward ).

Second part was also basically 2 minutes.
canopus27 likes this.
canadiancow is offline  
Old Dec 5, 2022, 3:19 pm
  #986  
 
Join Date: Nov 2022
Location: YEG
Programs: Aeroplan
Posts: 92
I used to be able to do these coding challenges, but then after working for almost 8 years and being constantly burned out, my mind just blanks on the simplest tasks. I don't know how people stay motivated and continue to do these challenges for fun.

It's made worse when you change jobs and throw away your years of experience programming in a unpopular language and platform (MATLAB) and got to relearn it all under a new platform (switched to Python). It's like taking baby steps again in a new language and it's mentally draining.
fysloc is offline  
Old Dec 5, 2022, 3:49 pm
  #987  
 
Join Date: Jan 2017
Location: Halifax
Programs: AC SE100K, Marriott Lifetime Platinum Elite. NEXUS
Posts: 4,552
What is mentally draining is yelling at a Meet screen (while on mute, I hope): "tab. no. tab.. no, not spaces. tab. OK. good intern. now a hyphen. No, not a colon, a hyphen. ON THE SAME LINE, HYPHEN. You misspelled that word, that is why vscode has it underlined. Now another hyphen. align the next line to the word. ALIGN TO THE WORD ABOVE. I have absolutely no idea what your policy is. I have no idea what command you run. Why don't you find someone who knows the policy. Why don't you find someone who knows the command."
YYC3722 likes this.
RangerNS is offline  
Old Dec 5, 2022, 3:57 pm
  #988  
Moderator, Air Canada; FlyerTalk Evangelist
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,718
Man, you guys are slow. I'm under 2 minutes in aggregate on these coding challenges
canopus27 and Bohemian1 like this.
Adam Smith is offline  
Old Dec 6, 2022, 7:38 am
  #989  
 
Join Date: Jan 2017
Location: Halifax
Programs: AC SE100K, Marriott Lifetime Platinum Elite. NEXUS
Posts: 4,552
Day 6.

Interesting how the mind works.

Conceptualized the solution in 10 minutes, another 20 to implement. And then off by 1 (..4) errors. Finally broke down and checked the subreddit, and everyone was celebrating their 4 minute solutions. I'll admit to glancing at a solution (in a different language). Dammit. It is something of a trivia game.. I remembered pop() and push() (actually, append()), but perhaps remembering shift() would have gotten me down a path to thinking that uniq() worked.

48 minutes.
RangerNS is offline  
Old Dec 6, 2022, 8:40 am
  #990  
Moderator, Air Canada; FlyerTalk Evangelist
 
Join Date: Feb 2015
Location: YYC
Programs: AC SE MM, FB Plat, WS Plat, BA Silver, DL GM, Marriott Plat, Hilton Gold, Accor Silver
Posts: 16,718
Anyone here still use cheques? I was chasing a clients for a payment, turns out they mailed me a cheque rather than sending an EFT. I was surprised at the large number of cheques I saw going out on their monthly bank statements when I had been looking at them a couple weeks ago, but hoped/assumed those were to old people do were used to getting their monthly royalty payments or surface rents or whatever via cheque and didn't want to change, but maybe not.

I used to oversee the treasury group of a decent-sized company, and I had had my team get us down to about 1-2 cheques a year (well, in Canada... South America was a different game, but I didn't have to sign those ones, so I was less worried about those ). And I used my last personal cheque earlier this year, having not ordered any in over a decade.
Adam Smith is offline  

Thread Tools
Search this Thread

Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.