Skip to content

Instantly share code, notes, and snippets.

COPY (
select r.cluster_id, r.token_array from hotel4x.review as r where
r.lang = 'en' and r.cluster_id in
(SELECT h.cluster_id
FROM hotel4x.hotel AS h
INNER JOIN (
SELECT s.cluster_id, COUNT(*) AS source_count
FROM hotel4x.source AS s
# Generic Aliases
alias ll='ls -latr' # List all file in long list format by modification time
alias ..='cd ..' # Go up one directory
alias ...='cd ../..' # Go up two directories
alias ....='cd ../../..' # Go up three directories
alias -- -='cd -' # Go back
alias c='clear' # Clear Screen
alias k='clear' # Clear Screen
alias cls='clear' # Clear Screen
alias _="sudo" # Execute with sudo
In [4]: np.arange(10).astype(object).mean(axis=0)
Out[4]: 4.5
In [5]: np.__version__
Out[5]: '1.8.1'
@mfcabrera
mfcabrera / min-char-rnn.py
Last active August 29, 2015 14:26 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@mfcabrera
mfcabrera / stream_sample.py
Last active August 29, 2015 14:27 — forked from anonymous/stream_sample.py
Stream sample
"""
Programming task
================
Implement the method iter_sample below to make the Unit test pass. iter_sample
is supposed to peek at the first n elements of an iterator, and determine the
minimum and maximum values (using their comparison operators) found in that
sample. To make it more interesting, the method is supposed to return an
iterator which will return the same exact elements that the original one would
have yielded, i.e. the first n elements can't be missing.
import java.io.IOException;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.SocketTimeoutException;
import java.net.URL;
import java.net.URLConnection;
import java.net.UnknownHostException;
/**
actconvenios.jar
actjuzgadosws.jar
acttutelasws.jar
anulacionws.jar
audiows.jar
axis-1.4.jar
axis-jaxrpc(CONFLICTO)-1.4.jar
barbecue-1.0.6b.jar
BrokerClient.jar
BrokerCommons.jar
<?xml version="1.0"?>
<application-server xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://xmlns.oracle.com/oracleas/schema/application-server-10_1.xsd" localhostIsAdmin="true"
application-directory="../applications"
check-for-updates="adminClientOnly"
deployment-directory="../application-deployments"
connector-directory="../connectors"
schema-major-version="10" schema-minor-version="0" >
<shared-library name="log4j" version="1.2.15">
require 'rubygems'
require 'bibtex'
b = BibTeX.open('./Sources_3_3_1.bib')
b.each { |citation|
if(citation.type != "comment" and ! citation.key.match(/^BR3/) )
citation.key = "BR3-#{citation.key}"
@mfcabrera
mfcabrera / tumlecturesgen.rb
Created October 9, 2012 13:21
Generation of Courses out of MyinTUM
require 'rubygems'
require 'open-uri'
require 'pp'
require 'nokogiri'
class Lecture
attr_accessor :module_id,:title,:ects, :cycle,:language,:area,:name
attr_reader :urlimytum
@@urlimytum_root = "https://drehscheibe.in.tum.de/myintum/kurs_verwaltung/"