This file contains hidden or 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
/* | |
* To change this template, choose Tools | Templates | |
* and open the template in the editor. | |
*/ | |
import a_vcard.android.syncml.pim.PropertyNode; | |
import a_vcard.android.syncml.pim.VDataBuilder; | |
import a_vcard.android.syncml.pim.VNode; | |
import a_vcard.android.syncml.pim.vcard.VCardException; | |
import a_vcard.android.syncml.pim.vcard.VCardParser; |
This file contains hidden or 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
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.LinearLayout; |
This file contains hidden or 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
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Bundle; | |
import android.view.KeyEvent; | |
import android.view.View; | |
import android.widget.Button; | |
import android.widget.EditText; | |
import android.widget.LinearLayout; |
This file contains hidden or 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
/** | |
* Get either a Gravatar URL or complete image tag for a specified email address. | |
* | |
* @param string $email The email address | |
* @param string $s Size in pixels, defaults to 80px [ 1 - 512 ] | |
* @param string $d Default imageset to use [ 404 | mm | identicon | monsterid | wavatar ] | |
* @param string $r Maximum rating (inclusive) [ g | pg | r | x ] | |
* @param boole $img True to return a complete IMG tag False for just the URL | |
* @param array $atts Optional, additional key/value attributes to include in the IMG tag | |
* @return String containing either just a URL or a complete image tag |
This file contains hidden or 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
$string = <<<EOF | |
<p dir="rtl"> | |
ุฃููููุงู ููุชูุฏูุจููุฑูููู ุงููููุฑูุขูู ูููููู ููุงูู ู ููู ุนููุฏู ุบูููุฑู ุงููููู ููููุฌูุฏููุงู ููููู ุงุฎูุชููุงูููุง ููุซููุฑูุง | |
</p> | |
EOF; | |
preg_match('/<p dir=(?:"rtl"|\'rtl\')>([\x{0600}-\x{06FF}\x{0750}-\x{077F}\x{FB50}-\x{FDFF}\x{FE70}-\x{FEFF} \r\n]+)<\/p>/um', $string, $matches); | |
$match = $matches[1]; |
This file contains hidden or 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/perl -w | |
use strict; | |
while (my $line=<>) { | |
my ($date, $host, $url_with_method, $status, $size, $referrer, $agent) = $line =~ | |
m/^\S+\s+\S+\s+\[(\S+\s+[\-|\+]\d{4})\]\s+(\S+)\s+\S+\s+\S+\s+\S+\s+\S+\s+"(\S+\s+\S+\s+[^"]+)"\s+(\d{3})\s+\S+\s+(\d+|-)\s+\d+\s+\d+\s+\d+\s+"(.*?)"\s+"(.*?)"/; | |
# Print relevant bits | |
} |
This file contains hidden or 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
Since you use JSONP, you should code it like this IMHO : | |
$.ajax(URL, { | |
crossDomain:true, | |
dataType: "jsonp", | |
success:function(data,text,xhqr){ | |
$.each(data, function(i, item) { | |
alert(item); | |
}); | |
} |
This file contains hidden or 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
import re, random | |
def shuffle_one(word): | |
if len(word) <= 3: | |
return word | |
middle = list(word[1:-1]) | |
random.shuffle(middle) | |
return word[0] + ''.join(middle) + word[-1] |
This file contains hidden or 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 | |
cd /path/to/backup/directory | |
for file in *.tgz | |
do | |
name=${file%%[.]*} | |
echo $name | |
if [ $name = $current_backup_name ] | |
then | |
# do new backup here | |
# delete older one here |
This file contains hidden or 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
if (!Util) { | |
var Util = {}; | |
} | |
Util.ResourceManager = function(culture, resourcePath) | |
{ | |
this.createResObj(culture, resourcePath); | |
} | |
Util.ResourceManager.prototype = |