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!

Friday, March 22, 2013

How to Dynamically Restrict From/To Dates with jQuery UI Datepicker

It has been awhile since my last post, but things sure have been busy over at Limelight Web Development! Anyway, I figured it was time to update the blog and pass along a useful piece of jQuery magic!

You are probably familiar with jQuery UI Datepicker already. It has a lot of options built in, a couple of which allow you to restrict the selectable 'to' and 'from' dates. The provided examples over at the jQuery UI site are useful on a single implementations, but what if you want to implement this across your entire site and not have to mess with it any more?

Let's assume your forms have a consistent structure across your entire application/site, like so:

 <!-- To/From Date Form Block -->
<form action="/action/" id="myform" method="post" name="myform">
  <div class="horiz">
    <div class="leftColumn">
      <label for="from_date">From:</label>
      <input class="datepicker" name="from_date" type="text" value="" />
    <div class="rightColumn">
      <label for="to_date">To:</label>
      <input class="datepicker" name="to_date" type="text" value="" />
  <div class="submitWrapper">
    <input name="submit_dates" type="submit" value="Submit" /> 

The main requirement being that all date inputs have class "datepicker", all from fields contain "from" in the name attribute and all to fields contain "to" in the name attribute and they are each descendants of a 'form' element. They don't have be direct children as you can see in the example code block above.

Now to implement datepicker across the entire site with automatically restricted maxDate and minDate on the appropriate fields, the following code will do all the work for you. It will make the to-date's minDate the same as the from-date's selected date. It will make the from-date's maxDate the same as the to-date's selected date.

 //jQuery UI Datepicker Universal Config
  showAnim: "slideDown",
  dateFormat: "mm/dd/yy",
  onSelect: function(dateText, inst){
   if( $(this).attr('name').indexOf('from') > -1 ) {
    var $from_date = $(this).datepicker("getDate");
    var $to_date_input = $(this).closest('form').find('.datepicker[name*="to"]');
    $to_date_input.datepicker("option","minDate", $from_date);
   } else if( $(this).attr('name').indexOf('to') > -1 ) {
    var $to_date = $(this).datepicker("getDate");
    var $from_date_input = $(this).closest('form').find('.datepicker[name*="from"]');
    $from_date_input.datepicker("option","maxDate", $to_date);