Archive for the ‘Technology’ Category

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 :-).

Popularity: 38% [?]

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:

:119
//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?!?).

Popularity: 36% [?]

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:

<script type=’text/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.

Popularity: 33% [?]

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’ »

Popularity: 26% [?]

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):

<location /projects>
        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).

<location /projects>
        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.

Popularity: 32% [?]

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.

read more | digg story

Popularity: 43% [?]

That’s right, our second iteration for the REM project has been completed. What is the REM project you ask … sorry, can’t tell you, that’s proprietary and you’d need to sign an NDA … nah, I kid. While I don’t want to spill all the beans, I will say that we are working on an web-based, AJAX-ie-nebulous type of application that will hopefully kick some major booty down here in the Tri-state area … those of you who know what it is and what it does … keep ‘yer yaps shut until we get so far ahead of the competition that Google decides to buy us ;-).

The big things that I’ve taken away from this project already are:

  • 1. How cool agile programing approaches are.
  • 2. How badly there is a need for a standard for Java-scriptish libraries.
  • We’ve been working with the Dojo Toolkit and while it is very robust … the voodoo that one must conjure into making things function is unbelievable. From functions that die magically in the middle of running without warning (check your commas (,) in JavaScript) to things like programmatically creating a pop up dialog widget only to have it cover your “user input” area because there is a magic order to doing it one way over the other, Dojo is filled with all sorts of things that would make a lesser programmer cry. Still … it is better than writing it by hand and pseudo-object oriented programming is better than nothing. Anyways, I’ll have another post up shortly about some idiots that have come across my site, but haven’t managed to read my blog (oh yeah, you know what I’m talking about :cool:).

    Popularity: 46% [?]

    “Gmail for Mobile” is something I’ve been looking forward to for a while. I must say I’m very impressed. I was a little panicked when I went to log in and there was no “save my password” check box, but that is some magic that happens in the background :-). Browsing messages looks beautiful on my Nokia E60. I love that a lot of the AJAX-ey sort of stuff like showing multiple messages, searching through contacts, clicking on messages and having them expand just like they do in Gmail. It really provides a very crisp and responsive user interface. I also like the fact that I can view most attachments right in the application itself. Here’s a link if you want to download it directly to your computer to hack around with:
    http://gmail.com/app/v1.0.0/en/gmail-g.jar

    read more | digg story

    Popularity: 58% [?]

    First off, I’m sorry it’s been a while since I’ve updated. I’ve been insane busy fighting the battles that need to be fought at the house; however, I do want to document this since I can’t seem to find how to do it anywhere else on the Internet and I know that I can’t be the only other person in the world that would ever want to store a PKCS#12 certificate in OpenLDAP using C. It took a little longer because I wanted nice clean sections of code for people to look at. Kudos to the Code Snippet [direct download] plugin for making that happen, originally found at http://blog.enargi.com/codesnippet/. (The guys blog is down and has been for some time … I though I’d make it available to anyone else who wanted this kick-ass plugin.)

    First a little background information on the “userPKCS12″ object in the schema. I quote directly:
    PKCS #12 [PKCS12] provides a format for exchange of personal identity information. When such information is stored in a directory service, the userPKCS12 attribute should be used. This attribute is to be stored and requested in binary form, as ‘userPKCS12;binary’. The attribute values are PFX PDUs stored as binary data. OpenLDAP note: “;binary” transfer should NOT be used as syntax is binary

    Now does anyone else think that it’s really stupid that the file is STORED and REQUESTED using the “;binary” transport syntax, but that you aren’t allowed to use it? If you do a Google on this, you’ll find a nice little mail message about someone who was trying to overcome this issue but never said how he did it … and that’s what I’m here to fix.
    Continue reading ‘Storing PKCS#12 Using the OpenLDAP C API’ »

    Popularity: 56% [?]

    Well, after 10 years I finally decided to get a new monitor. No, the old 15″ CRT is still working fine, you just have to jiggle the cord every now and again to get the color to go back to normal instead of the funky purple haze.

    I must admit, I was a little leery of getting a wide screen monitor though I’m not really sure why. Movies are wide screen, DVDs are wide screen, and most TVs are wide screen these days; however, I’ve never had to sit and stare at a monitor that was a wide screen. I think the big turn off was I saw wide screen laptops before I got the chance to try out a real monitor. I don’t care what you say, it’s not a “lap”-top with a 22″ monitor.

    Needless to say, I’m beyond impressed. At $190 shipped (thanks New Egg), this has been one of the best computer investments that I’ve made in a long time. With 1440×900, 5ms, 32-bit goodness, my eyes love it. It’s super bright, though some have complained that it’s too bright … I’d say those people are wusses and aren’t used to burning out their corneas on a daily basis. One of the best parts is that there is NO DRIVER for it in Windows (Winblows) XP, it just works like it does in Linux (Xorg was a touch fussy for a moment, but we’ve come to terms). If you’re in the mood for a new monitor and want something that’s big enough to see everything, but small enough to not emit unhealthy doses of gamma radiation, I highly recommend this monitor.

    Popularity: 56% [?]