Friday, September 4, 2009

How can I use AJAX.NET 1.0 - System.Web.Extensions, Version=1.0.61025.0

How can I use AJAX.NET 1.0 - System.Web.Extensions, Version=1.0.61025.0

 

If you got this message: "Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified."

1. You must copy dll(s) to Bin folder:

AjaxControlToolkit.dll
System.Web.Extensions.dll v1.0.61025.0 or other
System.Web.Extensions.Design.dll v1.0.61025.0

and maybe

AJAXExtensionsToolbox.dll v1.0.61025.0

You may have add those tags and sections to the web.config:

2. Under the <Configuration> tag, add the following <configSections> sections:

Code:

    <configSections>
      <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
         <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
            <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"  allowDefinition="MachineToApplication"/>
            <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35">
               <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="Everywhere"/>
               <section name="profileService"  type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false"  allowDefinition="MachineToApplication"/>
               <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" allowDefinition="MachineToApplication"/>
            </sectionGroup>
         </sectionGroup>
      </sectionGroup>
   </configSections>



3. Under the <system.web> tag, add the following <pages> sections:

Code:

   <pages>
      <controls>
         <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </controls>
   </pages>



3. Under <compilation>, <httpHandlers> and <httpModules> tags:

Code:

    <compilation debug="true">
      <assemblies>
         <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
         <add assembly="System.Web.Extensions.Design, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
         <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
   </compilation>
   <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
   </httpHandlers>
   <httpModules>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
   </httpModules>



5. Under <Configuration> tag, add the following <system.web.extensions> and <system.webServer> sections:

Code:

   <system.web.extensions>
      <scripting>
         <webServices>

            <!-- Uncomment this line to customize maxJsonLength and add a custom converter -->   
            <!-- <jsonSerialization maxJsonLength="500"> -->
            <!--    <converters> -->
            <!--       <add name="ConvertMe" type="Acme.SubAcme.ConvertMeTypeConverter"/>  -->
            <!--    </converters>  -->
            <!-- </jsonSerialization>  -->


            <!-- Uncomment this line to enable the authentication service. Include requireSSL="true" if appropriate. -->
             <!-- <authenticationService enabled="true" requireSSL = "true|false"/> -->

            <!-- Uncomment the lines below to enable the profile service.  To allow profile properties to be retrieved -->
            <!-- ...and modified in ASP.NET AJAX applications, you need to add each property name to the readAccessProperties and -->
            <!-- ...writeAccessProperties attributes -->
            <!-- <profileService enabled="true" readAccessProperties="propertyname1,propertyname2" writeAccessProperties="propname1,propname2"/> -->

         </webServices>
         <!-- <scriptResourceHandler enableCompression="true" enableCaching="true" />  -->
      </scripting>
   </system.web.extensions>
   <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
         <add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </modules>
      <handlers>
         <remove name="WebServiceHandlerFactory-Integrated"/>
         <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
         <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </handlers>
   </system.webServer>



You can read: Add AJAX to an Existing Web Application

6. On IIS7 you must fix web.config with migrate tool or migrate web.confing to Integrated pipeline mode:

6.1 You must migrate the application configuration to work properly in Integrated mode. You can migrate the application configuration with AppCmd:

Code:

> %windir%\system32\inetsrv\Appcmd migrate config "<ApplicationPath>"



6.2 You can migrate manually by moving the custom entries in in the <system.web>/<httpModules> and <system.web>/<httpHandlers> configuration manually to the <system.webServer>/<handlers> and <system.webServer>/<modules> configuration sections, and either removing the <httpHandlers> and <httpModules> configuration OR adding the following to your application’s web.config:

Code:

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
</system.webServer>



6.3 Use Classic mode as a last resort if you cannot apply the specified workaround.

Moving to Classic mode will make your application unable to take advantage of ASP.NET improvements made possible in Integrated mode, leveraging future features from both Microsoft and third parties that may require the Integrated mode.

You can read: Breaking Changes for ASP.NET 2.0 applications running in Integrated mode on IIS 7.0

 

Thursday, August 20, 2009

What is Virtual Memory?

 

What is Virtual Memory?

Virtual memory is simulated RAM. When you have used up all your RAM, your computer will shift data to an empty space on the hard drive. The computer swaps data to the hard disk and back to your RAM as needed. When you increase your virtual memory you are increasing the empty space that is reserved for your RAM overflow.

Also having enough available space is absolutely necessary for your virtual memory and RAM to function properly. You can increase Virtual Memory performance automatically by freeing up resources in your registry. You may want to use a Registry Cleaner. Click Here to learn more!

How to increase Virtual Memory?

In Windows XP

