A REAL VB .net Equivalent To The C/C++ atoi()

For awhile now I’ve used the following code that I got from here to translate text into integers without too much fuss in Visual BASIC:

Public Function ToInteger(ByVal s As String) As Integer
    Dim i as Integer
    Integer.TryParse(s, i)
    Return i
End Function

It’s pretty straightforward: The TryParse() tests the string and places the numeric value into ‘i’ if valid, else 0. It doesn’t exception like CInt() would, which makes a difference when processing large amounts of data – exceptions take a fair bit of time to process within try/catch blocks (and one would argue even more outside!)

There’s a catch, though: TryParse() is not exactly like C’s atoi(), and the difference is quite irritating since I come from that background. Specifically, if there is any trailing non-numeric data in the string, it fails. And since I like to use this to convert combo or listbox entries, you can imagine how annoying it is to fail on a string like “212 (Temperature of boiling water”)” or similar: Whereas our ToInteger() function would return 0, atoi() would return 212, stopping after the number.

So, time to get a bit more complicated – meet ToInteger() Mark II. It’s in VB, but it shouldn’t be too hard to convert to C#:

 Public Function ToInteger(ByVal s As String, Optional ByVal result As Integer = 0) As Integer
        Dim i As Integer = 0
        Dim valid As Boolean = False
        Const Asc_0 As Integer = Asc("0"c)
        For Each c As Char In s.TrimStart
            If (c < "0"c OrElse c > "9"c) Then
                Exit For
            End If
            valid = True
            i = i * 10 + (Asc(c) - Asc_0)
        If (valid) Then
            Return i
        End If
        Return result
    End Function

This version takes in the string, processing digits until they end, then stops with that value, so text following it is ignored. As well, you can (optionally) specify a default value other than 0, useful if you need to know if the input is invalid (no digits input at the string’s start). And despite being longer, it actually timed 25% FASTER than the previous routine – go figure.


Have You Mastered Doing What You Love? (An Accidental Part 2)

As I mentioned in my last post of the same name, I was narrowing my focus on tasks to get some more programming done, which is arguably my ‘passion.’ ‘Nuff said.

Not so fast. This month I read a book on NOT following your passion, which made some interesting arguments:

  • Following your passion is awkward when you aren’t sure what you want to do yet (think of choosing a major in college).
  • People change, and what your passion is right now may not be in the future.
  • Passion is only one part of the whole job, with a lot of room for non-passion (my word) in the day to day grind.
  • Passion without experience is likely doomed to failure.

The arguments make sense, but sure put a damper on what we’ve told about following our ‘bliss!’

However, all is not lost. He contrasts passion with work ‘capital’ – for example, years spent learning a craft. And not just learning, but getting good – extremely good – at it. This capital means you have options for the future, and can more easily aim for your dream job.

Serendipitously, I wrote this last month with the title ‘Have You Mastered Doing What You Love?’ because I firmly believe doing something is one thing, but doing it well is quite another.

However, I likewise can’t take credit for this observation, since I learned it from a much older source:

“Do you see any truly competent workers? They will serve kings rather than working for ordinary people.”
-Proverbs 22:29, New Living Translation of the Bible

So we’ve known that quality trumps passion for a long, long time. But which should come first?

I (im)modestly think the issue is one of what ‘bliss’ really is, and that it is really a hint of what to do, rather than a full-fledged job description.

For example, say you love working with horses. Sounds good. But which aspect? Vet, trainer, owner, racer? All of these people work with horses, and all jobs might have pleasant aspects. So does that mean one of them is the winner while the others aren’t?

The book uses the example of Steve Jobs, who was quoted as following his passion. However, as was also pointed out, Jobs was interested in becoming a guru around the time he started selling Apple computers. It was a matter of timing and success that he went into running Apple versus working at an Ashram. So how can only one be the ‘one’ passion?

But what if both jobs were part of the same passion? If we limit passion to running a computer company, only one works, but if we talk of a strong passion for molding people’s lives and influencing others, then both jobs are viable, including many more jobs besides.

To give another example, an older post of mine recommended testing to decide what your strengths are. In my case, one top item was focus, or staying with a problem until solved. Not a surprise, as I enjoy programming. But problem solving is satisfying in many areas. I enjoy inventing (solving problems with devices), and also writing, where I enjoy wrapping my head around a new topic (‘solving’ it for myself) and then explaining it to others. My ‘bliss’ is tied up in those aspects of all three of these things, not each job individually. If I had to choose just one, I’d likely refuse. The common thread, as the testing showed, is that I enjoy the focus involved in each.

