Entries Tagged as 'Linux'

Model-View-Controller (MVC)

Problem: The Model-View-Controller (MVC) is a commonly used and powerful architecture for GUIs. How does it work?

Dean Helman wrote (an extract from Objective Toolkit Pro whitepaper):

The MVC paradigm is a way of breaking an application, or even just a piece of an application’s interface, into three parts: the model, the view, and the controller. MVC was originally developed to map the traditional input, processing, output roles into the GUI realm:

Input –> Processing –> Output
Controller –> Model –> View

The user input, the modeling of the external world, and the visual feedback to the user are separated and handled by model, viewport and controller objects. The controller interprets mouse and keyboard inputs from the user and maps these user actions into commands that are sent to the model and/or viewport to effect the appropriate change. The model manages one or more data elements, responds to queries about its state, and responds to instructions to change state. The viewport manages a rectangular area of the display and is responsible for presenting data to the user through a combination of graphics and text.

[...]

[The model is used] to manage information and notify observers when that information changes. [...] It contains only data and functionality that are related by a common purpose [...]. If you need to model two groups of unrelated data and functionality, you create two separate models.

[...] a model encapsulates more than just data and functions that operate on it. A model is meant to serve as a computational approximation or abstraction of some real world process or system. It captures not only the state of a process or system, but how the system works. This makes it very easy to use real-world modeling techniques in defining your models. For example, you could define a model that bridges your computational back-end with your GUI front-end. In this scenario, the model wraps and abstracts the functionality of a computation engine or hardware system and acts as a liaison requesting the real services of the system it models.

[...]

The [view or viewport] is responsible for mapping graphics onto a device. A viewport typically has a one to one correspondence with a display surface and knows how to render to it. A viewport attaches to a model and renders its contents to the display surface. In addition, when the model changes, the viewport automatically redraws the affected part of the image to reflect those changes. [...] there can be multiple viewports onto the same model and each of these viewports can render the contents of the model to a different display surface.

[...]

[A viewport] may be a composite viewport containing several sub-views, which may themselves contain several sub-views.

[...]

A controller is the means by which the user interacts with the application. A controller accepts input from the user and instructs the model and viewport to perform actions based on that input. In effect, the controller is responsible for mapping end-user action to application response. For example, if the user clicks the mouse button or chooses a menu item, the controller is responsible for determining how the application should respond.

[...]

The model, viewport and controller are intimately related and in constant contact. Therefore, they must reference each other. The picture below illustrates the basic Model-View-Controller relationship:

Model View Controller

Model View Controller

The figure above shows the basic lines of communication among the model, viewport and controller. In this figure, the model points to the viewport, which allows it to send the viewport weakly-typed notifications of change. Of course, the model’s viewport pointer is only a base class pointer; the model should know nothing about the kind of viewports which observe it. By contrast, the viewport knows exactly what kind of model it observes. The viewport also has a strongly-typed pointer to the model, allowing it to call any of the model’s functions. In addition, the viewport also has a pointer to the controller, but it should not call functions in the controller aside from those defined in the base class. The reason is you may want to swap out one controller for another, so you’ll need to keep the dependencies minimal. The controller has pointers to both the model and the viewport and knows the type of both. Since the controller defines the behavior of the triad, it must know the type of both the model and the viewport in order to translate user input into application response.

More info:

Ralph Johnson, Model-View-Controller as an Aggregate Design Pattern

Steve Burbeck, How to use Model-View-Controller

Object Arts, Model View Controller

ootips.org

Reseting Ubuntu gnome panel

sudo debconf gnome-panel

This is not a permanent solution.

To permanently enable your default panel configuration enter the following commands in the terminal sequentially.

gconftool –recursive-unset /apps/panel
rm -rf ~/.gconf/apps/panel
pkill gnome-panel

NFS Client Configuration to mount nfs share using Ubuntu Linux

Type following command to install packages:
sudo apt-get install portmap nfs-common

Create a folder:
mkdir wwwroot

Mount:

mount server.mydomain.com:/network/wwwroot to /home/fred/wwwroot

example:
fred@mds028281:~$ pwd
/home/fred
fred@mds028281:~$ mkdir 223
fred@mds028281:~$ mkdir 243
fred@mds028281:~$ mkdir 130
fred@mds028281:~$ sudo mount 10.68.12.223:/dados/wwwroot /home/fred/223
fred@mds028281:~$ sudo mount 10.68.12.243:/dados/wwwroot /home/fred/243
fred@mds028281:~$ sudo mount 10.68.12.130:/dados/wwwroot /home/fred/130
fred@mds028281:~$ cd 223
fred@mds028281:~/223$ ls
email       moodle         moodledata     moodleInterno  teste
index.html  moodle.backup  moodledata193  smtp

you may need to restart above services:
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart

Debian GNU/Linux 5.0 released

From Debian.org

