Daniel Von Fange

Life, Code, and Cool Stuff

Another Way to Structure Css Files

Duh. I finally figured a way around my minor frustration with CSS - lack of “variables”.

In the past, I have usually structured css files like this exaggerated example:

body{color:#CCCCCC; font-family:"Arial";....}
h1{color:#00cc77; font-family:"Helvetica"; ....}
h2{color:#00cc77; font-family:"Helvetica";....}
h3{color:#00cc77; font-family:"Helvetica";....}
h4{color:#882200; font-family:"Helvetica";....}
p{color:#882200; .....}
table{color:#882200;....}
table.th {color:#00cc77; font-family:"Helvetica"; ....}

I have always be frustrated when I want to experiment with changing a value that appeared in multiple places. I just realized my own stupidity last night. What if I move most same values together - like this:

body{color:#CCCCCC;}
h1, h2, h3, table.th {color:#00cc77;}
h4, p, table {color:#882200;}

body {font-family:"Arial";}
h1, h2, h3, h4,table.th { font-family:"Helvetica"; }

body{ ;....}
h1{ ....}
h2{ ....}
h3{ ....}
h4{ ....}
table.th { ....}

Experimentation becomes much easier.

Light PHP

Last night I wanted to be able to have comments on an exported VoodooPad site. So I quickly hacked some light PHP code together to do the trick. The code is available in it’s rough state on this mini site.

New Zen Garden Entry

<p><a href="http://www.csszengarden.com/?cssfile=/069/069.css&#38;page=0">Bonsai Sky</a>, a new entry by <a href="http://www.mdavidson.com/">Mike Davidson</a> in the <a href="http://www.csszengarden.com/">CSS Zen Garden</a> is stunning. It&#8217;s manages to look this photorealistic and yet be a fixed width design. </p>

<p>Somebody has a sense of humor:</p>
<ul>
    <li>Look at the base of the big rock for the logo carvings.</li>
    <li>An idol on the right slides up and down the rock as you scroll the page.</li>
    <li>A person stands on the rock</li>
    <li>CSS is carved into the rock</li>
</ul>

Happy New Year!

Happy new year! As always, the woods around us resound with everyone and his brother-in-law shooting off fireworks.

I did not plan on staying, but about 11pm I inadvertently started coding something, and I’ve just now come out of the daze. I’ll have a cool little script to release tomorrow.

Bowling

<p>A friend and I went out tonight for some bowling. I&#8217;d never experienced the rolling of a ball into pins before.  Alternating between experimenting and trying my best, I was at least having fun. I was recollecting things that I have heard about target shooting, and trying to apply them. Halfway through the last game, I actually got the hang of it, and my scores abruptly turned upwards. I managed to beat my more experienced friend &#8211; though he had a bad game that time.</p>

<p>All the equipment in the building was from the eights. I felt I should be writing COBAL or assembler. </p>

<p>What did I apply?</p>

<ul>
    <li>Consistency &#8211; I put my feet in the exact same place for every starting shot.</li>
    <li>Coolness &#8211; Never got mad when I missed, just calmly regarded it as an opportunity to learn what not to do.</li>
</ul>

<p>What did learn?</p>

<ul>
    <li>Matched my pace to the swing of the ball &#8211; I tried to swing the ball to my footsteps and messed up horribly every time.</li>
    <li>Set the ball gently on the lane &#8211; As opposed to throwing it up and hearing it smack.</li>
    <li>Don&#8217;t try to aim when releasing the ball &#8211; At that point it is too late; You have already swung the ball and set it on it&#8217;s path.</li>
    <li>Smoothness.</li>
</ul>

<p>After playing, tonight I find myself doing everything smoothly. Even the tapping of keys on my keyboard. </p>

<p>(Now are you bored? I promise I&#8217;ll get back to talking about scripting/Macy/Unixy things soon. )</p>

Theory of Constraints

I am reading the excellent book Death March (Amazon). I just came across the diagram of the theory of constraints. ( Identify the systems constraints > Find a way to exploit the system’s constraints > Subordinate all other activities to the exploitation of the system’s constraints. )

Wow. That exactly describes the building phase of most Real Time Strategy games. I remember my first game of Total Annihilation. My friend who was introducing me too the game was my ally. I had managed to build about four tanks and a ship, so I sent my ship over to find the enemy. As soon as my ship neared the enemy continent, they sky became dark. My friend flew something like eighty advanced aircraft right over my ship and turned the enemy into rubble in less than a minute. He knew what the constraints were, and was exploiting them. I had no clue what the constraints were.

It’s amazing how naturally we find out what is the primary thing holding us back in a game, and yet don’t think of applying the same search and exploit procedure to life and business.

Merry Christmas

Have a Merry Christmas!

It’s 6:43m here. I was planning to sleep in, but the dogs thought they saw Santa outside the window. I was unceremoniously awaken. Now that they have calmed down, perhaps I can get back to sleep.

Refers Up

Although Reinvented beat me to it, I’ve now installed Refer.

The best part about it? An RSS feed of my refers that is not mentioned on the help page. Now I don’t have to do the classic maniacal refreshing of the refer page - it all comes to me.

Sadly the RSS feed was not up to spec, and choked in NetNewsWire. The RSS .92/2.0 specs state ”the description contains the text (entity-encoded HTML is allowed)”. The refer RSS feed was not escaping the HTML. A quick addition of htmlspecialchars() fixed this.

display.php Line 132:
tag(
 htmlspecialchars(
  tag(tag('Where: ','em').$page,'p').
  tag(tag('From: ','em').$refer,'p').
  tag(tag('Who: ','em').$host,'p')
 ),
'description'),'';

I also created a robots.txt file to keep Google from seeing the refer info. No sense in letting slimy refer spammers get Google Juice.

Preemptive Troll Satire

Trolls are usually predictable. For a given topic, there is are predicable angles that trolls use as bait. What if on an online news site with lots of people commenting and large population of trolls, someone quickly posted satires of the anticipated troll angles. Might take some of the sting out of them…

(Maybe. Maybe it’s a bad idea. However, this Idea of dubious value came to me while reading the comments of a ScrappleFace satire piece)

Hamas Charter

I mentally grasped the core of Roman warfare when I read Julius Caesar’s own writings, unfiltered and undistorted by others.

I’d never read the Hamas’ founding Charter until tonight. It’s an amazing document. I now know the raw, unfiltered core of one side of the “Middle East Problem”.

I had always thought that people who said that the long term plan was for the eradication of Israel were just pronouncing that based on their guesses based on terrorist actions. I wrong.

“Hammas is a social organization, dedicated to helping Palestinians.” I’ve heard it before. Here is little selection from the end of the charter.

Article Thirty-One: [To?] The Members of Other Religions The Hamas is a Humane Movement:

Hamas is a humane movement, which cares for human rights and is committed to the tolerance inherent in Islam as regards attitudes towards other religions. It is only hostile to those who are hostile towards it, or stand in its way in order to disturb its moves or to frustrate its efforts… … Islam accords his rights to everyone who has rights.

So who stands in the way of Hamas? And what are it’s efforts directed towards?

In the first paragraph of the charter:

Israel will rise and will remain erect until Islam eliminates it as it had eliminated its predecessors…

On the concept of Waqf:

No Arab country nor the aggregate of all Arab countries, and no Arab King or President nor all of them in the aggregate, have that right, nor has that right any organization or the aggregate of all organizations, be they Palestinian or Arab, because Palestine is an Islamic Waqf throughout all generations and to the Day of Resurrection. Who can presume to speak for all Islamic Generations to the Day of Resurrection? This is the status [of the land] in Islamic Shari’a, and it is similar to all lands conquered by Islam by force, and made thereby Waqf lands upon their conquest, for all generations of Muslims until the Day of Resurrection.

So any land once owned by Muslims, must be Muslim controlled forever. (The whole land of Israel is considered to be a Islamic Waqf. What happens to people that are on land once owned by Muslims?

…Nothing is loftier or deeper in Nationalism than waging Jihad against the enemy and confronting him when he sets foot on the land of the Muslims…

There could never be peace with Israel because Israelis must be killed when found in the land of Israel. Then, the next section of the charter is entitled ”Peaceful Solutions, [Peace] Initiatives and International Conferences”.

Peace] initiatives, the so-called peaceful solutions, and the international conferences to resolve the Palestinian problem, are all contrary to the beliefs of the Islamic Resistance Movement… … There is no solution to the Palestinian problem except by Jihad.

Ouch!

In Article Fifteen: The Jihad for the Liberation of Palestine is an Individual Obligation

We must imprint on the minds of generations of Muslims that the Palestinian problem is a religious one, to be dealt with on this premise… ….I swear by that who holds in His Hands the Soul of Muhammad! I indeed wish to go to war for the sake of Allah! I will assault and kill, assault and kill, assault and kill

In Article Sixteen:

We must accord the Islamic [young] generations in our area, an Islamic education based on the implementation of religious precepts, on the conscientious study of the Book of Allah; on the Study of the Prophetic Tradition, on the study of Islamic history and heritage from its reliable sources, under the guidance of experts and scientists, and on singling out the paths which constitute for the Muslims sound concepts of thinking and faith. It is also necessary to study conscientiously the enemy and its material and human potential; to detect its weak and strong spots, and to recognize the powers that support it and stand by it. At the same time, we must be aware of current events, follow the news and study the analyses and commentaries on it, together with drawing plans for the present and the future and examining every phenomenon, so that every Muslim, fighting Jihad, could live out his era aware of his objective, his goals, his way and the things happening round him…

Yow! These guys are no idiots. This is not the ranting of insane person, but a cold blooded, cool headed plan for eventually driving/killing Jews out of Israel.

In article Seventeen: The Role of Muslim Women

The Muslim women have a no lesser role than that of men in the war of liberation; they manufacture men and play a great role in guiding and educating the [new] generation. The enemies have understood that role, therefore they realize that if they can guide and educate [the Muslim women] in a way that would distance them from Islam, they would have won that war. Therefore, you can see them making consistent efforts [in that direction] by way of publicity and movies, curricula of education and culture… …Those Zionist organizations control vast material resources, which enable them to fulfill their mission amidst societies, with a view of implementing Zionist goals and sowing the concepts that can be of use to the enemy… … When Islam will retake possession of [the means to] guide the life [of the Muslims], it will wipe out those organizations which are the enemy of humanity and Islam.

They are smart. They are watching their “root” that will ensure the fighting keeps going from generation to generation.

Side note, Hitler took the long view too. From Mien Kamph:

The young boy or girl who is of German nationality and is a subject of the German State is bound to complete the period of school education which is obligatory for every German. Thereby he submits to the system of training which will make him conscious of his race and a member of the folk-community.

Then astounding irony found in Article Twenty:

…The Nazism of the Jews does not skip women and children, it scares everyone…

“Nazism of the Jews”!?!

Hamas is taking a long term view on killing Jews:

Social solidarity consists of extending help to all the needy, both materially and morally, or assisting in the execution of certain actions. It is incumbent upon the members of the Hamas to look after the interests of the masses the way they would look after their own interests. They must spare no effort in the implementation and maintenance of those interests, and they must avoid playing with anything that might effect the future generations or cause damage to their society. For the masses are of them and for them, their strength is [ultimately] theirs and their future is theirs. The members of Hamas must share with the people its joys and sorrows, and adopt the demands of the people and anything likely to fulfill its interests and theirs. When this spirit reigns, congeniality will deepen, cooperation and compassion will prevail, unity will firm up, and the ranks will be strengthened in the confrontation with the enemy.

They know the importance of a base of operations… They learned from Mao, who said:

Because guerrilla warfare basically derives from the masses and is supported by them, it can neither exist nor flourish if it separates itself from their sympathies and co-operation.

In Article Twenty-Eight:

…Israel, by virtue of its being Jewish and of having a Jewish population, defies Islam and the Muslims.

That line pretty much sums up their view.

So what did I learn. Hamas is a blood thirsty organization, dedicated to eliminating Israel. They are not stupid. In fact they are exceptionally clever. They are waging a long term, multi spectral war against Israel, and have every intention of winning. And peace with Israel is not something they would accept.

{I may edit this post later, since it’s late right now, and I may have muddled some of what I wrote. }