Text

Sending Emails from LabVIEW with the Mailgun API

Emails can give you play-by-play information from a program, or just act as a notifier that it is done running. Mailgun is a great web platform that can send emails via a web API. This is a LabVIEW VI that integrates with Mailgun, all you will need is a [free] account and to enter in your API information. I will not be keeping the source on Github, so here it is.

Use like this:

image

Change the defaults to reflect your Mailgun account settings/info:

image

This is the back panel:

image

Text

Moving LabVIEW and Windows Around on Multiple Hard Drives

LabVIEW and Windows can eat up a lot of space, so you may find yourself stretching your hard drives thin and having to consider swapping in a new (and bigger) hard drive, or simply adding another hard drive to the mix. Let’s consider some options.

Starting Afresh

As much of a headache as re-installing Windows and LabVIEW sounds, it is the only way to ensure the operating system and LabVIEW play nice. You risk losing some of your configurations, but at least you can rely on documentation and know your order of operations were done correctly. Start with Windows.

  1. If you have a Windows installation disk, pop it in and start installing it onto the new drive. Skip to #6.
  2. If not, Google “Windows 7 ISO” and download an ISO file of your intended Windows installation.
  3. Download the Windows 7 USB/DVD Tool and use it with a USB key to create a bootable version of Windows 7 with the ISO file.
  4. Restart your computer. Most computers will attempt to boot from a USB drive before anything else, but to makes sure, press F7 when starting your computer (or whichever key takes you to the boot menu) and select the USB drive.
  5. Proceed with the Windows installation on the new hard drive.
  6. You should still have access to the old hard drive, so at this point you can just drag over files you still need (don’t drag over programs, just re-install them).

Once Windows is installed you may choose to download LabVIEW or use installation disks. If you have disks, you should use them, and LabVIEW will provide updates once you are complete in case the disks are out of date. See below for more on this.

Merging onto a New Hard Drive

If you want to retain you Windows installation and all your files you will want to “clone” the old hard drive to the new one. There are plenty of paid-for solutions, but this is the free way.

Factory Windows installations usually partition a hard drive with a separate area (and disk letter) called “SYSTEM” which makes the drive bootable. Without this, the hard drive is just data and doesn’t represent a bootable operating system. If you choose to maintain the “SYSTEM” partition on the new hard drive, it needs to be the first partition, and you should use the Windows partition manager to format and create this partition before cloning.

  1. Download XXCLONE.
  2. If you are maintaining a boot partition (explained above), first clone that partition, using the “SYSTEM” partition as the source, and the new “SYSTEM” partition as the destination.
  3. Next, clone the primary partition of the old hard drive to the primary partition of the new hard drive (this is all the data that includes Windows, documents, etc.).
  4. If you are not using a boot partition, you will need to make sure your single partitioned hard drive is recognized as a bootable operating system. Download the free version of EasyBCD and use it’s “BCD Backup and Restore” tool on the new hard drive to create the proper files needed for booting. (XXCLONE offers something like this in their Tools but it didn’t work for me).
  5. Upon restarting your computer—making sure to boot from the new hard drive—you should be back in action, loading Windows as if nothing had changed.

Using Two Hard Drives

It is not ideal to use two hard drives to split the storage of program-specific files (like .exe files, or different LabVIEW components). The reason is that someday you may need to consolidate physical hardware space, and need to merge into one larger drive, but more importantly, the best reason to stay away from this is because you will start creating references across hard drives. If the supplemental hard drive fails, or the drive letter gets changed, your programs (including LabVIEW) start breaking. If you insist on using two (or more) drives, the best suggestion is to make sure one drive is for all operating system related files, and use the others for document and file storage.

LabVIEW 32-bit & 64-bit Order of Operations with FPGA Card and Basler Camera

