Skip to content

Commit

Permalink
ENH: First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddoria committed Jun 26, 2011
0 parents commit 0ec945c
Show file tree
Hide file tree
Showing 6,970 changed files with 648,383 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
9 changes: 9 additions & 0 deletions Bash/Arithmetic/Arithmetic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

i=2
echo $i test1
echo "$i test1"
echo $(($i*2)) test2

echo "testing"
echo testing
6 changes: 6 additions & 0 deletions Bash/Basics/Compare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ "2" = "1" ]; then
echo true!
else
echo false!
fi
5 changes: 5 additions & 0 deletions Bash/Basics/Concatenate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

testVariable=5; #must NOT have spaces around '='
testVariable2=6;
echo "Variables are ${testVariable}${testVariable2}"
3 changes: 3 additions & 0 deletions Bash/Basics/DisplayCommands.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -x;
doSomething;
6 changes: 6 additions & 0 deletions Bash/Basics/ForEachLoop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

for i in $*; do
echo $i
done;

12 changes: 12 additions & 0 deletions Bash/Basics/ForLoop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
for i in 1 2 3 4 5; do
echo $i.jpg
done;

for i in `seq 1 5`; do
echo $i.jpg
done;

for i in {1..5}; do
echo $i.jpg
done;
6 changes: 6 additions & 0 deletions Bash/Basics/If.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
if [ "$1" = "hello" ]; then
echo you said hello!
else
echo you DID NOT say hello!
fi
10 changes: 10 additions & 0 deletions Bash/Basics/ParameterList.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
echo name of script is $0

echo number of arguments is $#

for i in $*; do
echo $i
done;


9 changes: 9 additions & 0 deletions Bash/Basics/Parameters.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

if [ $# -lt 1 ]; then #-lt is "less than"
echo "You must enter an argument!";
exit;
fi

testVariable=$1; #must NOT have spaces around '='
echo "You input $testVariable"
33 changes: 33 additions & 0 deletions Bash/Basics/Parse.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

#call with
#./Parse.sh --prefix=a.txt

for i in $*
do
case $i in
--files=*)
FILES=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
;;
--searchpath=*)
SEARCHPATH=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
;;
--lib=*)
MyLib=`echo $i | sed 's/[-a-zA-Z0-9]*=//'`
;;
--default)
DEFAULT=YES
;;
*)
# unknown option
;;
esac
done

echo $FILES
echo "File 0:"
echo ${FILES[0]}

echo $SEARCHPATH
echo $MyLib
echo $DEFAULT
8 changes: 8 additions & 0 deletions Bash/Basics/Quotes.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

i=4

echo i = ${i}
echo testing --thing='stuff ${i}'
echo testing --thing="'stuff ${i}'"
echo testing --thing="'stuff'"
5 changes: 5 additions & 0 deletions Bash/Basics/UserInput.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
echo -n "Enter your name: " #-n is no new line
read -e Name #use readline

echo $Name
4 changes: 4 additions & 0 deletions Bash/Basics/Variables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

testVariable=5; #must NOT have spaces around '='
echo "Variable is $testVariable"
5 changes: 5 additions & 0 deletions Bash/Basics/ZeroPad.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
for i in 1 2 3 4 5; do
NewNumber=`printf %04d "$i"`
echo $i $NewNumber
done;
6 changes: 6 additions & 0 deletions Bash/Flicker/Flicker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
#for i in 1 2 3 4 5; do
# echo $i.jpg
#done;

convert -delay 20 -loop 0 *.jpg animated.gif # loop 0 means repeat infinitely
Binary file added Bash/Flicker/anim0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bash/Flicker/anim1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bash/Flicker/anim2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bash/Flicker/anim3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Bash/Flicker/animated.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions Bash/Timer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

while :
do
sleep 60
echo "keep alive" >> /media/portable/keepalive.txt
echo "keep alive"
done
2 changes: 2 additions & 0 deletions Bash/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
hi
hi
27 changes: 27 additions & 0 deletions CMake/CompilerFlags/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
cmake_minimum_required(VERSION 2.6)

