Category Archives: Tips

Archive for April

The Qualities of a Successful Dating App

 

 

These days, thousands of mobile applications are developed and marketed by the minute. However, only about a handful of them become popular and successful. Planning to create your own app? Application and software programming has become accessible now that even the least tech savvy person can design his own app. Theres even an app for creating an app, for crying out loud.

 

If you want your app to be the next Tinder, the trick is to design it in a way that will allow it penetrate the consumers consciousness. Easier said than done, though. To help your application gain the attention of gadget users, you may want to take into account the following qualities that have made so many apps successful.

 

Original – Many people would say that nothing is truly original anymore. Originality is still the key, however, in ensuring the success of an app. If you cant pull anything new out of thin air, then how about putting a fresh spin on an old idea? Case in point, the Plants vs Zombies game. Theres nothing new about zombies, right? In fact, they have become so ubiquitous. You see them in the movies, televisions, and comic books among other stuff. Some game developers, however, were able to create something new and exciting from such overly saturated horror movie staples. What would this mean for a dating app you ask? Well, the idea is not to re-invent the wheel but merely to turn the wheel. So look at the things that are already out there, making money in the dating space and then add your own original spin to them. For instance, Tinder pulls pictures from Facebook, so maybe somebody should make a dating app that pulls pics from Twitter or Instagram?

 

Problem solver – An app that makes life a bit easier will certainly find its audience. Some of the best apps in the market are those that address a problem that nobody pays attention to and then provide a solution for it. Whether its a budget planner or calorie counter app, users will get a kick out of it when they find it useful in solving their problems. So, think about what some of the biggest dating issues are out there, things like approach anxiety or running out of things to say solve these issues and youll have a winner.

 

Excellent design – You may have a unique, wonderful idea but if is poorly designed, its unlikely that youll even make a dent in the market. Just like when you go on a blind date first impressions count in a tough market, and this is especially true now that consumers tastes have become more sophisticated. Apart from minding the aesthetics, some of the things you should watch out for are glitches and device compatibility.

 

Mobile devices have become as powerful as desktop computers. Their processing power has provided creative programmers with a digital sandbox to play on. All it takes is one unique idea. If you already have one, good for you. Thats a good start. Just remember that to make it widely popular, you dating app has to be fresh, useful, and well-designed.

Things You Should Avoid If You Want To Attract Women Successfully

 

cute-nerd-girlThis article is supposed to be about what to do to attract women. When it comes to that subject, however, what you should do and say are less important than what you shouldnt do and say. Confused?

Well, heres the thing about attracting women: Not showing eagerness is the best way to get their attention.

Dont say anything  No matter what pickup line you have under your sleeve, theres a high probability that your target will be turned off the moment you open your mouth. The sad part is, she might have taken notice had you decided to stay silent.  So whatever opening line you have prepared, avoid being a fool and  try to be mysterious instead. Not many of them may admit this but women gravitates toward mysterious types.

Dont shower them with compliments  Women naturally get hit on so many times. Whatever compliment you have in your mind, theyve heard it all before. The most crucial mistake you can make when approaching the opposite sex is to give up your own value and say something flattering to get her approval.

Saying things like, Youre absolutely beautiful or You have the most gorgeous eyes (hair, body, etc.) that I have ever seen in my entire life will get you nowhere. You are only giving her power over you.  Once your prospect feels this, shell immediately lose interest in you. While its fine to find a woman beautiful, gorgeous or amazing, you shouldnt forget to place value on yourself. This way, shell see that you are worth the attention.

Dont be such a nice guy  Its pretty common knowledge that while a man is attracted to a woman based on her looks (among other things), a woman is attracted to a man based on how he makes her feel. This is very tricky as you might mistake the part of making her feel good for being super nice. If you are not careful, you run the risk of doing what she wants and, worse, putting up with all her bitchy and controlling behavior. Being extra nice to women may make them feel comfortable (OMG, you are so sweet!) but it doesnt make them feel any sort of sexual attraction. It only makes them feel as if they found a best friend or even a brother in you.

There have been tons of advice out there on what to do to attract a woman. The best you can do, however, is to mind your every move and consider the things that you shouldnt do. Change your tactics and who knows, you may improve your chances in going after any woman you like.

Ajax.Search based on Prototype

Ajax.Search displays search results on the fly when typing into a search box, similar to Spotlight search results in OS X, and also the new Apple.com search box.