The reason it can be a pain to move LabVIEW stuff around (especially .exe’s) is because LabVIEW’s NI MAX keeps record of the installation locations for all NI components. LabVIEW use’s the references inside of NI MAX to decide where to open the things it needs. This is why it can be easier to just re-install everything when shit hits the fan.

For re-installing LabVIEW with an FPGA card and Vision hardware (connected to a Basler camera) follow this order. This is specifically for users who have the installation discs.

  1. Make sure all the NI software is removed (use Window’s “uninstall a program” tool).
  2. Make sure all hardware cards are removed. If they are not, shut down the computer, unplug it, and remove the cards (set them on an anti-static bag). Plug the computer back in and start it.
  3. Insert the first LabVIEW discs and install LabVIEW (this will be the 32-bit version) and the FPGA module. You will also want to make sure that Xilinx compiling tools are installed along with this. When it prompts you for Drivers you will want to continue the installation without driver support—these will be installed when installing 64-bit LabVIEW.
  4. After the installation it will prompt you for a restart (don’t do anything with the hardware yet).
  5. Download LabVIEW 64-bit and begin the installation. When prompted for the location of the Drivers, place the driver CD into the computer and browse to the location in the NI prompt. You will want to select all of the Vision drivers in the next dialog.
  6. After the 64-bit installation you will need to restart the computer. Once you have done this, NI will check for updates. If there are any, download them (and restart the computer) before moving on.
  7. Once everything is installed, shutdown the computer, unplug the power cord, and install the FPGA and Vision hardware. Plug the power back in and start the computer.

The FPGA hardware should show up in NI MAX now (also see Getting Started with the R-Series Multifunction RIO and Getting Started with the NI PCIe-1433). If you were using a RTSI line between the FPGA and Vision hardware, be sure to re-install it in NI MAX.

  1. Open NI MAX.
  2. Right-click “Devices and Interfaces” and click “Create New…”.
  3. Choose “NI-RTSI Cable”.
  4. Locate the camera under “Devices and Interfaces” now and modify the RTSI Lines in the “Camera Attributes” tab.

It is also worth ensuring the camera attributes from your original projects is the same (for instance, we leave “Enable Serial Commands” unchecked). You now want to make sure the FPGA hardware is a use-able target in a LabVIEW project.

  1. Open a blank LabVIEW project.
  2. Right-click “My Computer” within the project and under “New” make sure you see “Target and Devices”. If it is available, click it.
  3. Now make sure your FPGA device can be added to the project.

If you fail to get through these 3 steps, you will want to review the installation procedure, and your best option may be to re-install everything with particular attention paid to the order of operations. It is worth either recompiling your FPGA VI’s or at least opening the “FPGA Compile Worker” in Windows (find it by searching or under the National Instruments folder) and making sure the compiler is installed correctly.

Text

Epitaphs on Edinburgh: The Remaining Words from the first Serial Killers in Old Town Edinburgh

Between 1827 and 1829 two serials killers circumvented the popular, yet foul racket of grave digging in Edinburgh, Scotland. Most of the bodies were bound for Surgeons Square—the epicenter of modern medicine—for dissection by the days’ leading anatomists. Burke & Hare, as they became known, found that instead of digging, murder was simply more expedient. They gained a reputation for some of the freshest specimens that could be bought. Three epitaphs can be found on the walls of buildings that surround what was once Tanners Close in Edinburgh, the place where 9 out of the 16 (recorded) murders took place. Although Tanners Close no longer exists and is for all intensive purposes, hidden, it seems several of these historical pieces of insignia have persisted through modern reconstruction, all with striking irony to the location’s macabre past.

Love God Above All and Your Neighbor as Yourself. (Matthew 22:34-40)

image

Burke and Hare had killed not only pensioners, but also towns people—their neighbors.

My days are suifter than a weavers shuttle. (Jon 7:6, Dated 1735)

image

Days were swift for those who encountered Burke and Hare in Tanners Close.

Behold, how good a thing it is, and how becoming well, Together such as brethren are in unity to dwell! (Psalm 133, Dated 1696)

