scala> def pageVisitCount(session: Int): Int = session + 1
pageVisitCount: (session: Int)Int
scala> var totalPageCount = pageVisitCount(1)
totalPageCount: Int = 2
scala> def message() = "Hello Scala"
message: ()java.lang.String
scala> message()
res0: java.lang.String = Hello Scala
scala> message
res1: java.lang.String = Hello Scala
Even you can able to call function without parenthesis if it doesn't have arguments.
Thursday, March 29, 2012
Google Open Source Blog: The Go project reaches a major milestone: Go 1
Google Open Source Blog: The Go project reaches a major milestone: Go 1: In November 2009 Google announced the Go project , a new open source programming language. Since then more than 200 outside contributors ...
Scala Basics - Variables
You can define variable by "var" keyword
scala> var message="Hello Scala"
message: java.lang.String = Hello Scala
scala> var count=7
count: Int = 7
These two example we have created variables of type String and Int.Remember you can able to change message and count binding, since it's declared by "var".
Scala Basics - Simple Expression
Here is simple expression in Scala.
You can define you're own name for a expression through "val".
Scala> 7 + 7
res0: Int = 14
Scala> 4.5+9.3
res0: Double = 13.8
Scala interpreter automatically created value name(res0) for result of the expression. Last expression, res0 has Double type and stores 13.8 value.You can define you're own name for a expression through "val".
scala> val result = 4*5
result: Int = 20
You cann't change the binding to a val.Almost everything in Scala is an expression.
Labels:
Expression,
Scala,
Tutorial
Wednesday, March 28, 2012
Scala Basics - Interpreter for testing/learning!
Once you're machine installed with scala, then starting scala interpreter is easy
Note: refer this post for Scala install instructions for Ubuntu
Note: refer this post for Scala install instructions for Ubuntu
$ scala
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
Now you're machine is ready for testing Scala code!
Welcome to Scala version 2.9.1.final (Java HotSpot(TM) Server VM, Java 1.6.0_26).
Type in expressions to have them evaluated.
Type :help for more information.
scala>
Monday, March 26, 2012
Scala - General Information
Scala is a concise, elegant, type-safe programming language that integrates object-oriented and functional features.It is fully interoperable with Java.
Scala and Java
Scala programs run on the Java Environment(JVM), so it compatible with Java. it makes Scala to use any existing Java Libraries/Applications.
Scala can able to calls/refers any Java code similarly Java can calls/refers any Scala code.
Scalar compiler performance is more reliable and well supports Java Byte Code.
Latest stable release & more information available here.
Scala and Java
Scala programs run on the Java Environment(JVM), so it compatible with Java. it makes Scala to use any existing Java Libraries/Applications.
Scala can able to calls/refers any Java code similarly Java can calls/refers any Scala code.
Scalar compiler performance is more reliable and well supports Java Byte Code.
Latest stable release & more information available here.
Thursday, March 22, 2012
Scala 2.9.2 RC1
Scala 2.9.2 RC1 is available, it includes many bugfixes,but for testing purpose only.
More information available here.
More information available here.
JDK 8 - State of the Lambda
New edition of the State of the Lambda is available here.
Labels:
Java
RR's Random Ramblings: Java Tuning in a Nutshell - Part 1
Looks interesting....
RR's Random Ramblings: Java Tuning in a Nutshell - Part 1: While delivering a training recently, I got a request to put together a JVM tuning cheat sheet. Given the 50+ parameters available on the ...
RR's Random Ramblings: Java Tuning in a Nutshell - Part 1: While delivering a training recently, I got a request to put together a JVM tuning cheat sheet. Given the 50+ parameters available on the ...
Monday, March 19, 2012
Release - SPRING DATA MONGODB 1.0.1 GA!
Spring released it's first Spring Data MongoDB 1.0.1 GA, it's major release with major bug fixes(entity mapping, query execution and added a converter for UUIDs out of the box).
See Downloads, JavaDoc and Reference Documentation for more information.
See Downloads, JavaDoc and Reference Documentation for more information.
Labels:
Java,
Release,
Spring,
Spring MongoDB
SPRING DATA JPA 1.1.0 RC1 AND 1.0.3 GA RELEASED
It includes lots of new features and bug fixes.Highlights are
* Support for locking
* Support for @IdClass in entities
* Support for LessThanEqual and GreaterThanEquals, True/False keywords in query methods
* Added CDI integration for repositories
* Improved parameter binding for derived queries for null values
More information
1.0.3.RELEASE - Maven artifacts | JavaDocs | Reference Documentation | Changelog
1.1.0.RC1 - Maven artifacts | JavaDocs | Reference Documentation | Changelog
* Support for locking
* Support for @IdClass in entities
* Support for LessThanEqual and GreaterThanEquals, True/False keywords in query methods
* Added CDI integration for repositories
* Improved parameter binding for derived queries for null values
More information
1.0.3.RELEASE - Maven artifacts | JavaDocs | Reference Documentation | Changelog
1.1.0.RC1 - Maven artifacts | JavaDocs | Reference Documentation | Changelog
Labels:
Java,
JPA,
Spring,
Spring Data
GlassFish Server 3.1.2!
After seven months(since release 3.1.1), Oracle has been released GlassFish Server 3.1.2
Release notes and downloads are available here
Release notes and downloads are available here
Saturday, March 17, 2012
Difference between Servlet container and Application server
Servlet Container - Tomcat 5/6/7, Jetty,etc
It supports a application which is based on Servlet Technology, it also handles extension of the servlet technology such as JSP, JSTL,etc.
Possible to deploy most of the JavaEE Technologies on Servlet container, For that we have to add respective Technology APIs(either by maven repo/ant) on your application
Application Server: WebLogic, JBoss, GlassFish,etc
It supports a application which is based on JavaEE Technologies - EJB,Servlet,JSP,JF,JMS,JTA,etc.
It supports a application which is based on Servlet Technology, it also handles extension of the servlet technology such as JSP, JSTL,etc.
Possible to deploy most of the JavaEE Technologies on Servlet container, For that we have to add respective Technology APIs(either by maven repo/ant) on your application
Application Server: WebLogic, JBoss, GlassFish,etc
It supports a application which is based on JavaEE Technologies - EJB,Servlet,JSP,JF,JMS,JTA,etc.
Typesafe Stack - Release 2.0
Typesafe stack has been release version 2.0. Install instructions are available here for different operating system.
What's TypeSafe?
It's a stack for builing scalable software applications in Java and Scala. It includes
1. Scala
It's a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive.
2. Akka
It's a event-driven middleware, with Scala and Java APIs.
3. Play
Go through Documents and try different (giter8) template projects available.
What's TypeSafe?
It's a stack for builing scalable software applications in Java and Scala. It includes
1. Scala
It's a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. It smoothly integrates features of object-oriented and functional languages, enabling Java and other programmers to be more productive.
2. Akka
It's a event-driven middleware, with Scala and Java APIs.
3. Play
It's a Scala framework - easier to build web applications with Java & Scala.
Go through Documents and try different (giter8) template projects available.
Thursday, March 15, 2012
Good Ruby on Rails Resources
These reference resources are very helpful and make you good in development and understand of Ruby on Rails.
Official Rails Doc
General reference for Rails
Rails API docs with usage notes
Official Rails Doc
General reference for Rails
Rails API docs with usage notes
Release - Rails 3.2.2
Rails 3.2.2 has been released. it contains two major security fixes and lots bug fixes.
Some of the major changes are
* Log files are always flushed
* Failing tests will exit with nonzero status code
* Elimination of calls to deprecated methods
* Query cache instrumentation includes bindings in the payload
* Hidden checkbox values are not set if the value is nil
* Various Ruby 2.0 compatibility fixes
More information about source and change log are available here
If you want to try latest rails on you're app, follow install and setup instructions which is available on official rubyonrails.org.
Some of the major changes are
* Log files are always flushed
* Failing tests will exit with nonzero status code
* Elimination of calls to deprecated methods
* Query cache instrumentation includes bindings in the payload
* Hidden checkbox values are not set if the value is nil
* Various Ruby 2.0 compatibility fixes
More information about source and change log are available here
If you want to try latest rails on you're app, follow install and setup instructions which is available on official rubyonrails.org.
Labels:
Rails 3,
Ruby on Rails
Sunday, March 11, 2012
PHP 5.4.0 released!
The PHP development team announced PHP 5.4.0. It includes a large number of new features and bug fixes.
Some of the key new features include: traits, a shortened array syntax, a built-in webserver for testing purposes and more. PHP 5.4.0 significantly improves performance, memory footprint and fixes over 100 bugs.
More details available in release announcement.
Some of the key new features include: traits, a shortened array syntax, a built-in webserver for testing purposes and more. PHP 5.4.0 significantly improves performance, memory footprint and fixes over 100 bugs.
More details available in release announcement.
Saturday, March 10, 2012
Open source release - WindowTester Pro
Google announced the open sourcing release of WindowTester Pro. It is a UI test generation tool for testing SWT and Swing Java applications. WindowTester Pro eliminates the need to manually create test cases to test GUIs by automating the process of GUI testing. Using WindowTester Pro, developers can easily create tests for every GUI they create. Automating GUI testing increases the productivity of both the developer and the QA team. WindowTester Pro empowers developers with testing capabilities and reduces the time required to hand-code tests. This enables developers to build quality into the product early in the process because problems are found and resolved earlier in the development cycle. Using WindowTester Pro helps developers and companies drastically lower both testing time and cost—it is not uncommon to save up to 50% or more of time required to write the tests.
The tests generated by WindowTester Pro are standard JUnit tests thus they can be run within your Eclipse environment or they can be automated to run using Ant. Typically, tests are recorded on projects within your Eclipse environment. If your want to test against a deployed application, you must first import your application into your Eclipse environment.
More information about WindowTester Pro(installation,download,sample) is available here.
The tests generated by WindowTester Pro are standard JUnit tests thus they can be run within your Eclipse environment or they can be automated to run using Ant. Typically, tests are recorded on projects within your Eclipse environment. If your want to test against a deployed application, you must first import your application into your Eclipse environment.
More information about WindowTester Pro(installation,download,sample) is available here.
Thursday, March 8, 2012
Unclean shutdown detected - MongoDB 2.0.2
If you are not able to start MongoDB server then log message says
Unclean shutdown detected.
*************
Wed Mar 7 15:17:41 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Wed Mar 7 15:17:41 dbexit:
Wed Mar 7 15:17:41 [initandlisten] shutdown: going to close listening sockets...
Wed Mar 7 15:17:41 [initandlisten] shutdown: going to flush diaglog...
Wed Mar 7 15:17:41 [initandlisten] shutdown: going to close sockets...
Wed Mar 7 15:17:41 [initandlisten] shutdown: waiting for fs preallocator...
Wed Mar 7 15:17:41 [initandlisten] shutdown: closing all files...
Wed Mar 7 15:17:41 [initandlisten] closeAllFiles() finished
Wed Mar 7 15:17:41 dbexit: really exiting now
One of the reason for this issue is lock file,So fix could be removing "mongod.lock"
File location could be /srv/db/mongodb/mongod.lock
Then restart MongoDB service
/etc/init.d/mongodb start
Hope it may help to solve unclean issue
Unclean shutdown detected.
*************
Wed Mar 7 15:17:41 [initandlisten] exception in initAndListen: 12596 old lock file, terminating
Wed Mar 7 15:17:41 dbexit:
Wed Mar 7 15:17:41 [initandlisten] shutdown: going to close listening sockets...
Wed Mar 7 15:17:41 [initandlisten] shutdown: going to flush diaglog...
Wed Mar 7 15:17:41 [initandlisten] shutdown: going to close sockets...
Wed Mar 7 15:17:41 [initandlisten] shutdown: waiting for fs preallocator...
Wed Mar 7 15:17:41 [initandlisten] shutdown: closing all files...
Wed Mar 7 15:17:41 [initandlisten] closeAllFiles() finished
Wed Mar 7 15:17:41 dbexit: really exiting now
One of the reason for this issue is lock file,So fix could be removing "mongod.lock"
File location could be /srv/db/mongodb/mongod.lock
Then restart MongoDB service
/etc/init.d/mongodb start
Hope it may help to solve unclean issue
Labels:
MongoDB
Install Opera 11.61 on Ubuntu 11.10
Simple steps to install Opera 11.61 on Ubuntu 11.10(Oneiric Ocelot)
1. Get the latest opera debian package from this link
http://www.opera.com/download
2. Run .deb file as root user
sudo dpkg -i ~/Downloads/opera_11.61.1250_i386.deb
1. Get the latest opera debian package from this link
http://www.opera.com/download
2. Run .deb file as root user
sudo dpkg -i ~/Downloads/opera_11.61.1250_i386.deb
Labels:
Opera,
Ubuntu 11.10
Sunday, March 4, 2012
Nginx 1.1.16 - Development version
Nginx 1.1.16 development version is available. Changes in Nginx 1.1.16 are
* Change: the simultaneous subrequest limit has been raised to 200. * Feature: the "from" parameter of the "disable_symlinks" directive. * Feature: the "return" and "error_page" directives can be used to return 307 redirections. * Bugfix: a segmentation fault might occur in a worker process if the "resolver" directive was used and there was no "error_log" directive specified at global level. Thanks to Roman Arutyunyan. * Bugfix: a segmentation fault might occur in a worker process if the "proxy_http_version 1.1" or "fastcgi_keep_conn on" directives were used. * Bugfix: memory leaks. Thanks to Lanshun Zhou. * Bugfix: in the "disable_symlinks" directive. * Bugfix: on ZFS filesystem disk cache size might be calculated incorrectly; the bug had appeared in 1.0.1. * Bugfix: nginx could not be built by the icc 12.1 compiler. * Bugfix: nginx could not be built by gcc on Solaris; the bug had More information and stable version of Nginx available here.
Labels:
Nginx,
Web Server
Saturday, March 3, 2012
Scala Driver for MongoDB - Casbah
Casbah is an interface for MongoDB designed to provide more flexible access from both Java and Scala. While the current core focus is on providing a Scala oriented wrapper interface around the Java mongo driver, support for other JVM languages may come in the future.
For the Scala side, contains series of wrappers and DSL-like functionality for utilizing MongoDB from within Scala. This currently utilises the very Java-oriented Mongo Java driver, and attempts to provide more scala-like functionality on top of it. This has been tested with MongoDB 1.2.x+ and v2.x of the Mongo java driver.
Tutorial and more information available here.
Friday, March 2, 2012
Scientific Linux 6.2!
Scientific Linux 6.2 has been available for i386 and x86_64. You can download it form here.
Labels:
Linux,
Scientific
PostgresSQL - Release 9.1.3, 9.0.7, 8.4.11 and 8.3.18!
PostgresSQL has been announced security and maintenance release of versions 9.1.3, 9.0.7, 8.4.11 and 8.3.18 last week.
Bug and performance fixes in this minor release include
* Fix btree index corruption from insertions concurrent with vacuuming
* Avoid crashing when we have problems deleting table files post-commit
* Fix recently-introduced memory leak in processing of inet/cidr
* Fix postmaster to attempt restart after a hot-standby crash
Download and release announcement available here.
Bug and performance fixes in this minor release include
* Fix btree index corruption from insertions concurrent with vacuuming
* Avoid crashing when we have problems deleting table files post-commit
* Fix recently-introduced memory leak in processing of inet/cidr
* Fix postmaster to attempt restart after a hot-standby crash
Download and release announcement available here.
Labels:
PostgreSQL,
Release
Subscribe to:
Posts (Atom)