Develop a digital watch using Javascript which runs on almost every browser.

Small piece of HTML and Javascript code to develop a digital watch using Javascript which executes at client side no need to write any server side script and it executes on almost every browser,We can do this in few lines of code and good thing is, there is no browser compatibility issue with this script, just copy and paste it on your notepad and save with html extension, now this is ready to Test.

Code:

<!--
    Author: Mohammad Usman
    Version: 1.0
    Technology used: HTML,Javascript
    Description: Digital Watch Using Javascript and Html.
-->
<html>
    <head>
            <title>Digital watch for every browser by Usman</title>
    </head>
    <body>        
        <script type="text/javascript">
            /*@Usman 
                Set method for every second time interval
                Parm 1(Clock) :Call custom Method to Run current Time.
                Param 2 :1000 millisecond to run watch second by second
            */
            var int = self.setInterval("clock()",1000);
            /*Clock method*/
            function clock(){
                var d=new Date();
                var t=d.toLocaleTimeString();
                document.getElementById("clock").innerHTML = "<B>" + t + "</B>";
            }
        </script>
        <div id="clock" style="text-align:center;font-size:30px;font-family:Calbiri;color:Black;background-color:rgb(207,229,236)"></div>
    </body>
</html>
Read the rest of this entry »

Key Prefixes of standard Objects in Salesforce

List of key Prefixes of standard Objects in Salesforce is given below , here I have covered almost all standard Sobject key prefixes.

Object prefix (Key prefix)

Object Type

001

Account

00r

Account Share

04m

Additional Directory Number

01p

Apex Class

07L

Apex Debug Log

707

Apex job

01q

Apex Trigger

806

Approval

04i

Approval Request

ka0,KA0

Article

02i

Asset

00P

Attachment

01m

Business Hours

019

Business process

04v

Call Center

701

Campaign

00v

Campaign Member

01Y

Campaign Member Status

08s

Campaign Share

500

Case

00a

Case Comment

01n

Case Share

010

Case Solution

02o

Category Data

02n

Category Node

0F9

Chatter Group

0FB

Chatter Group Member

09a

Community

003

Contact

00K,02Z,03j,02a

Contact Role

03s

Contact Share

068,069

Content

800

Contract

00b

Custom Button or Link

01N

Custom S-Control

015

Document

05X

Document Entity Map

091

Email Service

093

Email Services Address

018

Email Status

00X

Email Template

0E8

Entity Subscription

00U

Event

020

Event Attendee

0D7

Feed Comment

0F7

Feed Post

0D6

Feed Tracked Change

022

Fiscal Year Settings

00l

Folder

608

Forecast Share

00G

Group

011

Group Member

0C0

Holiday

087

Idea

00a

Idea Comment

kA#

Knowledge Article

ka#

Knowledge Article Version

00Q

Lead

01o

Lead Share

016

Letter Head

01H

Mail merge Template

0D5

News Feed

002

Note

006

Opportunity

008

Opportunity History

00k

Opportunity Product

00t

Opportunity Share

00J

Opportunity Competitor

00D

Organization

0D2

Org Wide Email Address

00l

Partner

026

Period

01s

Price book2

01u

Price book Entry

04g

Process Instance

04h

Process Instance Step

01t

Product

00e

Profile

03g

Queue Sobject

012

Record Type

00E

User Role

08e

Scheduled Job

0DM

Site

501

Solution

081

Static Resource

00T

Task

005

User

100

User License

03u

User Preference

0D5

User Profile Feed

099

Visual force component

066

Visual force Page

083

Vote

Read the rest of this entry »

Software Design Pattern Introduction (what and why)

What is the design pattern?

If a problem occurs over and over again, a solution to that problem has been used effectively. That solution is described as a pattern. The design patterns are language-independent strategies for solving common object-oriented design problems. When you make a design, you should know the names of some common solutions. Learning design patterns is good for people to communicate each other effectively.
In fact, you may have been familiar with some design patterns, you may not use well-known names to describe them. SUN suggests GOF (Gang Of Four--four pioneer guys who wrote a book named "Design Patterns"- Elements of Reusable Object-Oriented Software), so we use that book as our guide to describe solutions. Please make you be familiar with these terms and learn how other people solve the code problems.



Why we use design pattern? (For Best Practice)

Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems, and it also improves code readability for coders and architects who are familiar with the patterns.
In order to achieve flexibility, design patterns usually introduce additional levels of indirection, which in some cases may complicate the resulting designs and hurt application performance.
By definition, a pattern must be programmed anew into each application that uses it. Since some authors see this as a step backward from software reuse as provided by components, researchers have worked to turn patterns into components. Meyer and Arnout were able to provide full or partial componentization of two-thirds of the patterns they attempted.
Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that does not require specifics tied to a particular problem.
Read the rest of this entry »

Automatic on Time Based Shutdown in Batch

Manage PC power on, shutdown, logoff and sleep modes of your own PC - even if you have to set time to shut down your PC.The great thing is that , for doing , this type of stuff you do not need to download any Software or any thingYou just need Copy and Paste these lines of codes to your notepad  and save it with bat extension like (shutdown-batch.bat).

