Friday, November 27, 2009

FreeBSD 8.0 relesed.

  • A new virtualization container named “vimage” has been implemented. This is a jail with a virtualized instance of the FreeBSD network stack and can be created by using jail(8) command.

  • The FreeBSD netisr framework has been reimplemented for parallel threading support. This is a kernel network dispatch interface which allows device drivers (and other packet sources) to direct packets to protocols for directly dispatched or deferred processing. The new implementation supports up to one netisr thread per CPU, and several benchmarks on SMP machines show substantial performance improvement over the previous version.

  • The FreeBSD TTY layer has been replaced with a new one which has better support for SMP and robust resource handling. A tty now has own mutex and it is expected to improve scalability when compared to the old implementation based on the Giant lock.

  • [amd64, i386] The FreeBSD Linux emulation layer has been updated to version 2.6.16 and the default Linux infrastructure port is now emulators/linux_base-f10 (Fedora 10).

  • The FreeBSD GENERIC kernel now includes Trusted BSD MAC (Mandatory Access Control) support. No MAC policy module is loaded by default.

  • The FreeBSD USB subsystem has been reimplemented to support modern devices and better SMP scalability. The new implementation includes Giant-lock-free device drivers, a Linux compatibility layer, usbconfig(8) utility, full support for split transaction and isochronous transaction, and so on.

  • The FreeBSD CAM SCSI subsystem ( cam(4)) now includes experimental support for ATA/SATA/AHCI-compliant devices.

  • The shared vnode locking for pathname lookups in the VFS(9) subsystem has been improved.

  • The ZFS file system has been updated to version 13. The changes include ZFS operations by a regular user, L2ARC, ZFS Intent Log on separated disks (slog), sparse volumes, and so on.

  • The FreeBSD NFS subsystem now supports RPCSEC_GSS authentication on both the client and server.

  • The FreeBSD NFS subsystem now includes a new, experimental implementation with support for NFSv2, NFSv3, and NFSv4.

  • The wireless network support layer (net80211) now supports multiple BSS instances on the supported network devices.

  • The FreeBSD L2 address translation table has been reimplemented to reduce lock contention on parallel processing and simplify the routing logic.

  • The IGMPv3 and SSM (Source-Specific Multicast) including IPv6 SSM and MLDv2 have been added.

  • The ipsec(4) subsystem now supports NAT-Traversal (RFC 3948).

  • The GCC stack protection (also known as ProPolice) has been enabled in the FreeBSD base system.

  • The supported version of the GNOME desktop environment (x11/gnome2) has been updated to 2.26.3.

  • The supported version of the KDE desktop environment (x11/kde4) has been updated to 4.3.1.

For more details, please see the Detailed Release Notes.

Tuesday, November 24, 2009

Python Tutorials.

Work on Python began in late 1989 by Guido van Rossum, then at CWI (Centrum voor Wiskunde en Informatica, the National Research Institute for Mathematics and Computer Science) in the Netherlands. It was eventually released for public distribution in early 1991.
At the time, van Rossum was a researcher with considerable language design experience with the interpreted language ABC, also developed at CWI, but he was unsatisfied with its ability to be developed into something more. Having used and partially developed a higher-level language like ABC, falling back to C was not an attractive possibility. Some of the tools he envisioned were for performing general system administration tasks, so he also wanted access to the power of system calls that were available through the Amoeba distributed operating system. Although van Rossum gave some thought to an Amoeba-specific language, a generalized language made more sense, and late in 1989, the seeds of Python were sown.

Python buzzword –
High level
Object oriented
Scalable
Extensible
Portable
Easy to learn
Easy to read
Easy to maintain
Robust
Effective as rapid prototype tool
A memory Manger
Interpreted and (byte) compiled

Command-Line Options
When starting Python from the command-line, additional options may be provided to the interpreter. Here are some of the options to choose from:

-d Provide debug output
-O Generate optimized bytecode (resulting in .pyo files)
-S Do not run importsite to look for Python paths on startup
-v Verbose output (detailed trace on import statements)
-m mod run (library) module as a script
-Q opt division options (see documentation)
-c cmd Run Python script sent in as cmd string
file Run Python script from given file (see later)

>>>(primary prompt)
……(secondary prompt)
Other Implementation

1.Cpython
2.jpython
3.IronPython
4.Stackless


Functions that do not explicitly return a value by the programmer automatically return None, Python's equivalent to NULL


You will notice two primary ways that Python "does things" for you: statements and expressions (functions, equations, etc.). Most of you already know the difference between the two, but in case you need to review, a statement is a body of control which involves using keywords. It is similar to issuing a command to the interpreter. You ask Python to do something for you, and it will do it. Statements may or may not lead to a result or output. Let us use the print statement for the programmer's perennial first example, Hello World:
>>> print 'Hello World!'
Hello World!
Expressions, on the other hand, do not use keywords. They can be simple equations that you use with mathematical operators, or can be functions which are called with parentheses. They may or may not take input, and they may or may not return a (meaningful) value. (Functions that do not explicitly return a value by the programmer automatically return None, Python's equivalent to NULL.) An example of a function that takes input and has a return value is the abs() function, which takes a number and returns its absolute value is:
>>> abs(4)
4
>>> abs(-4)
4

The underscore (_) also has special meaning in the interactive interpreter: the last evaluated expression. So after the code above has executed, _ will contain the string:
>>> _
Hello World!

Python's print statement, paired with the string format operator ( % ), supports string substitution, much like the printf() function in C:
>>> print "%s is number %d!" % ("Python", 1)
Python is number 1!

The print statement also allows its output directed to a file. This feature was added way back in Python 2.0. The >> symbols are used to redirect the output, as in this example with standard error:
The print statement also allows its output directed to a file. This feature was added way back in Python 2.0. The >> symbols are used to redirect the output, as in this example with standard error:

import sys
print >> sys.stderr, 'Fatal error: invalid input!'

Here is the same example with a logfile:
logfile = open('/tmp/mylog.txt', 'a')
print >> logfile, 'Fatal error: invalid input!'
logfile.close()

Program Input and the raw_input()Built-in Function

The easiest way to obtain user input from the command line is with the raw_input() built-in function. It reads from standard input and assigns the string value to the variable you designate. You can use the int() built-in function to convert any numeric input string to an integer representation.
>>> user = raw_input('Enter login name: ')
Enter login name: root
>>> print 'Your login is:', user
Your login is: root

Comments
As with most scripting and Unix-shell languages, the hash or pound ( # ) sign signals that a comment begins from the # and continues until the end of the line.
>>> # one comment
... print 'Hello World!' # another comment
Hello World!

There are special comments called documentation strings, or "doc strings" for short. You can add a "comment" at the beginning of a module, class, or function string that serves as a doc string, a feature familiar to Java programmers:
def foo():
"This is a doc string."
return True

Unlike regular comments, however, doc strings can be accessed at runtime and be used to automatically generate documentation.