1.Click Start, and then click Control Panel.
2.Click Performance and Maintenance, and then click System.
3.On the Advanced tab, under Performance, click Settings.
4.On the Advanced tab, under Virtual memory, click Change.
5.Under Drive [Volume Label], click the drive that contains the paging file that you want to change.
6.Under Paging file size for selected drive, click to Custom size check box. You can enter the amount of memory you would like to reserve for Virtual memory by entering the initial and maximum size.
7.Click Set
When you are prompted to restart the computer, click Yes.
Special Note: You should choose the same amount for the initial size and maximum size. This will Stop your CPU from constantly changing the paging file.

HOT TIP: To stop your CPU from constantly changing the paging file, set the initial and maximum size to the same value. For example, 500 and 500. The value should be at least 1.5 times more than your physical RAM. If your computer has 512MB of RAM increase the virtual memory paging file to 1.5*512= 768

In Vista

1. Click Start button Picture of the Start button
2. Click Control Panel
3. Choose System and Maintenance and then click System.
4. In the left pane, click Advanced system settings.
5.On the Advanced tab, under Performance, click Settings.
6. Click the Advanced tab, and then, under Virtual memory, choose Change.
7. Click Custom to change the Initial size (MB) and Maximum size. See the hot tip above.

 

Tuesday, August 18, 2009

Sql Commands [usefull For Injection]

 

ABORT                                      -- abort the current transaction
ALTER DATABASE                      -- change a database
ALTER GROUP                          -- add users to a group or remove users from a group
ALTER TABLE                            -- change the definition of a table
ALTER TRIGGER                        -- change the definition of a trigger
ALTER USER                             -- change a database user account
ANALYZE                                  -- collect statistics about a database
BEGIN                                      -- start a transaction block
CHECKPOINT                             -- force a transaction log checkpoint
CLOSE                                      -- close a cursor
CLUSTER                                  -- cluster a table according to an index
COMMENT                                 -- define or change the comment of an object
COMMIT                                    -- commit the current transaction
COPY                                        -- copy data between files and tables
CREATE AGGREGATE                 -- define a new aggregate function
CREATE CAST                            -- define a user-defined cast
CREATE CONSTRAINT TRIGGER -- define a new constraint trigger
CREATE CONVERSION               -- define a user-defined conversion
CREATE DATABASE                   -- create a new database
CREATE DOMAIN                       -- define a new domain
CREATE FUNCTION                    -- define a new function
CREATE GROUP                         -- define a new user group
CREATE INDEX                          -- define a new index
CREATE LANGUAGE                   -- define a new procedural language

 

CREATE OPERATOR                   -- define a new operator
CREATE OPERATOR CLASS         -- define a new operator class for indexes
CREATE RULE                           -- define a new rewrite rule
CREATE SCHEMA                       -- define a new schema
CREATE SEQUENCE                   -- define a new sequence generator
CREATE TABLE                          -- define a new table
CREATE TABLE AS                     -- create a new table from the results of a query
CREATE TRIGGER                      -- define a new trigger
CREATE TYPE                            -- define a new data type
CREATE USER                           -- define a new database user account
CREATE VIEW                           -- define a new view
DEALLOCATE                            -- remove a prepared query
DECLARE                                  -- define a cursor
DELETE                                    -- delete rows of a table
DROP AGGREGATE                    -- remove a user-defined aggregate function
DROP CAST                               -- remove a user-defined cast
DROP CONVERSION                   -- remove a user-defined conversion
DROP DATABASE                       -- remove a database
DROP DOMAIN                          -- remove a user-defined domain
DROP FUNCTION                       -- remove a user-defined function
DROP GROUP                            -- remove a user group
DROP INDEX                             -- remove an index
DROP LANGUAGE                      -- remove a user-

 

 

DROP TYPE                                -- remove a user-defined data type
DROP USER                               -- remove a database user account
DROP VIEW                               -- remove a view
END                                          -- commit the current transaction
EXECUTE                                  -- execute a prepared query
EXPLAIN                                   -- show the execution plan of a statement
FETCH                                      -- retrieve rows from a table using a cursor
GRANT                                      -- define access privileges
INSERT                                     -- create new rows in a table
LISTEN                                     -- listen for a notification
LOAD                                        -- load or reload a shared library file
LOCK                                        -- explicitly lock a table
MOVE                                       -- position a cursor on a specified row of a table
NOTIFY                                     -- generate a notification
PREPARE                                   -- create a prepared query
REINDEX                                  -- rebuild corrupted indexes
RESET                                      -- restore the value of a run-time parameter to a default value
REVOKE                                    -- remove access privileges
ROLLBACK                                -- abort the current transaction
SELECT                                     -- retrieve rows from a table or view
SELECT INTO                            -- create a new table from the results of a query
SET                                          -- change a run-time parameter
SET CONSTRAINTS                    -- set the constraint mode of the current transaction
SET SESSION AUTHORIZATION -- set the session user identifier and the current user identifier of the current session
SET TRANSACTION                    -- set the characteristics of the current transaction
SHOW                                       -- show the value of a run-time parameter
START TRANSACTION                -- start a transaction block
TRUNCATE                                -- empty a table
UNLISTEN                                 -- stop listening for a notification
UPDATE                                    -- update rows of a table
VACUUM                                   -- garbage-collect and optionally analyze a database

 

 