Try the Ajax.Search Example:

  • Type ‘Bacon’ to get the first example results set (definition list)
  • Type ‘Waffles’ to get the second example results set (unordered list)
  • Type anything else and see the results not found message

Features

  • Search results display as you type, with configurable time between keystrokes (so the server is not hit with every single keystroke)
  • Up and down arrow keys highlight each result, return key sends user to search result url, escape hides the search results
  • Only required output from the server is a HTML unordered list (<ul>) or definition list (<dl>), which can be styled with CSS to look however you want

How to use it

All you have to do is include prototype.js and ajax.search.js into the head of your document, then tell your page to load Ajax.Search like so:

  Event.observe(window,'load',function() { new Ajax.Search({
      url: '/ajax.search/search.php', 
      results_container: 'search_results', // default
      input: 'search', // default
      loader: 'loader', // default
      search_interval: 1000
    });
  });

Or, you can do the minimalistic approach, as long as you name your HTML elements with the default names listed above:

  Event.observe(window,'load',function() { new Ajax.Search({
      url: '/ajax.search/search.php'
    });
  });

Check out the source, try it out, break it, and let me know what you think.

AJAX.Search WordPress Plugin

I use the Spotlight feature in OS X an awful lot. While some people would rather use things like Quicksilver, I like just hitting command+space and typing in what Im looking for, be it a document or even an application I want to open.

 

Thats the inspiration for AJAX.search, a search system built on Prototypes AJAX framework. It will make a call to a URL you specify and display the results under your search box like Spotlight (and now, like the search at Apple.com). From there you can hit the up or down arrow keys to select a result and then hit the enter key to visit the link.

 

I also built a WordPress plugin that uses AJAX.search in the default search box, and in fact you can test it out on this sites search box right now. By default the plugin will search all your posts and display them in the results grouped by category.

 

If you want to try it out on your WordPress install, you can download the plugin here. There are still features I still want to implement, and it may not work on all WordPress versions (Ive only tested on version 2.2.1). Eventually there will be a configuration page in the admin to allow you to change a few settings, such as number of results to display and whether to show categories in the results.

 

Download the AJAX.search WordPress Plugin version 0.1

 

If youre using K2: make sure you turn off Advanced Navigation in the K2 options, since K2 has an AJAX search function that will collide with this one. If you want to keep Advanced Navigation on, youll have to comment out the Javascript in the K2 header file that sets up the K2 AJAX search.

Trick your Computer Into Finding Web Sites on Other Servers

Quite often I’ve dealt with moving sites from one hosting situation to another. One issue that comes up is checking to make sure the site works on the new server, but you can’t check it because the domain is still pointing to the old server. Most clients are not okay with just waiting until the DNS switches over to the new server before finding out if their site is broken or not, so what to do? It turns out you can trick your computer into thinking the site really does live on the new server, so you can check it and verify everything is working correctly. Here’s how.

 

Whether you are on Windows, Linux or OS X,  you can tell your computer as event correlation to look for web sites at alternate IP addresses regardless of what DNS servers tell it. There is a hosts file that you can modify to do just that.

 

On Linux and OS X, this file is /etc/hosts, while on Windows it is the C:\WINDOWS\system32\drivers\etc\hosts file. The format is the same on both platforms, so you can use this trick no matter what OS you use. Here is the default one from OS X:

  ##
  # Host Database
  #
  # localhost is used to configure the loopback interface
  # when the system is booting.  Do not change this entry.
  ##
  127.0.0.1       localhost
  255.255.255.255 broadcasthost
  ::1             localhost

The setup is pretty simple. Enter the IP that you want your computer to point to, with the domain name you want it to use. So if you are in the process of moving www.clientwebsite.com from Dreamhost to Bluehost, then you’d find out the IP of the new server at Bluehost and enter at the end of the file like so:

 

  123.123.123.123 www.clientwebsite.com

Now clear out the DNS  cache on your computer to make sure you’re not viewing the site from your DNS cache. On windows, open up the command line and type ipconfig /flushdns. In OS X, open up Terminal and type lookupd -flushcache. I also recommend clearing your browser cache.

 

Open up your browser and go to the web site you just entered in the hosts file. It should now point to the new server. If not, make sure you remembered to flush your DNS cache.

 

