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 <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSString *str = [[NSString alloc] initWithBytes: "\0\r" length: 2 encoding: NSASCIIStringEncoding]; | |
NSLog(@"len = %zu \"%@\"", str.length, str); | |
} | |
} |
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
// | |
// main.m | |
// ProtocolImplementations | |
// | |
// Created by Uli Kusterer on 07/09/15. | |
// Copyright (c) 2015 Uli Kusterer. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
#include <string> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include <malloc/malloc.h> | |
class JollyRoger | |
{ | |
public: |
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
#include "cppwrapper.h" | |
#include "buff.hpp" | |
extern "C" void buff_deinit( buff* _this ) | |
{ | |
delete _this; | |
} | |
extern "C" buff* buff_init( int type, double amount, double max_amount, double start_angle, double relative_angle, double max_distance, double bleedthrough, bool permanent ) | |
{ |
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
-- first approach: | |
-- sadly this causes a deep nested hierarchy where "go" calls "openCard" | |
-- which calls "go", eventually running out of memory. | |
on openCard | |
wait 5 seconds | |
go next | |
end openCard | |
-- second approach: | |
-- idle gets called periodically by HyperCard, but you don't have control over |
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
You can specify the underlying name for a C function the linker/compiler should actually use. If you use an existing | |
function's name, it will just let you refer to it with your prototype's name. If you define the function, it'll give | |
it that name. It even complains if a function of that name already exists. Tested with clang on a Mac, but AFAIK also | |
works in GCC. You can even use special characters in your function names, like you can do in assembly. |
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
struct eat_char_fcn | |
{ | |
eat_char_fcn( struct eat_char_fcn (*inFun)( char currCh, xml_reader& reader, vector<shared_ptr<node>>& nod, attribute* att ) ) : function(inFun) {} | |
struct eat_char_fcn operator()( char currCh, xml_reader& reader, vector<shared_ptr<node>>& nod, attribute* att ) { return function(currCh,reader,nod,att); } | |
explicit operator bool() { return function != nullptr; } | |
struct eat_char_fcn (*function)( char currCh, xml_reader& reader, vector<shared_ptr<node>>& nod, attribute* att ); | |
}; |
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 <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
int* __nullable foo = NULL; | |
int& fooRef = *foo; | |
} | |
return 0; | |
} |
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
<html> | |
<head> | |
<title>Streaming - Back Soon</title> | |
</head> | |
<body bgcolor="#00ff00"> | |
<div id="message" style="font-size: 80pt; font-family: Helvetica; font-weight: bold; color: white; text-shadow: 2px 2px #000000;"> | |
Back in <span id="timer">5:00</span> minutes | |
</div> | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE dictionary SYSTEM "file://localhost/System/Library/DTDs/sdef.dtd"> | |
<dictionary title="AppleScriptPropertyTest Terminology" xmlns:xi="http://www.w3.org/2003/XInclude"> | |
<xi:include href="file://localhost/System/Library/ScriptingDefinitions/CocoaStandard.sdef" xpointer="xpointer(/dictionary/suite)"/> | |
<suite name="AppleScriptPropertyTest Suite" code="ASPT" description="AppleScriptPropertyTest Suite"> | |
<cocoa name="ULIAppleScriptPropertyTestSuite"/> | |
<class-extension description="The App" extends="application"> | |
<cocoa class="NSApplication"/> | |
<property name="boogaloo" code="ACTV" description="App's boogaloo prop." type="boolean"> |