A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| import socket | |
| class Netcat: | |
| """ Python 'netcat like' module """ | |
| def __init__(self, ip, port): | |
| self.buff = "" | |
| self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| /* | |
| Reddit DailyProgrammer Challenge #180 -- Tamagotchi Emulator | |
| By Aerospark12 (aka Luke) | |
| I may have gone a little bit overboard with this one, but I've got fond memories of tamagotchi from when | |
| I was but a wee laddie, I've always wanted to make something like this, and I really enjoy graphics and animation | |
| The design of this is partially inspirte by how I understand "low level" ICs to work, as an homage to the real tamagotchi |
| /* Useful celery config. | |
| app = Celery('tasks', | |
| broker='redis://localhost:6379', | |
| backend='redis://localhost:6379') | |
| app.conf.update( | |
| CELERY_TASK_RESULT_EXPIRES=3600, | |
| CELERY_QUEUES=( | |
| Queue('default', routing_key='tasks.#'), |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
A very brief guide to Rust syntax. It assumes you are already familiar with programming concepts.
This was written in 2014. It is not a good reference for Rust today, though the content is still correct.
cheats.rs looks like a good alternative.
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | |
| <input id="file" type="file" accept="image/*" /> | |
| <br/> | |
| <h2>As read:</h2> | |
| <img id="placeholder1" width=300/><br/> | |
| <h2>Rotated by exif data:</h2> | |
| <img id="placeholder2" width=300/> | |
| <script> |
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
| #!C:\Python27\python.exe | |
| # The MIT License (MIT) | |
| # | |
| # Copyright © 2014-2016 Santoso Wijaya <[email protected]> | |
| # | |
| # 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, sub-license, and/or sell copies of the Software, |
| git fetch --all | |
| git reset --hard origin/master | |
| git pull origin master |
| import win32serviceutil | |
| import win32service | |
| import win32event | |
| import servicemanager | |
| import socket | |
| import time | |
| import logging | |
| logging.basicConfig( | |
| filename = 'c:\\Temp\\hello-service.log', |