15Feb

Hi All,

If you haven’t seen this awesome menu system check it out: http://www.andrewsellick.com/examples/sliding-side-bar-scriptaculous/

Or check out the how-to here: http://www.andrewsellick.com/44/sexy-sliding-menu-for-scriptaculous

I really thought this menu system was cool and with a few tweaks can function as integral part of the user experience on a website. Recently I had decided to leave the fabulous world of Prototype/Scriptaculous and move to JQuery. Mostly because it seems the industry has standardized around JQuery. It had some what of a learning curve, but it took about a day to really make the switch. Having to convert this sideBar script really helped with that process.

As a final note before I post the code. The animations aren’t exactly the same, but with JQuery you can create your own custom animations so feel free to modify as you wish. Changes are below!

side-bar.js:


var isExtended = 0;

$(document).ready(function(){
$("#sideBarTab").click(function(){
$("#sideBarContents").animate({ "width":"toggle"},{duration:2000,queue:false}
);

if(isExtended==0){
$('#sideBarTab').html($('#sideBarTab').html().replace(/(\.[^.]+)$/, '-active$1'));
isExtended++;
}
else{
$('#sideBarTab').html($('#sideBarTab').html().replace(/-active(\.[^.]+)$/, '$1'));
isExtended=0;
}
}
 );
});

So thats cool… In my script I also wanted somewhat accordion style items expanding within my sidebar so I use the following line of JS to dynamically add items into the sidebar (well sort of, without giving too much away).


$("#divIdToAppenedTo").append("<li><a class='header' href='#' onclick='$(\"#"+slug(name)+"\").animate({\"height\":\"toggle\"},{duration:1000,queue:false});'><div style='margin:10px 0 0 15px;'>"+name+"</div></a><div id='"+slug(name)+"' style='display: none; padding-left:15px;'>");

Woo enjoy!

10Feb

So I have been struggling for the past month trying to get a Perl CGI script that acts as a proxy to work on certain servers. The client only supports/allowed perl (as far as i knew) and didn’t allow it to output data to a browser for some reason. So you can see my dilemma. I tried various means. Worked with their IT team, etc… I kept trying to find alternative methods. I knew JSONP was an option but it’s not like RSS feeds are in JSON or are coming from a JSONP server. Finally someone told me about YQL. In short, I am pretty impressed. I essentially used it as a proxy and XML -> JSON converter. The script in JQuery is really short and goes like this:

var maxEntries = 5; // if 0 then there will be no limit

function slug(str){
 return str.replace(/\s/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').toLowerCase();
}
/**
 * This function appends rss feed items to divs with the same slug
 * Name is the title of the feed, when slugged i use it as a div id
 * File is the rss feed
 */
function newFeed(name, file) {
 $.getJSON("http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%22"+encodeURIComponent(file)+"%22&format=json&callback=?", function(d) {
  var count = 0;
  //grab ever rss item from the json result request
  $(d.query.results.rss.channel.item).each(function() {
    //if set up to be infinite or the limit is not reached, keep grabbing items
    if(maxEntries == 0 || maxEntries>count){
     var title = this.title;
     var link = this.link;
     var description = this.description;
     var pubDate = this.pubDate;
     // Format however you want, I only went for link and title
     var anItem = "<a href='"+link+"' target='_blank'>"+title+"</a><br>";
     //append to the div
     $("#"+slug(name)).append(anItem);
     count++;
    }
   });
 });
};

I hope you guys find this useful. It made my life a ton easier to deal with. Coming soon… I’ll show you how to convert Andrew Sellick’s Sexy Slide Menu for Prototype to JQuery! WOO!

5Jan

So after much debate on how a useful CMS should function in this day and age I decided that a CMS is no longer something like joomla, and in fact should function like wordpress but allow for easy plugin development as well as management. Many of you already know my love for cakephp. I have many plugins already developed for cake, and other people do as well so my team’s current plan of action is to create a plugin manager of sorts… The way I see it, thats all a CMS essentially should be when everything in cakephp can essentially be a plugin. The plan is to load it up with some basic plug-ins that we have created (that can be replaced easily if desired); however, there may only be 1 or 2 core MVCs for settings purposes, auto updating and possibly a really slick GUI… I think the plugin manager as well as everything else can be a plugin, which allows for a great deal of modularity.

I feel that wordpress has it down right; however, services on linux machines like apt (synaptic) also work well to consider different repositories in existence, which I find ideal. Trying to host all plug-ins from 1 centralized source or even serve them through 1 centralized source isn’t the correct solution… instead it is better to simply allow different repositories to be added manually. That being said, we are currently trying to develop this plug-in we will see where it leads, but things are looking bright :) .

