Archive for the ‘Technology’ Category

Personal and work digital lives

Friday, August 21st, 2009

People underestimate the importance of having separate personal and work email accounts and calendars. It is great to have ones private and personal emails in separate mailboxes, so that if you want to get away from your work life and focus on your personal email you can. This extends to ones calendaring too - separate calendars for work appointments and personal events can be very useful.

This sort of separation is advantageous for lifestyle organisation too: it is good to know that certain times are reserved for work and others for play. It aids the balancing of ones work and personal lives, by enforcing a consciousness of the difference between work and non-work time. All of this is really very important in the lives of most people in the 21st century. It also provides a sense of lifestyle security.

Sarah Palin’s separation mess

In some peoples’ cases, it is politically important or important in terms of security to separate ones work and personal digital lives (ones emails, calendars, and such). Apparently Sarah Palin got in to trouble for allegedly breaching the Federal rule which creates the responsibility to separate ones work and personal email (or more appropriately, ‘public and private email’):

Sarah Palin’s [private] Yahoo email account was hacked by a group that calls themselves “Anonymous”. … Most of the emails seem to be messages of support, and photos of family. Nothing too exciting. But it’s been said that Palin and her associates all used private emails for government business.

The more important issue

The crux of this issue - which is far more interesting - is that technology often keep us constantly connected to everything and everyone in our lives, and it takes a conscious effort to mitigate this.

Communication omnipresence is a problem

We now have mobile telephones, home telephones, email accounts, instant messaging accounts, and social networking accounts - our communication technology is ever-expanding. Indeed, as for social networking sites, although I love Facebook, my only big dislike of it is that it doesn’t allow for the adequate separation of work and personal friendships, and this is a distinction which is important for most people.

By separating ones email and calendars, it is possible to prevent a natural omnipresence whereby you would be connected to your business and personal life constantly and your brain under constant pressure from being connected with both spheres of life concurrently. It would be near-impossible to live a balanced lifestyle.

1984 Internet just arrived

Sunday, May 3rd, 2009

Plan to monitor all internet use

Source: BBC

Internet spy

It is fresh out of 1984:

“Communications firms are being asked to record all internet contacts between people as part of a modernisation in UK police surveillance tactics.”

This sounds more like an Orwellification in police tactics, not a benign “modernisation”.

“The home secretary scrapped plans for a database but wants details to be held and organised for security services.”

The article gives enough information to believe that the new plan is exactly the same as the “plans for a database”, only that the information will be “organised” in a different way, a way in which they cannot attribute “database” to its title.

“The new system would track all e-mails, phone calls and internet use, including visits to social network sites.”

A system which tracks data in such a way, requires a database, at some point, to store the information - that is obvious. The fact the the BBC has just eaten up and regurgitate the Press releases from the Home Office in such a crude way is, of course, appalling.

“The Home Office will instead ask communications companies - from internet service providers to mobile phone networks - to extend the range of information they currently hold on their subscribers and organise it so that it can be better used by the police, MI5 and other public bodies investigating crime and terrorism.”

“Ministers say they estimate the project will cost £2bn to set up, which includes some compensation to the communications industry for the work it may be asked to do.”

“Security services could then seek to examine this data along with information which links it to specific devices, such as a mobile phone, home computer or other device, as part of investigations into criminal suspects.”

Wallpaper Woes Are Over

Friday, April 24th, 2009

Too often people put up with ugly desktop wallpapers. Or, at least they leave boring wallpapers lying there on their desktop for too long.

Some time ago I discovered the amazing website InteraceLift.com which has on it hundreds, if not thousands, of wallpapers of beautified Photoshop’d photographs. There are many other websites like it, but from my experience, InterfaceLift’s wallpapers are rather superior.

Beautiful wallpapers on InterfaceLift

Beautiful wallpapers on InterfaceLift.com

For ages I have regularly updated my wallpaper with a new random background manually: by going on to the website, clicking on a random page, finding a random wallpaper, downloading the image file, then finally setting the image as my background wallpaper. It takes bit of time - long enough to become a bore!

The solution: Cool Wallpaper Updater

