Craig Maloney snapl@identi.ca

Just another Linux / Ubuntu / Python hacker. Host of http://openmetalcast.com and co-host of http://lococast.net

  • Open Metalcast Episode #161: Judicious Use of Headphones

    2017-09-12T16:01:16Z via Spigot To: Public

    (http://feedproxy.google.com/~r/OpenMetalcast/~3/ImEtXDKURiw/)

    This episode is a tribute to those little bits of plastic, metal, and silicone that help keep us sane during the day. This is also dedicated to the friends of the show that help keep it going via sending albums via the Bandcamp wishlist. Between headphones, friends, and music what more could one ask?

    We’ve got a great show to exercise your headphones, including tracks from Dropthehammer, Photonoid, anal botox, Odradek Room, MOTOR, Dendrites, Thunderhag, Inhaling the Plague, and Neverside. Plus it’s CC-licensed so you can exercise your friends headphones as well.

    Please support the bands in this show! Buy a T-Shirt, buy an album, or head to the shows. 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 craig@openmetalcast.com.

    Open Metalcast #161 (MP3)

    Open Metalcast #161 (OGG)

  • Open Metalcast Episode #160: Longer Brief Thoughts

    2017-08-29T16:00:52Z via Spigot To: Public

    (http://feedproxy.google.com/~r/OpenMetalcast/~3/vTf9aY9dy_k/)

    Sometimes short and sweet is the order of the day. Sometimes there’s more to be said.

    This episode is on the shorter-end of the spectrum but that doesn’t make it any less potent. Especially with bands like humanhostbody, Crowned In Flesh, Throne of Botis, Old Man Wizard, Neptuniam, Cyborg Octopus, Wombripper, and Noble Beast pushing the limits of awesome Creative Commons metal.

    Perhaps we should re-brand it as concentrated or ultra-strength?

    Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or do their laundry. 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 craig@openmetalcast.com.

    Open Metalcast #160 (MP3)

    Open Metalcast #160 (OGG)

  • [Blog] Interview Questions: Tell me about a project you are proud of and why?

    2017-08-23T19:00:42Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/QGZMJMeDwgk/)

    An interview question I've received a lot during my interviewing is "Tell me about a project you are proud of and why are you proud of it". It's one of those "think about your career and tell me what one project stood out for you, and why it stands out" questions that feels like it is a good measure of interview candidates.

    But one of the downsides is it's also a question that gets self-edited to the bits that I can show a potential employer.

    At my last job I created a sort of "stylesheet for Excel" using openpyxl. Unfortunately the only thing I can show you is a gist that I posted to the openpyxl mailing list. The maintainer of the project didn't know what to do with it (and frankly I'm not sure the problem translated outside of the project that I was working on) but it worked and helped me style some pretty hoary spreadsheet reports.

    But is that the project that I tell people about? Nope. Why? Because there isn't that much code there to show folks. And frankly it isn't an interesting story. "I made a configuration system to style Excel Spreadsheets so people could take these and pass along to our customers" isn't the sort of thing that excites people.

    So what story do I tell? I tell them about the time when I created some photobooth software for a friend's wedding. He was getting married and wanted some more features for his Raspberry Pi project. Unfortunately it was taking longer than he anticipated so I wrote a new photobooth for him in Pygame. You can take a look at the code right now (Pygame Photobooth) and see what I did. Why am I proud of it? Because I helped out a friend during his time of need and it was cool to see people playing with it. It's still in use today.

    That's a story! It has conflict! Drama! A climax! A happy ending! Exclamation points! And you can see the code!

    Is it the project I'm most proud of? Possibly. There's a few other projects that I've done over the years that I can't show people. Projects like the system that completely automated mailing surveys for a customer. Projects that rewrote a Visual Basic system that was never going to work as written (and re-wrote it for the web). Projects like the imagemap that showed rooms that needed service.

    But I can't show you the code that I wrote. You'll just have to take my word that they're awesome and made people happy. All of that code sits on disks behind firewalls; save for the little bit that I liberated on a mailing list.

    And that's why you get the project that did make people happy; the project that made a friend's wedding all the better. Did it save the company money? Who cares? Did it surprise and delight the customer? I'd like to think so. Did it arrive on-time and under-budget? Well, they used it for their wedding so you tell me.

    Questions like this favor people who can tell good stories about their projects. They also have a high bias towards projects where the person involved felt happiest while doing the project. They also tend to favor projects where the person can show you the code.

    What about the times when the developer was on a death-march and everything was going wrong for them? What about the projects where the customer said "that's nice" and when the developer left the project died (that was the Visual Basic project that I worked on). What about the times when the developer didn't listen to management and took advantage of a brief window where they re-wrote the whole system and put it up on the web (That Visual Basic project again).

    You're not going to get those stories out of an interview question like this. You're only going to get the highlight reel. And much like sports highlight reels you're going to get the stories that have the best visuals. You're going to get the ones that have the best stories to tell, with code that can be shared.

    What are some of the stories that you have about developing projects?

    Claes Wallin (韋嘉誠) likes this.

    Claes Wallin (韋嘉誠), Claes Wallin (韋嘉誠), Claes Wallin (韋嘉誠) shared this.

    I like your story about the photobooth software. I think it has aspects that can be discussed and further expanded during an interview that should get at things people are interested in.

    [I almost deleted what I wrote below because it reads negative. I don't mean to be negative. Try to read it with a matter-of-fact voice.]

    I'm in a similar boat to you. I can't show other people any of the projects I've ever worked on. On top of that, I struggle with "pride". It's not that I don't  "take pride" in my work, in that I try to achieve the highest quality possible. I do that. However, I am not proud of any of the things I've worked on. The resulting objects are not things that I think are valuable, so there's nothing there for me to be proud of. I created them (or helped create them). They exist. But that's it. Apparently other people have found the objects valuable, but I never have. It's difficult to find an exemplar using an emotion I am not experiencing.

    Anyway, when faced with a question like that, I have one particular professional experience that I can talk about in specific terms. It's not even a project. It's just an aspect of a project, but at least it is something I can talk about in detail with some enthusiasm that hopefully satisfies the interviewer.

    An aspect of this problem is that when I'm not working, I struggle to do things related to engineering and development. I tend to spend my time on family, friends, chores, and, if I have time left, other hobbies unrelated to my profession. If I don't do the "other hobbies", I tend towards feeling burned out. So there's very little spare bandwidth for developing a portfolio away from my professional work. (I know. I know! I'm just not passionate enough.) I use that very little spare bandwidth for staying abreast of the industry or learning things that interest me since I've never worked anyplace that wants to invest in my continuing education. However, that learning doesn't generally result in anything significant that I can show people unless it gets used... at work. And so it continues...

    Charles Stanhope at 2017-08-23T21:04:43Z

    Claes Wallin (韋嘉誠), Craig Maloney likes this.

  • [Blog] Facebook's React patent grant is disingenuous and harmful

    2017-08-20T19:41:30Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/vxZKCdS1ukM/)

    I had some word-spew on Twitter about Facebook and their React.JS patent grant and decided to put it into a blog post:

    Find it super interesting that the discussion about the React License has boiled down to resharing two Medium articles. The "Paper Tiger" and the "Startups should avoid React" articles. Depending on what you believe reflects which article gets reshared. Unfortunately I think both articles don't concentrate on the point of the patent exemption and why it's a real sticking point for developers and that's this: Facebook is trying to take their software and carve out a competitive edge in the software patent minefield. It's not that Facebook will steal your patents, or that Facebook will make you have to rewrite your software if they compete with you - It's that Facebook is taking a popular library / framework they wrote and are using it to deflect some of their legal pain. They're taking a nominally open source product of theirs and neutering patent lawsuits against Facebook (or at least diffusing them); giving folks pause about using their software patents because they could run afoul of a patent grant. I'm no fan of software patents (I think they're anathema to software development) but Facebook's Patent Grant does not solve the problem - it exacerbates the problems between intellectual property and intellectual freedom. It carves an exemption for Facebook alone. It's disingenuous of Facebook and creates a "I've got mine; sucks to be you" mentality that I find abhorrent in FL/OSS. This is not liberty.

    Charles Stanhope likes this.

  • [Blog] Raindrops puzzle on Exercism

    2017-08-15T17:00:35Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/NcyjG0KTcoc/)

    One of the puzzles on Exercism is the Raindrops Puzzle. In this puzzle you find the numbers that divide into the original number (aka: factors). An example of this is the number 28 where 28 can be divided by the following numbers: 1, 2, 4, 7, 14, 28. (Remember that 1 divides into all numbers, and all numbers are divisible by themselves).

    The challenge is to output one of the following:

    • If 3 is one of the numbers that are divisible by the original number then display "Pling"
    • If 5 is one of the numbers that are divisible by the original number then display "Plang"
    • If 7 is one of the numbers that are divisible by the original number then display "Plong"
    • If the number is not divisible by any of the above display the original number.

    So in the case of 4 we factor that (1, 2, 4) and see that 3, 5, or 7 are not in those factors and display 4. For a number like 5 we note that (1, 5) are its factors and since 5 is in that set of factors we display "Plang". In the 28 example above we note that 7 is one of the numbers, and display "Plong".

    Where it gets interesting is a number like 15. 15's factors are (1, 3, 5, 15). In this case we first check if the number 3 is one of the factors. 3 is present in the factors so we display "Pling". But note too that 5 is also one of the factors, so we also need to display "Plang". The correct output is "PlingPlang", and we display "PlingPlang" instead of the number 15.

    With that in mind I started to attack the problem. This problem was part of the Scheme track so I started thinking how I'd approach this.

    The first part was getting the factors out. That suggested "recursion" but my recursion is rusty. I knew that I could easily blow the stack with larger numbers so it would need to be tail-recursive. And that's about where my brain said "do you know how to write a tail-recursive routine because I sure don't?". So I checked Google and found a few examples (one of which lead me down figuring out how to use let to create a loop, so that was interesting).

    Just for grins I wrote an iterative version in Python:

    def factor(n):
        factors = []
        for i in range(1, n+1):
            if (n % i == 0):
                factors.append(i)
    
        return factors
    
    
    def main():
        print(factor(28))
        print(factor(34))
    
    
    if __name__ == "__main__":
        main()
    

    Hmm, maybe I don't need recursion after all. This seems to be quick and does the trick. But is that Scheme? Scheme tends to favor recursion over looping (in my experience) so I needed a different approach, and with code that I could ultimately understand.

    I found a Prime Decomposition in Scheme on Rosetta Code:

    (define (factor number)
    (define (*factor divisor number)
        (if (> divisor number)
            (list number)
            (if (= (modulo number divisor) 0)
                (cons divisor (*factor divisor (/ number divisor)))
                (*factor (+ divisor 1) number))))
    (*factor 2 number))
    
    (display (factor 28))
    (newline)
    

    Ah, that sort of does what I want. I played with it a bit and came up with my own factorization algorithm / program:

    (define (factor number)
    (define (*factor divisor number)
        (if (>= divisor number)
        (list number)
        (if (= (remainder number divisor) 0)
            (cons divisor (*factor (+ 1 divisor) number ))
            (*factor (+ divisor 1) number))))
    (*factor 1 number))
    
    (display (factor 28))
    (newline)
    

    They may look similar but the key difference is in the (cons divisor (*factor (+ 1 divisor) number )) line (and the (*factor 1 number) instead of 2 line). The original algorithm cut the space for searching in half (which is great if you're looking for primes). But in the case of 28 I wanted 2 * 14 = 28. I wanted 4 * 7 = 28 (7 being one of the factors that causes "Plong" to occur). Instead I got '(2 2 7 1) which sort-of-works, but isn't what I wanted. With the re-worked algorithm I got what I wanted:'(1 2 4 7 14 28).

    Next came learning how to append strings in Scheme. That wasn't nearly as difficult as I thought it would be ((set! outstring (string-append outstring "Foo")), but what was slightly non-obvious to me was determining if an element is in the list.

    Scheme has a function called memq which will find an element and return the rest of the list. So if I have a list '(1 2 3 4 5) and I want to see if 4 is in that list I can use (memq 4 '(1 2 3 4 5)) and get '(4 5) as the result. If I do the same for 6 ((memq 6 '(1 2 3 4 5))) I get back #f. In Scheme the presence of a list can be tested using if, so checking if we have a list or don't becomes (if (memq 3 factors) ...).

    Appending a string in

    Here's the completed code (and a link to comment on Exercism):

    (define-module (raindrops)
    #:export (convert))
    
    (define (factor number)
    (define (*factor divisor number)
        (if (>= divisor number)
        (list number)
        (if (= (remainder number divisor) 0)
            (cons divisor (*factor (+ 1 divisor) number ))
            (*factor (+ divisor 1) number))))
    (*factor 1 number))
    
    (define (convert number)
    (let ((outstring "")
            (factors (factor number)))
        (if (memq 3 factors)
        (set! outstring (string-append outstring "Pling")))
        (if (memq 5 factors)
        (set! outstring (string-append outstring "Plang")))
        (if (memq 7 factors)
        (set! outstring (string-append outstring "Plong")))
    
        (if (string=? outstring "")
        (number->string number)
        outstring
        )
        )
    )
    
  • Open Metalcast Instrumetalcast #011: Reflections

    2017-08-15T06:00:27Z via Spigot To: Public

    (http://feedproxy.google.com/~r/OpenMetalcast/~3/YsllLtld8So/)

    It’s been over a year since we brought out the last Instrumetalcast.

    Time to rectify that.

    Please support the bands in this show! Buy a T-Shirt, buy an album, or head to the shows. 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 craig@openmetalcast.com.

    Open Metalcast Instrumetalcast #011 (MP3)

    Open Metalcast Instrumetalcast #011 (OGG)

  • [Blog] 100 day challenge: Final results

    2017-08-12T14:00:22Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/7N1Fwsunruo/)

    In the spirit of the 100 day challenge I wrote a quick program to parse the tags of the 100day challenge and note which tags were most often used.

    #!/usr/bin/env python
    
    from collections import Counter
    
    
    def main():
    
        tag_counter = Counter()
    
        with open('100day_tags', 'rt') as infile:
            for line in infile.readlines():
                line = line.strip().lower()
                (filename, spacer, tag_string) = line.split(':')
                tags = [x.strip() for x in tag_string.split(',')]
    
                for tag in tags:
                    tag_counter[tag] += 1
    
        del tag_counter['a day in the life']
        del tag_counter['100day']
        for i in tag_counter.most_common():
            print("{tag}: {counter}".format(
                tag=i[0],
                counter=i[1]))
    
    
    if __name__ == '__main__':
        main()
    

    The tags are from a simple grep 100day *.md > ~/100day_tags command in my Pelican directory.

    programming: 39
    scheme: 29
    racket: 16
    javascript: 10
    python: 5
    godot: 3
    guile: 3
    pyohio: 2
    css: 2
    c: 1
    html: 1
    html5: 1
    

    It looks like Scheme / Racket were the ones that got the most attention. After that is JavaScript, then some Python and a few mentions of Godot.

    Not sure if this means anything in particular but it's interesting to me.

    Claes Wallin (韋嘉誠), Charles Stanhope likes this.

  • [Blog] Day 70ish/100: Fin?

    2017-08-11T22:00:19Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/1ap_O675peg/)

    Apparently this is the second time that I can't count, and have double-counted days.

    It's also another day where "life has become rather chaotic and programming was the last thing on my mind".

    So I'm thinking about calling this done for now. I'm not planning on abandoning daily programming for now. But putting it as part of the daily challenge? That's becoming a bit much.

    That and I'm feeling guilty about not blogging about other things that are happening.

    So, it's done for now. Won't say this is the last time this will happen, but frankly I think it's run its course.

    Claes Wallin (韋嘉誠) likes this.

    I hope doing this challenge did something for you.

    Reading about it did something for me! Thank you.

    Claes Wallin (韋嘉誠) at 2017-08-12T01:39:17Z

    Thank you for sharing how it went. You've helped motivate me to come up with ways I can pursue goals even amidst the usual hectic day-to-day.

    Charles Stanhope at 2017-08-12T15:20:52Z

    I'm heartened to hear that this was inspiring for folks. Looking forward to reading your results. :)

    Craig Maloney at 2017-08-12T15:25:17Z

  • [Blog] Day 69/100: More reading / more Exercism / Hacker Rank

    2017-08-11T21:00:20Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/ErSu3ytNdiU/)

    Worked a little on Exercism today. One of the problems I was working on required the use of factoring a number to find all of the divisors (eg: 4 can be divided by 4, 2, and 1). It's a recursive solution but I didn't know offhand how to write it in Scheme (shameface) and looked one up online. That got me down a rabbithole of trying to figure out what the solution I found was doing. That lead to trying to figure out how the debugger in Guile worked, which lead me to try the debugger in DrRacket instead (pro-tip: The IDE debugger in Racket is quite good.).

    I also played around a bit with HackerRank. Expect a blog post on why I think HackerRank has its heart in the right place but the implementation needs a lot of work.

    Claes Wallin (韋嘉誠) likes this.

  • [Blog] Day 68/100: Reading / Exercism

    2017-08-11T20:00:20Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/DzHix_IF5r8/)

    Did a quick play around with Exercism and some reading.

    Here's my solution for RNA Transcription in Python:

    def to_rna(dna):
        dna_rna_trans = {'G': 'C', 'C': 'G', 'T': 'A', 'A': 'U'}
        rna_strand = []
        dna_list = list(dna)
        for dna_nucleotide in dna_list:
            if dna_nucleotide not in dna_rna_trans:
                return ''
            else:
                rna_strand.append(dna_rna_trans[dna_nucleotide])
    
        return ''.join(rna_strand)
    
  • [Blog] Day 68/100: Off my game / Reading

    2017-08-08T04:00:19Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/ocpHTAga81w/)

    Today I was pretty well off my game. Did a lot of administrative work for MUG and what-not, but didn't get to doing much programming. Hoping to rectify this tomorrow (before the MUG meeting. :) )

    Did a little reading here and there. Did a little reading of the Guile Manual. Still love this manual.

  • [Blog] Day 67/100: ...

    2017-08-07T04:00:11Z via Spigot To: Public

  • [Blog] Day 66/100: Just some reading

    2017-08-06T04:00:10Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/kLQpqXLneWk/)

    Did some more reading, but not a whole lot else.

  • [Blog] Day 65/100: More Godot

    2017-08-05T03:00:09Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/q43vqZuh2ks/)

    Today I watched a few introductory videos to learn more about Godot. The more I look at this engine the more I'm falling in love with it. I can't wait to put together and release a game with it. Thinking about doing a Kaboom-style game with it.

  • [Blog] Day 64/100: Pangram

    2017-08-04T03:00:09Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/LPfTjQbS5O8/)

    Today I worked on the Pangram solution for Exercism. Didn't quite get an hour in programming today but close enough.

    Claes Wallin (韋嘉誠) likes this.

  • [Blog] Day 63/100: Off-by-one error?

    2017-08-03T05:00:05Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/Fn1UfRh8fjk/)

    I think I managed to have two day 59s. Not sure if this means something is screwed up but whatever. I'm willing to call it good if you are. ;)

    Today I worked on the Exercism problem called "Bob". This was a hard problem for me but I think I managed it well.

    Here's a link to my solution to the Bob problem.

  • [Blog] Day 62/100: Working on other things

    2017-08-02T03:10:12Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/Ltqvi7AfoFg/)

    Today I had a few other things to work on, so I didn't get to programming. More to come.

  • [Blog] Day 61/100: Getting back into the swing

    2017-08-01T15:00:12Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/nCcOYxFpGjA/)

    Day 61 was dedicated to catching up from the weekend. Now I need to get back into the swing of coding again. PyOhio is a great motivator to get the programming juices flowing again.

  • [Blog] Day 60/100: Decompression

    2017-08-01T14:00:06Z via Spigot To: Public

    (http://feedproxy.google.com/~r/CraigMaloney/~3/0qPhWNwgRh8/)

    Day 60 was traveling and decompression.

  • Open Metalcast Episode #159: Metal Journeys

    2017-08-01T04:00:05Z via Spigot To: Public

    (http://feedproxy.google.com/~r/OpenMetalcast/~3/8GqFedPuqrE/)

    Sometimes i get lost in the music. Sometimes I involuntarily stop what I’m doing and just listen to the music. In this episode we have plenty of metal music to get lost in. We have tracks by Demimonde, Hekatombe, Seversun, Sarin, Epra Astera, Akaitsuki, Coma., and Lèpoka. Caution: Use caution while listening to this music. Might cause you to lose track of time, miss your exit, or God-knows-what. But you have our guarantee that this is the finest Creative Commons Metal you’ll hear this episode.

    Please support the bands in this show! Buy a T-Shirt, buy an album, head to the shows, or give them a ride to their next gig. 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 craig@openmetalcast.com.

    Open Metalcast #159 (MP3)

    Open Metalcast #159 (OGG)