This post over on Cool Tools is one I’d like to mention here. It’s something I’ve been using myself. The gist is, that you can utilize Google’s incredibly awesome expertise in running email-servers by using their free Google App service. I use it to debug things that I’m working on. I have one of my domains on Google Apps and used it to create ten different email accounts for testing my websites. It’s been a real set-it-and-forget-it experience for me.
Update: I was also reading someplace else that you can use a + syntax in your gmail addresses. So if my gmail address is bob@gmail.com, I can also use bob+sometag@gmail.com and use the “sometag” part to create a filter. Most services will treat this as a different email address from bob@gmail.com, but gmail itself does not. So you can effectively do bob+test1@gmail.com, bob+test2@gmail.com, bob+test3@gmail.com to create N new gmail accounts. Nifty.
Facebook URL Hacking »« MySQL Commenting Gotcha
The — comment operator must be followed by a space. So if you have a comment like a header up top…like below
-- mysql engine v1.2
-- this is more commenttt
-------------------------
-- further comments below
This will cause an error on line 3. The second line has no space in it at all. At least they have a reasonable error message for this, but it’s easily missed if you don’t read the error message.
Email Server Tip »« Turning a pile of spaghetti into a set of nearly orthogonal grids
This is really the heart of the problem I’m dealing with. I have a plate of spaghetti. My client has given me a zip of over eleven-thousand files, full access to their servers, and a mission to fix this mess.
I have no other info to go on. So what do I do? I’ll tell you what I do.
Compile the .java source files. If you cannot get it to compile GTFO.
If you’re still with me…install the site, get it halfway running, on my dev server. Begin to follow links in the browser, quickly fix easily-fixed broken links. Save my work. Tear down the server. Start over.
This time through most of the links work. Now is when this gets to be a rinse-and-repeat thing…get some logging statements into the important methods. Something like “entering MyClass.doStuff()” and “exiting MyClass.doStuff()”. Fix easy-to-fix compiler warnings…just the safe ones. Rebuild, push the changed classes or the whole application on your dev server. Click through it. Look through the log file(s) and note your “entering”/”exiting” messages.
Rinse-and-repeat. Eventually that plate of spaghetti will look like some weird Asian cuisine, all artful and orthogonal.
MySQL Commenting Gotcha »« Go Daddy Hosts on Macs?
i spent a good amount of time on the project today. which for me is about 7 hours. that brings my total up to around 110 hours. i haven’t taken a check yet though. i’ve been thinking that this whole thing is TOTALLY FUCKED but i’ve got some confidence now that i can straighten things out. i just need to fully step through this one flow on the site….and then i can show it off a bit. the site is an astrology-related site, and the flow i’m trying to nail down is the one which allows a user to enter in a precise birth place which will allow for calculating the ascendant and the moon-sign.
this whole site was built by some old-school type nerds using vi and CVS. it’s my first real big exposure to struts and velocity. i’m not at all impressed with either, and wonder what it will take to at least upgrade to struts 2. i think there are some real issues with the way struts 1 handles forms. the site was initially built around 2002 and there must be some big improvements in some of these libraries since 2002. the site is old enough that when it was built Java’s XML support was a complete fucking mess. that was changed at least as early as JDK 1.4, and has probably been further improved along the way to Java 6. we’re also upgrading from MySQL 3 to 5.1. So far that part has been pretty much painless.
the project is pretty hardcore. for him to find someone else that can handle it…he’s definitely going to be paying that coder around $80/hour or more, perhaps as high a rate as $200/hr. there’s some C involved, some JNI…it’s not for the feint of heart. at least i’ve taken some steps forward with the work. but until it is something presentable i’m going to be a worried guy. it’s been on my plate since October and now we’re halfway to February. even i think that’s slow moving. maybe if i work a lot of hours in these next couple of days i can show him a graph of the time spent and how it is unmistakably increasing.
Go Daddy Hosts on Macs? »« Nice use of EC2 and S3
I’m currently using them to host a dev-version of one of the sites I am working on. It is pretty damn slick, so far. I’ve been using these instructions to make custom AMIs at each critical point. So when I got the database working…I ran the scripts to save it off as a custom AMI, and it saved everything that I wanted it to. The tables were intact, the data inside the tables was intact…I am presently saving off the newest AMI to see if this is all-good now that I have my Joomla-based content pulled over into this new instance.
Turns out that worked great! Best idea I’ve had in a while…or the best idea that I’ve had which I followed through with.
A Little Update on the new Java Project »« JNI Tip on Linux
I’ve been banging around on a few different things, one being setting up my new Dell Mini 10 to run Ubuntu and to try and get World of Warcraft running on it. Just need to get a driver of some sort to enable the IDE-to-USB cable in Linux.
I like the Mini 10 over the 9 because of the keyboard. You just could not do a lot of programming on the smaller keyboard…the brackets and curly-brackets were on a function key so yeah.
The JNI tip is this…do not use System.loadLibrary(String library_name). On Linux you will need to update either your java.library.path or the Linux library path. The java environment option would be okay, but running inside of Tomcat, I noticed a change in the library path from the context of being called inside a taglib tag, inside of a jsp. Something about this didn’t work well, but once I used the System.load(String filename) call everything worked.
I think what’s going on is that loadLibrary() is using the operating-system’s way of searching for dynamic libraries. Configuring your OS to do this is sometimes difficult or not permissible. It’s best to avoid the trouble and just use load(). But I recommend that you’re working from Eclipse try to set the startup parameters of the JVM…open Windows->Preferences, type “jre” into the search box there…select the Installed JREs option, highlight the one you’re using in the list, and click the Edit button. You will find a textbox there for “default JVM arguments.” Do the “-Djava.library.path=” thing there. If you can get this to work, it’s sort of the preferred way.
Now if I can just figure out how to make this linux-style C code work from a DLL on my Windows machine, I will be all set!
Nice use of EC2 and S3 »« Did I Really Just See That???
Sometimes when you’re doing this programming thing…you’ll see something that defys belief. For instance, I’ve been fucking around with a JNDI name trying to get the right name to make my website talk to my database. I added in some log4j logging code and a more descriptive error handling…then I see a message telling me the site and the db are talking, but the db isn’t understanding what I’m saying. I examined the SQL and the error message mentioned something like “no table named ITEM” in your database. I noticed that the table is really named “item”, lowercase. I changed the SQL to lowercase and it fucking worked. Are you kidding me? The name of a table is case-sensitive? That can’t be true man!
A little bit of searching shows me that yes, it’s true. On Unix anyway…MySql table names are case sensitive, depending on your OS.
JNI Tip on Linux »« Handbrake Pain In The Ass
So handbrake, the most popular video-editing tool for Windows (and a lot of other platforms) does not come with support for the SAMR audio codec.
Proprietary codecs piss me off. Guess I should convert everything I own to OGG huh? Yeah right…
So I was futzing around trying to get past this SAMR crap….I tried out VirtualDub but that didn’t seem to work either. Finally I opened up the Adobe Media Converter (good ol’ proprietary Adobe) and it was able to crank out a .f4v (Flash video) file for me, with working audio.
Which I dragged into Handbrake and converted to .m4v because Flickr doesn’t accept Flash video. Maybe I will just find someplace that isn’t Flickr to host it.
Did I Really Just See That??? »« android tip