Thursday, May 16, 2013

Change Background Image with a Fade Transistion Using CSS and jQuery

I came across a question recently regarding how to use a 'fade' effect when changing/rotate through various background images. The sites I've been working on lately seem to all utilize large background imagery and I have written several custom background rotation scripts to accomplish rotating homepage hero type effects with background images. The jQuery involved is something for another posts, but the CSS to achieve a fade effect is very simple.

You can fade a background image using CSS3 transitions. I have accounted for non-CSS3 browsers in jQuery implementations using more complex strategies, but for most applications this CSS3 strategy will do just fine. It will offer a nice fade on compatible browsers and just a plain transition on others.

Set up jQuery to change the background image, but apply the transition style using the below CSS. Anytime the background changes, it will transition according to the CSS3 style.


 #header 
{
    background: url('images/header_slides/slide_1.jpg') no-repeat;
    transition: background 0.5s linear;
    -moz-transition: background 0.5s linear; /* Firefox 4 */
    -webkit-transition: background 0.5s linear; /* Safari and Chrome */
    -o-transition: background 0.5s linear; /* Opera */
}

Saturday, May 11, 2013

Using Multiple Google Accounts with Chrome

Google Chrome's ability to keep your history, bookmarks, passwords, and even tabs in sync across devices is awesome, but what happens when you bookmark a great new article for work and you are on your personal computer logged in to your personal Google account? You get to work the next day and have to sign out of your work Google account in Chrome and sign in to your personal Google account which is time consuming and too much trouble. What if you could take your work Chrome browser home with you and have access to your personal Chrome browser at work? It would be amazing right?

Well, it is possible and it truly is amazing. Imagine RDP'ing into your work computer just to access a saved login and bookmark... forget it! Now you can just switch Google accounts and Chrome and you are practically on your work computer using your work browser. How is it done? Pretty easily actually!

To setup and switch between multiple Google Account on Google Chrome:
  1. Login to Chrome with Google Account A.
  2. Click the Options/Tools/Settings icon Chrome menu.
  3. Click 'Add New User' under the 'Users' heading.
  4. Login with Google Account B.
  5. Click Google Account B in your User list and click 'Edit' to set a custom icon and account name.

  6. Switch back to Google Account A by clicking the (newly appearing) icon in the top left corner of Chrome and selecting Google Account A.
  7. Go back to the User settings and click on Google Account A and then 'Edit' to change the icon and account name, just like Step 5.

  8. You can now easily switch between accounts by clicking the icon at the top left corner of Chrome.
Limitations:
  1. You cannot have multiple accounts open in the same window. Each account must have a dedicated window.
  2. You cannot drag tabs between Chrome windows that are logged in on different accounts.

Tuesday, May 7, 2013

Finding Latitude & Longitude on Google Maps

Why is finding Latitude and Longitude with Google Maps so annoying? Why do we even need it anyway? Well, sometimes the application calls for it and we must dig in and discover the lat/long coordinates of a location on a map... a Google map. There are ways to do this and everyone seems to have their own way, but there is a magic button that can do this for you so easily it will make you embrace lat/long all over again!


  1. Simply drag this bookmarklet to your bookmarks bar.
  2. Visit Google Maps and find your point of interest whichever way you like.
  3. Right click and center the map on that point.
  4. Click the bookmarklet and you'll be presented the Lat/Long.
The script ties in with Google's scripts and returns the lat/long of the center point of the map. This has been incredibly useful for me and I suggest keeping it handy for that dreaded day you need to look up multiple lat/longs for some project of your own.



Credit goes to: Ian at iTowler



Friday, May 3, 2013

ColdFusion cfqueryparam MS Access Data Types

Once you get comfortable with it, ColdFusion's cfqueryparam is an excellent tool. It can enhance security, tighten up code, and conveniently ensure the correct data types are being used in your database statements. If you have looked in cfqueryparam at all, you've surely noticed that Adobe provides an excellent cfqueryparam cross-reference of data types for all sorts of databases... except MS Access.

I inevitably ran across the need to use cfqueryparam with a MS Access database and was struggling to match the data types. Access data types can be obnoxious, especially when the db designer has taken it upon himself to establish an obscure Access data type for every column. Thankfully, cfSearching provided a helpful table cross-referencing Access data types with cfqueryparam data type attribute values. I can vouch for the note that "when using the Unicode driver, the correct type for MEMO fields is CF_SQL_CLOB (not CF_SQL_LONGVARCHAR). "

Credit goes to cfSearching for the cross-reference, but here it is in case their page is down or goes away for whatever reason... it would be a shame to lose this information!

ColdFusion                  Jet                     MSSQL
CF_SQL_BIT                  Yes/No                  bit
CF_SQL_DECIMAL              Decimal, Currency       decimal, money, small money
CF_SQL_FLOAT                Double                  float
CF_SQL_INTEGER              Long Integer            int
CF_SQL_LONGVARBINARY        OLE Object              image
CF_SQL_LONGVARCHAR          Memo                    text, ntext
CF_SQL_MONEY                                        Double                      
CF_SQL_REAL                 Single                  real
CF_SQL_SMALLINT             Integer                 smallint
CF_SQL_TIMESTAMP            Date/Time               datetime, smalldate time
CF_SQL_TINYINT              Byte                    tinyint
CF_SQL_VARCHAR              Text                    varchar, nvarchar, sysname