So to apply it forward. If I looked for a job, the one that allowed me to focus for long periods on problems would be more satisfying that one that (for example) allowed me to interact with lots of people. So I can still try different jobs, just keep an eye open for how my strengths work best for me (and by extension, for the business that hires me, which makes me more valuable.)

The conclusion: I still think we can follow our passion. The key however is to understand that passion is not a ‘carved in stone’ absolute, but more an inclination of the direction you’d like to go in.

After all, you can have a sweet tooth, and there is a lot of food that appeals to you; but decide you’re eating just cheesecake forever, and you’ll soon wonder if you ever had a sweet tooth at all!

So figure out what kind of ‘tastes’ YOU have, and pursue them – life’s too short for not following your passion – some book authors notwithstanding.

Have You Mastered Doing What You Love?

As I write this, I’m aware of two things: 1) I have not written anything yet in April, and 2) I probably would have if I really wanted to.

None of this is earth shaking (I’ve been extra busy since April is a peak month in the world of radio.) But it harkens to something I’ve been thinking about for awhile now – and something I think would be of benefit to my readers (all five four three of you.)

It’s an old bit of advice, so you’ve likely heard it.


Jack of all trades, master of none.

Now of course that’s a bit whimsical/glib, and not entirely accurate. For example, if you’ve read anything by 4 hour week writer Timothy Ferris then you know mastering something is more a matter of how much focus/planning you apply to it, and less about the years spent.

On the other hand, Malcolm Gladwell, who wrote of the 10,000 hours experts need to master something, shows that deep single-minded mastery of something does takes time.

Confused? To balance the two extremes, we need only realize that if you want to play classical piano in a concert hall it will take many, many hours to train. But if you want to entertain people on your guitar, the bar to mastery – and the effort needed – can be mightily reduced with planning and focus.

So yes, you can master quite a few things in your life – but should you?

Lately, I’ve been thinking that the opposite may be true. Master one thing first; then move on.

I once saw a video by Paul McCartney called ‘Coming Up‘. I had heard he played all the instruments himself. Impressive I thought. I’d like to do that.

However, he spent years mastering just the bass guitar in a little Hamburg-based band called the Silver Beetles (although I think they may have renamed themselves soon after) In any case, he had some measure of success, and so then could devote himself to learning other instruments.

The key: Succeed first, then diversify. Learning for learning’s sake can be enjoyable, but if your core strengths are valuable, perhaps focus on them for awhile.

In my case, I enjoy writing, and I enjoy programming, and I think I’m good at them. You may disagree (after all, you’re reading this, so your opinion is valid) but I’ve had a measure of success. I still make a nice bit of coin from software I wrote over twenty years ago (OK, 21 years, but that’s still ‘over’) and I’ve done well with my writing, both as a column writer and a self published writer (I still remember fondly my first $1,000 day soon after I released my book “Top 10 Tricks to Conquer Your Niche With WordPress“)

However, when I form a business around them, I bog down. My core strengths get diluted with customer support, advertising, management, sales, financials and much, much more. So my core strengths bring in the money, while my non-core ones dilute how much I effectively make per hour of my time.

Don’t get me wrong – learning it all is fun. But focus is the key to success. So in my case, I’ve decided to keep my eye out for partners that can fill the gaps in my strengths with their strengths, like sales people who enjoy promoting products, or people who enjoy the minutiae of business. That way, I can focus on programming and writing. And the timing is right, since I’ve picked May 1st to start my own annual Summer of Code.

The takeaway from all this? Perhaps you should examine your strengths, and find someone to balance them. It may mean paying out a wage or commission or sharing a company, but the result is the two of you (or three or four or whatever) work at peak efficiency, and more gets done faster.

And if you become successful like Sir Paul, THEN you can learn the piano…

Trick: How To Get (Lots Of) Multiple Views Of The Same File

We all know how to get 2 split views of a text file when editing – but what if we want 3, or 4, or more?

I recently edited a file I wanted to see several views of. Keeping a window open for each section of the file made cut and paste very easy. Problem was, I couldn’t find any editor that did that. Notepad++, PSPad, even that editor in Visual Studio seemed to only split a single time – so two views of a single file at most.

