Skip to content

Instantly share code, notes, and snippets.

View chopmann's full-sized avatar

Cornelio Hopmann chopmann

  • WobCom
  • Hildesheim
View GitHub Profile
@chopmann
chopmann / import.rake
Last active December 12, 2015 09:58
import.rake
namespace :gitlab do
namespace :import do
# How to use:
#
# 1. copy your bare repos under git base_path
# 2. run bundle exec rake gitlab:import:repos RAILS_ENV=production
#
# Notes:
# * project owner will be a first admin
# * existing projects will be skipped
package de.gdplabor.aufgabe7;
import java.util.Locale;
import java.util.Scanner;
public class GDP7 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
@chopmann
chopmann / genes.java
Created October 5, 2013 10:03
Genen und Mutationen Pseudo Code
genes = new int[8];
Random rand = new Random();
for (int i = 0; i < genes.length; i++) {
genes[i] = Helper.randInt(1, 10, rand);
}
/** http://stackoverflow.com/questions/363681/generating-random-numbers-in-a-range-with-java */
public static int randInt(int min, int max, Random rand) {
public int removePlant(int x, int y) {
if (plantContainer[x][y] <= 0) {
plantContainer[x][y] = 0;
return 0;
} else {
plantContainer[x][y]--;
return plantEnergy;
}
}
// Dein Code
public int getAnzahlTiere(int x, int y) {
int count = 0;
for (int k = 0; k < ; k++)
if (this.map[x][y].tiere.get(k) != null) {
count++;
}
return count;
}
@chopmann
chopmann / GandB
Last active August 29, 2015 14:00
Grill & Burger Draft List
=========================
Grill:
+ Bio Chicken 1,5 Kg
+ Spieße (die Holzdinger ;) )
Burger:
+ Bio Beef --> 2 Kg
+ Bio Pork --> Wahrscheinlich nicht
+ Bio Bacon --> 1 Packung
@chopmann
chopmann / bsrn.py
Created June 18, 2014 12:19
Keygen for a University Exercise
__author__ = 'sirmonkey'
import httplib
import re
addr = "m.andapp.de"
doc = "/br/ha4.php?mat="
conn = httplib.HTTPConnection(addr)
pattern = 'Antwort:(.+?)<'
for i in range(70349800, 70349819):
| URL Mappings Configured for Application
| ---------------------------------------
Controller: appointment
| GET | /courses/${courseId}/appointments | Action: index |
| GET | /courses/${courseId}/appointments/create | Action: create |
| POST | /courses/${courseId}/appointments | Action: save |
| GET | /courses/${courseId}/appointments/${id} | Action: show |
| GET | /courses/${courseId}/appointments/${id}/edit | Action: edit |
| PUT | /courses/${courseId}/appointments/${id} | Action: update |
| GET | /courses | Action: index |
Liefert - Liste (format unten):
| GET | /courses/${id} | Action: show |
Liefert ein Element (
[
{
"id": 1,
"appointments": [
{
"id": 1,
Exception in Application start method
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:363)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:303)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)