Archive for the ‘Random’ Category

Unused CSS – find unused CSS

Friday, June 10th, 2011

I am no html expert, and my artistic design talent is non-existent, so when I needed to create a login form, contact and RSVP form (will post further details later) I turned to hacking an open and freely available existing website, WordPress to be exact.

If you try logging into the admin page, you will be presented with a beautiful login box, view any of the admin pages and there are countless beautiful forms.

I copied the html (direct save as), and the CSS. Cut down and modified it to my needs.

Now the problem, the CSS files are huge and contain a lot of irrelevant code. What to do. I search the web and found Unused CSS.

Now, I was a bit hesitant at first, would it work and would my forms look exactly the same. Their money back guarantee convinced me, willing to use it if anything went wrong (can’t seem to find this guarantee any more though).

It worked surprisingly well. Here are the stats for the login page;

Unused CSS result

The only thing I would have liked is if the membership was lifetime and not yearly.

In search of the elusive Google default marker

Friday, April 8th, 2011

For a number of years now I have been developing a Google Maps plugin for WordPress <end of plug>, I have even created a script to dynamically generate coloured markers with custom text. This is a great solution for hosting your own markers, but is has a lot of overhead, having to host a custom Arial font and requiring the PHP GD library installed. And even then, I still relied on Google to provide the starting coloured marker .

Google does provide an alternative, custom text and colour, but there is one problem, what if I want the classic default Google Map’s marker default marker, the one with the large black dot. Well it isn’t there. And that is where my script, dare I say, exceeded Google.

The trick was adding the large black dot to the font. You know that ugly square box you sometimes see when you don’t have the correct fonts installed square box marker, I simply replaced this with the large black dot. Any character codes that aren’t available will simply return the default style marker default marker with my script.

So that’s my implementation, but how do I migrate from my script to Google’s while keeping the default style marker. I had to find an equivalent. All the obvious choices (bullet U+2022, bullet operator U+2219 and black circle U+25CF) didn’t work.

I started sifting through thousands of markers, looking for the closest representation to the default marker. What I found was kangxi radical one U+2F00, now don’t ask me why, but for some reason this produced a black dot style marker close enough default marker, though smaller than the default. This would have to do.

collection of markers

5000+ markers in a 1mb+ png file
5000+ markers in a html page (file name is the unicode)

Note: all above inline marker examples are hosted on Google or generated with my script (view the image name to find out more).

Related posts:

  1. thydzik Google Map v1.4.7 – inline WordPress Google Maps
  2. thydzik Google Map version 1.4.6.1
  3. thydzikGoogleMap – an inline Google map plugin for WordPress

A network administrator’s guide to activating monitor Power Management while transitioning to Windows 2000 or Windows XP

Friday, April 8th, 2011

Anyone looking for PM_Win2k_Whitepaper.pdf from the now defunct host http://www.computerpowersaver.com, I have made it available.

PM_Win2k_Whitepaper.pdf

Related posts:

  1. USB2IDE drivers for Microsoft Windows 98
  2. SigmaTel High Definition Audio Codec driver for Windows XP

Check Point VPN – “SR_Service.exe – Application Error”

Saturday, December 25th, 2010

If you are getting the following error;

---------------------------
SR_Service.exe - Application Error
---------------------------
The instruction at "0x77c478c0" referenced memory at "0x00000000". The memory could not be "read".

Click on OK to terminate the program
Click on CANCEL to debug the program
---------------------------
OK   Cancel
---------------------------

Check-Point-VPN-SR_Service.exe-Application-Error

The solution is;

  1. Open Microsoft Internet Explorer
  2. Internet Options
  3. Content
  4. Certificates
  5. Trusted Root Certification Authorities
  6. Remove Autoridad Certificadora Raiz de la Secretaria Economia

Related posts:

  1. thydzik’s WordPress Tool – a WordPress error and link extractor
  2. Get the parameters/arguments being called to an executable

How to Unlock Garmin maps

Sunday, July 4th, 2010

For information only, How to Unlock Garmin maps.

First get your hands on the desired Garmin City Navigator Downloadable Update for your country/city (MapSource A).
In the compressed file should be the folders IMG, support and Windows plus a readme.txt.

You will need a version of Garmin MapSource 6.13.1 or older which does NOT support Unlocking via the internet (MapSource B).
This can be found in older version of the downloaded map update files (perhaps a 2007/2008 version).

Run the CN.msi installation file to install the old version of MapSource (B).

Run MapSource (B) and the UnlockWizard.

Now get your hands on Garmin Unlock Generator V1.5,
Enter your 10 digit Unit ID, and select map product <custom mapset>, enter the FID (MapID) of the newest Downloadable Update (the one you want to Unlock).
Click generate, copy the 25 digit map unlock code and paste this into the UnlockWizard.

At this stage you will have the older version of MapSource (B) with some old map.

Run the CNMENT2010Update_ENU.msi file in IMG folder (MapSource A).

Run MapSource (A). That’s it. The map should now be Unlocked.

Related posts:

  1. Unlock the Nokia 6300 for under $10 with the iSIM
  2. thydzikGoogleMap v1.3

8 Suits – eight suited playing cards

Saturday, June 12th, 2010

8 Suits, as you guessed is a deck of playing cards with an additional 4 suits, the clover, tear, crescent and star for a total of 104 cards plus a number of jokers.

Priced at $12 USD per deck plus $5 per postage ($13 per postage internationally), it is a little steeper than The Fat Pack, at roughly $16 USD including international postage. Unfortunately, I discovered the former after ordering the 8 Suits.

8 Suits - 8 suited playing cards
8 Suits - new suits clover, tear, crescent and star
8 Suits - height of deck

The following show how 8 suits affect the probability of standard poker hands;

Poker Hand         No of Combinations        Probability
--------------------------------------------------------
Royal Flush                         8       0.0000000870
Straight Flush                     72       0.0000007829
Five of a Kind                    728       0.0000079163
Flush                          10,216       0.0001110887
Four of a kind                 87,360       0.0009499522
Full House                    244,608       0.0026598662
Straight                      327,600       0.0035623208
Three of a Kind             3,075,072       0.0334383181
Two Pair                    5,381,376       0.0585170567
Pair                       41,000,960       0.4458442418
No Pair                    41,834,520       0.4549083692

Total                      91,962,520       1.000000000

To view the probabilities for any other numbers of suits.

Related posts:

  1. 5 Dimension – a 5 suit playing cards
  2. Poker hands probability calculator for any number of suits and ranks (denominations)

Poker hands probability calculator for any number of suits and ranks (denominations)

Saturday, June 12th, 2010

After purchasing a 5 suited deck of cards and an 8 suited deck of cards, I decided to work out how the numbers of suits affect the probabilities of each poker hand.

Further, the following can calculate combinations and probabilities for any number of suits and any number of ranks (number of denominations).

You will notice;

  • at 5 suits a Flush overtakes a Full House,
  • at 6 suits a Flush overtakes a Four of a Kind, and
  • at 13 suits a Flush overtakes a Five of a Kind.

If you don’t believe the numbers, you are more than welcome to add them up and email me.

(thanks to CodeCogs for there LaTeX Engine)

Related posts:

  1. 5 Dimension – a 5 suit playing cards