Posts Tagged ‘Programming’

C Program To Shutdown Or Turn Off Computer

February 20th, 2013, posted in C
Share

To shutdown immediately use “C:\WINDOWS\System32\ shutdown /s /t 0”. To restart use /r instead of /s.

C Program to shutdown your computer: This program turn off i.e shutdown your computer system. Firstly it will asks you to shutdown your computer if you press ‘y’ the your computer will shutdown in 30 seconds, system function of “stdlib.h” is used to run an executable file shutdown.exe which is present in C:WINDOWSsystem32 in Windows XP. You can use various options while executing shutdown.exe for example -s option shutdown the computer after 30 seconds, if you wish to shutdown immediately then you can write “shutdown -s -t 0” as an argument to system function. If you wish to restart your computer then you can write “shutdown -r”.

If you are using Turbo C Compiler then execute your file from folder. Press F9 to build your executable file from source program. When you run from within the compiler by pressing Ctrl+F9 it may not work.

C programming code for Windows XP

#include <stdio.h>
#include <stdlib.h>

main()
{
   char ch;

   printf("Do you want to shutdown your computer now (y/n)n");
   scanf("%c",&ch);

   if (ch == 'y' || ch == 'Y')
      system("C:\WINDOWS\System32\shutdown -s");

   return 0;
}




C programming code for Windows 7

#include <stdio.h>
#include <stdlib.h>

main()
{
   char ch;

   printf("Do you want to shutdown your computer now (y/n)n");
   scanf("%c",&ch);

   if (ch == 'y' || ch == 'Y')
      system("C:\WINDOWS\System32\shutdown /s");

   return 0;
}

To shutdown immediately use “C:\WINDOWS\System32\ shutdown /s /t 0”. To restart use /r instead of /s.

C programming code for Ubuntu Linux

#include <stdio.h>

int main() {
  system("shutdown -P now");
  return 0;
}


You need to be logged in as root user for above program to execute otherwise you will get the message shutdown: Need to be root, now specifies that you want to shutdown immediately. ‘-P’ option specifes you want to power off your machine. You can specify minutes as:

shutdown -P “number of minutes”

For more help or options type at terminal: man shutdown.

Share

Link to “References & Resources For Programming “

February 19th, 2013, posted in Programming
Share

1.  Java

General

  1. Java mother site @ http://java.sun.com (or http://www.oracle.com/technetwork/java/index.html).
  2. Java Developers’ sites, in particular, http://java.net.


