Pencarian

Rss Posts

 

 

 

Berita pada bulan August, 2010

Ruby on Rails: Rails Has Great Documentation

Aug 29, 2010

To this day I still hear people complain that Rails has poor documentation. From where I?m sitting this seems far from the truth. Let me lay out the evidence piece by piece:


RailsTutorial.org

To learn Rails from scratch Michael Hartl recently finished his book Ruby on Rails Tutorial: Learn Rails by Example. The book teaches Rails 3 from the ground up and it?s available for FREE online. If you?d rather have a PDF or a book you can grab that as well (and he?s even working on some screencasts).

The source for the finalized book will be pushed to GitHub and released under a Creative Commons License shortly after Rails 3 is done. If you?d like to help translate the book to your language of choice, feel free to contact Michael and he?ll get in touch when it?s time to make it happen.

Rails Guides

If you?re not a Rails newbie don?t forget about the Rails Guides, which have been updated for Rails 3.

Rails API Docs

There are two main websites I use to do API lookups. The first is Rails Searchable API Doc, which has online and offline searchable documentation. The second is APIdock which is online only, but has the ability to comment and easily compare different versions of documentation.

Rails 3 Free Screencasts

If you?re more of a visual learner (like me) then there are plenty of free screencasts to teach you about Rails 3. About 2 months ago I produced the Rails 3 Screencasts, which will get you started.

Ryan Bates has also produced an incredible amount of Rails 3 screencasts over on Railscasts.com. Ryan has been producing Railscasts for over 3 1/2 years, isn?t that crazy?

There?s also a few good free screencasts over on Teach me to Code by Charles Max Wood.

Keeping on the Edge

If you find yourself wondering how to keep up with all of the newest features / libraries for Rails 3, both the Ruby5 Podcast and the Ruby Show are going strong. Don?t listen to audio? It doesn?t matter, just subscribe to the Ruby5 RSS feed and get links with descriptions to all the newest libraries, tutorials, and more. You might also want to checkout Peter Cooper?s new Ruby Weekly, a Ruby email newsletter

.

Need to upgrade a big app to Rails 3?

Jeremy McAnnaly?s Rails 3 Upgrade Handbook PDF is just $12. There?s also a few paid screencasts for the upgrade over on Thinkcode.tv and BDDCasts.

Need a Book?

There?s a bunch of books that will be coming out after the release, most of which you can start reading now. The Rails 3 Way by Obie Fernandez, Rails 3 In Action by Ryan Bigg and Yehuda Katz, Beginning Rails by Cloves Carneiro Jr and Rida Al Barazi, and of course the Agile Web Development with Rails:fourth edition by Sam Ruby, Dave Thomas, and David Heinemeier Hansson.

In conclusion

No more complaining about lack of good documentation! Seriously. If you want even more Rails 3 content, check out the blog post by Kevin Faustino on 34 Ruby on Rails 3 resources to get you started.

MySQL 5.1 Plugins Development Published

Aug 28, 2010

MySQL 5.1 has a great feature which not many people know about, that is the fact it can be extended via. the use of plugins. ?Unfortunately how you go about this is not incredibly well documented. ?You can search for examples on the internet, dig through the MySQL source code and ask on the forums and you may figure it all out. ?But doing all this is time consuming and could easily put someone off. So Sergei Golubchik and I have got together to bring you this book which will show you, using examples, how to write your own plugins.
We start by explaining the UDF API which has been around for a long time, and then move on to Daemon Plugins, Information Schema Plugins, Full-text Search Plugins and Storage Engine Plugins. ?Each with?usable?examples.
MySQL 5.1 Plugins Development has just been published by Packt Publishing and I believe it is well worth a look if you are thinking of extending MySQL.

MariaDB 5.1.49 for Mac OS X

Aug 27, 2010


Stuttgart: a rainy day, waiting for Iftar. Good time for good news!
During my vacation I read about a request for a MariaDB package for Mac OS X? and did some research. Back from vacation I have an alpha version of MariaDB package for Mac OS X for? our community to test.
Caution: this is the first installer I ever wrote on a Mac, so use it on a test system only!
I would like you to test the installer and provide us with feedback.
Known issues in the MariaDB installer:

The Preferences Pane app for starting/stopping the server instance is missing
The installer for setting up MariaDB as a Startup Item is missing.

Side node: while digging into the Mac installer I found two
bugs in the MySQL Mac OS X installer.

