Setup - simple-build-tool - A build tool for Scala Trying SBT (Simple Build Tool) for compiling a simple (one file, perhaps two) Scala application with some dependencies (Apache Pivot) on Windows as specifying all the jars on the command line quickly becomes annoying... (I try to convert the tutorial files to Scala). Following the instructions here I have put the jar file in C:\Java\scala-2.8.0.final\misc and the sbt.cmd file in C:\Java\scala-2.8.0.final\bin Content of the latter: @echo offjava -Xmx512M -jar C:\Java\scala-2.8.0.final\misc\sbt-launch-0.7.4.jar %* As shown above, I use the current version, 0.7.4, supposed to support Scala 2.8. Project does not exist, create new project? Trying what is suggested, I answer s for a simple "hello world" setup (Quick Setup), perfect for my simple need (precisely a HelloScala? So I find the LocalScala page. Do I have to read the whole wiki before starting to experiment? So I look at BuildConfiguration and have a hint: I have to create a .scala file in the project/build directory.
Brushing Up on Computer Science Part 4, Algorithms » Victus Spiritus “An algorithm must be seen to be believed.”Donald Knuth How we ended up here It all began a few days ago with an email from a friend (thanks Denny). I was inspired to dust off my software engineering cap, and review a few choice topics in computer science. What better way to study than to write up a blog post sampling the materials of interest. The table of contents for this blog series: Algorithms In short, an algorithm is a recipe. A formula or set of steps for solving a particular problem. Understanding Strategies beats Memorizing Tactics Algorithms are well specified techniques for performing an unbounded variety of tasks (good luck learning all algorithms). There are broad patterns common to vastly separated problem spaces. A couple of the most famous divide and conquer techniques are the FFT and MapReduce (slides, web article). I first came across map reduce while reading a set of slides by Jeff Dean, Designs, Lessons and Advice from Building Large Distributed Systems. Quicksort
About "ScalaBison" by John Boyland and Daniel Spiewak Abstract ScalaBison is a parser generator accepting bison syntax and generating a parser in Scala. The generated parser uses the idea of ``recursive ascent-descent parsing,'' that is, directly encoded generalized left-corner parsing. Of interest is that fact that the parser is generated from the LALR(1) tables created by bison, thus enabling extensions such as precedence to be handled implicitly. BibTeX Style Reference How to Get a Copy The article is available from ScienceDirect (Elsevier). Last Modified: January 7, 2012
Java EE 6 and Scala » Source Allies Blog Last weekend while pondering the question “Is Scala ready for the enterprise?” I decided to write a simple Java EE 6 app entirely in Scala, without using any Java. I had three main reasons for doing this: one was just to see how easy/difficult it would be to write everything in Scala (it was easy). Another was to document the process for others journeying down the same road (the entire project is on github). Finally, I wanted to identify advantages of using Scala instead of Java that are specific to Java EE apps (I found several). Background The specific app I created was an adaptation of the Books example from Chapter 10 of Beginning Java™ EE 6 Platform with GlassFish™ 3. Results As a baseline, I first created the example from the Book using Java (and put it on github). Next I rewrote the Java parts in Scala (and put it on github). First up, here’s Book.java: The Java version has 58 lines of completely useless getters & setters. Now let’s look at the Book entity in Scala: Conclusion
Software Updates: Courgette The source code does not have this problem because all the entities in the source are symbolic. Functions don't get committed to a specific address until very late in the compilation process, during assembly or linking. If we could step backwards a little and make the internal pointers symbolic again, could we get smaller updates? Courgette uses a primitive disassembler to find the internal pointers. The non-pointer part is about 80% of the size of the original program, and because it does not have any pointers mixed in, it tends to be well behaved, having a diff size that is in line with the changes in the source code. We bring the pointers under control by introducing 'labels' for the addresses. How do we use this to generate a better diff? server: diff = bsdiff(original, update) transmit diff client: receive diff update = bspatch(original, diff) (The server would pre-compute diff so that it could be transmitted immediately) server: asm_old = disassemble(original) asm_new = disassemble(update)
The Feel Of Scala scala « Mundo Funcional Pattern Matching y Case classes en scala Scala viene con el combinado de un soporte a pattern matching y a case clasess que ofrece una alternative muy flexible a la hora de establecer logicas basadas en opciones. En este post voy a tratar de hacer un pequeño resumen de estas características y su comparación con mecanismos anteriores en C/C++ y Java Para aquellos que venimos de C/C++ y Java estamos familiarizados con el bloque switch. Repasemos un poco, supongamos que temos el siguiente ejemplo: El valor del error medir el una corrientes electrica (mA) varía dependiendo del tipo de aparato que se use. Error aparato Analógico tiene un error relativo de 0.2 % de la medición Error aparato Digital tiene un error absoluto de 10 mA En este contexto tenemos una función: errorAbsoluto (in tipo: TipoAparato, in valor: Double) : Double que nos determina el error absoluto de una medición dependiendo del tipo de aparato. Su implementación en C/C++ podría ser algo asi: Pattern matching [2] Hasta la proxima!
Donut math: how donut.c works -- a1k0n There has been a sudden resurgence of interest in my "donut" code from 2006, and I’ve had a couple requests to explain this one. It’s been five years now, so it’s not exactly fresh in my memory, so I will reconstruct it from scratch, in great detail, and hopefully get approximately the same result. This is the code and the output, animated in Javascript: At its core, it’s a framebuffer and a Z-buffer into which I render pixels. So how do we do that? To render a 3D object onto a 2D screen, we project each point (x,y,z) in 3D-space onto a plane located z’ units away from the viewer, so that the corresponding 2D position is (x’,y’). \begin{aligned} \frac{y'}{z'} &= \frac{y}{z} \\ y' &= \frac{y z'}{z}. So to project a 3D coordinate to 2D, we scale a coordinate by the screen distance z’. . and use that when depth buffering because: Now, how do we draw a donut, AKA torus? So we have a circle of radius R1 centered at point (R2,0,0), drawn on the xy-plane. ) and reuse them in the code. .
Is Scala or Clojure poised for stardom? Is Scala, which was designed only a short while ago (comparatively speaking, that is) poised for stardom? Or will Clojure achieve greatness instead? There are a number of complementary aspects that seem to indicate for the time being that Scala might; however, what remains to be seen is if Scala can stand above recent newcomer Clojure. Both languages often show up together, especially when the topic of conversation is concurrency; nevertheless, each language is distinctly different. What’s interesting is how each language is starting to show up in various hip places. First, a recent CIO.com article entitled “6 Scripting Languages Your Developers Wish You’d Let Them Use” listed both Scala and Clojure. Scala might have a slight edge on Clojure when it comes to articles, however. What’s interesting is that both languages lack a killer application– yet, they are already on the map. . a worldwide shortage of people experienced in parallel computing Is Scala or Clojure poised for stardom?
10 Scala One Liners to Impress Your Friends | solog Register These Currently Available Domains Today Search for your ideal .CO Web Address Get it now before it's gone! Close Notify me when the auction is scheduled for Thank you for inquiring about this premium domain. I'm sorry, but an error occurred. Recently Sold .CO Domains breckenridge.co | $8,499 mesothelioma.co | $76,000 3dtv.co | $5,200 spark.co | $5,050 mojo.co | $5,100 allergy.co | $16,286 fairfield.co | $7,210 paydayloan.co | $6,425 sneakers.co | $6,300 vail.co | $15,500 plumber.co | $5,900 bankers.co | $10,100 bombay.co | $5,010 swingers.co | $5,700 termlifeins.co | $12,000 What is .CO ? .CO is the new web address that gives you a truly global, recognizable, and credible option for branding your online presence.
Dijkstra's algorithm The algorithm exists in many variants; Dijkstra's original variant found the shortest path between two nodes,[3] but a more common variant fixes a single node as the "source" node and finds shortest paths from the source to all other nodes in the graph, producing a shortest-path tree. For a given source node in the graph, the algorithm finds the shortest path between that node and every other.[4]:196–206 It can also be used for finding the shortest paths from a single node to a single destination node by stopping the algorithm once the shortest path to the destination node has been determined. For example, if the nodes of the graph represent cities and edge path costs represent driving distances between pairs of cities connected by a direct road, Dijkstra's algorithm can be used to find the shortest route between one city and all other cities. Dijkstra's original algorithm does not use a min-priority queue and runs in time (where is the number of nodes). History[edit] Algorithm[edit] is and
Author Interview There are several good looking Scala books on their way to market. I'd like to help you get an early look at the books and their authors, so I'm working on a series of Scala author interviews for the FP side of On Ruby. Here's the second of several interviews. Programming Scala authors Dean Wampler (@deanwampler) and Alex Payne (@al3x) have been good enough to answer several questions for me in this interview. Functional Programming languages seem to be an increasingly popular topic. Why? Alex FP forces you to think differently about solving problems in code, and in a highly structured way. Dean It seems that every "paradigm" that goes mainstream lurks in the background until some "killer app" comes along for which the paradigm seems tailor made. FP is a promising approach for concurrent programming because in pure FP, variables are immutable and functions have no side effects. Another hallmark of FP is that functions are side-effect free — they don't change any global or object state.