JDK
(aka Java SE)

  1. Java SE mother site @ http://java.sun.com/javase (or http://www.oracle.com/technetwork/java/javase/overview/index.html).
  2. JDK 7 API Documentation Online @ http://download.oracle.com/javase/7/docs/api/index.html.
  3. JDK 7 Documentation Online @ http://download.oracle.com/javase/7/docs/.
  4. Ken Arnold, James Gosling and David Holmes, “The Java Programming Language”, 4th Edition, 2005. (The defacto standard for Java Language, but does not seem to have been updated to cover the latest features?!)
  5. James Gosling, Bill Joy, Guy Steele and Gilad Bracha, “The Java Language Specification”, 3rd Edition, 2005. (The defacto standard for JVM, but does not seem to have been updated?!)
  6. JDK 7 Demos and Samples (to be downloaded @ http://www.oracle.com/technetwork/java/javase/downloads/index.html)

Books & Online Tutorials

  1. The online Java tutorial @ http://docs.oracle.com/javase/tutorial/. (The authoritative source.)
  2. Paul Deitel and Harvey Deitel, “Java How to Program”, 9th Edition, 2011. (A comprehensive reference for programmers.)
  3. Y. Daniel Liang, “Introduction to Java Programming”, 9th Edition, 2012. (Good text book for undergraduate Java courses.)
  4. Bruce Eckel, “Thinking in Java”, 4th edition, 2007. (Great book but has not been updated?!)


2.  HTML & CSS

Specifications

  1. HTML @ W3C (www.w3.org)
    1. HTML 4.01 Specification @ http://www.w3.org/TR/html401/.
    2. HTML 5 Draft Specification @ http://www.w3.org/TR/html5/.
  2. XHTML 1.0 Specification (W3C) @ http://www.w3.org/TR/xhtml1/.
  3. CSS Specification (W3C) @ http://www.w3.org/Style/CSS/.

Online Tutorials and Resources

  1. W3School Tutorials & References @ http://www.w3schools.com/.
  2. Mozilla Developers Network (MDN)

Books

  1. [TODO]

3.  Android

  1. Android mother site @ www.android.com.
  2. Android Developers @ developer.android.com.
  3. Andriod API Documentation @ http://developer.android.com/reference/packages.html.


4.  MySQL

MySQL Mother Site & Standards

  1. MySQL Mother Site @ www.mysql.com.
  2. MySQL 5.5 “Reference Manual” @ http://dev.mysql.com/doc/.
  3. MySQL 5.5 “SQL Statement Syntax” @ http://dev.mysql.com/doc/refman/5.5/en/sql-syntax.html.
  4. “ISO/IEC 9075 Information Technology – Database Languages SQL”: 1989 (SQL-89), 1992 (SQL-92 or SQL2), 1999 (SQL-99 or SQL3), 2003 (SQL-2003), 2006 (SQL-2006) and 2011 (SQL-2011).

Sample Databases

  1. MySQL Employees Sample Database @ http://dev.mysql.com/doc/employee/en/index.html.
  2. MySQL Sakila Sample Database @ http://dev.mysql.com/doc/sakila/en/index.html.
  3. Microsoft Nothwind Sample database @ http://www.microsoft.com/en-us/download/details.aspx?id=23654; MySQL port @ http://code.google.com/p/northwindextended.
  4. The “Classic Models” Retailer database @ http://www.mysqltutorial.org.

Books and Tutorials

  1. Codd E. F., “A Relational Model of Data for Large Shared Data Banks”, Communications of the ACM, vol. 13, issue 6, pp. 377–387, June 1970.
  2. (For Java Programmers) “JDBC Basics”, Java Online Tutorial @ http://download.oracle.com/javase/tutorial/jdbc/basics/index.html.
  3. Paul DuBois, “MySQL Developer’s Library”, 4th ed, 2009 (5th eds is probably available).
  4. http://mysqltutorial.org.
  5. Russell Dyer, “MySQL in a Nutshell”, 2nd ed, O’reilly, 2008.


5.  C Language

  1. Kernighan and Ritchie “The C Programming Language”, 2nd edition, 1988, (The “K&R”).
  2. Plauger, “The Standard C Library”, 1992, PrenticeHall.
  3. The Formal Specification of C Language:
    1. ISO/IEC 9899:2011 “Programming Languages. C” (The “C11”);
    2. ISO/IEC 9899:1999 “Programming Languages. C” (The “C99”);
    3. ISO/IEC 9899:1990 “Programming Languages. C” (The “C90”).

6.  C++ Language

  1. The Formal Specification for the C++ language:
    1. ISO/IEC 14882:2011 “Programming Language. C++” (The “C++11”);
    2. ISO/IEC 14882:2003 “Programming Language. C++” (The “C++03”);
    3. ISO/IEC 14882:1998 “Programming Language. C++” (The “C++98”).
  2. Bjarne Stroustrup (creator of C++), “The C++ Programming Language”.
  3. Bjarne Stroustrup, “The Design and Evolution of C++”.
  4. http://www.cplusplus.com (C++ documents, tutorials, library references).
  5. Stanley B. Lippman & Josee Lajoie, “C++ Primer”.
  6. Deitel & Deitel, “C++ How to Program”.
  7. Gary J. Bronson, “Program Development and Design using C++”.
Share

Link to "References & Resources For Programming "

February 19th, 2013, posted in Programming
Share

1.  Java

General

  1. Java mother site @ http://java.sun.com (or http://www.oracle.com/technetwork/java/index.html).
  2. Java Developers’ sites, in particular, http://java.net.


JDK
(aka Java SE)

  1. Java SE mother site @ http://java.sun.com/javase (or http://www.oracle.com/technetwork/java/javase/overview/index.html).
  2. JDK 7 API Documentation Online @ http://download.oracle.com/javase/7/docs/api/index.html.
  3. JDK 7 Documentation Online @ http://download.oracle.com/javase/7/docs/.
  4. Ken Arnold, James Gosling and David Holmes, “The Java Programming Language”, 4th Edition, 2005. (The defacto standard for Java Language, but does not seem to have been updated to cover the latest features?!)
  5. James Gosling, Bill Joy, Guy Steele and Gilad Bracha, “The Java Language Specification”, 3rd Edition, 2005. (The defacto standard for JVM, but does not seem to have been updated?!)
  6. JDK 7 Demos and Samples (to be downloaded @ http://www.oracle.com/technetwork/java/javase/downloads/index.html)

Books & Online Tutorials

  1. The online Java tutorial @ http://docs.oracle.com/javase/tutorial/. (The authoritative source.)
  2. Paul Deitel and Harvey Deitel, “Java How to Program”, 9th Edition, 2011. (A comprehensive reference for programmers.)
  3. Y. Daniel Liang, “Introduction to Java Programming”, 9th Edition, 2012. (Good text book for undergraduate Java courses.)
  4. Bruce Eckel, “Thinking in Java”, 4th edition, 2007. (Great book but has not been updated?!)


2.  HTML & CSS

Specifications

  1. HTML @ W3C (www.w3.org)
    1. HTML 4.01 Specification @ http://www.w3.org/TR/html401/.
    2. HTML 5 Draft Specification @ http://www.w3.org/TR/html5/.
  2. XHTML 1.0 Specification (W3C) @ http://www.w3.org/TR/xhtml1/.
  3. CSS Specification (W3C) @ http://www.w3.org/Style/CSS/.

Online Tutorials and Resources

  1. W3School Tutorials & References @ http://www.w3schools.com/.
  2. Mozilla Developers Network (MDN)

Books

  1. [TODO]

3.  Android

  1. Android mother site @ www.android.com.
  2. Android Developers @ developer.android.com.
  3. Andriod API Documentation @ http://developer.android.com/reference/packages.html.


4.  MySQL

MySQL Mother Site & Standards

  1. MySQL Mother Site @ www.mysql.com.
  2. MySQL 5.5 “Reference Manual” @ http://dev.mysql.com/doc/.
  3. MySQL 5.5 “SQL Statement Syntax” @ http://dev.mysql.com/doc/refman/5.5/en/sql-syntax.html.
  4. “ISO/IEC 9075 Information Technology – Database Languages SQL”: 1989 (SQL-89), 1992 (SQL-92 or SQL2), 1999 (SQL-99 or SQL3), 2003 (SQL-2003), 2006 (SQL-2006) and 2011 (SQL-2011).

Sample Databases

  1. MySQL Employees Sample Database @ http://dev.mysql.com/doc/employee/en/index.html.
  2. MySQL Sakila Sample Database @ http://dev.mysql.com/doc/sakila/en/index.html.
  3. Microsoft Nothwind Sample database @ http://www.microsoft.com/en-us/download/details.aspx?id=23654; MySQL port @ http://code.google.com/p/northwindextended.
  4. The “Classic Models” Retailer database @ http://www.mysqltutorial.org.

Books and Tutorials

  1. Codd E. F., “A Relational Model of Data for Large Shared Data Banks”, Communications of the ACM, vol. 13, issue 6, pp. 377–387, June 1970.
  2. (For Java Programmers) “JDBC Basics”, Java Online Tutorial @ http://download.oracle.com/javase/tutorial/jdbc/basics/index.html.
  3. Paul DuBois, “MySQL Developer’s Library”, 4th ed, 2009 (5th eds is probably available).
  4. http://mysqltutorial.org.
  5. Russell Dyer, “MySQL in a Nutshell”, 2nd ed, O’reilly, 2008.


5.  C Language

  1. Kernighan and Ritchie “The C Programming Language”, 2nd edition, 1988, (The “K&R”).
  2. Plauger, “The Standard C Library”, 1992, PrenticeHall.
  3. The Formal Specification of C Language:
    1. ISO/IEC 9899:2011 “Programming Languages. C” (The “C11”);
    2. ISO/IEC 9899:1999 “Programming Languages. C” (The “C99”);
    3. ISO/IEC 9899:1990 “Programming Languages. C” (The “C90”).

6.  C++ Language

  1. The Formal Specification for the C++ language:
    1. ISO/IEC 14882:2011 “Programming Language. C++” (The “C++11”);
    2. ISO/IEC 14882:2003 “Programming Language. C++” (The “C++03”);
    3. ISO/IEC 14882:1998 “Programming Language. C++” (The “C++98”).
  2. Bjarne Stroustrup (creator of C++), “The C++ Programming Language”.
  3. Bjarne Stroustrup, “The Design and Evolution of C++”.
  4. http://www.cplusplus.com (C++ documents, tutorials, library references).
  5. Stanley B. Lippman & Josee Lajoie, “C++ Primer”.
  6. Deitel & Deitel, “C++ How to Program”.
  7. Gary J. Bronson, “Program Development and Design using C++”.
Share