image

Together, bretheren, unity. All words that could have helped the criminals lure their prey.

My travels take me to Europe retracing the path of the most famous and interesting accounts of 19th century medicine for my upcoming book, Left. Learn more at http://gaidi.ca

Text

The Character of Daily Experiences

The noise was deafening: Hawkers clanged bells announcing that they had brandy for the men trudging to work, town criers shouted the day’s news, quarreling neighbors screeched at the top of their lungs.—Paris: The Secret History

A vivid description of a stroll down the streets of 17th-century Paris—a bustling of chaos. We have inadvertently replaced this with a click to our news feed. Advertisers selling to us. Inordinate amounts of news, stories, and propaganda. The tribulations of the day, or the conflicts amongst ourselves, shouted to the world. We haven’t lost any piece of humanity through technology other than our innate and God-given character. We have lost the smells, the sites, the textures, the auditory influx of noises—both piercing and pernicious. We have lost the abundance of experience and variety that was once existant in seemingly ordinary activities.

Our sounds are now mono-directional. The light and colors from our flat panels are limited, both in their spectrum, and intensity. The binary transmission that underlies our virtual realities is superfluous, and we can only remiss that we have supplanted data for character.

Text

The Practical Man

I share this with the greatest respect for Dr. Frank Crane and his illustrious writing. This is an excerpt from Volume V of his Four Minute Essays.

[The Practical Man] is supposed to be of much more real use to the world than the Theoretical Man. We speak of the man who “does things” or “gets things done” with a certain smack and relish as though he, after all, were the fellow worth while.

Practical implies that he can do things that he has practised. But when he wants a thing done that nobody practised, when he gets to one of the real hard knots of life, your practical man is helpless. Then we discover that the great man is the Dreamer with a head full of theories.

The best work is done by the Theorists, in their laboratories, watching test-tubes, in their studies excogitating philosophies, or under the summer trees dreaming of the coming days of gold and singing of their dreams.

Text

Why We Hate What We Love To Do

image

As you probably know, Japanese is a logographic language, which means that it maps single characters into a meaningful unit. It’s this consolidation and compactness that makes it popular among people getting tattoos—you can pack a lot of meaning into a small space! So although a direct translation is not possible, the word ikigai (pronounced [icky-guy]) is best described as what makes life worth living. It’s something that motivates you, drives you, and gives you purpose and joy.

There was a study that started in 1994 in Japan, asking people if they had an ikigai; it included a little over 40,000 people, from ages 40 to 80. After seven years, 95% of the people with an ikigai were still living, versus only 83% who were without an ikigai. Think about this: because people had a reason to wake up, they did—12% more often. The leading cause of death? Heart disease. Hypertension (a pre-cursor to strokes). You might think that correcting for socioeconomic, or lifestyle, or habitual factors would somehow separate this data into something more than just ikigai. But it doesn’t. There is an entire field of study for this phenomena and it’s positive psychology. It’s a real hot topic for popular science and authors alike, marrying self-help and scientific anecdotes into one.

image

For those of us who would have said “yes” to having an ikigai, we are still struck with some days, weeks, or even month-long stints of feeling lost. We are often asking how we have lost our ikigai, and what we can do to reclaim it.

“The noblest pleasure is the joy of understanding.” -Leonardo da Vinci

To understand this better we have to inspect the brain; and in particular, the two hemispheres. Try folding your hands together, as if you were praying. Notice that the thumb of one hand, and pinky of the other are the outermost fingers. Now, fold your hands again, but switch the way which you folded them (so the pinky and thumb are now of the other hand). Feels odd, right? Try it with folding your arms. Now, try pointing at something with your right hand, then cover your left eye with your left hand. Are you still point at it? Try doing it the opposite way. These are lateral dominances, and they range from folding our hands, to writing, seeing, throwing, eating, brushing our teeth, using our phones, and twisting a screwdriver. This all has to do with the fact that the two hemispheres up there are different.

