Featured Post

Attaching a footer to the bottom of the page

I've been messing around with positioning a footer at the bottom of a page for a few hours now and finally after trial and error have a workable solution that seems to be cross browser compliant. My first thoughts were to absolutely position the footer element at the bottom of the page, but I knew that...

Read More

Attaching a footer to the bottom of the page

Posted by chelfers | Posted in Web | Posted on 14-02-2010

0

I've been messing around with positioning a footer at the bottom of a page for a few hours now and finally after trial and error have a workable solution that seems to be cross browser compliant.

My first thoughts were to absolutely position the footer element at the bottom of the page, but I knew that it would overlap content if the viewport was too small. I messed around with it for awhile playing with margins, heights, and padding with little success. The final result ended up being a combination of previous attempts minus the absolute positioning, and we found a winner!

The basic run down goes a little something like this

<style type="text/css">
html, body { height: 100%; }
#wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 0 -100px 0; }
#spacer { height: 100px; }
#footer { height: 100px; }
</style>
<div id="wrapper">
  <div>Here is some great content</div>
  <div id="spacer"></div>
</div>
<div id="footer">footer</div>

The cool part is that this works in IE6-8, Safari, and Firefox. The key components to cross browser compliance are the height attributes. The height 100% attributes of html and body are inherited by IE and mimic ( by bug? ) the min-height attribute stretching the wrapper element the entire length of the viewport.

The spacer element along side the negative margin attribute ( make sure that both numbers match ) help to offset the footer and keep it snuggled at the bottom of the page.

Mark’s Status Update

Posted by chelfers | Posted in Web | Posted on 29-01-2010

0

Why does it seem like some of the worst things happen to the absolutely most undeserving people? How many times have we seen a child with brain cancer, a single mother of three with terminal breast cancer doing all that she can to keep fighting for her family, or your own father diagnosed with stage four colon cancer. Unfortunately for us the later is the story for Mark, an amazing man, one of those undeserving individuals that should never spend a second of their life suffering for anything.

On Friday January 15, 2010 our father Mark was diagnosed with colon cancer while visiting the hospital for kidney stone pains; to push that knife a little deeper into our hearts we were also told that it has spread to his stomach and liver which are both inoperable.

The doctors sent him off for emergency surgery that occurred a couple days later where nine inches of colon was removed along with bits and pieces that were attached to his stomach. His recovery from the surgery was amazingly quick ( he passed three kidney stones while on the pain medication so he was ecstatic about that also ), and ten days later he was up and about like nothing had happened.

We need to meet with the oncologist to find out the details for the next phase of treatment, but we do know that it will include six months of chemotherapy where he will receive two day-long doses of the drugs pumped into his body through a port they installed in his chest.

We have reached out to everyone we know, and they have reached even further. Before www.prayersformark.com was built we had been tracking the prayers on a printed map and received at least one prayer from every state in the united states and more than twenty countries from around the world. Knowing so many strangers ( at the time ) were thinking about him, and took the time to say a little prayer, even for someone they didn't know is an amazing feeling that has made each day so much more enjoyable and easier.

Our spirits have been greatly lifted by all the support we have received and it is physically possible to see how much it has helped our father; to try and keep the high rolling, prayersformark.com was created for him to stop by and see how many people really do love and support him.

Thank you all for your support, love, and prayers, they have not gone unheard and have changed the lives of an entire family. If you would like to show your support stop by www.prayersformark.com and leave a little remark for him or our family, we would all greatly appreciate it. God bless you all, and may you and your family stay strong and healthy.

Vista – Windows installer service could not be accessed

Posted by chelfers | Posted in Computers, Windows Fixes | Posted on 06-12-2009

Tags: , , ,

2

*facepalm*

What a mini nightmare this turned out to be, but after an hour of unsuccessful googled fixes we have a winner! Here is a brief list of what I tried and then the one that worked and made the most sense; sorry I don't have post-backs to where the information came from, and I do not take credit for any of these fixes.

