This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cusin | |
import xmlcusin.bo._ | |
import scalaxb.DataRecord | |
import scalax.io._ | |
import Resource._ | |
import java.util.concurrent.TimeUnit | |
import akka.actor.Actor.actorOf | |
import akka.actor.Actor | |
import akka.actor.ActorRef |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cusin | |
import scalax.io._ | |
import Resource._ | |
import FileWriterBackend.xmlParserService | |
import FileWriterBackend.ParseLineRequest | |
import akka.actor.PoisonPill | |
object App { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Start microkernel from your IDE. | |
Main: akka.kernel.Main | |
VM args: -Xms256m -Xmx1024m -Dakka.home=./kernel -Dlogback.configurationFile=src/main/resources/logback.xml | |
In kernel directory I have a symlink config -> ../src/main/resources | |
In the kernel directory I also have an empty deploy directory. Not used, but must be there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Active status subscribers | |
-- Exposes Effective_Date as a pushdown predicate, use this to get only one possible value | |
REPLACE VIEW Subscriber_Snapshot AS | |
SELECT Cal.Calendar_Date AS Effective_Date | |
, Sub.Subscriber_Id | |
, SSN.Status_Code | |
FROM Sys_Calendar.Calendar Cal | |
CROSS JOIN Subscriber Sub | |
INNER JOIN Sub_Status_History SSH | |
ON Sub.Subscriber_ID = SSN.Subscriber_Id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git svn clone http://example.googlecode.com/svn -s | |
git remote add origin [email protected]:example/example.git | |
git push origin master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE seqtest(seqval INT); | |
INSERT INTO seqtest( 3); | |
INSERT INTO seqtest( 4); | |
INSERT INTO seqtest( 5); | |
INSERT INTO seqtest( 8); | |
INSERT INTO seqtest( 9); | |
INSERT INTO seqtest(11); | |
INSERT INTO seqtest(18); | |
INSERT INTO seqtest(19); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collection.GenMap | |
import scala.math | |
/** | |
* Created by IntelliJ IDEA. | |
* User: orjan | |
* Date: 2012-03-24 | |
* Time: 15:15 | |
* To change this template use File | Settings | File Templates. | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function luhn(cardnumber) { | |
// Build an array with the digits in the card number | |
var getdigits = /\d/g; | |
var digits = []; | |
while (match = getdigits.exec(cardnumber)) { | |
digits.push(parseInt(match[0], 10)); | |
} | |
// Run the Luhn algorithm on the array | |
var sum = 0; | |
var alt = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> List(3,4,5,8,9,10,12).sliding(2).collect{ case Seq(x, y) if(y != x + 1) => (x,y) } | |
res39: Iterator[(Int, Int)] = non-empty iterator | |
scala> .foreach(println(_) ) | |
(5,8) | |
(10,12) | |
scala> def findGaps[T <: Int](xs:List[T]) = xs.sliding(2).collect{ case Seq(x, y) if(y != x + 1) => (x,y) } | |
findGaps: [T <: Int](xs: List[T])Iterator[(T, T)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
calendar_date birth_date, | |
current_date - birth_date Diff_Days, | |
CASE WHEN Diff_Days >= 0 THEN (Diff_Days)/7 | |
ELSE (Diff_Days +1) / 7 - 1 END | |
FROM sys_calendar.calendar | |
ORDER BY 1 |