Posts

Showing posts from April, 2011

Add JRebel to SBT

This allows for continuous reloading when doing Lift development Download JRebel (jar installer) http://www.zeroturnaround.com/jrebel/current/ Get free JRebel license for Scala Developers http://sales.zeroturnaround.com/ 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 ( http://lifty.github.com/) 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 http://liftweb.net/ Lift Book http://simply.liftweb.net/index.html code samples: https://github.com/dpp/simply_lift

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) http://www.jetbrains.com/idea/download Download Scala http://www.scala-lang.org/downloads (2.8.1 installer) Download SBT http://code.google.com/p/simple-build-tool/ (0.7.5) Setup   Setup SBT according to this page (Launching Sbt section) http://code.google.com/p/simple-build-tool/wiki/Setup 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 http://www.sqlite.org/download.html Download ADO.Net provider for SQLite http://sourceforge.net/projects/sqlite-dotnet2/ . The Project page is here http://sqlite.phxsoftware.com/ Download SQLite GUI client. This is a very basic one. wxSQLite http://cfred.free.fr/download.php#wxsqliteplus 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