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
# https://www.tensorflow.org/get_started/eager | |
# Configure imports and eager execution | |
from __future__ import absolute_import, division, print_function | |
import os | |
import matplotlib.pyplot as plt | |
import tensorflow as tf | |
import tensorflow.contrib.eager as tfe |
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
################################################################################ | |
# E-mail tool in PowerShell | |
# | |
# 0. Set execution policy to "RemoteSighed" in PowerShell | |
# Set-ExecutionPolicy RemoteSigned | |
# | |
# 1. Right click this file and select "Run with PowerShell" from context menus. | |
# Or run the following command in cmd.exe. | |
# powershell -Sta -File send-message.ps1 | |
# |
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
#!/usr/bin/env python | |
# -*- mode: python; coding: utf-8 -*- | |
import sys | |
import os.path | |
import smtplib | |
if len(sys.argv) <= 2: | |
print('Usage:') | |
print(' $ python ' + sys.argv[0] + ' mailfrom rcptto <emlfile>') | |
print('') |
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
#!/usr/bin/env ruby | |
require "mkmf" | |
def cv_version_suffix(incdir) | |
major, minor, subminor = nil, nil, nil | |
open("#{incdir}/opencv2/core/version.hpp", 'r') { |f| | |
f.read.lines.each { |line| | |
major = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_EPOCH|CV_MAJOR_VERSION)\s+(\d+)\s*\Z/ | |
minor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MAJOR|CV_MINOR_VERSION)\s+(\d+)\s*\Z/ | |
subminor = $1.to_s if line =~ /\A#define\s+(?:CV_VERSION_MINOR|CV_SUBMINOR_VERSION)\s+(\d+)\s*\Z/ |
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
# | |
# INSERT query generator for Oracle | |
# | |
# Requirements: | |
# - Ruby 2.0 or later (https://www.ruby-lang.org/) | |
# - ruby-oci8 (gem install ruby-oci8) | |
# - Oracle Database | |
# | |
require 'oci8' |
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
require 'opencv' | |
# Prepare a sample image (I used an image in this article: http://opencv-srf.blogspot.se/2011/09/object-detection-tracking-using-contours.html) | |
# $ wget http://4.bp.blogspot.com/-r36OpIdjPWE/UDPMJ2kPFZI/AAAAAAAAAPs/-eO4W_XeDo0/s1600/FindingContours.png | |
cvMat = OpenCV::CvMat.load('FindingContours.png', 0) | |
img = cvMat.GRAY2BGR | |
polygons = [] | |
# CvMat#find_contours returns CvChain when the mode is CV_CHAIN_CODE, or returns CvContour when the mode is one of the others. |
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
using System; | |
namespace QuickSort | |
{ | |
class MainClass | |
{ | |
private static void quickSortInternal<Type>(Type[] array, int left, int right, Func<Type, Type, int> compare) | |
{ | |
if (left >= right) | |
{ |
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
;; -*- mode: lisp; coding: utf-8 -*- | |
(defun quick-sort(lst &optional (test-func #'<)) | |
(if (<= (length lst) 1) | |
lst | |
(let (upper | |
lower | |
(pivot (car lst))) | |
(dolist (v (cdr lst)) | |
(if (funcall test-func v pivot) |
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
// -*- mode: c; coding: utf-8 -*- | |
#include <stdio.h> | |
void quicksort_internal(int array[], int left, int right, int (*test_func)(int, int)) { | |
int pivot; | |
int i, j, tmp; | |
if (left >= right) { | |
return; | |
} |
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
;; -*- mode: lisp-interaction -*- | |
;; http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html | |
;; P01 | |
(defun my-last (lst) | |
(if (null lst) | |
nil | |
(if (null (cdr lst)) | |
lst | |
(my-last (cdr lst))))) |