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
void DWT::transform1d(float *src, int length, int step) | |
{ | |
float *tmp = new float[length]; | |
float W = 1/sqrt(2.0f); | |
for (int len = length/2; len >= PREVIEW; len /= 2) { | |
for (int i = 0; i < len; i++) { | |
float c = src[i*2*step]; | |
float w = src[(i*2+1)*step]; | |
tmp[i] = (c+w)*W; | |
tmp[i+len] = (c-w)*W; |
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
/** | |
* Builds a new sudoku instance given a difficulty level | |
* | |
* @param level describes the difficulty level of the generated game | |
* - 1 normal | |
* - 2 medium | |
* - 3 hard | |
*/ | |
def makeSudoku(level: Int): Sudoku = { | |
var board = new Array[Array[Int]](9, 9) |
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; | |
namespace Stack | |
{ | |
public class StackEmpty : Exception { } | |
public class Stack | |
{ | |
private object[] arr; |
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.Diagnostics.Contracts; | |
namespace Stack | |
{ | |
public class StackEmpty : Exception { } | |
public class Stack | |
{ | |
private object[] arr; |
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
@invariant(lambda self: self.value >= 0) | |
class PositiveInt(object): | |
@post(lambda self: self.num_changes == 0 and self.value == 0) | |
def __init__(self): | |
self.value = 0 | |
self.num_changes = 0 | |
@post(lambda new, old: new.num_changes == old.num_changes + 1) | |
def add(self, x): | |
self.value += x |
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
#include "hg_adv.h" | |
#define ADV_DEBUG 0 | |
VgHashTable write_buffers_8; | |
VgHashTable write_buffers_16; | |
VgHashTable write_buffers_32; | |
VgHashTable write_buffers_64; | |
typedef struct _AddrWBNode { |
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
%% instance | |
place(1). | |
place(2). | |
place(3). | |
place(4). | |
transition(1). | |
transition(2). | |
t_pre(1,1). | |
t_post(1,2). |
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
from copy import deepcopy | |
from pprint import pprint | |
board = [ | |
[-1,-1, 1, 1, 1,-1,-1], | |
[-1,-1, 1, 1, 1,-1,-1], | |
[ 1, 1, 1, 1, 1, 1, 1], | |
[ 1, 1, 1, 0, 1, 1, 1], | |
[ 1, 1, 1, 1, 1, 1, 1], | |
[-1,-1, 1, 1, 1,-1,-1], |
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
*** Date: Thursday, December 6, 2012 12:29:19 PM Central European Time | |
*** Platform Details: | |
*** System properties: | |
applicationXMI=org.eclipse.ui.workbench/LegacyIDE.e4xmi | |
awt.nativeDoubleBuffering=true | |
awt.toolkit=apple.awt.CToolkit | |
eclipse.application=org.eclipse.ui.ide.workbench | |
eclipse.buildId=M20120914-1800 |
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
*** Date: Friday, December 7, 2012 10:25:15 AM Central European Time | |
*** Platform Details: | |
*** System properties: | |
awt.nativeDoubleBuffering=true | |
awt.toolkit=apple.awt.CToolkit | |
eclipse.application=org.eclipse.ui.ide.workbench | |
eclipse.buildId=M20120208-0800 | |
eclipse.commands=-os |
OlderNewer