Fixing MySQL Gone Away Issues in python

I have to say Python isn’t my favorite programming language however it is unavoidable when it comes to where I currently work.

I’ve been passed a nasty little bug to fix, the Python scripts I work on connected to several MySQL databases however their purpose require them to constantly run (which by my understanding would make them a service, but they are known as scripts :S)

So why and when would this ‘MySQL gone away’ occur well when the application starts it opens the connection to the database however even though the script is always on it can lay dormant for hours (or even days) at a time. This is where the issue occur as one of MySQL’s runtime variables defines a “time out” period for each database connection by default this timeout period is 8 hours (28800s) so what happens is our script comes alive +8hours after we last tried to execute an SQL query and fails (thus falls over)

So to test this I constructed a small script to connect to a database which has a custom timeout period to replicate this issue

import sys
import time
from some_dbhandler import mysql_dbhandler

class mysqlTests:
    __db = False

    def __init__(self, log = "test"):
        self.__init_db()

    def run(self):
        print "starting mysql tests"

        while True:
            result = self.__db.dbsql_query("SELECT * FROM m_table");
            if result != False:
                for i in range(len(result)):
                    id = result[i]['id']
                    print "id = " + str(id) + " Content = " + result[i]['content']
            time.sleep(5)
    def __init_db(self):
        self.__db = mysql_dbhandler('testdb')
        isDbconnected = self.__db.dbconnect("localhost", "{user}","{password}", "mtestdb");
        if isDbconnected :
            print "successfully created database connection"
        else:
            print "not connected"

if __name__ == "__main__":

    mysqlTests = mysqlTests()
    mysqlTests.run()

To set a custom timeout you need to access mysql and set the global and local ‘wait timeout’ variables like so

[root@somepc ~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 134
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>  set wait_timeout =3;
Query OK, 0 rows affected (0.00 sec)
mysql>  set global wait_timeout =3;
Query OK, 0 rows affected (0.00 sec)

mysql> show global variables like "wait_timeout";
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| wait_timeout  | 3    |
+---------------+-------+
1 row in set (0.00 sec)
# same for local variables

so now how do we catch the error and deal with the issue, we use an OperationalError exception to catch any exception that may occur and to further discover whether the exception in question is the ‘MySQL gone away issue’ we use the error code to decipher the error and if its ’2006[' then we've identified the error and can then take in this instance we reconnect to the database.

     except OperationalError, err:
            self.__log.error("Error "+str(err.args[0])+': '+str(err.args[1]))
            print('Error '+str(err.args[0])+':'+str(err.args[1]))
            self.__log.error(';SQL:'+str(str_sql))
            if int(err.args[0]) == 2006 :
                connected = False
                for i in range(self.__reconnect_attempts):
                   connected = self.__reconnect();
                   if connected == True:
                      break
                if connected != False:

However a problem I had discovered during my testing on multiple the mysql error codes differ in different python version in my case I have been testing locally and machine is running Python 2.4.3 and also on a dev server which is running Python 2.3.4 each send out different sql codes

  • Python 2.3.4 :: sql code 2013 'Lost connection to MySQL server during query'
  • Python 2.4.3 :: sql code 2006 'MySQL server has gone away'

To fix this I added a extra condition on the if statement

# In Python 2.3.4 this registers as sql error 2013 'Lost connection to MySQL server during query'
            # In Python 2.4.3 this registers as sql error 2006 'MySQL server has gone away'
            if int(err.args[0]) == 2006 or int(err.args[0]) == 2013:
            ...

Fini!

VN:F [1.9.3_1094]
Rating: 5.0/5 (1 vote cast)

Setting up Apache and Php on Ubuntu 10.04

Ok so I’ve decided to make some much needed improvements on my website antgrimmitt.co.uk but do this I need setup a testing environment on my local machine. Now the site’s content is provided by JSON file I’ve created. Why you ask originally  this site was written to have a J2EE backend which it did (Spring/Hibernate etc) but due to running costs of a decent server with sufficient memory allocation to keep tomcat happy (£50pcm) I had to look at  alternatives. However the way in  which the front-end is written promotes a healthy dose of interoperability as the front-end is just after all it just wants a JSON feed.

So I decided to use php to serve my JSON data. Now to set up the testing environment firstly we need to install apache instead of using source this time I’m going to use the package management provided by Ubuntu.

p.s. for old skool linux geeks like  me ‘sudo passwd root’ fixes ubuntu’s lack of root capability so ‘su’ and ‘su -’ works :)

ant@ant-desktop:~$ su -
Password:
root@ant-desktop:~# apt-get install apache2 //apt-get is ubuntu's package management software

Follow the on screen ‘apt-get’ instructions and when it completes you should see the following statement ‘ * Starting web server apache2′ this means we are rocking and rolling open up browser and type into the address bar ‘http://localhost/’ and you should get the following (I do at least).

It works!

This is the default web page for this server.

The web server software is running but no content has been added, yet.

Right on to PHP, once again I’m going to use the ubuntu package management to install it

root@ant-desktop:~# apt-get install php5  // using php5

Again follow the on screen ‘apt-get’ instructions and when it completes you should see the following statement ‘* Reloading web server config apache2′

Its reload apache2′s config as apt-get also bundled ‘ libapache2-mod-php5′ with the php5 install therefore automatically enabling php in apache. To test the install worked browse to the default web directory and create a php file that looks like this:

/**
* test.php
*/
<?php
    phpinfo();
?>

This is how I did it:

root@ant-desktop:~# cd /var/www/
# check if its write directory by looking at the index.html file
# we should see the content from http://localhost page in html code
root@ant-desktop:/var/www# vi index.html
# add the contents of test.php
root@ant-desktop:/var/www# vi test.php

Now browse to http://localhost/test.php and it … tries to download test.php *Scratches head* hmmmpf that’s not right, lets try restarting apache

root@ant-desktop:/var/www# service apache2 restart
 * Restarting web server apache2

Refresh the http://localhost/test.php, ahhh there we go it works

Simples :)