I am sure you are familiar with some of the common attributes given to “left-” and “right-brainers”. Left brainers love math, and right brainers are artsy. To talk with some depth about whether this is true, we have to look a bit deeper at the brain, and even though it may seem like a diversion from ikigai, we will certainly see that it all fits together.

The brain exhibits a physical breaking of symmetry, or asymmetry. This is seen both in “Yakovlevian Torque”, which shows a slight clockwise twist of the two hemispheres if viewed from the bottom-up, as well as unique morphologies of the outer layer (aka. the cerebral cortex).

image

The story of why is interesting. What we do know is that we were once less asymmetric; we are able to tell from fossilized endocasts that our brain has evolved into this more-lateralized structure. Most animals have highly symmetrical brains, unlike us, but asymmetry does seem to follow the primates and peak at our species. The primary biological reason for symmetric redundancy is so we have extras; we can continue to live without one hand, one foot, and even one hemisphere of our brain, but are usually unable to if both are inflicted.

For humans, there was a span of time about 1.5M years ago that contains the evidence for a good theory which explains the explosion of asymmetry in our cranium.We weren’t Homo sapiens yet, rather Homo habilis, or handy-man. Thats because we were using tools to hunt and build. Language was forming, and soon societies that would spawn cultures. Mothers stayed home, and men hunted. We were no longer adapting to our environment, but adapting it to ourselves. As this played out, it was becoming more important for us (in terms of survivability) to be specialists, rather than having redundant, copied body parts.

image

Jump to today and we have language centers, motor centers, places where objects are rendered, and where memories are stored. Let’s look at a few examples of how these lateralizations play out.

The outbreak of WWI sent many of the great European scientists to the United States and included within their fields of research was brain function and anatomy. Remember that during this time frontal lobotomy’s and electroconvulsive shock were ‘cutting edge’ (there was a Nobel Prize given for the lobotomy). It wasn’t until the 1960’s that anything having to do with asymmetry appeared and it was through a surgical procedure that would limit debilitating seizures for people suffering from epilepsy. It was called a commissurotomy and involved cutting the fiber tracts that run between each hemisphere. This essentially stopped seizures from spreading between the brain, and gave much relief to the patients. Unknown at the time was what effects it might have on consciousness and human processes (the procedure had only been trialed on monkeys).

image

There is a crossing of motor fibers in the medulla oblongata, just above the brainstem, called the pyramidal decussation (decussate means to cross, or form an X), which makes it so our left hemisphere controls the right side of our body, and the right hemisphere controls the left—we are said to have contralateral control. This is the rule for everything except for smell.

image

Once the procedure for the epileptic patients was complete, one of the first experiments was to take a bag full of random objects and ask the patient to blindly pick one with their right hand. Once the did, and placed it back into the bag, they were asked to use their left hand to retrieve the same object. They were not able to; it was a failure in cross-retrieval. If each hand got to select an object, then the objects were scattered onto a table, each hand would search for its object, paying no attention to the other hand’s object. Next, researchers blindfolded the patient, and had them place their hands out in front of their body. They manipulated one hand and gave it a unique posture—such as a closed fist—and then asked them to replicate that posture with there other hand. Again, this proved impossible; a failure in a symmetrical hand pose. The commissurotomy had created two brains (or minds?) that are not talking.

Next were the behavioral studies, which are far more interesting. The researchers devised a simple device to stimulate each side of the brain: two transparencies were projected to the right and left peripheral views of the patient with a shutter set to display them at 1/10s intervals. When the patient focused on the center of the device, this was quick enough where the image would only be registered by the corresponding half of the brain.

image

