Typical WML File Structure
Posted on April 28, 08 @ 05:32 am under WML and WAP and has no comments.
<!-- The xml notation -->
<!-- DOCTYPE specification -->
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd">
<!-- Starting of WML Deck (set of cards) -->
<!-- Starting of Card (screen displayed at once) -->
<card id="welcome" title="Welcome">
<!-- Everything has to be in paragraphs -->
<p>Welcome to WAP Content!!!</p>
<p><a href="page2.wml">Sample Link </a></p>
<p><a href="#contact">Contact Webmaster</a></p>
<!-- ... much more content ... -->
<!-- End of card -->
<!-- More cards if needed -->
<card id="contact" title="Contact Webmaster">
<p>Webmaster: Krishna Srikanth (email@example.com)</p>
<!-- End of WML deck -->
April 28, 08
Posted on April 28, 08 @ 05:07 am under Diary and has no comments.
Every one in this world is so busy, except me. So busy that they dont want to talk atleast for a few minutes. Every one is sitting so quietly that I cannot bare this silence.
April 27, 08
Posted on April 26, 08 @ 04:18 pm under Diary and has no comments.
Today I installed the latest Ubuntu 8.04 Linux on my Windows drive (wubi installation). I am also able to connect to BSNL internet using ADSL router and am posting this message from Ubuntu. No doubt, Ubuntu will replace the Windows just in few years.
April 9, 08
Posted on April 09, 08 @ 09:10 pm under Diary and has no comments.
I found the real power of Orkut today. I found one of my old school friend and my school batch from Orkut. Guess what, there are few more Krishna Srikanths around the world (as seen in Orkut). One is in Atlanta GA, second in Bangalore, third in Visakhapatnam, fourth in Kakinada. I dont know if there are any more. Yes, Orkut should be given a prize for its concept. But the only problem is with names, most of which are very weird.
April 07, 08
Posted on April 07, 08 @ 08:15 am under Diary and has no comments.
Svasti sri chandramana sarvadhari naama samvatsara ugadi subhakankshalu. Wishing my relatives, well-wishers, friends and everyone, a happy and prosperous Ugadi. I hope this new year will bring peace all over the world as well as in the minds of everyone.
March 31, 08
Posted on March 31, 08 @ 07:46 pm under Diary and has no comments.
Today I gave training on PHP in TCS. There were six students. The way I started was some what different. I stuffed alot of information in my mind, but I forgot everything when I started telling. On the whole, I gave only 45% of what I have prepared. My colleagues said not to worry, as it was my first training program.
Today I also understood how insulting it would be for a faculty, when one of the trainees goes away while the class is going on. One of the student (a girl) went away talking on the phone, and came back after the session ended. I don't think she might have talked for two and half hours on the phone. Any way, I felt some what insulted. And she did not showed up for the second half of the session.
Second half was somewhat satisfactory. I showed the participants the application I was designing currently. I explained the Jasmine Framework which I have prepared. I think the participants were impressed by the programming style I follow.
I understood how difficult it is to explain a subject, though we are expert in it. Programming a script is different from explaining how it works. Really, this day has to be remembered in my life.
Posted on March 30, 08 @ 12:39 am under For Your Information and has no comments.
rundll32.exe PowrProf.dll, SetSuspendState
(Make sure hibernation is enabled)
To clear auto logon
Getting Apache's ModRewrite to work
Posted on March 30, 08 @ 12:26 am under Webservers and has no comments.
Apache ModRewrite module makes the URLs to be rewritten in a search engine friendly manner. ModRewrite means Rewrite Module. For example, Drupal uses the ModRewrite to change the appearance of URLs. To use this functionality, ModRewrite should be enabled on the Apache server. This tutorial is based on Apache 2.2.8 on Windows. The same process can be applied to other versions.
First of all the rewrite module has to be enabled on the server. For this, in httpd.conf, uncomment the following line and restart the server.
<code>LoadModule rewrite_module modules/mod_rewrite.so</code>
Once it is done, its left to applications to use this feature. Applications need to turn on this feature in .htaccess file. For this, add following line to .htaccees file.
Finally the rewrite condition has to be specified in .htaccess.
Calculating world times for PHP scripts
Posted on March 30, 08 @ 12:22 am under PHP and has no comments.
Some websites show timings of different places all over the world. This improves user interface. Often programmers find this tricky. So I thought to articulate this for future references.
Calculating time differences is done in two steps.
1. Calculating the time difference between the server zone and the GMT.
2. Calculating the time difference between GMT and requested place.
Suppose this server is in Arizona, i.e -7:00 Hrs from GMT. So first the difference needs to be calculated.
$gmt=time() + 25200;
The value 25200 comes from 7 x 1hrs (60 mins) = 420mins x 60sec/min = 25200 secs. Now this value is added to current time on server, got by time(). Now the GMT time (in secs) is calculated.
Next, we need to add/subtract the required location from the GMT time. The final time would be our required time.
Here are some of the examples and their difference (in seconds) from GMT .
Using FCKEditor in PHP websites
Posted on March 30, 08 @ 12:21 am under PHP and has no comments.
Many times, especially when it comes to content management systems, FCKEditor will be a useful thing. It generates html, that can be directly inserted into database, and can be displayed in relevant pages. This will be a reference of how to use FCKEditor in websites.
<strong>Compacting the FCK editor </strong>
- Other than PHP scripts in the fckeditor folder.
- Language messages other than English, located in editor/lang folder.
- Delete other than PHP connectors in editor/filemanager/connectors
- You may also want to keep only one theme which you like in editor/skins. I prefer the silver theme.
Now the folder size comes down around 1.8 MB, and its reasonable.
<strong>Knowing the files to be used</strong>
FCK can be centrally included by including fckeditor/fckeditor.php. The FCK object becomes available then and you can directly use it.
<strong>Creating the Editor</strong>
Once the environment is setup, you need to start using the FCKE. For this, just create an object, show the base path to fckeditor folder, and create() it. You can give the instance a name, while instantiating the object. In this case, myFCKE is the name given.
$fcke = new FCKeditor('myFCKE') ;
$fcke -> BasePath = 'fckeditor/';
$fcke -> Create() ;
Giving the Basepath relative to the fckeditor.php is a must, or else the icons will not be shown. This will generate the iframe window with necessary elements in it.
<strong>Uploading the files via FCKE</strong>
While inserting images, you may want to upload the newer ones via fck, for this, you need to enable this configuration in editor/filemanager/connectors/php/config.php. In this file, turn on the config by giving true for $Config['Enabled'].
$Config['Enabled'] = true ;
But be careful. Turning this On on a publicly accessible FCKE opens a risk of file uploads by anonymous users. It is recommended to login control the FCKE after enabling this.
Next you need to specify where the uploaded files reside. You can specify the path relative to document root in $Config['UserFilesPath'];
$Config['UserFilesPath'] = '/FCKEFiles/' ;
Note: The directory specified here must be writeable.
<strong>Using images and other objects in FCKE</strong>
The images uploaded via FCKE can be accessed at the time of inserting images.
<strong>Storing the value in database</strong>
The output of FCKE will be posted back as a normal form post, along with the other form fields, if any. You can capture this value from $_POST['myFCKE']. This value contains the html code with properly escaped quotes and other things. So you can directly put in database.
<strong>Getting back the FCKE value</strong>
For displaying in HTML
As the output of FCKE is HTML itself, the value retrieved form database can be directly echoed on the HTML page.
For editing back in FCKE
The HTML generated by FCKE can be understood by FCKE, so this HTML can be directly assigned to the $Value property of the object before create()ing it.
$fcke -> Value = $db->rows['Content'];
$fcke -> Create();
Once the editing is finished, it can be directly inserted into database as briefed out previously.
Pages: 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 -  - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 30 - 31 - 32 - 33 - 34 - 35