The Debian Project is pleased to announce the official release of Debian GNU/Linux version 5.0 (codenamed Lenny) after 22 months of constant development. Debian GNU/Linux is a free operating system which supports a total of twelve processor architectures and includes the KDE, GNOME, Xfce, and LXDE desktop environments. It also features compatibility with the FHS v2.3 and software developed for version 3.2 of the LSB.

Debian GNU/Linux runs on computers ranging from palmtops and handheld systems to supercomputers, and on nearly everything in between. A total of twelve architectures are supported: Sun SPARC (sparc), HP Alpha (alpha), Motorola/IBM PowerPC (powerpc), Intel IA-32 (i386), IA-64 (ia64), HP PA-RISC (hppa), MIPS (mips, mipsel), ARM (arm, armel), IBM S/390 (s390), and AMD64 and Intel EM64T (amd64).

Debian GNU/Linux 5.0 Lenny adds support for Marvell’s Orion platform which is used in many storage devices. Supported storage devices include the QNAP Turbo Station series, HP Media Vault mv2120, and Buffalo Kurobox Pro. Additionally, Lenny now supports several Netbooks, in particular the Eee PC by Asus. Lenny also contains the build tools for Emdebian which allow Debian source packages to be cross-built and shrunk to suit embedded ARM systems.

Debian GNU/Linux 5.0 Lenny includes the new ARM EABI port, armel. This new port provides a more efficient use of both modern and future ARM processors. As a result, the old ARM port (arm) has now been deprecated.

This release includes numerous updated software packages, such as the K Desktop Environment 3.5.10 (KDE), an updated version of the GNOME desktop environment 2.22.2, the Xfce 4.4.2 desktop environment, LXDE 0.3.2.1, the GNUstep desktop 7.3, X.Org 7.3, OpenOffice.org 2.4.1, GIMP 2.4.7, Iceweasel 3.0.6 (an unbranded version of Mozilla Firefox), Icedove 2.0.0.19 (an unbranded version of Mozilla Thunderbird), PostgreSQL 8.3.6, MySQL 5.0.51a, GNU Compiler Collection 4.3.2, Linux kernel version 2.6.26, Apache 2.2.9, Samba 3.2.5, Python 2.5.2 and 2.4.6, Perl 5.10.0, PHP 5.2.6, Asterisk 1.4.21.2, Emacs 22, Inkscape 0.46, Nagios 3.06, Xen Hypervisor 3.2.1 (dom0 as well as domU support), OpenJDK 6b11, and more than 23,000 other ready-to-use software packages (built from over 12,000 source packages).

With the integration of X.Org 7.3 the X server autoconfigures itself with most hardware. Newly introduced packages allow the full support of NTFS filesystems and the use of most multimedia keys out of the box. Support for Adobe® Flash® format files is available via the swfdec or Gnash plugins. Overall improvements for notebooks have been introduced, such as out of the box support of CPU frequency scaling. For leisure time several new games have been added, including puzzle games as well as first-person shooters. Also notable is the introduction of goplay, a graphical games browser offering filters, search, screenshots and descriptions for games in Debian.

The availability and updates of OpenJDK, GNU Java compiler, GNU Java bytecode interpreter, Classpath and other free versions of Sun’s Java technology, into Debian GNU/Linux 5.0 allow us to ship Java-based applications in Debian’s main repository.

Further improvements in system security include the installation of available security updates before the first reboot by the Debian Installer, the reduction of setuid root binaries and open ports in the standard installation, and the use of GCC hardening features in the builds of several security-critical packages. Various applications have specific improvements, too. PHP for example is now built with the Suhosin hardening patch.

For non-native English speaking users the package management systems now support translated package descriptions and will automatically show the description of a package in the native language of the user, if available.

Debian GNU/Linux can be installed from various installation media such as DVDs, CDs, USB sticks and floppies, or from the network. GNOME is the default desktop environment and is contained on the first CD. Other desktop environments — KDE, Xfce, or LXDE — can be installed through two new alternative CD images. Again available with Debian GNU/Linux 5.0 are multi-arch CDs and DVDs supporting installation of multiple architectures from a single disc; and this release adds Blu-ray Discs, allowing the archive for an entire architecture to be shipped on a single BD.

In addition to the regular installation media, Debian GNU/Linux can now also be directly used without prior installation. The special images used, known as live images, are available for CDs, USB sticks, and netboot setups. Initially, these are provided for the amd64 and i386 architectures only.

The installation process for Debian GNU/Linux 5.0 has been improved in many ways: among many other improvements, support for installation from more than one CD or DVD has been restored, firmware required by some devices can be loaded by using removable media, and installations via Braille display are supported. The installer boot process has also received much attention: a graphical menu can be used to choose front-ends and desktop environments, and to select expert or rescue mode. The installation system for Debian GNU/Linux has now been translated to 63 languages.

Debian GNU/Linux can be downloaded right now via bittorrent (the recommended way), jigdo or HTTP; see Debian GNU/Linux on CDs for further information. It will soon be available on DVD, CD-ROM and Blu-ray Disc from numerous vendors, too.

