Skip to content

Instantly share code, notes, and snippets.

View jtuttas's full-sized avatar

jtuttas jtuttas

  • http://www.mmbbs.de
View GitHub Profile
public class Fahrzeug {
private double gewicht;
private long laufleistung;
public double getGewicht() {
return gewicht;
}
public void setGewicht(double gewicht) {
this.gewicht = gewicht;
}
public long getLaufleistung() {
public class Fahrzeug {
private double gewicht;
private long laufleistung;
public double getGewicht() {
return gewicht;
}
public void setGewicht(double gewicht) {
this.gewicht = gewicht;
Write-Host "Zählen startet"
$z1 = Start-Job {
for ($i=0;$i -lt 3;$i++) {
"Zaehler 1 ist bei $i"
sleep 1
}
}
$z2 = Start-Job {
for ($i=0;$i -lt 6;$i++) {
"Zaehler 2 ist bei $i"
@jtuttas
jtuttas / Main.java
Created September 14, 2014 13:43
Threads Fork and Join
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Zaehler z1 = new Zaehler("Nummer 1", 3);
Zaehler z2 = new Zaehler("Nummer 2", 6);
z1.start();
public class Main {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Client c1 = new Client("Thomas","mmbbs");
Client c2= new Client("Frank","mbs");
Client c3= new Client("Simone","mmbbs");
public class Client implements Observer{
private String name;
private String pw;
public Client(String user,String pw) {
this.name=user;
this.pw=pw;
}
@jtuttas
jtuttas / oktal.ps1
Created September 5, 2014 12:24
Oktalzahlen Wandlung
[int]$z=0
$out=""
while ($z -le 0) {
$z=Read-Host "Dezimalzahl:"
}
$dezimal=$z
while ($z -gt 0) {
$diff=$z%8
$out=$out.Insert(0,$diff)
$z=($z-$diff)/8
$ci=New-Object System.Object | Select-Object -Property MACAddress,Architecture,OS,RAM,freeDiskspace,ComputerName
$ci.MACAddress=Get-WmiObject win32_networkadapterconfiguration | Where-Object ipaddress | Select-Object -ExpandProperty MACAddress
$ci.Architecture=(Get-WmiObject win32_operatingsystem).OSArchitecture
$ci.OS=(Get-WmiObject win32_operatingsystem).Caption
[double]$ci.RAM=(Get-WmiObject win32_computersystem).totalPhysicalmemory/1gb
$ci.freeDiskspace=(Get-WmiObject win32_logicaldisk) | Where-Object {$_.DeviceID -eq "c:"} | Select-Object -ExpandProperty FreeSpace
$ci.ComputerName=$env:COMPUTERNAME
$ci
function ipinfo($ip) {
$ip
[int[]]$x = $ip.Split(".")
if($x[0] -le 127)
{
"Class A"
}
elseif($x[0] -gt 127 -and $x[0] -le 191)
{
"Class B"
# Login
Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?user=mmbbs&password=mmbbs" -SessionVariable s
# Logout
Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?cmd=logout" -WebSession $s
# Abfrage letzte News
Invoke-WebRequest http://192.168.178.29/mmbbsapp/news.php -WebSession $s
# Abfragen News ab ID
Invoke-WebRequest http://192.168.178.29/mmbbsapp/news.php?id=2 -WebSession $s
# Eintragen einer News
Invoke-WebRequest "http://192.168.178.29/mmbbsapp/news.php?Headline=Überschrift&Text=Dies ist ein Text mit öäü" -WebSession $s