Browsed by
Category: Problem solutions

CMake with compilers that need custom parameters

CMake with compilers that need custom parameters

When using CMake on non-GCC/non-Microsoft compilers – you often run into interesting problems. Especially true for embedded devices/cross-compilers.

One thing that can bite you is the fact that CMake requires the compiler to pass a ‘smoke’ test. Unfortunately, if there are required parameters for your compiler, the smoke test part will fail.

There are a few ways to solve this, the ‘recommended’ way seems to be via the CMAKE_FORCE_C_COMPILER/CMAKE_FORCE_CXX_COMPILER flags. This allows you to tell CMake what the compiler is and pass the smoke test.

CMAKE_FORCE_C_COMPILER(/usr/mycc/cxint86 GNU)
CMAKE_FORCE_CXX_COMPILER(/usr/mycc/cxxint86 GNU)

Here are the docs for more information
https://cmake.org/Wiki/CMake_Cross_Compiling#The_toolchain_file

Canoscan Lide 25, Photoshop CC, Windows 7, TWAIN, and you!

Canoscan Lide 25, Photoshop CC, Windows 7, TWAIN, and you!

I recently upgraded from Photoshop CS5 to Photoshop CC and it has been a great improvement overall.  However, I still have my old Canoscan LIDE 25 scanner that uses TWAIN.  If you remember, this involved a bit of tweaking when I went to get it to work with CS5  and CS6.

At any rate, here’s how you get your Canon Canoscan LiDE25 (or other TWAIN scanner) working with Photoshop CC on Windows 7:

  1. Install the CanoScan LIDE 25 driver.  You can find that on the Canon download page (or download it here locally if they ever stop updating it)
  2. Adobe does not have TWAIN support installed in Photoshop by default anymore.  Instead, you must download their Optional Plugin pack.  It’s important to note that you download the CS6 plugin pack for CS6 or CC editions.  Also note, the TWAIN support only works on the 32-bit version of Photoshop.  It will NOT work on 64-bit versions of Photoshop.
    1. Download the Optional pack
    2. Close Photoshop
    3. Install the option pack by copying it in the right plugin directory for your 32-bit version of Photoshop (see their website for the right directory)
    4. Open Photoshop (32-bit version)
  3. So, you installed the scanner driver and Photoshop is updated.  I open Photoshop and go to File->Import->Canoscan LiDE25.  Sadly, I then get this error message: “Could not open the TWAIN sourceMake sure there is a valid source for your scanner in the TWAIN Directory found in the Window Directory.”Hmmm, what is going on?  I try running the CanoScan Toolbox and when I copy/PDF and hit the ‘Copy’ or ‘Scan’ button, I get this error message:Unable to open TWAIN source. Please check connection then re-start Toolbox.However, if I use a 3rd party tool like VueScan – it is able to capture scans just fine.  So I know the scanner is physically working.
  4. I found this badly aged/broken blog entry, but it describes the solution:
    1. Go to your c:Windowstwain_32 directory
    2. You should see a sub-folder with a number/letter combination,  Mine is: C:Windowstwain_32CNQL25
    3. Add that to your system path variable
      1. Right-click on Computer -> Properties -> Advanced system settings -> Advanced -> Environment Variables
      2. In the bottom System variables scroll-box, find the ‘Path’ variable
      3. Click edit and go to the far right of the ‘Variable value:’ field. Enter the directory to the end of the list, separating it from previous entries by a ‘;’.  Google adding a directory to system path in Windows if you need more help.
        i.e. ;C:Windowstwain_32CNQL25
      4. Save and close the system settings
  5. Restart Photoshop 32-bit – and you should have success!
VS2013 annoyances

VS2013 annoyances

Visual Studio 2013 is by-and-large a pretty nice development environment, but there are at least 2 things that REALLY annoy me.

1. Changed all the default hot keys.  I mean – really?  You just change all the standard hot keys that you’ve used for, oh, I don’t know, the last 3 releases for….no good reason at all?  I’ve had to go back and reset a lot of them.  Why?  I can’t think of any good reason to change defaults you’ve used forever.  If people want to change them, let them change them through the keyboard configurations.