Thursday, July 23, 2009

TRIGGER - After / Before / deleted / inserted - MS SQL

 

TRIGGER

            There are

                        BEFORE (trigger)

                        AFTER (trigger)

 

In BEFORE Trigger .

            There is no keyword in MS sql. Instead it defines for.

It is a default trigger

 

In AFTER Trigger.

            There is a keyword in MS sql.i,e After.

 

 

We can get rows which are stored in temporary table by trigger.

            Insert / update

                        Get values from inserted. ( select * from inserted) (copy of a row(s) effected).

            Delete

                        Get values from deleted .  ( select * from deleted) (copy of a row(s) effected).

 

 

During UPDATE

            On Before trigger – we can get row which is not effected by a update in deleted table.

                                                Basically we get rows from deleted table when we are maintaining log/history table.

 

            On After trigger – we can get row which is effected by a update in inserted table.

 

 

Note : there is no updated temporary table.

 

Friday, July 3, 2009

Service Unavailable


Service Unavailable

Then the first solution to the above error is http://support.microsoft.com/default.aspx?id=823552 but if this does not solve the problem try doing the following stuff.

Open the IIS Manager, right click Web Sites and select properties:

http://www.go4expert.com/images/PostImages/IISMan.jpg

Switch to the Service Tab

http://www.go4expert.com/images/PostImages/WebProp.jpg

Check "Run WWW Service in IIS 5.0 Isolation Mode".

You will be asked for Restart of IIS. Click yes to restart IIS. If you are not asked just restart IIS.




This message (including any attachments) contains confidential information intended for a specific individual and purpose and is protected by law. If you are not the intended recipient, you should delete this Message. Any disclosure, copying, or distribution of this message, or the taking of any action based on it, is strictly prohibited.



Wednesday, July 1, 2009

Different Ways to Lock Windows XP


http://pubs.logicalexpressions.com/pub0009/images/dot_transp.gif

Different Ways to Lock Windows XP

http://pubs.logicalexpressions.com/pub0009/images/dot_transp.gif

There are several ways to lock your Windows XP computer, but all of them use the same command line. The method you choose is a matter of personal preference.

  1. via the keyboard
    The easiest way to lock Windows XP is by simply pressing the Windows logo key and the letter L (for Lock) on a Microsoft Natural Keyboard or any other compatible keyboard that includes the Window key. Doing so will pop up the Unlock Computer Password box.
  2. via a Shortcut.
    If you don't have a keyboard with a Window key or simply don't like the keyboard method, then here's how you can make a desktop shortcut to lock your computer.

    Right
    click an empty area of your desktop, choose New/Shortcut and enter this line as the command line:

    rundll32.exe user32.dll, LockWorkStation

    Click Next. Name the shortcut whatever you prefer and click Finish. That's it.

    If you'd like to change the icon, just right click the shortcut and go to Properties/Shortcut/Change Icon.
  3. via the command line
    The above command line can also be used at a DOS prompt to lock your computer. One simple way you can do it would be by clicking Start/Run, typing CMD and then entering the command and pressing Enter.
  4. via a bat file
    This is similar to a Windows shortcut method. But it's a DOS version. If you've never created a bat (batch) file, but would like to try this method, simply open a new text file (such as with Notepad) and type the following commands:

    @echo off
    rundll32.exe user32.dll, LockWorkStation
    cls


    Save the file with a .bat extension, such as Lock.bat, and you're done. Double click to make the file run.

Those are the basic methods to lock XP, but there are some other relating factors of which you should be aware.

Password
It should go without saying that if you don't use a password to log on to your computer, then anyone can access your computer and unlock it. If you want to use the lock feature, then set a password by going to User Accounts in the Control Panel and then click Create Password.

Fast User Switching
Fast User Switching allows multiple login sessions at the same time. Whether you have this feature enabled or disabled will make a big difference in how your locked computer can be accessed and on the behavior of your shortcuts when executed.