PROJECT(CompilerFlags)

find_package(wxWidgets COMPONENTS core base REQUIRED)
include( ${wxWidgets_USE_FILE} )

ADD_EXECUTABLE(CompilerFlags CompilerFlags.cxx)

#works, but not best-practice
#set_target_properties(CompilerFlags PROPERTIES COMPILE_FLAGS "-DUNIX")

#works fine
#set_target_properties(CompilerFlags PROPERTIES COMPILE_DEFINITIONS "UNIX;DAVID;")

#also works fine
#set(myvariable "UNIX; DAVID;")
#message("myvariable: " ${myvariable})

#best practice
list(APPEND myvariable "UNIX")
list(APPEND myvariable "DAVID")
message("myvariable: ${myvariable}")
message("CMAKE_CXX_FLAGS: ${CMAKE_CXX_FLAGS}")
SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS ${wxWidgets_DEFINITIONS} )
set_target_properties(CompilerFlags PROPERTIES COMPILE_DEFINITIONS "${myvariable}")

24 changes: 24 additions & 0 deletions CMake/CompilerFlags/CompilerFlags.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include <iostream>

int main()
{
#ifdef UNIX
std::cout << "UNIX was defined." << std::endl;
#else
std::cout << "UNIX was NOT defined." << std::endl;
#endif

#ifdef DAVID
std::cout << "DAVID was defined." << std::endl;
#else
std::cout << "DAVID was NOT defined." << std::endl;
#endif

#if defined(UNIX) || defined(DAVID)
std::cout << "Working." << std::endl;
#else
#error "Broken!"
#endif

return 0;
}
11 changes: 11 additions & 0 deletions CMake/Install/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
cmake_minimum_required(VERSION 2.6)

PROJECT(InstallTest)

ADD_EXECUTABLE(InstallTest InstallTest.cxx)

# Install to a hard coded path
#install(TARGETS InstallTest RUNTIME DESTINATION /home/doriad/Desktop/InstallTest)

# Install to a path specified in ccmake
install(TARGETS InstallTest RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
4 changes: 4 additions & 0 deletions CMake/Install/InstallTest.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main()
{
return 0;
}
6 changes: 6 additions & 0 deletions CMake/Library/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 2.6)

PROJECT(TestLibrary)

add_library(TestLibrary TestLibrary.cxx)

4 changes: 4 additions & 0 deletions CMake/Library/TestLibrary.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int TestFunction()
{
return 0;
}
6 changes: 6 additions & 0 deletions CMake/SetTargetProperties/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 2.6)

PROJECT(SetTargetProperties)

ADD_EXECUTABLE(SetTargetProperties SetTargetProperties.cxx)
set_target_properties(SetTargetProperties PROPERTIES COMPILE_FLAGS "-DUNIX")
4 changes: 4 additions & 0 deletions CMake/SetTargetProperties/SetTargetProperties.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main()
{
return 0;
}
14 changes: 14 additions & 0 deletions CMake/VariableCaching/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 2.6)

PROJECT(VariableCaching)

#SET(CMAKE_CXX_FLAGS "Flags1" CACHE STRING "Compiler flags")
SET(CMAKE_CXX_FLAGS "Flags1")
message("Using flags ${CMAKE_CXX_FLAGS}")
ADD_EXECUTABLE(Executable1 VariableCaching.cxx)

#SET(CMAKE_CXX_FLAGS "Flags2" CACHE STRING "Compiler flags")
SET(CMAKE_CXX_FLAGS "Flags2")
message("Using flags ${CMAKE_CXX_FLAGS}")
ADD_EXECUTABLE(Executable2 VariableCaching.cxx)

4 changes: 4 additions & 0 deletions CMake/VariableCaching/VariableCaching.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main()
{
return 0;
}
12 changes: 12 additions & 0 deletions CMake/Variables/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
cmake_minimum_required(VERSION 2.6)

PROJECT(Variables)

