Skip to content

Instantly share code, notes, and snippets.

View faraday's full-sized avatar

Çağatay Çallı faraday

View GitHub Profile
anonymous
anonymous / gist:398234
Created May 12, 2010 05:16
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/top_control_bar">
<Spinner android:id="@+id/sort_by" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:entries="@array/default_sorts" />
</RelativeLayout>
<LinearLayout android:id="@+id/bottom_control_bar"
import bisect
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state
/**
This code snippet shows how an Android activity can trigger a web based auth using webview and then use
the cookies from there to make subsequent calls to an API (since the api is checking the cookies to detect
sign in)
MyApplication: The root "controller" and the first activity in my app
OAuthLogin: A class that handles the web based login.
It montors the url change and if the user had been redirected to
a "success" page it sends out the cookie string to the root controller
Once the controller has the cookie, it sets those on the service that
@faraday
faraday / multi.c
Created May 27, 2011 00:05
Extract audio features with libxtract, from Mp3 input read using Gstreamer
#ifndef MULTI.C
#define MULTI.C
#include <gst/gst.h>
#include <xtract/libxtract.h>
#include <sys/types.h>
#include <dirent.h>
#include <string.h>
#include <math.h>
@espeed
espeed / bulbs03_example.py
Created January 20, 2012 21:31
Bulbs 0.3 Neo4j Server Example
from bulbs.config import Config
from bulbs.gremlin import Gremlin
from bulbs.model import Node, NodeProxy
from bulbs.property import String, Integer
from bulbs.element import Vertex, VertexProxy, EdgeProxy, Edge
from bulbs.neo4jserver import Neo4jResource, NEO4J_URI, \
VertexIndexProxy, EdgeIndexProxy, ExactIndex
class Person(Node):
@entaroadun
entaroadun / gist:1653794
Created January 21, 2012 20:10
Recommendation and Ratings Public Data Sets For Machine Learning

Movies Recommendation:

Music Recommendation:

@romannurik
romannurik / SwipeDismissListViewTouchListener.java
Last active August 5, 2025 08:10
**BETA** Android 4.0-style "Swipe to Dismiss" sample code
Moved to
https://github.com/romannurik/android-swipetodismiss
@tzengyuxio
tzengyuxio / gist:4284108
Created December 14, 2012 09:44
Fetch IMDb Top 250 into CSV file.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib2
import HTMLParser
import csv
import datetime
import codecs, cStringIO # for UnicodeWriter
response = urllib2.urlopen('http://www.imdb.com/chart/top')
@mnot
mnot / iri_to_uri.py
Created January 20, 2013 03:15
Convert an IRI to a URI
import urllib
import urlparse
def iri_to_uri(iri, encoding='Latin-1'):
"Takes a Unicode string that can contain an IRI and emits a URI."
scheme, authority, path, query, frag = urlparse.urlsplit(iri)
scheme = scheme.encode(encoding)
if ":" in authority:
host, port = authority.split(":", 1)
authority = host.encode('idna') + ":%s" % port
---------- Forwarded message ----------
From: Daniel Bauer <@cs.columbia.edu>
Date: Thu, Feb 21, 2013 at 6:19 PM
Subject: Mon 2/25 - Brendan O'Connor
To: nlp-announce
Cc: Brendan O'Connor <[email protected]>
Dear all,