Skip to content

Instantly share code, notes, and snippets.

View Drewch's full-sized avatar

Andrew McNamara Drewch

View GitHub Profile
<dev-libs/openssl-0.9.8
import numpy as np
from keras.models import Sequential
from keras.layers.recurrent import LSTM
from keras.preprocessing import sequence
from keras.layers.embeddings import Embedding
from keras.layers.core import Dense, Activation
from keras.optimizers import SGD
from keras.layers import TimeDistributed
#from keras.layers.embeddings import Layer, Embedding
@Drewch
Drewch / fstab
Last active July 26, 2016 22:06
Gentoo latest stage3 genkernel all failure
# /etc/fstab: static file system information.
#
# noatime turns off atimes for increased performance (atimes normally aren't
# needed); notail increases performance of ReiserFS (at the expense of storage
# efficiency). It's safe to drop the noatime options if you want and to
# switch between notail / tail freely.
#
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
@Drewch
Drewch / error.log
Created August 12, 2014 15:39
Restaurant query error
org.apache.cxf.interceptor.Fault: org/maluuba/service/docktypes/SortOrder
at org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:167)
at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:94)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
@Drewch
Drewch / IteratorIterator.java
Last active August 29, 2015 13:57
IteratorIterator Interview Question
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import javax.naming.OperationNotSupportedException;
/**
* An iterator that flattens an iterator of iterators.
@Drewch
Drewch / Collection
Last active December 29, 2015 05:39
MongoDB TTL Index
{
"_id" : ObjectId("52927978ee7f10541d74490e"),
"status" : ISODate("2013-11-24T22:11:04.352Z"),
"data" : 1
}
@Drewch
Drewch / logs
Last active December 22, 2015 01:39
Cookie not being set in sessions_controller.rb, but it works fine in pages_controller.rb
I, [2013-08-31T10:13:09.209516 #40075] INFO -- : Started GET "/auth/google" for 127.0.0.1 at 2013-08-31 10:13:09 -0400
I, [2013-08-31T10:13:09.209547 #40075] INFO -- : Started GET "/auth/google" for 127.0.0.1 at 2013-08-31 10:13:09 -0400
I, [2013-08-31T10:13:09.218944 #40075] INFO -- omniauth: (google) Request phase initiated.
I, [2013-08-31T10:13:09.220953 #40075] INFO -- OpenID: WARNING: making https request to https://www.google.com/accounts/o8/id without verifying server certificate; no CA path was specified.
I, [2013-08-31T10:13:09.717991 #40075] INFO -- OpenID: Generated checkid_setup request to https://www.google.com/accounts/o8/ud with assocication 1.AMlYA9Uww5yHUlnMTHlGU_NEA3lFC-PukLjLnGNTXehDfpWQ56ePaSRJA7R1YQ
D, [2013-08-31T10:13:17.611396 #40075] DEBUG -- :
D, [2013-08-31T10:13:17.611614 #40075] DEBUG -- :
D, [2013-08-31T10:13:17.611812 #40075] DEBUG -- :
D, [2013-08-31T10:13:17.611864 #40075] DEBUG -- :
I, [2013-08-31T10:13:17.612552 #40075] INFO -- : Started GET "/auth/google/callback?_met
@Drewch
Drewch / gist:6392261
Created August 30, 2013 17:24
xpath-filter configuration that does not work properly because the field name is the same inside two separate properties. This causes nutch to insert the proper name twice for each property, because of an bug in xpath-filter indexer.
<?xml version="1.0" encoding="UTF-8"?>
<xpathFilterConfiguration>
<!-- List of properties -->
<!-- (O)pageUrlFilterRegex: If supplied the xpath-field mapping will be evaluated only on
the urls that match the regex (DEFAULT: ALL URLS WILL BE INCLUDED) -->
<!-- (O)pageContentFilterXPath: Evaluate the pageContentFilterRegex on the data of this
xpath expression -->
<!-- (O)concatPageContentFilterXPathData: If the xpath return multiple nodes defines if
they should be concatenated (DEFAULT: FALSE) -->
<!-- ONLY IF pageContentFilterXPath DEFINED -->
@Drewch
Drewch / .zprofile
Last active January 14, 2016 16:45
This is my path with zsh. One is when I initially set my path as follows: PATH=/default/zsh/setup/path:$PATH and the other as PATH=$PATH:/default/zsh/setup/path. It's worth noting that RVM only works properly when I use the latter. Apologies I can't use / in the file name.
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
@Drewch
Drewch / gist:5449462
Created April 24, 2013 03:45
mysql error in rails c
>> require 'mysql'
LoadError: cannot load such file -- mysql
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/backports-3.3.0/lib/backports/tools.rb:328:in `require'
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/backports-3.3.0/lib/backports/tools.rb:328:in `require_with_backports'
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
from (irb):1
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
from /Users/Drewch/.rvm/gems/ruby-1.9.3-p392@MaluubaAnalytics/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `st