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
var r = Raphael(0, 0, 400, 600), | |
aRect = r.rect(10, 10, 100, 100), | |
aPath = r.path('M10,200 l100,0 l0,100 l-100,0 z'), | |
aText = r.text(200, 150, "Double click on the boxes to see what I mean."); | |
aRect.attr({'fill':'url("http://commondatastorage.googleapis.com/proto4/beltpattern4.png")'}); | |
aPath.attr({'fill':'url("http://commondatastorage.googleapis.com/proto4/beltpattern4.png")'}); | |
aRect.dblclick(function() { | |
this.animate({'translation':"100, 0"}, 1000); |
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 <iostream> | |
void funcWithReference(int &ref) | |
{ | |
ref = 659; | |
} | |
void funcWithPtr(int *ptr) | |
{ | |
*ptr = 659; // ignore this |
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
Scroll to the bottom for the code (tracer.mm) | |
When I run the tracer, the return value (the value of rax after stepping out of the thread) is always zero. | |
I'm breaking on malloc, so the output should be some pointery looking value. I tried with other functions as well, | |
and I get the same issue. I also tried checking for the process state, and that says it's invalid. |
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
@interface SREAGLContext : NSObject | |
+ (EAGLContext*)sharedContext; | |
+ (EAGLContext*)newContext: (EAGLRenderingAPI) api; | |
@end | |
@implementation SREAGLContext |
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
/* CGSPrivate.h -- Header file for undocumented CoreGraphics stuff. */ | |
/* This file is a relicensed portion of DesktopManager and was originally released under | |
* the terms of the GNU General Public Licence. Original licence text follows the new terms. | |
* The contents of this file has been re-released by the original author under the following terms: | |
* | |
* Copyright (C) 2003, 2004, 2013 Richard J Wareham <[email protected]> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy of this | |
* software and associated documentation files (the "Software"), to deal in the Software |
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
// Function to update image buffer in NV12 format with BGRA pixel buffer | |
// Assumptions: | |
// bgra buffer is 32bpp | |
// bgra buffer width and height equal to imageBuffer | |
// bgra buffer stride is equal to imageBuffer width | |
int UpdateSampleBufferWithBGRAPixels(CVImageBufferRef imageBuffer, void *bgraPixels) { | |
const OSType pixelFormat = CVPixelBufferGetPixelFormatType(imageBuffer); | |
assert(pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarFullRange || pixelFormat == kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange); | |
const size_t width = CVPixelBufferGetWidth(imageBuffer); |
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
// | |
// AppDelegate.m | |
// MetalComputeOSX | |
// | |
#import "AppDelegate.h" | |
@import Metal; | |
#define IMAGE_SIZE 128 |
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
$base-font-size: 16px; | |
$base-line-height: 1.5; | |
// this value may vary for each font | |
// unitless value relative to 1em | |
$cap-height: 0.68; | |
@mixin baseline($font-size, $scale: 2) { |
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
// $base-font-size: 16px; // not sure this ever did anything | |
$base-line-height: 1.5; | |
// this value may vary for each font | |
// unitless value relative to 1em | |
$cap-height: 0.68; | |
@mixin baseline($font-size, $scale: 2) { |
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) addAppAsLoginItem { | |
if ([self wasAppAddedAsLoginItem]) return; | |
NSString * appPath = [[NSBundle mainBundle] bundlePath]; | |
// This will retrieve the path for the application | |
// For example, /Applications/test.app | |
CFURLRef url = (__bridge CFURLRef)[NSURL fileURLWithPath:appPath]; | |
// Create a reference to the shared file list. |
OlderNewer