VN:F [1.9.3_1094]
Rating: 4.0/5 (1 vote cast)

What is Money?

How money has changed through out history due to ever changing technology and its impact on global finance?

‘What is money?’ this seemed like a simple question with an even simpler answer, indeed this is what I thought until it was pointed out to me that a five pound note is only a representation of five units of money as a five pound note states “ I promise to pay the bearer on demand the sum of” then the value of the note!

Being informed of this, my imagination was stimulated and I started to ask myself ‘what is money? ` From the onset of this essay I wish to investigate the changes in how we quantify the value of money and how the advent of certain technologies have led over time to different concepts of money and monetary transaction.  Also I wish to set a time scale in which I will focus this essay; This time scale is between the late 1700s to the present, I believe this period has the utmost relevance to the varying perceptions on the value of money as this period includes the industrial revolution, the information revolution and the digital revolution.

I have recognised four areas, which I intend to look at which will show significant changes in the image of monetary value and how monetary transactions take place. Firstly I will discuss the impact of the worldwide transition to the ‘Gold Standard” being introduced as a global standard of currency to paper based money representation and the dividing into nation specific currency. With the advent of telegraph technology a new from of money manipulation came about and thus merchant banking was born in the second part of this essay I will look how this opened up the international trade markets specifically looking at the Western Union and how they operated in the early stages of the companies life. As I believe the global stock exchanges to have an extreme influence on how business’s value money I will look at how emergence of technology has revolutionised the operational standards of the worlds stock exchanges. Finally I will look at the more recent technological advancements that have derived from the digital revolution this will include the popularisation of credit cards and the global shift towards electronic money transfers via communication systems such as the Internet.

Money in the form of currency has existed since 3000BC, where primitive societies used objects such as bracelets as currency before the introduction of coins in 600BC in Lydia (ancient Turkey). The quantifying of the value of money globally did not occur till the 19th century with the global adoption of a new standardisation known as ‘The International Gold Standard’. Though there is mixed opinions to when the creation of this standard first appeared, with some historians claiming Sir Isaac Newton’s 1717 essay equating a value of gold to silver gave rise to the idea of the gold standard. Critics argue that this was theory not the implementation of ‘The International Gold Standard” it is the general consensus that the standard was globally implemented between 1871 and 1900.  This helped improve global trade and now international transactions retain the same value even though the currency type can vary for example the ‘Great British pound (Sterling)’ or the ‘United States Dollar’. This system was dependant on physical currency such as a £5 note which could be taken to a banking establishment where it could be associated with an account this information would be stored in a paper based format which would be recorded by a bank clerk.

“The generalisation of the gold standard coincided with a rise in international capital   out flows to levels never before seen, Bairoch (1976) estimates the increase in    capital flow internationally as the new International Gold standard became more       predominate in the late 18th century”

1 Moving Money – Banking and Finance in The Industrialised World Daniel Verdier

Around the same time that ‘The International Gold Standard’ became significant in global banking. The telegraph was being introduced as a method of transatlantic communication. Before this technology became available all monetary transfer and indeed all communications between different nations would be carried out via writing letters which were then shipped across to its intended destination thus the transfer of money from one nation to another was a long and tedious operation. The telegraph was pioneered in the Napoleonic war where visual signals where sent over distances of few miles. Of course this method wasn’t used in a monetary sense but with invention of the electronic based telegraph system patented in 1837 the possibility of using this technology as a means of monetary transactions became plausible.  This idea became even more feasible as in 1886 the first successful transatlantic telegraph cable became operational using Morse code (invented earlier in the 1830’s). One of the key developers of the telegraph were  ‘The New York and Mississippi Valley Printing Telegraph Company` established in 1851 who went to become the world lead telegraphical company more commonly know as ‘The Western Union’ the pioneer of non face to face or letter based money transfers. ‘The Western Union’ was responsible for creating the first ever transcontinental telegraph in 1861, this line was highly effective in improving communications during the American civil war. The Western Union’s most notable triumphs were there creation of the ability to perform global money transactions almost instantly compared to the previously existing systems for global monetary movement.
“The spreading of relevant information for market participants more widely and more rapidly than before. Take for example the case of the use of the telegraph and later the telephone for the transmission of financial market information in the nineteenth century, which resulted in a more rapid circulation of information across financial markets. In such a case, the degree of co-integration between financial markets may seem to increase following the introduction of the telegraph, because pieces of information which previously affected financial prices at different points in time are subsequently able to exert a nearly simultaneous impact on financial prices.”
2 The globalisation of financial markets – Professor Otmar Issing, 12 September 2000, Ottobeuren

