Tuesday, February 28, 2006

Capturing time spent on a form

There was a requirement to show the time taken to take the test in the test module. I started off with something like this.

I used the following code on the test page:
[code]
<body onload="" starttime =" new" onunload="endTime = new Date(); document.form1.timerField.value = endTime.getTime() - startTime.getTime()">

[/code]

But this was somehow not capturing the endTime.

So I had resorted to functions as follows using javascript.

var endtime
var starttime
var tdiff

function doStart() {
starttime = new Date();
document.form1.startTime.value = starttime.valueOf();
}

function doEnd() {

endtime=new Date()
document.form1.endTime.value = endtime.valueOf() ;
diff();
document.form1.submit;
}


function diff()
{
tdiff = endtime.valueOf() - starttime.valueOf();
document.form1.timerField.value = round_decimals((tdiff/60000),2) ;
}

This displays the time taken to complete the test on the results page by using the Request.Form("timerField")

Friday, February 24, 2006

What is BBCode? What are the differences between HTML and BBCode?

I have seen lot of forums that require postings be written in BBCode rather than HTML.

The main reason, must be so that there is some control over people not adding unauthorized links (like including pictures from unaffiliated Web sites) because it doesn't seem that much easier than HTML when you look at the two.

The basic differences between BBCode and HTML is that HTML uses <> two surround tags, BBCode requires that you use [ and ]. For example:


  • Bold text is produced with [b] text to have in bold[/b],
  • While italics is generated with [i] and [/i] and
  • Underlining is done with [u] and [/u].
  • Font color and size changes are accomplished with deprecated HTML "font" tag attributes: [color=red]text in red[/color] turns some text red, for example. You can also use the hexadecimal color equivalent (that is, use [color=#00ff00]), and text size can be specified as a value (that is, use [size=1]).
  • There are two ways you can show a hypertext reference in BBCode. The easiest is to use a URL tag. To point to this Web site, for example, you'd use this: [url]http://mytechlearning.blogspot.com/[/url]. If you want to display a name instead of the actual URL, use this: [url=http://mytechlearning.blogspot.com/]My Tech Learning[/url].
  • There is also special code listing blocks denoted with [code] and [/code]. Within these two tags, all <> symbols are translated into their displayable equivalent (the HTML character entities < and >) so that you can share HTML code with other members of the forum like in tek-tips forums .
  • As in HTML, you can combine multiple tags in a sequence if you want. Just make sure that you always close links from innermost to outermost, just like parentheses in your English writing!

    • Wednesday, February 22, 2006

      Do you want to amuse yourself ?


      Oops! see I have spilt coffee on my weblog. This is how I amused myself by trying the different options.



      I have also seen the flowerpower on my blog . It looks cute isn't it!

      You also can do these things and many more by Check for yourself here.

      Hope you enjoy this!

      Tuesday, February 21, 2006

      Ticks and Crosses

      Today I had to mark the test module I was creating with some ticks and crosses when the user answers the questions in the test. I thought of using images of crosses and ticks. So I searched on google high and low for a reasonable tick and a cross. But couldn't find reasonable ones.

      Then Wayne suggested to use symbols from Word. So I used the symbols in Front Page.

      Did you know that 'P' means a tick(P) when we change the font to 'Windings 2'?
      Also did you know that 'Q' means a cross(Q) when you change the font to 'Windings 2'?

      Well the advantage of using these symbols was you could change the color of the font to whatever you want.

      Monday, February 20, 2006












      This is the homepage of the test module application that I am developing in asp. This module has a user and an admin features.

      The user after creating an account can login and take tests and see the results. The administrator can add a test category, add questions under the test category, edit existing questions.

      Thursday, February 16, 2006

      What's AJAX?

      These days I have been hearing a lot about AJAX. So today I had sometime to explore and see what it means.

      And I have found heaps of information about it and didn't where to start. But I found this site where it starts from the basics.

      So What's AJAX? Is it just another plugin like a flash, or an applet? no it isn't. Ajax is just a style of design, one that milks all the features of modern browsers to produce something that feels less web and more desktop. Sounds nice isn't it?

      As Jesse James Garrett puts it, "AJAX" itself is a geeky acronym: "Asynchronous JavaScript+CSS+DOM+XMLHttpRequest". The technologies involve: Javascript and DHTML, to let applications respond to events such as mouseclicks; DOM, to let applications manipulate the display; XMLHttpRequest, to let the browser and the server communicate without having to refresh the page.

      I am going to explore this AJAX phenomenon in the coming days and learn more about it.

      Wednesday, February 15, 2006

      Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.

      I worked a long time on this error with the application I am developing in ASP. My research today has shown that this is often a datatype problem. If the value that is filled in the form is not the same as that has been defined in the database, you get this error. For example, if you are passing a null value to a field that doesn't accept them (DATETIME field) or passing an value to a Boolean field etc.

      For more information on this error, click here

      Tuesday, February 14, 2006

      Emailing Voice (Really???)

      Many thoughts come to our mind while we are walking, relaxing, driving etc. Our thinking cap is on as long as we are awake but we are not at our computers all along. And these thoughts are lost if we don't make a note of it and execute it. Now in this Technology age there is this company Springdoo that provides phone users in New Zealand, Australia, UK and USA the ability to 'talk' their emails.

      In other words, you can be lazy like me and record a Springdoo voice message using a computer microphone and send it via their existing email account for free. You can also configure your cellphone (which you always carry with you) and whenever you feel like making notes you can record your thoughts and email it to yourself or the appropriate people and make sure those thoughts get actioned.

      Wonderful! Isn't it?

      Now imagine Blogging Voice instead of Emailing Voice!! Sounds spectacular. You don't need to be at your computer posting your blog. You can publish your voice as your blog entry everyday. Hope one day we will be able to do this with the help of companies like Springdoo.

      Monday, February 13, 2006

      "[Microsoft][ODBC Microsoft Access Driver]General error Unable to openregistry key 'Temporary (volatile) Jet DSN for process"

      This error occured for the first time to me today when I set up my connection in the asp code. I spent about 15 mins. thinking why this error is occuring. I thought this could be something related to permissions either for the database or for the directory where the database is residing.

      These are the things I tried:
      • the webserver environment needs "write" permission to the directory where the Access database resides. So, set permissions first. Go to Windows Explorer, Tools, Folder Options, View and turn off the very last entry in the list ("Use simple file sharing") if you haven't already done so.
      • When you right-click on the database folder there is a "Security" tab . Make sure you give write permission to the folder with the Access database to the "IUSR_****" account (with *** being your computer's name). This account is used by IIS, as default, to evaluate permissions for the default access to your local website and scripts.
      • Give the same user IUSR_ (or whatever is the default account) access to the TEMP directory of Windows. MS Access might need to write some stuff there.
        Give the same account write permission in MS Access itself. These permissions can be reset by Access if you compact and repair the database so keep in mind to refresh this permission if necessary.
      • If you still get the error "[Microsoft][ODBC Microsoft Access Driver]General error Unable to openregistry key 'Temporary (volatile) Jet DSN for process", check that the database is really in the directory referenced by the DSN or the connection string in your ASP file! Also, check for misspellings in the file name and whether the path is correct. This was the reason for my error today.

      Free Power BI Classes for Week 7 (Last)

      Just completed the last class of the F ree  P ower BI  classes of this series.  Today we have covered Adding a canvas background Adding Imag...