http://bugs.mysql.com/bug.php?id=56279

Mac installer does not work as documented

http://bugs.mysql.com/bug.php?id=56280

Mac installer’s postflight script does not work all the time

You can grab the package from here:

http://lisas.de/~hakan/file/mariadb-5.1.49-osx10.6-x86.pkg

Hudson and JUnit Kung Fu at JavaOne this year

Aug 24, 2010

This year, I’ll be giving two talks at JavaOne: one on Hudson and one on JUnit. Here are the rundowns:

S312977 – Getting More from Your CI Server: Taking Hudson to the Next Level

Hudson is an excellent open source, continuous integration server with a rich and rapidly evolving feature set. Targeted to developers, lead developers, and architects interested in implementing CI with Hudson or enhancing their existing CI setup, this session will focus on using Hudson’s more advanced features to go from Continuous Integration to Continuous Quality and Continuous Deployment. The session will focus on how Hudson can help with:

  • Enforcing code quality metrics
  • Build promotion strategies
  • Automated release and deployment
  • Web and performance testing
  • Distributed builds and CI in the cloud

 

S312958 – JUnit Kung Fu: Getting More Out of Your Unit Tests

JUnit is the de facto standard in Java testing. Yet many advanced JUnit features are little known and poorly understood. This session reviews some lesser-known features of JUnit, along with a few associated libraries, that can make your unit tests more powerful, expressive, and fun. The session is intended for Java developers, lead developers, and architects trying to introduce good testing practices into their teams. Attendees will learn about:

  • The fine art of naming your tests
  • Writing clearer and more expressive tests with Hamcrest and Mockito
  • Data-driven testing in JUnit with parameterized tests and theories
  • Using JUnit rules to extend your test cases and writing your own rules to customize JUnit
  • Using JUnit categories to group your tests
  • Getting faster feedback with parallel testing and continuous testing tools

I’m looking forward to catching up as well, so do give a yell if you intent to be at JavaOne this year.

And if you want to learn even more about JUnit, Hudson and lots of other cool tools, be sure to check out the Java Power Tools Bootcamps – scheduled soon for London and Canberra.

 

Ed Burnette: “I am not a villain,” says alleged Android Trojan creator

Aug 24, 2010

Max Lifshin, an Android developer living in Russia, says his Tap Snake program is not a Trojan or virus, despite a warning from security software maker Symantec last week. Lifshin has been vilified in the press for releasing the program, which was intended for parents to track their children?s whereabouts. Reached by ZDNet for comment, Lifshin insisted that his motivations were innocent:

The app is no more malicious than a motion detection camera – everything depends on the user?s intentions. It gives all the proper warnings and requires a set up, a conscious action, to report location. It can be easily used by mothers worrying about their kids? whereabouts. In fact, I suspect the majority of users were indeed the mothers.

For the program to work, the parent or guardian downloads and installs the innocuous looking game on their kid?s phone. During the installation process, Android asks for permission to access location information and to send and receive information to the Internet. After accepting these terms, the parent must open up a menu option and activate the tracking service with a unique key. Then they give the phone back to their child. From that point on, the game will occasionally upload its location to a server, where only somebody with the key can view it. Lifshin says:

The app is not really very different from Google?s Latitude. As any technology product, it can be put to either noble or malicious ends.

The game can be uninstalled at any time. The program run by the parent to view location information is called GPS Spy. The Market description for GPS Spy openly explained how all this works, saying:

Download and install the free Tap Snake game from the Market to the phone you want to spy on. Press MENU and register the Snake with the service. Use the GPS Spy app on your phone with the same email/code to track the location of the other phone.

However, the description of the Tap Snake game did not say anything about tracking, presumably so your child could look up the game for updates or reviews and be none the wiser. Until recently, Tap Snake was a free download and GPS Spy was $4.99. After the news came out, Google removed both apps from the Market. According to Lifshin,

What?s sad is that these ?whistle blowers? have prompted Google to suspend the app and thus deprived me of income. They unfairly classified this app as a Trojan and portrayed me as a villain, a malicious Russian developer working in the shadows.

What do you think: is this a dangerous Trojan or a useful safety device for parents? Was Google right to ban it? Speak up in the Talkback section below.

MySQL GIS ? Part 1

Aug 23, 2010

