Dan-Hill.org: Whereupon research kicks our writer in the balls...
Today has been a humdinger.
A script (part of a loosely connected trilogy) has been giving me a bit of trouble but I could see the light at the end of the tunnel. I resigned myself to not enjoying the lovely weather today and to just finishing the damn thing.
I started like I always do. Slowly….
Source: dan-hill
JQuery UI - Collapse Table Rows
I have written a simple script with the help of JQuery to hide/collapse table rows when the webpage loads. It should only appear when you click on an element; a link, text or an image in his instance.
To show and hide rows, I have based my script on the one from the JQuery UI as a template (the toggle effect).
I made a basic dating web page to demo the script.
1) Add JQuery UI to your webpage. I used version 1.8.17. Attach it in the header.
<head>
<!— JQUERY —>
<script type=”text/javascript” src=”public/jquery/jquery-1.7.1.min.js”></script>
<script type=”text/javascript” src=”public/jquery/jquery-ui-1.8.18.custom.min.js”></script>
<link href=”public/jquery/jquery-ui-1.8.18.custom.css” rel=”stylesheet” type=”text/css” />
</head>
2) Add a HTML table with headers.
<table class=”profiletable”>
<tr>
<th></th>
<th>Name</th>
<th>Age</th>
<th>Location</th>
</tr>
</table>
3) Add a new profile in each row. For every row, add another one below. This secondary row will be the profile details which can be shown or hidden.
<!— PROFILE 1 —>
<tr class=”row”>
<td><img src=”public/imgs/woman.png” alt=”Profile” title=”Profile” class=”profileImg” id=”1001”/></td>
<td><p>Joanne</p></td>
<td><p>28</p></td>
<td><p>Birmingham</p></td>
</tr>
<tr id=”profile1001” class=”profile”>
<td colspan=”4”>
<div>
<div class=”box”>
<table>
<tr>
<td><p><b>Likes:</b></p></td><td><p>Rock music, reading Charlotte Bronte books, pizza, travel</p></td>
</tr>
<tr>
<td><p><b>Disikes:</b></p></td><td><p>Narrow minded people, </p></td>
</tr>
<tr>
<td><p><b>Looking for:</b></p></td><td><p>Male, tall, broad shoulders, GSOH</p></td>
</tr>
</table>
</div>
</div>
</td>
</tr>
<!— END PROFILE 1 —>
You may note in each primary row, an image named ‘woman.png’ has a class ‘profileImg’ and an id. Also, the secondary row has an id with prefix of profile e.g profile1001.
Increment the ID number for every set of rows e.g. 1001, profile1001, 1002, profile1002.
Both rows’ id will be used as in the JQuery script.
4) OK, now you have added a set of rows. Let’s write some JQuery magic. In the head section, write the following code. This code was based on the JQuery UI toggle effect. I made some changes.
<script type=”text/javascript”>
$(function () {
// run the currently selected effect
function toggleRow(whichRow) {
// get effect type from
var selectedEffect = null;
// most effect types need no options passed by default
var options = {};
// some effects have required parameters
if (selectedEffect === “scale”) {
options = { percent: 0 };
} else if (selectedEffect === “size”) {
options = { to: { width: 200, height: 60} };
}
// run the effect
$(“#profile” + whichRow).toggle(selectedEffect, options, 500);
};
// HIDE ALL ROWS ON LOAD
$(“.profile”).hide();
// IMAGE ACTS AS BUTTON TO SHOW OR HIDE SECONDARY ROW
$(“.profileImg”).click(function () {
var id = 0;
id = $(this).attr(“id”);
if ($(this).hasClass(‘on’)) {
$(this).removeClass(‘on’).addClass(‘off’);
} else if ($(this).hasClass(‘off’)) {
$(this).removeClass(‘off’).addClass(‘on’);
} else {
$(this).addClass(‘on’);
}// SHOW OR HIDE THIS ROW
toggleRow(id);
});
});
</script>
That’s it, really.
Click on the profile image and the secondary row will be shown. Click on image again, it will be hidden.
How it works
When the profile image is pressed, it fires the click event.
$(“.profileImg”).click(function ()
It retrieves the id from the image e.g. 1001.
The if/else clause, below, was added so that it could be used to highlight the profileImage icon. It can be used to change the image source. In my stylesheet, I can make alternations to the on or off class. I didn’t write this particular code. It was through research in the internet.
if ($(this).hasClass(‘on’)) {
$(this).removeClass(‘on’).addClass(‘off’);
} else if ($(this).hasClass(‘off’)) {
$(this).removeClass(‘off’).addClass(‘on’);
} else {
$(this).addClass(‘on’);
}
It then passes the ID to the function ‘runEffect(whichRow)’.
It accepts whichRow as parameter. It then appends the id to variable “#profile” + whichRow. The secondary row, e.g. profile1001, would be shown or hidden.
I have set the selectedEffect to null because I had some problems with the animation when you show or hide it. If I set it to null, the table rows snaps open or shut, which I prefer.

I have uploaded a full working webpage, with CSS, JQuery and more icons, at my Dropbox account. Feel free to download it for your use.
The Whale House
The Whale House is the first in a new series from Angry Candy (and co-published with BitterSweetFatKid), written by Andrew Cheverton and illustrated by Chris Doherty.
What sort of a series can you expect from the creators of West and Video Nasties? We’re not telling. The first issue is scheduled for publication in time for the Bristol Comic Expo in May.
Source: angry-candy
Review - Superman II: The Richard Donner Cut
This blog contains spoilers for the film: Superman II, the Richard Donner cut. This was released in DVD back in 2006. On Twitter, @mrbrianduffy recommended it to me. So I thought I’ll check it out.
Oh boy, I’m glad I did.
I have to say while I enjoyed the original version,I prefer the Richard Donner version. In this one, General Zod, Ursa and Non were real bad villians. I noticed that Non was less of an idiot and comic relief, also. He was a more of a thug who relished in destroying everything.
Originally, the bad guys were freed by the shockwaves from the hydrogen bomb, shattering their prison. Instead, it was the explosion of the nuclear missle that broke them free. None of that “prevously on” montage. In fact, I didn’t like it. I felt it was lazy. I’ve seen the first Superman film. I loved it and I wanted to see something new and different.
It was more fun in watching Lois Lane in working out Clark Kent is Superman such as doodling on the photo of Superman. Further down the film, Lois showed a dark side in exposing Clark Kent by simply pointing a gun at him. She pulled the trigger causing Clark to change posture. I felt it was unlike Lois to do this and very unusual.
The best bit was Jor El sacrificing himself to save his son, restoring his powers.
Now for the parts I didn’t like. Superman turned back time. Again.
He did it because he knew Lois Lane would be totally unhappy that she loves him but can’t be with her. So Supes turned back time to point where Lois Lane would never find out Clark Kent’s secret. I didn’t like it because it was a Deus Ex Machina moment. We were cheated of the emotional impact from seeing Lois’s burden and Jor El’s sacrifice.
Now Clark Kent is Superman. He has his powers restored. What’s the last thing he does? He went after the bully in the diner. The bully busted his hand on Supes’ six pack. He was put on a dinner tray before being pushed to a pinball machine. Let’s cheer for Superman! Yayy!
But wait a minute, there’s a problem!
Superman turned back time to prevent Lois finding out Clark’s double life. There would be no flying to the Fortress of Solitude with your new found love, no sacrificing your powers, no driving down to the diner and gasp, no encountering the bully.
So basically, when Clark Kent walked into the diner, the bully was minding his own business eating his supper. Clark said he needed to be taught manners. Yes, he was a bully but if the timeline was altered, it follows that bully never beat up Clark Kent at his weakest. The diner manager confused things further when he said he just had his diner repaired (Never happened, remember? Hang on, you don’t).
What makes matters worse, Clark Kent is not the revenge seeking type. He’s a Boy Scout (an invincible one, that is). So for events that never happened, Clark Kent went after the bully. That makes no sense.
Time travel worked in the first film. It didn’t in this one. While there was some flaws, I like this version better and I will recommending this film to others who have yet to see it. It’s a better version there is of Superman II.
3D - Acoustic Guitar
It was rendered with Blender. I used the Yafaray plugin to create a photo realistic image.
This was one of my first complex 3D models. I was inspired by listening to Johnny Cash. The strings were difficult to perfect. Often, they were too thick to be proper strings or they were so thin that you couldn’t really see it! Then I had to bend them over the bridge edge. Not easy! Argh! :)
3D - Piano
I rendered the piano in Blender. It was a big complex piece I did. It started off with making a piano lid by drawing 2 circular paths and then squared some of the edges. Then I had a basic frame for a piano.
Creating the keys was a challenge because I had to make those fitted within the size of the piano. I used a function where I duplicated a key by nth number of times along the same horizon (X co-ordinates). It saved me a lot of hassle from copying and pasting.
3D - Green Lantern ring
Found this old image. Rendered it with Blender. I used the Yafaray plugin to make it photo realistic. I loved the reflection underneath the ring.
I was inspired by reading Green Lantern: Rebirth. BTW, I do not claim the copyright holder of Green Lantern lantern logo.
Mock logo: Dr Parker Weevil
Font used is Detective Inc from Blambot Fonts. Just thought up the name randomly. This was an exercise playing with fonts, colouring it and warping the text.
It’s not designed for any publication.
Superheroes are not thrilling
Apart from Batman, I rarely read any other superheroes series. Why? It is because they always win and if they die, they never stay dead. The Deus Ex Machina makes sure of that.
It gets repetitive and the so called surprise reveal “He was never really dead” cheats readers. The emotional impact of a loss of a superhero is made meaningless when they come back from the dead or an alternate timeline. It’s boring and lazy.
That is why I prefer Incognitio and Sleeper by Ed Brubaker and Sean Phillips. A bleak world filled with shady characters with superpowers. When someone is seriously hacked off, there is a world of hurt heading to their direction. No forgiveness. No broken relationships are healed. When an anti-hero is dead, they are dead and gone. There is no coming back. That has more emotional impact.
That is my kind of superheroes’ world. It is much more thrilling and a whole less safe.
Traffic Stop
This is probably not safe for work. I got this joke in the email the other day. :)
Story from a Kansas State Highway Patrol officer:
I made a traffic stop on an elderly lady the other day for speeding on U.S. 166 Eastbound at Mile Marker 73 just East of Sedan, KS.
I asked for her driver’s license, registration, and proof of insurance.
The lady took out the required information and handed it to me.
In with the cards I was somewhat surprised (due to her advanced age) to see she had a conceal carry permit. I looked at her and ask if she had a weapon in her possession at this time.
She responded that she indeed had a .45 automatic in her glove box. Something in her body language, or the way she said it made me want to ask if she had any other firearms. She did admit to also having a 9mm Glock in her center console. Now I had to ask one more time if that was all. She responded once again that she did have just one more, a .357 Magnum in her purse. I then asked her what was she so afraid of. She looked me right in the eye and said, “Not a fucking thing!”



