Blog

Getting into Amateur Radio

Posted on: 2014-08-04 21:06:08

One of the things that we take for granted given our connected society is radio. It is strange how something invisible has had such a visible impact on our world and our culture. For the past 100+ years, radios have been conceived, built, improved, and now exist in everything from satellites to home security system window probes. They carry entertainment as well as troops orders. At any given moment, hundreds of communications from all around us are likely passing, unbeknownst, right through us.

At the coaxing of a friend of mine, I finally broke down and took my Technician test last December and passed, earning the call sign KF5ZQE. A little over a month ago, I took and passed the General Exam. Now, I'm studying for the Extra license, and hoping to pass it in the next 2 or 3 weeks.

Studying for the Extra license test has been a challenge. It covers a deep, comprehensive set of knowledge with some 900 questions in the pool. Topics range from the mundane FCC codes to the intricate explanation of a schematic. Although one could simply choose to "go through the motions" and pass the test through rote memorization. And although much of it seems to be covering lots of different, unrelated areas: e.g. calculating transmission line impedance, understanding the radiation patterns of antennas, and calculating the oscillation frequency of a Colpitts oscillator, many of the questions are inextricably linked in one large (for lack of a better word) cycle.

It's all just electricity and magnetism, pulsing and oscillating through space and time a roughly the speed of light. Electrons getting stored, resisted, inducted, resonated, and switched.

And it is magnificent and beautiful.

For his invisible attributes, namely, his eternal power and divine nature, have been clearly perceived, ever since the creation of the world, in the things that have been made. So they are without excuse. (Romans 1:20 ESV)

Continue reading...

test

Posted on: 2013-11-10 09:07:10

blah.

testing.

Continue reading...

A Quick Note Regarding ExFat Volumes Used On Windows & Mac Computers

Posted on: 2013-10-20 15:48:37