Eventually, I downloaded the Windows version of emacs, which does offer this option; however, it kept crashing on exit, and the keys are non-standard to Windows, which made it annoying to set up Ctrl-V, Ctrl-C, etc (not impossible, mind you, just annoying – check their menu option ‘Options; Use CAU Keys’ if you go this route).

Today while idly browsing the web (and avoiding work) I came across another option – Visual Studio once again. Tried it, and it worked a treat. Best of all, it’s an environment I’m familiar with so no cases of “why did this happen?” when I pressed familiar keyboard shortcuts.

Here’s the steps to set it up:

  1. Load the file you want to edit in VS (I use VS2015, but I’ve read VS2010 and on supports it) or drag and drop from explorer.
  2. Click on its tab.
  3. Use menu option Window; New Window to duplicate the contents into a second window. Same file, but two views of it (you can prove it by typing in one and watching it change in the other.)
  4. Right click on the tab you want to move and select New Vertical Tab Group (or New Horizontal Tab Group). Whether you pick vertical or horizontal is up to you, but apparently once you do one window this way, all the subsequent windows need to be the same orientation.
  5. Rinse and repeat: Duplicate the window with New Window, then move it with New Vertical Tab Group or New Horizontal Tab Group.

One other point: If you’re using wide scroll bars (I like the “Wide” Source Overview option,) just right click on the scroll bars to change them via Scroll Bar Options to make them thinner, with more room for text. But if you turn them off like I did, no more right clicking, so just go to the same option is found via the menu Tools; Options; Text Editor; All Languages; Scroll Bars.


A Review of HobbyKing’s Fabrikator Mini 3D Printer (AKA ‘Tiny Boy’)

I finally did it.

I got a 3D printer.

I have spent the past five years or so looking at the various devices out there, trying to figure out how to justify buying one.

Then HobbyKing had a shipping sale, and shortly thereafter I was the proud owner of a bright orange Fabrikator model 3D Printer.
3d printerThe orange Fabricator printer, or as I now like to call it, ‘MINE’

It’s based on the ‘Tiny Boy‘ model of 3D printers, and sells for under $200, a bargain in the printer world. And while its print volume is only about a 3 inch cube, for beginners it’s a great introduction to printing.

So why should you consider it?

  • Prebuilt. I many times considered making my own printer (even buying some parts), but always shied away from starting. The fact is, getting a ready-built machine was the deciding factor here. I wanted to print things out, not assemble a device and then maybe – maybe – get it working fine after. Don’t get me wrong, I may assemble my next printer, but one step at a time works best for me right now.
  • Small. Small can mean bad, but it’s good too – I can place this beside my computer and run it while I work. Far more convenient than running cables to another table, or dedicating a couple of feet square for a huge device I use only occasionally.
  • Quiet. I can actually run this at night, it’s so quiet. I don’t have experience with many printers (just the ones at the local Makerspace) but based on those I know this one is well on the low end for noisiness.
  • Ideal Starter. I like the idea of a 3D printer – but will I use it? For around $200 I’m able to test out just how convenient it is, and how best to use it on projects. Much better testing things out for $200 than spending $1,000 and finding out I’m not a ‘3D print’ kind of guy!
  • Safe(r). Unlike some printers that use ABS, this one is exclusively PLA. PLA is a plant-base plastic, and its fumes while the printer runs are actually quite pleasant, which makes it easy to run in a room without the the windows wide open. Also, it means the printer doesn’t require a heated plate to print on, reducing the chance of burning yourself (note that in both cases the print head is hot, so you still need to be careful.)

Now a word of warning: 3D printers are not for absolute beginners. I’ve taken a couple of printer courses at the local Makerspace, and I’ve run several projects on their printers while there. You’ll also want to look into some training, to at least understand how they work, and how to put together a print.

As well, the printer uses Repetier-Host for the printer management software. This lets you upload the code for your design and it processes it, converting your .stl format file into a series of movement instructions that lets the printer create the object.

And design? I use Sketchup, but I’ve heard good things about Blender. One warning: Sketchup’s license does not permit the free program to do commercial designs, so you may wish to spend your time learning Blender, which is completely free and unrestricted. Of course, if you’ll never do a part for a commercial project, either will be fine to use.

3d legOnce up and running, I immediately set about to create – legs. It turns out they recommend raising the printer up a bit for improved air circulation, and from their site you can get a design for little square feet that the printer rests on. At about 10 minutes printing time each, my first project was a success, plus a great introduction to using my printer.

