10 minutes

this is going to be a ten minute post- hopefully it will be a meaningful 10 minutes.

up until last night i had a problem. i’m working on a project. it’s a website that plays video. the page is simple- it only has the title banner across the top, the main div where the video goes, and a few navigation links under that. what i needed was a way to switch between videos without reloading the page, just the div. flash is out of the question- i work only with xhtml, css, javascript, and php.

after some googling, i came across this. for some reason, i knew as soon as i saw this that it was exactly what i needed. after a little more inspection, these two lines confirmed it:

xmlhttp.open(”GET”,url,true);
and
onload=”loadXMLDoc(’test_xmlhttp.txt’)”

i noticed that the source for the text swapped into the div was a text file. up until this example, all the “div content swap” solutions i found used text that was in a preloaded div with display:none; to keep it hidden until whatever action called it. it didn’t seem to be a far stretch to change that path to that text file to the path to the videos i was using.

the fact that the second argument passed to the xmlhttp.open() function is actually called “url” confirmed it. i just needed to provide it with the url i wanted.
this is where the functions that i had previously written came in handy. instead of calling the loadXMLDoc function right away, clicking on the previous or next function calls would generate the correct path. instead of loading the contents of “test_xmlhttp.txt”, the
function would load the correct path. ie “http://…1.html” or whatever. it was just a matter of changing the last line of the script to pass the correct url to the function.

here’s the rest of my javascript.

var videoNumber = 1;

// initialize first video
// to http://…whatever…/1.html

var path = “http://…whatever…/videos/”;
var extension = “.html”;

function nextVideo(){
if (videoNumber < 3)
updateNumber(videoNumber += 1);

// increment current video's number,
// pass value to updateVideo()

else updateNumber(videoNumber = 1);
}

function previousVideo(){
if (videoNumber > 1)
updateNumber(videoNumber -= 1);

// decrement current video’s number,
// pass value to updateVideo()

else updateNumber(videoNumber = 3);
}

function updateNumber(currentVideoNumber){
var newVideoAddress = path + currentVideoNumber + extension;

// create new video’s address
loadXMLDoc(newVideoAddress);

// pass address to reloading function
}

weird how those two scripts seem like they were written to work together. comments and critiques are always welcome.

ps- i removed the actual path for now. it wasn’t the final one anyway. i’ll be sure to mention once this is good and ready.

pps- this took me 17 minutes to write.

the mini-blog/dawn of a new era.

so i stumbled upon a few cool things lately- orkut, del.icio.us, yulblog, and the mini-blog. i’m not going to run down the first two because a) as much as i’d like to, i don’t live in brazil and can’t speak portuguese, and b)i’m years too late on this one and you’ve probably all been there and done that already. some things i just can’t get into right away, and delicious was on of them. useful, kinda neat actually, but whatever.

the main topics of discussion for today’s lecture are yulblog and another (mini)blog i found. firstly, why i like yulblog is because it’s a regularly updated stream of random tidbits of lives that are lived close to mine. it’s kind of interesting to read miscellaneous posts and realize that i may have actually run into one of these people today and not even known it. (literally, i almost hit a lot of people/cars on my daily bike rides to school. i blame it on the video games as a kid.)

in reading one of the blogs, i came across the miniblog, which you may or may not have seen already.  i think this is neat because it’s so random and has almost no possible context.  so, similarly to why i find random blogs interesting, mini randomness is even more interesting because there is no context to the post, no follow-up, no explanation, no nothing.  almost no point.
it might be something i’d incorporate here. i think that having only tiny posts to write is less daunting than writing almost a full page.

just thought i’d share.

p.s.- in case anyone’s wondering; yes i am only writing this as a way to procrastinate some more. my homework is really annoying.

design 0.1

intro:
i may not have mentioned this before, but one of my short-term goals for this experiment is to try to write more often. i thought it would be interesting to write one post every day, but lately i’ve realized that that is probably not possible. i have too many other things to do (start playing music more, working on some design projects, homework, read more, etc.) so this is taking more and more of a back seat-maybe not as much as some other projects. another block i see to this being more a more regular activity is lack of one main item-a camera. so i can write a shitload about random ideas and events and whatnot. i feel that with a camera, and in turn photographs, this would be way more interesting. so i’m going to pursue that. i’m going to try to get a camera as soon as possible, or at least draw some diagrams or something. a camera will also help with the job i’m working on, but more on that in a sec. as stated, i’m not going to be updating this daily. i’m going to update it as much as i can and hope that it’s once a day. so here goes.

in racking my brain trying to figure out what to write today, i realized that i was taking a break from something that was stressing me out which was also a break from something else that was stressing me out. i have a tentative job to finish which is already way overdue. a local establishment has given me the opportunity to create a website for them.
in my usual fashion, i managed to take something that could probably be finished in an afternoon and turned it into a stressful drawn-out affair. i got caught up in learning some “slick” new CSS and XHTML shite, and still haven’t finished an acceptable version of the site i can show them. i spent way too much time focusing on details like trying to make suitable dropdown menus with only CSS and HTML and no JavaScript or images. also, the DTD stumped me for way too long and caused unnecessary headaches. why? because instead of focusing on the job, i was getting caught up in unimportant details like i always do. i hope that the finished product will look suitable. ‘ll have the main layout finished and ready to be filled with their content. all that’s missing are a few pictures and a logo or two. i’ll post the link once it’s finished.

the upside to this, aside from a potentially paying gig, is that i’ve learned a lot more about CSS. i’ve seen some pretty impressive things, and have a bunch of sites that i can use for “inspiration”.

one benefit, though, is that i got the dropdown menu to work. no images and no javascript. the site looks pretty clean, even elegant, and i’m not sure if that’s what they want. i’m hoping they’ll appreciate simplicity, but you never know. simplicity and minimal layout/design can be confused with incompetence and bland style fairly easily. i guess i’ll just have to show them a draft and hope it works out without me having to start from scratch.

work

well, as mentioned weeks ago, there was mighty debauchery in my habitat recently. we’ve successfully “broken-in” our bar.

in other news, i’ve finished a layout for a mini-project i’m working on. here are two screen shots of the mini-site i’m working on that i hope to sell.

ps: i put in the links to the website in the last post.