So the general concept behind an artificial intelligence is quite simple. It's basically just a replication of what we see in other sentient beings. It has been abstracted to mean things like speech, the ability to play a game well, to guess a person's motives and intentions, and to use that against them in order to win. The reason this seems like a form of intelligence to us, a being with sentience, is because as humans, we see anything with an understanding of anything to be sentient. Almost, anyway. An understanding is a very important part, but where it really hits
This link is refferenced all the time. Keep it open in tab. http://docs.python.org/2/reference/
The numbers before each section refer to this document. Use it to get more detail on a subject.
So this isn't really a proper Atom theme, it's just some modifications I made to the "Dark One" theme in an attempt to replicate this Reddit post
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
| # decorators are just shorthand for passing functions as arguments to other functions | |
| # They are called decorators as code can be run before and after the supplied | |
| # function is run (if at all). A good use for decorator functions is adding | |
| # callback hooks for your applications. The decorator functions take the | |
| # supplied function and store it to be run at the right time | |
| # There are two types of decorators: regular decorator and callable decorators | |
| # regular decorators take the function it's decorating as an argument |
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 asyncio | |
| loop = asyncio.get_event_loop() | |
| # returns true if coroutine function blocks or errors, else false | |
| async def holds(function, arg): | |
| # try block for catching errors | |
| try: | |
| # create a promise for the function to run in another thread | |
| p = loop.run_in_executor(None, await function, (arg,)) |
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 python3.6 | |
| import sys | |
| import os | |
| import pwd | |
| import pipes | |
| import subprocess | |
| # Usage: servicize.py python3 main.py | |
| # OR: servicize.py ./somefile.sh | |
| # It will attempt to complete abs paths and automatically name the service. |
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 random | |
| # returns the number of jumps taken in a simulation of `pads` pads | |
| def frog_game(pads): | |
| # init the counter at 1 | |
| jumps = 1 | |
| # take a random jump between 1 and `pads` | |
| jump = random.randint(1, pads) | |
| # now calculate the remaining jumps: | |
| # while the current number of pads we've jumped in total is not enough |
I hereby claim:
- I am Taiiwo on github.
- I am 0x41 (https://keybase.io/0x41) on keybase.
- I have a public key whose fingerprint is EF36 EB55 4CD8 760D 063A 3715 F6E4 96CC 72CA 322F
To claim this, I am signing this object:
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
| <link rel="import" href="../core-drawer-panel/core-drawer-panel.html"> | |
| <link rel="import" href="../core-icon-button/core-icon-button.html"> | |
| <link rel="import" href="../core-toolbar/core-toolbar.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> | |
| :host { | |
| position: absolute; |
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 sys | |
| import time | |
| # Keeps track of an iteration | |
| class Tracker: | |
| def __init__(self, max=False, index=0): | |
| self.max = max | |
| self.index = index | |
| self.times = [] | |
| self.time = time.time() |
NewerOlder