Attempt 1

  • Boot into safemode ( f8 when restarting the computer )
  • Click Start, then click run ( or hit windows key + r ), then type cmd and click ok
  • Type in the following:

    • %windir%/system32/msiexec.exe /unregister
    • %windir%/syswow64/msiexec.exe /unregister
    • %windir%/system32/msiexec /regserver
    • %windir%/system32/msiexec /regserver
  • Reboot and try your install again

Attempt 2 - Little more advanced, please don't screw up your system

  • Click Start, then click run ( or hit windows key + r ), then type regedit and click ok
  • Navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer\Enum]
  • The view pane should look like this:

    "0"="Root\\LEGACY_MSISERVER\\0000"
    "Count"=dword:00000001
    "NextInstance"=dword:00000001
  • If it looks similar right click Enum entry in the left pane tree and select delete
  • Reboot and try your install again

Attempt 3 - Little bit more advanced, be careful!

  • Click Start, then click run ( or hit windows key + r ), then type regedit and click ok
  • Navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer]
  • Look for the key name DisplayName and make sure that the value is set as C:\WINDOWS\SysWOW64\msiexec.exe /V
  • If you change it reboot

Attempt 4 - this worked for me

- Click Start, then click run ( or hit windows key + r ), then type regedit and click ok
- Navigate to [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSIServer]
- Look for the key name WOW64, double click it and change the "Value data" to 0
- Reboot

In attempt 4, the WOW64 key value of 1 tells the installer to only deal with 32-bit installers and error on the rest, by changing this to 0 the system is now open to install 64-bit apps ( hopefully ) with less headaches.

Hope this helps someone!

CSS Arrows / Pointer Tutorial

Posted by chelfers | Posted in CSS, HTML, Web | Posted on 02-12-2009

Tags: , ,

2

Arrows, pointers, triangles, whatever you wish to call this technique you will end up making a pure CSS arrow; graphics are forbidden!

The process is actually extremely simple, the basic idea is that you you set a nice fat border then remove the side you wish the arrow to point to.

Example Code

.right-arrow {

border: 8px solid white;
border-width: 8px 0 8px 8px;
border-color: white red;
font-size: 0; /* needed for IE browsers, if this isn't set to 0 you will end up with a trapezoid */
line-height: 0;

}

<div class="right-arrow"></div>

Output

So that works fairly nice, but we want to actually do something useful with the arrow like pointing to a link; using a div just complicates the job as we now have to deal with floating. If we change the first example's tag from div to span and remove the font-size property, or set a width to it you will notice we get a trapezoid shape. Let's try and get this fix0red!

Example Code

.right-arrow {

border: 8px solid white;
border-width: 8px 0 8px 8px;
border-color: white red;
font-size: 0; /* needed for IE browsers, if this isn't set to 0 you will end up with a trapezoid */
line-height: 0;
display: inline-block;

}

<span class="right-arrow"></span> <a href="http://twitter.com/blindsignals">follow me on twitter</a>!

Output

follow me on twitter!

The possibilities are fairly large with this technique and it almost certainly shuts out any previous requirement of an image to get the same functionality. With positioning properties we can move our arrow anywhere within a block element to make beautiful pointers on menu items, we can make pointing list items, link pointers, and even faux element wrapping!

Go and make peace with your GIFs and PNGs, they are going to hate you after this.

MS SQL date / time conversion

Posted by chelfers | Posted in SQL, Web | Posted on 25-09-2009

Tags: , , , , ,

0

I often find myself turning to MSDN to get the possible conversion options on MS SQL's date data type, so I finally became un-lazy and created a little script to use in the future to quickly list all possibilities with nice example data and name references.

