Friday, August 6, 2021

Code & Coffee recap from 8/6/2021

 Topic: Conway’s Game of Life Challenge

  • Keeping up with tech
    • is important
    • or tech will leave you
  • Programming is hard: Copy all the elements of an array
    • for (m=0; m < len; m++) {
      • for (n=0; n < len; ++n) {
    • will it work?
      • no.
      • BOO!
    • This was an example problem and fragment of one person’s solution
    • This was a rough conversation.
    • Sometimes it takes a bit for things to click, sometimes they don’t
    • These conversations should be handled gracefully with an eye towards everyone’s future.
  • Some people are more wired for programming
  • Missed a lot of stuff about containers and networking and latency
    • And I was driving Sam so I missed taking notes
    • But it was good stuff
  • Bruce was talking about Native Spring
    • Sounds pretty cool, lots of potential
    • Make sure you have tests it sounds like there is some tree shaking going on during the running of the tests and if you don’t use a class in a test it might not notice that you need things compiled in to work.
  • Talked about the intersection of computerized processes and how they interact with the real world.
    • Do you know what the price is.  Really?
  • Introduced the “Conway’s Game of Life” challenge

Thursday, August 5, 2021

Code & Coffee recap from 7/30/2021

 Topic: "What are you reading"  60 second review and bring links to share if you are able.

This week we talked about what we are reading or looking forward to reading soon.  I find this to be an expensive topic as it tends to add more to my bookshelf.  Good discussion and lots of variety.



Thomas:

  • Segueing into management-is books:
    • Drive by Dan Pink
      • “this could be four blog posts and two ted talks and were done ;-)”
      • But it is still very much worth the read
    • Traction
      • EOS 
    • Effective Java
      • 90 rules, did one rule per day
    • Site Reliability Engineering
    • Next up
      • Head First Design Patterns

Carlus:

Hoppe:

Does this look interesting to you?  Let me know in the comments and I will get you invited to the slack channel where we organize the group.

Monday, July 26, 2021


Notes for Code & Coffee on 7/23/2021


Topic for 7/23: POP QUIZ:  Name a few code smells

  • Identified smells:
    • Player 1 - (anonymized players in case they prefer it that way)
      • Overused singleton
      • Overly complex test code (to get 100% coverage)
        • test private ctor throws exception (Bruce’s example)
      • Side effects
      • Pushing to a dev branch that hasn’t been green in three months
        • Broken builds
        • See also disabled tests
    • Player 2
      • Lack of type safe code in Java
        • extra tests required to assert types
      • Git commit messages that just tell exactly what was done
        • maybe useful maybe not
        • “Undoing last commit”
        • For better commits try:
        • Make it easy to make the change (this may be hard) then make the easy change (Kent Beck)
    • Player 3
      • Shotgun surgery
        • Making one change causes need to change in other places
      • Feature envy
        • Got a function doing work and needs or over uses collaborators
      • Long methods
      • Badly named variables
    • Player 4
      • Inconsistent IDE linting settings.
  • What to do about code smells
    • “When I was at x-company that was our job”
      • 2 million line code base
      • 30% dead code
      • 20% duplicate code
        • Copy/Paste coding
        • Aggressively adding huge amounts of dead code
      • Removed dead code and worthless comments
        • 5000 loc -> 400 loc (extreme case)
        • Nothing makes me happier than deleting code
    • Eclipse and Intellij
      • if statements that explicitly compare against true or false.
        • little t true and big true and other notes I missed
      • Do some uncomfortable low risk cleanups
  • Links:


 

Thursday, July 30, 2020

Diode questions on the Amateur Extra exam

There was a question about diodes on the Amateur Extra exam and I wrote some notes, here they are for later reference in case I need them. 

 Here is a link to the question pool home which will give an idea of what to look into: http://www.ncvec.org/page.php?id=356 

Near the bottom of the page there is a link to diagrams: http://www.ncvec.org/downloads/2020ExtraClassPoolDiagrams.pdf 


 It looks like section E6B is the diode section but look at the other places that mention diodes too as that will show you other things you may be interested in. For instance there is a diode question in E6A that would be good to understand. This is only a start, the next step is to figure out the things that are unfamiliar, so look up the different types of diodes like Zener, Schottky, PIN, LED, sheesh there are a lot, this seems like a good start: 

 Check out the diagrams and see if you can identify all the diode symbols in Figure E6-2, then figure out what the application would be. 

 E6 is the circuit components section, good stuff to know for sure, but if it is a super rough section for you make sure to balance your study with the other sections where you are stronger and just give E6 your best shot. 

 Each section has an indication in the pool of how many questions will come from that section. E1A was my nemesis, memorizing the frequencies was just not working out... so I stopped worrying about it and figured out enough of them to get some right but even if I would have gotten everyone in that section wrong I would still be ok (and I have a handy chart to look them up for when I do need to know: http://www.arrl.org/graphical-frequency-allocations)

Thursday, October 31, 2019

Perl musings

I needed to modify a pdf the other day, the first and last pages needed to be removed.

So I did what anyone would do, I made a Perl program to do it for me.
Then I was so happy tweeted about it.



Olivier Mengué asked what module was used for this. "PDF::API2" but just telling what module seems too easy so I will show you.

First a little confession I didn't write the code from scratch in just a minute, I took an existing program I had that combines two pdf files into one.

This program has some issues, the filenames are hard coded and I really don't care for the indexed for loop, but it works great and fills its need well. Here it is for the curious:


It was almost right to do the trimming so I jiggled things around a little and came up with this:


That is slightly better than the original, couldn't resist just a little clean up. But can it be better?

After a little more rework:


It is now more generic, it takes arguments from the command line for file names. The double loop was cleaned up since it will only process a single set of files at a time. The range operator replaces the indexed for loop. Finally the subroutine was inlined it wasn't adding much anymore so I dropped it.

After I posted the tweet Perl came up as being hard to read, I am interested to know what you think. This is just a short program but it seems pretty readable to me. (the last one is anyway) Certainly not all of my code comes out this clean but not all is going to be maintained either. What do you think?


Quick note on Perl modules for working with pdf files: I used "PDF::API2" for this task where I am manipulating full pages, either putting them together or taking pages out. When I am creating pdfs (putting text and lines onto a page) I have been using "PDF::Create" also in the past I have been known to just write out postscript and send it through ps2pdf. Want samples? Just ask and I will post a few.

Wednesday, October 3, 2018

Code & Coffee for October 3, 2018

Here is what you missed:

What is a `trie` and the genesis of this insomnia driven tweet: https://twitter.com/Hopasaurus/status/1047363507736498176
A lot more about `tries`  pretty sure Othelle was thinking I fell off the deep end.

A review of linked list traversal.

A potential match opportunity for a searching developer and an empty position (I really hope there is more to talk about on this front soon)

We also talked about
Spring boot:
http://spring.io/projects/spring-boot
https://spring.io/guides/gs/spring-boot/

Programming interviews, specifically “Programming Interviews Exposed”:
http://www.wrox.com/WileyCDA/WroxTitle/Programming-Interviews-Exposed-Secrets-to-Landing-Your-Next-Job-2nd-Edition.productCd-047012167X.html

$20-ish on Amazon: https://www.amazon.com/Programming-Interviews-Exposed-Through-Interview/dp/111941847X/ref=sr_1_2?ie=UTF8&qid=1538572735&sr=8-2&keywords=programming+interviews+exposed

The Cormen “Introduction to Algorithms” book:
https://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844/ref=sr_1_3?ie=UTF8&qid=1538572820&sr=8-3&keywords=algorithms
I don't have this one yet, but do have the Sedgewick and Skiena books and we compared and contrasted those.

On the topic of algorithms, this is on my reading list: http://algorithmstoliveby.com/  it looks really interesting, and looks like does an interesting job of drawing parallels between algorithms and real life experiences.  If you decide to check it out, please let me know what you think of it.

Up next week:
I am developing some sorting games that we can try out, would be interesting to get some feedback to see if they seem useful and warrant further development.
Perhaps a presentation on linked list traversal?
Also open to suggestions

Wednesday, September 19, 2018

Code and Coffee September 19, 2018

Here in Grand Rapids a few of us regularly get together over coffee and talk about code.

 Here is a report that I sent back to our slack group to tell about what we did and I thought it might be good to share it here so I can point people somewhere when they ask what it is about:

 Code & Coffee was pretty epic this morning. I talked so much it took nearly three hours to finish my sandwich. The theme of today turned out to be Algorithms. We started talking about Codepen.io, and ACE editor which somehow go onto the topic of algorithms which it turns out we have both been brushing up on in the last few weeks.

We did light coverage a couple of sorting algorithms insertion and selection sorts) going through my notes and a run through of each on some sample data. Talked about the runtime ( O(n^2) ) then we talked about other sorting including 3 way quick sort which can get to linearithmic time with certain (likely) key distributions. (Also quick sort works well with modern caching architectures which is a free bonus performance boost)

 Then we wandered off into linked lists and doubly linked lists, heaps and binary search trees. Finishing up with finding the middle of a linked list in one pass. All in all it was a good discussion @Othelle allowed me to practice talking about the things made notes on and hopefully it was at least entertaining for him if not educational too.

 Links: https://codepen.io/
https://ace.c9.io/
http://www.algorist.com/
https://algs4.cs.princeton.edu/home/

Somewhere along the line we talked about Conway’s Game of Life
here are two implementations I did (one only gets partial credit: https://github.com/Hopasaurus/GameOfLife  (in C# partially done, check the commits for the interesting bit of this)
https://www.youtube.com/watch?v=iT7b59CmUjk  (in C for Arduino, code on request if I can find it back)


Also my (one) post for last year was a somewhat related topic: http://blog.hopasaurus.com/2017/10/tail-recursion-considered-harmful.html