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

Thursday, October 26, 2017

Tail Recursion considered harmful?

Some time back, someone told me that tail recursion is a lot like using a 'goto' this makes a lot of sense when you think about it. Tail recursion is an optimization that can happen when a function is calling itself as and returning the result as it's return. This allows the system to skip creating a new frame on the stack and makes life a little easier when fiddling with limited stack while doing embedded work.

An example might help:


So the code compiles and both do what it looks like they do. What's the big deal? And isn't 'goto' bad?  Everyone knows it right? What about that famous paper and everything.  It sure looks like recursion is just a fancy way to do a goto.

Lets dig into it a little:

First we should look at the paper... more than just the title of course but first we can focus on the title.  Kind of an interesting thing happened with the title.  The writer of the paper did not chose it the editor of the publishing journal did. Turns out the original title was "A case against the goto statement."

To the editor, this title was not quite right so he changed it to: "Go To Statement Considered Harmful." Sounds like clickbait to me. Oh, wait, it is. Turns out that way before 'clickbait' was a thing people had to sell the news (that is convince people to part with hard earned money for a physical paper, how quaint.)

According to my hastily googled up source; 1949 gave us this: "Rent Control Controversy / Enacting Now of Hasty Legislation Considered Harmful" sounds exciting right? That is from the national news.  It looks like the "Go To" title started a bit of a theme in CS articles: "Global variables considered harmful" and "The letter O considered harmful."

Global variables I can see, and wish that the message got out more on that, but really, the letter O? (Let me tell you it was a real problem, 0 and O didn't always look so different. In fact my typewriter doesn't even have a zero, gotta use the O to make a zero so yeah the problem is real.  See also l and 1 bet you have to squint to figure out which is 'ell' and which is 'one', 1 would tell you but 1 already forgot. (Are we sure computers use Ones and Zeros or do they use Ohs and Ells?))

If Dijkstra's title is where you stopped reading, you better try again... wait if you stopped at Dijkstra's title how did you get this far in this silly little blog post?  Doesn't matter!  Go read the rest of Dijkstra's article it is only a few pages:

https://www.cs.utexas.edu/users/EWD/ewd02xx/EWD215.PDF

Hmm, interesting.  That was published in 1968 in case you missed that detail.  They sure knew a lot back then. 

What I got from it is the article is that Goto causes serious issues with being able to tell how we got to where we are in a program. We call a stack trace now but only because we can walk the stack and know there wasn't any funny business. 

My little trick above is a bit of an illusion.  When you start allowing stuff like that people become a little immune to goto and will let it slip in other places, then pandemonium.

I was wondering what it would be like if the paper had retained it's original title. Would it have gained traction and would goto have been effectively banished as it is today? We may never know unless we were able to shift into the parallel universe where it was not banned.

Well, I traveled to that parallel universe.  There are companies that run custom home grown software written in BASIC.  Yes, that BASIC:

10 print "hello world"
20 goto 10

Yes, THAT BASIC.  I took on some work there and let me tell you it sure was interesting.  On one hand BASIC grew in the last many years since I learned it first and the flavor they are using has some features that effectively allow you to not use that basic. The client didn't get the message.  So yes, if the title had remained "A case against the goto statement.", we might all have been doomed to live in this weird parallel universe.

Who was the masked stranger that saved us all from certain doom? No mask and not a stranger it is Niklaus Wirth. (Europeans call him by name, Americans by value (his joke, not mine))

If you have not heard of him, please look him up.  He was instrumental in creating Pascal, Modula, Oberon programming languages.  Also EBNF can be traced back to him along with "Railroad Diagrams" (aka Syntax Diagrams)



Is Goto harmful? 

Maybe, maybe not. Did Dijkstra formulate a case against it, yes I think definitely.  Goto is going to be there at a low level but hidden away by tools of a more civilised age.

Is Tail Recursion harmful?

I think that is the wrong question.  I think the real question is: Is Tail Recursion the same as using a Goto?  Which I think the answer is no. Earlier today I thought maybe they were the same, after thinking and reading Dijkstra's article again which calls recursion in place of goto I am more convinced that goto can go.

Gotos replacing tail recursion are a gateway to mass hysteria. Gotos everywhere, jumping into the middle of a function with no way to know how you got there or where you came from.  Sounds like I am exaggerating, maybe I am, but not by much (been there and done that it's not pretty.)


Links to more on this:
https://en.wikipedia.org/wiki/Considered_harmful
https://en.wikipedia.org/wiki/Niklaus_Wirth
https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form
https://en.wikipedia.org/wiki/Syntax_diagram


What I find most interesting about this is the link between Dijkstra and Wirth, not something I usually think about. Nobody works in a vacuum and this is one instance that highlights the collaboration in an interesting way. 

It really is fun looking into some of the history behind what we do. With the history so recent I wonder why it is not purposefully studied more.



One last thing:

I had trouble deciding on the title for this the alternate is

"Considered Harmful" Considered Harmful  ... see what I did there?  A little recursion in the title.  Let me know in the comments which title you would have picked.


You can also read about this here: Tail Recursion considered harmful?

Wednesday, January 22, 2014

GR Testers lightning talk notes


Notes from my GR Testers lightning talk:

Tuckman's stages of group development.

- Form
- The team forms and comes together initially
- Initial period of politeness while forming
- "Honeymoon" period
- Storm
- Personalities come out
- Conflict arise over differing ideals
- Roles within the teams are being sorted out
- Norm
- A mutual plan converges and forms
- Relaxing of individual ideals

- Perform
- Able to get a job done smoothly and efficiently
- Communication barriers a reduced

- Stages
- Not all teams get to each step
- Sometimes there is reversion to earlier stages
- Later an "Adjourning" stage was added, but it does not rhyme so we don't say it.
- Team manager role adjusts greatly through the stages of development
- One of the common by-products is one of the team members is ready to become a team manager the team and the old manager will restart the process with a new team. Some managers fear this, but it is a natural and key part of creating high performing teams.

- Links:
- http://www.armyg1.army.mil/eo/docs/group_dev_tng.pdf
- http://en.wikipedia.org/wiki/Tuckman's_stages_of_group_development
- http://changingminds.org/explanations/groups/form_storm_norm_perform.htm
- http://www.myteamtype.com/uncategorized/form-storm-norm-the-5-stages-of-group-development/
- http://www.businessballs.com/tuckmanformingstormingnormingperforming.htm


Friday, October 25, 2013

Code and Coffee in Grand Rapids, Michigan

Coming soon to Grand Rapids: "Code & Coffee"

What is it?  Just something fun to do in the morning before real work kicks in. Get together and write some code, pair up, or just chat and solve problems.  For more information see: http://codeandcoffee.info/


The first round of Code & Coffee will be on Thursday October 31, 2103 at 7:00 am at "Tim Hortons" on Fulton.

Tim Hortons900 Fulton St, West
Grand Rapids, MI 49504
Directions

Hope to see you there.