Since then, I’ve done other prints, and can recommend you start slow with small parts, watch the prints in the beginning very carefully, and be sure to follow the instructions for starting and stopping (such as feeding in plastic until it squeezes out the head to be sure it’s primed properly.)

One more caution: Buy the right color plastic! I’m not sure why I picked up a spool of purple (on sale, perhaps?) but I wish I hadn’t. It’s a big spool, and I know I’m going to be using it a long, long time. I’d recommend instead either a neutral color (black/brown/grey) or a vivid color to make the detail in your parts easier to see, such as orange. Still, at the price it sells for I suppose I could just order another spool…

So, if you’ve been wondering about 3D printing, and you have a hankering for a printer of your own, consider this one from HobbyKing. At this price, it is a very inexpensive introduction to the topic, and a great gift for someone when you move on to a bigger printer…

A Very Low Cost Deaf Alert Device

Although many of my assistance projects on this blog involve the blind, I’ve been keeping alert to other group’s needs. For example, I’ve spent a lot of time planning a sound/light display for the deaf (and not incidentally, for use when I have my headphones on). Sounds flash lights, and so you can know when there is noise around. Handy for parties, handy for the deaf, handy for me when ‘plugged in’.

Anyhoo, I was slowly planning a fancy audio meter with Fourier transforms using an Arduino to create a spectrum display, and perhaps an app as well, when I found a simple on eBay. Using the LM358 chip, it puts a microphone, 10 LED power display and everything you need minus power supply for under $10.

So – program a Fast Fourier Transform on a RISC chip and add DIY hardware, or use a ready made component I just plug in? Tough choice. I

According to the specs, it runs under 100mA and 5v, so I literally hacked a USB cable to provide the power, and hooked it up (use a meter to test for the outer two power wires, and then connect just them up.) USB is supposed to be OK up to 500mA, but just in case, I first plugged it into a cheap and then plugged that into the computer.USB pinout

Now, several months later, I’m finally writing my observations:

  • It’s bright. The green LEDs are easy to see, they are by any means NOT underpowered, and there are 10 of them. It’s very visible – ’nuff said.
  • It’s adjustable. There is a tiny potentiometer on the device for level adjustment, and at the full setting I’m watching the bottom LED flicker as I type. And of course with 10 LEDs, it’s also good for picking up a wide range of quiet to loud sounds.
  • It’s sensitive. If the room is dark, it flashes quite the green lightning storm from any sound, so it does the job very well. It picks up sounds from other rooms and outside, so I suspect it would be fine to use as baby cry alert or fire alarm alert.
  • It’s distracting (but not too much.) I thought a flickering light would be quickly annoying. It wasn’t. There’s something relaxing about having it flicker gently while I type, and of course it does pick up the louder sounds for me and alerts me about the ‘big bangs’.
  • It’s neat. Although you can (and probably should) make a case for it, I preferred to keep the circuits exposed and just did some 3D printed legs to display it with a slight tilt, and to provide strain relief to the USB cable.
  • It’s convenient. Small (about four inches long), it fits well on my desk and doesn’t get in the way. With a long enough cord I can position it near me, or keep it far away (or place it face down to turn it ‘off’.) While it could probably be battery powered, I only need it at my desk, so the USB cable is fine. Of course, if I wanted to make it more portable I could buy a

All in all, a great experiment, and a very low-cost way to try out a sound meter alert. For someone hard of hearing or deaf, it could be a very, very useful tool. Or plug one in at your next party and watch the ambient noise move the meter. Well worth the low cost!

How To Avoid The Most Depressing Day Of The Year

According to various websites (and at least one I will actually link to) the third Monday of January (also known as Today) is the most depressing day of the year.

Although there are many reasons, one of the best (or worst?) I’ve seen is a mathematical formula calculating the date based on several factors: weather, debt, income, time since Christmas, time since last aborted ‘quit’ attempt (oh, those failed New Year resolutions!), and a few other things related to mood and motivation.

Of course any calculation can, at the very very best, only approximate the average mood. And we are not an average, we are individuals, so any date is guaranteed to be too soon for some people, and too late for others.