So ‘What is Money?’ with the introduction of the telegraph communication system. The actual manipulation of money at a non-commercial level stayed constant with banks use paper based systems and keeping accounts of the money owed. But in world commercial monetary functions w e start to see the movement towards the use of electronic systems though the actual storage of money was still very much paper based. Money transactions especially made full use of telegraph system so money in a commercial transaction sense was reduced to simple Morse coding .

Of course the telegraph system had an affect on the worlds stock markets to the extent of ‘The Western Union’ being one of the first eleven companies to be tracked in the first ‘Dow Jones Average’ on the New York Stock Exchange.  As telecommunication technology has advanced so has the worlds stock exchange’s. Several differing devices derived from the innovation of the telegraph gave substantial extra operation abilities to the world exchanges most pro-dominantly ‘The Universal Stock Ticker’ invented in 1871 a device which took a telegraph signal and printing a readable output on ‘Ticker Tape’.

“  Stock tickers were used for many years. By 1890 the New York Stock Exchange, which is itself a private corporation, purchased the rights to one of the most popular stock tickers and went into business manufacturing them and selling stock quotation services to brokers. Soon, brokers and many business people kept tickers in their offices, and the machines spat out strips of tape during hours in which the stock exchanges were open. People in offices soon found that throwing a roll of paper tape out the window made a lovely streamer, giving rise to the ‘ticker tape parade’ “

[3] IEEE Virtual Museum

The arrival of the digital revolution shaped modern society the invention and rapid popularity of new computer technology affected most things and the world stock exchange was not exempt from this in fact the first computer was introduced into the London stock exchange to manage a system which would revolutionise the London stock exchange called Transfer Accounting and Lodgement for Investors, Stock Management for Jobbers or talisman for short.

