I felt the need to propagate to the interwebs a good resource I found today for setting up SSH to a guest OS using a host-only network:
http://muffinresearch.co.uk/archives/2010/02/08/howto-ssh-into-virtualbox-3-linux-guests/
I am running VirtualBox 4.1.4, but the blog entry is still quite relevant. The only difference is how to set up a host-only network. In the VirtualBox Virtual Machine Manager, under menu option File choose Preferences. Click the “Network” tab in the window that follows, and then you will see an interface for adding host-only network adapters.
The default network address is still 192.168.56.1, so the everything after that is applicable.
I recently wrote some functions in the global jQuery namespace that add array utilities. The list is small right now (only 3) but I hope to grow them as I have time, and can optimize as well. They are inspired by some useful PHP array functions that I have missed on the client-side.
Continue reading →
jQuery 1.4.4+ includes this already, using DOMElement.getAttribute(), but for prior versions you can bind an element to the getData event. This event is fired internally by jQuery.fn.data if you attempt to retrieve data for a key that has no corresponding value in the data cache. The event handler can then be used to query the element.dataset store, or use getAttribute() as a fallback.
Continue reading →
The PHP world has been somewhat boring for me lately. That’s why I found it necessary to post about two PHP projects that recently caught my attention. I’m hoping to find some excuse to use them.
The first is Elgg – The Open Source Social Networking Engine (http://www.elgg.org/index.php). The base framework provides a social networking site, but the power lies within its API through actions, hooks, events, and web services. These tools can power not just your base site, but client apps for your site (think Facebook Connect type stuff). Pretty cool.
The second project, Neural Mesh (http://neuralmesh.com/) is a bit more esoteric in that it provides a PHP/MySQL framework to build neural networks. It provides an administrative panel for building networks and training, and an API to do the same through remote calls. There are demos within the site, give them a try!
A friend at work introduced me to a site that I found quite handy. It is http://downforeveryoneorjustme.com/
Down for everyone or just me? tests a URL to see if the corresponding site is available from their server. If the site does not respond, then the site declares “It’s not just you!”.
Truth is, I don’t know what is being tested. Perhaps a response code? That would make sense. I also don’t know where its being tested – and that is more important. It may attempt to resolve the URL from multiple servers, that would be the most helpful.
However, it is still pretty neat. Another tool for the kit, another site saved to favorites.
As PHP applications grow into complex object-oriented systems, developers look to create centralized components to execute repetitive tasks. These include logging, emailing, redirects, and more. The Observer pattern is a commonly used design pattern to hook such components into an application during runtime, thereby making them reusable. Since PHP 5.1, there are two interfaces built into the Standard PHP Library (SPL) that can be implemented to use the Observer pattern in your application. They are SplSubject, and SplObserver.
Continue reading →
Today I found a nifty little hack that appears so far to work for IE8 on STSoftware Support Forum. It apparently has to do with the fact that IE8 ignores multiple id selectors.
I decided to test it out on the infamous fieldset – legend IE bug. The display issue came to my attention not by IE, which had been fixed using the usual relative/absolute positioning fix. The “bug” reared its ugly head in Firefox 3.6, which now positions the legend absolutely from the top-right corner within the padding of the fieldset. This being the case, I had to make one of two choices:
- Eliminate the fieldset padding
- Eliminate the absolute/relative positioning built only for IE
I decided to go with option #2. However, to do this we had to preserve positioning one way in IE 6/7, and another way in IE8. This CSS ‘hack’ is actually more of an anti-hack. By that I mean, whatever styles are placed will affect all browsers except IE8. So let’s take a look at how this works.
Continue reading →