Showing posts from April, 2011

Add JRebel to SBT

This allows for continuous reloading when doing Lift developmentDownload JRebel (jar installer) free JRebel license for Scala Developers installation add this to your sbt batch and VM parameters in IntelliJ IDEA (File/Settings/SBT)set SCRIPT_DIR=%~dp0 java -Dhttp.proxyHost=<proxy-server> -Dhttp.proxyPort=<proxy-port> -Xmx512M -Drebel.license=<path-to-jrebel>/javarebel.lic -noverify -javaagent:<path-to-jrebel>/jrebel.jar -jar "%SCRIPT_DIR%sbt-launch-0.7.5.jar" %*From sbt console run 
> ~prepare-webapp

Setup Lift (Scala web framework)

Create new folder 'LiftProject' Run sbt command from that folder, choose 'y' to create new project (Name: LiftProject, Organization: test) Configure Lifty ( Lift SBT processor - you only need to do it once From sbt prompt run the following (including * character)
  > *lifty is org.lifty lifty 1.6.1 
  > update Create new Lift project (when asked you can specify version 2.3 instead of 2.3-RC3)
  > lifty create project-blank Create idea project files 
> idea Refresh everything 
> reload
> update
> compile Run Jetty webserver
> ~jetty-run Open http://localhost:8080 and you should see your lift webpage More info about Lift Book
code samples:

How to configure git http proxy

git config --global http.proxy {servername}:{portnumber}

Setup Scala with SBT in IntelliJ IDEA

Download DependenciesDownload IntelliJ IDEA Community Edition (10.0.3) Scala (2.8.1 installer) Download SBT (0.7.5) SetupSetup SBT according to this page (Launching Sbt section) Scala/SBT plugins to IntelliJ IDEA Go to File/Settings/Plugins, choose Available tab, right click on Scala plugin and click on 'Download and Install'. Do the same for SBT plugin. Restart IntelliJ IDEA Go to File/Settings/SBT and set location of your SBT jar file and if you're on windows behind firewall add proxy info to vm params (-Dhttp.proxyHost=<proxy_server> -Dhttp.proxyPort=<proxy_port>) Create ProjectCreate new Folder ScalaProject Run sbt command from that folder, choose 'y' to create new project (Name: ScalaProject, Organization: test)  Configure sbt-idea plugin (htt…

C# SQLite Example

Download Precompiled Binaries for Windows from ADO.Net provider for SQLite The Project page is here SQLite GUI client. This is a very basic one. wxSQLite new SQLite database using wxSQLite or command line c:\temp\contacts.dbIn Your C# ProjectAdd References to System.Data.SQLiteAdd sqlite3.dll (as link) to your project and set Copy to Output Directory property to Copy if newerC# Test to create table and read some data.[TestFixture] publicclass TestSqlLite { #region sql privatestring createSql = @"DROP TABLE IF EXISTS Contacts; CREATE TABLE Contacts( FirstName TEXT, LastName TEXT ); INSERT INTO Contacts SELECT 'Michael','Jordan' UNION SELECT 'Scottie','Pippen' ; "; privatestring selectSql = @"SELECT * FROM Contacts"; #endregion [Test] publicv…