Through this scheme it introduced the use of computers as a standard method of money transfers with the aim to eliminate the”
“Cumbrous and expensive ‘paper chase’ ticket passing system which had been operating unchanged for almost a century”
[4] Coffee House to Cyber Market, 200 years of the London Stock Exchange
This saw a rapid increase in the daily transactions within the London Stock Exchange and soon the rest of the world’s stock exchanges followed suit
Computer-driven trade has significantly affected the stock exchange. Computer and telecommunications technology, besides opening a wide market in over the counter dealings, has also given rise to trading on an international level. Personal computers and modems allow trading to occur around the clock (after-hours NYSE and Nasdaq trading began in 1999), and the securities trading on one major stock exchange can now significantly affect the trading on others. Many contend that the traditional manner of trading will eventually become obsolete. Technology also now allows for “day trading,” a high-risk business in which numerous computerized trades are made during a single day, with large gains (and large losses) possible.
[5] The Columbia Electronic Encyclopedia

So what is money?  The introduction of computer technology and Binary Coding has resulted in money transactions being conducted using computer systems, which store details of the all money movements in and out of an account. This has reduced the amount of paper recording and made money less tangible – a difficult concept for individuals who wish to maintain physical contact with their money.

The digital revolution also generated technology which enabled the invention of the debit / credit card in the late 1980’s. The idea of these cards was to replace paying for things with cash with a plastic card incorporating a magnetic strip. Within the last few years new ‘Chip & Pin’ technology has been introduced, this is incorporated within the Electronic Funds Transfer at Point of Sale, which is now the world standard for money transactions.

Another product of the digital revolution, which has dramatically, changed the world of finance and money is the Internet. The Internet has affected all area of money from online stock exchanges to personal banking. Thus launching a new phase in monetary history where by most transactions whether business or personal take place using some from of Internet connection.

“The money screamed across the wires, its provenance fading in a maze of electronic transfers, which shifted it, hid it, broke it up into manageable wads which would be withdrawn and redeposited elsewhere, obliterating the trail.”
[6] Nest of Vipers by Linda Davies.

The Internet really burst into modern way of accessing and exchanging information in the mid 1990’s with the development of ‘web browsers’ which allowed users to view textual and graphical data in standardised format. E Commerce arrived on the scene in 1998 and the concept of electronic cash was born!

“The importance of electronic payment methods has been widely recognized, triggered by the proliferation of electronic services, such as services available over the Internet or cellular systems. Electronic cash, introduced as a concept by David Chaum in 1982, is among the most important of these methods due to its guarantee of user anonymity; hence the parallelism with physical cash. Privacy of transactions is progressively viewed to be a highly desirable feature in financial services. We present our results in efficient and secure e-cash; our systems can be implemented in current smart cards and are provably secure.”
[7] Yiannis Tsiounis 1997

As we enter the 21st century where does this leave our understanding of what money is?  I have considered the historical trail which leads from paper money to telegraphed money transfers to electronic money transfers. I have mentioned the impact of such changes on global banking and financial institutions like the stock exchange. At personal level cash in your pocket has moved towards plastic cards and memorized pin numbers.
Innovations in payments system underpinned by an electronic technology are transforming the monetary landscape of many countries, the researchers note. But the potential technology-driven substitution of cash by card payments raises a number of crucial issues for monetary policy-makers. In particular, the decline in transactions balances of cash is governed by the rate of adoption by consumers and merchants alike of card payments facilitated by EFTPOS.

[8] Dr Sheri Markose How Far To The Cashless Society

How has technology has affected our personal and financial perception of money? My research has helped my understanding of answers to this wide-ranging question. However it has also prompted more questions, which time and experience will be able to answer.

Is money becoming just a series of 1s and 0s being moved electronically from one transaction to the next?

Will this reduce our capacity to appreciate how much we spend, as we do not handle the money during a transaction?

Will coins and notes become a thing of the past?

VN:F [1.9.3_1094]
Rating: 3.0/5 (1 vote cast)

An introduction to the art of software design

