Category Archives: Dev

Dealing with hosts on Android SDK Emulator – MAC OS X 10.8

I was getting some odd bugs with responsive design on some Android phones and need to test it. After spending an afternoon at the Shopping Mall annoying the everyone to let me test every Android phone I could find I decided to install the Android SDK on my MB Air running OS X 10.8

After some tweaks I managed to set the emulador working, there is plenty of tutorial online on that I couldn’t test my dev sites because I always use hosts and your localhost on the emulator 10.0.2.2 (if using MAMP with port 80 or add the port after the ip eg 10.0.2.2:8080).

So my solution was:
As I use a define so I only change one file from dev to production I have a define for my WEB_URL the only question was to change that define:

if($_SERVER["SERVER_NAME"]=="10.0.2.2"){
	define("WEB_URL", "http://10.0.2.2/myfoldername/public_html/");	
}else{
	define("WEB_URL", "http://myhostname/");
}

BONUS TIP: Giving the Emulator localhost access

When you create a Avd you need to give it a name change myAvdNameHere to the name you gave Avd and this way you have access to localhost

emulator -avd myAvdNameHere -partition-size 128

More on this Emulator localhost acceess

Note to self:

cd ~/Development/android-sdk-mac_x86/sdk/tools/
./emulator -avd phone -partition-size 128

Mysql Delete with null left join

If you do:

Select * from table left join other_table on id=ext_id where ext_id is null

it works great. But if you want to convert that select to a delete you need to include ‘table.*‘:

Delete table.* left join other_table on id=ext_id where ext_id is null

It kind of makes sense, but MySql could be smart and get that we only want to delete from where there actually exists content.

Analysis of long tail keywords for SEO with Google Analytics

After the recent Mayday update to Google SERP I decided to have a look into how much was the long tail keywords influenced by this.

Long tail keywords are normally keywords with 3 or more words. To track it down I used the following regular expression: [^\s\+]+(\s|\+)+[^\s\+]+(\s|\+)+[^\s\+]+

Steps inside Google Analytics. Traffic Sources->Search Engines->Google->Non paid

On the filter keyword [containing] I input the regular expression: [^\s\+]+(\s|\+)+[^\s\+]+(\s|\+)+[^\s\+]+

After I just tracked down the last 3 month number of visits with and without filtering the long tail and calculated the % value of the longtail.

long tail keywords/total organic = % of the value for the long tail

5 minutes and I realised that mayday update did *not* influence my sites long tail keywords.

Hope that helps and if someone knows of a simpler or more effective way to do this I would love to know.

User Experience Professionals

I just order two tickets to http://www.ux-lx.com/

I am really happy that this kind of events happen in Portugal as it gives us (Portuguese developers) a chance to learn and share experiences and knowledge.

UPDATE: minutes after I emailed about this I received a friendly response and the issue bellow was solved. Great job.

I am not one to normally nag and complain about stuff, but for a user experience professionals conference this menu issue made me laugh:

Anyway, and as I started complaining having http://www.ux-lx.com/index.html and http://www.ux-lx.com/ both working is not a very good thing for SEO.

P.S. – Sorry about this guys at http://www.ideias-imagens.com/ but just couldnt resist.

Flash – Resize and Crop – Faces Thumbnails

Flash Resize and CropAfter my last post about image resize using flash I did some research and found this:

Flash based cropping tool released (LGPL)

I tried to get it to work and saving the crop server side.

I manage to get to work pretty easy on my local server but after uploading it the php was giving me trouble.

So I stripped it down and now its working great: flash resize and crop

If you want the source: download

I found a very cool script using JavaScript that does almost the same as this one: Prototype JavaScript Image Cropper UI

About flash client side resize, no luck.

I found several Java ones and also I know that is possible to do it in flash but the methods I found were to explode the image pixel by pixel and then pass it like that into php. From what I could understand quality problems and flash player frozes on large images were the problems using that option.

Anyway. I think this was a great step foward.