Saturday, September 28, 2013

Build Tools

  • Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.
 https://maven.apache.org/


  • Ant

Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications
http://ant.apache.org/
  • Gradle
Gradle is build automation evolved. Gradle can automate the building, testing, publishing, deployment and more of software packages or other types of projects such as generated static websites, generated documentation or indeed anything else.
http://www.gradle.org/

  • gulp is a toolkit for automating painful or time-consuming tasks in your development workflow, so you can stop messing around and build something.

https://gulpjs.com/


  • SBT

The interactive build tool
Define your tasks in Scala. Run them in parallel from sbt's interactive shell. 
https://www.scala-sbt.org/index.html
  • Grunt
The Grunt ecosystem is huge and it's growing every day. With literally hundreds of plugins to choose from, you can use Grunt to automate just about anything with a minimum of effort. If someone hasn't already built what you need, authoring and publishing your own Grunt plugin to npm is a breeze.
Why use a task runner?
In one word: automation. The less work you have to do when performing repetitive tasks like minification, compilation, unit testing, linting, etc, the easier your job becomes. After you've configured it through a Gruntfile, a task runner can do most of that mundane work for you—and your team—with basically zero effort.
http://gruntjs.com/
  • Apache Ivy 

The agile dependency manager
Apache Ivy is a popular dependency manager focusing on flexibility and simplicity
https://ant.apache.org/ivy/

  • Java jar dependency management using Ivy


Along with our source code, we’ve also been putting all required jars into cvs, basically for two reasons:

    The build process controlled by cruisecontrol needs the jars, but cruisecontrol runs on a server where we don’t want to install an IDE (jdeveloper). We’ve put all adf, bc4j and other required jars into cvs, and when the build process compiles the application, it first gets all the required source code and the required jars, so no need for jdeveloper.
    We want version control on dependencies. If you check out the code for release 1, you need the jars that release 1 depends on. If you check out release 2, you will need different jars.

So just relying on the project dependencies in jdeveloper is not an option.

The downside to this approach however, is that we get a lot of jars in cvs, and many projects use the same jar files, so it’s bit of a waste. For some time, i thought the solution would be to move from using ant to using maven for building the code. However, some weeks ago, i discovered ivy. Ivy is a java dependency manager, which you can easily use in existing projects using ant.

http://www.andrejkoelewijn.com/blog/2005/07/14/java-jar-dependency-management-using-ivy/
  • PHing

PHing Is Not GNU make
it's a PHP project build system or build tool based on Apache Ant.
You can do anything with it that you could do with a traditional build system like GNU make, and its use of simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework.
http://www.phing.info/


  • Gant

Build software with Gant - IBM
Gant is a highly versatile build framework that leverages both Groovy and Apache Ant to let you implement programmatic logic while using all of
www.ibm.com/developerworks/java/tutorials/j-gant/


  • LuntBuild
Luntbuild is a powerful build automation and management tool.
Continuous Integration or nightly build can be easily set using a clean web interface
luntbuild.javaforge.com


  • Buildbot Basics
Buildbot is an open-source framework for automating software build, test, and release processes.

https://buildbot.net/

  • CMake is a cross-platform open-source meta-build system which can build, test and package software. It can be used to support multiple native build environments including make, Apple’s xcode and Microsoft Visual Studio.

https://github.com/ttroy50/cmake-examples


  • CMake is an open-source, cross-platform family of tools designed to build, test and package software. CMake is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice. The suite of CMake tools were created by Kitware in response to the need for a powerful, cross-platform build environment for open-source projects such as ITK and VTK

https://cmake.org/


  • In a short conclusion, CMake help you to manage and build your source codes effectively. If you have some troubles with gcc and Makefile, just move out to CMake.

https://tuannguyen68.gitbooks.io/learning-cmake-a-beginner-s-guide/content/chap1/chap1.html


  • First, it is almost unreadable. Second, it does not account for any header file dependencies. In fact, if any of the header files change, there’s no way for the system to detect this at all, forcing the user to type in make clean, then make to make everything all over again. Third, given the sheer number of files, make will take minutes to run, which kills productivity. Fourth, if you look closely at the path, you will observe that the person writing this Makefile used a Mac with MacPorts and therefore is the kind of person who is just wrong. Fifth, this Makefile obviously won’t work for someone on Linux or Windows, even worse, it won’t work for another Mac user who used HomeBrew or compiled OpenCV from source. Sixth, some rules are just commented out, which indicates sloppy behaviour. Writing Makefiles like this just sucks. It sucks productivity and makes me think of slow and painful death.

