I hereby claim:
- I am alfakini on github.
- I am alfakini (https://keybase.io/alfakini) on keybase.
- I have a public key ASDKbWiwaCUJnq3RWVwqz3-aDkpboHOldbjGsrIvB6RqUwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def on_created(self, event): | |
file_size = -1 | |
while file_size != os.path.getsize(event.src_path): | |
file_size = os.path.getsize(event.src_path) | |
time.sleep(1) | |
self.process(event) |
import sys | |
import time | |
from watchdog.observers import Observer | |
from .events import ImagesEventHandler | |
class ImagesWatcher: | |
def __init__(self, src_path): | |
self.__src_path = src_path | |
self.__event_handler = ImagesEventHandler() |
import os | |
from PIL import Image | |
from PIL.ImageOps import grayscale | |
from watchdog.events import RegexMatchingEventHandler | |
class ImagesEventHandler(RegexMatchingEventHandler): | |
THUMBNAIL_SIZE = (128, 128) | |
IMAGES_REGEX = [r".*[^_thumbnail]\.jpg$"] | |
def __init__(self): |
×
Done
-
In progress
# | Cidade | Crawler | Parser |
---|---|---|---|
1 | São Paulo | ||
2 | Rio de Janeiro | - | |
3 | Brasília | ||
4 | Salvador |
#!inbox
I am passionate about Ruby, but its execution time compared to other languages is extremely high, especially when we want to use more complex algorithms. In general, data structures in interpreted languages become incredibly slow compared to compiled languages. Some algorithms such as ´n-body´ and ´fannkuch-redux´ can be up to 30 times slower in Ruby than Go. This is one of the reasons I was interested in embedding Go code in a Ruby environment.
For those who do not know how shared libraries operate, they work in a similar way as DLLs in Windows. However, they have a native code with a direct interface to the C compiler.
Note
$ wget ...cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
$ sudo dpkg -i /tmp/cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
$ rm -f /tmp/cuda-repo-ubuntu1404_7.5-18_amd64.deb | |
$ wget ...nvidia-machine-learning-repo_4.0-2_amd64.deb | |
$ sudo dpkg -i /tmp/nvidia-machine-learning-repo_4.0-2_amd64.deb | |
$ rm -f /tmp/nvidia-machine-learning-repo_4.0-2_amd64.deb | |
$ sudo apt-get install digits |
ROOM_ID="" # Can also be the name of the room | |
AUTH_TOKEN="" # Go here to get it https://chute.hipchat.com/account/api | |
function getURL { | |
url=`osascript -e 'tell application "Spotify" to spotify url of current track'` | |
remove='spotify:track:' | |
url=${url#$remove} | |
url="http://open.spotify.com/track/$url" | |
echo $url |
NUMBER_OF_CORES=4 | |
sudo apt-get install -y libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev | |
sudo apt-get install -y --no-install-recommends libboost-all-dev | |
sudo apt-get install -y libatlas-base-dev | |
sudo apt-get install -y python-dev | |
sudo apt-get install -y python-pip git | |
sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler | |
class AccountLogoUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
max_file_size = 5.megabytes | |
version :original do | |
process | |
end | |
private |