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 requests | |
| from bs4 import BeautifulSoup | |
| import argparse | |
| def get_google_count(query): | |
| parser = argparse.ArgumentParser(description='Get Google Count.') | |
| parser.add_argument('word', help='word to count') | |
| r = requests.get('http://www.google.com/search', | |
| params={'q':'"'+ query +'"', | |
| "tbs":"li:1"} |
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
| #include "ofxFmodSoundPlayer.h" | |
| FMOD_RESULT F_CALLBACK analyzerCallback(FMOD_DSP_STATE *dsp_state, | |
| float *inbuffer, float *outbuffer, | |
| unsigned int length, int inchannels, | |
| int outchannels) | |
| { | |
| // pass the data along | |
| memcpy(outbuffer, inbuffer, sizeof(float)* length * outchannels); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| make CXXFLAGS="-arch i386 -arch x86_64" CFLAGS="-arch i386 -arch x86_64" LDFLAGS="-arch i386 -arch x86_64" |
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
| # verify | |
| sudo /usr/libexec/repair_packages --verify --standard-pkgs / | |
| # repair | |
| sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume / | |
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
| -UIViewShowAlignmentRects YES |
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
| auto start = std::chrono::steady_clock::now(); | |
| // some task | |
| auto end = std::chrono::steady_clock::now(); | |
| std::cout << "Elapsed time " << double((end-start).count())/double(std::chrono::steady_clock::period::den) << "s" << std::endl; |
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
| NSString *hexString = "01abcd"; | |
| UInt64 value = (UInt64)strtoull([hexString UTF8String], NULL, 16); | |
| NSLog(@"value %ld", value); |
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
| [mediaQuery addFilterPredicate:[MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithBool:NO] forProperty:MPMediaItemPropertyIsCloudItem]]; |
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
| if ((num & (num - 1)) == 0){ | |
| // num is 2^N | |
| } |