Analyse the problem, draw up a list of requirements to solve the problem, implement those requirements, test what you’ve implemented and wish the end user good luck! The basics of any software development life cycle from conception to handing over the software to the customer, it is structured, consistent, linear and predictable. So we’re six months into developing a new revolutionary piece of software for a company that are desperately in need of a new system. We have only got a few weeks left and are half way through implementing our superb new system. Then one of our team starts a conversation with “hey what if we did this…..” you think it’s a great idea and it could exponentially improve the systems productivity. So you turn to the guy and say “Why the hell didn’t you thinking of this five months ago, we just can’t change the system one day from the next and just do what we feel could work, Its a great idea but we have 8 weeks left to do 12 weeks work, we’re already working 60 hour weeks! Right everyone back to work” so off you go back to work begrudgingly forgetting that wonderful idea -too little, too late.

Extreme Programming (XP) sees this as one of they key failures of other software development techniques, the inability to introduce new ideas at any stage of the development, being constrained by requirements set out months before. Projects ruled by meeting that all-important deadline and the whole team over worked up tight and stressed, each with their individual task to complete before the deadline under pressure not to fail. XP see this as an unproductive way of producing software.

So what is XP, how does it differ from other software development methods and why could we consider XP to be a more creative way of developing software. Firstly to define what we perceive as ‘creative’;

“Creative is to have imagination and to be able to think originally, to express creativity is to apply these skills within a specific area for example painting or composition of music” [Oxford Dictionary {D N}]

You could argue that any software development project has creative merit, as building software always requires a sort of creativity so any software development technique involves an artistic component. This may be true to an extent but software development methodologies like Structured Systems Anaylsis and Design Method (SSADM) and the Rational Unified Process (RUP) are specific to what needs to be constructed in the analysis stage before implementation (coding) has taken place. This is like composing a song without touching a musical instrument, thus setting what is to be built before trying to build it limits the creative scope!

XP promotes a different way of approaching software development by shifting the emphasis from analysing the problem as the key activity in software development to the actual implementation (coding) of the software. XP is a test driven software development technique, testing is the primary activity which XP relies upon. XP puts forward the philosophy of if you can’t test it doesn’t exist;

“Any program feature without an automated test simply does not exist. Programmers write unit tests so that their confidence in the operation of a program can become part of the program itself. Customers write functional tests so that their confidence in the operation of the program can become part of the program too!” [Kent Beck 1999]

When the actual development takes place XP says that the programmers should compose the test classes before they start to write the subject code that the test are for. XP calls this a “test-first” programming method. By doing this eXtreme Programmers believe the approach benefits the development by making their code more testable and therefore more measurable.

“Test-first, because we write automated, repeatable unit tests before writing the code that makes them run, this approach yields several benefits; The code is testable, the tests are tested, the tests are repeatable and its easier to produce documentation from the tests results” [William C. Wake 2001]

So how could we perceive a test-first approach as a more creative way of developing software, well firstly it appears similar to other methodologies as it is defining what we want to construct before actually constructing it. How it differs from other methods as XP works on a day to day basis thus these pre-built tests are written regularly therefore if anything changes within the development life cycle the tests can be altered to fit a modified set of properties. XP has its critics but on the evidence presented by using a test driven process critics praise XP for this centralised view of a test-first development strategy.

“An increased emphasis on unit testing and on the use of automated testing tools is probably the most useful benefit to emerge from the XP phenomenon.” [Matt Stephens, Doug Rosenberg 2003]

XP employs a different view on how software should be implemented, conventional methods such as SSADM see the construction of software (coding) as an activity, which is subdivided into modules and assigned a programmer who individually works on that module. XP proposes a different way of writing code – Pair programming, two developers working at one computer system on the same module.

“Pair programming is the practice of having two people working together to design and develop code. They are full partners, taking turns in typing and watching; this provides constant code and design review” [William C. Wake 2001]

This benefits the creative aspect of software development as it improves the ideals of original thinking as if two people are working on the same module they have the opportunity to share ideas between each other and constantly review their work. This exercises the idea of collective ownership for the given project and pair programming aids this as no one person is responsible for a particular module of the project but everyone is collectively responsible for the whole project.