Ideas? Comments?

17Dec
Not me - but it hilariously/accurately describes my emotions currently

Not me - but it hilariously/accurately describes my emotions currently

Wow, its been almost a month since my last post! Sorry guys, was busy with school and work; however, now that that is done I can devote more attention to personal projects, woo!

Andy and myself found out last week that we made it to the semifinal round of imagine cup. This round will determine the winners in the national scene! So now its time to start upgrading our entry.

Meh forget that for now…. IM GOING TO DC BABY, FOR FREE! WOOO (THE CROWD GOES WILD). My plans for DC are as follows:

  • First and foremost: Become president and take over the world. Don’t ask me how… It will happen.
  • Second: Don’t be sober… Being sober is completely unnecessary for the purposes of a presentation.
  • Third: Nerd out with fellow nerds… Self explanatory and completely necessary.
  • Forth: Roll out to the clubs with random people I meet from Imagine Cup. I will visit the top 10, as described here: Clubin’ . There is something about the name Zanzibar that just makes me want to go there. It better be good DC or I will be highly disappointed!
  • Fifth: Be a nerdy tourist for a bit. I used to make fun of people taking pictures all touristy like, but now it feels right haha. I am in London right now (unable to sleep), but I feel like taking pictures of everything, including the subway even though I find that odd myself…

On more serious notes we gotta quickly ramp this project up from a demo to a fully functional platform. We currently have a bunch of ideas in the fray… Here is my to do list :) :

  • Create more powerful user centric features including multiple network functional
  • Graphing/Statistical plotting of power consumptions, per network and per machine that scales up and down based on the time range
  • Upgrade the user experience on the website
  • Create some tables to keep track of all hardware available out there with power consumption information

Andy is handling the optimization of the client side stuff and user experience related to that, although I may help with design related issues.

I also had ideas for expanding this project out to mobile devices. We could a) at the least be able to track consumption via mobile device and b) it may be possible to track power consumption of phones. I have not done much mobile development, but I seem to be venturing into it more and more. (Being a web/game developer inherently allows you to make applications for smart phones now a days.)

I do not think it is possible to have multiple processes running on a phone other than an app and a phone OS, I think the biggest challenge would be to be able to keep the app in the background. I am not sure if this sort of thing has been done on a phone before? Also if it is in a daemon of sorts how much power will the app itself consume…

Meh! First things first I guess :) . I’ll worry about non-mobile things first… Also I don’t have a real “smart phone.” The LG Dare does not really count hah.

Droid here I come! (cue cheesy advertisement here)

21Nov

The following video shows off Andy’s and mine’s Imagine Cup 2010 submission. The project dubbed Tesla is about conserving and monitoring energy consumption across a home or office network (or any other for that matter). Tesla has 2 aspects the client side which records data of individual computers and the server/web side which will create new users, networks and display device data.

Currently the user experience is not that amazing; however, the website almost looks awesome and the functionality exists! We are looking to expand in user experience of course; however, we are also looking to make functional enhancements (if we get into the next round). These include enhancing our database of known products (to get more accurate statistics), making an awesome visualizer for the data, and giving alternatives for your computer components in order to reduce consumption. I hope you guys enjoy our video. More coming from us soon on this hopefully!

Someone also mentioned how this could also be applied for overclocking machines and trying to get the biggest bang for the buck/power.

PS: We were running on fumes while recording this, please discard my lame explanations :) !