The idea behind is sound though – many people tend to “give’er a go” in January, only to have it fail in a week or two (or three). That, plus the lousy Winter weather, the bills finally coming in, and the first paychecks being cashed and disappearing immediately to handle aforementioned bills, means it’s understandable this is a more depressing time, than, say, sunny July.

So let’s move past the detailed analysis, and skip to the good stuff – how to ignore it.

Here’s Dave’s Procedures For A Great Most Depressing Day Of The Year – feel free to apply to the rest of the year as well:

  • Slack Cutting. No matter what you’re doing, scale back. How many of us try to lose 10 pounds and get annoyed at ‘only’ 7? Aim for 5, and it’s a win. It’s only in your head, so get your head on your side. Remember, a number/goal that keeps you going is MUCH better than a number you get ticked at and give up on.
  • Wagon Mounting. As in get back on the wagon. Not trying again means no more progress. So you fail, you try again. Good for you.
  • Positive Being. They are called ANTS – Automatic Negative Thoughts. ANTs usually begin without something like “you are no good because…” and go downhill from there. They can completely irrational, but that doesn’t stop them from dragging you down. I read about A.N.T.S. and liked the image so much I printed out a big ant with a red slash through it. Do it too, and realize we have some automatic glitch in our system – and need to be ever vigilant to fight them when they pop up.
  • News Fasting. Think of all those websites and TV programs reminding you that the world is burning. No news, no scare, right? It’s not likely you can give up cold turkey, but cut back on some. Avoid the most sensational websites and stations on TV (they know who they are), and pay attention to how much better you feel. Who knows, you might start cutting back in a big way – and feeling better for it in a big way, too…
  • Health Watching. Exercise (as you are able/allowed) can be good for you. Eating good food is likewise a step in the right direction. Get some sunshine. Hang out with nice people. Start (or continue) a favorite hobby. And so on. Break the bad patterns/habits/trends that interfere with feeling better, both mind and body.

I admit these a bit tongue in cheek, but let’s be honest: Isn’t a bit of levity good this time of the year?

And one more thing: I am not a doctor, nor do I play one on TV. If you think you have a serious issue, please look into it immediately; real chronic depression is a serious matter, and needs more treatment than just skipping the news.

But for the rest of us, take Monday in stride, look to the positive, and we shall persevere…

The Really, Really, Really, Beginner’s Guide On How To Solder (Or, What Is A Solder Sucker?)

A local Makerspace question reminded me of an article I had planned to write ‘any day now’ – how to solder. Not because I am a soldering virtuoso eager to impart my vast knowledge – but because I am a real neophyte, and if I can do it, so can you.

Although I had soldered for some time (and even somehow justified going from a nice temperature controlled wand soldering iron to a fancy ) I was generally soldering wires together, and the occasional resistor.

However, for my Speaking Multimeter Project, I needed to add audio to the Arduino, using the Adafruit Wave Shield. Which ships unassembled. And with a lot (to me) of parts. Tiny, little, sensitive, solder it carefully once ‘cuz you’ll never get a second chance parts. And I realized I was in deep waters.

So I researched like mad, scoured the net for videos and articles, and ended up soldering not just one, but three audio boards. And most surprisingly, they all worked first time. But they didn’t go smooth at first, so here’s the summary so you don’t have to struggle:

Firstly, get your tools together. And get them ahead of time. Here’s a list of parts I used for my job (including a few I wished I had at the time). The links point to eBay where I got most of my items.

  • A to hold the board. Imagine: You’ve got solder in one hand, the iron in the other – so something to grip the circuit board is very useful! In fact, they are sometimes called a third hand – I got an inexpensive one at a local Automotive store (Princess Auto).
  • Magnifier. The third hand jig I got had one built in, but you’ll likely need something more portable. Buy cheap reading glasses in high power, and hang them low on your nose for instance. Another option is a , especially one with a light, flip up magnifier, and frames so they can stay on your face. eBay has a variety of these types of .
  • Fan. Some form of to keep the fumes away from you. Fancy ones can include an activated charcoal filter to keep smells down. I used a household fan on low pointed nearly at me but not quite (direct fan would have cooled the solder, whereas indirect was enough to push the fumes away).
  • . As much as we all want to save the world and avoid toxins, lead solder is much easier to work with than lead-free. Get thin solder with a rosin core.
  • . I’ll discuss this in detail further down, but rosin (flux) paste is vital – get a few extra containers since they are so cheap.
  • Soldering braid. Also called a , it’s a woven wire mesh that helps ‘mop up’ solder. Handy for when the solder goes in the wrong hole!
  • . Great for trimming soldered leads sticking up afterwards.
  • . The audio board needed jumper wires, so I found some wire and soldered it in. However, I hadn’t planned for it, so ended making some really large wire joints in a tight space on the board. It works, but I’m not proud of it, and wished I had more wire size selection before I started.
  • or at least a heat sink. Handy for cleaning and scraping, the non-metallic ones will be safest overall. A heat sink lets you heat a part and divert some of that heat away from the part’s delicate internals.
  • . A simple pump that will suck up molten solder. Like the solder braid, useful when the solder goes in the wrong place.
  • A good soldering iron. At a minimum, you’ll get better results with a iron that can have its temperature adjusted. Lead and lead free solder have different melting points, so finding the sweet spot for each is key. I’ve found inexpensive on eBay for ten bucks or so that I’ve liked, which is an inexpensive way to start.