Now you can save yourself some trouble with moving sites and make sure they work before you switch them over. Your clients will be happy, and more importantly you’ll have peace of mind that you won’t be getting calls from panicking clients that their site is broken.

Install ImageMagick from source on OS X Tiger (and Leopard)

Ive tested and verified this also works on OS X Leopard. An additional command was needed to make the JPEG library install without errors, noted below. Ive also updated the commands outlined below for the latest versions of the software.

 

If you’re like me and use mini_magick or (or RMagick) Ruby gems on OS X for building Rails apps, installing ImageMagick can be a pain. There is a universal binary package which works alright, but I prefer to build apps from source when possible. Also, I run a few web sites on my G5 Power Mac and I want ImageMagick to be compiled specifically for the PowerPC platform, which will get me a bit of an advantage in speed and reliability. I ran into a few roadblocks while getting it all compiled and installed, so I thought I’d share how I did it.

 

First off, I should mention that I only added in JPEG and PNG support for ImageMagick, so if you need more formats supported, this article doesn’t cover it. You’ll also need the OS X Developer Tools installed on your system. Finally, I did this on the latest version of OS X (Tiger 10.4.9) for PowerPC and Intel Macs. Both tested working. Update: Also tested on OS X Leopard on Intel.

 

Here is a list of packages you’ll need to download. Get all of these and place them in one directory.

  • JPEG
  • LibPNG
  • ImageMagick

Once you’re done downloading, open the Terminal app and go to the folder you downloaded the files to. For example if you downloaded them do your Desktop, type the following in the command line and hit enter:

cd Desktop

Step One: Compile and Install JPEG Libraries

Installing the JPEG libraries is actually the trickiest part of the install. By default on OS X building and installing the JPEG libraries won’t install any libraries at all, only some binaries that allow you to manipulate JPEG files.

 

Update: I also discovered while installing the JPEG library on Leopard that it needs the /usr/local/man/man1 directory to install without errors. I added the command below to create it.

So here’s the magic to force it to install JPEG libraries that ImageMagick will use while compiling:

tar zxvf jpegsrc.v6b.tar.gz cd jpeg-6b cp /usr/share/libtool/config.sub . cp /usr/share/libtool/config.guess . sudo mkdir -p /usr/local/man/man1 ./configure –enable-shared –enable-static make sudo make install sudo ranlib /usr/local/lib/libjpeg.a cd ../

Done! You shouldn’t have gotten any errors. If you did, then make sure you definitely have the OS X Developer Tools installed.

Step Two: Compile and Install LibPNG

This is pretty straightforward, and doesn’t require any weird tricks to get it to work.

tar zxf libpng-1.2.24.tar.gz cd libpng-1.2.24 ./configure make sudo make install cd ../

Step Three: Compile and Install ImageMagick

This is pretty simple too. We don’t have to pass any special options to ImageMagick either. It should automatically pick up that we have JPEG and PNG libraries installed and compile in support automatically.

tar zxf ImageMagick.tar.gz cd ImageMagick-6.3.8/ ./configure

After ./configure is done, you should check to make sure the following lines are present in the output that indicated JPEG and PNG support are in there:

JPEG v1 –with-jpeg=yes yes PNG –with-png=yes yes

If those are both set to yes, then you’re golden. Now finish him!

  make
  sudo make install

Unobtrusive Javascript Pop-up Links

One of the things I dislike the most about writing HTML is creating links that open in new windows. Since I try to make all my HTML standards-compliant, I can’t use the target="_blank" attribute in my links anymore, since it’s been deprecated in XHTML. Many have followed the new standard of making an inline onclick attribute of the link open the window, including myself. But what a pain it is to type it all out and remember the exact code to do it. Instead of this:

  <a href="http://www.example.com" onclick="window.open(this.href); return false;">External Link</a>

Wouldn’t it be easier to type this?

  <a href="http://www.example.com" rel="external">External Link</a>

I’m sure you’ll agree it’s much cleaner, easier to type, easier to remember, and to top it off, it’s (kind of) symantically correct. While the possible attribute values of rel do not include external, using it as a keyword to denote the relationship between an external page and your link makes sense. Best of all it validates with the W3C validator with flying colors.

 

How to Make it Happen

 

So how do we make the magic happen? The answer is with our good old friend Javascript. Basically we’re going to make a function that will crawl the document after the page loads and check for links that have rel="external" in it, then attach an Event.observe to each link that will cause it to open in a new window (note that you’ll need Prototype.js for this to work).

