This file contains hidden or 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
from PIL import Image, ImageDraw | |
def checkX(image, x): | |
pixels = image.load() | |
sum = 0; | |
for i in range(image.size[1]): | |
if (pixels[x,i][3] == 0): | |
sum += 1 | |
return (sum == image.size[1]) |
This file contains hidden or 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/bash | |
function createDir { | |
if [ ! -d $1 ]; then | |
mkdir $1 | |
fi | |
} | |
createDir ios |
This file contains hidden or 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/bash | |
function createDir { | |
if [ ! -d $1 ]; then | |
mkdir $1 | |
fi | |
} | |
createDir imageset | |
createDir imageset/drawable-xxxhdpi |
This file contains hidden or 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 "stm32l1xx.h" | |
int main(void) | |
{ | |
RCC->CR |= RCC_CR_HSEON; | |
while(!(RCC->CR & RCC_CR_HSERDY)); | |
RCC->APB2ENR |= RCC_APB2ENR_USART1EN; //USART1 Clock ON | |
USART1->BRR = 0xD05; // Bodrate for 9600 on 32Mhz | |
USART1->CR1 |= USART_CR1_UE | USART_CR1_TE | USART_CR1_RE; // USART1 ON, TX ON, RX ON |
This file contains hidden or 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 "stm32l1xx.h" | |
void delay(unsigned int time) { | |
for (time; time > 0; time--); | |
} | |
int main(void) | |
{ | |
RCC->AHBENR |= RCC_AHBENR_GPIOBEN; |
This file contains hidden or 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
/* | |
* Name:RFID.pde | |
* Create:www.electrodragon.com | |
* Create date:2011.09.19 | |
* Function:Mifare1 searching card →prevent conflict→ select card →read write pins | |
*/ | |
// the sensor communicates using SPI, so include the library: | |
#include <SPI.h> | |
#define uchar unsigned char |
This file contains hidden or 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
############################################################################################## | |
# | |
# On command line: | |
# | |
# make all = Create project | |
# | |
# make clean = Clean project files. | |
# | |
# To rebuild project do "make clean" and "make all". | |
# |
This file contains hidden or 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/bash | |
WIDTH="2880"; | |
HEIGHT="1868"; | |
SHIFT_X="880"; | |
SHIFT_Y="608"; | |
ORIENT="left"; | |
# If right page - first, insert "1", otherwise "0" | |
RIGHT_FIRST="1"; |
This file contains hidden or 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/bash | |
ffmpeg -i video.MOV -r 6 image_%010d.png; | |
mkdir resized; | |
for i in image_*.png; do convert $i -resize 600 resized/$i; done | |
rm -f image_*.png; | |
cd resized; | |
convert -delay 10 -layers optimize *.png ../animation.gif | |
cd ..; | |
rm -fr resized; |
This file contains hidden or 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
#!/usr/bin/python | |
import os | |
listRoms = os.listdir("."); | |
countRoms = len(listRoms); | |
for i in range(0, countRoms): | |
name = listRoms[i]; | |
if (name[-4:] == ".bin"): |
NewerOlder