This isn’t a comprehensive list. Different projects require different things. For instance, a large board may require a larger jig to hold it. Also, I live on the (damp) coast and so static electricity is rarely an issue. If you live in a dry area (say, the prairies during winter), consider an and frequently ground yourself with it so you don’t zap any components.

So that’s the parts – now the techniques:

  • Build one, but get parts for two. At the beginning, I didn’t know how successful I’d be soldering the board, and I had promised to make two devices, so buying a third one was a no-brainer: I had replacement parts if something didn’t work or was damaged by the heat. Much less stress – and as it turned out, all three worked, an unexpected bonus!
  • Keep the instructions handy. Adafruit is phenomenal in this way – all their projects are detailed online, and by wandering through it very slowly I had few problems. I had their audio shield web page open next to me as I worked, where I pinched, zoomed, scrolled and soldered away.
  • Check twice, solder once. I cannot emphasize enough to go slow and check again and again (and again). For example, transistors fit only one way, as do electrolytic capacitors, but disc capacitors and resistors are position agnostic. To give you an idea of how cautiously I approached this project, the ICs were marked for orientation with either a dot near pin 0 or a half circle notch. One IC had both of these, but on opposites ends! So rather than guess the correct orientation, I soldered in a DIP socket for the chip, and then press fit the IC in later – I figured if it didn’t work, I’d just reverse the chip without soldering (and hopefully no blown parts). I ended up with the right orientation, but was still happy using the socket – soldering it in directly could have been really bad…
  • Flux is your friend – so show the love. One thing I learned online is how flux is actually a descaler/cleaner for the metal you are bonding – without it, you are trying to join two metals that have an oxidized coating on them. Oxidation equals no conduction, so flux and heat cleans the metal for the bonding. Now I’m a fluxing fool; my boards may be a tad sticky from too much rosin applied before soldering, but the joints are oxidation-free where it counts.
  • The ‘Two Mississippi Rule’ is all you need. Another technique I found is to apply the soldering iron to the joint, and count to two seconds (three if necessary.) If the joint isn’t right by then, stop. Let everything cool down, then try again. Getting in that habit prevents you from trying to melt solder ‘just a little bit longer’ and risk heating/damaging the part.
  • Hot is good, not bad. Everyone has a different idea online of the temperature to set the soldering iron. One thing is for sure though – too cold is useless. I thought keeping the soldering iron’s temperature a little low would give me more time for each joint, but the solder flowed poorly, and I wasted time. Instead, keep it the right temperature (and maybe a teeny bit more), never keep it on too long (the two second rule) and the result is better. Also remember there are two popular types of solder, and each needs a different temperature to melt. I recommend lead solder, but no matter what you use, make sure the soldering iron’s temperature is appropriate for it.
  • Heat the part, not the solder. I admit, I’m a fan of touching solder to iron and flowing it into the joint. Really bad idea – the connection between the solder and the part may never get hot enough to really join. Always heat the part directly, while the solder is touching it, and then you’ll have your good connection.
  • Learn what good solder joints looks like. This page is excellent. Shiny, concave, and no gaps. Making all your joints like that is the gold standard – and knowing what a good joint looks like first is the key.
  • Naughty tip: Reheat everything. I’ve seen this tip nowhere else, and I suspect real soldering people will want to lynch me for it; however, I find reviewing all the solder joints and getting them to flow one more time makes me feel better. If I wait long enough, the part starts cold so I don’t risk overheating (which can happen if I try to melt the solder too long), and I can try and retry until I get the solder joint looks just right.
  • Check after as well. Imagine you have a short somewhere when you’re done. You’re optimistic, so you power it up – and blow a few parts in the process. Now measure the annoyance of tearing apart a board you just finished, versus checking and rechecking everything BEFORE power goes on. It’s really tempting to see something in action immediately after all that work, but checking first is well worth it.
  • Be prepared to test. Fortunately, I didn’t have this issue, but make sure you have a meter nearby. It might also help to have the company’s forum open on your browser and pointing to pages where people have needed troubleshooting help. This may be overkill, but knowing what often goes wrong before you start can keep you aware of the problem areas as they happen.

