Monday, November 04, 2013

Matlab Single Value Default Function

function default(varargin)
   param = [varargin{:} ';'];
   ind = find(param=='=');
   stmt = 'if ~exist(''%s'',''var'');%s;end';
   str = sprintf(stmt,param(1:(ind(1)-1)),[varargin{:}]);
   evalin('caller', str);
end


Example use

default x=2

Tuesday, October 22, 2013

Wednesday, August 28, 2013

Good observation

"Just as machine learning algorithms can overfit by tuning a classifier’s parameters to the
accidental properties of a training set, a research community can overfit by refining algorithms that
have already done well on the existing data sets"



Lewis, D. D.; Yang, Y.; Rose, T.; and Li, F. RCV1: A New Benchmark Collection for Text Categorization Research. Journal of Machine Learning Research, 5:361-397, 2004. http://www.jmlr.org/papers/volume5/lewis04a/lewis04a.pdf

Monday, July 22, 2013

Matlab Keyboard function

keyboard function is useful for debugging purposes. It stops execution of m file and allows user to watch and manipulate variables.

Wednesday, July 10, 2013

Matlab Jit Acceleration


Monday, July 01, 2013

Moving file to folder in HG versioning system

Just copy files into desired directory. Go into that directory and right click. Go to hg->guess renames. Rest is straightforward.

http://kiln.stackexchange.com/questions/1943/moving-a-file-in-a-repository

Semi Turing Test

A loosely definition for semi-Turing test is whether a human is capable to understand an output from human and output from computer aided human. For example If I am using spell checker , how someone can understand that I am doing so. It requires much more effort to distinguish.

Wednesday, April 03, 2013

Matlab Long Simulation Interactive Debug , Set Debug flag using GUI , Pause execution to debug

Create a button function:


function util_DebugGuiButtons()
global debugFlag;
uicontrol('Position',[30 10 35 40],'String','||','Callback',@wait);
uicontrol('Position',[70 10 35 40],'String','>>','Callback',@dontwait);
function wait(hObject,eventdata)
debugFlag = 1;
end

function dontwait(hObject,eventdata)
debugFlag = 0;
dbcont;
end
end



Define in top of document:
global debugFlag


Put this inside your loop :


    if (debugFlag)
        dbstop in file.m at line
end



Continue Button is not working as desired now. It just clears the breakpoints but does not issue dbcont command properly. I will try to figure out later.

Sunday, March 17, 2013

Comments on variables

Matlab displays comments of functions when you tend to use it. It would be good if it can show the comment of variables while holding mouse on top of variable name. This way can provide a tool to remember what each variable if for without using long descriptive variable names.

Monday, March 11, 2013

Wednesday, March 06, 2013

mouse and pencil

While being a student my life is accomodated with two items   mouse and pencil.So why we are not combining them . Put a wireless mouse pen to one side and put a pencil to other side. A gyro sensor can figure out if mouse is active.

Tuesday, March 05, 2013

Robot Dish Washer

It is difficult to create robot that cleans our arbitrary dirty dishes. However  , if we put some digital information on dishes (special designed for this machine) such as RFID , than robot can easily understand the shape , coordinates and features of the dish. In this way it will be easy to optimize the placement of the dishes based on current dirty dishes information.
I imagine we can create machine that has two part , first part is regular dish washer and second part is open area for dirty dishes and attached robot hands at top. It will increase the size of the machine , but it may worth , especially for big restaurants.

Friday, February 15, 2013

Monday, January 21, 2013

Wednesday, January 02, 2013

Display Array in NetBeans

Netbeans uses GDB:

http://stackoverflow.com/questions/1651682/how-to-watch-a-c-dynamic-array-using-gdb

AI

Despite the benefits of AI we are starving for humanity.