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 maya.cmds as cmds | |
selList = cmds.ls(sl=1, ap=1, tr=1) | |
for sel in selList: | |
cmds.setAttr(sel + ".tx", k=1, l=0) | |
cmds.setAttr(sel + ".ty", k=1, l=0) | |
cmds.setAttr(sel + ".tz", k=1, l=0) | |
cmds.setAttr(sel + ".rx", k=1, l=0) |
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
public class Blur { | |
private static final float BITMAP_SCALE = 0.5f; | |
private static final float BLUR_RADIUS = 7.5f; | |
public static void blurImageView(ImageView view) { | |
Bitmap viewBitmap = getViewBackgroundBitmap(view); | |
Bitmap blurredBitmap = blur(view.getContext(), viewBitmap); | |
view.setImageBitmap(blurredBitmap); | |
} |
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
tm epochToTM(UINT32 epoch){ | |
tm time; | |
time.tm_hour = ((epoch * 100) / 360000) % 24; | |
time.tm_min = ((epoch * 100) / 6000) % 60; | |
time.tm_sec = (epoch / 100) % 60; | |
time.tm_yday = ceil(fmod(epoch / 86400.0f, 365.24f)); | |
time.tm_mon = ceil(fmod(epoch / 2629743.0f, 12.0f)); | |
time.tm_year = (epoch / 31536000) + 1970; | |
return time; |
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
Chop attempt 1: | |
int chop(int intToFind, int arrayToSearch[], int length){ | |
int index = length / 2; | |
while (arrayToSearch[index] != intToFind){ | |
if (arrayToSearch[index] > intToFind){ | |
length = index; | |
index /= 2; | |
} | |
else if (arrayToSearch[index] < intToFind){ | |
index = (index + length) / 2; |
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
//25ns if hashSize = words.size() | |
//26ns if hashSize = words.size() / 2 | |
//40ns if hashSize = words.size() / 4 | |
//46ns if hashSize = words.size() / 10 | |
vector<string> fileToLineVec(char * fileName){ | |
ifstream file(fileName); | |
vector<string> out; | |
if (file){ | |
file.seekg(0, file.end); |
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 <iostream> | |
#include <sstream> | |
#include <fstream> | |
std::vector<std::string> fileToLineArr(char * fileName){ | |
std::ifstream data(fileName); | |
if (!data){ | |
std::cout << "Could not find file " << fileName << std::endl; | |
} | |
std::string line; |
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 <sstream> | |
char* LoadShader(string fileName) | |
{ | |
char * shader; | |
stringstream buffer; | |
ifstream s(fileName); | |
buffer << s.rdbuf(); | |
shader = new char[buffer.str().size() + 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
void quickSort(int arr[], int left, int right) | |
{ | |
int leftIndex, rightIndex, temp; | |
leftIndex = left; | |
rightIndex = right; | |
do | |
{ |
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
void copyArray(int arrA[], int arrB[], int lower, int upper) | |
{ | |
for (int i = lower; i < upper; i++) | |
{ | |
arrA[i] = arrB[i]; | |
} | |
} | |
void merge(int arr[], int lower, int mid, int upper) | |
{ |
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
void insertionSort(int arr[], int size) | |
{ | |
int temp,j; | |
for (int i = 1; i < size; i++) | |
{ | |
j = i; | |
while (arr[j] < arr[j - 1]) | |
{ | |
temp = arr[j]; | |
arr[j] = arr[j - 1]; |
NewerOlder