And remember to practice – because if you know the fundamentals and practice, you will get better!

How To REALLY Accomplish Your Goals This Year

I know I’m hurrying things along – it’s smack-dab on January 1st, and I’m already talking about goals. I’m not the first, however; I’m seeing a lot of ads for exercise equipment and Fitbits already.

But the fact is: We seem prone to try to ‘start anew’ each year at this time, so why not anticipate it and get started early?

In line with that, here’s a quick list of things to encourage you to start something ASAP and continue through it this year:

  • Start (very) Small. Last year Gwen started with a few steps on a block. Now she does an embarrassingly large amount every day, without exception. I tried to do a lot at once, and failed. Starting small, and increasing slowly is better than a big start, and an equally big end in a short while.
  • Give yourself a quick win. We thrive on positive feedback. Pick something you know will be a slam dump. Say you know a second language. Then make a goal of simply talking in it for 5 minutes every day.
  • Understand when the same old same old doesn’t work. Do you plan 30 goals, and give up on all of them by February? Then you already know what doesn’t work. So do something different – take a smaller group of things you’d really like to do and focus on them.
  • Keep firing. On the other hand, if you set one or two goals, and they fail, why not set a few more? Perhaps five goals will give you one or two that will succeed. Everyone is different, of course, but remember, “if you don’t play, you can’t win.”
  • Go with the flow. If you succeeded at something last year, do similar this year. Successful patterns are proven winners – so reuse them.
  • Make concrete goals. This does two things. By making a concrete goal, you think about what you really want to accomplish. And this gets you thinking if you really want to do this. Learning Swahili, for example, is a goal. But thinking about it, you may realize you will never use it, and your time can be spent better elsewhere.
  • Make valuable goals. “Losing weight” is a goal. “Fitting into that dress you’ve been holding for a special occasion for five years” is a valuable goal, one that means something. Realizing why you’re doing something can give you more oomph in your goal setting (and attaining)
  • Plan to test. Likewise, figuring out how to “test” your results gets you thinking about what you really want. Getting back to language learning, it can be a lifelong goal with no real end to it. But if you determine mastery to be able to read a book and get most of the details out of it, or watch a program and understand most of it, now you have a solid way to measure and test your progress.
  • Make visible goals. Write them down, and keep them where you will see them. Reminding yourself constantly is key. And while you’re at it, note the goals you reached in previous years. I’ve kept list of my “Top” goals attained in past years, to remind myself of what I have done, rather than focus on what I haven’t.
  • Micromanage. Saying “I’m losing 50 pounds in a year” might be a good goal, but I can almost guarantee you’ll be trying to lose 49 of those next December! Instead, plan on four pounds lost for each month (or better yet, one pound a week), and you get quicker feedback on results. Quicker feedback means you can adapt, try new things, and attack the problem before it gets too far off track.

Hope these help. Now I have to get working on more of my goals (which not coincidentally includes more regular writing on Utopia Mechanicus!)

Hello World! (Or, How To Transfer + Setup A WordPress Blog for 2016) Part 2