Criticisms of pair programming consists of firstly not every programmer is suited to pair programming, XP defines pair programming as a mandatory requirement for a XP based development so a programmer who likes to individually work on code is unable to do so. Pair programming is dependant on the pair having similar skills and abilities or else one half of the partnership could be made redundant as the other does all of the work, this is called ‘go make me a cup of tea syndrome’ [Matt Stephens, Doug Rosenberg 2003]. Another issue with pair programming is it can cause loss of expertise as programmers work on everything so that everyone has a sort of understanding of every module within the project but may lack depth of specifics.

“In XP, everybody takes responsibility for the whole system. Not everyone knows every part equally well, although everyone knows something about every part” [Kent Beck 1999]

Though the above quote is illustrating a positive point about XP it also highlights a possible issue off loss of expertise as if everyone has knowledge of every part no one person can claim specialized skill and expertise this also supports an argument against implementing a collective ownership policy as no one person can be seen as responsible for a particular module.

XP prides itself on the idea of having an “on-site” customer, most software development methods believe in having a strong customer relationship so that the end user can explain to the development team what the software needs to do. XP takes this idea to the extreme by pushing the idea of an “on-site” customer available at all times for the developers to query on matters concerning the system and help combat problems which arise during development. XP defines the customer as the persons, which the system will be operated by;

“If you are building a customer service system, the customer will be a customer service representative. If you are building a bond trading system, the customer will be a bond trader. The big objection to this rule is that real user (customers) of the system under development are too valuable to give to the development team” [Kent Beck 1999]

This idea seems extremely beneficial to the development team but from the business point of view it could be seen as an unproductive use of human resources as it requires an employee of the business being taken out of their working environment into a situation where for some of the time their role will be redundant and their presence may be unwarranted.

One of the problems this could generate is if there are more than one type of customer who will operate the system. This is because XP relies on a singular “on-site” customer so having more than one customer causes confusion and enhances the chance of the project failing. Take for instance the first project XP implemented which was the ‘C3′ project (Chrysler Comprehensive Compensation). The project aim was to develop a payroll system, XP came into existence when Kent Beck the pioneer of XP was bought onto the project as a software developer in 1996 and he introduced several ideas, which now make up the basic core principals of XP. In February 2000 the project was unexpectedly cancelled by Chrysler, Kent Beck then went on to explain why the project failed by saying;

“Near as I can tell the fundamental problem was that the ‘Goal Owner’ (the person who instigated the project for example managers) and the ‘Goal Donor’ (the person XP sees as the customer) weren’t the same. The customer feeding stories didn’t care about the    same things as the managers evaluating the team’s performance”[Matt Stephens, Doug Rosenberg 2003 Figure 2-6]

The critics of XP also claim that the ‘C3′ project failed because of a combination of problems generated by XP methodology. XP relies on releasing small and frequent releases this is considered one of XPs main strengths along with continuous unit testing. The C3 project saw the first implementation of these short incremental releases. When faced with this XP function within a real world situation, within the C3 project the development team found that these releases were unobtainable as in the circumstances it was impossible to implement the system to a small proportion of users. Ron Jeffries who was a software developer who worked on the C3 project as the XP coach (a role which required him to lead the team and keep the project on track) posted a message on rational.com about the reasons he felt the C3 project failed;

