Archive for the ‘General’ Category

C4 = Price After Tax
C4 = Tax Value e.g. 17.5 for the current UK VAT

Price Before Tax =C4/((C4+(C4*(C3/100)))/C4)

e.g.
Tax Value: 17.5
Final Price = 79.99
The price before Tax would be 68.08

  • Share/Bookmark

Today, I had the problem of converting a timestamp to a readable time format inside excel.  Not quite as easy as I would have hoped for, but the solution is fairly painless.

In the excel column you wish to display the date, you need to place the following formula.

=(((COLUMN_ID_HERE/60)/60)/24)+DATE(1970,1,1)

You would then need to replace COLUMN_ID_HERE with the cell that holds the timestamp. e.g. A1

The above formula can be simplified, but I think the above explains a little more what is actually being done to the data :)

You would then need to format the cell to be dd/mm/yyyy hh:mm and you are done :)

  • Share/Bookmark

Over the past few days I have been playing about with my Sky Boxes at home, and found a few hidden secrets around. This post is just to combine the bits I have found.

Forcing An Upgrade

After a few months of having a HD box still running on the old EPG (electronic program guide) , I decided to find a way to force the system to update to the latest version.

You can do this by:

Power off the box at mains
Hold down back up buttom on front of box
Power back on at mains
When download message appears on screen, let go of back up button.

This will usually take around 10 minutes, but once the box comes back, you should have the latest software for your box :)

Sky Installers Menu
The Sky installers menu allows you to change extra settings on your Sky box, but be careful, changing settings in here can cause your box to stop working.

On the original sky epg, you can access this menu by pressing the following keys on your sky remote in order.

SERVICES
4
0
1
SELECT

More information can be found about the options here: http://www.digitalsat.co.uk/skyinstallersmenu.html

To access the menu on a sky HD box, you need to press the following keys in order:

SERVICES
0
0
1
SELECT

  • Share/Bookmark

So, I just downloaded the new Opera, and ran a JavaScript speed check, and was amazed how their new engines compare to the other browsers around.  It also supports Windows 7 taskbar highlights properly :)

The test I ran was on http://www2.webkit.org/perf/sunspider-0.9/sunspider-driver.html and here are the results

Opera 10.50
============================================
RESULTS (means and 95% confidence intervals)
——————————————–
Total: 388.6ms +/- 2.3%
——————————————–

Chrome 4.0.249
============================================
RESULTS (means and 95% confidence intervals)
——————————————–
Total: 556.2ms +/- 3.1%
——————————————–

Firefox 3.5.8
============================================
RESULTS (means and 95% confidence intervals)
——————————————–
Total: 1155.4ms +/- 1.6%
——————————————–

Internet Explorer 8
============================================
RESULTS (means and 95% confidence intervals)
——————————————–
Total: 5145.4ms +/- 0.6%
——————————————–

  • Share/Bookmark

Ever since the web moved into the 2.0 generation, websites are increasingly using ajax to build up content, and navigate around without reloading the entire page. There is one major problem with this, and that is the browser. Until now, browsers to not trigger events for when the user is flipping between pages using the navigation buttons. This has been a problem with flash sites for a much longer period of time, with the user clicking back in the browser expecting to see the previous page shown in flash, but instead, they are taken to the last site they were on.

When improving the functionality of our Automated Chat Software, Intellichat, we had many requests from customers asking for the chat window to not launch when the user clicked back in their browser. After a lot of research into the problem, and how to detect it, I found the solution to be based around iFrames (as much as I hate them). When the user clicks back on their browser, they will initially navigate back through the iframes on the page before main page can go back.

This solution works great in Firefox and IE, however Safari needs an alternative solution. This is based around location hash tags (I find this solution quite messy, and easy to spot from the users point of view). When the page first loads, you can set the window.location.hash to anything you want, and then simply check the window.location.hash variable every few milliseconds to see if it has changed. Once it changes back to an empty value, you can see the user clicked back.

The Solution
I have made a very reusable javascript class, that can be simply dropped into your web page, and when the user clicks back, it will call a function. The default function on this call is a javascript alert “Back Button Clicked”.

To replace this functionality, you simply need to override the OnBack function. This can be done by using the code below.

<script type="text/javascript">
bajb_backdetect.OnBack = function()
{
alert('You clicked it!');
}
</script>

This will now replace the “Back Button Clicked” alert with a “You clicked it!’” alert.

You can see the code in action at http://www.brookebryan.com/code/backbutton/
or you can download the source from: http://www.brookebryan.com/code/backbutton/BackDetect.zip

  • Share/Bookmark

About 20 minutes ago I got my invite to google wave. I now have my account live (brooke@wavesandbox.com) as well as my secondary account (brooke-test@wavesandbox.com), so I can start testing out the wave. I haven’t had any time to get into it and play, but here is a screenshot of an empty preview account :)

Google Wave Home Preview

Update:
After about 20 minutes, everyone started using wave and this is what it looks like

Wave After 20 Minutes

