Showing posts from April, 2011

Add JRebel to SBT

This allows for continuous reloading when doing Lift development Download JRebel (jar installer) Get free JRebel license for Scala Developers After 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 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 Dependencies Download IntelliJ IDEA Community Edition (10.0.3) Download Scala (2.8.1 installer) Download SBT (0.7.5) Setup   Setup SBT according to this page (Launching Sbt section) Add 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 Project Create new Folder ScalaProject Run sbt command from that folder, choose 'y' to create new pr

C# SQLite Example

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