Tuesday, April 30, 2013

How to Temporarily Unroot Your Android

I previously posted about Flixster not allowing me to watch my Ultraviolet Digital Copy of Dredd since my Galaxy S3 was rooted (CM10.1). I have since seen lots more complaints about apps that block rooted Android phones. Most of these apps have to do with digital media, so the anti-root lockdown isn't surprising... even if it doesn't really make sense. The debate as to why a rooted Android would be blocked from using a specific app is immaterial. The fact is, Android root blocking apps exist and there is something you can do!

It is actually a simple and awesome app called OTA Rootkeeper, by none other than Project Voodoo. The techno-wonder that brought you Voodoo Sound and many other great Android utilities and apps. OTA Rootkeeper allows you to 'unroot' your Android temporarily. It backs up your 'root' and stores it away for safekeeping until you need to go back to using root-required apps like Titanium Backup and Root ExplorerOTA Rootkeeper keeps your phone 'unrooted' as long as you need to use stingy anti-root apps like Flixster, but can restore root on command to set everything back to normal again!

Using OTA Rootkeeper is a very simple 3-step process, though be sure to read all the warnings.... it is not compatible with all Androids and configurations. I am running is on a Galaxy S3 CM10.1.

  1. BACKUP ROOT: Launch the App, give it Superuser permissions and tap 'Protect root'
  2. UNROOT: Tap 'Temp un-root (keeps backup)'
  3. RESTORE ROOT: Tap 'Restore root'


Wednesday, March 27, 2013

How to Switch Between Multiple Accounts for Marvel War of Heroes for Android



Marvel War of Heroes has got me hooked! It is available on both iOS and Android and allows playing between players on both platforms. Like many mobile games out there, this game 'throttles' you as you only have so many energy points or attack points to spend before they recharge. This results in only a few minutes of gameplay at a time before you can't really do anything else and have to wait for your energy/attack to recharge.

You can keep the Marvel War of Heroes gameplay going by setting up multiple accounts and switching between them on your Android. It is as easy as tapping a widget and selecting a different account before you re-launch Marvel War of Heroes! There are a few different ways to do this, but this specific method couldn't be easier!

How do you switch between multiple accounts on Marvel War of Heroes for Android?
*Each account needs a UDID (Unique Device ID). If you create the accounts on different phones, you don't need to worry about this. If you are creating accounts from one phone, you'll need to force the UDID to change which can be done a few different ways. I am not going to explain how to change your UDID. I don't recommend doing it and it can cause issues with other apps that are installed. The best practice is to just create alternate accounts on alternate devices.

Use Titanium Backup Pro and setup multiple profiles for the app.
First of all, Titanium Backup Pro is a must-have Android app (see here and here). The main point here though is that setting up multiple profiles in Titanium Backup is easy and quick.

  1. Select the option to setup/switch profiles toward the bottom right of the main Titanium Backup screen.
  2. Tap "Create a new data profile..." (this is your primary account, so name it appropriately).
  3. Go ahead and make additional profiles for any additional Marvel accounts you have.
  4. Tap Backup/Restore at the top of the main Titanium Backup screen and find Marvel War of Heroes.
  5. Long press on Marvel War of Heroes and select the option "Enable 'multiple profiles' for this app"
  6. Now add the Titanium Backup Data Profile switcher widget to your home screen. You can tap this widget to quickly change between profiles/accounts.
  7. Use the widget to change to one of the alternate accounts you've setup and then re-launch Marvel War of Heroes normally... it will ask you to login. This login will be associated with the currently selected Titanium Backup profile.
  8. Use the widget to change to your primary account and re-launch Marvel War of Heroes. You'll be logged in as your original/primary account.
  9. Now you can easily switch between accounts and keep the game going!
    

Monday, March 25, 2013

ColdFusion and "Reserved Words" for MS Access

While I normally only use SQL Server, Oracle, or PostgreSQL, the need inevitably arises to work with an Access database in ColdFusion. Sometimes it is solely for data migration, sometimes to meet a client's specs, but regardless of the reason... there is this annoying thing that must be dealt with when using Microsoft Access databases: "Reserved Words".

You see the issue is that you can't use Microsoft Access reserved words in ColdFusion queries or they will blow up... and the kicker is: there are a LOT of reserved words. Check out this list of reserved words for Access 2000 alone. This means you will inevitably encounter issues when writing queries.

There is a very simple solution though! Simply escape these reserved words by placing inside [brackets]. For example, a column named DATETIME will need to be referenced as [DATETIME].

Hopefully you found this blog post helpful. Sometimes the simplest solutions are the hardest to find!