New BSDPunk Windows Vista Gadget. To install it unzip that file into a directory called dj.gadget in:
%userprofile%\appdata\local\microsoft\windows sidebar\gadgets
So basically when you are done the three files are in:
%userprofile%\appdata\local\microsoft\windows sidebar\gadgets\dj.gadget
Then just go to your windows sidebar and hit the plus button and it should be in the list.
Wait a minute...What the fuck does it do? So you guys can take it apart and look at it but basically it's just a link and then some ajax bullshit that goes to my page so I can say if I am djing or not...ok so why not just call it the BSDPunk DJ gadget? Well because of ajax magic I can really put any sort of web information into the gadget, like updates about blog posts or just like a one way twitter or something, or I could but like vb shit in there and give you guys weird different kinds of functionality every week! So what's it do, I don't know. Just install it if you use gadgets and we can figure out together. Oh hey and if you want to create your own gadgets check here:
http://www.microsoft.com/technet/scriptcenter/topics/vista/gadgets-pt1.mspx
And I was having trouble with my xml file because of encoding or something so if you make one and you go to add it to your sidebar and it isn't showing up in your sidebar, download the sample one from here:
http://www.danielmoth.com/Blog/2006/10/vista-sample-sidebar-gadget.html
And just edit it.
PS I made another Ann Arbor Post on wereboobs.
Saturday, June 21, 2008
Hacker Culture Blog Windows Vista Gadget
Saturday, May 31, 2008
AJAX tutorial for begginers
So ajax is a buzz word around the whole web 2.0 scene. It stands for Asynchronous JavaScript And XML. Basically it's just using some javascript to call a function called xmlHttpRequest(); .Anyway it's usually some pretty standard not changing code which you can get from the W3CSchools. I have made some slight modifications, that I find make the AJAX code work a little better.
What I did was write a simple stupid recursive function(smarm, I had been reading to much QC that week) that has a wait in it and a header thing, which I had to put in there due to some weird IE thing I still don't quite understand.
So this ajax code only does one little thing, it prints a diffrent page in a div every 5 seconds. Now the reason you would do this is if you had ever changing data in that html/php file, you put in the div. You also need onLoad="smarm()" in the body tag.
function ajaxFunction()
{
var xmlHttp;
try
{
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
{
document.getElementById('stable').innerHTML=xmlHttp.responseText;
}
}
xmlHttp.open("POST","ajax2.php",true);
xmlHttp.send(null);
}
function smarm()
{
ajaxFunction();
var t=setTimeout("smarm()",5000);
http.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
}
So like ajax2.php might look something like this:
$handle = fopen('info.txt', 'a+');
$shiznit = fread($handle,600);
fclose($handle);
Or you could dump a mysql database table into an html table if that database was changing a lot.
Yeah and don't forget to add the div, in my example the div I used was "stable". So to do that you would just add div brackets with a class and id named stable. Also make sure you put the javascript in script brackets and the php in php brackets of course.
One caveat is that unless the page you are inserting into the div is somehow otherwise linked to your site, the content within it most likely well not be viewed by a search engine. So if you are building SEO intensive sites, be aware.