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
import pymongo, gridfs | |
conn = pymongo.Connection('localhost') | |
fs = gridfs.GridFS(conn.test) | |
fid = fs.put('hello', filename='1st') | |
fid | |
# ObjectId('4beb91f78caf495b3e000000') | |
fid2 = fs.put('hello 2', filename='2nd', _id=fid) | |
fid2 | |
# ObjectId('4beb91f78caf495b3e000000') | |
fs.list() |
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
public void onStatus(StatusEvent e) { | |
final RobotStatus s = e.getStatus(); | |
others = peer.getOthers(); |
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
62c62 | |
< self._config_section = "engine/Table/%s" % self._name.replace(' ','_') | |
--- | |
> self._config_section = "engine/Table/%s" % self._name | |
83c83 | |
< # self._cursor: the caret position in preedit phrases | |
--- | |
> # self._cursor: the caret position in preedit phrases | |
103,106c103,107 | |
< self._chinese_mode = self._config.get_value ( |
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
def count_down(self, counting=3): | |
''' called before manauton ''' | |
label = 'Prepare to speak: ' | |
for i in xrange(counting): | |
label += str(counting - i) + '... ' | |
threading.Thread(target=self.hint_label.set_text, args=(label,)).start() | |
time.sleep(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
public void gotoCoordinate(int x, int y) | |
{ | |
// using Pythagoras' theorem to get the distance to travel | |
int goto_distance = (int) Math.sqrt( | |
(double) (x - robotX) * (x - robotX) |
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
import robocode.util.Utils; | |
import robocode.JuniorRobot; | |
public class Example extends JuniorRobot { | |
public void random_movement() | |
{ |
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
public void run() { | |
if (others < 1) { // see http://robocode.cs.cityu.edu.hk/javadoc/robocode/JuniorRobot.html#others | |
// won | |
setColors( ... ); | |
} | |
: | |
: |
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/sh | |
# | |
# A git hook script to find and fix trailing whitespace | |
# in your commits. Bypass it with the --no-verify option | |
# to git-commit | |
# Ref - http://is.gd/PerowD | |
# | |
if git rev-parse --verify HEAD >/dev/null 2>&1 | |
then |
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
class Tag(models.Model): | |
""" | |
A tag. | |
""" | |
name = models.CharField(_('name'), max_length=50, unique=True, db_index=True) | |
objects = TagManager() | |
class Meta: | |
ordering = ('name',) |
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
Index: civicrm-4.0.4/CRM/Mailing/BAO/Mailing.php | |
diff --git a/civicrm-4.0.4/CRM/Mailing/BAO/Mailing.php b/civicrm-4.0.4/CRM/Mailing/BAO/Mailing.php | |
index 2ee9ac79f89bed1232858c75b8c6a180a3335c91..f926712922a4d3ec6c38ad16d495f12d6db76945 100644 | |
--- a/civicrm-4.0.4/CRM/Mailing/BAO/Mailing.php | |
+++ b/civicrm-4.0.4/CRM/Mailing/BAO/Mailing.php | |
@@ -1130,7 +1130,6 @@ AND civicrm_mailing.id = civicrm_mailing_job.mailing_id"; | |
$headers['To'] = "$toName <$toEmail>"; | |
- $headers['Precedence'] = 'bulk'; |
OlderNewer