Irritated with the fact that some applications just don't go well together with Window's Hibernate or Suspend features? 
Batch Script :
@echo off
    color 3
    title Time Based Shutdown
    set /p fullname="Enter a name:"
     
    :start
    cls
    echo Hi, %fullname%
    echo.
    echo 1.Shutdown
    echo 2.Quit
     
    :invalid_choice
    set /p choice="enter your choice 1,2: "
    if %choice%==1 goto shutdown
    if %choice%==2 exit
    echo invalid choice: %choice%
    goto invalid_choice
     
    :shutdown
    cls
    set /p sec="Enter the number of seconds that you wish the computer to shutdown in: "
    set /p message="Enter the shutdown message you wish to display: "
    shutdown -s -f -t %sec% -c "%message%"
    echo shutdown initiated at %time%
    set /p cancel="type cancel to stop shutdown "
    if %cancel%==cancel shutdown -a
    if %cancel%==cancel goto start

Read the rest of this entry »

How to Create System Log Using Batch Script

Several time we need to trace our log to check which types of error and waring exist in our computer system there is a easy way to generate system log.you  don't need any software installation.So copy this script and paste in notepad and give name like log.bat in your Operating System drive (like C: drive or whatever you want).

Script:
  1. @echo off
  2. echo. > l1.txt
  3. echo Log File >> l1.txt
  4. echo. >> l1.txt
  5. echo User : %username%  >> l1.txt
  6. Date />>l1.txt
  7. Time />> l1.txt
  8. echo. >> l1.txt
  9. echo Process Ran by %username% >> l1.txt
  10. echo. >> l1.txt
  11. qprocess  >> l1.txt
  12. echo. >> l1.txt
  13. echo Network Activities  >> l1.txt
  14. netstat ->> l1.txt
  15. exit

And here is another part of this application which is an HTML code to show you log in Browser.just Copy and paste this code in notepad and save as log.html .

Code :
  1. <!-- Author : Mohammad Usman
  2.     Date   : 12/07/2011    -->
  3. <head><title>Log File - Usman</title></head>
  4. <br/>
  5. <center><h1><u> Log File </u></h1>
  6. <i>This Log file is created by <b>Usman</b> for monitoring System Activities!</i>
  7. <br/>
  8. <ul>
  9. <center><a href="c:/l1.txt">Click here to view the Log File</a></center>
  10. </ul>
  11. </body>
  12. </html>

Read the rest of this entry »

Format whole Computer using Utility Disk in few steps.

Format your computer using utility disk , Most of the people need to format his/her computer for removing bad sector from computer.
Here is a simple debug code need to write to perform format.

DEBUG SCRIPT
  1. C:> debug
  2. - F  200  L1000  0 < Enter >
  3. - A CS : 100 < Enter >
  4. xxxx:0100  MOV AX,301 <Enter >
  5. xxxx:0103  MOV BX,200 <Enter >
  6. xxxx:0106  MOV CX,1 <Enter>
  7. xxxx:0109  MOV DX,80 < Enter >   <-"80" for hd 0 ,"81" for hd 1
  8. xxxx:010c  INT 13 < Enter >
  9. xxxx:010E INT 20 < Enter >
  10. xxxx:0110 < Enter >  <- leave this line blank
  11. - G < Enter >
  12. program terminated normally
  13. < CTRL - ALT - Del >
  14. partitions are now gone. Now you can proceed with F disk.

Read the rest of this entry »

Clean your PC with batch File

OPERATING SYSTEMS, PROGRAMMING

Note : your all files will be cleaned by using this script (batch file) , so don’t try it if you have any important data or you does not want to remove all.

To clean your PC BY BATCH FILE PROGRAMMING just copy and save in notepad as clean.bat
and run the file
it will clean your pc. All files of administrator will be deleted.

Script:
  1. @echo off
  2. if %username% == Administrator.WINDOWS goto admin
  3. REM ** Delete User Files **
  4. rmdir /S/Q “%systemdrive%\Documents and Settings\%username%\Recent”rmdir /S/Q “%systemdrive%\Documents and Settings\%username%\Local Settings\Temp”rmdir/S/Q “%systemdrive%\Documents and Settings\%username%\Local Settings\History\History.ie5&#8243;rmdir /S/Q “%systemdrive%\Documents and Settings\%username%\Local Settings\Temporary Internet Files\content.ie5&#8243;
  5. goto end
  6. :adminREM ** Do some extra stuff here **REM ** What ever you want….. **
  7. ECHO You are a Administrator
  8. rmdir /S/Q “%systemdrive%\Documents and Settings\%username%\Recent”rmdir /S/Q “%systemdrive%\Documents and Settings\%username%\Local Settings\Temp”rmdir/S/Q “%systemdrive%\Documents and Settings\%username%\Local Settings\History\History.ie5&#8243;rmdir /S/Q “%systemdrive%\Documents and Settings\%username%\Local Settings\Temporary Internet Files\content.ie5&#8243;
  9. REM ** Do more stuff here **REM ** Blah, blah, blah……**
  10. :endexit

Read the rest of this entry »

Comment On Facebook