TweetIn my business (weather) we use lots map based (Geo) information.? Almost every table has latitude and longitude. Working with this kind of data can be exciting and frustrating.? This should give you a quick start into GIS with MySQL.
“A geographic information system (GIS), or geographical information system, is any system that captures, stores, analyzes, manages, and presents data that are linked to location. In the simplest terms, GIS is the merging of cartography, statistical analysis, and database technology. GIS systems are used in cartography, remote sensing, land surveying, utility management, natural resource management, photogrammetry, geography, urban planning, emergency management, navigation, and localized search engines.” – Wikipedia
GIS / Mapping Systems work with both text data and graphical data.? Applications and utilities often blur the lines between the two types and make understanding difficult.? Map servers blend raster images, with point or polygon data, and bitmap images to make complete images to display in the user’s client application.? For this post I will concentrate on the text type “data”.? The type we can index in a MySQL database.
THE SEARCH
After months of reading, [1]? I’m writing this post to describes what I have learned about how to get started using GEO coding data as quickly as possible.? I found very little piratical information on GIS and MySQL.? The MySQL manual covers the functions but doesn’t supply much practical information on GEO.? Anders Karlsson wrote a nice and short story about GIS that give me a good start.
The best information has be written by Florin Duroiu in his post titled “Political boundaries overlay in Google maps”. A good part of my post is based on his work.
STEP BY STEP
Below are the detailed needed to to produce a MySQL database with the Points of Interest (POI).? This is based on CentOS 5.5 with MySQL 5.1.
yum install gdal
mkdir geo
mkdir data
mkdir data/Oklahoma
cd geo/data/Oklahoma
wget http://downloads.cloudmade.com/north_america/united_states/oklahoma/oklahoma.shapefiles.zip
unzip oklahoma.shapefiles.zip
mysql -e ‘create database geo’
ogr2ogr -f “MySQL” MySQL:”geo,user=root,host=localhost,password=” -nln oklahoma_poi -lco engine=MYISAM oklahoma_poi.shp
mysql geo -e ‘desc oklahoma_poi’

+———-+————–+——+—–+———+—————-+
| Field | Type | Null | Key | Default | Extra |
+———-+————–+——+—–+———+—————-+
| OGR_FID | int(11) | NO | PRI | NULL | auto_increment |
| SHAPE | geometry | NO | MUL | NULL | |
| category | varchar(30) | YES | | NULL | |
| name | varchar(113) | YES | | NULL | |
+———-+————–+——+—–+———+—————-+

mysql geo -e “select name, category, Y(SHAPE) as lat, X(SHAPE) as lng from oklahoma_poi where NAME like ‘School:Putnam%’”

+————————————-+——————————–+————+————-+
| name | category | lat | lng |
+————————————-+——————————–+————+————-+
| School:Putnam City West High School | Government and Public Services | 35.492557 | -97.6605975 |
| School:Putnam City North School | Government and Public Services | 35.5892209 | -97.6372648 |
| School:Putnam City School | Government and Public Services | 35.5122794 | -97.6142079 |
| School:Putnam High School | Government and Public Services | 35.5214459 | -97.6086523 |
| School:Putnam Heights Academy | Government and Public Services | 35.5081143 | -97.5397619 |
+————————————-+——————————–+————+————-+

In a coming set of post I’ll go over:

The “Data” types your will find and how to convert between them.
What data is available and where can you find it?
More examples on what you can do with GIS data.
Viewing our GIS data.
How to collect your own GIS data.
Good and bad examples of searching GIS data.
Optimizing MySQL GIS.? Is it really worth using?

[1] Books: GIS for Dummies – Author: Michael N. DeMers – John Wiley & Sons?(2009) – ISBN: 0470236825
Open Source GIS: A GRASS GIS Approach. Third Edition.-? Author: Markus Neteler and Helena Mitasova – ISBN: 978-0-38735767-6
Web Mapping Illustrated: Using Open Source GIS Toolkits – Author: Tyler Mitchell – ISBN: 9780596008659
?

InnoDB memory allocation, ulimit, and OpenSUSE

Aug 23, 2010