#string variable
#SET(VariableName DefaultValue CACHE VariableType HelpText FORCE)
SET(AStringVariable HelloWorld CACHE STRING "String variable help text" FORCE)

SET(ABoolVariable OFF CACHE BOOL "Bool varibale help text" FORCE)

ADD_EXECUTABLE(Variables Variables.cxx)

4 changes: 4 additions & 0 deletions CMake/Variables/Variables.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int main()
{
return 0;
}
8 changes: 8 additions & 0 deletions CSharp/HelloWorld/HelloWorld.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using System;
class myClass
{
static void Main()
{
Console.WriteLine("Hello World");
}
}
Binary file added CSharp/HelloWorld/HelloWorld.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions CTest/Simple/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
cmake_minimum_required(VERSION 2.6)

project(simple)
ENABLE_TESTING()

add_executable(simple simple.cpp)
add_test(NAME SimpleTest COMMAND simple)
10 changes: 10 additions & 0 deletions CTest/Simple/simple.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>

int main (int, char *[])
{

std::cout << "Sample text." << std::endl;

return 0;
}

1 change: 1 addition & 0 deletions Doxygen/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
see c++/src/Doxygen
5 changes: 5 additions & 0 deletions ImageMagick/ApproximateSizeImages/ApproximateSizeImages
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

#this makes all the images in the current directory as close to 600x600 (360000 area) as possible while preserving the aspect ratio
for i in *.png; do convert $i -resize 360000@ $i; done;

Binary file added ImageMagick/Borders/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions ImageMagick/Borders/Borders.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

#convert 1.jpg -bordercolor blue -border 10 border.jpg
convert 1.jpg -bordercolor blue -border 2x2 border.jpg

Binary file added ImageMagick/Borders/border.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/001.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/002.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/003.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/005.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions ImageMagick/ConcatenateImages/ConcatenateImages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash

#make images same size
#for model in {1..5}; do
# File="${model}.jpg"
# convert $File -resize 100x100\! $File
#done;


#concatenate vertically
#convert 1.jpg 2.jpg -append append.jpg

#concatenate vertically with a border
#convert 1.jpg 2.jpg -border 10 -append append.jpg

#concatenate vertically with a blue border
#convert 1.jpg 2.jpg -bordercolor blue -border 10 -append append.jpg

#concatenate horizontally
#convert 1.jpg 2.jpg +append append.jpg

#concatenate a list of images
#convert [12345].jpg +append append.jpg #works
#convert [1,2,3,4,5].jpg +append append.jpg #works
#convert [1-5].jpg +append append.jpg #works
#convert *.jpg +append append.jpg #works
#convert 00[1-5].jpg +append append.jpg



#add a border
#montage -background blue -geometry +4+4 001.jpg test.jpg

#add a border and concatentate
#montage -background blue -geometry +4+4 001.jpg 002.jpg test.jpg


Binary file added ImageMagick/ConcatenateImages/append.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/horizontal.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/nozeropad/1.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/nozeropad/2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/nozeropad/3.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/nozeropad/4.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/nozeropad/5.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/test.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ConcatenateImages/vertical.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions ImageMagick/DrawSquare/DrawSquare.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/python
import os, sys

#RGB
#cmd = "convert -size 200x100 xc:rgb\(255,0,0\) square.png"

#HSL
#Saturation and lightness are represented as percentages
#100% is full saturation, and 0% is a shade of grey
#0% lightness is black, 100% lightness is white, and 50% lightness is 'normal'

#hsl(0, 100%, 50%) red
#hsl(120, 100%, 50%) green
#hsl(120, 100%, 25%) light green
#hsl(120, 100%, 75%) dark green
#hsl(120, 50%, 50%) pastel green

cmd = "convert -size 200x100 xc:hsl\(100,100\%, 50\%\) square.png"
os.system(cmd)


Binary file added ImageMagick/DrawSquare/square.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ImageMagick/ImageBottomRight/BottomRight.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0ec945c

Please sign in to comment.