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/python | |
import os | |
import sys | |
import time | |
import resource | |
import signal | |
RUNNING_DIR = "/tmp" | |
LOCK_FILE = "pydaemond.lock" |
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
#include <stdio.h> | |
int _fact(int n){ | |
if(n <= 1) | |
return 1; | |
return n*_fact(n-1); | |
} |
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/python | |
import ctypes | |
import timeit | |
def fact(n): | |
if n <= 1: | |
return 1 | |
return n * fact(n-1) | |
if __name__ == "__main__": | |
t1 = timeit.Timer() |
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
$("head").append("<link>"); | |
css = $("head").children(":last"); | |
css.attr({ | |
rel: "stylesheet", | |
type: "text/css", | |
href: css_link | |
}); |
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
$("head").append("<style>;"); | |
var style = $("head").children(":last"); | |
style.attr({ | |
type: "text/css" | |
}); | |
for(var index in fonts){ | |
var font = fonts[index]; | |
var font_details = resultobj[font]; | |
var css_link = pathname + "?font="+font; | |
$("head").append("<link>"); |
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
<intent-filter> | |
<action android:name="android.intent.action.VIEW"/> | |
<category android:name="android.intent.category.DEFAULT"/> | |
<category android:name="android.intent.category.BROWSABLE"/> | |
<data android:scheme="OauthTwitter" android:host="twitt"/> | |
</intent-filter> |
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
private static final String CONSUMER_KEY = "Your consumer key"; | |
private static final String CONSUMER_SECRET = "Your consumer secret"; | |
private static String ACCESS_KEY = null; | |
private static String ACCESS_SECRET = null; | |
private static final String REQUEST_URL = "http://twitter.com/oauth/request_token"; | |
private static final String ACCESS_TOKEN_URL = "http://twitter.com/oauth/access_token"; | |
private static final String AUTH_URL = "http://twitter.com/oauth/authorize"; |
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
btnLogin = (Button) findViewById(R.id.btnLogin); | |
btnLogin.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
try { | |
String authURL = provider.retrieveRequestToken( | |
consumer, CALLBACK_URL); | |
Log.d("OAuthTwitter", authURL); |
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
@Override | |
public void onResume() { | |
super.onResume(); | |
Uri uri = this.getIntent().getData(); | |
if (uri != null && uri.toString().startsWith(CALLBACK_URL)) { | |
Log.d("OAuthTwitter", uri.toString()); | |
String verifier = uri.getQueryParameter(OAuth.OAUTH_VERIFIER); | |
Log.d("OAuthTwitter", verifier); | |
try { |
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
package com.vasudev.msgdigest; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import android.app.Activity; | |
import android.app.AlertDialog; | |
import android.os.Bundle; | |
import android.view.View; | |
import android.view.View.OnClickListener; |
OlderNewer