CWU

I have created a program called ‘Cool Wallpaper Updater’, currently at version 1.00b!! I know the title’s cheesy but it’s not a complicated program yet; if it becomes one, maybe I’ll someday re-brand it!

You install the application on your computer, and load the program (from your desktop, quick launch bar, or Start Programs menu), and the program automatically finds, selects, downloads, and sets a new random desktop background courtesy of InterfaceLift in front of your eyes!

You can read more about the program at the Cool Wallpaper updater mini-homepage. Or download the current (ATW) version of the program for Windows XP/Vista straight away.

If you don’t get along with the program, checkout the how-to section of the mini-homepage. Moreover, if you don’t like the program, you can of course uninstall it (?).

So, give it a go and see how you like it! Give me feedback by commenting on this post or contacting me. I’ll do my best to improve the program to your requirements!

I hope the program can be of use to you! :-)

Roman Numerals in ColdFusion

Saturday, April 11th, 2009

I think Roman Numerals are particuarly attractive when used well on the web.

This website uses Roman Numerals for the copyright date. Of course, this is easily implemented in PHP with the code below:

<?php
 
function numberToRoman($num) 
 {
     // Make sure that we only use the integer portion of the value
     $n = intval($num);
     $result = '';
 
     // Declare a lookup array that we will use to traverse the number:
     $lookup = array('M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400,
     'C' => 100, 'XC' => 90, 'L' => 50, 'XL' => 40,
     'X' => 10, 'IX' => 9, 'V' => 5, 'IV' => 4, 'I' => 1);
 
     foreach ($lookup as $roman => $value) 
     {
         // Determine the number of matches
         $matches = intval($n / $value);
 
         // Store that many characters
         $result .= str_repeat($roman, $matches);
 
         // Substract that from the number
         $n = $n % $value;
     }
 
     // The Roman numeral should be built, return it
     return $result;
 }
 
echo(numberToRoman(date('Y')))
 
?>

In ColdFusion, though, I have not been able to find a ‘numberToRoman’ function anywhere, so had to build my own.

Solution

The ‘RomanNumeralsFormat’ function utilises another function I created called ‘RoundDown’. First, we declare the latter:

<cfscript>
function RoundDown(numberIn,roundBy){
	var resultantNumber = 0;
 
	if( (numberIn MOD roundBy) NEQ 0 )
	{
		resultantNumber = numberIn - (numberIn MOD roundBy);
	}else{
		resultantNumber = numberIn;
	}
 
	return resultantNumber;
}
</cfscript>

Then RomanNumeralsFormat is ready to be declared:

<cffunction name="RomanNumeralsFormat" returntype="string" displayname="Convert to roman numerals">
    <cfargument name="number" type="numeric" required="yes" displayname="The required number to pass in">
 
    <cfset numberOrig = number>
    <cfset number = round(number)>
 
    <cfset onesChrs = "I,II,III,IV,V,VI,VII,VIII,IX">
    <cfset tensChrs = "X,XX,XXX,XL,L,LX,LXX,LXXX,XC">
    <cfset hundredsChrs = "C,CC,CCC,CD,D,DC,DCC,DCCC,CM">
    <cfset thousandsChrs = "M,MM,MMM,MMMM">
 
    <cfif number GT 4999>
        <cfreturn numberOrig>
		<cfthrow message="Cannot represent numbers larger than 4999 in plain ASCII.">
	<cfelseif number EQ 0>
		<!---
		(nullae)
		--->
		<cfreturn "N">    
    <cfelse>
		<cfset result = "">
 
    	<cfset thousandsCount = RoundDown(number,1000,'down') / 1000>
		<cfif thousandsCount gt 0>
             	<cfset result = listGetAt(thousandsChrs,thousandsCount)>
		</cfif>
 
    	<cfset hundredsCount = RoundDown(number-(1000*thousandsCount),100,'down') / 100>
		<cfif hundredsCount gt 0>
	    	<cfset result = result & listGetAt(hundredsChrs,hundredsCount)>
        </cfif>
 
    	<cfset tensCount = RoundDown(number-(1000*thousandsCount)-(100*hundredsCount),10,'down') / 10>
		<cfif tensCount gt 0>
	    	<cfset result = result & listGetAt(tensChrs,tensCount)>
		</cfif>
 
    	<cfset onesCount = RoundDown(number-(1000*thousandsCount)-(100*hundredsCount)-(10*tensCount),1,'down')>
		<cfif onesCount gt 0>
	    	<cfset result = result & listGetAt(onesChrs,onesCount)>
       	</cfif>
 
        <cfreturn result>
    </cfif>
