Skip to content

Instantly share code, notes, and snippets.

struct task_basic_info info;
mach_msg_type_number_t size = sizeof(info);
kern_return_t kerr = task_info(mach_task_self(),
TASK_BASIC_INFO,
(task_info_t)&info,
&size);
if (kerr == KERN_SUCCESS)
{
static vm_size_t last_resident_size = 0;
#import <UIKit/UIKit.h>
@class BDSegmentedControl;
@protocol BDSegmentedControlDelegate <NSObject>
- (NSUInteger)segmentedControl:(BDSegmentedControl *)segmentedControl numberOfMenuItemsForSegmentAtIndex:(NSUInteger)segmentIndex;
- (UIImage *)segmentedControl:(BDSegmentedControl *)segmentedControl imageForMenuBackgroundForSegmentAtIndex:(NSUInteger)segmentIndex;
- (UIImage *)segmentedControl:(BDSegmentedControl *)segmentedControl imageForMenuItemAtIndex:(NSUInteger)menuItemIndex forSegmentAtIndex:(NSUInteger)segmentIndex;
- (UIImage *)segmentedControl:(BDSegmentedControl *)segmentedControl imageForSelectedMenuItemAtIndex:(NSUInteger)menuItemIndex forSegmentAtIndex:(NSUInteger)segmentIndex;
root@s15333697:~# clang -I/root/openssl-1.0.0a-orig/include/ -L/root/openssl-1.0.0a-orig/ -lcrypto -lssl srpgen.c
/tmp/cc-6XVXN4.o: In function `main':
srpgen.c:(.text+0x92): undefined reference to `SRP_get_default_gN'
srpgen.c:(.text+0xbb): undefined reference to `SRP_create_verifier_BN'
srpgen.c:(.text+0xc7): undefined reference to `BN_bn2hex'
srpgen.c:(.text+0xd4): undefined reference to `BN_bn2hex'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
root@s15333697:~# cd openssl-1.0.0a-orig
root@s15333697:~/openssl-1.0.0a-orig# nm libcrypto.a | grep SRP_get_default_gN
0000000000000000 T SRP_get_default_gN
- (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree
{
self = [super init];
if ([self class] == [MapCSSSpecifier class])
{
id item = [[syntaxTree children] objectAtIndex:0];
if ([item isKindOfClass:[MapCSSNamed class]])
{
f.planes[RightPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) - MatrixGetValue(m, 0, 0),
MatrixGetValue(m, 1, 3) - MatrixGetValue(m, 1, 0),
MatrixGetValue(m, 2, 3) - MatrixGetValue(m, 2, 0),
MatrixGetValue(m, 3, 3) - MatrixGetValue(m, 3, 0)));
f.planes[LeftPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) + MatrixGetValue(m, 0, 0),
MatrixGetValue(m, 1, 3) + MatrixGetValue(m, 1, 0),
MatrixGetValue(m, 2, 3) + MatrixGetValue(m, 2, 0),
MatrixGetValue(m, 3, 3) + MatrixGetValue(m, 3, 0)));
f.planes[BottomPlane] = NormalisedPlane(PlaneMake(MatrixGetValue(m, 0, 3) + MatrixGetValue(m, 0, 1),
MatrixGetValue(m, 1,
NSString *currentDir = [[[NSBundle mainBundle] bundlePath] stringByDeletingLastPathComponent];
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath: @"/usr/bin/java"];
[task setCurrentDirectoryPath:currentDir];
[task setArguments:[NSArray arrayWithObjects:[NSString stringWithFormat:@"-Xmx%dM", [RamTextField intValue]], [NSString stringWithFormat:@"-Xms%dM", [RamTextField intValue]], @"-jar", [NSString stringWithFormat:@"%@/minecraft_server.jar", currentDir], nil]];
NSPipe *pipe = [NSPipe pipe];
[task setStandardError: pipe];//Return Error only
[task setStandardInput:[NSPipe pipe]];
NSFileHandle *file = [pipe fileHandleForReading];
[task launch];
Wraith:Desktop tatd2$ clang -framework Foundation test.m
Wraith:Desktop tatd2$ ./a.out
2011-10-31 21:57:46.840 a.out[916:707] Before
2011-10-31 21:57:46.843 a.out[916:707] After
Wraith:Desktop tatd2$ cat test.m
#import <Foundation/Foundation.h>
int main (int argc, char **argv)
{
@autoreleasepool
@implementation MapCSSSpecifier
- (id)initWithSyntaxTree:(CPSyntaxTree *)syntaxTree
{
self = [super init];
if ([self class] == [MapCSSSpecifier class])
{
id item = [[syntaxTree children] objectAtIndex:0];
CompileC /Users/tatd2/Library/Developer/Xcode/DerivedData/CoreParse-cwpermngdqajjygdcvsbbihrurrs/Build/Intermediates/CoreParse.build/Debug/CoreParse.build/Objects-normal/x86_64/CPQuotedRecogniser.o "CoreParse/Tokenisation/Token Recognisers/CPQuotedRecogniser.m" normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/tatd2/Documents/Personal/CoreParse
setenv LANG en_US.US-ASCII
/Developer/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=gnu99 -fobjc-gc -Wno-trigraphs -fpascal-strings -O0 -Werror -Werror-implicit-function-declaration -Wmissing-field-initializers -Wmissing-prototypes -Wreturn-type -Wmissing-braces -Wparentheses -Wswitch -Wunused-function -Wunused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wunknown-pragmas -Wshadow -Wsign-compare -Wshorten-64-to-32 -Wnewline-eof -Wstrict-selector-match -Wundeclared-selector -DDEBUG -isysroot /D
@beelsebob
beelsebob / NSAlert+Blocks
Created October 27, 2011 13:51 — forked from PsychoH13/PSYBlockTimer.h
Fire an NSTimer using a block as execution code.
//
// NSAlertWithBlocks.h
//
// Created by Thomas Davie on 26/12/2009.
// Copyright 2009 Thomas Davie. All rights reserved.
//
#import <Cocoa/Cocoa.h>