Skip to content

Instantly share code, notes, and snippets.

@d8ta
d8ta / 9_MyIntArray_expand.cs
Last active August 29, 2015 13:57
Methoden Remove() und RemoveAT() fehlen noch
// (d) void RemoveAt(int index)
public void RemoveAt(int index)
{
int counter = 0;
numbers [index] = 0;
counter++;
if (counter >= 1) {
for (int i = index; i < numbers.Length-1; i++) {
numbers [i] = numbers [i + 1];
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Post</title>
<link type="text/css" rel="stylesheet" href="stylesheet.css" />
</head>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Übung 3: PHP Upload</title>
</head>
<body>
<form action="upload.php" method="post" enctype="multipart/form-data">
<?php
$uploaddir = dirname( $_SERVER["SCRIPT_FILENAME"] ) . "/pix/";
$filename = basename($_FILES['bild']['name']);
$ext = substr($filename, -4);
if( $ext != '.jpg' || $ext != '.gif' || $ext != '.png' ) {
die("es dürfen nur jpg, png oder gif Dateien hochgeladen werden, nicht " . substr($filename, -3) );
}
using System;
using System.Collections.Generic;
class Book
{
public string isbn;
public string title;
public string year;
public string publisher;
@d8ta
d8ta / cpp
Last active August 29, 2015 14:01
CG
// zum einbinden der Dateien
#include <oogl/Texture2D.h>
#include <oogl/GLSLProgram.h>
// sowie..
oogl::Texture2D* moontexture;
oogl::GLSLProgram* phongshader;
// in der Init haben wir:
#include <oogl/Texture2D.h>
#include <oogl/GLSLProgram.h>
oogl::GLSLProgram* phongshader;
oogl::Texture2D* skybox;
phongshader = oogl::GLSLProgram::create("/Users/danielraudschus/Documents/spacerace/projectSpacerace/spacerace/data/shader/textShader.vert", "/Users/danielraudschus/Documents/spacerace/projectSpacerace/spacerace/data/shader/textShader.frag");
@d8ta
d8ta / steuerung.js
Created June 14, 2014 14:24
Habe die touchsteuerung in die normale reingepackt; var (touchLeft usw.) holen sich die Button aus dem HTML und werden bei touch aktiv; Habe dann versucht in der KeyUp z.b Hammer wieder auf .off zu stellen. Läuft aber nicht
/**
* Spielsteuerung
* @returns {movePlayer}
*/
function movement() {
var up = down = left = right = touchLeft = touchRight = touchDown = touchUp = false;
var touchLeft = document.getElementById('left');
Hammer(touchLeft).on("touch", function() {
touchLeft = true;
@d8ta
d8ta / prototypeExtension.js
Last active August 29, 2015 14:10
Prototyping extension
//immediate function: it is convention to sign it with an $ if you use jQuery (but we did not use jQuery here??))
$(function () {
//constructor function
function Person(name) {
console.log('constructor::Person');
console.log(this);
this.name = name;
}
@d8ta
d8ta / hosting.js
Created November 29, 2014 09:00
hosting example
var test = 'hello'; //window, global var
(function() {
//function scope, but we can also access variables and functions in the global scope
//where this function was defined (thus test) and the variables of the parent function
console.log(test); //ToDo: wird in der console als undefined ausgegeben, warum?
//function declaration statement, function declarations get hoisted to top of function scope
function test2(param2, param3) {
console.log(test);