Skip to content

Instantly share code, notes, and snippets.

@nkigen
nkigen / GooglePoints.cs
Created May 1, 2019 12:45 — forked from shinyzhu/GooglePoints.cs
Encode/Decode Polyline Algorithm Format in C#
/// <summary>
/// See https://developers.google.com/maps/documentation/utilities/polylinealgorithm
/// </summary>
public static class GooglePoints
{
/// <summary>
/// Decode google style polyline coordinates.
/// </summary>
/// <param name="encodedPoints"></param>
/// <returns></returns>
DECLARE @SQL NVARCHAR(MAX) = N'';
SELECT @SQL += N'
ALTER TABLE ' + OBJECT_NAME(PARENT_OBJECT_ID) + ' DROP CONSTRAINT ' + OBJECT_NAME(OBJECT_ID) + ';'
FROM SYS.OBJECTS
WHERE TYPE_DESC LIKE '%CONSTRAINT' AND OBJECT_NAME(PARENT_OBJECT_ID) = 'Your_TABLE';
PRINT @SQL
Add this to the watch name:
((System.Data.Entity.Validation.DbEntityValidationException)$exception).EntityValidationErrors
#! /bin/sh
# Generated by configure.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
@nkigen
nkigen / build_error.txt
Created July 16, 2016 16:40
Error When building DMTCP
DMTCP version: 2.5.0-rc2
Date built: Sat Jul 16 16:32:18 UTC 2016
config.log: ./configure
Linux alarm36 3.19.0-3-ARCH+ #1 SMP PREEMPT Wed Apr 20 03:03:00 UTC 2016 armv7l GNU/Linux
libc version: ldd (GNU libc) 2.23
Compiler: gcc
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/5.3.0/lto-wrapper
Target: armv7l-unknown-linux-gnueabihf
@nkigen
nkigen / autotools.sh
Created August 27, 2015 14:10
Install autotools in a custom location(If you arent part of the "sudoers")
myprefix=YOUR_CUSTOM_LOCATION
wget http://ftp.gnu.org/gnu/m4/m4-1.4.17.tar.gz
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
wget http://ftp.gnu.org/gnu/automake/automake-1.15.tar.gz
wget http://ftp.gnu.org/gnu/libtool/libtool-2.4.6.tar.gz
gzip -dc m4-1.4.17.tar.gz | tar xvf -
gzip -dc autoconf-2.69.tar.gz | tar xvf -
gzip -dc automake-1.15.tar.gz | tar xvf -
gzip -dc libtool-2.4.6.tar.gz | tar xvf -
cd m4-1.4.17
@nkigen
nkigen / glibc-error
Created March 12, 2015 15:40
Error when cross-compiling glibc
Applying patch: /home/nkigen/development/thesis/ubuild/specs/patches/glibc-2.16-no-libgcc_s.patch
Calling configure with: --prefix=/usr --with-headers=/var/tmp/ubuild.wandboard-armhf.build_dir/armv7a-hardfloat-linux-gnueabi/sysroot/usr/include --host=armv7a-hardfloat-linux-gnueabi --enable-bind-now --disable-profile --without-gd --without-cvs --disable-multi-arch --enable-obsolete-rpc --enable-kernel=2.6.9 --enable-add-ons=nptl,libidn,/var/tmp/ubuild.wandboard-armhf.build_dir/armv7a-hardfloat-linux-gnueabi/tools/usr/src/glibc-ports
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
checking build system type... x86_64-unknown-linux-gnu
checking host system type... armv7a-hardfloat-linux-gnueabi
checking for armv7a-hardfloat-linux-gnueabi-gcc... armv7a-hardfloat-linux-gnueabi-gcc
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether armv7a-hardfloat-linu
@nkigen
nkigen / mware_layers.sh
Created January 7, 2015 11:33
A script to cross compile ZeroMQ, ORTE and OpenDDS including the TAO-IDL compiler for an ARM target
#!/bin/bash
#(2014)Nelson Kigen<nellyk89@gmail.com>
set -x
#path to arm compiler
CC_PATH="/home/nkigen/development/tools/compilers/arm-2014.05/bin"
TARGET="arm-none-linux-gnueabi"
SRC_DIR="/home/nkigen/development/thesis/sources/src/"
BUILD_DIR=${SRC_DIR}"../build/"
OUTPUT_DIR=${SRC_DIR}"../output"
@nkigen
nkigen / super_kill.sh
Last active August 29, 2015 14:12
Kill processes that usually run in the background even after exiting (This script was initially targeted at the notorious viber :-) )
#!/bin/bash
#Kill processes that don't usually run in the background even after exiting
# (This script was initially targeted at the notorious viber :-) )
#nelson kigen<nellyk89@gmail.com>
SUDO_ACCESS="" #Optionally put your sudo pwd here
no_param(){
case "$1" in
"")