</cffunction>

We call the function like this:

<cfdump var="#RomanNumeralsFormat('999')#"> <!--- Produces: CMXCIX --->
<cfdump var="#RomanNumeralsFormat('2009')#"> <!--- Produces: MMIX --->
<cfdump var="#RomanNumeralsFormat('2008.9')#"> <!--- Rounds to 2009 and Produces: MMIX --->
<cfdump var="#RomanNumeralsFormat('11.11')#"> <!--- Rounds to 11 and Produces: XI --->
<cfdump var="#RomanNumeralsFormat('11.99')#"> <!--- Rounds to 12 and Produces: XII --->

I hope you find this post interesting and the function can be of use to you. ;-)

ISAPI Rewrite and WordPress

Thursday, April 9th, 2009

This blog uses the WordPress blogging platform which I host myself on my Windows server in the US.

However, WordPress support for ‘pretty URLs’ (pretty Permalinks) does not seem to exist Windows servers that use ISAPI Rewrite for re-writing URLs.

An example of a pretty v. ugly URL is:

  • Pretty:
    http://www.example.com/general/isapi-rewrite-and-wordpress
  • Ugly:
    http://www.example.com/?categoryname=general&p=123

URL re-writing is the process whereby you websites’ users (i.e. you guys as readers of my blog) can type in a pretty URL, and because the URL is re-written, the web server finds the right page at the ugly URL and sends it to your screen.

For those that don’t know, this re-writing is considered good practice, because it means that URLs are more aesthetically pleasing to read, easier to remember,  and easier for search engines to find.

[Also, if you are reading this post out of interest rather than for practical advice, then you may be asking what on earth is ISAPI Rewrite? Well it is simply a piece of software which is installed on a webserver that runs a Windows operating system. It allows for URL re-writing and is easily setup with one small file called 'httpd.ini' which is a settings/configuration file that website designers upload to their website.]

Problem

WordPress does not allow for pretty Permalinks customizations to work with a Windows server and ISAPI Rewrite installed to re-writing URLs.

Solution

[Should work with all WP versions, ATW I use 2.71]

  1. Customise your permalinks as you want (at http://yourblog/wp-admin/options-permalink.php)
    e.g. I use custom structure “/%category%/%postname%” - this creates the Pretty Permalink as in the example above. [More information on choosing your Permalinks.]


    Step 1

  2. Install the plugin (how to?) called ‘AskApache RewriteRules Viewer‘. Next, activate the plugin.
  3. Go to your WP Admin Settings page (at http://yourblog//wp-admin/options-general.php) and click on the subpage “AA RewriteRules“.
  4. You will then be presented with a page similar to the one below:


    Step 4

  5. Select all of the text in the big box “All WordPress RewriteRules” and copy it to the clipboard.
    (Left click on the box; CTRL + A [Select all]; CTRL + C [Copy])
  6. Go to my ‘WordPress RewriteRules to ISAPI RewriteRules Converter‘ page:


    Step 6

  7. Paste (CTRL+V) into the big box on the converter page, and click ‘Convert’.
  8. Select all of the converted rewrite rules returned by my utility and copy them into your ‘httpd.ini’ file (the ISAPI Rewrite Configuration file).
  9. Put the httpd.ini file in the root of your web directory, and assuming it’s enabled on the domain, your WordPress should now work with the Pretty Permalinks you setup.

Limitations

If you significantly change the structure of your site, you may have to go through this process again for some links to work on your blog. I, however, have never encountered this problem.

I hope you find this interesting/useful!

Pretty permalinks with ISAPI Rewrite all the way! ;-) Amen.