Here’s the code:

  function external_link(link) {
    var el = Event.element(link);
    if (el.tagName == 'IMG') {
      if (el.parentNode.tagName == 'A') {
        var el = el.parentNode;
      } else {
        return false;
      }
    }
    window.open(el.href);
    Event.stop(event);
    return false;
  }
  function init() {
    var links = $A(document.getElementsByTagName('a'));
    links.each(function(link) {
      if (link.getAttribute('rel') == 'external') {
        Event.observe(link,'click',function(e){ external_link(e); },false);
      }
    });
  }
  Event.observe(window,'load',init);

Note in the external_link function it checks if the item clicked was an image tag. If it is, then it will look up one node in the DOM tree to see if the image was enclosed in an anchor tag, and attach the event to that instead (since it contains the href it needs to open). If it doesn’t find anything, it will exit quietly.

Load this in your document header and off you go. You should be able to add rel="external" to any link on your page and it will open in a new window. Remember you need a copy of Prototype loaded as well. Leave a comment if have any questions or improvements.

Make Graticule Failover to other Geocoding Services

The Graticule Ruby gem makes it super easy to geocode addresses using multiple services. One thing I’ve found in developing Unthirsty is that sometimes a geocoding service either fails to be reached or the address couldn’t be found. So as a precaution, I’ve set up a way for Graticule to failover to another service if a lookup fails. Here’s how.

 

First, set up a list of your preferred geocoding services. Graticule expects a service name and optionally an access key. Some geocoding services like Ontok don’t require a key. However Google does, and it’s probably the one you’ll want to use over the others. Order your geocoders so your preferred geocoders are listed first.

 

  PREFERRED_GEOCODERS = [
    {:name => :google, :key => '[your key here]'},
    {:name => :yahoo, :key => 'My Service'}, # yahoo will take any string for a key
    {:name => :geocoder_us, :key => 'My Service'} # same with geocoder.us
  ]

Take your pick of geocoding services. Graticule supports quite a few:

  • Google (Free)
  • Host IP (Free, get geocode info by IP)
  • Yahoo (Free)
  • Geocoder.ca (Free but throttled, or paid service, Canadian locations)
  • Geocoder.us (Free for non-commercial use)
  • Local Search Maps (Free)
  • Meta Carta
  • Postcode Anywhere (Paid, locations)

 

Now it’s time to put those geocoders to use. This method loops through your PREFERRED_GEOCODERS array and sets up a new Graticule instance with the service name and key you provided. It will then try to locate it with a lookup to that service. Calling the locate method on a service instance will raise an exception if an error occurs, so it’s possible to rescue all the different errors you can get while doing a lookup.

Note that this was used in a Rails project, so I’m using logger, a built in Rails logging facility. You may want to substitute your own logging method if you’re not using Rails.

 

  def geocode(query)
    PREFERRED_GEOCODERS.each{|service|
      begin
        geocoder = Graticule.service(service[:name]).new(service[:key])
        result = geocoder.locate(query)
        logger.info("Found address [#{query}] with service [#{service[:name]}]")
        return result unless result.precision == :country # probably not worth keeping
      rescue Graticule::AddressError => detail
        logger.error("Nothing found [#{query}] with service [#{service[:name]}] (#{detail})")
      rescue Graticule::Error => detail
        logger.error("Nothing found [#{query}] with service [#{service[:name]}] (#{detail})")
      rescue Graticule::CredentialsError => detail
        logger.error("Invalid credentials [#{service[:name]}] with [#{service[:key]}] (#{detail})")
      rescue Errno::ECONNREFUSED
        logger.error("Connection refused to #{service}")
      end
    }
    raise Graticule::AddressError.new("Couldn't find address [#{query}] with any service")
  end

The failover works because since we are in a begin..rescue block, a raised exception will cause it to skip over the return result line, log the exception, then move on to the next service. But if a lookup succeeds, it will return a new Graticule::Location instance that contains the results, and not go any further. If no lookups are successful, it will raise a new Graticule::AddressError exception that you can trap while calling the method in your code.

Also notice I don’t return a result if the :precision attribute is :country There’s pretty much no use for it if you’re going for specific addresses. You may want to adjust it based on your needs. Maybe you only want results that have :address precision.