This file contains 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
/*************************** | |
Compile with: | |
gcc -framework CoreFoundation | |
****************************/ | |
#include <CoreFoundation/CoreFoundation.h> | |
int main(int argc, char** argv) { | |
CFStringRef myCFString = CFStringCreateWithCString(NULL, argv[1], kCFStringEncodingMacRoman); | |
/* Use myCFString */ |
This file contains 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
void class_printMethods(Class cl) { | |
unsigned int methodCount = 0; | |
Method *methods = class_copyMethodList(cl, &methodCount); | |
printf("Methods for %s: \n", class_getName(cl)); | |
for (int i = 0; i < methodCount; i++) { | |
Method method = methods[i]; | |
printf("%s : %s \n", | |
sel_getName(method_getName(method)), | |
method_getTypeEncoding(method)); | |
} |
This file contains 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
void class_printProperties(Class cl) { | |
unsigned int propCount; | |
objc_property_t *props = class_copyPropertyList(cl, &propCount); | |
printf("Properties for %s: \n", class_getName(cl)); | |
for (int i = 0; i < propCount; i++) { | |
objc_property_t prop = props[i]; | |
printf("%s : %s \n", | |
property_getName(prop), | |
property_getAttributes(prop)); | |
} |
This file contains 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
void class_printIvars(Class cl) { | |
unsigned int ivarCount; | |
Ivar *ivars = class_copyIvarList(cl, &ivarCount); | |
printf("Ivars for %s: \n", class_getName(cl)); | |
for (int i = 0; i < ivarCount; i++) { | |
Ivar ivar = ivars[i]; | |
printf("%s : %s \n", | |
ivar_getName(ivar), | |
ivar_getTypeEncoding(ivar)); | |
} |
This file contains 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
Ivar class_getIvarFromString(Class cl, NSString *__ivar) { | |
unsigned int count; | |
Ivar *ivars = class_copyIvarList(cl, &count); | |
for (int i = 0; i < count; i++) { | |
Ivar ivar = ivars[i]; | |
NSString *ivarName = [NSString stringWithUTF8String:ivar_getName(ivar)]; | |
if([ivarName isEqualToString:__ivar]) { | |
free(ivars); | |
return ivar; | |
} |
This file contains 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 os | |
import sys | |
import numpy as np | |
import struct | |
import warnings | |
path="sample.wav" | |
#get the file size in bytes | |
fileSize=os.path.getsize(path) |