Blog

Mission Trip!

Posted on: 2010-06-06 08:17:50

It has been one of my dreams for the longest time to go on a mission trip to another country. I'm happy that prayer has finally been answered! At the end of July, we're going to Haiti with a group out of Kansas City, Missouri.

The goal is to work with an established project there: Joshua's Village, a village for abandoned, orphaned and neglected special needs and at-risk children.

The cost of the trip is $1,400, not including all of the required medicines and vaccinations or the travel fees since we don't live in Missouri. If you'd like to help, with financial stuff, please let me know. I am taking donations!

Also, prayer support is really needed. It seems like after our first visit to the doctor to get shots, questions really started to pop up after we started reading the travel guidelines. It's definitely outside of my comfort zone! Being away from home for more than 3 days has always made me feel uneasy, but in a country where diseases are running rampant, kidnappings are common, and a curfew is the law... gosh. However, the need is greater than my fear -- pray it stays that way!

My mentor at church has said that the enemy will throw all sorts of nasty things to discourage us especially when doing something like this. I can definitely feel it already.

So I hope that even if you are unable to provide financially, you will pray for me, Jessa, and our entire group, as we embark on this journey together.

Continue reading...

Limits on Powder & Primers

Posted on: 2010-05-17 15:43:12

At my boss's direction, I called the City Attorney's office and inquired about the maximum amount of powder & primers that one might possess at home.

According to the city attorney Temple, TX adopted the 2006 ICC Fire Code and you are limited to:

  • 1 pound of black powder
  • 20 pounds of smokeless powder
  • 10,000 small arms primers

He wasn't sure if this was 'per person' or if this was a limit based on the location. The exact wording is tough to get ahold of because the law is copyrighted and it is not freely available online.

I can't imagine if you had some stored in a another building or offsite (legally) there would be a problem with possessing more than that. But honestly, 20 pounds of powder is a lot of powder. (25k+ rounds of 9mm, for instance depending on load).

There are probably similar limits in most areas, so please be sure check before stocking up!

Continue reading...

Theming Local Task Tabs in Drupal 6

Posted on: 2010-05-14 16:44:52

In one of the primary applications on our intranet, we use small icons in the process to help our Agents and Home office users through the process.

Agents see something like this:

While our employees see something more along the lines of this:

There are various combinations but the point that I'd like to impress is that a use-case exists for theming Drupal's MENU_LOCAL_TASK tabs.

In Drupal 5, you could get away with doing stuff like this in hook_menu:

'node/'.arg(1).'/reject', 'title' => 'Reject', 'type' => MENU_LOCAL_TASK, 'callback' => 'drupal_get_form', 'callback arguments' => array('pcf_casetracker_form_reject',$node), 'access' => $finish_access, 'weight' => 3, 'class' => 'hasicon reject'); // Special class for my my tab. ?>

Then, a simple theme override:

'. menu_item_link($mid) .\"\\n\"; } else { return ''. menu_item_link($mid) .\"\\n\"; } } ?>

Would give you the intended results.

This, however, does not work in Drupal 6. There are two reasons:

Firstly, in Drupal 6, two theme functions are used to build links to menu tabs:

menu_item_link takes the actual menu router item as a parameter. It returns an HTML link. menu_local_task takes just the link, wraps it with an <li> tag, and adds the appropriate class if it is $active. At no time does the $menu_router item get passed to the function where it could affect the display of the <li> tag.

Secondly, the menu router system stores all of its values in a table called... menu_router. Writing entries to this table strips them of any values which are not in the table to begin with. So adding 'css_class' ?> in the menu's item in hook_menu() does nothing.

So how do we do this? I've got a hack, and a possible "fix."

h3. The Hack

In the menu system, and can be utilized to pass extra parameters to your page and access callbacks. These arguments get serialized before they get sent to the database. So you can actually stick a bunch of stuff in here. So, if you write your own access callback to only utilize the first param, you can stick extra information on those callback arguments like so:

'Reject', 'type' => MENU_LOCAL_TASK, ... 'access callback' => 'pcf_casetracker_can_finish', 'access arguments' => array(1, array('class' => 'hasicon reject')), ); ?>

