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
#!/bin/sh | |
# Arduino-IDE-and-Ino-Side-by-sidy Helper Script | |
# Version: 0.1 | |
# Author: Tim Pulver | |
# Ino URL: http://inotool.org | |
# | |
# Compile and upload Arduino sketches using Ino | |
# without moving them to a "scr"-folder, so you can still edit | |
# the sketch in Arduino IDE. |
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
/* | |
* Watchdog example | |
* | |
* Send 'r' through serial to reboot the Arduino, when it's back up, "Boot..." should appear. | |
*/ | |
// include watchdog, part of avr-gcc compiler | |
#include <avr/wdt.h> | |
void setup(){ |
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
import static java.nio.file.LinkOption.NOFOLLOW_LINKS; | |
import static java.nio.file.StandardWatchEventKinds.ENTRY_CREATE; | |
import static java.nio.file.StandardWatchEventKinds.ENTRY_MODIFY; | |
import static java.nio.file.StandardWatchEventKinds.ENTRY_DELETE; | |
import static java.nio.file.StandardWatchEventKinds.OVERFLOW; | |
import java.io.IOException; | |
import java.nio.file.FileSystem; | |
import java.nio.file.Files; | |
import java.nio.file.Path; |
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
/* | |
Am Anfang müssen die Dateinamen im script gespeichert werden. Dazu nehme ich der Einfachheitshalber ein Array namens $bild. Die Funktion mt_rand() liefert eine Zufallszahl im Bereich unteres Array (also unterer Anzahl der eingetragenen Bilder). Mit der letzten Zeile wird der Wert aus dem Array $bild per PHP-Befehl "echo" in den HTML-Code geschrieben. | |
Um das Ganze nun nutzen zu können, musst du auf deinem Server diesen Quellcode in eine Datei mit der Endung .php speichern (sonst interpretiert der Server den Quelltext nicht als PHP). Wichtig dabei natürlich, dass dein Server überhaupt PHP installiert hat. Sollte aber mittlerweile überall Standard sein. | |
*/ | |
<?PHP | |
// Hier kommen die dateinamen untereinander | |
$bild[] = "header1.jpg"; |
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
// String definieren | |
string s1("Ein Text"); | |
// Zeichen aus String in char-Feld umkopieren | |
char charArray[40]; | |
// string.c_str() liefert char* | |
strcpy(charArray,s1.c_str()); |
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
srand ( time(NULL) ); | |
int grA, grB; | |
grA = 0; grB = i; | |
int a; | |
a = grA + (rand() % (grB - grA + 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
#include <stdio.h> | |
int remove(const char *filename); |
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
// returns 0 if equal | |
stricmp(str1, str2); |
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
bool DirectoryExists( const char* pzPath ){ | |
DIR *pDir; | |
bool bExists = false; | |
pDir = opendir (pzPath); | |
if (pDir != NULL){ | |
return true; | |
} | |
return false; | |
} |
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 <fstream> | |
#include <iostream> | |
#include <string> | |
using namespace std; | |
int main(int argc, char *argv[]) | |
{ | |
ifstream f; // Datei-Handle | |
string s; | |
f.open(argv[1], ios::in); // Öffne Datei aus Parameter |
OlderNewer