Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
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
// SymSpell: 1000x faster through Symmetric Delete spelling correction algorithm | |
// | |
// The Symmetric Delete spelling correction algorithm reduces the complexity of edit candidate generation and dictionary lookup | |
// for a given Damerau-Levenshtein distance. It is three orders of magnitude faster and language independent. | |
// Opposite to other algorithms only deletes are required, no transposes + replaces + inserts. | |
// Transposes + replaces + inserts of the input term are transformed into deletes of the dictionary term. | |
// Replaces and inserts are expensive and language dependent: e.g. Chinese has 70,000 Unicode Han characters! | |
// | |
// Copyright (C) 2012 Wolf Garbe, FAROO Limited | |
// Version: 1.6 |
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
# Convert Hashes to CSV easily | |
# source.rb | |
# | |
# { valid: "ruby", hash: "" } | |
# { another: "valid", ruby: "hash" } | |
# { etc... | |
# usage: | |
# |
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
int xPos = (canvas.getWidth() / 2); | |
int yPos = (int) ((canvas.getHeight() / 2) - ((textPaint.descent() + textPaint.ascent()) / 2)) ; | |
//((textPaint.descent() + textPaint.ascent()) / 2) is the distance from the baseline to the center. | |
canvas.drawText("Hello", xPos, yPos, textPaint); |
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
require 'net/http' | |
class HttpClient | |
def initialize(base_url, username = nil, password = nil) | |
@base_url = base_url | |
@username = username | |
@password = password | |
end | |
def get(path, headers = {}) |
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
Using gem aws-sdk for a ror application for uploading images to s3 | |
Uploading images to a fixed bucket with different folders for each object or application. | |
The s3 keeps a limitation on the number of buckets creattion whereas there is no | |
limitation for content inside a bucket. | |
This code will upload image for a user to s3 using aws-sdk gem. The bucket and the image uploaded are made public | |
so that the images uploaded are directly accessible. The input it takes is the image complete path | |
where it is present, folder in which it should be uploaded and user_id for whom it should | |
be uploaded. |
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
#!/bin/bash | |
# remove __MACOSX foldr and .DS_Store files | |
# from *_original.zip file | |
# zip again and place under fixed/* | |
for x in $* | |
do | |
unzip $x |
- Close Android File Transfer
- Open Activity Monitor and kill “Android File Transfer Agent”
- Go to where you installed “Android File Transfer.app” (I have it under /Applications)
- Ctrl+click –> “Show package contents”
- Go to Contents/Resources
- Rename “Android File Transfer Agent” to e.g. “Android File Transfer Agent_DISABLED”
- Then go to “/Users/username/Library/Application Support/Google/Android File Transfer” and again rename the Agent app.
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
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |
OlderNewer