And then simply override your theme callbacks to do some trickery. Basically, test for that extra set of classes and build the link and the item entry in theme('menu_item_link') instead of building it in theme('menu_local_task'). Then, if menu_local_task detects the '<li' at the beginning, it will just let it pass through. Now your <li> tags can have extra css or attributes passed to them.

'. $link .\"\\n\"; return $active ? str_replace('class=\"', 'class=\"active ', $link) : $link; } function garland_menu_item_link($link) { if (empty($link['localized_options'])) { $link['localized_options'] = array(); } if ($link['access_arguments'] && ($stuff = unserialize($link['access_arguments'])) && is_array($stuff) && ($b = array_pop($stuff)) && is_array($b)) { if ($b['class']) { $link['class'] = $b['class']; } } if ($link['class']) { return '
  • '. l($link['title'], $link['href'], $link['localized_options']) .\"
  • \\n\"; } return l($link['title'], $link['href'], $link['localized_options']); } ?>

    h3. The "Fix"

    Since Drupal 6 isn't taking any new features, it is highly unlikely that this will get fixed. At any rate, by modifying core to add two fields 'theme callback' and 'theme arguments', the menu system can be modified to add support for theming the individual items as they come out. From there, it is easy. One particular function, menu_local_tasks is responsible for actually rendering the links.

    By modifying the function to look for the theme function and call it if it exits, we can do all sorts of cool things. The patch is down a the bottom of this post. If there is no , it will fall back to the current method it uses.

    It might be more worthwhile to split the actual rendering and collection of the tab information into two separate functions. This is probably the better way to do it. Also, there might be a better way to do it in D7.

    Also, if you are using the Chaos tool suite you'd need to patch it as well (if you are using Garland).

    There is also probably a way to do this that involves overriding the menu theme function just like ctools does it. The only problem that still remains is making sure that the menu tabs get the proper data associated with it. There doesn't seem to be a no-brainer to attach that data after the fact. Could be wrong, though!

    This is what the code in the new solution looks like (in your module, that is.)

    The menu item itself:

    'Void', 'type' => MENU_LOCAL_TASK, 'page callback' => 'drupal_get_form', 'page arguments' => array('pcf_casetracker_form_void', 1), 'access callback' => 'pcf_casetracker_can_void', 'access arguments' => array(1, array('class' => 'hasicon void',)), 'theme callback' => 'pcf_casetracker_tab', 'theme arguments' => array('class' => 'hasicon void'), 'weight' => 9,); ?>

    The callback, which is basically theme('menu_item_link') embedded in a tweaked copy of theme('menu_local_task').

    0 ? ' class=\"'. implode(' ', $classes) .'\"' : '') .'>'. l($menu_item['title'], $menu_item['href'], $menu_item['localized_options']) .\"\\n\"; } ?>

    Anyway, hope this helps someone.

    Continue reading...

    Panic's Checkout Form

    Posted on: 2010-05-13 09:03:02

    Just bought the "Transmit 4":http://panic.com/transmit upgrade. Having used Transmit 3 for several years, the UI improvements are a big deal. It seems like some of the nit-picky stuff irked me was fixed and overall the app feels worth the $19 upgrade.

    Panic has always been detailed oriented. Their site has always been easy to use and a pleasure to navigate. One thing that caught my eye while purchasing Transmit 4 was the checkout button:

    !/sites/nickvahalik.com/files/transmit_checkout_button_1.png!

    My only complaint after having gone through the process was that this button is mislabeled. But it looks like a normal button, right? Well, it's not. Because as you fill out the form:

    !/sites/nickvahalik.com/files/transmit_checkout_first_field.png!

    The button transforms:

    !/sites/nickvahalik.com/files/transmit_checkout_button_2.png!

    Continue filling out the form:

    !/sites/nickvahalik.com/files/transmit_checkout_form.png!

    And it fills out more.

    !/sites/nickvahalik.com/files/transmit_checkout_button_4.png!

    Until you've filled out every required field:

    !/sites/nickvahalik.com/files/transmit_checkout_button_3.png!

    Very cool!

    Continue reading...

    dgo.to: A URL shortener (and smartener) for drupal.org

    Posted on: 2010-04-28 10:27:31

    The last day of DrupalCon, after talking to several people about drupal.org URLs, dgo.to was born. It's goal is to make drupal.org URLs easy and smarter. For instance, where else can see someone's profile by just typing their name?

    "dgo.to/@nvahalik":http://dgo.to/@nvahalik

    Anyhoo, check out the site itself: "dgo.to":http://dgo.to/ or "this post on d.o":http://dgo.to/783692 for more information.

    Any comments & suggestions are welcome!

    Continue reading...

    A Thought On Immigration & Illegal Aliens

    Posted on: 2010-04-28 10:16:37

    "Rep. Debbie Riddle":http://debbieriddle.org/ of Tomball is going to "introduce immigration-check legislation in Texas":http://news.yahoo.com/s/ap/20100428/ap_on_re_us/us_immigration_texas that is similar to Arizona's newly passed law requiring law enforcement to question people about their immigration status. Even "people in Ohio are thinking about implementing it":http://news.cincinnati.com/apps/pbcs.dll/article?AID=/AB/20100427/NEWS01/4280359/.

    Aside: Yahoo! News, of course, would have you believe that these bills are "anti-immigration." However, their editors forgot the "illegal" part of the phrase (anti-illegal immigration, for the curious). Should be expected from them, but it's frustrating nonetheless. After all, if you put the phrase out there like it should, be, their whining seems a little silly.

    First off, while I am in favor of this for several reasons, it seems that it could be possible for some harassment of legal immigrants (or even citizens) to occur under this law. It can be hard to tell what exactly who is and isn't an illegal alien just by looking at them. Most legal aliens, though, know that illegal immigration hurts them just as much as it does this. So they might very well be willing to put up with this. Which leads me to my thought...

    Why not just require English from everyone? Why not make that the litmus test of being American. Speak english. For purposes of stopping illegal immigration, it would probably be very effective. If you want to work in this country, learn English. Indians, Chinese, Thai, Vietnamese, Arabs... they all come here to go to college and they know English. Would it really be that bad?

    Continue reading...

    Dear Liberals

    Posted on: 2010-03-23 00:12:20

    bq. "Pride goes before destruction, a haughty spirit before a fall." -Proverbs 16:18

    Delivered to my inbox this morning from "David Plouffe, Democrats.org":mailto:democraticparty@democrats.org was a message entitled "Will you add your name?" You might be asking yourself why a registered republican subscribe to such political rubbish? Simple. To keep my enemies closer. Sometimes it is funny, other times, like today, it's downright disturbing.

    For some reason, the Democrats like to lie to themselves. They think that this "century-long fight" has finally been won. We haven't been fighting towards communism for 100 years. We've been fighting to stave it off for as long as we can. And for some reason, these people think that this is some sort of "win." Heck, they didn't even get the public option! And the "liberal feminists are furious":http://www.now.org/press/03-10/03-21b.html!

    I'm curious what would lead them to believe that the vote yesterday "...[proves] once again that Americans, standing together, can change the course of a nation." Do these people realize that the people standing together were "totally opposed to the healthcare bill?":http://www.cbsnews.com/8301-503544_162-20000941-503544.html I mean, you'd have to have mental problems to think that the Jack and Jill hometown democrat had anything to do with the passage last night. Are these liberals on drugs? (I mean, "this guy":http://www.youtube.com/watch?v=9Q-VGZiEbrs has to be.) Are they completely oblivious to all of the "underhanded dealings":http://online.wsj.com/article/SB10001424052748703775504575136133814210008.html?mod=rss_opinion_main that went into making this happen? The Democrats who "changed their vote to Aye":http://www.cnn.com/2010/POLITICS/03/17/health.care/index.html didn't change their vote because ma-and-pa were calling their offices telling them to vote for it. They changed their votes because "Obama was threatening to withdraw his support of them":http://www.telegraph.co.uk/news/worldnews/northamerica/usa/barackobama/7450237/Barack-Obama-threatens-to-withdraw-support-from-wavering-Democrats.html... among other things.

    So, now that these weak-minded sheep can feel all warm and fuzzy inside for feeling like they had a hand in the biggest bribery of our generation they get a special prize for eating the whole cracker-jack box!

    They have a chance to <a href="http://my.barackobama.com/page/content/hccosign?source=20100322_dp_dnc">"co-sign" the health care "reform" bill with President Obama.

    (please excuse my language) You must be shitting me.

    First off, you aren't co-signing anything. Only the president is signing this steaming pile of a bill. Secondly, how stupid do you have to be to put your name in a permanent archive "so that generations to come will have a record of those who stood together in this moment." Are you kidding me? This bill has the potential to "bankrupt the country":http://phoenix.bizjournals.com/phoenix/stories/2010/03/22/daily6.html and you want to put your name on it? Why? Do you want the rest of us angry, dissenters to know who to hang for treason first? Why would you want to do that?

    I'm going to have to go with pride. It's so crystal clear. People want to feel like they've made a difference. They want to feel like they own a piece of this. The democratic party is using parlor tricks against it's own members. They feed them lie after lie, but continue to make them feel like they had some part in it, when in reality they are getting the same thing they despised from Bush but in a different package. Obama has consistently lied to them, and they love him. He is their God, no doubt about it. And since you can mix liberalism and Christianity, we're pretty much left with secular humanists who think they are more enlightened than everyone else.

    For people who claim to want to "progress" us keep running around in circles. Apparently progress means getting rid of humans! Apparently saving the planet means "having less children":http://online.wsj.com/article/SB10001424052970204313604574328823712388930.html. I mean, heck, liberals don't have a problem killing children because they may be an inconvenience. They can also say it'll help the planet! So, let's save the planet for our children's sake... but let's have less children... We've got to save them something, at the point, they'll have nothing but debt (if the country hasn't gone bankrupt by then.) Our debt increases, but if we have less children there will be less people to spread the debt around. That makes total sense! If you're a liberal...

    Yes, the pride comes before the fall. And this fall, we are done playing games. You can expect a fight like you've never seen before. All that you have worked for will pass away, one way or another. We are tired of your hypocrisy, lies, pride, political correctness and blatant destruction of our freedoms and our country. You may have won the healthcare battle, but the sleep giant has awoken and piece by piece as this bumbling monstrosity of a bill comes into effect it will serve as the fuel we need to defeat you and your anti-capitalist, anti-family, anti-life, anti-american agenda.

    Continue reading...

    Remembering Kole

    Posted on: 2010-03-19 10:27:56

    Back in October 2008, my wife started working at Texas Motorsports in Killeen. I met most of her co-workers at the Christmas party that December. That was the first time I met Kole:

    !/sites/nickvahalik.com/files/kole.jpg!

    Floyd, Erin's husband, was deployed in Iraq for most of 2009. As a result, Erin & my wife, Sarah, got to spend a lot of time together. And usually where Erin came, Kole came as well.

    Kole died in an accident March 7th, 2010. The details don't matter, but most it is believed he died in his sleep.

    Floyd and Erin managed to, above everything in this world, love Kole more than you could possibly imagine. From the countless photos on Facebook, to the toys scattered all over the floor you didn't have to ask if they loved their child, it was apparent from the very moment you saw them.

    Kole will be sorely missed not only by his mother and father, but by anyone and everyone who knew him.

    Sarah and I made this video for them and we'd like to share it to remember him by:
    <object width="640" height="385"><param name="movie" value="http://www.youtube.com/v/0tF7Zez819s&hl=en_US&fs=1&"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/0tF7Zez819s&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385">

    Continue reading...

    Ultrasonic Cleaning of Brass Rocks!

    Posted on: 2010-03-16 19:40:11

    After reading "Jason Baney's article on ultrasonic brass cleaning":http://www.6mmbr.com/ultrasonic.html, it's hard not to try it out. Cabela's cheapest "brass tumbler kit":http://www.cabelas.com/p-0012554212869a.shtml costs $63. I was able to find <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Foffer-listing%2FB001DKDAVW%3Fie%3DUTF8%26ref_%3Ddp%5Folp%5Fnew%26qid%3D1268540550%26sr%3D8-1-catcorr%26condition%3Dnew&tag=nickvaha-20&linkCode=ur2&camp=1789&creative=390957">an inexpensive ultrasonic jewelry cleaner<img src="https://www.assoc-amazon.com/e/ir?t=nickvaha-20&l=ur2&o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> on Amazon for under $30.

    I'll be honest, it's not the best little thing. It only runs for 3 minutes at a time (so you have to keep pressing the button) but luckily I don't need it to run that long and since I'm mainly doing 9mm and .380 at the moment, I can fit a lot more brass in a much smaller container.

    In his article, Baney cleaned 8x fired brass cases. I'm pretty sure mine are only 1x or 2x fired. After about 9 minutes in the first cycle, the first batch was done. I skipped the tap and distilled water cycles, too, opting instead to just rinse them under the tap. The results are below:

    h3. Before

    !/sites/nickvahalik.com/files/brass_dirty.jpg!

    h3. After

    !/sites/nickvahalik.com/files/brass_cleaned.jpg! !/sites/nickvahalik.com/files/brass_cleaned_2.jpg!

    Needless to say, my results were exactly in line with his! Many, many thanks to Mr. Baney for his wonderful article and the time it took him to research and test it all.

    Now to scour eBay for a larger (or at least time-programmable) ultrasonic cleaner!

    Update: I wanted to add that after cleaning a few more rounds that the results are not always as amazing as the ones I took pictures of. The first batch was small (~38 rounds) and with larger batches not all of the brass looks this pretty after 9 minutes of the vinegar bath and 6 minutes of the baking-soda + water bath. The outsides still look very clean, but the insides are still little dirty around the flash hole. However, it's not dirty enough to warrant cleaning them again.

    Continue reading...

    Finally: Drupal 5 to Drupal 6 Upgrade of our Production Intranet

    Posted on: 2010-03-15 16:46:32

    Since getting to RVOS, a lot of my focus has been on improving things. Improving the network (new APs, redundant switches), infrastructure downtime (40+ hours a week to <2hrs a week), improving applications (bugfixes on custom apps), and in general, the way business is done.

    Our intranet went live in Q3 of 2007, when "Drupal 6 was still -beta1":http://drupal.org/node/175832. Right after we went live, I tried to upgrade and failed miserably. Ultimately, the idea got pushed to the back burner over and over for several years until roughly 2 weeks ago.

    I figured this would be somewhat easy since most of the modules now have 6.x counterparts. This assumption probably would have been true if I was updating a simple Drupal site. However, Views, Panels, and all of our custom modules have been throwing me for a loop.

    Here's just a snapshot of what I've found so far:

    1. Upgraded Panels that had views had to be rebuilt after *cough* manually converting the Views. This doesn't bother me so much, but it's still painful on over 40 custom views.
    2. All of my blocks were automatically disabled after the upgrade.
    3. The groups part of \"LDAP integration module\":http://drupal.org/project/ldap_integration doesn't upgrade properly. The names of the columns in 5.x start with ldap_groups_ but in 6.x they start with ldapgroups_. I'd work on a patch, but I'm just not sure how to actually 'rename' a column with the whole \"Schema API\":http://api.drupal.org/api/group/schemaapi/6 in Drupal 6.
    4. LDAP integration also breaks customizations. To do custom mapping of OUs to Roles, you had to edit a config file in the 5.x version. In 6.x, it's a configuration parameter in the admin area. That's actually great, but pretty much ruins any chance of automating it besides writing a custom module to stick that value in there (which I'm doing.)
    5. Errors, errors everywhere. Most of them appeared to be benign, but seeing several hundred errors flood out of an update script can be very unnerving.
    6. Running the update script felt like Windows Update. Had to re-run it five or six times before it finally got everything. Probably due to the above.

    Anyhoo, now that I've vented, let the progress commence again!

    Continue reading...