An image that was flashed twice to the same hemisphere was readily identified as a duplicate, however when flashed contralaterally, the patient could make no such mention and they considered it unique. Anything flashed to the right visual field could be spoken about, or written down. However, when flashed to the left visual field, the patient could only describe that a flash occurred on the screens, but nothing was shown. This in itself represents the existence of the language dichotomy and dominance hypothesized by 19th century physicians. When a nude picture was supplanted into otherwise random images displayed to the left visual field, the patient showed a “sneaky grin” and “perhaps a blushing,” yet when asked what they saw, the replied in similar fashion as before, that is was only a flash of light. When asked about their peculiar behavior and arousal, they said they had no idea what had come over them!

What followed was testing whether or not each hemisphere identified objects by appearance or function. When a cake was flashed to the right hemisphere, the patient would relate the stimuli to a hat. When flashed to the left hemisphere, the patient would relate it to a spoon and fork.

Over and over the right hemisphere proved to be making metaphorical and holistic relationships. The left hemisphere was concerned with function and categories. In one of the more famous cases (and in a similar experimental manner), a patient’s right brain was asked what he wanted as an occupation, with a response of “race car driver”, while the left brain said “architect”—seems to fit into the pattern.

“A scary dream makes your heart beat faster. Why doesn’t the part of your brain that controls your heart beat realize that another part of your brain is making the whole thing up? Don’t these people communicate?” -George Carlin

Of course 40 years of research on top of these results has brought up contention, alternative experiments, and other findings, but in principle these are hard to dispute.

Now that we have a basic idea of the left and right brain functioning, we come back to ikigai, and can expose it through a study on cerebral dominance of musicians and non-musicians. We can think about music—and lets stick with classical or symphonic music for now—in two ways. When we are listening in a casual manner, music is a grand melody; there is a flow, a canter, a mood. Alternatively, we could just think of it as a combined set of instruments, playing a set of notes. Given the previous discussion, you may find yourself already alluding to placing these interpretations to one or the other side of the brain. What the research reveals is that musically naive listeners (aka. non-professionals) will interpret music as a melody using their right hemisphere. However, professionals who have dedicated most of their life to practicing and playing music become more focused on the isolated tones, individual sequences, and even the notes when listening to music, using mainly their left hemisphere.

This is the key to our ikigai! Professionals break down the music because they have to; they have been trained to be aware of the nuances, and even the errors. They become a stickler to themselves. They can not see majesty of the forrest through the slightly-imperfect trees. An off-key note will ruin a performance for them just as bad as a misspelled word would ruin a novel for a grammaticist, or an awry brushstroke would ruin a painting for an artist. All the while, the naive listener is in mild euphoria allowing the music to tell a story. The professional looks back at the naive listener and sees a twinkle in their eye and a pose of serenity,wondering how on earth they could enjoy such mediocracy.

We are all naive at some point and I propose that we fall in love with our ikigai using primarily one hemisphere of our brain—just like naive musicians. For them, it starts in the right hemisphere, where we appreciate vistas of information coming together as a whole. But for others, it may be the individual elements of chemistry that call to the left brain, each with a distinct atomic weight and a plethora of properties. But one day that naive chemist is asked to build compounds, integrate those into atoms, and then describe how a world of atoms creates an organism, and how organisms create our world—and its here that the ikigai is lost, and the chemist wonders, what happened to my elements?!

I think this is the fundamental shift we all need to be careful of. When we find ourselves falling out of love, we need to remember the magic that inspired us in the first place. We need to, at least on occasion, revisit it with the naivety, the humility, and the ignorance we once had. The musician needs to play their heart out, sing some acapella, dance in the rain to something that speaks to their heart. The chemist needs to pin up a table of elements, quiz themselves on the properties, and balance a couple reactions, just to remind them that this is what it’s all about.

image

The real world is full of minutiae that impedes our sense of ikigai. It’s that paperwork, the Monday meetings, and unread emails that makes us question our purpose. Sometimes we can’t get away from it. But if our hearts are in it, if it is our true ikigai, we need to remember why and spend some time revisiting the hemisphere that brought us to it—because let’s face it, it may just save your life.

