Skip to content

Instantly share code, notes, and snippets.

View bluescreen303's full-sized avatar

Mathijs Kwik bluescreen303

  • Uithoorn, Netherlands
View GitHub Profile
starting server
opts: StartupConfig {connectionMode = TCPIP False 4005, autoPort = False, showHelp = False}
=== Listening on port: 4005
==> {"id":1,"method":"connection-info","params":{}}
<== {"version":"0.1","id":1,"result":{"version":1,"pid":0}}
==> {"id":2,"method":"list-cabal-components","params":{"cabal-file":"/home/mathijs/workspace/json/json.cabal"}}
<== {"version":"0.1","id":2,"result":[{"library":null,"cabal-file":"/home/mathijs/workspace/json/json.cabal"}]}
==> {"id":3,"method":"load","params":{"component":{"library":null,"cabal-file":"/home/mathijs/workspace/json/json.cabal"},"output":false}}
Configuring json-0.1...
Creating .dist-scion (and its parents)
diff --git a/build.xml b/build.xml
index 8979d97..87ac1d6 100644
--- a/build.xml
+++ b/build.xml
@@ -211,17 +211,26 @@
<jar destfile="${jar.outfile-server}">
<fileset dir="${staging}">
<include name="META-INF/services/*" />
+ <include name="builtin/**/*" />
+ <include name="com/dutchcoastsoftware/tsunami/**/*" />
import System.TimeIt
import System.Random
import Control.Parallel.Strategies (NFData(..))
import Control.Exception (evaluate)
rpartition :: (a -> Bool) -> [a] -> ([a], [a])
rpartition p = go [] []
where
go ts fs [] = (ts, fs)
go ts fs (x:xs) | p x = go (x:ts) fs xs
import System.TimeIt
import System.Random
import Control.Parallel.Strategies (NFData(..))
import Control.Exception (evaluate)
-- rpartition :: (a -> Bool) -> [a] -> ([a], [a])
-- rpartition p = go [] []
-- where
-- go ts fs [] = (ts, fs)
-- go ts fs (x:xs) | p x = go (x:ts) fs xs
module Imports
import com.dutchcoastsoftware.tsunami.server.ClientFrontend
import com.dutchcoastsoftware.tsunami.server.ClientFrontendImpl
import org.waveprotocol.wave.examples.fedone.waveserver.WaveletListener
import org.waveprotocol.wave.examples.fedone.waveserver.WaveletProvider
import org.waveprotocol.wave.model.id.WaveId
import org.waveprotocol.wave.model.id.WaveletName
import org.waveprotocol.wave.model.wave.ParticipantId
Common = org.waveprotocol.wave.protocol.common
end
ruby_thing.rb:
require 'jruby/core_ext'
puts "hello from ruby"
class RubyThing
include org.test.RubyInit::RubyThingInterface
def setJt(java_thing)
puts "setJt"
module Main where
partEither list = helper list ([],[])
where
helper [] (l,r) = (reverse l,reverse r)
helper ((Left a):xs) (l,r) = helper xs (a:l,r)
helper ((Right b):xs) (l,r) = helper xs (l,b:r)
test = iterate (\(Left x) -> Left (x+1)) (Left 0)
{-# LANGUAGE OverloadedStrings #-}
import Database.MongoDB
import Data.UString (u)
import Control.Monad.Trans (liftIO)
main = do
ee <- runNet $ do
conn <- connect (host "127.0.0.1")
runConn run conn
module Main where
import Control.Distributed.STM.DSTM
import System.Environment (getArgs)
main = startDist goTasks
goTasks = do
(arg:_) ← getArgs
let n = read arg
module Main where
import Control.Distributed.STM.DSTM
import System.Environment (getArgs)
main = startDist goTasks
goTasks = do
(arg:_) <- getArgs
let n = read arg