I recently encountered an interesting case. A customer reported that mysqld crashed on start on OpenSUSE 11.2 kernel 2.6.31.12-0.2-desktop x86_64 ? with 96 GB RAM when the innodb_buffer_pool_size was set to anything more than 62 GB. I decided to try it with 76 GB. The error message was an assert due to a failed malloc() in ut_malloc_low() in ut/ut0mem.c inside InnoDB source code. InnoDB wraps the majority of its memory allocations in ut_malloc_low(), so to get an idea of the pattern of requested allocations I added a debugging fprintf() to tell me how much was being allocated and whether it was successful.
I discovered something interesting. I expected the allocation to fail on the 76 GB of the buffer pool, due to some weird memory mapping issue and a continuous block of 76 GB not being available. However, that is not what happened. 76 GB buffer was allocated successfully. What was failing is the allocation of 3.37GB after that. What in the world could InnoDB need that was 3.37 GB? There was nothing in the settings that asked for anything close to 3 GB explicitly.
Source code is the ultimate documentation, and I took advantage of that. My good friend GDB guided me to buf_pool_init() in buf/buf0buf.c. There I found the following:
buf_pool->frame_mem = os_mem_alloc_large(
UNIV_PAGE_SIZE * (n_frames + 1),
TRUE, FALSE);
That was the buffer pool itself, the 76 GB of it. And now the buffer pool’s friend:
buf_pool->blocks = ut_malloc(sizeof(buf_block_t) * max_size);
3.6 GB of it!
From the comments in the code (InnoDB code actually has very good comments), max_size is the maximum number of buffer pool pages (16K each), n_frames which is the same thing unless AWE is used, but it was not used, so I did not worry about it.
What shall we call that friend? It is used for storing some meta information about buffer pool pages. The most natural name I could come up with from reading the source code is the blocks array.
Thus we can see that we are allocating another chunk that is in proportion to the setting of innodb_buffer_pool_size for the blocks array. The exact proportions will probably vary from version to version, but roughly about 1 G for every 25 G of the buffer pool. This can become significant in the proper innodb_buffer_pool_size estimations when the system has a lot of RAM and you want to have the largest possible innodb_buffer_pool_size. Do not forget to give the blocks array some room!
While this was an interesting investigation, it nevertheless did not explain why there was not enough room for a 76 GB buffer pool. Even with the extra 3.37 GB allocation, there was still some free memory. Or was there? Maybe some hidden monster was eating it up? I quickly wrote this hack to prove or disprove the monster’s presence.
I verified that I could allocate and initialize two chunks of 40 GB from two separate processes, but not 80 GB from one. In fact, 80GB allocation failed right in malloc(), did not even get to initialization. I tested it with allocating 70 GB concurrently in each process so as to overrun physical memory + swap. Both allocations were successful, one initialized successfully, the other was killed by the OOM kill during initialization.
This smelled like a low ulimit, and sure enough it was. ulimit -m ulimited; ulimit -v unlimited did the magic, and mysqld successfully started with an 80 GB buffer pool. Apparenly OpenSUSE defaults are set in proportion to physical memory to keep the memory-hungry applications from taking the system down. On this particular system (96 GB physical memory, 2 GB swap it decided to set the virtual memory ulimit (-v) to 77.27 GB, and the physical memory (-m) to 80.40 GB).

Entry posted by sasha |
No comment
Add to: | | | |

Lowongan di Guyub – PHP Developer

Aug 09, 2010

Guyub -http://guyub.co.id membutuhkan segera PHP Developer untuk menjadi bagian dari tim pengembangan sebuah aplikasi berbasis web. Adapun detail persyaratanya adalah;

  • Berlokasi di Palembang dan sekitarnya.
  • Memiliki dasar logika dan pemrograman yang baik.
  • Mempunyai etos kerja & attitude yang baik.
  • Boleh memilih bekerja full atau part time.
  • Nilai lebih bagi yang terbiasa bekerja dengan Free/Open Source Software.
  • Nilai lebih bagi yang familiar dengan framework apa saja, web service, MySQL, dan jQuery.
  • Tidak ada prasyarat khusus mengenai pengalaman dan latar belakang pendidikan, akan tetapi semua kandidat siap langsung wawancara dan tes praktik.

Bagi yang berminat silahkan langsung kirimkan lamaran disertai CV/Resume ke subair[at]guyub.co.id, menggunakan judul “PHP Developer”, paling lambat tanggal 14 Agustus 2010.

Grizzly Deployer (1.9.19) new features

Aug 07, 2010

It has been a while since a blog about Grizzly, I was too busy adding new features. The Grizzly Deployer’s community grows and requested theses new features.

Here a quick list of the changes :

  • Websockets support
  • Watch folder
  • Can starts without applications to deploy
  • Can be embedded and extended easily
  • and few bug fixes (thanks to the community)

A little overview or remainder of what is Grizzly Deployer