Learn more about Your Brain and Your Work in my upcoming book, Left. Find out more at http://gaidi.ca

References

Bolger, Donald J., Charles A. Perfetti, and Walter Schneider. “Cross‐cultural effect on the brain revisited: Universal structures plus writing system variation.”Human brain mapping 25.1 (2005): 92-104.

Carlin, George. Brain droppings. Hyperion, 1998.

Edwards, Betty. Drawing on the Right Side of the Brain. ACM, 1997.

Iaccino, James F. Left brain-right brain differences: Inquiries, evidence, and new approaches. Lawrence Erlbaum Associates, 1993.

Rippon, Gina, S. L. Springer, and G. Deutsch. “Left Brain, Right Brain: Perspectives from Cognitive Neuroscience.” Journal of Psychophysiology 14.1 (2000): 50-52.

Sone, Toshimasa, et al. “Sense of life worth living (ikigai) and mortality in Japan: Ohsaki Study.” Psychosomatic Medicine 70.6 (2008): 709-715.

Sperry, Roger W. “Hemisphere deconnection and unity in conscious awareness.” American Psychologist 23.10 (1968): 723-33.

Bear, Mark F., Barry W. Connors, and Michael A. Paradiso. Neuroscience. Lippincott Williams & Wilkins, 2007.

Text

Despicable Me.

What are you doing over there?

You have been silently staring at flat flimsy things all day—and they don’t even move—yet, you stare. I am baffled. And hungry.

Let’s go outside, to that tree we like. We can roll in the grass, and maybe catch those damn ducks before they get into the pond.

I bet Cheyenne will be out there with Caesar. A pretentious couple they are. I barely get a sniff of his butt before he cowers like a little bitch.

I have to pee.

Hey. After we play for a bit, we can come in and eat Cheerios on the chair. With that blanket. Then nap until mom gets home.

God damnit Matt. Your boring the hell out of me and I’m just a stupid dog.

Link

I have no reason to call this “intellectual property” anymore. I have released the code that drives this cool little demo: http://landr.co/brandr/ This project was about 2 weeks of coding, testing, and understanding—having late nights, and a lot of white-boarding to figure out the best way to extract colors from brands. Notice, I say “brands”. It’s not just colors from an image, it’s the human interpretation of a gestalt; and that’s why it is a tough problem. Click on the title above, or here for the Github repo.

Text

Installing suPHP with Plesk 11 on Media Temple DV4

I ran into major dependency issues trying to follow this tutorial provided in the Media Temple knowledge-base. Normally it is recommended to install suPHP by compiling it from source (as mentioned in the tutorial), but mainly because of the mode that suPHP is put into during the installation. The reckoning for suPHP is well-put here, with the three modes of operation being:

  • owner: Run scripts with owner UID/GID
  • force: Run scripts with UID/GID specified in Apache configuration
  • paranoid: Run scripts with owner UID/GID but also check if they match the UID/GID specified in the Apache configuration

The advantage of compiling from source is that suPHP can run in paranoid mode—however, as the previous link states: Although suPHP states that the default mode is “paranoid”, the libapache2-mod-suphp is installed in “owner” mode by default. When suPHP is installed in “owner” mode, the directive suPHP_UserGroup is not recognized which is required for “force” or “paranoid” mode.

Running suPHP in owner mode doesn’t seem all-that-bad, considering it is in fact the default for some installations. However, the comment about not having access to the “suPHP_UserGroup” within your configuration file is true, and if you try to restart Apache with it in there (as the Media Temple tutorial suggests), it will result in an error, and possibly crash your server.

My workaround is to remove any of the lines that include “suPHP_UserGroup”, and simply use yum to install suPHP, which lets you skip steps 1-4 in the tutorial.

yum install mod_suphp
Link

I couldn’t understand why cash-based receipts have not been exploited. It is so seemingly simple to return your “used” stuff, if only you had that magic receipt. Let me know what you think!