Update 2:
When I tried to reply to a wave that was created after I first loaded the page.

Wave Requires Refresh
  • Share/Bookmark

It has now reached the stage where I am logging into 20 – 40 different servers a day, which itself is quite time consuming when you know the server logins stored in your head.  However, all our servers have different access passwords and finding each server password takes a little too long (there is no way I could remember all our server logins).

There is a great feature on UNIX  machines which will allow you to simply ssh into a server without the password as long as you have configured each machine.

The setup of this is pretty quick, there are only 3 main things you need to remember.

1. Generate the Key on the client box
2. Copy the Key into your clipboard from the client box
3. Enter the Key into  the server box from your clipboard

Stage 1: Generating the Key

ssh-keygen -t dsa

By running the above command, you will generate your client key. You will be faced with a few questions, you should just be able to press enter with no answer on each question.

Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Stage 2: Access the Key

You will need to access the key that was just generated to place on your server so you can quickly access it.   First things first, you need to get the key onto the screen or into your email.  I would recommend using the screen output to avoid any formatting errors by your mail client.

Outputting onto the screen:

cat ~/.ssh/id_dsa.pub

Sending the output to your email:

cat ~/.ssh/id_dsa.pub | mail email@domain.com

Stage 3: Storing the Key on the Server
Now you have the key, you just need to add it onto the server you are going to be SSH’ing into.

Open up the file ‘~/.ssh/authorized_keys’ using your preferred editor. I usually use nano, so:

nano ~/.ssh/authorized_keys

Then copy the key into the end of the file. You need to ensure that the key stays on one line and you have one key per line.

Once you have saved the authorized_keys file, you should be able to hop back onto the client box and just type

ssh root@hostname

and you will be logged straight into shell on the ‘hostname’ box.

And thats all you need to do :)

This has saved me soo much time on a day to day basis and probably given me an extra 30 mins > 1 hour a day to get some real work done.

  • Share/Bookmark

So, its only a few hours away from the timestamp 1234567890 and we just went past 1234543210. As always, sad enough to take a photo (well, Jordan (www.oxcreative.com) took the photo) on a monitor in our office which is displaying www.coolepochcountdown.com. Its only 6 or so hours till all hell breaks out and the time starts going backwards (or we just see a nice timestamp come and go).

123453210

  • Share/Bookmark

A few weeks back Jordan (designer @ Just Develop It) brought in his rubiks cube into the office and we were all amazed that he could complete the cube. The fact he could do it in under 5 minutes just added to the amazement. Between writing code and sleeping, Rich and myself found ourselves trying to solve the cube wondering what logic we could apply to come to a solution. After about a week not being able to complete more than the first 2 layers I cracked and looked around youtube.com for a way to complete the cube.

Much to my suprise, there was a logical way to solve the cube based on a few algorithms. Easy when you know how :) So, the youtube video I found was by pogobat and made the cube easy to understand. You can see the video here: http://uk.youtube.com/watch?v=HsQIoPyfQzM. The algorithms for the cube are as follows:

  1. Fi U Li Ui
  2. Ri Di R D
  3. U R Ui Ri Ui Fi U F
  4. Ui Li U L U F Ui Fi
  5. F R U Ri Ui Fi
  6. R U Ri U R U U Ri
  7. U R Ui Li U Ri Ui L
  8. Ri Di R D

Ok, the letters above dont mean very much unless you can watched the video. You always need to hold the cube in the same position for any of this to work :)

F = The face closest to you (Front)
U = The face on the top (Up)
L = The face in your left hand (Left)
R = The face in your right hand (Right)
D = The face on the bottom of the cube (Down)

There is also i. This stands for ‘inverted’ or ‘counter clockwise’

If you see Ri, you should turn the right face counter clockwise. Should you see R you should turn the right face clockwise. Be sure to only move that one face and not rotate the cube, else it will all end in disaster :)

Once I got to grips with the algorithms, everything slotted into place and I could complete the cube serveral times in one night. Its a very impressive skill to learn.

Get yourself onto youtube.com and watch the video linked above and learn the cube for yourself :)

  • Share/Bookmark

I have finally started working on a new product for JDI a few weeks back, its called Visitors 2 You.   This product is based around Search Engine Optimisation, allowing customers to enter in their domain, and a few search criteria they expect / want to appear under, and we will start recording historical data of search positions, link popularity and a few other bits.  I have been looking to get a product like this for the past few months to watch our own websites grow, see our improvements in Search Engine Rankings and make sure we are always improving our sites for both customers and search engines.

Visitors 2 You aims to help you improve your natural search positions through a range of methods, from code improvement, correct meta tags, improved content and much more.  We aim to have this product live within the next week or so, so make sure you signup to the newsletter and be the first to know when you can signup.

We are always looking for new features to add into the product to make sure its the only SEO tool you need, so if you have any ideas, feel free to email them to me : brooke [at] justdevelop.it

Visitors 2 You can be accessed at: www.visitors2you.com

  • Share/Bookmark