[Blog] Unprocrastination challenge: Check-in #2
2017-01-21T06:00:11Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/oYe4kMakTbo/)
Even though I'm laid off I'm still trying to work on The Unprocrastination Challenge. I'm trying to keep myself on as many routines as I can even though my tasks aren't accountable to anyone but myself. If I don't hold myself accountable then I'll be drifting along, and that's not good for myself and the things that I want to get done.
Overall I've not been as good blocking off the Internet using Block Focus, but I have been able to pause and give myself the breathers that lead me to want to be on social media. Recognizing that I'm feeling overwhelmed by my thoughts and my desires to keep myself in comfort. Pushing myself outside of my comfort levels is how I'm going to grow.
I have some more thoughts on this, but I'm keeping this short so I can collect my thoughts on how to break my cycles of procrastination.
[Blog] Unprocrastination challenge: Check-in #1
2017-01-21T05:00:12Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/aiPSk8bPhHo/)
So the "unprocrastination challenge" is in full swing. Here's what I've learned so far:
The Block Focus extension is quite good at keeping me from dallying on social media. It's a good reminder to put my focus back to what it is that I am doing.
I've been using the full Pomodoro 25 minutes rather than 5 minutes, as this is something that I'm used to. Unfortunately here's a little more resistance at certain points of the day to not start up another round. So I need to get myself to not be so worried about blocking things for a spell and just do the work.
Once I manage to get myself focused it's tempting for me to lose focus when I have to wait for something to complete. I need to remind myself to stay focused, and at the very least pull something off of my next actions list instead of letting the internet at large satiate my boredom.
I've not been nearly as diligent as I should be with this whole exercise, but there are clear ways for me to improve. I think I can make it work.
More later as the month progresses.
[Blog] What about plan C?
2017-01-18T13:00:09Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/T3V2fGwdVO8/)
With the closing of The Ringling Bros. and Barnum & Bailey Circus it appears my backup plan of running away to join the circus is less of a viable option.
Open Metalcast Episode #146: Jump In Anytime
2017-01-17T01:17:59Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/gXJgapfHNrE/)
Ever have one of those moments when you don’t know when to jump into a conversation? Where the time to speak doesn’t happen for a while? That’s what happened with this episode. Normally I jump in after the first few tracks but it didn’t seem right. And really, where would you interrupt such a great line-up of music from Dantalion, Feral, Abriosis, Totem Skin, Anopheli, and Sedulity? I don’t know the answer to that, but I do know this show is ready and waiting for your podcatching software of choice to download. Just make sure to leave yourself plenty of time to listen all the way through. You’d really hate to interrupt this set of amazing Creative Commons Metal Music.
- (00:09) 03.Crimson Tide by Dantalion from …And All Will Be Ashes (BY-NC-ND)
- (07:09) Virus by Feral from Alter Ego (BY-NC-ND)
- (14:40) Between the Bridge and the Water by Abriosis from Tattered and Bound (BY-NC-ND)
- (22:41) Reckless Recluse by Totem Skin from Weltschmerz (BY-NC)
- (26:21) Trade by Anopheli from The Ache Of Want (BY-NC)
- (34:37) Seven Cities by Sedulity from The Valley of Dying Stars (BY-NC-ND)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or just buy up everything they’ve ever made. Whatever you can do to help these bands keep making music, please do it!
If you have any suggestions for Creative Commons licensed metal, send me a link at email@example.com.
Open Metalcast #146 (MP3)
Open Metalcast #146 (OGG)
That moment when you change your procmail filters, start checking procmail logs, and receive no mail.
firstname.lastname@example.org likes this.
[Blog] mismatch_cnt, RAID1, and a clever fix
2017-01-03T22:00:07Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/ER1lc-by0lM/)
This past weekend my computer showed an ominous error:
Jan 1 04:06:16 lister mdadm: RebuildFinished event detected on md device /dev/md/0, component device mismatches found: 9856 (on raid level 1)
Huh, that doesn't look particularly good. Mismatches between drives tend to lead to bad things.
Once the original panic subsided I checked online.
please explain mismatch_cnt so I can sleep better at night seemed promising for an explanation of what was going on. I read through this. "Aha! Swap files cause this problem!" I exclaimed to myself. "That has to be the culprit".
Except my machine didn't have a swap file on a RAID1 device.
Shoot. That would have been an easy explanation.
Much like looking up symptoms online the more I searched the more my heart sank. Data corruption seemed the most obvious cause.
I checked the SMART data on all of the drives. Nothing looked amiss there.
I re-ran the checks:
echo check > /sys/block/md0/md/sync_action
watch cat /sys/block/md0/md/mismatch_cnt
My heart sank as I watched the counter tick up and up.
So I pulled out my copy of Spinrite and ran a read-test on all of my drives. Spinrite said there was nothing wrong with the hardware. So it had to be something up with the software RAID1 itself.
I kept reading that the problem could one of two issues. Either: 1) there was a memory-mapped file that wasn't in sync between the drives, or 2) the free space between the drives didn't 100% match. I was still holding out that it wasn't 3) corrupted data.
At this point I could have done:
echo repair > /sys/block/md0/md/sync_action
but that thought scared me. I had one of the drives on this machine corrupt a Virtualbox instance before when I mirrored the bitmaps between them (one drive had issues, and suddenly both copies of the file had issues). Add to that the somewhat scary notion that it was anyone's guess which mismatch would become the canonical version. That path seemed a certain way to ensure something got corrupted.
I'm not currently able to find the exact article but someone mentioned that one way to test to see if it's the free space of the RAID is to do a
dd if=/dev/zero of=foo bs=8Kand just let it fill up the disk. The reasoning is that the free space will be reclaimed and will be set to a known quantity.
Note: If you decide to do this make sure that you do this in single-user mode (
shutdown now) rather than with a running system. Filling up a filesystem while things are running can make your machine very cranky.
So I ran
dd if=/dev/zero of=foo bs=8Kas root and let it fill up the remaining space on the disk. I then ran
sync;sync;syncto make sure everything was synchronized before removing the file (and re-running the
I booted the machine into multi-user mode and re-ran the scrubbing check. I kept an eye on the progress and the
When it kept at a steady 0 count I breathed a sigh of relief.
Moral of the story: The free space on RAID1 can get out of sync (especially if there's a power outage or if you have memory-mapped files like swap files). You can do a "repair" on it, but you might run into corruption if the mismatches are pointing to real data. You may want to instead create a known-good file in the free-space of the drive and see if that clears it out.
Hope this helps someone else who runs into this. If I re-run into the original article that mentioned this nugget I'll update with a link.
Open Metalcast Episode #145: Quietly entering 2017
2017-01-03T04:00:05Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/EXvKphbmV8M/)
First off, congratulations on making it to 2017.
We decided for this episode to just shut up and announce the song titles at the end of the show. That way we can let the music speak for itself. So you’ll hear some great music from Wasted Heroes, Digger, Muldjord, Stellarvore, Zombie Destrüktion, Nimrud, Black Autumn, and Pressor. Definitely check this out and kick off 2017 with some of the best Creative Commons metal the net has to offer.
- (00:25) Living For The Moment by Wasted Heroes from Living For The Moment (BY-SA)
- (05:16) Digger – Evidence  – Bendalian by Digger from Evidence… is written in the noizz – Full Album (BY-NC-SA)
- (10:30) The Pebble and the Stone by Muldjord from The Reissue of My Soul (BY-SA)
- (15:40) L’Année terrible by Stellarvore from L’Orgueil des drapeaux et des flammes (BY-NC-SA)
- (19:27) Grinding the Spleen by Zombie Destrüktion from Tales of Morbid Mummification (BY-NC-ND)
- (22:44) Sarahu by Nimrud from Sarahu (BY-NC-SA)
- (29:29) Rauhnacht MMXVI – II by Black Autumn from Rauhnacht MMXVI (BY-NC-SA)
- (35:32) Royal Witch by Pressor from Pressor / Diazepam / Soom (BY)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or [FUNNY]. Whatever you can do to help these bands keep making music, please do it!
If you have any suggestions for Creative Commons licensed metal, send me a link at email@example.com.
Open Metalcast #145 (MP3)
Open Metalcast #145 (OGG)
mray shared this.
[Blog] War of Ashes: Fate of Agaptus
2016-12-29T18:00:10Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/i4L__gLlBcQ/)
- Title: "War of Ashes: Fate of Agaptus"
- Game Creators: Sophie Lagacé, Karen Twelves, Mike Olson, Edmund Metheny, and Sean Nittner
- Publisher: Evil Hat Productions
- System: Fate Accelerated
It's taken me way too long to write up a review of War of Ashes: Fate of Agaptus. I've wanted to write the perfect review, detailing just how much I love this game. I wanted to show just how much thought and world-building this book has in it, and how the different factions / characters in this book blend together to make an interesting, "lived-in" world.
I may still write that review at some point: poring over each and every page, detailing what I found interesting.
But I'll sum it up as best I can:
"This is the book I wish I'd wrote."
Not that I feel the authors did a disservice to the material that only I can fix; I mean that I wish that games that I wrote even approached how wonderful this book is.
The source material for this book is the miniatures game "War of Ashes" by Zombiesmith games. Generally speaking miniatures games don't put a whole lot of depth into their characters. Sure they may have some backstories and motivations, but the objects of those games is to annihilate the opposing forces.
What "War of Ashes: Fate of Agaptus" does that is so brilliant is it takes what is ostensibly a hack-and-slash game and transforms it into a living world. And the world they present is a fascinating world.
Each "race" believes different things about their pantheon of gods. The Elvorix believe in many gods, the Vidaar believe in one god, and the Jaarl ignore their gods. (The Kuld believe in a diffuse, impersonal universal force). While on the surface that feels a bit trite, the interactions between the gods and the races is what really shines in this book. There are certain gods for which the Elvorix do not want to draw attetion. Agaptus, the God of Sky and Stars, is a bit heavy-handed whenever he arrives, so the priests do things like burn smelly incensei, and make the temples and themselves unattractive to keep the god away. The Vidaar have one god: Akka -Maas, which the Elvorix claim is another name for Agaptus and which the Vidaar vehemently deny. It's writing like this that breathes life into the world and makes for interesting interactions between characters.
Apart from religion each society has their own ways of thinking and behaving. While they share some similarities there is enough differences between them to make for interesting interactions for characters. The world feels lived in, with reasons for each of the factions to live, work, and behave the way they do. And all throughout the book there are seeds and ideas that give direction for what sorts of adventures the characters could have.
The book is written in the perspective of an in-world historian, along with conversations between her and other in-world participants, gives a unique flavor to each of the races and how they interact and interpret the events in the world.
I won't go too in depth about the system itself. Suffice to say it's a stand-alone version of Fate Accelerated that I am looking at carefully for my own designs. :)
And the artwork. I really love the artwork and the style of this book.
In short I think "War of Ashes: Fate of Agaptus" is an excellent book, and I hold it as a standard for what I want to achieve with my own writing and design. It builds a world, shows how to best participate in it, and creates interesting obstacles for the characters to interact. I would see small skirmishes in this world, and epic campaigns. It has depth and mythology that make sense, and draws out a sense of humor that fits the characters and setting.
How do you feel the minis battling mechanics hold up? I followed Mike Olson's blog while he was working on that part. Tactical battles are kind of challenging in Fate sometime so I was curious how it would work in actual gameplay.The rules for combat add a little bit for minis but they don't distract much from the overall "Fateness" of the game. I haven't actually done much with them, and I'm pretty sure if you wanted you could completely ignore them if you wanted.
Christopher Allan Webber likes this.
2016-12-29T02:00:09Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/oGYw3Xl6x7I/)
> bar = ['width', 'height'] [ 'width', 'height' ] > bar [ 'width', 'height' ] // Nothing up my sleeve > bar.indexOf['length'] 1 // Presto!
[Blog] Habit tracking: Shaving
2016-12-26T18:00:34Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/MOM7-smTGD8/)
I've been quietly implementing a new habit for myself. As part of the Habit Guide from Zen Habits I've decided to start with a ridiculously small habit in order to get myself back into the habit of making good habits. (Play along at home with the "Craig says 'habit"" game: take a drink whenever this post says habit.)
That habit? Shaving.
Now you may think "that habit has a natural trigger, doesn't it? If you look like a mountain-man, then you need to shave, right?" Yes, but I decided on this habit for the following reasons:
- I grow facial hair like a pre-pubescent boy (it takes me a week to get to "mostly stubble")
- It has an easy trigger (I see the razor, and three-minutes-later I have a clean face).
- It has a positive effect (I have a shaved face).
Is it a major, life-changing habit? Hardly. Most folks won't even notice the effects. But the benefits for me are making a habit that I can see results. I'm already 35% through in tracking the habit via Loop Tracker and I'm seeing progress. That's the real reason for doing this.
I'll add different habits in the near future. But for now I'm going to enjoy a clean-shaven (or some facsimile thereof) and see where this leads.
(And yes, it hasn't escaped me that someone could call this yak shaving. I'm OK with shaving this yak. :)
[Blog] Twas a few nights before Christmas...
2016-12-24T15:21:19Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/7SdPW3fTm2w/)
May your holidays be carefully guarded by the Christmas Kitten.
Open Metalcast Episode #144: Closing out 2016
2016-12-23T19:00:30Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/xGU7Qxkj_vE/)
It doesn’t feel like the end of 2016 is upon us. It also doesn’t feel like this should be the last regular episode of 2016. Yet, here we are.. But we’re going out with style, with brand new music from Dejadeath, Agónica, and Minenwerfer. We also have tracks from Ishmael, Silent Path, Last Dive, Dehumanizing Process, and an ear-worm from Martes Mártir. And while we bid a farewell to 2016 we’ll be back first-thing in the new year with more Creative Commons Metal Music to blast your ear-holes into the new year.
- (00:11) Voluntary Servitude by Dejadeath from Satan Is Losing Momentum (BY-NC-ND)
- (03:43) The King Of Worms by Agónica from Collapse (BY-NC-ND)
- (09:04) Iron Cross (Ostfront 1915 Version) by Minenwerfer from Ich hatt einen Kameraden (BY-NC-SA)
- (12:28) III by Ishmael from Second Perception (BY-NC)
- (23:21) Grey Dolls from Nowhere by Silent Path from Mourner Portraits (BY-NC)
- (29:51) Last Dive by Last Dive from Firstborn (BY-SA)
- (34:30) Enslavement by Dehumanizing Process from Supremacy (BY-NC-ND)
- (39:24) Fantasmagoria by Martes Mártir from CARCASA (BY-NC-SA)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or leave a present for them. Whatever you can do to help these bands keep making music, please do it!
If you have any suggestions for Creative Commons licensed metal, send me a link at firstname.lastname@example.org.
Open Metalcast #144 (MP3)
Open Metalcast #144 (OGG)
[Blog] Happy Holidays and Merry Christmas
2016-12-23T19:00:29Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/JKF2A3TIpkw/)
Wishing you and yours the best of the holiday season.
Open Metalcast Episode #143: Cat on the Desk
2016-12-06T22:00:14Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/TLufJVxD6ao/)
This episode brought to you despite the efforts of Pixel to prevent it from happening.
- (00:11) Conflict by Violblast from Conflict (BY-NC-ND)
- (03:44) Deceiving The Host by Wasting The Genesis from Viral Supremacy (BY-NC-ND)
- (06:33) Expiation by Screaming Savior from Semblances of the Void (BY-NC-ND)
- (12:05) The Awakening by Catchlight from Amaryllis (BY-NC-SA)
- (17:22) Dancer in the Sky by SILUETLESS from Drifting (BY-NC-SA)
- (24:55) RAISING HELL by Galderia from Royaume de l’Universalité (BY-SA)
- (28:41) Drone by Ov Hollowness from Drawn to Descend (BY-ND)
- (37:40) Jupiter’s Moons by The All Seeing Hand from Sand To Glass (BY-NC-SA)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows. Whatever you can do to help these bands keep making music, please do it!
Open Metalcast #143 (MP3)
Open Metalcast #143 (OGG)
2016-11-29T05:00:07Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/ZtL6FkivYyI/)
I've been binge-watching the documentary series "Soundbreaking" (which leaves PBS streaming tonight. :( ) and overall I've enjoyed it. It's an ambitious series and I've learned a few things from it:
I wasn't aware of the TONTO synthesizer and Tonto's Expanding Head Band, which formed the synth periods of Stevie Wonder and The Isley Brothers.
That DEVO was a reaction to the music of the 1970s that lost a lot of the protest vibe of the 1960s. I thought it was more of a reaction to the sterilization of music and culture.
That Donna Summers' song "I Feel Love" was done by Giorgio Moroder, and who Giorgio Moroder was and his role in creating EDM.
How Tom Petty's "Free Falling" came about.
There's a few others, but those really stuck out to me.
Unfortunately with any survey of modern music there's bound to be a number of blind spots. And while this tries to cover a lot of territory there are a few places where I feel they missed out:
When they talk about synthesizers they give a passing nod to Wendy Carlos, and completely ignore Tangerine Dream and the Krautrock / Berlin School movement. Kraftwerk gets a nod in the section about beat.
The episode on sampling is dominated by rap and the genesis of hip-hop. To hear them tell it sampling was strictly the domain of rap and hip-hop and was later adopted by pop musicians in the late 2000s. The Beastie Boys get a lot of play in this arena because they (rightly) claim "Paul's Boutique" couldn't be made today without a crap-ton of sample clearance. But industrial bands are ignored.
The section on producers completely ignores Motown. Motown gets mentioned in the section on beat because of the amazing Funk Brothers rhythm section, but outside of Smokey Robinson and Diana Ross the Motown sound is conspicuously absent.
The hardest music they touch on is The Who. Prog Rock is completely ignored. Sections where they could easily talk about the virtuosity of artists in the acoustic realm are left with The Black Keys and Bruno Mars as the examples of virtuosity. Rush gets one picture. No mention is made of any metal bands that are putting out mind-blowing melding of jazz, funk, rock, and metal. Punk gets passing mentions, but when you have Rick Rubin on the show and just mention Slayer in passing? That's a missed opportunity.
To hear them talk you'd think EDM was where everything is happening in music. And while I won't argue there's interesting things happening there it gets a disproportionate amount of weight in this series.
Sure they're quibbles, and "my favorite bands didn't get a mention" complaints. But the overall package is amazing. The shear amount of music in this series is amazing and had to have been a huge undertaking to compile. What's there is a compelling story about the origins of recorded music and a lot of interesting discussion about what goes into making it.
Highly recommended if you get the chance to watch it.
Open Metalcast Episode #142: Thankful
2016-11-22T03:00:21Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/sccAnmEHIas/)
We’re coming up on the Thanksgiving holiday here in the USA and I wanted to take a moment to thank you for listening to this humble podcast of Creative Commons Metal Music. It’s a privilege to bring you this episode every couple of weeks and though some episodes take a little more to put together than others, seeing folks download the episode warms my heart. We have a great episode lined up with new music from the upcoming Sonus Mortis album, as well as music from Æons Collide, Effigy, Monster Coyote, Neila, PhaZer, Shady Bliss and Seal of Beleth. It’s an episode you won’t want to miss.
- (00:09) I See Humans But No Humanity by Sonus Mortis from Hail The Tragedies Of Man (BY-NC-ND)
- (08:24) Epiphany by Æons Collide from None (BY-SA)
- (14:25) Cessation Of All by Effigy from Eugenics (BY-ND)
- (18:47) The Worst Blind by Monster Coyote from NECKBREAKER (BY-NC-ND)
- (24:57) Tronos ardiendo by NEILA from “Tronos ardiendo” LP (BY-NC)
- (30:18) No Remedy by PhaZer from Un(Locked) (BY-ND)
- (35:28) Thanks For The Ride by Shady Bliss from Old Boy (BY-NC-SA)
- (42:18) Death In Eden by Seal Of Beleth from None (BY-NC-ND)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or thank them for making their music Creative Commons Licensed. Whatever you can do to help these bands keep making music, please do it!
Open Metalcast #142 (MP3)
Open Metalcast #142 (OGG)
[Blog] Left behind
2016-11-10T17:00:12Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/3zEpo4sA1YM/)
Feeling a little left behind at the moment. Checking job sites will do that for you.
It feels like anything that isn't on the resume as "professional experience" doesn't count.
Is there a way to start with AWS that doesn't cost a lot of money and can get me up to speed fast?
At the coffeeshop that we meet at for Coffee House Coders I remember a conversation where I told another developer what I did (Python and Linux). He commented that was "Old School Development". At the time I was offended, but now I'm thinking he was right.I hear ya. Checking job sites can definitely be demoralizing. A lot of development is very faddish and moves from tech stack to tech stack without actually improving the state of the art very much (if at all). It's just a bunch of different details about how to do the same thing you were already doing. I think one factor is that the demand for developers has been ever increasing, which means the industry remains mostly young (that's the only way to fill the demand). Wave after wave of young, inexperienced people making tech choices... I'm not criticizing, just observing.
Anyway, it sounds like you have some tremendous skills. Demand for Python developers remains strong (although I know a lot depends on geography), and understanding operating systems well enough to administer machines should be knowledge that is transferable. After all, whether containers or virtual machines, it's still the same tech under the hood. Your skills and knowledge are still useful.
I wish I had some advice on AWS. It's something I keep intending to play with, but I never find time to do. For one thing, I hear bad stories about billing snafus or virtual machines that Amazon keeps alive but are nowhere to be seen in dashboards. Maybe it's better these days, but I prefer to play with solutions where I know that I can't exceed my budget (just in case I screw something up). I do not need crazy surprise bills.
Open Metalcast Episode #141: V.O.T.E.
2016-11-07T22:47:37Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/bgicNffNulM/)
If you’re even remotely aware of a country called the United States of America you’ll no-doubt know that November 8th is our election day. We’ve had a barrage of campaign calls from celebrities who likely would never call me otherwise (Seriously, lose my phone number). We’ve also had non-stop election coverage in every medium known to man (I think they’re even using the Rosetta stone to craft messages for any voters who might only read hieroglyphs). Whatever your political stripe, denomination, or leaning: please vote if you can.
Regardless, here’s 49 minutes of the best Creative Commons Licensed Music as a (temporary) respite from the United States of America’s political machinations.
V.O.T.E.: Very Over This Election.
- (00:11) Eye of Providence by Violent Eve from A Great Day (BY-NC)
- (04:17) Beneath by Roads to Nowhere from Lifeless (BY-NC)
- (08:23) In the Master’s Fire by Chateau from Moons Over the Slaughter (BY)
- (13:41) VI by Sanctus Daemoneon from The unaVOIDable (BY-NC-ND)
- (18:35) The Writer’s Farrago by SILUETLESS from Drifting (BY-NC-SA)
- (27:34) Exit Wounds by That Of A Lion from Amalgamation (BY-NC-ND)
- (35:25) Terrorball by Room 101 from The Gadfly (BY-NC-SA)
- (41:21) Verne by Maeth from Shrouded Mountain (BY-NC-SA)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or vote them for office. Whatever you can do to help these bands keep making music, please do it!
Open Metalcast #141 (MP3)
Open Metalcast #141 (OGG)
[Blog] Code Katas
2016-10-29T17:00:10Z via Spigot To: Public(http://feedproxy.google.com/~r/CraigMaloney/~3/kcRE62rqbEs/)
One of the things I noticed on the site was that you could use Vim or Emacs keys. Cool! So I dutifully started typing into their editor.
A keypress that is handy and almost automatic to me in Vim is CTRL-W. This keypress allows you to quickly delete the previous word. Unfortunately modern window managers and browsers have usurped that keypress to close out the browser window.
Yeah, so it closed out my browser. Don't do that.
(warning: Solution ahead. Stop reading if you want to play with this on your own.)
The kata that I was working on was to find the two lowest sums of an array (assuming the array has positive integers, etc.). In Python it's a pretty simple matter: sort the array and take the two elements off the front of the newly sorted array. Simple.
But they added this caveat: Don't change the original array.
As anyone who has ever done a sort on an array in Python knows, sort is destructive:
>>> foo = [3,5,2,7,8,0,6,2] >>> foo.sort() >>> foo [0, 2, 2, 3, 5, 6, 7, 8] >>>
(But there's something that I missed and learned. Hint: there's a difference between
It felt like they were expecting me to not sort the array. Hm, that makes things a little more tricky and less Pythonic.
So I got to thinking, put on my BASIC programming language hat and wrote this masterpiece:
def sum_two_smallest_numbers(numbers): # Take the first number as the lowest number lowest = numbers # Set the position of the lowest number lowest_position = 0 for i in range(0, len(numbers)): if numbers[i] < lowest: lowest = numbers[i] lowest_position = i second_lowest_position = 0 # Check for the case where the lowest position is the first number of the # array if second_lowest_position == lowest_position: second_lowest_position = len(numbers) - 1 second_lowest = numbers[second_lowest_position] for i in range(0, len(numbers)): if i != lowest_position and numbers[i] < second_lowest: second_lowest = numbers[i] second_lowest_position = i return lowest + second_lowest def main(): print sum_two_smallest_numbers([5, 8, 12, 18, 22]) if __name__ == "__main__": main()
This code has problems: It's not Pythonic (it's essentially BASIC), it doesn't take advantage of any of the routines that Python gives you, it does two passes of the array.
It's not a great solution, but it works.
What's the first solution that I see?
def sum_two_smallest_numbers(numbers): sum(sorted(numbers)[:2])
Much more Pythonic, but does the sort affect the original array?
Turns out there's a difference between
numbers.sort()replaces the original array (which is not what we want), but
sorted(numbers)returns the sorted array. Learned something new there.
But is my solution a better solution? At first glance it isn't (lots more code to do something that a simple one-liner of Python handles with ease). Python's
sorted()uses TimSort which is O(n) at best and O(n log n) at the average and worst cases. My code takes two passes at the array which is O(n+n) which reduces down to O(n) (if I'm remembering that right).
So my code (inelegant as it is) might be a better solution for larger sets of unordered data. Huh.
What's the lesson here? I'm not entirely sure. Katas are interesting problems and there's a wide variety of solutions on the site for CodeWars. To he honest I thought I had failed when I saw the short, Pythonic solution. But that's the real beauty of learning to code: sometimes the elegant solution isn't the best solution, and sometimes the ham-fisted solution might not be so bad after all.
But the most important lesson of all is that even programmers who think they know what they're doing need to practice and keep learning.
Open Metalcast Special Episode: Club Metal #17
2016-10-26T12:00:05Z via Spigot To: Public(http://feedproxy.google.com/~r/OpenMetalcast/~3/6wyW0Sh2S-8/)
All Systems Go. Punch It!
- (00:12) Sick Nation TV by The Derision Cult from Born Into This (BY-NC-ND)
- (05:24) Ms. Hearty by ctrlBrain from Don’t Press Any Key. Use CTRL (BY-NC-SA)
- (08:04) Lost Generation by Freaky Mind from Crawl EP (BY-NC-ND)
- (12:25) Deus Ex Machina by Barnum from Devices (BY)
- (16:41) Divided Bliss by Neurotech from In Remission (BY-SA)
- (21:27) Regret Your Past And You Reject Your Self by reakt[ion] from We Are The Cause Of Our Own Despair (BY-NC-SA)
- (25:28) Land Of Desperate by [Sin.Thetic Squad] from Synthematika Four (BY-NC-ND)
- (30:27) Berlin by The Stroj from Metafonik (BY-NC-SA)
- (34:22) Daniel Neun – Mein Kreatives Manifest (Wacht auf) by Daniel Neun from Mein Kreatives Manifest (Wacht auf) (BY-ND)
- (39:02) Hands of God by Pain Factor from 8 Seconds (BY-NC-SA)
- (43:20) Area S’Minty One by We Be Subarashii from S’Mint: The Hentai Soundtrack (BY-NC-ND)
- (46:47) Moonlight Sonata by cYsmix from Escapism (BY-NC-ND)
Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or reshare this episode with your friends. Whatever you can do to help these bands keep making music, please do it!