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
| // I pasted this without even looking at it. It the code running in the video here: http://youtu.be/OZ_9Yg0PG3M | |
| // The video is of an Arduino controlling a single 8x8 LED matrix via an MBI5026 chip + a single 74HC595 shift register. | |
| // Link to the MBI5026: http://www.rayslogic.com/propeller/programming/AdafruitRGB/MBI5026.pdf | |
| #define SDI 10 | |
| #define CLK 9 | |
| #define LE 8 | |
| #define LED 17 | |
| // 74HC595 | |
| #define SHSDI 3 // DS (pin 14 on shift register) |
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/env python | |
| """ | |
| shiftreg.py | |
| Shift register control module. Provides the :class:`Shiftter` class which | |
| makes it easy to control shift registers. | |
| .. note:: |
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/python | |
| # -*- coding: utf-8 -*- | |
| from random import Random | |
| ⶻ=len | |
| ج=int | |
| ⶽ=sum | |
| ܠ=str | |
| ܓ=range | |
| ش=object | |
| import sys |
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/env python | |
| """ | |
| Example of how to use futures with ProcessPoolExecutor or ThreadPoolExecutor. | |
| """ | |
| from concurrent import futures | |
| def long_running_function(): | |
| """ |
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
| /* | |
| * This file is part of the libopencm3 project. | |
| * | |
| * Copyright (C) 2009 Uwe Hermann <uwe@hermann-uwe.de> | |
| * Copyright (C) 2011 Stephen Caudle <scaudle@doceme.com> | |
| * | |
| * This library is free software: you can redistribute it and/or modify | |
| * it under the terms of the GNU Lesser General Public License as published by | |
| * the Free Software Foundation, either version 3 of the License, or | |
| * (at your option) any later version. |
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 os, re, sys | |
| comments_re = re.compile( | |
| r'//.*?$|/\*.*?\*/|\'(?:\\.|[^\\\'])*\'|"(?:\\.|[^\\"])*"', | |
| re.DOTALL | re.MULTILINE | |
| ) | |
| trailing_commas_re = re.compile( | |
| r'(,)\s*}(?=([^"\\]*(\\.|"([^"\\]*\\.)*[^"\\]*"))*[^"]*$)') | |
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/env python | |
| """ | |
| An example of how to remove comments and trailing commas from JSON before | |
| parsing. You only need the two functions below, `remove_comments()` and | |
| `remove_trailing_commas()` to accomplish this. This script serves as an | |
| example of how to use them but feel free to just copy & paste them into your | |
| own code/projects. Usage:: | |
| json_cleaner.py some_file.json |
OlderNewer