Kerjo's Random Musings

Saturday, June 03, 2006

0x2D0 - Relocated

The kinks have finally been worked out of my new site, I think, so if you'd update your bookmarks in your browser or your head to jordan.hofker.org, you'll be able to see future posts.

Would you stay or would you go

Friday, May 26, 2006

0x2D9 - Hodgepodge

Here's some Javascript to fade any element on a page from one color to another in a given number of steps. Just give it the element's id! The recursive idea came from javascript.internet.com, and the base idea came from a site I can't remember right now.

function makearray(n)
{
this.length = n;

for(var i = 1; i <= n; i++)
this[i] = 0;

return this;
}
var thing;
var j = 0;
var steps = 0;

var sr = 255;
var sg = 255;
var sb = 255;

var er = 255;
var eg = 255;
var eb = 255;

hexa = new makearray(16);

for(var i = 0; i < 10; i++)
hexa[i] = i;

hexa[10]="a";
hexa[11]="b";
hexa[12]="c";
hexa[13]="d";
hexa[14]="e";
hexa[15]="f";


function toHex(i)
{
if (i < 0)
return "00";
else if (i >255)
return "ff";
else
return "" + hexa[Math.floor(i/16)] + hexa[i%16];
}

function fade()
{
if(j <= steps)
{
var hr = toHex(Math.floor(sr * ((steps-j)/steps) + er * (j/steps)));
var hg = toHex(Math.floor(sg * ((steps-j)/steps) + eg * (j/steps)));
var hb = toHex(Math.floor(sb * ((steps-j)/steps) + eb * (j/steps)));
j++;

document.getElementById(thing).style.backgroundColor = "#" + hr + hg + hb;
setTimeout("fade()", 1);
}
}
function startFade(element, ssr, ssg, ssb, ser, seg, seb, step)
{
steps = step;
sr = ssr;
sg = ssg;
sb = ssb;
er = ser;
eg = seg;
eb = seb;
thing = element;
fade();
}


Wednesday, May 24, 2006

0x2DA - Time

The install of Windows Vista Beta 2 took altogether 35 minutes from mounting the image to booting into Vista.

It's pretty, and I can ramble on about that at a later time. I just wanted to make sure I wrote down how long it took somewhere.

We're going downtown

Wednesday, May 17, 2006

0x2E2 - Check

Courtesy of hardrock.cnblogs.com, here is how to make a PDF checkbox using iTextSharp in Java (but it should give you a good idea as to how to do it in C# as well).
Please forgive the formatting.

Using System;
Using ITextSharp.text;
Using ITextSharp.text.pdf;
Using System.IO;
Public Class Form_checkbox
{


[STAThread]
Public Static Void Main ( String [] args)
{
Document document
= New Document (PageSize.A4, 50 , 50 , 50 , 50 );
Those
{
// Creation of the different writers
PdfWriter writer = PdfWriter.GetInstance (document, New FileStream ( @" E:\java\form_checkbox.Pdf " , FileMode.Create));

Document.Open ();
PdfContentByte cb
= Writer.DirectContent;
Cb.MoveTo (
0 , 0 );
PdfFormField 87-98
= PdfFormField.CreateCheckBox (writer);
PdfAppearance tpOff
= Cb.CreateAppearance ( 20 , 20 );
PdfAppearance tpOn
= Cb.CreateAppearance ( 20 , 20 );
TpOff.Rectangle (
1 , 1 , 18 , 18 );
TpOff.Stroke ();

TpOn.SetRGBColorFill (
255 , 128 , 128 );
TpOn.Rectangle (
1 , 1 , 18 , 18 );
TpOn.FillStroke ();
TpOn.MoveTo (
1 , 1 );
TpOn.LineTo (
19 , 19 );
TpOn.MoveTo (
1 , 19 );
TpOn.LineTo (
19 , 1 );
TpOn.Stroke ();

Field.SetWidget (
New Rectangle ( 100 , 700 , 120 , 720 ), PdfAnnotation.HIGHLIGHT_INVERT);
Field.FieldName
= ( " AMR " );
Field.ValueAsName
= ( " Off " );
Field.AppearanceState
= ( " Off " );
Field.SetAppearance (PdfAnnotation.APPEARANCE_NORMAL.
" Off " , tpOff);
Field.SetAppearance (PdfAnnotation.APPEARANCE_NORMAL.
" On " , tpOn);
Writer.AddAnnotation (87-98);
Document.Close ();
System.Console.Out.WriteLine (
" F1M. " );
}

Catch (System.Exception de)
{
System.Console.Error.WriteLine (de.Message);
}

}

}


And I finally found the reason for me

Saturday, May 06, 2006

0x2ED - Disturbing

I've successfully moved back in at home. Today was spent cleaning around my desk to make room for my computer, but hopefully I can continue on to all the other stuff in my room, too.

Setting up my computer and speakers went pretty quickly, and a quick firmware upgrade to the wireless router let's me use it as a client so that my desktop has internet as well. The disturbing thing is that I currently have my speakers set to my "nighttime" volume level that I use at school, but playing music at the level is quite loud here.

I'd do a sound test at my normal listening level at school, but I'm afraid that'd disturb everyone a little too much.

Follow the path of the straight and narrow

Monday, April 24, 2006

0x2F8 - Process This

















ERP is over, this is a Good Thing.

However, the processor is due Wednesday, and it isn't the easiest project we've had to do. If Blogger cooperates, there's an overview of it to the left. This is, in no single way, complete.

What ever happened to suburbian rhythm...

Tuesday, April 04, 2006

0x30D - Countdown

A new one. Isn't it exciting?

I realize the lyrics should potentially be from the "Final Countdown", but you'll just have to deal with it.

So if you really love me, say yes.