Skip to content

Instantly share code, notes, and snippets.

var spawn = require('child_process').spawn,
ls = spawn('pcsc_scan', []);
var util = require('util');
var atrfound = false;
console.log("pcsc_scan should be running now");
ls.stdout.on('data', function (data) {
//console.log('stdout: ' + data);
var data = data.toString();
data = data.replace(/\u001b\[\d{0,2}m/g, ''); // Remove ANSI colors.
@flexd
flexd / index.html
Created June 29, 2012 19:10
Its semi-working!
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.v2.js"></script>
<script type="text/javascript">
// Initialize the node storage variables.
glVertexAttribPointer (s->attribLocation("a_position"), 2, GL_FLOAT, GL_FALSE, sizeof(vertex2f), 0);
glEnableVertexAttribArray (s->attribLocation("a_position"));
glVertexAttribPointer (s->attribLocation("aTextureCoord"), 2, GL_FLOAT, GL_FALSE, sizeof(vertex2f), (void *) (2 * sizeof (float)));
glEnableVertexAttribArray (s->attribLocation("aTextureCoord"));
glVertexAttribPointer (s->attribLocation("aColor"), 4, GL_FLOAT, GL_FALSE, sizeof(vertex2f), (void *) (4 * sizeof (float)));
glEnableVertexAttribArray (s->attribLocation("aColor"));
// Pass in the position information
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mCubeBufferIdx);
GLES20.glEnableVertexAttribArray(mPositionHandle);
mGlEs20.glVertexAttribPointer(mPositionHandle, POSITION_DATA_SIZE,
GLES20.GL_FLOAT, false, stride, 0);
// Pass in the normal information
GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, mCubeBufferIdx);
GLES20.glEnableVertexAttribArray(mNormalHandle);
mGlEs20.glVertexAttribPointer(mNormalHandle, NORMAL_DATA_SIZE,
public void initGL() {
//2D Initialization
/*glClearColor(0.0f,0.0f,0.0f,0.0f);
glDisable(GL_DEPTH_TEST);
glDisable(GL_LIGHTING);*/
//glEnable(GL_TEXTURE_2D);
font = new TrueTypeFont(awtFont, false);
glMatrixMode(GL_PROJECTION);
// top left
glTexCoord2f(tileX * tileWidth / ftexWidth, tileY * tileHeight / ftexHeight);
glVertex2i(x, y);
// top right
glTexCoord2f((tileX + 1) * tileWidth / ftexWidth, tileY * tileHeight / ftexHeight);
glVertex2i(x + tileWidth, y);
// bottom right
glTexCoord2f((tileX + 1) * tileWidth / ftexWidth, (tileY + 1) * tileHeight / ftexHeight);
@Override
public void draw() {
this.sprite.getTexture().bind();
int tileSize = ScrollGame.tManager.sheets.get(0).getTileSize();
double row = this.sprite.getsY();
double col = this.sprite.getsX();
double v0 = tileSize * row * (1/this.height);
double v1 = tileSize * (row + 1) * (1/this.height);
/*
*/
package org.cognitive;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.newdawn.slick.opengl.Texture;
<html>
<head></head>
<body>
<h1>Meny</h1>
<a href="listansatte.php">List ansatte</a>
<p>
<a href="avdskjema.html">Legg til avdeling</a>
</body>
</html
<?php
mysql_connect("localhost","kristoffer","dbpass") or die("Kan ikke koble til server");
mysql_select_db("kristoffer")or die("Kan ikke koble til databasen");
$deptno=trim($_POST ["DEPTNO"]);
$dname=trim($_POST ["DNAME"]);
$loc=trim($_POST ["LOC"]);
$sql="INSERT INTO DEPT (DEPTNO, DNAME, LOC) VALUES ('$deptno','$dname','$loc')";
$resultat=mysql_query($sql);
header("Location:meny.html");