- Use a class 10 SD card for best speed. The USB bus can't come much higher than 30MB/s so you don't have to buy any extremely fast ones though. Not all cards are compatible, check the compatibility list: http://elinux.org/RPi_SD_cards
- Use the HardFloat version of Raspbian instead of the SoftFloat. HF has much faster floating point operations - however SF is required for running Java. So it's either Java or performance, like normal.
- The official Raspbian image gives low network speeds: http://elinux.org/RPi_Performance#NIC
- A graphics driver by Simon / teh_orph is using hardware acceleration for some instructions: http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=28294 installation instructions: http://elinux.org/RPi_Xorg_rpi_Driver
- The firmware can be upgraded which gives, among other things, better GPU performance.
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
/// start TouchProfiler.h | |
#ifndef __MySketchPad__TouchProfiler__ | |
#define __MySketchPad__TouchProfiler__ | |
#include <deque> | |
using namespace std; | |
class TouchProfiler | |
{ | |
public: |
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 "SmoothedBIView.h" | |
#import "TouchProfiler.h" | |
@implementation SmoothedBIView | |
{ | |
UIBezierPath *path; | |
UIImage *incrementalImage; | |
CGPoint pts[5]; // we now need to keep track of the four points of a Bezier segment and the first control point of the next segment | |
uint ctr; | |
TouchProfiler *_profiler; |
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 "ScrolledSmoothedBIView.h" | |
#import "SmoothedBIView.h" | |
@implementation ScrolledSmoothedBIView | |
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { |
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
. + (UIImage *)renderView:(UIView *)view { | |
. UIGraphicsBeginImageContext(view.bounds.size); | |
. | |
. CGContextRef ctx = UIGraphicsGetCurrentContext(); | |
. [view.layer renderInContext:ctx]; | |
. | |
. UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); | |
. | |
. UIGraphicsEndImageContext(); | |
. |
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
#!/usr/local/python/bin | |
# coding=utf-8 | |
'''Implements a simple log library. | |
This module is a simple encapsulation of logging module to provide a more | |
convenient interface to write log. The log will both print to stdout and | |
write to log file. It provides a more flexible way to set the log actions, | |
and also very simple. See examples showed below: |
When I use docker to work with the shared workspace with host under Ubuntu, I find that files created by docker user is owned by root. This is not the same with macOS.
Maybe this is becuase docker is run by root user and the default user mapping mechanism is to map container-root to host-user or host-root. So can I map the container-root or container-any-user to host-current-user?
Fortunately the latest docker supports the re-map the container user to any host user via Linux namespace. Refer to this.
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
# To extract the sound from a video and save it as MP3: | |
ffmpeg -i <video.mp4> -vn <sound>.mp3 | |
# To convert frames from a video or GIF into individual numbered images: | |
ffmpeg -i <video.mpg|video.gif> <frame_%d.png> | |
# To combine numbered images (frame_1.jpg, frame_2.jpg, etc) into a video or GIF: | |
ffmpeg -i <frame_%d.jpg> -f image2 <video.mpg|video.gif> | |
# To quickly extract a single frame from a video at time mm:ss and save it as a 128x128 resolution image: |