2. Automatically switching to Error List when Visual Studio completes compiling.  Maybe I’m just old-fashioned, but I need to see the Output panel – NOT Error List.

Here’s how to change it back:
1. Tools -> Options -> Projects and Solutions -> General
2. uncheck ‘Always show Error List if build finishes with errors

Windows design fail: Unable to move a folder because of thumbs.db

Windows design fail: Unable to move a folder because of thumbs.db

One of the most annoying things about managing files in Windows is managing media files such as photos and videos.  Windows in all it’s ‘helpfulness’ constantly tries to categorize and create thumbnail icons for all your media files.  The irritating part of this is that it’s constantly doing it – even while you’re trying to move the files or folders in question.  In fact, it seems to ALWAYS be doing this even if it’s already gotten icons for it.  Every directory you select immediately triggers Windows to start categorizing the directory.  So when you try to move the folders in question – you get a never-ending stream of ‘File in use’ errors and you can’t get anything done.

Even better is the fact Windows doesn’t tell you WHICH file(s) are in use (thumbs.db), by whom (Windows itself), nor give you any way to figure it out.  One of the cardinal rules of error dialogs is that they must give you enough information to fix the problem – or you’re wasting everyone’s time and have designed something completely useless for the user.  This fails that test miserably.

What would have been infinitely better is if Windows had the smarts to know IT is the one preventing the folder from being moved and stop doing it for the 2 seconds it needs to move the directory and then start over again.  But we don’t get that intelligence at all.

Instead, do this:

Start Menu-> Edit Group Policy

Select:

User Configuration > Administrative Templates > Windows Components > Windows Explorer
The setting you want: “Turns off the caching of thumbnails in hidden thumbs.db files.”

Google Code closes down – Taskbar Sound Switcher moves to GitHub

Google Code closes down – Taskbar Sound Switcher moves to GitHub

Well, I didn’t have my project uploaded more than a week and Google send me an email informing me that Google Code hosting is shutting down.  Here’s the email:

Hello,

Earlier today, Google announced we will be turning down Google Code Project Hosting. The service started in 2006 with the goal of providing a scalable and reliable way of hosting open source projects. Since that time, millions of people have contributed to open source projects hosted on the site.

But a lot has changed since 2006. In the past nine years, many other options for hosting open source projects have popped up, along with vibrant communities of developers. It’s time to recognize that Google Code’s mission to provide open source projects a home has been accomplished by others, such as GitHub and Bitbucket.

We will be shutting down Google Code over the coming months. Starting today, the site will no longer accept new projects, but will remain functionally unchanged until August 2015. After that, project data will be read-only. Early next year, the site will shut down, but project data will be available for download in an archive format.

The simplest option would be to use the Google Code Exporter, a new tool that will allow you to export your projects directly to GitHub. Alternatively, we have documentation on how to migrate to other services — GitHub, Bitbucket, and SourceForge — manually.

For more information, please see the Google Open Source blog or contact google-code-shutdown@google.com.

-The Google Code team

 

The good news is that the Google Code Exporter works really well.  The only extra work I needed to do was work up a readme.md file.  A handy tool for doing the markup can be found on http://dillinger.io/ which allows you to write on one side and see the results on the other.

TLDR:
So, if you want taskbar sound switcher – it’s is now hosted on GitHub:


https://github.com/mattfife/taskbar-sound-switcher

 

Quick Audio Taskbar Sound Switcher

Quick Audio Taskbar Sound Switcher

When using my computer I often use my speakers when listening to music, watching movies, or coding something up. As a first-person shooter fan, I usually want to use headphones so I can use the mic to coordinate play with the other live players and not completely bother the rest of the people in the house with gunfire, explosions, and ‘colorful language’.

Switching between audio output devices on Windows systems usually requires no less than:

  1. Right-click on speaker tray icon
  2. Left click on playback devices
  3. Right click on device you want to be the default output device in Sound selector
  4. Left click on ‘Set as Default Device’

