Skip to content

Instantly share code, notes, and snippets.

View chesnerdesir's full-sized avatar

Chesner Desir chesnerdesir

View GitHub Profile
@chesnerdesir
chesnerdesir / get_paths_from_dict.py
Last active May 12, 2019 11:43
Walk and extract recursively from a given dictionary all available complete paths to data values (from root to leaf) as a list of nested nodes (fields or keys), in Python.
"""
Walk and extract recursively from a given dictionary all available complete paths to data values, including nodes that are nested lists of dictionaries (from root to leaf) as a list of nested nodes.
"""
import copy
def get_paths_from_dict(in_dict, io_final_list=None, io_temp_list=None, in_extract_list=True) -> list:
"""
Walk and extract all available complete paths to data values as a list of nested nodes from dictionary, recursively.
The method also handles dictionaries within nested lists (a specific pattern is used for indexing list elements)
@chesnerdesir
chesnerdesir / build.gradle
Created February 19, 2015 17:20
NDK configuration, default folders and paths
import org.apache.tools.ant.taskdefs.condition.Os
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.13.0'
}
}
@chesnerdesir
chesnerdesir / osx_apps
Last active August 29, 2015 14:10
Useful apps for OSX
EDITOR
-cotEditor : Text editor - http://coteditor.com
DEVELOPMENT
-Code::blocks : IDE C++/Fortran - http://www.codeblocks.org
FILE EXPLORER
-XtraFinder : add features to the standard Finder - http://www.trankynam.com/xtrafinder/
-MuCommander : dual-pane interface explorer - http://www.mucommander.com
@chesnerdesir
chesnerdesir / matlab_permission_denied
Last active August 29, 2015 14:00
matlab_permission_denied problem
chmod u+x ../Documents/matlab64/bin/glnxa64/MATLAB
sudo ln -s /lib/x86_64-linux-gnu/libc-2.19.so /lib64/libc.so.6
#sudo ln -s /usr/lib/x86_64-linux-gnu/libicudata.so.52.1 /usr/lib64/libicudata.so.44
sudo ln -s /usr/lib/x86_64-linux-gnu/libicudata.so.52.1 /lib/libicudata.so.44
# Configuration file for Logitech Marble Mouse trackball
# Works for Debian/testing-Jessie
# See detailed configuration : https://wiki.archlinux.org/index.php/Logitech_Marble_Mouse
# put this file "50-marblemouse.conf" under /usr/share/X11/xorg.conf.d/ or /etc/X11/xorg.conf.d/
#
# - - - Logitech Marble Mouse Settings - - -
#
# The Logitech Marble Mouse buttons are mapped [A-D] from left to right:
# A (large); B (small) | C (small); D (large).
#
#In case of errors of type section without header whil eupdating or installing packages
#Tested in Ubuntu Precise 12.04
sudo rm /var/lib/apt/lists/* -vf
sudo apt-get update
Dialog dialog = new Dialog(this, R.style.full_screen_dialog) {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.choose_device_name_dialog);
getWindow().setLayout(LayoutParams.FILL_PARENT,
LayoutParams.FILL_PARENT);
}
};
final Dialog dialog = new Dialog(this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
dialog.setContentView(R.layout.splash);
dialog.show();