In part 1 we got a site ready to move – now it’s part 2, and the transfer:

  • Snap it all. This time to make things easier, I did screen shots of every page in every section in WordPress admin I had made changes in. In Windows, select the window, use Alt-PrtScn to snap a shot, then select and open Irfanview’s window, and Ctrl-V to paste in it. Then click the Save As button on top to save as a snap. I set aside a directory, and just kept increasing the file names by 1. Later, Irfanview will let you scroll through these snaps easy, making compares simple. Of course, if any page has data in it, like long text, then I copied and pasted that into a text file with a note so I could find it again (and save THAT file frequently!)
  • Export your blog’s posts. ‘Nuff said – you don’t want to enter them again. Although one time I did help recover a client’s site from cached Google pages, I wouldn’t recommend it…
  • Change your site/Change your nameservers. You have the data, you have the blog entries, you have the nuts and bolts, time to go. Set up your domains on your new host, and point your blog’s nameservers to your new site. I also like to put a simple file on each domain so I know when I’m looking at the new (index.html, saying something like ‘be back soon’).
  • Say goodbye to the old. This is the hardest part. The new site will appear quite quickly online as everyone sees the new nameserver entries (called DNS propagation). However, with the old sites active, there’s still some online give and take (technical term). What this means is you might be switched to the old site from time to time. The easiest (but most painful) solution is to shut down the domains on the old cPanel. A trick: Go into FTP, and rename the blog’s directory or move the files if possible, and then close down the site on the (now empty) directory. This keeps the files handy just in case…
  • Email ahoy (or, swab the poop decks). Until DNS propagates, you’ll likely be looking at the old site (or nothing). This is a good time to set up your email accounts from the old site, so they transfer properly. Also, use this time to dig into cPanel and copy over more settings. I find flipping through the old and new email sections in cPanel the easiest way, so that I remember forwarding, redirects, catchalls, and other settings. You might also want to do this for cron jobs (if any), and other cPanel settings that affect your site. Also, remember to clear your browser cache and (possibly) reboot your machine to help get it unstuck from the old site. Once that happens, and you’re looking at the new, you should be good to go on.
  • Say hello to the new. Install WordPress. Likely, you’ll need to set up a new MySQL database, or perhaps you have a setup system like Fantastico to do most of it for you. No matter what, you should end up with that plain vanilla ‘Hello World’ site (or sites).
  • Upload anything needed. This is where you rebuild the site outside of WordPress: any file directories, your upload directories, and so on. Basically, anything outside of the usual WordPress install, and just about anything within the WordPress /wp-content/ directory is needing a restore or rebuild. What you copy and what you reinstall (like plugins and themes) is up to you. For example, I copied plugins of my own, downloaded the ones I could from the WP plugin site, and filled the /uploads/ directory from my backups (with the exception of /cache/, which is a caching directory that the Super Cache plugin will rebuild). In my case, two problems: As I mentioned, my wife’s blog was missing most of the uploads directory (which made me glad I didn’t delete the old site’s directory when I killed it!), and I had trouble getting the NextGen Gallery plugin to work. In the end, I copied the gallery images to the same location in /wp-content/ they used to be in, activated the plugin, then went in and (via phpMyAdmin) removed the relevant SQL tables (xxx_ngg_gallery, xxx_ngg_pictures, and xxx_ngg_album, where xxx is the table prefix for the blog), and replaced them with the originals from the old site. I still had to re-add albums to my posts, but at least the images transferred without me needing to reenter all 120+ images!
  • Set up everything BUT the posts. It may sound counter-intuitive, but if for example you don’t have your pictures transferred, then the posts will look funny, so save them for last. I installed all the plugins, then called up Irfanview, and scrolled through all the screen shots, matching old settings to the new install. The end result was everything synced except the data…
  • Call in the posts. Now you can import the posts. Oddly enough, this is not a builtin feature with WordPress anymore, so you’ll have to download the plugin first, then import. If everything exists, you should be OK, but of course, expect error messages. In my case, I got errors for every image I didn’t export (didn’t need to, since they were in the /uploads/ directory I copied already).
  • Verify. Go through as much as you can, double-checking. Verify the new site looks right.
  • Backup. Make sure you backup the new site – just in case. It’s easier to restore from a configured new site than the old one you had to tweak. Besides, backups are cool, right?

That’s about it. Likely, you will find many, many other items cropping up when you do your transfer, since every site is a little unique. If so, my apologies for not being able to cover your specific situation; I mainly wrote this to keep track of it for my next transfer, since I was caught yet again, even though I transferred a year ago (my issue was DNS propagation, and I forgot I had to kill the old site or my browser would sometimes go there instead of the new – which made for some weird errors).

In any case, I don’t recommend a transfer lightly. However, sometimes it’s worth it – for me, it was 80% off of Hostgator’s rates for three years, meaning I won’t have to move again until 2018 at the earliest (I hope), and so won’t have to think about WordPress transfers until then…

…which is why I wrote this – hope it helps you not think about WordPress as much as possible, too.