Skip to content

Instantly share code, notes, and snippets.

View wavescholar's full-sized avatar
🎯
Focusing

Bruce Campbell wavescholar

🎯
Focusing
  • These are projects that I have developed out of academic interest or as part of various consulting roles.
  • Columbus, Ohio
View GitHub Profile
@wavescholar
wavescholar / gist:5432219
Created April 22, 2013 03:16
git config http.postBuffer 524288000
git config http.postBuffer 524288000
@wavescholar
wavescholar / gist:10152479
Last active August 29, 2015 13:58
Stream Cipher Code - Experimental
#include <string>
#include <iostream>
#include <map>
#include <vector>
#include <cctype>
int to_int(int c) {
if (! isxdigit(c)) return -1; // error: non-hexadecimal digit found
if (isdigit(c)) return c - '0';
if (isupper(c)) c = tolower(c);
@wavescholar
wavescholar / gist:10565397
Created April 13, 2014 01:51
Modify Path in C++
//Try to set the path to the Matlab binaries. The below does not work. The runtime
//tries to load the dependencies before this can be executed. Investigate delay loadding of dll.
//The code is kept here for reference.
//I have previously experienced an issue where the environment variable can not be used. There is a maximun path
//length of 2048 for the system environment variable. Exceeding this will cause
//myriad problems with a Windows 7 system. If you find you icon image cache is corrupt - check the
//length of your path variable.
//char* envV= getenv("PATH");
////Returns an errno if there is a problem.
////int setOK = _putenv( "PATH=C:\\Program Files\\MATLAB\\R2012b\\bin\\win64;%PATH%");
using System;
using System.Collections.Generic;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using klManagedImaging;
using System.Drawing;
//Quite Literally - scraps
//Scraps of Bitmap Interop GDI+ code I did not want to loose.
using System;
class klGDIBitmapConversion
{
public static System.Drawing.Bitmap MainConv(System.Drawing.Bitmap img)
{
System.Drawing.Bitmap b = img;// new System.Drawing.Bitmap("test.jpg");
SplashImage(b, 0, 0);
DateTime dtFaq = DateTime.Now;
System.Drawing.Bitmap b0 = CopyToBpp(b, 8);
TimeSpan tsFaq = DateTime.Now - dtFaq;
@wavescholar
wavescholar / gist:68f86080a2497fdce6dc
Created August 11, 2014 02:30
Floating Point Exception Demo
#include <cfloat>
#include <iostream>
#include <sstream>
#include <cmath>
using namespace std;
string FPClass(double x)
{
int i = _fpclass(x);
@wavescholar
wavescholar / gist:da3ca722e231c84c41b7
Created September 1, 2014 02:42
Fedora Linux Setup - Step 1
On a clean system
yum groupinstall "Authoring and Publishing" "Administration Tools"
yum groupinstall "Books and Guides" "C Development Tools and Libraries" "Development Tools" "Fedora Eclipse" "System Tools" "Editors"
I use Intel Composer
https://software.intel.com/en-us/articles/using-intelr-compilers-for-linux-under-fedora
Follow the instructions for ia32 libraries or only install x64 bin.
@wavescholar
wavescholar / gist:b85a3be3685112110bd3
Last active August 29, 2015 14:06
RPM & YUM Commands
yum repolist
yum repolist enabled
yum repolist disabled
yum repolist all
Syntax Description Example(s)
rpm -ivh {rpm-file} Install the package rpm -ivh mozilla-mail-1.7.5-17.i586.rpm
rpm -ivh --test mozilla-mail-1.7.5-17.i586.rpm
@wavescholar
wavescholar / gist:3352c66c08dda3f1722c
Created September 6, 2014 22:21
Linux Directories
http://www.tecmint.com/linux-directory-structure-and-important-files-paths-explained/
/bin : All the executable binary programs (file) required during booting, repairing, files required to run into single-user-mode, and other important, basic commands viz., cat, du, df, tar, rpm, wc, history, etc.
/boot : Holds important files during boot-up process, including Linux Kernel.
/dev : Contains device files for all the hardware devices on the machine e.g., cdrom, cpu, etc
/etc : Contains Application’s configuration files, startup, shutdown, start, stop script for every individual program.
/home : Home directory of the users. Every time a new user is created, a directory in the name of user is created within home directory which contains other directories like Desktop, Downloads, Documents, etc.
/lib : The Lib directory contains kernel modules and shared library images required to boot the system and run commands in root file system.
/lost+found : This Directory is installed during installation of Linux, useful fo
@wavescholar
wavescholar / gist:5f1cb490f9439ede7bc1
Created September 6, 2014 22:21
java alternatives setup Oracle on top of OpenJDK
--------------------------
Swap between OpenJDK and Sun/Oracle Java JDK/JRE
alternatives --config java
alternatives --config javaws
alternatives --config libjavaplugin.so
alternatives --config libjavaplugin.so.x86_64
alternatives --config javac
Post-Installation Setup