I’ll now show how I replaced this terrible Makefile with a clean, modular CMake build system that replicated the effects of the Makefile
the ease of setting up this CMake system will convince you to never write a Makefile again.
As these files are generated by a tool and not written by a person, you never have to read them, so Makefile readability is not a concern. Second, the Makefiles encode all the dependencies correctly, so there’s no reason to go through the hoops creating complex dependency files.

But what if I’m on Windows, or if I just am the kind of person who is always wrong and uses CodeBlocks, Xcode, or another IDE? you ask. Well, hold on till the end, I’ll show you how CMake has you covered.
CMake has a concept of generators’, which is just a fancy name for a backend.

https://skandhurkat.com/post/intro-to-cmake/



  • I love CMake, it allows me to write cross-platform code and be confident that the build system would work across a choice of compilers, IDEs, and operating systems. 

For example, I could simply write a function that mimics a unit test and prints out either “Test passed” or “Test failed” depending on the result of the test. All I now need is a way to automatically run these tests.
when C++ with CMake offers cross platform builds, testing infrastructure, and parallel execution with memory consistency models?
https://skandhurkat.com/post/intro-to-ctest/


  • SCons is an Open Source software construction tool—that is, a next-generation build tool. Think of SCons as an improved, cross-platform substitute for the classic Make utility with integrated functionality similar to autoconf/automake and compiler caches such as ccache. In short, SCons is an easier, more reliable and faster way to build software.

https://scons.org/

  • Yarn is a package manager for your code. It allows you to use and share code with other developers from around the world. Yarn does this quickly, securely, and reliably so you don’t ever have to worry.
  • https://yarnpkg.com/en/

maven repository management

  • Nexus

Sonatype Nexus sets the standard for repository management providing development teams with the ability to proxy remote repositories and share software artifacts.
Download Nexus and gain control over open source consumption and internal collaboration.
http://www.sonatype.org/nexus/


  • Artifactory

Artifactory offers powerful enterprise features and fine-grained permission control behind a sleek and easy-to-use UI.
Proxy
Artifactory acts as a proxy between your build tool (Maven, Ant, Ivy, Gradle etc.) and the outside world.
Local Cache
It caches remote artifacts so that you don’t have to download them over and over again
Control
It blocks unwanted (and sometimes security-sensitive) external requests for internal artifacts and controls how and where artifacts are deployed, and by whom.
http://www.jfrog.com/home/v_artifactory_opensource_overview


  • Empower Hudson with Artifactory - Track and Replay Your Build Artifacts

Using one of the different flavors of version control applications, you can easily reproduce the state of any point in the past using the different methods of SCM tagging.

what happens when you want to reproduce binary products from a certain phase?
Are dependencies considered?
Does anyone really remember what version of dependency X was used in version 1.0 or in version 3.1 of your application?
What if you used version ranges or dynamic properties?
Was the application compiled using JDK 5 or 6?
All this information can be recorded during the publication of your binaries, which is usually done by a CI server of your choice.

Your CI server has all the knowledge required in order to reproduce a build:
    Information on the builds themselves
    The published items
    Version information
    Dependencies
    Build environment details

Using Hudson (and others to be supported soon) and Artifactory we've:

    Supplied Hudson with all the needed dependencies from Artifactory—helping us keep the exact dependencies that were used in each build
    Deployed all produced binaries to Artifactory—helping us keep and promote all the products of the build
    Published build information to Artifactory—helping us manage and keep track of every build, environment, product, and dependency


With the assistance of these tools and methods, you will be able to reproduce and execute a build from any point of recorded time or compare information between different builds.


http://java.dzone.com/articles/empower-hudson-artifactory
  • Archiva

