- Pizza
- Sushis/makis
- Ramens
- Pates vivantes
- kebab
- burger
- Ometis
- pΓ’tes
- sandwich
- Bagel
π¨βπ»
Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032
Me: I have no idea what that
-staticflag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.
Minutes later...
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 gevent | |
| import gevent.queue | |
| import gevent.lock | |
| from functools import partial | |
| class JobQueue: | |
| class Job: | |
| def __init__(self, run=None, *args, **kwargs): | |
| self.callback = kwargs.pop('dispatch_callback', None) |
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
| from mutagen.easyid3 import EasyID3 as Tag | |
| from os import listdir | |
| from re import sub | |
| for f in listdir('.'): | |
| if (f[-4:] == '.mp3'): | |
| try: | |
| tag = Tag(f) | |
| except: | |
| tag = Tag() |
If your system is running slowly, perhaps a process is using too much CPU time and won't let other processes run smoothly. To find out which processes are taking up a lot of CPU time, you can use Apple's Activity Monitor.
The CPU pane shows how processes are affecting CPU (processor) activity:
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
| from numpy.polynomial.polynomial import polyval | |
| from scipy.optimize import newton | |
| from random import random | |
| def poly(coeffs): | |
| def polyfunc(x): | |
| return polyval(x, coeffs) | |
| return polyfunc | |
| # Polynomial: coeffs[0]*x^0 + coeffs[1]*x^1 + coeffs[2]*x^2 + ... |
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
| USER_PREFIX=/Users | |
| LOADER_PATH_PREFIX=@loader_path | |
| for f in *.dylib; do | |
| old_install_path="$(otool -D "$f" | sed '2q;d' | grep -E "$USER_PREFIX|$LOADER_PATH_PREFIX")" | |
| if [ -n "$old_install_path" ]; then | |
| new_install_path="$(sed -E "s%($USER_PREFIX|$LOADER_PATH_PREFIX).*%@executable_path/../Frameworks/%" <<< "$old_install_path")""$(basename "$old_install_path")" | |
| echo "$old_install_path -> $new_install_path" | |
| install_name_tool -id "$new_install_path" "$f" | |
| fi | |
| for old_install_path in $(otool -L "$f" | grep -E "$USER_PREFIX|$LOADER_PATH_PREFIX" | awk '{print $1}'); do |
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
| // GetHostName.c | |
| // | |
| // Prints current host's name in localized, human-readable format to stdout | |
| // | |
| // Compile using: | |
| // cc -framework SystemConfiguration -framework CoreFoundation -o GetHostName GetHostName.c | |
| // | |
| #include <SystemConfiguration/SystemConfiguration.h> |
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
| QApplication qapp(argc, argv); | |
| { | |
| QNetworkConfigurationManager manager; | |
| QList<QNetworkConfiguration> configs(manager.allConfigurations()); | |
| QNetworkConfiguration config; | |
| foreach (config, configs) | |
| { | |
| NSString* type; | |
| switch (config.type()) |
