Skip to content

Instantly share code, notes, and snippets.

View iandol's full-sized avatar
👾
typing away...

Ian Max Andolina iandol

👾
typing away...
  • Institute of Neuroscience, Chinese Academy of Sciences
  • Shanghai
  • 03:37 (UTC +08:00)
View GitHub Profile
@iandol
iandol / a newer build selecting textmate in first pane
Last active August 29, 2015 13:56
Console logs for QS 4009 selecting between differing catalog items
19/02/2014 09:34:50.405 Quicksilver[65997]: .scriptSuite warning for result type of command 'GetDirectTypes' in suite 'QuicksilverHandlers': 'list' is not a valid type name.
19/02/2014 09:34:50.405 Quicksilver[65997]: .scriptSuite warning for result type of command 'GetIndirectTypes' in suite 'QuicksilverHandlers': 'list' is not a valid type name.
19/02/2014 09:34:50.532 Quicksilver[65997]: Cannot find executable for CFBundle 0x7f82e970d380 </Users/ian/Library/Application Support/Quicksilver/PlugIns/com.blacktree.Quicksilver.QSExtraScriptsPlugIn.92.qsplugin> (not loaded)
19/02/2014 09:35:36.969 Quicksilver[65997]: initial action count for TextMate.app: 6
19/02/2014 09:35:36.969 Quicksilver[65997]: validation required for Run in Terminal […]
19/02/2014 09:35:36.970 Quicksilver[65997]: validation failed for Run in Terminal […]
19/02/2014 09:35:36.970 Quicksilver[65997]: QSCLTermExecuteWithArgsAction was not in (
QSCLTermShowDirectoryAction
)
19/02/2014 09:35:36.970 Quicksilver[65997]: validation required fo
function testptb( )
Screen('preference','skipsynctests',2)
backgroundColour = [0.3 0.3 0.3];
name = 'test';
%-----dots stimulus
n = dotsStimulus();
n.name = name;
n.size = 5;
@iandol
iandol / ptbkernel.sh
Created October 22, 2014 02:42
You'll need to update the path on line 9 to your PTB installation...
#!/bin/zsh
sudo cd /System/Library/Extensions
echo "\n\nIs PsychtoolboxKernelDriver Currently Installed"
kextstat -b PsychtoolboxKernelDriver
echo "\n\nRemoving old driver, installing update..."
sudo kextunload -b PsychtoolboxKernelDriver
sudo rm -rf PsychtoolboxKernelDriver.kext
sudo unzip ~/Code/Psychtoolbox-3/Psychtoolbox/PsychHardware/PsychtoolboxKernelDriver64Bit.kext.zip
@iandol
iandol / CreateProceduralSineSmoothedGrating.m
Created February 18, 2011 20:21
Add a cosine (method = 0) or hermite (method = 1) smoothed edge to a circularly masked sine grating. sigma is the width of the smoothing in pixels to apply to the edge. You can set useAlpha = 0 to modulate only colour, or useAlpha = 1 to modulate alpha.
function [gratingid, gratingrect] = CreateProceduralSineSmoothedGrating(windowPtr, width, height, backgroundColorOffset, radius, contrastPreMultiplicator, sigma, useAlpha, method)
% [gratingid, gratingrect] = CreateProceduralSineGrating(windowPtr, width, height [, backgroundColorOffset =(0,0,0,0)] [, radius=inf][, contrastPreMultiplicator=1])
%
% Creates a procedural texture that allows to draw sine grating stimulus patches
% in a very fast and efficient manner on modern graphics hardware.
%
% 'windowPtr' A handle to the onscreen window.
% 'width' x 'height' The maximum size (in pixels) of the grating. More
% precise, the size of the mathematical support of the grating. Providing too
% small values here would 'cut off' peripheral parts or your grating. Too big
@iandol
iandol / sendSerial.m
Created March 17, 2011 11:41
sendSerial.m -- simple wrapper for Psych toolbox IOPort TTL output on DTR and RTS pins of serial port
classdef sendSerial < handle
%SENDSERIAL Connects and manages Serial port communication
% Connects and manages Serial port communication
properties
name='pci-serial0'
baudRate=115200
silentMode=0 %this allows us to be called even if no serial port is attached
verbosity=1
openNow=1 %allows the constructor to run the open method immediately
end
function out = uipickfiles(varargin)
%uipickfiles: GUI program to select files and/or folders.
%
% Syntax:
% files = uipickfiles('PropertyName',PropertyValue,...)
%
% The current folder can be changed by operating in the file navigator:
% double-clicking on a folder in the list or pressing Enter to move further
% down the tree, using the popup menu, clicking the up arrow button or
% pressing Backspace to move up the tree, typing a path in the box to move
@iandol
iandol / gist:899981
Created April 2, 2011 22:44
A global wrapper for both pnet (UDP and TCP) and pnet_remote (send/receive matlab objects). See http://144.82.131.18/optickadocs/classdata_connection.html for more details...
% ========================================================================
%> @brief dataConnection Connects and manages a socket connection
%>
%> Connects and manages TCP/UDP Communication. We allow both TCP and UDP
%> connections, and can choose to be a client or server in TCP mode. To use
%> at its simplest in UDP mode, both clients on the same machine:
%>
%> %OPEN CLIENT 1
%> >> d1=dataConnection('rPort',4321,'lPort',1234,'protocol','udp','autoOpen',1)
%> %OPEN CLIENT 2
@iandol
iandol / Console output
Created May 31, 2011 11:20
Bits++ logs
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriverUserClient::openUserClient(): Client connects to us :-)
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: GetGPUInfo(): Returning GPU info.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: GetLUTState(): Checking LUT and bias values on GPU for headId 0.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: SetDitherMode: Trying to disable digital display dithering on display head 0.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: SetDitherMode: Current dither setting before our dither disable on head 0 is 0xa960f100. Disabling.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: SetDitherMode: Trying to disable digital display dithering on display head 1.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: SetDitherMode: Dithering already disabled. Skipped.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: SetDitherMode: Trying to disable digital display dithering on display head 2.
31/05/2011 12:13:06 kernel PsychtoolboxKernelDriver: SetDithe
@iandol
iandol / Console log
Created May 31, 2011 11:59
New Bits++ logs
31/05/2011 12:52:47 kernel PsychtoolboxKernelDriverUserClient::openUserClient(): Client connects to us :-)
31/05/2011 12:52:47 kernel PsychtoolboxKernelDriver: GetGPUInfo(): Returning GPU info.
31/05/2011 12:52:47 kernel PsychtoolboxKernelDriver: GetLUTState(): Checking LUT and bias values on GPU for headId 0.
31/05/2011 12:52:47 kernel PsychtoolboxKernelDriver: GetLUTState(): Checking LUT and bias values on GPU for headId 0.
31/05/2011 12:52:58 kernel PsychtoolboxKernelDriver: SetDitherMode: Trying to disable digital display dithering on display head 0.
31/05/2011 12:52:58 kernel PsychtoolboxKernelDriver: SetDitherMode: Dithering already disabled. Skipped.
31/05/2011 12:52:58 kernel PsychtoolboxKernelDriver: SetDitherMode: Trying to disable digital display dithering on display head 1.
31/05/2011 12:52:58 kernel PsychtoolboxKernelDriver: SetDitherMode: Dithering already disabled. Skipped.
31/05/2011 12:52:58 kernel PsychtoolboxKernelDriver: SetDitherMode: Trying to disable digital display dithering on display
@iandol
iandol / CreateProceduralSineSquareGrating.m
Created June 5, 2011 13:14
Square wave gratings using GLSL functions for Psychophysics toolbox. Based on the standard sine shader, thus supports the same options, including radius of a circular mask.
function [gratingid, gratingrect] = CreateProceduralSineSquareGrating(windowPtr, width, height, backgroundColorOffset, radius, contrastPreMultiplicator)
% [gratingid, gratingrect] = CreateProceduralSineGrating(windowPtr, width, height [, backgroundColorOffset =(0,0,0,0)] [, radius=inf][, contrastPreMultiplicator=1])
%
% Creates a procedural texture that allows to draw sine grating stimulus patches
% in a very fast and efficient manner on modern graphics hardware.
%
% 'windowPtr' A handle to the onscreen window.
% 'width' x 'height' The maximum size (in pixels) of the grating. More
% precise, the size of the mathematical support of the grating. Providing too
% small values here would 'cut off' peripheral parts or your grating. Too big