Fun! Not. Even worse is that many times I click on the game I want to play only to realize I forgot to switch audio devices.  In many games, alt-tabbing out and switching the default audio device doesn’t actually change the in-game playback device.  You have to exit the game and restart.  Annoying.

What I want is a taskbar icon I can simply double-click to switch between headphones and speakers – or any of my many audio devices really.  So to that end, I wrote up an app that does exactly that.  You simply select which devices you want to toggle between (any number) and double-clicking the tray icon simply toggles you to the very next device.

Or, you can right-click on the icon and select the device directly with a single click.

Give it a try.

Click here to download a copy.

The MSI installer is in the source directory.  Even better is that I’ve put the code up on Google Code and it’s open-source under the BSD license.

Drop a line if you found it handy or have suggestions!

 

 

 

42 Rules for Apartment rental (and homebuying)

42 Rules for Apartment rental (and homebuying)

I saw this posting on Reddit and thought it was so good that I needed to save a copy here.

Reddit’s 42 Rules of Apartment Rental

  1. Check for cell reception.
  2. Inspect tops of cabinets, behind stove/fridge, for poop. If there are red/brown stains in the corners where the ceiling meets the walls, it’s bed bugs. If there is a line of white powder along the baseboards, it can mean roaches, but more likely bedbug treatment has been performed. White powder behind fridge, stove, etc. is usually boric acid or diatomaceous earth used to treat roaches. Brown or tan kernel sized paste is also used against roaches. Check the Bed Bug Registry online and ask if the building has a history of any pest problems.
  3. Inspect drawer under the oven and kitchen drawers.
  4. Check the water pressure on cold, on hot, on both, and how long it takes to get warm.
  5. Bring a socket tester and test all outlets. Also make sure there are enough outlets in each room, and enough 3-prong ones.
  6. Ask the neighbors what the worst part of the building, street, neighborhood is.
  7. Request to see the exact unit you will be moving into, NOT a showcase apartment. If they refuse to at least show you an actual unit, be suspicious.
  8. Check to see if you have a designated parking spot (and assure its cost, if any, is satisfactory). How many visitors can you have at a time & is that enough for you? On a Fri/Sat night, or any other evening/night, are there even any available spots? What happens if someone takes your spot?
  9. Drive through the area during rush hour if commuting via car.
  10. What’s in close walking distance? (food, bars, stores, etc)
  11. If touring multiple units, take pictures of each for later comparison. When you decide on one, time-stamp photograph any damage and make sure landlord is notified of it in writing prior to move-in so you aren’t blamed for it later.
  12. Research state tenant’s rights laws.
  13. Make sure you’re completely clear on all terms of the lease and know what utilities you’ll be paying and what payment method you’ll need to use.
  14. When driving around, take note of what kinds of cars are parked around, and if they’re substantially different from yours, your potential new neighbors lifestyle may differ from your own.
  15. Call a pizza place and see if they deliver there after dark. If not, the place may have a history as being unsafe.
  16. Make sure there’s an Internet provider suitable to your preferences.
  17. An experienced landlord is usually better to deal with than an inexperienced one.
  18. Get an idea of the general price range of utilities such as heat and AC for the unit. Ask neighbors in similar units the general price range for heating/cooling.
  19. Google your potential new landlord. Look up online property records in the county you are in. Slumlords will generally have lots of liens against them and/or have multiple properties in foreclosure.
  20. Assure the windows are double-paned/double-glazed and in good repair if the area is cold to avoid high heating bills. See if the windows open and close easily.
  21. Look up crime statistics for the area and ask the police how often they have been called to the street/complex in the last 6 months.
  22. An apartment with laundry facilities will save you money. If they don’t have them, check the prices/quality of the nearest ones.
  23. www.apartmentratings.com may be a useful resource.
  24. Drive through the area at 10pm one day, 2am the next, and see what kind of activity is occurring, especially on Fri/Sat nights. Walk through the complex around 8pm.
  25. Be wary of any musty smells that could indicate water damage. Too many air fresheners may be an attempt to hide this.
  26. Fill all sinks/tubs. Drain simultaneously and flush each toilet during.
  27. Ask if they accept section 8 or convicted felons, if you care about those things.
  28. Find out who does the maintenance (some handyman, a legit company, the landlord?). What are their policies on work orders? Can they be submitted online? What is their response time guarantee for after hours emergencies? If it’s just a single landlord and not a property management company, do they have someone you can call when they go on vacation and the hot water heater breaks?
  29. Make sure the building managers or owners are local.
  30. When scoping out potential neighborhoods, check out the local grocery stores to get a good sense of the type of people that live in that neighborhood. Also check the closest gas station late at night.
  31. Check your responsibilities as a tenant. After moving in many landlords require you to pay the cost of a stopped up toilet, pest infestations, and require you to shovel snow from sidewalk/mow the grass on areas around the house, or clean gutters. They may also require you to pay the cost to fix supplied appliances.
  32. Dress well, and ask for a discount.
  33. If surrounding places have belongings left sitting on the porches (toys, stoves, seating, decorations), it’s a good sign for little/no theft and a kid-friendly environment.
  34. If the leasing agent or landlord promises to do something before you move in, it needs to be written into the lease or it may not happen.
  35. Assure the unit has adequate storage space for your needs.
  36. 1st floor apartments are most convenient for thieves, and the most frequently broken into.
  37. It’s usually best to avoid living in the same building as your landlord, unless the other tenants vouch for them.
  38. If there’s a homeowner’s association, find out its rules.
  39. Find out the policy on smoking, pets, noise, and visitors.
  40. If you must break the lease, what are the consequences/options?
  41. What’s the average rental time for apartments in the building? If people aren’t staying long, it’s a bad sign.
  42. Try to get a look at as many different options in the area as possible so you can see if what they’re offering is competitively priced for the size/type of unit you’re seeking.