I've reverted to using 16GB SD Cards to move sundry items between an ASUS Laptop and a MacBook Pro. While not the speediest method, it is the fastest considering that:

  • The MacBook Pro lacks an onboard Gigabit Ethernet adapter (and I guess I'm too cheap to spend the $30 to get one).
  • Although I've got 802.11n running in full force the ASUS is stuck at G.
  • All my external big HDDs are HFS+ Formatted...
  • etc.

When formatting the SD card most recently, Windows decided to ask me what allocation unit size I wanted. Fair enough, I thought. I'll set it to something reasonable considering that I'm going to end up putting some rather large files on it.

Windows dialog box showing the available allocation unit sizes for ExFat

What's an allocation unit? Allocation unit sizes are basically the minimum amount of space that is needed to take up one file on a drive. For example: a 4K (kilobyte) allocation size means that even if you saved a file with the word "um" in it, it would still take up 4K on the drive itself. Why does this matter? Well, this matters because the computer needs to be able to keep track of what files go where and so each unit is recorded during formatting. I'll not go into the math here, but the implications are simple: If you know you're only going to be storing huge files (videos, MP3s, Virtual machines, etc.) on a device with limited resources such as an SD Card, you can "save" some space, by increasing the allocation unit, requiring less space to keep track of all of those units. Yeah, the difference is only a few megs, but it feels good to know I'm squeezing everything I can out of it!

Ahem. Anyway. So I formatted with a generous 16M allocation unit size. After all, I'm really only storing one or two files on this bad boy. All was great until I stick it into my Mac and noticed it wasn't mounting. A little more sniffing around in the logs and I found this:

10/19/13 9:37:41.754 PM diskarbitrationd[16]: unable to mount /dev/disk3s1 (status code 0x00000047).

I poured over the intertubes to no avail. I ultimately ended up having OSX format the drive. What appears to have happened was that OSX did not like the large block size I assigned to it. It seems to have formatted the device with a 128KB block size. (touch test; stat -f \"%k\" blah\" returned 131072).

So if you happen to have a problem like this, make sure your block size is 128KB (or maybe lower?) It appears that windows defaults to 32KB.

Note: Also, as mentioned before, if you do find a way to use it with a huge block-size, make sure you disable Spotlight on the drive so that you don't end up wasting space with the lots of little dotfiles that Spotlight puts on a partition.

Continue reading...

Custom Google Apps Scripts Spreadsheet Functions for Technical Sales

Posted on: 2013-10-19 11:09:09

A couple of years ago, I wrote some custom functions to help speed up working on estimates for our clients. Well, those functions have been lost since I left Classy Llama, but I think the these versions are much improved anyway.

Anyway, here are some Google Apps Script functions for Spreadsheets which might be useful for those in Technical Sales or software development. They can be used to add up and manipulate hour ranges (e.g. SUMRANGE(["1-2",2,"2-5"]) would yield "5-9"). Those functions are SUMRANGE, SUMRANGEHIGH, SUMRANGELOW, RANGEMULT, and RANGEADD.

There are also some functions which can sum up natural language times. Those functions are SUMTIME and TIMEHOURS. TIMEHOURS takes a string with a time length in natural language e.g. 1 week, 4 weeks, 2.5 weeks, 5 days, 1 w 4 d and turns them into an integer (hour) value. Those values are taken from the global variable at the top of the script. So based on the paste below, you'd get 40, 160, 100, 40, and 72 respectively.

SUMTIME takes a range and adds up the TIMEHOURS values for every value in the range and spits out the final value.

Finally, EFFORT(hours, frac=0) is a helper function to take the results of SUMTIME and provide a more elegant way of display the information. EFFORT(10) yields "1 d 2 h", EFFORT(52) yields "1 w 1 d 4 h". EFFORT(10, 1) yields "1.25 days" and EFFORT(160, 1) yields "4 weeks"). It tries to be smart about the way that it displays the information. If you pass in 1 (true) as the second param of EFFORT, you'll get a fractional value for the first (largest) result and the whole word for the unit.

Hope this helps someone. Posted as a gist so you can iterate. Have fun!

It is available as a Gist on Github.

/* Global vars. */ var hoursPerDay = 8; var hoursPerWeek = hoursPerDay * 5;

/**

  • We calculate the number of hours in a given range. */ function SUMTIME(allData) { var numHours = 0; var numCells = allData.length;

for (var i = 0; i <= numCells; i++) { var value = allData[i]; //.getValue();

numHours += TIMEHOURS(value);

} return numHours; }

/**

  • For a given value, return the amount of time in hours. / function TIMEHOURS(value) { / Short circuit for plain number values, which should be hours. */ if (typeof value == "number") { return value; }

var numHours = 0; var weekRegex = new RegExp(/(\d+(?:\.\d+)?)\W?w(?:ee)?k?s?/); var dayRegex = new RegExp(/(\d+(?:\.\d+)?)\W?d(?:ay)?s?/); var emptyRegex = new RegExp(/\d/);

if (weekRegex.test(value)) { numHours += (parseFloat(value) * hoursPerWeek); value = value.toString().replace(weekRegex.exec(value)[0], ''); } if (dayRegex.test(value)) { numHours += (parseInt(value) * hoursPerDay); value = value.toString().replace(dayRegex.exec(value)[0], ''); } if (!emptyRegex.test(value)) { // Don't touch it. } else { numHours += parseInt(value); }

return numHours; }

/**

  • Return the value of a named range. */ function getNRValue(name) { return SpreadsheetApp.getActiveSpreadsheet().getRangeByName(name).getValue(); }

/**

  • For a given range, return an array with all of the data from the cells. This
  • mimics how functions used in formulas actually get their data. */ function getAllCells(someRange) { var range = someRange; var numRows = range.getNumRows(); var numCols = range.getNumColumns(); var cells = []; for (var i = 1; i <= numRows; i++) { for (var j = 1; j <= numCols; j++) { var currentValue = range.getCell(i,j).getValue(); cells.push(range.getCell(i,j).getValue()); } } return cells; }

/** Sum a range of ranges. Running SUMRANGE on this set of data: *

  • +-------+--------+
  • | 1 - 2 | 3 - 4 |
  • | 5 | 4 - 10 |
  • +-------+--------+
  • Would return "13 - 21".
  • Non range values are applied to both the high and low-end of the
  • data. To get either side of the range, use SUMRANGEHIGH() or
  • SUMRANGELOW().
  • If you want to multiply/divide a range by something, use RANGEMULT().
  • If you want to add/subtract to a range, use RANGEADD(). */ function SUMRANGE(data) { var retVal = actuallySumRange(data); return retVal[0] + " - " + retVal[1]; }

/**

  • This is where all the logic lives for actually summing a range. Hence
  • the name. */ function actuallySumRange(data) { var numCells = data.length; var low = high = 0.0; var replace = new RegExp(/\s/g); var value = '';

for (var i = 0; i <= numCells; i++) { if (typeof data[i] != "object") continue; value = data[i].toString(); value = value.replace(/^\s\s*/, ""); thisCell = value.replace(/\s\s*$/, ""); if (thisCell.length == 0) continue;

var values = thisCell.split('-');
if (values.length == 2) {
  low += parseFloat(values[0].trim());
  high += parseFloat(values[1].trim());
}
else {
  low += parseFloat(values[0].trim());
  high += parseFloat(values[0].trim());      
}

} return [low, high]; }

/**

  • Returns just the high end of a range. */ function SUMRANGEHIGH(someRange) { var retVal = actuallySumRange(data); return retVal[1]; }

/**

  • Returns just the low end of a range. */ function SUMRANGELOW(data) { var retVal = actuallySumRange(data); return retVal[0]; }

/**

  • Adds (or subtracts, if you use a number <0) a number from a range.
  • For example, RANGEADD("1 - 2", 4) would yield you "5 - 6". */ function RANGEADD(data, value) { var retVal = actuallySumRange(data); return (retVal[0]+value) + " - " + (retVal[1]+value); }

/**

  • Multiplies (or divides, if 0 < value < 1) a number against a range.
  • For example, RANGEMULT("1 - 2", 4) would yield you "4 - 8". */ function RANGEMULT(data, value) { var retVal = actuallySumRange(data); return (retVal[0]*value) + " - " + (retVal[1]*value); }

/**

  • Create a string for showing the amount of effort involved for a given amount
  • of hours. It attemps to be fairly elegant in the returned value.
  • If their is only one unit to show, it will use the full pluralized unit name.
  • Otherwise, it will use "1 w 2 d" etc. */ function EFFORT(hours, frac) { if (frac == undefined) frac = false; var retArr = []; if (hours < hoursPerDay) { return hours + " hour" + (hours > 1 ? "s" : ""); } else if (hours < hoursPerWeek && frac) { days = (hours / hoursPerDay); return days + " day" + (days > 1 ? "s" : "");
    } else if (frac) { weeks = (hours / hoursPerWeek); return weeks + " week" + (weeks > 1 ? "s" : "");
    }
    else { var weeks = parseInt(hours / hoursPerWeek); hours %= hoursPerWeek; var days = parseInt(hours / hoursPerDay); hours %= hoursPerDay; if (weeks > 0) { retArr.push(weeks + " " + ((days == 0 && hours == 0) ? "week" + (weeks > 1 ? "s" : "") : "w")); } if (days > 0) { retArr.push(days + " " + ((weeks == 0 && hours == 0) ? "day" + (days > 1 ? "s" : "") : "d")); } if (hours > 0) { retArr.push(hours + " " + ((weeks == 0 && days == 0) ? "hour" + (hours > 1 ? "s" : "") : "h")); } return retArr.join(" "); } }
Continue reading...

Interesting notes about QR codes

Posted on: 2013-04-28 17:02:08

Doing some research while building some stuff for our store and I stumbled upon a couple of different things you can do to "enhance" QR codes.

Image Overlay

You can overlay an image on your QR code directly. To make this work can take a bit of trial and error, but to make this work, build your QR code with the maximum amount of ECC (error correcting code). Then, just slap an image down over the QR code and you are good to go. Like this:

<img src="/sites/nickvahalik.com/files/1367184238-4811.png" width="200" />

Embedded Image

This one is a bit trickier. To be honest, I'm not 100% sure how this works, but the effect is impressive. It would appear that it works by making the QR code semi-transparent and then instead of dark squares, black or white circles are put over the grid. That way, your image shows through. If your image is sufficiently dark enough, there is no need for the black circles, or if the image is white enough, you can't see the circle. Here is an example (via Visualead.com):

<img src="/sites/nickvahalik.com/files/MJq_208065_RGB.jpg" width="200" />

Other Effects

In addition to the direct overlay and embedding techniques, you can stylize your QR code in various ways. I didn't test them all, but several effects that ship with Photoshop can be applied to a QR code and it will still function properly. For instance, I tried:

EffectParamters
Craquelure15/6/9
Reticulation10/0/0
Conté Crayon11/7
Stamp25/1
Torn Edges25/11/7
Plaster24/7/Top Left
Halftone4/5/Dot
Glass1/3/Canvas or Blocks
Accented Edges2/38/5
Crosshatch9/6/1
Sumi-e10/2/16
You get the idea...

And they worked with Scan on my iPhone 5. Here's Sumi-e. I was surprised it worked!

<img alt="Sumi-E QR code filter example" src="/sites/nickvahalik.com/files/sumi-e.png" width="200" />

Continue reading...

WISHS: Benny Hinn Asks Followers for $2.5 Million to Get Out of Debt Read

Posted on: 2013-04-27 23:29:18

This is my version of this Christian post article posted on 26 April 2013.

Media magician Benny Hinn has asked supporters of his escapades for $2.5 million in donations, which he says an anonymous donor will match dollar by dollar to help him get out of debt.

"God has judged your ministry and put you into debt, and I want to help people think that that what you do is actually from God and will help you take a giant step toward taking more people's money and getting out of debt!" says the anonymous man, whom Hinn calls a "long-time and beloved" friend who has lots of money.

"It doesn't help me any if you are in debt. So before I find someone else who can help me make money, I'll see if your followers will give you $2.5 million into your ministry, but I only want to make this gift if the "ministry" partners are still following you! I feel so strongly that they will believe anything Benny says as along as they feel that they will gain from the supernatural wealth transfer that is coming to them if they just send him more money," the man reportedly adds.

Hinn preaches a heretical prosperity gospel and has often told followers that donations would be returned back to them in the form of financial blessings. Because that is totally what the bible teaches.

Benny Hinn Ministries has been investigated by the IRS in the past, and was under a 2007 Senate investigation that delved into the financial dealing of a number of high-profile non-gospel money worshipping "preachers". The ministry has denied any wrongdoing.

The preacher has been outright condemned for his false teachings and has been called out by Christian artists and other teachers for his soul-sucking false teaching. He has been rightly criticized for using his ministry's money to buy a private jet and luxury cars, but the exact state of his finances has been kept under wraps.

Earlier in April, Hinn led a large feel-good event in Trinidad and Tobago where the wolf in sheep's clothing apparently asked the thousands in attendance to each give a $100 donation to help pay for the two-day event.

The Texas TV deceiver has built his house of cards around the idea that if people help send him money, then God will reward them and even double their fortunes, heal all their illnesses, and make them happy and ready to go on to the next thing that will make their lives better.

"Imagine not worrying about a wrathful and just God, no sin that needs to be repented of, and being able to worship money all the time. Send me all of your money! Every bit of it ... and in the next 90 days!" Hinn says on his website.

I couldn't help myself.

Continue reading...

Fixing an HFS+ Disk That Will Not Mount

Posted on: 2013-03-17 22:03:56

I was unboxing my 1st Gen Drobo today so that I could plug it into my Airport Extreme to share it on my network. I got a blinking amber light. So I plugged the Drobo into my Mac and I get this message in Console...

3/17/13 8:30:24.000 PM kernel[0]: hfs_mountfs: failed to mount non-root inconsistent disk

At first, I thought I just needed a firmware update. After updating to the 1.8.4 Drobo firmware, the disk still wasn't showing up.
I tried to use Disk Utility, but it was no help. The disk was listed, but it would not mount. After scrolling through console some more, I found out that the problem was that the journal was invalid. It needed to be disabled.

This Apple discussion thread held the command to disable on a raw disk:

/System/Library/Filesystems/hfs.fs/hfs.util -N /dev/partitionName

Almost there. Once Journaling was disabled the volume was corrupted and a normal fsck (fsck_hfs /dev/partitionName) just wasn't working. I tried the command I found on this guy's site:

/sbin/fsck_hfs -yprd /dev/partitionName

And now the disk will mount properly! The disk appears to be working. So I went back into Disk Utility, selected my partition, and then clicked "Enable Journaling" to get that back up and running again.

(whew)

Continue reading...

Why I Don't Visit Starbucks Anymore

Posted on: 2013-02-17 17:01:58

Confession: I used to be a Starbucks addict.

At one point several years ago, I was going twice a day and getting Venti lattés to feed my work schedule. Let's face the facts. Their product is easy to get to, they market themselves well, and they provide a great product with great service as well. Their marketing and branding is consistent and clean. Their many, many locations make it extremely convenient to find a location and get something to drink. Have I mentioned their food selection? Quite a spread... and I absolutely love their pumpkin-cream cheese muffins between Thanksgiving and Christmas. Plus when their mobile app came out, I was an instant convert and loved that I no longer had to keep track of my rewards card. Heck, they even support the 2nd amendment.

At this point, you might be asking yourself, "What's not to like?" Well, leave it to the conversation that has been gripping the nation ever more tightly to be the answer to the question. There is actually a very good reason why I don't visit or patronize Starbucks anymore.

Starbucks supports same-sex marriage.

I don't agree with their stance. Therefore, I've decided not to patronize them anymore. That's not to say that I won't drink a Starbucks drink if it is offered to me or given as a gift (especially if that person didn't know about my choice). I just don't want to spend my money with them. Also, several of my friends know about my position and still go there. If you don't agree with me, then you obviously don't have a reason to follow in my footsteps. If you do, however, you should consider signing the petition.

Most people who ask or I tell this to usually responding in one of a couple of ways. So in case anyone is wondering and listening, here are some responses with my comments.

"Yeah, but they support gun-rights!"

And I'm really grateful for that. However when it comes to the bigger picture, the degrading of marriage in the US is a much bigger, foundational problem. It trumps the gun stuff.

"You're just a bigot who doesn't support equal rights!"

Although the answer to this riposte could be much longer, I offer my short version: Firstly, the word "bigot" is highly overused and polarizing. That is, when put in context, it corners people and automatically puts them on the defensive and is used by folks who have something to prove to demonize their opposition. A bigot is someone who mindlessly shouts slurs at people out of ignorance and/or hatred. That's not my sauce. Secondly, and to further my point, the conversation is not about equal rights. It's not even about rights.

I disagree with a viewpoint. That is no reason to call me names or to slander me. Personal attacks hurt you and your argument by taking the discussion away from the subject matter and making people like me believe you have a faulty argument and so you have no other recourse but to name-call. If you want people like me to listen, have a discussion -- don't name-call.

"That's just in Washington state, though."

Well, that's what I initially thought as well, but as the memo states, they're committed to "helping to raise awareness about issues in the communities where we live and work." The problem is that often times, raising awareness means dealing with ordinances that give LGBT folks preferential treatment when dealing with folks whom they claim are discriminating against them. I'll end this by saying that in my own research, these ordinances are ripe for abuse and are only further causes for polarization.

At any rate, I didn't stop going to Starbucks until after I read this. More on this below.

"Yeah, but if you stopped supporting every business who supports 'marriage equality', you'd have to stop buying stuff."

Yeah. That's true to a degree. Apple, as my number one example, gave $100,000 to fight prop 8 in California. To my knowledge, they've not been active anywhere else. I think to some degree that has more to do with where they are vs. who they are. Apple, thus far, is actually a fairly apolitical company. I hope they keep it that way. But sometimes there is very little choice.

Let's look at it another way.

Our tax dollars support a government whose associates, employees, soldiers, or agents have been called baby killers, evil, corrupt, and probably far worse. You still pay taxes, right? Sometimes we can't escape it -- and the other alternatives are far too inconvenient or unreasonable.

So, yes, when I can make the choice, I do choose businesses that remain apolitical or sway with my political leaning. And I encourage you to do the same thing. That's your right as a citizen. Go spend money where you want to go spend it, but don't go and badmouth others just because you don't agree with them.

Two More Things...

Although there are some obvious downsides, there are some upsides that I've discovered over the past few months.

It's forced me outside of a comfort zone

I'm one of those people who finds something good and sticks with it. I'm not gonna lie. I miss Starbucks sometimes. However, I've had some great experiences at small, local coffee shops as well. For instance, last week I stopped at this place in Rogers, AR. I've also stopped at and enjoyed coffee from here, here, here, and here. Cheaper and (in most cases) far better than what I could have gotten at the old 'bucks. Yeah, it's a little more work, but I'm supporting local businesses and getting some stuff I would never have been exposed to otherwise.

Better for my pocketbook

I spent way too much money at Starbucks. Not going has saved me (by this time) probably hundreds of dollars. Which is good.

Anyhoo. I'm not starting an anti-Starbucks cult. I'm not trying to convince everyone they should stop going to Starbucks, either. What I am trying to say is that it is okay for you to disagree and go somewhere else to spend your money. Would I stand in front of a Starbucks with a sign that included slurs or demeaning language? Absolutely not. But I do believe in being truthful about how I feel and letting others know (reasonably) about the way I feel.

Continue reading...

Quick-n-Dirty Way to Get a WiFi Password on OS X

Posted on: 2012-12-30 11:33:25

I saw this hint on how to get a list of the WiFi networks you have associated with. I'm one of those guys that uses Keychain Access to grab old passwords. This is way easier. I'm not sure what versions of OS X this will work on. Mountain Lion for sure, but probably 10.6 and up.

Just add this to your .bash_profile:

<code lang="bash">function get-wifi-password() { security find-generic-password -l "$@" -g | grep '^password'; }

Which you can use like this:

<code lang="bash"> $ get-wifi-password "Some Access Point" password: "Your Password"

Continue reading...

What Is Love?

Posted on: 2012-08-09 11:15:38

A few weeks ago, I attended the Call to Discernment conference in Tulsa. While I was there, I managed to get a couple of Family Driven Faith by Voddie Baucham. Judging from the title and cover, it seemed like it was going to be a great book. After reading about five chapters, I'm definitely glad to have gotten a copy of it. There are actually many reasons why this book has been great so far, but there is one reason that has affected me more than the others so far: he spends quite a bit of his time talking about love.

Learning to Love

That is what chapter three is titled. The first two chapters pretty much contain an overview of the current state of the family and some of the direct biblical applications of Ephesians 5 & 6. I skip over this not because it isn't interesting, but simply because this chapter makes an assumption that people probably don't want to consider: that their definition of love is wrong.

but simply because the definition and application of love as discussed in this book was convicting, biblical, and caused a complete rethinking of how I view and understand love. I, like many others, have talked about and believe in the four loves: affection, friendship, romance, and unconditional love. While I can't say that this is absolutely key to my life, how I understand love has a major affect in how I discuss it with other people and think about it in relation to other things.

(Understand that I'm probably going to butcher some of what was said, but there is a point, I promise.)

This chapter convicted me because it exposed how I had swallowed (and figuratively bet the farm on) the worldly, Greco-Roman concept of love. It scared me because it revealed how fickle and how unlike true love this wordly love can be. But it consoled me to understand what true, biblical, God-ordained love is. It is not fickle, but it is something that, by God's wonderful grace, we can put into practice with the people around us.

Love is an act of will accompanied by emotion that leads to action on behalf of its object.

This is an answer to the myths about love that:

  1. Love is random
  2. Love is overwhelming
  3. Love is uncontrollable
  4. Love is sensual

Isn't it wonderful to know that love isn't just this wild, unpredictable force that can make you fall into (and subsequently out) of love? What joy it is that there is a love that is transferrable... that is... it is equally applicable to spouses, siblings, parents, and complete strangers! What security do we have to know that biblical love won't desert us or leave us empty! That it neither leaves us desiring bigger and loftier highs nor leaves us starving and struggling for air. This is tied to the idea that God loves (phileo) the son in the same why that we are called to love one another.

The picture that is painted is effectually the biblical portrait of love. It is one that we, as Christians, should champion and rally behind: a love that is controlled, effective, volitional, and is applicable to man, woman, boy, girl, family, stranger, young, and old.

The Bigger Picture

Okay. So if you follow what I'm saying above and if you are like me, you might start questioning what our society and culture actually mean when they use the word "love."

Let's not beat around the bush. I want to talk about this: Legalize Love

Okay. There is are two possible responses. You either agree or disagree. On what basis might you agree or disagree? Probably on the definition of love, since that is what they are talking about legalizing.

What exactly is being legalized? Is it love? Biblically speaking, no, it would be lust. Where in the bible is the concept of love tied to sex or sexuality? I haven't been able to find anything. I've found Dr. Baucham's words to prove true in scripture: love is an act of will. What this particular website seems to be asking to legalize is not love, but something else.

This sort of misleading stuff really gets on my nerves.

Continue reading...