“One of C3′s possibly-not-minor problems was that we did not release the payroll incrementally because no one could see how to do half a population” [http://www.rational.com 2000]

XP keeps it simple, XP believes that if you find the simplest solution to a problem it will provide the best solution, as XP promoters have a philosophy that it is better to build something simple without adding extra functionality which may prove to be unneeded in the final system. They also believe by doing this it improves the maintainability of the system if the code is simpler to understand it will be simpler to modify. With this in mind XP as a software development technique which has been tailored around the use of object orientated design.

XP brings a new dimension to invoking a software development methodology; it promotes a number of alternate ways of approaching key practices that take places within a regular system development.  An aspect of XP which evens it critics agree upon is the idea of a test driven development process this is a highly desirable characteristic as it improves the quality of the code produced thus improving the reliability of the project.

So why could XP be consider a development, which promotes creativity. Well the main argument lies within pair programming, based on the principle that if two people working on the same piece of work inspires them to be more creative, a counter argument to that is by forcing developers to program in pairs takes away the individual creative ability of the developers.

“People in creative programming don’t pair. Remember too many cooks spoil the broth. Can you imagine two painters creating a masterpiece by taking turns with a paint brush?”

[Matt Stephens, Doug Rosenberg 2003 Figure 2-6]

Though in some ways this argument is valid, others such as Kent Beck would argue the opposite as he believes pair programming increase’s creative productivity and that the example given above is limited as Stephens and Rosenburg only draw comparisons with creating a painting, this is only type of creative practice, which is historically an individual activity. Johnson and Johnson investigating how XP can be compared and contrasted related XP to the composition of a piece of music.

“In particular we emphasize how pair programming can facilitate an increase in the overall skill level of individuals and teams, and relate this to musicians’ development of models of excellence through ensemble playing. Consideration is also given to the psychology of music performance and its relevance to the pursuit of excellence in software development.” [Andrew Johnston and Chris S. Johnson 2007]

XP in the real world paints a slightly different view of its use. In practice XP requires an exclusive set of developers who are highly motivated, well experienced and have superior communication skills. This is because the XP work environment relies on self-motivation and expertise. XP also requires the developer to be able to adapt to a different way of developing software.

XP brings numerous advantages to the development, specifically within the design and implementation stage as XP is centered on the creation of software. But in our estimation XP lacks the analytical tools, which other software development methodologies possess such as SSADM, these are vital tools in most software development projects. Because of this XP would profit from being paired with another software development methodology so that the impact of pitfalls in analysis XP presents is lessened.

VN:F [1.9.3_1094]
Rating: 4.0/5 (1 vote cast)

Howto: install and configure java SDK on linux

Ok a rather quick how to for java SDK on linux.

First of all go grab yourself a jdk .bin file from java.sun.com 1.6 or 1.5 your choice in this how to it will show how to install and use both, get  a jdk that suits your system DON’T: get a 64bit sdk if your running 32bit linux :p

Ok this tutorial is solely old skool terminal based and does not make use or YUM/APT-GET/SYNAPTIC etc

so lets begin move the .bin file and prepare the environment


[ant@somelinuxpc ~]$ su -

password:

[root@somelinuxpc ~]$ cd /usr

// I'm  using /usr/java but its upto you guys where you want yours

[root@somelinuxpc /usr ]$ mkdir java

[root@somelinuxpc /usr ]$ cd {download directory of bin file}

[root@somelinuxpc downloadDir ]$ cp jdk1.x.bin /usr/java

[root@somelinuxpc downloadDir ]$ cd /usr/java

[root@somelinuxpc /usr/java]$

Ok so we moved the .bin file, lets install java …


//First we need to make the .bin executable

[root@somelinuxpc /usr/java ]$ chmod +x jdk1.x.bin

[root@somelinuxpc /usr/java ]$ ./jdk1.x.bin

// following the instructions and complete the installation

and your done … well its installed you can’t really use it but its installed  lets get it working what we need to define a few things such as JDK_HOME and the JAVA_HOME. Want we need to do is create to files in the /etc/profile.d directory java.sh and java.csh which you can and edit using vi.

Java.sh Looks like this

pathmunge () {
if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
if [ "$2" = "after" ] ; then
PATH=$PATH:$1
else
PATH=$1:$PATH
fi
fi
}

export JDK_HOME=/usr/java/default
export JAVA_HOME=$JDK_HOME
pathmunge $JDK_HOME/bin

You will notice I’m using /usr/java/default as my jdk home this is because I’ve created a symbolic link to my version of java using thew following commad ln -s /usr/java/jdk1.x default. The reason this sometimes I need to develop code or compile code using an older(or newer) JDK having a symbolic link means I can switch easily between the two without having to edit the java.sh or java.csh simples!

java.csh Looks like this


setenv JDK_HOME /usr/java/default
setenv JAVA_HOME /usr/java/default
set path=(/usr/java/default/bin $path)

now this is important close your terminal and all over terminals you have open you need to do this as your profile needs to be reloaded to take affect. Once done your good to go perform the following.


[ant@somelinuxpc ~ ]$ java -version
java version "1.6.0_18"
Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode, sharing)

Fini!

VN:F [1.9.3_1094]
Rating: 0.0/5 (0 votes cast)
Return top