SELECT
CONVERT( varchar, GetDate(), 100 ) AS '100 Default',
CONVERT( varchar, GetDate(), 101 ) AS '101 USA',
CONVERT( varchar, GetDate(), 102 ) AS '102 ANSI',
CONVERT( varchar, GetDate(), 103 ) AS '103 British/French',
CONVERT( varchar, GetDate(), 104 ) AS '104 German',
CONVERT( varchar, GetDate(), 105 ) AS '105 Italian',
CONVERT( varchar, GetDate(), 106 ) AS '106',
CONVERT( varchar, GetDate(), 107 ) AS '107',
CONVERT( varchar, GetDate(), 108 ) AS '108',
CONVERT( varchar, GetDate(), 109 ) AS '109 Default + milliseconds',
CONVERT( varchar, GetDate(), 110 ) AS '110 USA',
CONVERT( varchar, GetDate(), 111 ) AS '111 JAPAN',
CONVERT( varchar, GetDate(), 112 ) AS '112 ISO',
CONVERT( varchar, GetDate(), 113 ) AS '113 Europe default + milliseconds',
CONVERT( varchar, GetDate(), 114 ) AS '114',
CONVERT( varchar, GetDate(), 120 ) AS '120 ODBC canonical',
CONVERT( varchar, GetDate(), 121 ) AS '121 ODBC canonical (with milliseconds)',
CONVERT( varchar, GetDate(), 126 ) AS '126 ISO8601',
CONVERT( varchar, GetDate(), 130 ) AS '130 Hijri',
CONVERT( varchar, GetDate(), 131 ) AS '131 Hijri'

Pretty dang simple if you ask me; once you find the format you want take a look at the column name and reference it back to the code.

Enjoy!

ASP Search Stemmer Class

Posted by chelfers | Posted in ASP, Web | Posted on 02-08-2009

Tags: , , ,

0

The original stemmer class was developed by Martin Porter to bring words back to their word stems. For example "abilities" would stem to "able", "smelling" to "smell", "I'm awesome" to "damn straight", etc.

I couldn't find a Classic ASP version of this so I ported a port ( I'm not even sure if that's legal! ).

example usage

set Search = new Stemmer      tmp_string = Search.Stem( "abilities" )      response.write tmp_string set Search = nothing

This should produce an echo of "able". Below is a dictionary list of words you can test the class out with, let me know if you find any bugs or issues.

Download ASP Stemmer 1.0.0
Download Dictionary File

How to check for legit credit card numbers

Posted by chelfers | Posted in ASP, Web | Posted on 30-07-2009

Tags: ,

0

I think the title says it all; I've seen many implementations for checking credit card numbers and in my opinion there is really only one that you need and actually works.

Sadly, still in use today by many code examples that I've run across is the good old

if ( first_digit = 4 ) then "visa" elseif ( first_digit = 5 ) then "mastercard" elseif ( first_digit = 3 ) then "amex" elseif ( first_digit = 6 ) then "discover" else "invalid card" end if

/facepalm

This isn't entirely bad ( yes it is, I'm just trying to be nice ), most likely those first digits will always be associated with the cards mentioned above, the problem is the numbers that follow.

"But I found one that checks and second and third numbers!"

Awesome, one tiny step closer to almost not really getting anywhere!

Obviously I'm leading up to the one and only Luhn algorithm which is basically a simple checksum formula used to validate a few different sequences of numbers, for example credit card account numbers.

Straight from Wikipedia here is what is going on with the algorithm

The formula verifies a number against its included check digit, which is usually appended to a partial account number to generate the full account number. This account number must pass the following test:

1. Counting from the check digit, which is the rightmost, and moving left, double the value of every second digit.
2. Sum the digits of the products together with the undoubled digits from the original number.
3. If the total ends in 0 (put another way, if the total modulo 10 is congruent to 0), then the number is valid according to the Luhn formula; else it is not valid.

As an illustration, if the account number is 49927398716, it will be validated as follows:

