For some reason, I’ve got it in my head that I need a “fun” project to take up the remainder of my free time. I think it’s going to be a homebrew/DIY snake camera. Something like this, but with the ability to mechanically bend it’s head and assembled for way less cash and from parts I have lying around. If anyone has any links to anything like this already, let me know so I can stop wasting my time dreaming up a design … but I’ve not found anything … yet.
Archive for the ‘Technology’ Category
I’m a pretty big fan of Vmware. As a developer, it’s almost become an essential tool of the trade for keeping around different systems to test with, etc. so when the new beta version was released, I was right there to sign up. Here’s a few of my thoughts on the new beta.
First off, I swear to god Vmware, FIX YOUR DAMNED REGISTRATION FORM!!! I don’t need to fill out 75 fricken check boxes, including checking a check box that says “I’m not going to check any of these check boxes,” to try and register … especially if I have an account at your site. If I have an account, I should just be able to log in, register for my key, and start downloading. If this is the first impression people get of your site, what do you think they are going to think about your product? Exactly. Fix it.
Second, I don’t know why there is this need to shove Vmware Infrastructure down my throat, but you seem to feel the need to. Guess what, 70% of developers don’t need that type of system. Now some people that have to do really, really tricky multi-threaded, super-uptime system … but not me. Stop trying to force me to use something you think I want when for once, the customer actually KNOWS what they want.
Third, where did my windowed interface go??? You’ve replaced my nice, speedy, clean Windows/GTK application with a crap-ass Tomcat Java web-app. I understand the pain and suffering trying to build and maintain 2 different UIs; however, you went completely the wrong way with it. You should have just stuck with the GTK version of the application … cause you know, it runs on Linux and Windows! Damn you to hell with a stick and your stupid web-app up your ear sideways. It used to take me about 15 seconds to define a new system; however, thanks to the new and worthless UI that was obviously skanked from Vmware Infrastructure (there you go, shoving it down my throat again), it takes me almost a minute because of how terrible this new interface is. Don’t get me wrong, I like the new “System Summary” page, and it was missing from 1.0, but the other sacrifices just aren’t worth it. And before you go off into criticizing my hardware, 2.0GB at 2Ghz is enough to run Tomcat’s crappiness.
Other than that, the improved hardware (love the USB 2.0) and the currently running VM’s do great. Keep up the good work … and fix the damned registration page.
Man … it seems like the more of these I post, the more morons actually send me emails asking if I’ll help them out. You’d think that whole part about reporting people to the FBI and letting the Military Commissions Act ruin their lives would bother most people … but not these brave sacks of stupid! Anyway, on to letters.
Continue reading ‘More Letters from Idiots’ »
First off, Code Snippet 2.0 is not mine. I didn’t make it, I won’t take any credit for it. The original creator was the person who hosted a blog at http://blog.enargi.com/codesnippet/ (which no longer works and is apparently down for good; however, it is GPL.). I came across the plugin awhile ago and and I’ve decided that I couldn’t just let it be lost to the ages and I’ll let it live here as long as I’m able.
Straight from the readme.txt, Code Snippet 2.0 is is a WordPress plugin for displaying code with highlighting in blog posts. The plugin uses GeSHi syntax highlighter engine. I’ve seen others, but they’ve gone the way of the dodo and most of them didn’t have as many supported languages at Code Snippet 2.0. I also think that Code Snippet does a better job than the Code Auto-escape plugin.
Install
- Download the plugin here.
- Copy archive to wp-content/plugins directory
- Extract the zip file
- When extracted properly you should have following directory structure: /wp-content/plugins/codesnippet
- Since I’ve not tore through the code, the plugin will probably not work if extracted/copied in diffrenet directory.
- Enable the Plugin
Usage
The original author recommended always wrapping your code in a <pre> tag; however, I’ve found that you generally don’t need to. To use it, simply surround your code with as such and specify your language type:
int main(int argc, char** argv) { return 0; }
[/code]
And you get this:
Or you could do something like:
<?php
echo “Hello World!”;
?>
[/code]
echo "Hello World!";
?>
If you find a bug in it, drop a comment or an email to wyatt dot neal at gmail and I’ll try my best to fix it for you.
Also, if you have find that your language isn’t here and you write your own GeSHi hack to work with it, let me know and I’ll drop a link on this page so that people can find you. Heck, I’ll even put it in the archive so the world can share it if you want. Here’s the list of supported languages: Continue reading ‘Code Snippet 2.0’ »
CSS is pretty cool; however, I think I’m becoming addicted to using it. It appeals to me in that love hate relationship. I love that I can perfect the look of an element … but I hate that I can perfect the look of an element. I continually find myself trying to perfect way to much. For example, right now I’m getting addicted to styling the borders on buttons, inputs, and textarea elements. I really think the defaults are possibly the crappiest looking things in the world.
For the buttons, I’m really like the flat look. I’m not really sure why but I think it gives a nice simplistic look. Though I’m conflicted, because I really like the slightly raised look that changes to a inverted gradient to give it the depressed look when you click it; hence, my addiction issue. I can never really determine what I like. Now I’m sure that most user interface experts would say take the look that fits the rest of the application, but then you come to the issue of what do you decide when that’s one of the first components you’re designing. I think that even though I really like the flat look for buttons, I’m going to reserve that for more of menu types of things, not actually user input buttons.
Now, for the textarea and input stuff, I’m really liking the solid thin border. I think it really gives a good definition to the area especially considering the default is the indentation that only hits the top and left sides. While that’s good if you put the input/textarea on a different background, it’s terrible if the backgrounds match. After staring at it for about 2 hours, your eyes have a really hard time discerning where the element really is on the page … something really important when you are trying to layout the final design. So adding a little darker background that’s about 4-6 shades off from blending and that thing border I love, it really makes things look slick. Yeah, I’m addicted to that
.
Though, you probably don’t need to hear this from me since most anyone that would read this article would know more about what users consider appealing in a user interface. Though, I really think that the usability and designers are a little over zealous with designs needing to appeal to the lowest common brain cell. I admit that I appreciate a guided interface; however, I don’t need every interface I use to hold my hand and look like it was designed for 3rd graders. Would it really kill to have simple, clean interface that might appeal to the engineering mindset? I don’t think so, but then again, don’t trust me … I’m not a ‘certified’ usability guy
.
I have been scouring the Internet for two days for looking for a suitable PHP alternative to DWR(read the previous post for more information) and haven’t found a single one so I’ve hacked out my own.
I had been looking at xajax in the hopes that it would get me what I was looking for, but it didn’t. So the next one I found was SAJAX. This project appears to be less active than xajax; however, disappointment strikes again. SAJAX does not support JavaScript objects, only basic variables. While that’s all well and good, when I need to pass larger objects, that’s extremely fricken annoying!!!
But wait … a glimmer of hope on the horizon … Sanjer promises to combine SAJAX and JSON. Only one major problem, it’s not actively maintained and it’s based on the 0.10 version of SAJAX which had some serialization bugs.
So to end the frustration for me and anyone else on the Internet who would ever want to do something this stupid (it apparently has to be stupid since no one else is willing to pull this off), I present my solution to the problem … hacking SAJAX. Before I delve into what changed, I’m going to give you the files so you can just run with it in the event that you aren’t interested in that crap. This zip includes everything you need to pull this off: Crockford’s json.js from http://www.json.org/, hacked up version of Sajax.php from me, and a simple index.php file that gives a super simple example of how it works. Oh yeah, since this is all based on GPL/Open source code, my derivation falls under the same licensing and comes with absolutely no warranty. Now, on to the other stuff that most people don’t really care about.
Fortunately, the people who wrote the SAJAX framework did a really good job a keeping a very nice code separation. All that had to happen to tweak this was:
- JSON Encode the arguments before they are passed to the proxied PHP code
- Create a new argument array of decoded JSON objects
- Pass in the new argument array
- JSON Encode the function result
Now I know that I could put this encode and decode inside every PHP function; however, I’m lazy and I don’t want to do that, especially if it’s a framework and it should do it for me. Here’s a snip-it of changes I made to the file:
//parse out the args array
$newArgArray = array();
$arraySize = sizeof($args);
for($i = 0; $i < $arraySize; $i++) {
//decode the JSON object
$tmpArg = json_decode($args[$i]);
array_push($newArgArray, $tmpArg);
}
$result = call_user_func_array($func_name, $newArgArray);
//encode the result in to JSON
$retString = json_encode($result);
//echo "var res = " . trim(sajax_get_js_repr($result)) . "; res;";
echo "var res = " . $retString . "; res;"
:215
for (i = 0; i < args.length-1; i++) {
//uri += "&rsargs[]=" + escape(args[i]);
uri += "&rsargs[]=" + escape(args[i].toJSONString());
}
:227
for (i = 0; i < args.length-1; i++) {
//post_data = post_data + "&rsargs[]=" + escape(args[i]);
post_data = post_data + "&rsargs[]=" + escape(args[i].toJSONString());
}
Well, that’s it. Really fricken hard, eh? Yeah, didn’t think so. I’m sure that this version will work for most uses; however, if you do find a bug, feel free to leave a comment or send it to me at wyatt neal on my GMail account and I’ll do my best to help you out. Hopefully this will inspire someone else with more time to come up with a better PHP framework that is a lot closer to the coolness you get from DWR.
If you have one that does what DWR does, drop a comment and let me know. SAJAX, PAJAX, and XAJAX don’t count because I’ve looked at them and I know they don’t provide the same level of use. The only one that comes close is PAJAX but it fails because it does synchronous instead of asynchronous calls by default (what where you thinking people?!?).
So at HTG, we build web applications. Hosted web apps to be precise. For one of our big ones, we choose to go the route of DWR. If you don’t know what DWR is, it’s basically a way of getting a nice JavaScript interface to a back end Java server. That’s all well and good; however, only 2 of our 3 developers liked the idea of going with Java. The third has what can only be described as reverent animosity towards Java … especially after some classes we took in the Engineering college
.
Anyway, I think the best part of DWR is that you get this JavaScript, or files, that give you objects that have functions equivalent to your exposed Java interfaces on the server. The beauty of this is that you can just make calls to something like this in the JavaScript:
src=’/project/remoteSecurityManager.js’> </script>
<script>
if (remoteSecurityManager.loginUser(‘username’, ‘password’)) {
…
} else {
…
}
</script>
Now of course, that code is completely bogus and won’t work for crap (bonus points if you can see why it would never work); however, it’s really nice because it gives you a way to have some people hammer on the server-side and some people work on the UI side without needing to really jump bank and forth from server to client. Well, Java’s all well and good; however, if you remember from earlier, we have one person that “hates” Java. So putting on the pseudo PM hat, I started looking around for some other ways to get that same sort of functionality in PHP … low and behold, such a thing does exist. It’s called xajax and it seems like it gets me the same sort of thing that DWR does. I’ve not read a ton on it, but I’m going to delve into it a little more and let you know what I think.
Owning this domain name comes with a small amount of pleasure and a small amount of annoyance. Today, we’re going to cover the annoyance part (me reporting all these idiots to the FBI). For your reading pleasure, I always try to reply with the most witty response I can think of in 10 seconds (names and email addresses have been removed to protect the innocent, not the criminals). Enjoy!
Continue reading ‘Fan … No, Farce Mail’ »
Recently at HTG, we had the need to have anonymous access to create Trac tickets. This is all well and good if you are using Trac with it’s own built in authentication; however, it gets a little more hairy when you are trying to use PAM for authentication. The big gain from PAM is that our developers only need 1 password for login to the box, login to SVN, and login to Trac. I could have figured this out a lot sooner if I’d read the documentation better; however, that’s not a typical engineer/hacker attitude. Also, this wasn’t able to be found by Google because so many people have “provided by ‘Trac’” in their pages that sifting just took forever. Anyway, here’s our setup for PAM authentication (this goes in your location /projects tag):
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/trac
PythonOption TracUriRoot "/projects"
PythonDebug on
PythonPath "sys.path + ['/opt/trac']"
AuthType Basic
AuthName "Dev"
AuthPAM_Enabled on
Require group admin
</location>
Pretty simple, just sets up our generic stuff. This is what I had to add to change it to get anonymous authentication AND HTTP basic auth when you click the little login button (our Trac is setup so anonymous can read the how-to’s in the wiki, but nothing else).
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/trac
PythonOption TracUriRoot "/projects"
PythonPath "sys.path + ['/opt/trac']"
# AuthType Basic
# AuthName "Dev"
# AuthPAM_Enabled on
# Require group admin
</location>
<location /projects/*/login>;
SetHandler mod_python
PythonHandler trac.web.modpython_frontend
PythonOption TracEnvParentDir /opt/trac
PythonOption TracUriRoot "/projects"
PythonPath "sys.path + ['/opt/trac']"
AuthType Basic
AuthName "Dev"
AuthPAM_Enabled on
Require group admin
</location>
There is probably some repeat stuff in there; but it doesn’t seem to break things. Hope this helps someone else out there looking to do the same thing. As a side note, this is not generally a good idea since your are sending basic auth (i.e. plain text) login info over unencrypted connections.
Update:Stupid Wordpress wasn’t auto-escaping the code correctly, if you view it now, you should be able to see the location tags used in the apache configuration.
Google has added a feature I’ve been crying for since the advent of Google Maps … way points. In Google terms, they call them Multipoints, but it doesn’t matter, the functionality is still there. No only can you specify multiple places you want to go, but it’s only a drag-and-drop movement to change your route and have it automatically updated. Check it out for yourself by going to Google Maps and firing up the directions.