Apache Archiva™ is an extensible repository management software that helps taking care of your own personal or enterprise-wide build artifact repository. It is the perfect companion for build tools such as Maven, Continuum, and ANT.
http://archiva.apache.org/

  • In a continuous integration environment, where builds are often triggered by checking in artifacts, there is the potential for a large number of builds to be executed. Each of these builds, at least the successful ones, results in some artifacts being published into the repository. These can start consuming a lot of space, and it is important to manage them.

Archiva provides two different options for automatically cleaning up old snapshots on a per-repository basis:

    Repository Purge by Number of Days Older

    Repository Purge by Retention Count

Both of these options can be viewed and changed by clicking Repositories under the Administration menu and then clicking Edit for the repository you are interested in.

Repository Purge by Number of Days Older

Archiva automatically deletes snapshots older than the specified number of days. Archiva always retains the most recent snapshot, no matter how old it is.

Repository Purge By Retention Count

To use this method, you must set the purge-by-days-older value to 0. Archiva retains only the most recent snapshot instances up to this value. Older instances that exceed this count are deleted.
http://docs.oracle.com/middleware/1212/core/MAVEN/populating_archiva.htm

  • Maven Repository Manager, Archiva in this case, includes the following:

Internal: This repository is used to store finished artifacts that you have built in your development environment.

Snapshot: This repository is used to store work in progress artifacts that you have built in your development environment.

Mirror: This repository is used to store dependencies that have been downloaded from an external repository.

Dev, test, qa, prod: You have one repository for storing the dependencies needed for each target environment. You do this because it is possible that two environments might have the same version of an artifact (for example, 12.1.2-0-0) even though the artifact has been patched in one environment, and is therefore different.
http://docs.oracle.com/middleware/1212/core/MAVEN/intro_ref_ede.htm

  • We use Maven 2 to resolve dependencies and build the source code into packages. 

With the Archiva repository manager we are able to store the needed libraries and to keep track of the daily builds or releases.
Hudson will be the tool to start up the build process every day and notify the developers when the build fails.
By default you'll have 2 Managed repositories. An internal one you can use as a proxy
for the company, and a snapshots repository to put your snapshot builds
Besides those there are
also remote repositories. These are other Maven repositories where Archiva will look for
dependencies when they aren't in your own repositories.
You can also add remote repositories. This is useful if you want to set up a proxy repository for
your company. This way your company users only have to access the internal repository and
don't need to go to the internet.
You can let Hudson poll the SCM and rebuild after every commit. You can also let it build periodical by specifying a cron job



archiva starts up with two hosted repositories configured:

    Internal

    The internal repository is for maintaining fixed-version released artifacts deployed by your organization, which includes finished versions of artifacts, versions that are no longer in development, and released versions. Note that in-development versions of the same artifacts may exist in the snapshot repository in the future.

    Snapshot

    The snapshot repository holds the work-in-progress artifacts, which are denoted with a version with the suffix SNAPSHOT, and artifacts that have not yet been released.
http://docs.oracle.com/middleware/1212/core/MAVEN/populating_archiva.htm


  •  Efficiency. Repository acts as a cache for Maven Central artifacts

    Resilience. Repository protects against remote repository failures or lack of internet connection
    Repeatability. Storing common artifacts centrally, avoids shared build failures caused by developers maintaining their own local repositories.
    Audit. If all 3rd party libraries used by development come from a single entry point in the build process one can assess how often they're used (based on download log files) and what kinds of licensing conditions apply.


http://stackoverflow.com/questions/8259118/good-configuration-for-archiva


  • By default, Archiva comes with a proxy to the mavenSW central repository. Therefore, it's basically all set up to be used as a mirror of the maven central repository. If we make a request of Archiva for an artifact for a central repository artifact, it will download that artifact and return that artifact to us. If we make future requests for that artifact, Archiva will return to us the copy of the artifact that it had already downloaded from the central repository.



http://www.avajava.com/tutorials/lessons/how-do-i-use-archiva-as-a-mirror-of-the-maven-central-repository.html

Monday, August 26, 2013

SSO vs CAS


  • For example, a user logs on to her workstation, then decides to access a company database