Grizzly Deployer is a bundle of Grizzly project that act as a web container. It will allow you to deploy applications (war, servlet).
Works fine for Comet, Atmosphere, JSP applications … For more details, I suggest this link Introduction to the first release of Grizzly Deployer

First, lets take a look at the command line parameters.


Usage: com.sun.grizzly.http.servlet.deployer.GrizzlyWebServerDeployer

  -a, --application=[path]    Application(s) path(s).

                              Application(s) deployed can be :
                              Servlet(s), war(s) and expanded war folder(s).
                              To deploy multiple applications
                              use File.pathSeparator

                              Example : -a /app.war:/servlet/web.xml:/warfolder/

  -p, --port=[port]           Runs Servlet on the specified port.
                              Default: 8080

  -c, --context=[context]     Force the context for a servlet.
                              Only valid for servlet deployed using
                              -a [path]/[filename].xml

  --dontstart=[true/false]    Won't start the server.
                              You will need to call the start method.
                              Useful for Unit testing.
                              Default : false

  --libraryPath=[path]        Add a libraries folder to the classpath.
                              You can append multiple folders using
                              File.pathSeparator

                              Example : --libraryPath=/libs:/common_libs

  --autodeploy=[path]         AutoDeploy to each applications.
                              You could add JSP support.
                              Just add a web.xml that contains Jasper

                              Example : --autodeploy=/autodeploy

  --webdefault=[path]         webdefault to be used by all applications, can be file or dir with multipe web.xmls.
                              If you want to add only one webdefault point it to web.xml file,
                              If you want multiple files to be included put them in one dir and provide this location here.

                              Example : --webdefault=webdefault.xml

  --cometEnabled=[true/false] Starts the AsyncFilter for Comet.
                              You need to active this for comet applications.
                              Default : false

  --websocketsEnabled=[true/false] Starts the AsyncFilter for Websockets.
                              You need to active this for websockets applications.
                              Default : false

  --forceWar=[true/false]     Force war's deployment over a expanded folder.
                              Will deploy the war instead of the folder.
                              Default : false

  --ajpEnabled=[true/false]   Enable mod_jk.
                              Default : false

  --watchInterval=[seconds]   Watch interval to scan for new applications to deploy in work folder.
                              Default : -1 ; disabled

  --watchFolder=[path]        Folder to scan for new applications to deploy in work folder
                              Default : none

Websocket support

The first feature added was Websockets support. It can be enabled at command line by using the parameter –websocketEnabled=true . That will allow you to deploy Websocket applications.

Watch folder

This feature is interesting, because most of the web container have it. Grizzly Deployer will watch a specific folder to applications to deploy. When this feature was added, I remove the need to specify a application to deploy by command line.
To enable this feature you need to use the command line parameter –watchFolder=[path]. It can be used with this other parameter : –watchInterval=[seconds].

The parameter –watchInterval is used to create a watchdog that will monitor the watch folder. If the parameter –watchInterval is not present, when Grizzly Deployer starts, it will check
all applications that are in the watch folder at launch time and will deploy them, but it won’t monitor the folder after that.

When both of theses parameters are used, it will create a watchdog that will deploy and undeploy application put in the watch folder, and remove from that folder. If you deploy an application at command line and put another application with the
same context name in the watch folder, the application in the watch folder won’t be deploy twice.

Embedded Grizzly Deployer

Grizzly Deployer could already be embedded trough his API, but we got few feedback about to make it simplier. The problem wasn’t the API, it just that most people will only use the main part of Grizzly Deployer : deploy a war.

So to make it easier and faster to implement, I did a little refactoring. We now have 2 main config classes we could use to launch an Embedded Grizzly Deployer : DeployerServerConfiguration and DeployableConfiguration.

DeployerServerConfiguration

That file is used to launch Grizzly Deployer. It contains the same command line parameters. In fact, at runtime, the command line parser use that classe.


    GrizzlyWebServerDeployer deployer = new GrizzlyWebServerDeployer();

    DeployerServerConfiguration conf = new DeployerServerConfiguration();
    conf.cometEnabled = true;
    conf.watchFolder="C:/temp/webapps/";
    conf.watchInterval=15;
    deployer.launch(conf);

Once grizzly Deployer is launched in your application, you can deploy a war later. For that, you use this class : DeployableConfiguration.


    DeployableConfiguration warConfig = new DeployableConfiguration();
    warConfig.location = "C:/temp/webapps/grizzly-jmaki.war";

    deployer.deployApplication(warConfig);

