This file contains 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 main | |
import ( | |
"fmt" | |
"sort" | |
) | |
// Item has a priority and an order | |
type Item struct { | |
Prio int |
This file contains 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 main | |
import ( | |
"fmt" | |
"math/big" | |
) | |
func main() { | |
for i := 1; i <= 10; i++ { |
This file contains 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
module Main where | |
main = do | |
print $ map fibN' [1..10] | |
print $ fibN' 1001 | |
print $ length $ show $ fibN' 500000 | |
fibN' 1 = 0 | |
fibN' 2 = 1 | |
fibN' n = iter 0 1 n where |
This file contains 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
module Main where | |
import Text.Printf | |
main = do | |
input <- getContents | |
printf "%8d%8d%8d\n" | |
(length (lines input)) | |
(length (words input)) | |
(length input) |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Newtonsoft.Json; | |
namespace DownCaster | |
{ | |
static class Program | |
{ | |
static void Main() |
This file contains 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 main | |
import ( | |
"bufio" | |
"fmt" | |
"math/rand" | |
"os" | |
"strconv" | |
"time" | |
) |
This file contains 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
<!DOCTYPE html> | |
<!-- by calle@stenhall.com --> | |
<html> | |
<head> | |
<title>TITLE</title> | |
<style> | |
@import url("reset.css"); | |
@import url("style.css"); | |
</style> | |
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> |
This file contains 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
// Filter File | |
// a simple script for extracting parts in a textfile between two lines. | |
// by Calle Robertsson, calle@upset.se, 2013. | |
var fs = require('fs'); | |
var filename = process.argv[2]; | |
if (!filename) { | |
throw new Error('Missing command line argument for file name.'); |
This file contains 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
// The javascript compare objects function | |
function compareObjects(o1, o2, ignoreFields){ | |
ignoreFields = ignoreFields || []; | |
//console.log('Ignore: ' + JSON.stringify(ignoreFields)); | |
for(var p in o1) { | |
if (ignoreFields.indexOf(p) < 0) { | |
if(o1[p] !== o2[p]){ | |
return false; | |
} | |
} |
This file contains 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 main | |
import ( | |
"flag" | |
"fmt" | |
"io/ioutil" | |
"net/http" | |
"net/url" | |
"os" | |
"strconv" |
NewerOlder