I'm having trouble storing a date into a Peewee DateField for SQLite. I keep getting "Invalid Date" What am I doing wrong? I've tried all three of the options below and all have the same result.
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 sys | |
word = sys.argv[1] # 'dad' | |
emoji = sys.argv[2] # 'parrot_dad' | |
letters = dict( | |
a=[ | |
[1, 1, 1, 1, 0], | |
[1, 0, 0, 1, 0], | |
[1, 0, 0, 1, 0], |
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
emoji = 'square' | |
letter = 'a' | |
letters = dict( | |
a=[ | |
[1, 1, 1, 1, 1, 0], | |
[1, 0, 0, 0, 1, 0], | |
[1, 0, 0, 0, 1, 0], | |
[1, 1, 1, 1, 1, 0], |
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
final = [u'Blokus Trigon', u'Coloretto', u'Friday (2)', u'Luna', u'Mancala (2)', u'Medieval Academy', u'No Thanks! (3)', u'Patchwork', u'Pi\xf1ata', u'Port Royal', u'Rhino Hero', u'Roll For It!', u'Rolling America', u'Star Realms', u'Tsuro'] | |
', '.join(final) | |
# results in | |
u'Blokus Trigon, Coloretto, Friday (2), Luna, Mancala (2), Medieval Academy, No Thanks! (3), Patchwork, Pi\xf1ata, Port Royal, Rhino Hero, Roll For It!, Rolling America, Star Realms, Tsuro' |
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
@course.route('/courses/<slug>_<id>/print/') | |
@course.route('/courses/<slug>_<id>/') | |
def show_course(slug=None, id=None): | |
# how do I know whether /print was used, or just normal? | |
pass |
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 StudentAssignments(BaseModel): | |
assignment = ForeignKeyField(Assignment) | |
student = ForeignKeyField(User) | |
grade = IntegerField(null=True) |
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
Given a text file with n numbers of rows, each containing a single integer, sorted in descending order, I want to group (by 10s) and count the results. So for the following content: | |
100 | |
100 | |
99 | |
87 | |
75 | |
75 | |
72 | |
69 |
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
scores = [ | |
('Andy', 85), | |
('Bob', 92), | |
('Cindy', 85), | |
('Dale', 89), | |
('Edmund', 81), | |
] | |
def place(scores): |
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
/*jshint camelcase: false*/ | |
module.exports = function (grunt) { | |
'use strict'; | |
// load all grunt tasks | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks('grunt-contrib-compress'); | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); |
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
// An existing code sample I have uses cURL (found below). | |
// But is there a reason why someone would use the second example instead of the first example? | |
// They both appear to do the exact same thing, but the first one is MUCH simpler. | |
// Thoughts? | |
<?php | |
$response = file_get_contents("http://feeds.arstechnica.com/arstechnica/index?format=xml"); | |
print_r($response); | |
?> |