I haven’t had a whole lot to blog about lately as I have been stuck doing some Java work that won’t ever really see the light of day (as far as the to the public), so I decided to start posting some of my commonly used PHP functions. I use this function urldecodeObject() along with the mysql_fetch_object() when I’m fetching urlencoded data from a mysql database. This makes it easier than typing urldecode($obj_name->property) every time I need to access/output a property.
It’s April 1st and some of the websites I frequent are pulling out the usual this April Fools Day.
The one I look forward to every year is WorldOfWarcraft.com. They are saying they’re coming out with a new console game, World Of Warcraft: The Molten Core – the graphics on this would make your Atari 2600 drool with envy. WoW.com is also announcing a new playable class – the Bard. Those two are okay, but my favorite is on their forums, it seems that they’ve replaced every period in a sentence with some funny internet acronym including: lol, lolwut, lolcats, lawl, roflmao, i LOL’d IRL, kekekeke, IMO, etc
YouTube.com has to have one of the funniest inside joke April Fools ever. If you’re not familiar with what “rick rolling” is look it up on urbandictionary.com. It seems that YouTube is rick rolling us if we goto their site and click on any featured video.
I recently decided to use one of the cool new features of Dreamweaver CS3 in a site I was developing – the Spry AJAX Framework – more specifically the Spry Tab widget. After Googling for a bit I couldn’t seem to find any page that showed how to make the tabs switch by clicking a link either inside the content of the tab or somewhere else on the page.
The first link I found recommended using the query string of the URL to tell Spry that you wanted to open a different tab. Although this approach works, it requires including another javascript file and adding a bunch of unnecessary syntax at the end of your links. Since many sites already do this when they’re loading actual pages, I think this method could get confusing. This method, however, is the only way to make it so your browser’s back button will work between tabs.
It turns out, after browsing the SpryTabbedPanels.js file, this is pretty easy to accomplish with plain javascript (if you don’t mind the back button functionality not working). You will be invoking the showPanel() method of your tab control. You must call this function on the main tab control’s id. Below is an example of what it would look like if your Tab Control was named “TabbedPanels1” (the default in Dreamweaver CS3).
<a href="javascript:TabbedPanels1.showPanel(1);">Click Here to Switch to Tab 2</a>
I was writing some PHP for a customer of mine and encountered a very annoying problem with Dreamweaver CS3, two problems actually….
Authentication Failures
The first was solved pretty easily, it seems that Dreamweaver won’t play nice with an sshd that isn’t configured to have PasswordAuthentication yes. So if you’re getting a login/password error the first thing to do is to goto the web server open up sshd.conf and make sure that the “no” is a “yes”, and then restart the ssh daemon. It seems “no” is default on a lot of Linux systems.
If you don’t have access to your sshd.conf, try contacting your server admin, if they don’t help you might be stuck using an application like Cyberduck (Mac) or WinsCP (Windows) for uploading files to SFTP.
Note: I have heard this could cause a security issue as it may enable “clear text” passwords which means your password may not be encrypted as it’s sent to the server. I can’t confirm this, so if anyone happens to know, please leave a comment.
SFTP Not On Default Port 22
The second problem is even more annoying: You can’t change the SFTP/SSH port in Dreamweaver CS3!!! What the hell Adobe?? We’re locked in to using port 22 as our SFTP, even if the server we’re working with is using 10022 (as was the case for me today). Although I love Dreamweaver and wouldn’t dream of using another app to write PHP in, I can’t believe that for the cost of it compared to other (free) software you can’t even change the SFTP port.
Okay, enough complaining… there’s got to be a work-around right? Of course! This work-around is only for Mac users, however Windows users will be able to do the same thing with plink.exe (available at The PuTTY web site). Using plink.exe to forward ports is somewhat confusing, so be prepared to do some research.If you’re using a Mac it’s much easier, what we’ll be doing is mapping port 22 on our local machine (IP 127.0.0.1 or localhost) to the remote ip address and remote port using the ssh command.
Today I finally got my hands on the long anticipated Flex Builder 3! For most of my projects since October I’ve been using the beta version – it feels great have this software finally out in the world. At first glance, I can’t see many changes from the third release of the beta but I haven’t had much of a chance to get under the hood yet. I’ll post updates as I start to use the software.
It’s that time of year again, I haven’t really had much to post lately; I’ve been working alot and playing a little World Of Warcraft. I have some interesting things going on in the C# front. I have written a full blown socket server in C# that I plan on making available after the first of the year. We’ve had some problems with Vectren (a natural gas provider in Ohio and Indiana). Apparently they don’t like their customers receiving their usage data in any form other than on their site. I’ve contacted so many people there it’s ridiculous. We finally decided it would just be better to write a server that parses the HTML on their website and then serves the information back out through TCP to our devices. It’s going to suck when they change their website but we pretty much have no other options. In this day and age it’s hard to believe that companies like Vectren refuse to work with 3rd parties from a technology stand point. What’s the point the of giving customer’s access to data that they can do nothing with?? We’ve worked with so many other companies that are willing to bend over backwards for us to get us their data, DP&L has been awesome for instance – why is Vectren so slippery with their data?
I’m heading back to Las Vegas next week for a sales training class we’re putting on for some west coast partners. As part of the training we’ve developed a Jeopardy game to dull the boredom a little. After searching the internet for some type of quick and easy way of getting Jeopardy into our presentation I wasn’t satisfied with the solutions others were offering, so I wrote my own solution. Our Jeopardy game is a flash movie that uses an XML file to create the game board. It’s very easy for someone to modify the XML file to suit their own needs. I plan on releasing this movie and xml to the public when I return on Friday – I think this will help a lot of people – especially teachers who like using a Jeopardy type of game in their class rooms.
About a month ago I broke down and bought an iPhone. Here are a few things that in my opinion need to be fixed or added to the iPhone.
Features that Need Fixing
Speaker Phone Volume – This has got to be one of the most annoying things I’ve ever had to deal with on a cell phone. Sometimes I feel like the speaker is louder through my ear piece than my speaker phone. It is absolutely unusable unless you are in an extremely quiet place – we’re talking pin drop here. Unusable while driving even if the windows are closed.
Key Board – Currently it’s very clumsy to go back and edit a word that you have already typed. Most text boxes including the To field of an E-mail or the Address Bar of Safari are at the top of the page. You can’t even see where your cursor is in the textbox when trying to go back and correct something. It’s easier to just retype the entire thing. I think this should be fixed by adding Arrows to the keyboard.
Features Request
Video Recording – I mean c’mon any $50 camera phone let’s you record video as well as still images, what’s the deal?
Audio Recording – I mean c’mon any $25 phone let’s you record audio! What’s the deal?
Picture and Video Text Messaging – I can e-mail pictures but I can’t “text” or SMS pictures. Most phones with a camera allow you to do this (Motorola Razr anyone?)
E-mail Multiple Photos – If I have a couple photos I’d like to share with a couple friends I need to send a separate e-mail for each photo. It might not sound bad, but it can be really annoying. Over the holidays some family members asked me to e-mail them some of photos I had taken earlier in the day. I had to create a new e-mail for each of the 6 photos and select all 10 names from my contacts list for every email/photo. That’s 60-70 clicks/taps for something that should have been able to be done in 10.
Bluetooth Music Server – Allow me to “broadcast” my iPod through Bluetooth to devices like car stereos and other receivers. I’m sick of having to choose whether I get my ears blown out by my FM transmitter because of cell phone interference or to go Air Plane mode and be unable to receive calls in my car (it’s a cell phone damn it, where else would I need to receive calls when I’m not at home).
Tilt – Allow me to use the horizontal tilt functionality in more apps including Maps, and especially Mail and SMS. I can type 20 times faster with the bigger horizontal keyboard – at the very least allow the keyboard to be flipped horizontal at any time, even if the underlying app doesn’t change its orientation.
Add GPS to Maps – I think this one is a no brainer. While you’re at it, add voice guided directions so I can say Bye Bye to Tom Tom.
So that’s all I could think of for now. Many people may think that things like voice guided directions or the Bluetooth music server wouldn’t be possible, but in fact they should be quite simple for Apple to do. The OS is based off of OSX which already includes support for voices. The device does support Bluetooth so I don’t understand why it would be hard to make the iPod work with it. As for audio and video recording there are already people (outside of Apple) who have made applications that perform these functions on jail broken phones.
I’m hoping by February we’ll see alot of these features from Apple, if not, they’ll be giving us developers the SDK for the iPhone so we’ll be able to write them ourselves. First person to write a Speaker Phone Volume Booster gets $100 from me via PayPal 😉
So far the only problem I’ve had with my new MBP and Leopard has been mounting shares from a Samba share on a Linux box we have at work. For some reason, I can’t just goto Go > Connect to Server in my Finder menu like I should be able to. After a few hours of trying everything on both the Linux box and my MacBook, I figured out the only way I could view my share was by connecting manually using the command line or by mounting the share to a folder also using the command line.I was sort of disappointed because I wanted my shares to connect as any other external drive would – a USB hard drive for example. If I connect the device, it shows up on my desktop until I unmount. If it’s not connected, nothing shows up. I decided to write a BASH shell script to take care of this for me.
A few key things to remember when creating a script:
1. To get the script to execute when you double click the file, it must have the “.command” extension in the filename. You can simply create a blank plain text file, write your script and save it as filename.command.
2. The script must have execute permissions. The easiest way to do this is to pop open the terminal and type this:
chmod +x /path/to/File.command
After you’ve created your script, saved it to the location of your choice, and given it the proper permissions it should work just great. The last step (in my case) is to have your script run at login. Goto your System Preferences > Accounts > Select Your Account and click on the “Login Items” tab. Now just drag your .command file into the list and presto you’re done!
Below is my script, obviously you’ll need to customize it for your needs, but it should help you as a step in the right direction. I couldn’t find anything like this when I Googled so hopefully this is of help to someone.
This script will: 1) Search for the Samba server by IP Address, if it exists 2) create a folder on your desktop and 3) mount the SMB share to the folder it created, or… if the share doesn’t exist (can’t be pinged) it will attempt to remove the empty share folders from your desktop if they exist. Click “Read More…” to view the entire script.