Skip to content

Instantly share code, notes, and snippets.

@chitchcock
chitchcock / gist:1251336
Created September 29, 2011 17:23
Simple printout wrapper for FindDataStoreBlocks
function FindDataStoreInSystem(rootSystemName, dataStoreName)
warning off
%% Get Data
[foundDSRSystems, foundDSWSystems] = FindDataStoreBlocks(rootSystemName, dataStoreName);
%% Printout Data
disp '-----------------------------------------'
disp 'Read Blocks'
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@chitchcock
chitchcock / 20111012_iCloudAndSharedAppleID.md
Created October 12, 2011 21:21
Using iCloud on multiple devices with shared Apple ID

But what if I share my Apple ID? If multiple people use your Apple ID (say, if you have one central account for your, your spouse’s, and your children’s purchases), you can still use this ID among you for purchases, but each person will have to create a separate iCloud account for syncing and backup.

For example, if you have an Apple ID (or MobileMe account) you use between you, your significant other, and your daughter for purchases, but they'd like to take advantage of iCloud's sync and storage features, you'll want to do the following: Have each family member sign up for an iCloud account for their backups, mail, etc; then, after setting up iCloud on their iOS devices, go to the Store preference pane within the Settings app, sign out of the iCloud account (which will populate there automatically after you sign up), then sign into the original Apple ID you use for purchases.

If the Apple ID your family uses for purchases is also your primary account for syncing (if it's a MobileMe account, for exampl

@chitchcock
chitchcock / gist:2513236
Created April 27, 2012 21:08
mdlInitializeSampleTimes for S-Function blocks that can inherit sample time
#define MDL_INITIALIZE_SAMPLE_TIMES
static void mdlInitializeSampleTimes(SimStruct *S)
{
ssSetSampleTime(S, 0, INHERITED_SAMPLE_TIME);
ssSetOffsetTime(S, 0, 0.0);
ssSetModelReferenceSampleTimeInheritanceRule(S,
USE_DEFAULT_FOR_DISCRETE_INHERITANCE);
}
<script type="text/javascript" src="http://ck.upickem.net/engine/SubmissionWidget.aspx?PageType=VOTING&ContestID=51634&SubmissionID=19527997"></script>
@chitchcock
chitchcock / SearchHex.py
Created September 6, 2012 14:12
Sublime Text 2 Plugin to search for decimal values using a hex value
import sublime, sublime_plugin
class SearchHexCommand(sublime_plugin.TextCommand):
def findHexInView(self, pcode):
intToFind = int(pcode, 16)
print('Looking for ' + str(intToFind))
self.markers = []
self.foundRegions = []
@chitchcock
chitchcock / CRC16-CCITT.js
Created March 7, 2013 22:05
A quick and dirty copy of a C routine for generating a CRC16-CCITT with an intial value of 0xFFFF in Javascript
// Modified from http://automationwiki.com/index.php?title=CRC-16-CCITT
var crcTable = [0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5,
0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b,
0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210,
0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6,
0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c,
0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401,
0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b,
0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d,
(function(){
var idToSearch=window.getSelection ?
window.getSelection().toString() :
document.selection.createRange().text;
if (idToSearch=== "") {
t = prompt("Enter ID","");
}
if (idToSearch) {
@chitchcock
chitchcock / sandman_reading_order
Last active September 28, 2020 16:21
Possible Sandman reading order
[What order to read Sandman books in?](http://neilgaimanboard.com/eve/forums/a/tpc/f/68210996141/m/963107562)
by that scott guy
posted on August 28, 2010 04:50 AM
-------
i do have to say that the books MUST be read in the order they came out
no, i'm not takling about the trade volumes, i'm talking about the individual comics (issues 1-75)
i'm pretty sure that the absolute volumes are presented in order of the issue release
normally i wouldn't think that reading the trades in order would be a bad idea, but i'm pretty sure that Fables & Reflections (volume 6) just collected a bunch of loose stories and threw them all together...i could be wrong though
...and i looked it up, heres the reading order if you can't get a hold of the single issues or the absolute version
issues 1-8 (collected in Preludes & Nocuturnes)
#include <stdlib.h>
#include <stdio.h>
#include <process.h>
int main(int argc, char *argv[]) {
if (argc >= 3) {
// call out to cp and use the arguments passed to this program.
// We are using P_WAIT so that spawnlp waits for CP to return