If enabled, executing any of the above locking methods will bring up the Welcome screen and other users will be able to log on to the computer, as is the norm for Fast User Switching. So, you really don't get much security at all this way, if your intention is to lock your machine. With Fast User Switching, only your profile is locked, not the ability for other users to log into your system. Any other user can just log on to your computer and use it.

If Fast User Switching is disabled, you will have to enter a password to unlock the computer. Double clicking your shortcut will bring up the Unlock Computer password dialog box. This is the same lock method that Windows NT and 2000 uses.

If you're not sure whether or not you have Fast User Switching enabled or disabled, go to User Accounts in the Control Panel and click the Change the way users log on or off tab. There you will see your status for Fast User Switching.

Welcome Screen
Whether the Welcome screen is enabled or disabled also has an effect on the way your computer can be locked.

If the Welcome screen is enabled, you can also lock your computer in Task Manager (Ctrl+Alt+Delete) by clicking the Lock Computer option in the Shutdown menu list. This option will only appear if the Welcome screen is enabled—without Fast User Switching being enabled.

Note! In order to use Fast User Switching, the Welcome screen must be enabled. You cannot select Fast User Switching if the Welcome screen option is unchecked.

If the Welcome screen is disabled, you can lock the computer by pressing Ctrl+Alt+Delete and then clicking the Lock Computer tab in the Windows Security dialog box that comes up.

Get Server and Machine Name in SQL

 

 

To Get Server name in Microsoft Sql .

select @@SERVERNAME

 

To Get Machine name in Microsoft Sql .

select host_name()

 

Friday, June 26, 2009

Monday, June 15, 2009

ADO.NET : Calling Store procedure

ADO.NET : Calling Store procedure

private void SpTest (id, string name)

{

SqlConnection sqlConn= new SqlConnection(_sqlConnString);

try

{

SqlCommand sqlCmd = new SqlCommand();

sqlCmd.CommandText = "sp_test";

sqlCmd.CommandType = CommandType.StoredProcedure;

sqlCmd.Parameters.Add("id", SqlDbType.Int);

sqlCmd.Parameters.Add("name", SqlDbType.VarChar);

sqlCmd.Parameters[0].Value = id;

sqlCmd.Parameters[0].Direction = ParameterDirection.Input;

sqlCmd.Parameters[1].Value = name;

sqlCmd.Parameters[0].Direction = ParameterDirection.Input;

sqlCmd.Connection = sqlConn;

sqlConn.Open();

sqlCmd.ExecuteNonQuery();

}

catch (Exception exSp)

{

throw exSp;

}

finally

{

sqlConn.Close();

}

}

Wednesday, June 10, 2009

ls –lR Unix Command in sFtp C# DotNet


This code functionality facilitates the ls -lR command in C# project and is for the project which is using Tamis.SharpSsh 3rd party dll to Unix data transmission. 

ls -lR  functionality not provided by them. So I came across the need of it and wrote as below .



Download 3rd party .dll for SFTP data transmission.


 public Tamir.SharpSsh.java.util.Vector lsLr(string path)   
  {   
       Tamir.SharpSsh.java.util.Vector putLsEntry = new Tamir.SharpSsh.java.util.Vector();   
       Tamir.SharpSsh.java.util.Vector getLsEntry = new Tamir.SharpSsh.java.util.Vector();   
       Tamir.SharpSsh.java.util.Vector recLsEntry = new Tamir.SharpSsh.java.util.Vector();   
       Tamir.SharpSsh.jsch.ChannelSftp.LsEntry lsEntry;   
       getLsEntry = _sftp.ls(path);   
       int i = 0;   
       for (i = 0; i < getLsEntry.Count; i++)   
       {   
            lsEntry = (Tamir.SharpSsh.jsch.ChannelSftp.LsEntry)getLsEntry[i];   
            if (lsEntry.getFilename().ToString().Trim() == "." || lsEntry.getFilename().ToString().Trim() == "..") { continue; };   
            if (lsEntry.getAttrs().getPermissionsString().StartsWith("d"))   
            {   
                recLsEntry = lsLr(path + "/" + lsEntry.getFilename());   
                int j = 0;   
                 for (j = 0; j < recLsEntry.Count; j++)   
                 {   
                     putLsEntry.add(recLsEntry[j]);   
                 }   
            }   
            else   
            {   
                putLsEntry.add(lsEntry);   
            }   
       }   
       return putLsEntry;   
 }   

Tuesday, June 9, 2009

Problem in running Iptables from CGI ?

Problem in running Iptables commands from CGI ?

 

This is because ,  CGI not having root privileges  even though you are login as root or Admin.

 

To run root privileges commands through CGI .

 

