I hereby claim:
- I am snaewe on github.
- I am snaewe (https://keybase.io/snaewe) on keybase.
- I have a public key whose fingerprint is 0E3E 3B5F 9344 7F55 F461 88C3 A327 C9B2 2095 D5A5
To claim this, I am signing this object:
| #!/bin/bash | |
| PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin | |
| case ${0##*/} in | |
| sudify) | |
| if [ $# -eq 1 ]; then | |
| pushd ${0%/*} > /dev/null | |
| if [ -e $1 ]; then | |
| echo "ERROR: Can't sudify $1" | |
| popd > /dev/null | |
| exit 1 |
| #include <time.h> | |
| #include <stdio.h> | |
| #include <errno.h> | |
| int main(int argc, char* argv[]) | |
| { | |
| time_t t = time(0); | |
| char mbstr[100] = { 0 }; | |
| printf("errno: %d\n", errno); | |
| size_t s = strftime(mbstr, sizeof(mbstr), ((argc>1) ? argv[1] : "%c"), localtime(&t)); |
I hereby claim:
To claim this, I am signing this object:
| # -*- coding: utf-8 -*- | |
| # Author: Douglas Creager <[email protected]> | |
| # This file is placed into the public domain. | |
| # Calculates the current version number. If possible, this is the | |
| # output of “git describe”, modified to conform to the versioning | |
| # scheme that setuptools uses. If “git describe” returns an error | |
| # (most likely because we're in an unpacked copy of a release tarball, | |
| # rather than in a git working copy), then we fall back on reading the | |
| # contents of the RELEASE-VERSION file. |
| // From http://wiki.blender.org/index.php/Dev:2.4/Source/Python/API/Threads | |
| void start_python() | |
| { | |
| Py_NoSiteFlag = 1; | |
| Py_SetProgramName("my_program_name"); | |
| Py_Initialize(); | |
| PyEval_InitThreads(); | |
| PyThreadState *py_tstate = PyGILState_GetThisThreadState(); | |
| PyEval_ReleaseThread(py_tstate); |
| void sleepMillisec( long milliseconds ) | |
| { | |
| boost::this_thread::sleep( | |
| boost::get_system_time() + | |
| boost::posix_time::milliseconds( std::max<long>(milliseconds,0) ) ); | |
| } |
| // -*- c++ -*- | |
| // compile with: "g++ -D_WIN32_WINNT=0x501 run_iosvc_in_thread.cpp -lboost_thread -lboost_system -lwsock32 -o run_iosvc_in_thread" | |
| #include <boost/asio.hpp> | |
| #include <boost/thread.hpp> | |
| #include <boost/bind.hpp> | |
| #include <boost/scoped_ptr.hpp> | |
| int main() | |
| { | |
| boost::scoped_ptr<boost::asio::io_service> m_ioServicePtr(new boost::asio::io_service); |
| inline | |
| CORBA::LongLong msecs_since_midnight() | |
| { | |
| using namespace boost::posix_time; | |
| using boost::gregorian::date; | |
| using boost::numeric_cast; | |
| ptime now = second_clock::local_time(); | |
| time_duration td = now.time_of_day(); | |
| return td.total_milliseconds(); |
| # Eine einfache Ausgabe von Membern eines Objektes erreicht man mit | |
| # (vorausgesetzt objekt.intMember und objekt.strMember existieren) | |
| print "%(intMember)d %(strMember)s" % vars(objekt) | |
| # Das tree Object zu einem commit Object erhält man z.B. mit... | |
| git show commitish^{tree} |