Typically, the database would require another username and password for authentication. But in an SSO environment, the application simply determines whether it can authenticate the user based on information the network's authentication server provides

With centralized authentication, this authentication process is different. Using the example above, logging on to the database isn't transparent; the user would have to enter her authentication information again. However, the required credentials would be identical to the credentials she used to log on to her workstation. Centralized authentication effectively solves only one problem: users having to remember multiple sets of authentication credentials.

http://windowsitpro.com/networking/sso-vs-centralized-authentication


  • The Central Authentication Service (CAS) is a single sign-on protocol for the web

Its purpose is to permit a user to access multiple applications while providing their credentials (such as userid and password) only once
It also allows web applications to authenticate users without gaining access to a user's security credentials, such as a password.
http://en.wikipedia.org/wiki/Central_Authentication_Service


  • Central Authentication Service project, more commonly referred to as CAS.  

CAS is an authentication system originally created by Yale University to provide a trusted way for an application to authenticate a user. CAS became a Jasig project in December 2004.
CAS provides enterprise single sign-on service:
http://www.jasig.org/cas

  • FreeIPA is an integrated security information management solution combining Linux (Fedora), 389 Directory Server, MIT Kerberos, NTP, DNS, Dogtag (Certificate System). It consists of a web interface and command-line administration tools.
FreeIPA is an integrated Identity and Authentication solution for Linux/UNIX networked environments. A FreeIPA server provides centralized authentication, authorization and account information by storing data about user, groups, hosts and other objects necessary to manage the security aspects of a network of computers.
https://www.freeipa.org/page/About

  • cookie-based SSO

share the user logged in across multiple applications using only a cookie on the browser

cookies can be shared if domains have a master domain in common. foo.example.com and bar.example.com can share a .example.com cookie
When the user authenticates on site-a.com, you set a cookie on site-a.com domain. Then on site-b.com, you link a dynamic javascript from site-a.com, generated by server side script (php, etc) who has access to the created cookie, and then copy the same cookie on site-b.com on the client-side using js. Now both sites have the same cookie, without the need of asking the user to re-login
I have seen custom SSO solutions that transmit the payload using XML over HTTPS.
https://stackoverflow.com/questions/1784219/cookie-based-sso

Static analysis


  • Static  analysis

Static program analysis is the analysis of computer software that is performed without actually executing programs (analysis performed on executing programs is known as dynamic analysis). In most cases the analysis is performed on some version of the source code and in the other cases some form of the object code.
The term is usually applied to the analysis performed by an automated tool, with human analysis being called program understanding, program comprehension or code review.
http://en.wikipedia.org/wiki/Static_program_analysis

Tuesday, August 20, 2013

Using Symlinks in Windows


  • Using Symlinks in Windows Vista

One of the long-awaited features in Windows Vista was the ability to use symbolic links, the way you can in linux

For instance, if you wanted to make the folder C:\Users\Geek\TestFolder available from C:\TestFolder as well, you could use the following command.

C:\mklink /D C:\TestFolder C:\Users\Geek\TestFolder

symbolic link created for C:\TestFolder <<===>> C:\Users\Geek\TestFolder




Hard Link

A hard link directly points to the file, and acts to the operating system as if it is the file itself. You’ll want to use this option the majority of the time if you are trying to fake an application’s directory.

Soft Link

A soft link is essentially a shortcut to a file or folder – if you are using Windows explorer, you’ll be redirected to the directory if you double-click on a shortcut, it won’t pretend its part of the filesystem. You can still directly reference or open a file with the symlinked path, and it mostly works.

Deleting Symlinks

To delete a symlink, you can just delete the link. Just make sure you don’t delete the original file.

http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/

HSQLDB


  • HSQLDB (HyperSQL DataBase) is the leading SQL relational database engine written in Java. It offers a small, fast multithreaded and transactional database engine with in-memory and disk-based tables and supports embedded and server modes. It includes a powerful command line SQL tool and simple GUI query tools.

http://hsqldb.org/





  • HSQLDB (Hyper Structured Query Language Database) is a relational database management system written in Java. It has a JDBC driver and supports a large subset of SQL-92 and SQL:2008 standards.[1] It offers a fast,[2] small (around 1300 kilobytes in version 2.2) database engine which offers both in-memory and disk-based tables. Both embedded and server modes are available for purchase.


