When adding library dependencies, make sure they dlls are targeting the same .Net framework as the project. took me ~12 hours to figure out that i was using a dll with 4.5.2 in place of 4.5. couldnt figure out wth was going on, why the build was failing
...this is a log of code snippets and useful tips I wrote/found. Should you find any mistakes or have any useful suggestions, please do not hesitate to write to me.
Wednesday, June 28, 2017
Friday, June 16, 2017
ubuntu login loop while nvidia driver update
got into a login loop, when i updated my nvidia driver. not sure what fixed the issue. But i just uninstalled and reinstalled the driver from the shell and the login loop was gone.
Monday, April 24, 2017
Filtering in excel using a list of values
https://www.extendoffice.com/documents/excel/3186-excel-filter-rows-by-list.html
Wednesday, March 8, 2017
Monday, February 6, 2017
Most frequently occuring data in a row
=INDEX(B2:D2,MODE(MATCH(B2:D2,B2:D2,0)))
can be used for example to count votes
can be used for example to count votes
Splitting a colum into multiple columns Excel
=INDIRECT("Sheet1!R" & (ROW()-1)*3+1 & "C1", FALSE)
Say you have a long oclumn of data. You want to split it into 3 columns such that, every third element goes into each column. for example youd data is: AAABBBCCCDDDEEEFFFGGGHHH
you want to split into 3 columns : ABCDEFGH, ABCDEFGH, ABCDEFGH. use the above formula
Say you have a long oclumn of data. You want to split it into 3 columns such that, every third element goes into each column. for example youd data is: AAABBBCCCDDDEEEFFFGGGHHH
you want to split into 3 columns : ABCDEFGH, ABCDEFGH, ABCDEFGH. use the above formula
Tuesday, December 6, 2016
Wednesday, October 12, 2016
Friday, June 5, 2015
Wednesday, April 8, 2015
the command 'sl'
do you know about the command sl in unix? I ran into it when I typed it by mistake instead of 'ls'try it out and try not to get run over by the train :)
Tuesday, March 31, 2015
'cut' - in place file change: can't do
We cannot run a cut command on a file and change it in place For example:
cut -d',' -f -3 abc.txt>abc.txt
the above command leads to an empty abc.txt file
cut -d',' -f -3 abc.txt>abc.txt
the above command leads to an empty abc.txt file
Friday, February 6, 2015
Perceptually different colors
Sometimes, you need a plot which compares about 10 different methods. In that case there is a particular need for each line in the plots to look different, here is a neat function:(big thanks to harsh agrawal for finding this)
http://www.mathworks. com/matlabcentral/ fileexchange/29702-generate- maximally-perceptually- distinct-colors/content// distinguishable_colors.m
http://www.mathworks.
Friday, January 30, 2015
Friday, September 5, 2014
Script to create in a bash script
Here is a shell script I use to create multiple nohup commands and put them in bash script called scripts1to100.txt. Each nohup command runs a matlab function called runFunctionWithVariablesAandB which takes a and b as inputs.
for i in {1..100};
do
let a=(i-1)*100+1;
let b=i*100;
echo nohup matlab -nodisplay -nosplash -r \"runFunctionWithVariablesAandB\($a:$b\)\; exit\;\" \> \/home\/logs\/batch$i.log \& >>scriptsFor1to100.txt;
done
Once script1to100.txt is ready, you can run it by calling 'bash script1to100.txt'
Note: This particular script launches 100 parallel runs of runFunctionWithVariablesAandB, each with a different set of inputs.
for i in {1..100};
do
let a=(i-1)*100+1;
let b=i*100;
echo nohup matlab -nodisplay -nosplash -r \"runFunctionWithVariablesAandB\($a:$b\)\; exit\;\" \> \/home\/logs\/batch$i.log \& >>scriptsFor1to100.txt;
done
Once script1to100.txt is ready, you can run it by calling 'bash script1to100.txt'
Note: This particular script launches 100 parallel runs of runFunctionWithVariablesAandB, each with a different set of inputs.
Tuesday, September 2, 2014
Inserting text in visual mode in vim
Steps:
1) Ctrl+v (takes you to visual mode)
2) up/down/left/right arrows to select location for inserting text.
3) Gto select all lines in the file
4) Actual commands for inserting: 'I' takes to insert mode
5) type the text you want to insert. It gets inserted in the first line
6) hit Esc. the inserting done in all the lines you selected.
1) Ctrl+v (takes you to visual mode)
2) up/down/left/right arrows to select location for inserting text.
3) Gto select all lines in the file
4) Actual commands for inserting: 'I' takes to insert mode
5) type the text you want to insert. It gets inserted in the first line
6) hit Esc. the inserting done in all the lines you selected.
Friday, August 29, 2014
Thursday, August 28, 2014
checking for a field in struct matlab
To check if stuct S has a field called 'fieldName', use:
isfield(S, 'fieldname')
isfield(S, 'fieldname')
Tuesday, August 19, 2014
Changes to run BING (objectness)
General changes to run on our servers:
-- In the objectness folder: change line 15:
from
set(OPENMP_FLAG "-fopenmp -std=c++11 -ftree-vectorize")
to
set(OPENMP_FLAG "-fopenmp -std=c++0x -ftree-vectorize")
--Put absolute path to the dataset as opposed to relativepath in Main.cpp
Specific changes to make it compaible with ImageNet:
in Objectness/CmFile.cpp line number: added these lines:
415 if (line.find (' ') != string::npos)
416 {
417 int position = line.find (' ');
418 strs.push_back(line.substr(0,position));
419 }
420 else
421 strs.push_back(line);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
The xml annotation file had some inconsistencies for imagenet:
ILSVRC2012_val_00029561.xml
ILSVRC2012_val_00047711
ILSVRC2012_val_00037916
ILSVRC2012_val_00027851
ILSVRC2012_val_00008272
ILSVRC2012_val_00004948
ILSVRC2012_val_00000400
ILSVRC2012_val_00008009
ILSVRC2012_val_00019545
ILSVRC2012_val_00032716
ILSVRC2012_val_00000922
ILSVRC2012_val_00023854
ILSVRC2012_val_00035744
ILSVRC2012_val_00019316
ILSVRC2012_val_00021400
ILSVRC2012_val_00004522
ILSVRC2012_val_00006974
and many more. this cannot be done manually.!
(the coordinates cannot be 0 in matlab!)
%%%%%%%%%%%%%%%
The changes in everything above xml file issues can be ignored
-- In the objectness folder: change line 15:
from
set(OPENMP_FLAG "-fopenmp -std=c++11 -ftree-vectorize")
to
set(OPENMP_FLAG "-fopenmp -std=c++0x -ftree-vectorize")
--Put absolute path to the dataset as opposed to relativepath in Main.cpp
Specific changes to make it compaible with ImageNet:
in Objectness/CmFile.cpp line number: added these lines:
415 if (line.find (' ') != string::npos)
416 {
417 int position = line.find (' ');
418 strs.push_back(line.substr(0,position));
419 }
420 else
421 strs.push_back(line);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
The xml annotation file had some inconsistencies for imagenet:
ILSVRC2012_val_00029561.xml
ILSVRC2012_val_00047711
ILSVRC2012_val_00037916
ILSVRC2012_val_00027851
ILSVRC2012_val_00008272
ILSVRC2012_val_00004948
ILSVRC2012_val_00000400
ILSVRC2012_val_00008009
ILSVRC2012_val_00019545
ILSVRC2012_val_00032716
ILSVRC2012_val_00000922
ILSVRC2012_val_00023854
ILSVRC2012_val_00035744
ILSVRC2012_val_00019316
ILSVRC2012_val_00021400
ILSVRC2012_val_00004522
ILSVRC2012_val_00006974
and many more. this cannot be done manually.!
(the coordinates cannot be 0 in matlab!)
%%%%%%%%%%%%%%%
The changes in everything above xml file issues can be ignored
Subscribe to:
Posts (Atom)