Steam: Failed to add new steam library folder

Steam: Failed to add new steam library folder

Until we get 1TB SSD’s for less than $1000, space on them is always at a premium. One strategy is to split your Steam game installs between drives. For slow loading or games you play often, you might want those on your SSD.  For infrequently played games, you likely want those on a big, cheap platter drive. Steam gives you the ability to have multiple libraries on multiple drives, but it doesn’t always work as expected.

I tried recently to add a library to a big platter drive, and got the message 'Failed to add new steam library to folder'. I tried all kinds of ways of creating the library, but always got the same message. My drive was not out of space, I had adequate permissions. I started/restarted steam. No luck.

The problem:
Failed to add new steam library to folder
The issue is that the Steam client cannot add new libraries while anything is happening to the existing game library.  In my case, one single game (way off the bottom of the screen!) was updating.  This activity prevents the Steam client from being able to add a new library folder.

The solution:
Pause or cancel the download/update. Make sure nothing is updating, then go to the Library display view in the Steam client. Then select: Steam->Settings->Steam Libraries Folders->Add Library Folder. You should then be able to select/create new library folders on new drives.

The shaming:
Valve engineers – fix that dialog! Be sure to tell people WHY you can’t create the folder, not just that you can’t. Error messages are useless unless they give you enough information about what’s wrong so that you can fix the problem. Especially one so simple to report.

Installing WordPress using XAMPP

Installing WordPress using XAMPP

When customizing/working on a new WordPress layout – it’s better if you don’t do it on your live blog.  Instead, install XAMPP

http://www.wikihow.com/Install-Wordpress-on-XAMPP

You can then set up the database and install WordPress in the httpdocs/ directory – but that’s not a straightforward/easy process.

Instead of all the extra setup, you can also use Bitnami’s WordPress application that installs WordPress for you and takes care of a lot of the annoying database and other setup bits.  They have versions for Windows, OS X, and Linux to make your life easier.

After setup, instead of the WordPress files being in the normal httpdocs\ directory, Bitnami’s WordPress on top of XAMPP puts the WordPress files in X:\..\XAMPP\apps\wordpress