You can follow me on Twitter.

Heiko Seeberger: How to setup a Scala project with SBT and IDEA

Aug 07, 2010

Today I helped my mate Bernd Kolb setting up a simple Scala project. He had been struggling far too long with various options like Maven, SBT, Eclipse and Intellij IDEA. If I remember correctly it only took a 30 minutes conf call to setup a simple Scala and Lift project with SBT and IDEA. But there are quite a few things to know in order to be successful which I am going to describe here in a step-by-step tutorial. I hope you find it useful. Please let me know any issues.

Why SBT and IDEA?

Why not Maven and Eclipse? Or Ant and Netbeans? Or …? First, we have to make a choice. Second, SBT and IDEA are currently the best build tool and the best IDE for Scala. SBT is written specifically for Scala and offers very fast compilation, interactive mode for continuous compilation, testing, etc., integration for Scala test tools like specs and ScalaTest, cross compiling against different Scala versions and many more. While the Scala IDE for Eclipse recently has made nice progress and the Netbeans plugin looks good, IDEA still offers the best Scala plugin with many features known from a Java IDE, e.g. refactroings, code completion, code navigation, etc.

Preparations

Java 5 or 6 is assumed. Get the SBT launcher and follow the instructions to set it up. Install IDEA 9.0.3 and use its plugin manager to install the Scala plugin. Here we go!

1. Create a SBT project

Create a folder for your project, cd there and run SBT. You will be asked the following questions. Answer like I did or chose different values (except for the Scala version).

Project does not exist, create new project? (y/N/s) y

Name: simple

Organization: localhost

Version [1.0]:

Scala version [2.7.7]: 2.8.0

sbt version [0.7.4]:

Now SBT will download Scala 2.7.7 as well as some other libraries for internal use. And it will download Scala 2.8.0 which is used to build your project.

As soon as the downloads are finished, you are in SBT’s interactive mode. At the prompt enter compile, then ~test (press enter to leave the triggered mode) and then help to make yourself familiar with the features.

Looking at your project in the file system, you will notice a layout similar to Maven: Scala sources go into src/main/scala, Scala tests go into src/test/scala and artifacts go into target. If your project looks different from the one at the right, you probably did not run compile or test. But as it is important to run your project against the same version as it was compiled against, there is a Scala_2.8.0 folder between the target and the classes, test-classes etc.

Update

Thanks to Comments from Bart and Mikko I looked into the sbt-idea-plugin which makes it possible to create the project files for IDEA from SBT. While it is still under active development and there are some minor issues, the current snapshot release 0.1 already produces usable IDEA project files. So you could just go for that plugin and skip the next two steps.

2. Create an IDEA project

Now you have to create an IDEA project on top of your SBT project.

Choose File > New Project …, select Create project from scratch and continue.

Then pick your project folder for Project files location and continue.

Then enter src/main/scala as path for the source directory and continue.

Now it is getting a little tricky!

Select Scala from the list of technologies.

Ignore the erroneous combo for the Version.

Choose Pick files from disk and select scala-compiler.jar and scala-library.jar form project/boot/scala-2.8.0/lib.

Then change the Name to scala-2.8.0 and click Finish.

3. Adjust IDEA project settings

Now you have make some adjustments to align SBT’s and IDEA’s project layout.

Choose Modules on the left and navigate to the Sources tab. Add src/main/resources to the Sources (blue) and src/test/scala and src/test/resources to the Test Sources (green). Exclude (red) .idea, lib, project/boot and target.

?

Next go to the Paths tab and select target/scala_2.8.0/classes for the Output path and target/scala_2.8.0/test-classes for the Test output path.

?

Then choose the Scala facet from the mid column (below the one and only module simple) and unchek Use Scala compilers ….

That’s it! Now you are ready to go.

4. Give it a try

In IDEA go to the src/main/scala folder and choose New > Scala Class from the context menu. Call it Hello and make it an Object.

In the editor delete the package statement and enter the following code:

object Hello {

??def main(args: Array[String]) {

????println(“Hello!”)

??}

}

From the context menu choose Run Hello.main(). IDEA will build your project and then run this object.

After that go to SBT and enter ~run. Watch the output and look for the Hello! message. Then change the message in the code, e.g. to Hello, world!. As you have told SBT to use triggered run by prefixing whith the tilda, your project will be incrementally built and the Hello object run again: Watch the output.

Have fun with Scala, SBT and IDEA!