Upgrades to Debian GNU/Linux 5.0 from the previous release, Debian GNU/Linux 4.0 (codenamed Etch) are automatically handled by the aptitude package management tool for most configurations, and to a certain degree also by the apt-get package management tool. As always, Debian GNU/Linux systems can be upgraded painlessly, in place, without any forced downtime, but it is strongly recommended to read the release notes for possible issues, and for detailed instructions on installing and upgrading. The release notes will be further improved and translated to additional languages in the weeks after the release.

Dedication

Debian GNU/Linux 5.0 Lenny is dedicated to Thiemo Seufer, a Debian Developer who died on December 26th, 2008 in a tragic car accident. Thiemo was involved in Debian in many ways. He has maintained several packages and was the main supporter of the Debian port to the MIPS architectures. He was also a member of our kernel team, as well as a member of the Debian Installer team. His contributions reached far beyond the Debian project. He also worked on the MIPS port of the Linux kernel, the MIPS emulation of qemu, and far too many smaller projects to be named here.

Thiemo’s work, commitment, broad technical knowledge and ability to share this with others will be missed. Thiemo’s contributions will not be forgotten. The high standards of his work make it hard to pick up.

About Debian

Debian GNU/Linux is a free operating system, developed by more than a thousand volunteers from all over the world who collaborate via the Internet. Debian’s dedication to Free Software, its non-profit nature, and its open development model make it unique among GNU/Linux distributions.

The Debian project’s key strengths are its volunteer base, its dedication to the Debian Social Contract, and its commitment to provide the best operating system possible. Debian 5.0 is another important step in that direction.

Contact Information

For further information, please visit the Debian web pages at http://www.debian.org/ or send mail to <press@debian.org>.

Java, Flash, MPlayer in Ubuntu 8.10

Type:
sudo apt-get install ubuntu-restricted-extras flashplugin-nonfree mozilla-mplayer

And enjoy!

Linux (Ubuntu) Installer for Windows – Wubi

http://wubi-installer.org/

Wubi allows you to install and uninstall Ubuntu as any other Windows application, in a simple and safe way. Are you curious about Linux and Ubuntu? Trying them out has never been easier!

Wubi is Simple

No need to burn a CD. Just run the installer, enter a password for the new account, and click “Install”, go grab a coffee, and when you are back, Ubuntu will be ready for you.

Wubi is Safe

You keep Windows as it is, Wubi only adds an extra option to boot into Ubuntu. Wubi does not require you to modify the partitions of your PC, or to use a different bootloader, and does not install special drivers. It works just like any other application. Wubi is spyware and malware free, and being open source, anyone can verify that.

Wubi is Discrete

Wubi keeps most of the files in one folder, and if you do not like it, you can simply uninstall it as any other application.

Wubi is Free

Wubi and Ubuntu cost absolutely nothing (free as in beer), but yet provide a state of the art, fully functional, operating system that does not require any activation and does not impose any restriction on its use (free as in freedom).

Ubuntu Logo Ubuntuforums Logo SourceForge.net Logo Launchpad.net Logo

Scientists write guide to build supercomputer from Sony Playstation3

Researchers at the University of Massachusetts Dartmouth, US, have
created a step-by-step guide to building a home-brewed supercomputer
that can reduce the cost of university and general computing research.
The resource fully illustrates how to create a fully functioning and
high performance supercomputer with the Sony Playstation 3.

Last year, the researchers’ construction of a small supercomputer using
eight Sony-donated Playstation 3 gaming consoles made headlines
nationwide in the scientific community. The consoles are used to solve
complex equations designed to predict the properties of gravitational
waves generated by the black holes located at the centre of the
galaxies.

Typically, scientists rent supercomputer time by the hour. A single
simulation can cost more than 5,000 hours at USD 1 per hour on the
National Science Foundation’s TeraGrid computing infrastructure.

The guide is freely available to the public under an open source license
at www.ps3cluster.org.

PhysOrg.com / University of Massachusetts Dartmouth – December 17, 2008

http://www.merit.unu.edu/i&tweekly/ref.php?nid=3511

Linux IP Command Lines

Display Current Config for all NIC’s: ifconfig

Display Current Config for eth0: ifconfig eth0

Assign IP: ifconfig eth0 192.168.1.2

Assign IP/Subnet: ifconfig eth0 192.168.1.2 netmask 255.255.255.0

Assign Default Gateway: route add default gw 192.168.1.1

Assign multiple IP’s: ifconfig eth0:0 192.168.1.2

Assign second IP: ifconfig eth0:1 192.168.1.3

Disable network card: ifconfig eth0 down

Enable network card: ifconfig eth0 up

View current routing table: route “or” route -n

View arp cache: arp “or” arp -n

Ping: ping -c 3 192.168.1.1

Trace Route: traceroute www.google.com

Trace Path: tracepath www.google.com

DNS Test: host www.google.com

Advanced DNS Test: dig www.google.com

Reverse Lookup: host 66.11.119.69

Advanced Reverse Lookup: dig -x 66.11.119.69