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 hashlib as hasher | |
import datetime as date | |
# Define what a Snakecoin block is | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp | |
self.data = data | |
self.previous_hash = previous_hash |
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
# The MIT License (MIT) | |
# Copyright (c) 2014 Lycaon (lycaon.me) | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
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 Pet(object): | |
def __init__(self, name, species): | |
self.name = name | |
self.species = species | |
def getName(self): | |
return self.name | |
def getSpecies(self): |
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
{ | |
"created_at": "Fri Sep 19 12:20:23 +0000 2014", | |
"id": 512939257850511360, | |
"id_str": "512939257850511360", | |
"text": "\"I never used the Blackberry again.\" https://t.co/CYsbbBDtOh", | |
"source": "<a href=\"http://radio3.io/\" rel=\"nofollow\">radio3.io</a>", | |
"truncated": false, | |
"in_reply_to_status_id": null, | |
"in_reply_to_status_id_str": null, | |
"in_reply_to_user_id": null, |
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
{ | |
"created_at": "Fri Sep 19 12:20:23 +0000 2014", | |
"id": 512939257850511360, | |
"id_str": "512939257850511360", | |
"text": "\"I never used the Blackberry again.\" https://t.co/CYsbbBDtOh", | |
"source": "<a href=\"http://radio3.io/\" rel=\"nofollow\">radio3.io</a>", | |
"truncated": false, | |
"in_reply_to_status_id": null, | |
"in_reply_to_status_id_str": null, | |
"in_reply_to_user_id": null, |
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
function fbUpdatePost (idPost, thePostText) { | |
FB.api (idPost, "post", {message: thePostText}, function (response) { | |
console.log ("fbUpdatePost: response == " + JSON.stringify (response, undefined, 4)); | |
}); | |
} |
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
<html> | |
<head> | |
<title>Wordnik demo from JavaScript</title> | |
<script src="http://static.smallpicture.com/bootstrap/js/jquery-1.9.1.min.js"></script> | |
<script> | |
var baseUrl = "http://api.wordnik.com/v4/word.json/"; | |
var apiKey = "a2a73e7b926c924fad7001ca3111acd55af2ffabf50eb4ae5"; //demo key from developer.wordnik.com | |
function getSynonyms (theWord, callback) { | |
var url = baseUrl + theWord + "/relatedWords?useCanonical=true&relationshipTypes=synonym&limitPerRelationshipType=100&api_key=" + apiKey; | |
var jxhr = $.ajax ({ |
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
# Copyright (c) 2013-2022 Kyle Gorman | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a | |
# copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, | |
# distribute, sublicense, and/or sell copies of the Software, and to | |
# permit persons to whom the Software is furnished to do so, subject to | |
# the following conditions: | |
# |
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
from Population import Population | |
from Individual import Individual | |
from random import random, randint | |
class Algorithm(): | |
#Constants | |
Uniform_rate = 0.5 | |
Mutation_rate = 0.015 | |
Tournament_size = 5 |
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/env python | |
# -*- coding: utf-8 -*- | |
# Created on Mon Sep 09 23:06:21 2013 | |
# @author: Danilo J. S. Bellini | |
""" | |
AudioLazy time-variant resonator helping instantaneous frequency measurements. | |
""" | |
from __future__ import print_function | |
from audiolazy import (sHz, sinusoid, gauss_noise, line, z, inf, resonator, |
NewerOlder