Chrome Remote Debugging Nexus 7 on Windows 8

After running into issues with the instructions on the official Google page for Remote Debugging, I had to do some sleuthing to figure out how to make Windows 8 run remote debugging of my Nexus 7.

The trick (as usual) is drivers. If you’re running the “adb devices” command and coming up with no devices, or perhaps you’re running the full “adb forward tcp:9222 localabstract:chrome_devtools_remote” and getting “Device not found”, even after typing in “adb kill-server” … then you’re in the right place.

  1. Plug in your Nexus 7 and follow the instructions on the official Google page for Remote Debugging. Basically download and extract the Android SDK, set up your device for USB debugging, and set up Chrome for web debugging
  2. In Windows 8, right click in the bottom left side of the screen (where the “Start” button used to be). Click “Device Manager”.
  3. You should see a Nexus driver with a warning triangle like this nexusdriver
  4. Click “Update Driver”, and select “Browse my computer for driver software”.
  5. Find the folder where you installed the Android SDK and choose the folder: /sdk/extras/google/usb_driver. Make sure you keep “Include subfolders” checked.
  6. Your drivers should be successfully installed
  7. Now go to command line and run “adb kill-server” followed by “adb devices” and you should see your Nexus like so:Untitled

Hope that helps you along. Happy debugging,

Mike

 

Damn you Windows Server 2012!

Recently I set up a dedicated server with SoftLayer as a hosting provider. They offered the choice between Windows Server 2012 and 2008. When trying to find documentation on the versions of 2008, I noticed an interesting thing – Microsoft has removed all documentation for Server 2008! Here, give it a try.

  1. Google “Windows Server 2008”. Other than Wikipedia the first link is “Windows Server 2012”.
  2. Visit this Technet link for Server 2008 documentation. Click “Windows Server 2008 R2 Editions Overview”. Where you do get? “Windows Server 2012: How to Buy”

See what I mean? I even chatted with a representative on their website who basically told me to fuck off and buy Server 2012 already. Refused to provide any information on the versions of 2008, or where I could find reliable information.

 

Continue reading

Ajax variables in Atlassian Bonfire for JIRA to access session state

If you didn’t know already, you can insert variables into your issues with Bonfire. It comes with four default variables: cookies, useragent, title, url. You insert them into your issue summary like so {useragent}, and Bonfire will replace it with something like this:

*Mozilla/5.0 (Windows NT 6.1; WOW64)….*

Or for the pictorially inclined:

You can read more about it [here](http://confluence.atlassian.com/display/BONFIRE/Templates+and+Variables). What I’m more interested in is creating custom variables. These vanilla variables are fine indeed, but often you need more debugging information before you can proceed to fix the issue. After the break I will show you how to create your own Ajax requests *in Bonfire* to get more complex information about your users (in particular **session** variables!)

Continue reading

Wincache vs APC Data Performance

I was interested in the performance of PHP’s APC cache vs the new Wincache touted by Microsoft. Essentially Wincache is APC for Windows (no duh!). I am only interested in their performance at storing variables and arrays in memory, and not any of the OPCODE stuff. Part of the reason is because I think they would be equally performant, and another part is that I have no f’ing idea about OPCODEs. Another thing is that I am not testing on server farms, so I was only evaluating single-server solutions (i.e. ignoring memcache) Enough with the hors d’oeuvres, let’s get to the meat of it.

Continue reading

jColourStrip: A jQuery Gradient Colour Bar

Here’s a fun little plugin I wrote. I wanted some really neat syntax to display little coloured bars that go from 0% to 100% width and as they grow they change colour from say red to green.

It’s very tiny, and easy to use.

* [Demo](http://mikemurko.com/demos/jColourStrip/demo.html)
* [Download .js](http://mikemurko.com/demos/jColourStrip/jColourStrip.js)
* [Download .zip](http://mikemurko.com/demos/jColourStrip/jColourStrip.zip)

Here’s all the syntax you need on your page to make it work (Note **0.2** is the percentage of the bar that is complete):

$('.default').jColourStrip();
<div class="default" title="0.2"></div>

CakePHP 2.0 Plugin Webroot URL Rewrite on IIS 7

After trying my hand at CakePHP and falling in techno-geek love with it, I ran into a problem with how CakePHP 2.0 Beta runs it’s plugins’ webroot content. Just so we’re on the same page, the 2.0 documentation hasn’t been updated as of writing (Aug 14, 2011) to include any changes to how plugin’s webroot work … so I’m assuming it’s pretty much the same as 1.3. The docs for 1.3 state:

The urls to plugin assets remains the same. In the past you used /debug_kit/js/my_file.js to link toapp/plugins/debug_kit/vendors/js/my_file.js. It now links to app/plugins/debug_kit/webroot/js/my_file.js

Perhaps this works in Apache, but I’m running IIS7 and it does not work for me. In my layout (or view, whichever) I tried inserting the following code:

$this->Html->css('/manager/css/menu.css')

Continue reading

jQuery Keycode Cheatsheet

These are just Javascript keycodes, but when I searched originally I typed in “jQuery keycodes” and didn’t get much. This should be of help to someone in any case. Cheat away!

It’s useful for when you’re using the keydown, keypress, and keyup functions in jQuery. You’d use them in a way like this:

$('#textbox').keyup(function (e) {
if (e.keyCode == 13) {
alert('Enter key pressed!');
}
});

Continue reading

PHP IIS7 Web Platform Installer 3.0 Unsupported OS Error!

OK, so while trying to install PHP 5.3 on IIS7.5 from this page I kept getting an error message saying that I was not using a supported operating system. The issue is that I was using Windows 7 (and later Windows Server 2008) which are both supported operating systems. I don’t have a screenshot of the error, but if you’re reading this – you probably know what I mean. This can’t be an isolated issue and maybe reveals a deeper issue with Microsoft’s bad OS detection mechanism.

How did I fix it? Pretty simple actually. It turns out that I had Web Platform Installer 2.0 installed. The PHP IIS site uses WPI 3.0, so maybe there is a version incompatibility. To get around it I went to Internet Information Services (IIS) Manager, and double clicked “Web Platform Installer” under Management. This did a quick upgrade to 3.0, and then I was able to download PHP 5.3.5 in a snap from the Window that comes up!

Basically – don’t use the website to install it.

Note: Another useful product to install with WPI is “Microsoft SQL Driver v2.0 for PHP v5.3 in IIS” found under “Products”>”Database”. This allows you to easily connect PHP to a SQL Server database using PDO.

God almighty that was a lot of acronyms. I count 6.

Chow,
-Mike

Find sticky tags with Tortoise CVS in Windows 7 and Vista

Situation: I want to find a list of all the files in one of my CVS directories that have sticky tags. The code may have been stickied weeks ago, but is no longer receiving updates to the code due to it being fixed!

Problem: Any new (post XP) version of Windows does not allow custom columns in Windows Explorer.  Back in the Windows Server 2000, or XP days when you installed Tortoise CVS you would get a few columns (such as current revision and Sticky Revision) added to any CVS folders in Explorer.

Solution: After trying out a few different types of file managers with no success I finally found the solution inside Tortoise CVS. What you need to do is:

  1. Right-click your root CVS folder, go to the CVS menu, and click Update Special.
  2. Check the box “Get tag/branch/revision” and leave it as Head.
  3. Go to Advanced, and check Simulate update. Now don’t worry, NO FILES WILL BE UPDATED. You won’t be returning your whole application to head branch.
  4. Click OK and after CVS has run it should provide you with a list of files that will be returned to Head branch (basically the files you had stickied).

Hope this helps someone out there who had the same problem as I did.

Happy source-controlling,

Mike

jQuery UI Autocomplete Dynamic Delay

As part of a project I’ve been working on recently I chose to implement a jQuery UI autocomplete bar. Now, due to the application I have heavily customized it. One of these customizations is something that I call ‘dynamic delay’. So what is it? Basically the delay time varies depending on how many characters have been typed into the input box. As the user’s query becomes more specific, the delay dies off. So if you enter in “a”, it will wait a second until it returns any results. If you type in “as” it will have a 0.5s delay. I think it makes for a nicer user experience (than simply having a minimum character input). Also, from the ajax I only return the Top 25 rows, that way the load is never too high on the database. Click below for a demo, or read after the break to see how I do it. For best effect type “harry” slowly into the textbox in the demo … you’ll see the shortening delay.

Continue reading