Skip to content

Instantly share code, notes, and snippets.

View simonwh's full-sized avatar

Simon Westh Henriksen simonwh

  • Copenhagen, Denmark
  • 13:36 (UTC +02:00)
View GitHub Profile
App failed to start
/disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler/runtime.rb:138:in `initialize': Read-only file system - /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/environment.rb - Heroku has a read-only filesystem. See http://docs.heroku.com/constraints#read-only-filesystem (Errno::EROFS)
from /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler/runtime.rb:138:in `open'
from /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler/runtime.rb:138:in `write_rb_lock'
from /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler/runtime.rb:10:in `initialize'
from /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler.rb:77:in `new'
from /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler.rb:77:in `load'
from /disk1/home/slugs/145271_cde30b7_5ec6/mnt/.bundle/gems/gems/bundler-0.9.11/lib/bundler.rb:6
var search = Titanium.UI.createSearchBar({});
var tableView = Titanium.UI.createTableView({
data:data,
search:search,
filterAttribute:'title',
autoHideSearch:false
});
Titanium.UI.currentWindow.add(tableView);
var search = Titanium.UI.createSearchBar({
barColor:'#000',
showCancel:true,
height:43,
top:0
});
var tableView = Titanium.UI.createTableView({
top:40,
data:{title:'Please perform a search'}
% Scriptet SUPER simulerer køsystemet i et supermarked.
%
% Tidsintervallet mellem to kundeankomster,
% tiden for et indkøb (dvs. kundens indsamling af varer) og
% tiden for en kundeekspedition antages alle at være
% gamma(alfa,beta)-fordelte, men med forskellige alfa- og beta-parametre.
clear all;
% Vi definerer først nogle konstanter
%
@simonwh
simonwh / gist:950851
Created May 1, 2011 20:38
Dijkstra search
package graph;
import java.util.*;
import GUI.GUIGraph;
public class DijkstraSearch {
static final HashMap<KrakNode, Double> dist = new HashMap<KrakNode, Double>();
static final HashMap<KrakNode, KrakNode> previous = new HashMap<KrakNode, KrakNode>();
@simonwh
simonwh / gist:950852
Created May 1, 2011 20:39
Dijkstra search with heuristics (A*)
package graph;
import java.util.*;
import GUI.GUIGraph;
public class DijkstraSearchHeuristics {
static final HashMap<KrakNode, Double> dist = new HashMap<KrakNode, Double>();
static final HashMap<KrakNode, KrakNode> previous = new HashMap<KrakNode, KrakNode>();
static final HashSet<KrakNode> hasVisited = new HashSet<KrakNode>();
private int[,] PossibleMoves(int x, int y)
{
return new int[,] { {x + 2, y + 1},
{x + 2, y - 1},
{x - 2, y + 1},
{x - 2, y - 1},
{x + 1, y + 2},
{x + 1, y - 2},
{x - 1, y + 2},
{x - 1, y - 2},
@simonwh
simonwh / AsyncSocketsClient.cs
Created December 7, 2011 16:58
Async sockets
namespace Descent.Messaging.AsyncSockets
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Text;
public delegate void MessageReceivedHandler(ClientInfo clientInfo, string message);
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <semaphore.h>
#include "list.h"
List *fifo;
int pro_count;
int con_count;
#include<stdio.h>
#include<stdlib.h>
#include <sys/time.h>
#include <pthread.h>
typedef struct state {
int *resource;
int *available;
int **max;
int **allocation;