Additionally, it includes tools such as a minimal web server, command line and GUI management tools (can be run as applets), and a number of demonstration examples. It can run on Java runtimes from version 1.1 upwards, including free Java runtimes such as Kaffe.

HSQLDB is available under a BSD license. It is used as a database and persistence engine in many open source software projects, such as OpenOffice Base, LibreOffice Base, and the Standalone Roller Demo,[3] as well as in commercial products, such as Mathematica or InstallAnywhere (starting with version 8.0)
http://en.wikipedia.org/wiki/HSQLDB



  • 1. The dialect is set to the database we are using which is HSQLDB

2. The JDBC driver is also set to HSQLDB
3. We set the database to one called testdb and request that the database be shutdown when our program exits
4. The default user name and passwords are used (change if yours differs)
5. I use the create-drop option to create the database and table(s) if they doesn’t exist, if they do they are dropped leaving me with a clean database each time I run the program. Other options are: create, update and validate

http://www.giantflyingsaucer.com/blog/?p=2902



  • querying using hsql database manager :


select your connection

    type: HSQL DATABASE ENGINE SERVER
    Driver: jdbc.hsqldb.jdbcDriver
    URL: jdbc:hsqldb:hsql://localhost/


Wednesday, August 7, 2013

jakarta commons logging


  • When writing a library it is very useful to log information. However there are many logging implementations out there, and a library cannot impose the 

use of a particular one on the overall application that the library is a part of.

The Logging package is an ultra-thin bridge between different logging implementations. A library that uses the commons-logging API can be used with any 

logging implementation at runtime. Commons-logging comes with support for a number of popular logging implementations, and writing adapters for others 

is a reasonably simple task.

Applications (rather than libraries) may also choose to use commons-logging. While logging-implementation independence is not as important for 

applications as it is for libraries, using commons-logging does allow the application to change to a different logging implementation without 

recompiling code. 

Note that commons-logging does not attempt to initialise or terminate the underlying logging implementation that is used at runtime; that is the 

responsibility of the application. However many popular logging implementations do automatically initialise themselves; in this case an application may 

be able to avoid containing any code that is specific to the logging implementation used.



http://commons.apache.org/proper/commons-logging/

Tuesday, August 6, 2013

cells on laptop batteries

6 cell 2 1/2 hrs
9 cell 4 1/2 hrs
12 cell 4 hrs plus
depending on your power saving options
the higher the cell capacity the higher/heavier the price.
http://answers.yahoo.com/question/index?qid=20091001184320AAmwNsS

Monday, August 5, 2013

toad 9.1 toad 9.5 problem with oracle 11g client

toad 9.1 toad 9.5 problem with oracle 11g client

I logged a support ticket at Quest. The support over there is really quick and helpful. In less than a day I got a message back that they were going to try it themselves, it went even to the technical people (development team) and after a few mails of back and for I got this final message: "Unfortunately, it was confirmed by our team's technical lead that Toad version 9.5 only support Oracle server 11g and not Oracle client 11g. My only suggestion for you is to install another client on your machine that is 10gR2 version or lower."

http://dgielis.blogspot.com/2007/11/quest-toad-on-oracle-11g-not-supported.html

ORACLE_HOME

ORACLE_HOME refers to either:

    a directory where the Oracle software is installed; or
    an environment variable pointing to the directory where the Oracle software is installed.


Windows

Check current value:

echo The current ORACLE_HOME is %ORACLE_HOME%

Set the ORACLE_HOME environment variable:

set ORACLE_HOME=C:\oracle\ora10.2

On Windows the ORACLE_HOME may also be stored in the registry:

    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOMEID
    HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\ALL_HOMES
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

http://www.orafaq.com/wiki/ORACLE_HOME

Sunday, July 28, 2013

The Oracle System ID (SID)

The Oracle System ID (SID) is used to uniquely identify a particular database on a system. For this reason, one cannot have more than one database with the same SID on a computer system.
When using RAC, all instances belonging to the same database must have unique SID's.

http://www.orafaq.com/wiki/ORACLE_SID