1. Double every second digit, from the rightmost: (1×2) = 2, (8×2) = 16, (3×2) = 6, (2×2) = 4, (9×2) = 18
2. Sum all the individual digits (digits in parentheses are the products from Step 1): 6 + (2) + 7 + (1+6) + 9 + (6) + 7 + (4) + 9 + (1+8) + 4 = 70
3. Take the sum modulo 10: 70 mod 10 = 0; the account number is valid.

Below is an ASP version I've ported, enjoy.

ACCOUNT = "4500000000000001" alt = false sum = 0     for i = len( ACCOUNT ) to 1 step - 1             digit = mid( ACCOUNT, i, 1 )                     if ( alt = true ) then                 digit = digit * 2                     if ( digit > 9 ) then digit = digit - 9 end if             end if         sum = ( sum + digit ) mod 10                                                 if ( alt = true ) then alt = false else alt = true     next if ( sum = 0 ) then   'legit else   'did not pass the test end if

CSS Sprites or How to make your pages load faster

Posted by chelfers | Posted in CSS, HTML, Web | Posted on 28-07-2009

Tags: , , , ,

0

Regurgitating old web techniques seems to be somewhat of a trend I've fallen into recently, but as I see questions and non-existent usage of these important and basic techniques I feel obligated to help spread the word once again.

Here are a couple of great articles explaining what CSS sprites are, their purpose, makeup, and why no site has a reason to NOT be using this technique aside from laziness ( which is why my blog doesn't use them, <3 Wordpress ).

- http://www.alistapart.com/articles/sprites
- http://css-tricks.com/css-sprites/

Save the Pandas, take the bus, stick to w3 standards! Ah, who am I kidding.

Evony.com or why I’m quitting

Posted by chelfers | Posted in Games, Web | Posted on 24-07-2009

Tags: , ,

11

I was passed this article and have finally made my decision to quit playing, wee.

The game is Evony, I've been playing for a couple weeks and feel I've come to the end; the game is decent, but starting to get boring now that accomplishing anything really takes an entire day or more of waiting ( and it just gets longer, way longer ), and lots of time searching for various objects that seem to be non-existent aside from the online shop that only accepts cash. The player vs player, or player vs computer is also very redundant; you 'spy' on the target, decide how many of your troops are needed and click attack; nothing more to it, repeat perpetually.

I've been doing my best to ignore the extreme push to spend real US dollars to purchase objects that enhance game play. The objects generally speed the game up for the player, but the part that really irks me is the objects called 'medals' that are required to advance in rank. At the start of the game these medals are given out like candy, and as you advance further they can only be obtained by winning computer generated battles at a rate of what seems to be less than 1%. If you don't wish to spend weeks of countless battles looking for these non-existent objects you could spend a few seconds buying them in the online shop for real US dollars, giving you a clear advantage in a game that is advertised as 'Free Forever'.

The real reason that pushed me to quit playing is the game's affiliation with a famous World of Warcraft gold farming company. For those who are unfamiliar with this, the companies basically hire Chinese workers for almost no pay to collect in-game currency and resell it for real world cash. The business model alone isn't what gets people in a tizzy, it's the conditions that the workers are put in and how they are treated. I know my word isn't worth much, but trust me anyone associated with these types of companies are complete scum and I will not be associated with them in any way.

Let's sum up what I don't like and why I'm quitting before I start on a real rant.

  1. Affiliation with a disgustingly inhuman company.
  2. Pushed to spend USD
  3. Boob advertising or overall 'sex sells' mentality that appears in the majority of all Evony ads; here are a few of the many ads that appear on family friendly sites:

Good luck to everyone, and Go Vikings ( server 24 :P )!

Edit: And awesome, now I get to play tag with Google's Adsense to try and block Evony and WoW gold farming ads.

Evony 100,000 Prestige Noob

Posted by chelfers | Posted in Games, Web | Posted on 17-07-2009

Tags: , , ,

91

Let's set things straight right off; I do not think prestige is important for judging someone's abilities in game, it has its uses but for the most part it means nothing.  This guide is to explain how prestige works and how easily it can be gained.