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
% add and remove path | |
addpath(folder_name) | |
% generate recursive paths within a folder | |
genpath(folder_name) | |
% add all sub-directories in MATLAB path within a folder | |
addpath(genpath(folder_name)) | |
### Comment |
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
def get_subdirs_in_folder(folder): | |
# subdir_list = [] | |
# for path, subdirs, files in os.walk(folder): | |
# subdir_list.extend(subdirs) | |
dir_files = [os.path.join(folder,files) for files in os.listdir(folder)] | |
subdir_list = filter(os.path.isdir, dir_files) | |
return subdir_list |
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
// ======> get path of running jar file | |
// Solutions act funny for non-file locations | |
// Solution:1 | |
String path = MyClass.class.getProtectionDomain().getCodeSource().getLocation().getPath(); // gives path, acts funny if path has spaces | |
String decodedPath = URLDecoder.decode(path, "UTF-8"); // to solve problem related to whitespaces in path | |
// Solution:2 | |
// URLDecoder does not work for many special characters | |
// toURI is vital here as it takes care of URL encoding/decoding | |
String path = MyClass.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath(); |
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
package com.vaibhaw.imagesimilarity | |
import java.io.File; | |
import java.io.IOException; | |
import java.io.UnsupportedEncodingException; | |
import java.net.URL; | |
import java.net.URLDecoder; | |
public class Searcher { | |
static String jarPath = "."; |
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
for %a in ("%path:;=";"%") do @echo %~a | |
($env:Path).Replace(';',"`n") |
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
# based on https://gist.github.com/amirsani/d2aa0763cc138902bf73 | |
# Read this two also | |
# http://stackoverflow.com/questions/11443302/compiling-numpy-with-openblas-integration/14391693#14391693 | |
# http://osdf.github.io/blog/numpyscipy-with-openblas-for-ubuntu-1204-second-try.htmlhttp://osdf.github.io/blog/numpyscipy-with-openblas-for-ubuntu-1204-second-try.html | |
# OS dependencies | |
sudo apt-get install -y build-essential gfortran | |
sudo apt-get install -y git curl vim | |
# Python dependencies |
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
# search and replace strings | |
grep -rl search_string directory | xargs sed -i 's/string_to_replace/replace_string/g' | |
# bulk rename files in a folder | |
a=1 | |
for i in *.jpg; do | |
new=$(printf "sofa_%04d.jpg" "$a") #04 pad to length of 4 | |
mv -- "$i" "$new" | |
let a=a+1 | |
done |
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
# path_tools.bash | |
# Ref - http://stackoverflow.com/a/294025 | |
# A set of tools for manipulating ":" separated lists like the | |
# canonical $PATH variable. | |
# | |
# /bin/sh compatibility can probably be regained by replacing $( ) | |
# style command expansion with ` ` style | |
############################################################################### | |
# Usage: | |
# |
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
# fix the broken pipe problem || keep the server connection alive | |
http://www.howtogeek.com/howto/linux/keep-your-linux-ssh-session-from-disconnecting/ |
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
solver.prototxt | |
1. net: | |
2. snapshot_prefix: | |
3. solver_mode: | |
Optional | |
test_interval: | |
max_iter: | |
snapshot: |
OlderNewer