TODO: Write a project description
TODO: Describe the installation process
# Author: Abhinay Omkar | |
# Title: One-liner to download youtube video in Python | |
from urllib import urlopen, unquote; from urlparse import parse_qs, urlparse; youtube_watchurl="http://www.youtube.com/watch?v=NeSuirvA6UE&playnext_from=TL&videos=MS3Hq4oBj08"; video_id = parse_qs(urlparse(youtube_watchurl).query)['v'][0]; open(video_id+'.mp4', 'wb').write(urlopen("http://www.youtube.com/get_video?video_id=%s&t=%s&fmt=18"%(video_id, parse_qs(unquote(urlopen('http://www.youtube.com/get_video_info?&video_id=' + video_id).read().decode('utf-8')))['token'][0])).read()) |
target hw1 | |
sources | |
hw1.mlb | |
hw1.main.sml | |
end | |
option compiler = mlton | |
option output = hw1 | |
end |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace CodeMasters | |
{ | |
class Program | |
{ |
fun remove_duplicates (xs) = | |
case xs of | |
[]=>[] | |
| x::xs' => if List.exists (fn y=> x=y) xs' | |
then remove_duplicates (xs') | |
else x::remove_duplicates (xs') | |
val test_remove_duplicates = remove_duplicates ([3,3,3,3,5,5,5,5,6,6,6,6,7]) |
using System; | |
using System.Collections.Generic; | |
using System.Text; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace SomeNamespace | |
{ | |
/// <summary> | |
/// Check and report multiple conditions in unit tests. | |
/// |
<link href="http://yandex.st/highlightjs/7.0/styles/default.min.css" rel="stylesheet"> | |
<script src="http://yandex.st/highlightjs/7.0/highlight.min.js"></script> | |
<script type='text/javascript'> $(document).ready(function() { | |
function fixup(s) { | |
var re1 = new RegExp('<','g'), re2 = new RegExp('>','g'); | |
return s.replace(re1,'<').replace(re2,'>'); | |
} | |
$.ajax({type: "GET", | |
url: "https://api.github.com/gists/5617520", |
##Getting results from DialogFragments to another Fragment.
When setting up the DialogFragment make a call to Fragment.setTargetFragment()
Then from DialogFragment you can access the main fragment with
Fragment.getTargetFragment()
Use interfaces to provide the required actions to the calling Fragment.
##Example code.
###AddFriendDialogFragment - Calls back to calling fragment.
datatype 'a stream = Empty | Cons of 'a * (unit -> 'a stream) | |
fun from n = Cons(n, fn () => from(n +1)) | |
fun takeWhile f xs = | |
case xs of | |
Empty => Empty | |
| Cons(h,t) => if not(f(h)) | |
then Empty | |
else Cons(h, fn () => takeWhile f (t())) |
var INCR = 16; // Number of messages per page | |
var SENT_URL = '//www.linkedin.com/inbox/invitations/sent?startRow='; | |
var loMessageLinks = []; // Main array for all contacts | |
var fetchMessages = function(i, cb) { | |
console.log('Fetching message page #' + (i+1)); | |
$.get(SENT_URL + (i*INCR), function(data){ | |
var $dom = $(data); | |