Step:

 

If you run sudo it will not support.So alter sudoers file and restarted apache.

 

 

Ucase in DataTable.Select(

Ucase in DataTable.Select(

If you want to apply a filter condition on base of upper cases like what we do in sql server as ucase(columnname)=<UPPERCASE VALUE> .

In ADO.NET - Just make it
 datatable.CaseSensitive = false;  

syntax:

 dtCopy.CaseSensitive = false;  
 DataRow[] drFilter = dtCopy.Select("Source_Dir=’/LOCAL/HOME’”);  
 dtCopy.CaseSensitive = true;  

Tuesday, June 2, 2009

XAMPP - Make your Computer a Webserver: Apache, PHP, MySQL

XAMPP - Make your Computer a Webserver: Apache, PHP, MySQL



XAMPP is a free installer that has Apache / PHP / MYsql / perl and more integrated so you won't have to configure anything yourself. HTML / CSS Tutorial.

Wednesday, May 27, 2009

UNIX Quick Reference Sheet

1 Log In Session

1.1 Log In

Enter username at login: prompt. Be carefull - Unix is case sensitive.
Enter password at
password: prompt.

1.2 Change Password

passwd

1.3 Log Out

logout or exit

2 File System

2.1 Create a File

cat >  file      Enter text and end with  ctrl-D
vi  file         Edit  file  using the  vi  editor 

2.2 Make a Directory

mkdir   directory-name

2.3 Display File Contents

cat   file    display contents of  file 
more  file    display contents of  file one screenfull at a  time.
view  file    a read only version of vi. 
less  file    similar to, but more powerfull than more. 
              See the man page for more infomation on  less.

2.4 Comparing Files

diff file1 file2   line by comparison
cmp file1 file2    byte by byte comparison

2.5 Changing Access Modes

chmod mode file1 file2 ...
chmod -R  mode dir (changes all files in  dir  )
    Mode Settings
 
 u  user (owner)
 g  group
 o  other
 
 +  add permission
 -  remove permission
 
 r  read
 w  write
 x  execute

Example: chmod go+rwx public.html adds read, write, and execute permissions for group and other on public.html.

2.6 List Files and Directories

ls        list contents of  directory
ls -a     include files with "." (dot files)
ls -l     list contents in long format (show modes)

2.7 Move (or Rename) Files and Directories

mv src-file dest-file    rename src-file to  dest-file
mv src-file dest-dir     move a file into a directory
mv src-dir dest-dir      rename src-dir,  or move to dest-dir
mv -i src dest           copy & prompt before overwriting

2.8 Copy Files

cp src-file dest-file    copy src-file to   dest-file
cp src-file dest-dir     copy a file into a directory
cp -R  src-dir dest-dir   copy one directory into another
cp -i src dest           copy & prompt before overwriting

2.9 Remove File

rm file      remove (delete) a file
rmdir dir    remove an empty directory
rm -r dir    remove a directory and its contents
rm -i file   remove file, but prompt before deleting

2.10 Compressing files

compress file       encode file, replacing it with file.Z
zcat file.Z         display compressed file
uncompress file.Z   decode file.Z, replacing it with file

2.11 Find Name of Current Directory

pwd    display absolute path of working directory

2.12 Pathnames

simple:

One filename or directory name for accessing local file or directory.
Example:
foo.c

absolute:

List of directory names from root directory to desired file or directory name, each separated by /.
Example:
/src/shared

relative:

List of directory names from working directory to desired file or directory name, each separated by /.
Example:
Mail/inbox/23

2.13 Directory Abbreviations

~           Your home (login) directory
~username   Another user's home directory
.           Working (current)  directory
..          Parent of working directory
../..       Parent of parent directory

2.14 Change Working Directory

cd /                           go to the root directory
cd                             go to your login (home) directory
cd ~username                   go to username's login (home) directory
                               not allowed in the Bourne shell
cd ~username/directory         go to username's indicated directory
cd ..                          go up one directory level from here
cd ../..                       go up two directory levels from here
cd /full/path/name/from/root   change directory to absolute path named 
                               note the leading slash
cd path/from/current/directory change directory to path relative to here. 
                               note there is no leading slash

3.0 Commands

3.1 Date

date    display date and time

3.2 Wild Cards

?    single character wild card
*    Arbitrary number of characters

3.3 Printing

lpr file            print file on default printer
lpr -Pprinter file  print file on printer
lpr -c# file        print # copies of file
lpr -d file         interpret file as a dvi file
lpq                 show print queue (-Pprinter also valid)
lprm -#             remove print request # (listed with lpq)

3.4 Redirection

command > file         direct output of command to file instead of
                       to standard output (screen), replacing current 
                       contents of file

command > > file       as above, except output is appended to the current 
                       contents of file

command < file         command receives input from file instead of
                       from standard input (keyboard)

cmd1 | cmd2            "pipe" output of cmd1 to input of cmd2

script file            log everything displayed on the terminal to file; 
                       end with exit

4 Search Files

grep string filelist           show lines containing string in any file 
                               in filelist
grep -v string filelist        show lines not containing string
grep -i string filelist        show lines containing string, ignore case

5 Information on Users

finger user or
finger user@machine    get information on a user
finger @machine        list users on machine
who                    list current users

6 Timesavers

6.1 Aliases

alias string command     abbreviate command to string

6.2 History: Command Repetition

Commands may be recalled

history    show command history
!num       repeat command with history number num
!str       repeat last command beginning with string str
!!         repeat entire last  command line
!$         repeat last word of last command line

7.0 Process and Job Control

7.1 Important Terms

pid            Process IDentification number.  See section 7.2.
job-id  Job identification number. See section 7.2.

7.2 Display Process and/or Job IDs

ps       report processes and pid numbers
ps gx    as above, but include "hidden" processes
jobs     report current jobs and job id numbers

7.3 Stop (Suspend) a Job

ctrl-Z    NOTE:process still exists!

7.4 Run a Job in the Background

To start a job in  background add & to the end of the command. 
Example: xv foo.gif &


To force a running job into the background:

ctrl-Z    stop the job
bg        "push" the job  into the background

7.5 Bring a Job to the Foreground

fg              bring a job to foreground
fg %job-id      foreground by job-id (see 7.2)

7.6 Kill a Process or Job

ctrl-C                 kill foreground process
kill -KILL pid#        see 7.2 for 
kill -KILL %job-id#    displaying  pids & job-ids 

8.0 Mail Handler (MH)

MH commands are issued directly to the terminal.

inc        incorporate new mail
scan       show list of mail  messages
show       show  current message
next       show next message
prev       show previous message
repl       reply to current message
forw       forward current message
comp       compose a mail message
rmm        remove current mail message
cmd -help  print help on mh commmand cmd 

The file .mh_profile is used to enable/disable MH features. man mh-profile for more information.

9.0 On-line Assistance

On-line Documentation

man command-name   display on-line manual pages
man -k  string     list one-line summaries of manual pages containing string

 

Wednesday, May 13, 2009

Unable to find manifest signing certificate in the certificate store.

Unable to find manifest signing certificate in the certificate store.

1.         To solve, I went to the "Signing" tab of the project properties and unchecked "Sign the ClickOnce manifests".

2.         Go to Project -> project Proprietes -> Signin and then go to Create Test Certificate,and just give a simple password.And then enjoy publish it .

Monday, May 11, 2009

Data Flow Diagram Symbols


Data Flow Diagram Symbols

Data Flow Diagrams Symbols

There are some symbols that are used in the drawing of business process diagrams (data flow diagrams). These are now explained, together with the rules that apply to them. Flow diagrams in general are usually designed using simple symbols such as a rectangle, an oval or a circle depicting a processes, data stored or an external entity, and arrows are generally used to depict the data flow from one step to another. A DFD usually comprises of four components. These four components can be represented by four simple symbols. These symbols can be explained in detail as follows: External entities (source/destination of data) are represented by squares; Processes (input-processing-output) are represented by rectangles with rounded corners; Data Flows (physical or electronic data) are represented by arrows; and finally, Data Stores (physical or electronic like XML files) are represented by open-ended rectangles.


External Entity

An external entity is a source or destination of a data flow which is outside the area of study. Only those entities which originate or receive data are represented on a business process diagram. The symbol used is an oval containing a meaningful and unique identifier.

Process

A process shows a transformation or manipulation of data flows within the system. The symbol used is a rectangular box which contains 3 descriptive elements:

Firstly an identification number appears in the upper left hand corner. This is allocated arbitrarily at the top level and serves as a unique reference.

Secondly, a location appears to the right of the identifier and describes where in the system the process takes place. This may, for example, be a department or a piece of hardware. Finally, a descriptive title is placed in the centre of the box. This should be a simple imperative sentence with a specific verb, for example 'maintain customer records' or 'find driver'.

Data Flow

A data flow shows the flow of information from its source to its destination. A data flow is represented by a line, with arrowheads showing the direction of flow. Information always flows to or from a process and may be written, verbal or electronic. Each data flow may be referenced by the processes or data stores at its head and tail, or by a description of its contents.

Data Store

A data store is a holding place for information within the system:

It is represented by an open ended narrow rectangle. Data stores may be long-term files such as sales ledgers, or may be short-term accumulations: for example batches of documents that are waiting to be processed. Each data store should be given a reference followed by an arbitrary number.

Resource Flow

A resource flow shows the flow of any physical material from its source to its destination. For this reason they are sometimes referred to as physical flows.

The physical material in question should be given a meaningful name. Resource flows are usually restricted to early, high-level diagrams and are used when a description of the physical flow of materials is considered to be important to help the analysis.

Data Flow Diagrams - The Rules

External Entities

It is normal for all the information represented within a system to have been obtained from, and/or to be passed onto, an external source or recipient. These external entities may be duplicated on a diagram, to avoid crossing data flow lines. Where they are duplicated a stripe is drawn across the left hand corner, like this.

The addition of a lowercase letter to each entity on the diagram is a good way to uniquely identify them.

Processes

When naming processes, avoid glossing over them, without really understanding their role. Indications that this has been done are the use of vague terms in the descriptive title area - like 'process' or 'update'.

The most important thing to remember is that the description must be meaningful to whoever will be using the diagram.

Data Flows

Double headed arrows can be used (to show two-way flows) on all but bottom level diagrams. Furthermore, in common with most of the other symbols used, a data flow at a particular level of a diagram may be decomposed to multiple data flows at lower levels.

Data Stores

Each store should be given a reference letter, followed by an arbitrary number. These reference letters are allocated as follows:

'D' - indicates a permanent computer file
'M' - indicates a manual file
'T' - indicates a transient store, one that is deleted after processing.

In order to avoid complex flows, the same data store may be drawn several times on a diagram. Multiple instances of the same data store are indicated by a double vertical bar on their left hand edge.

Relative Data Flow Diagram Resource

Data Flow Diagram Software

UML Diagram Software

Code Composer Studio Tutorial



Code Composer Studio Tutorial

Module by: Deania Fernandez

Summary: A brief tutorial on how to get started using Code Composer Studio.

Introduction

This is a brief tutorial over Code Composer Studio which is a programming environment used to implement various algorithms and load code onto a DSP. If you would like a more in-depth tutorial, please feel free to click on Help -->Tutorial in Code Composer.

Starting Code Composer Studio

Before starting, it would be a good idea to create a folder where you will be saving your project files. Label the folder ELEC424_Tutorial.

To open Code Composer Studio in a Windows 2000 system, click on Start and select Programs --> Texas Instruments --> Code Composer Studio DSK Tools 2 ('C2000) --> Code Composer Studio.

Figure 1
Figure 1 (SelectingCodeComposer.jpg)

You should see the following screen:

Figure 2
Figure 2 (CodeComposerWorkEnvironment.jpg)

Creating a File

To create a new source code file, click on File --> Source File. A window titled 'Untitled1' will appear within the Composer environment:

Figure 3
Figure 3 (CreatingANewFile.jpg)

You can double-click on the 'Untitled1' window to make it larger.

To save your file, click on File --> Save. The following prompt will appear:

Figure 4
Figure 4 (SavingAFilePrompt.jpg)

There are several Save as type… options. Choose the appropriate one for your code. It will give your file the proper file extension. It is also lets the linker know when you compile your code what kind of language the file is written in.

When you are done, click Save.

Creating a New Project

After you have finished creating the files you need to run on the DSP, you will now want to create a project that will include all the files. Select Project --> New…

The following prompt will appear:

Figure 5
Figure 5 (ProjectCreationDialog.jpg)

Fill in the project name in Project Name. Browse to the folder you created for the project in Location. Make sure you select Executable (.out) in Project Type, and select TMS320C28XX in Target. When you are done, click Finish.

Example.pjt will appear in the left-hand side of the Composer environment. Click on the '+' to expand the project:

Figure 6
(a) Before expanding project (b) After expanding project
Figure 6(a) (BeforeExpandingProject.jpg) Figure 6(b) (AfterExpandingProject.jpg)

Adding New Files to the Project

In order to add new files, select Project --> Add Files to Project… The following prompt will appear:

Figure 7
Figure 7 (AddingFilesPrompt.jpg)

Select the file you want to add. To make it easier, you can narrow your search of a particular file by choosing which type of file you want in the Files of type…

When you are done, click Open.

You should now see the file after clicking on the '+' in the left-hand window:

Figure 8
Figure 8 (ExpandingSource.jpg)

Compiling Files and Building Projects

Once you have added all the files you want to be included in your project, you will now need to build your project. Select Project --> Rebuild All. You should see the following window at the bottom of the Code Composer Studio Environment:

Figure 9
Figure 9 (AfterCompilingWindow.jpg)

If there are errors in your code, they will be listed with the corresponding line numbers. Correct them and rebuild your project.

Loading/Reloading Programs

After your code has been successfully compiled and built, you must now load your program onto the DSP. Select File --> Load Program… You will see the following prompt dialog:

Figure 10
Figure 10 (LoadProgramPrompt.jpg)

When you rebuild your project, Code Composer Studio is set at default to create a new folder in your directory called Debug. This is where the executable file is created. Double-click on the Debug folder and you should see your *.out file:

Figure 11
Figure 11 (SelectingOutFilePrompt.jpg)

After you select your file, click Open.

Executing, Halting, or Stopping Your Program

To execute your program, select Debug --> Run or press the F5 key:

Figure 12
Figure 12 (SelectingDebugRun.jpg)

Your program will then begin to run. You will see the following at the bottom left-hand corner of the Code Composer Studio environment:

Figure 13
Figure 13 (CPURunning.jpg)

To stop running your code, select Debug --> Halt:

Figure 14
Figure 14 (SelectingHaltCPU.jpg)

You should then see the following at the bottom left-hand corner of the work environment:

Figure 15
Figure 15 (CPUHalted.jpg)

To resume running your code, press the F5 button.

Debugging Your Code

Since there are few of us that can get our code working right the first time, you will probably have to debug your code. To figure out what could be wrong, there are several methods you can use to break the problem down.

Setting Breakpoints

To execute your code a little at a time or to stop it after a certain point, you can place breakpoints. You can do this by placing the cursor on the line you want to set the breakpoint on, highlighting it by clicking once, and double-click. You should see a solid red circle on the left:

Figure 16
Figure 16 (SettingBreakpoint.jpg)

You can set as many as you like. Rebuild and reload the program. Execute it. The DSP will stop at the first breakpoint. To get to the next breakpoint, press the F5 button to run the DSP again.

To remove the breakpoint(s), place the cursor on the line, highlight it by clicking once, and double-click. The solid red circle should disappear:

Figure 17
Figure 17 (RemovingBreakpoint.jpg)

Watching Variables

To see what values your variables, constants, and/or registers are getting, you can view them in a watch window. Select View --> Watch Window. You should see the following appear in the Code Composer Studio environment:

Figure 18
Figure 18 (WatchWindows.jpg)

Click on the 'Watch 1' tab:

Figure 19
Figure 19 (ClickOnWatchWindow.jpg)

To add a variable, double-click on the row under the 'Name' column:

Figure 20
Figure 20 (SettingAWatchVariable.jpg)

Type in the name of the variable and press the Enter key:

Figure 21
Figure 21 (EnteringAWatchVariable.jpg)

You can change the base of the value by clicking on the 'Radix' column and selecting how you want to view the value.

Figure 22
Figure 22 (ChangingBaseInWatchWindow.jpg)

Profiling Sessions

You can benchmark your code by profiling a session. To do this, you can set one breakpoint at the line where you want the counter to start counting and another breakpoint at where to stop.

Select Profiler --> Start New Session… You will see the following dialog:

Figure 23
Figure 23 (ProfileSesionNameDialog.jpg)

Type in a name for your profile session and click OK.

A window will appear at the bottom:

Figure 24
Figure 24 (ProfileWindow.jpg)

To profile a function, you need to add it to the profile session you just created. Double-click on the file you want to do this in, and place the cursor on any line inside the function and right click. Choose Profile Function --> in (session-name) Session.

Execute the code. When the CPU stops, click on the 'Functions' tab to see the result of the profiling.

Counting Clock Cycles

If you just want to count the cycles and do not need all the stats from profiling, you can just view the clock. SelectProfiler --> View Clock:

Figure 25
Figure 25 (SelectingViewClock.jpg)

The following window should appear at the bottom:

Figure 26
Figure 26 (ClockWindow.jpg)

After setting up your breakpoints, reset the PC to start at the beginning of your code by selecting Debug --> Reset. Run your code. Clear the clock by double-clicking on it, and then run it again. The number of clock cycles will appear in the clock window.

Troubleshooting

If you are having any trouble, sometimes it is best to reset the CPU. You can do this by selecting Debug --> Restart CPU. You will have to reload the program.

Another option is to simply quit Code Composer Studio by selecting File --> Quit and restart the application.

Code Formater

Paste Here Your Source Code
Source Code Formatting Options
1) Convert Tab into Space :
2) Need Line Code Numbering :
3) Remove blank lines :
4) Embeded styles / Stylesheet :
5) Code Block Width :
6) Code Block Height :
7) Alternative Background :
Copy Formatted Source Code
 
Preview Of Formatted Code