A bash script to rename files using its sha256 hash number, no error trapping or anything yet.
Category: programming
Syntax helloAPP [count [custom string]]
This creates an object that can be linked to a main program containing all hello world services to a parent program. A sample program using that object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 … Read More “C++ Hello World using OOP” »
#include <stdio.h> #include <time.h> using namespace std; bool isPrime(long n) { long i, m; m = n / 2; if(n % 2==0) return false; else for(i=3; i<m; i+=2) if(n % i==0) return false; return true; } int main() { long j; clock_t tStart = clock(); for(j=1;j<1000000;j++) if(isPrime(j)) printf(“%ld\n”, j); printf(“Time taken: %.2fs\n”, (double)(clock() – tStart)/CLOCKS_PER_SEC); … Read More “C++ Prime Numbers” »
‘ Chloe Program data “C”, “h”, “l”, “o”, “e”, ” “, “G”, “r”, “a”, “c”, “e” data ” “, “M”, “o”, “r”, “e”, “t”, “z”, “,”, ” “, “I”, ” ” data “l”, “o”, “v”, “e”, ” “, “y”, “o”, “u”, “!”, chr$(13), “I” data ” “, “w”, “a”, “n”, “t”, ” “, “t”, “o”, … Read More “Chloe” »
#!/bin/bash if [ -f $1 ] then filename=$(basename “$1”) echo “Converting file…” dwebp “${filename%.*}”.webp -o “${filename%.*}”.png else echo “The file does not exist.” fi
#include <cstdio> #include <cstdlib> #include <ctime> #include <string> usingnamespace std; class ifstree { public: float minfactor; float maxfactor; float bend; float angle; float initlen; int fdim; ifstree(); void turnleft(float ang) { printf(“lt %4.2f\n”, ang); }; void turnright(float ang) { printf(“rt %4.2f\n”, ang); }; void movefw(float value) { printf(“fw %4.2f\n”, value); }; void movebw(float value) { … Read More “Fractal Tree C++ Logo Output” »
I am planning to do practice some javascript programming at the console rather than embedded in a web page. My main system runs windows so it does support jscript in the windows scripting host. However, I want something better than what windows provides. One of the possibilities was Google’s V8 interpreter, the fastest javascript interpreter … Read More “Javascript” »
The following program (written in C++) creates a filter program for converting ascii into ROT13 encoding. A very simple cypher where each character in the alphabet is replaced with the 13th letter from its position. To download a compiled windows compatible binary, click here. #include <cstring> #include <cstdio> #include <cctype> using namespace std; char translate(char … Read More “ROT13 C++” »