Skip to content

Instantly share code, notes, and snippets.

View anaisbetts's full-sized avatar

Ani Betts anaisbetts

View GitHub Profile
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using Jurassic;
using Jurassic.Library;
namespace NotActuallyTheDlrCoffee
// This is the main DLL file.
#include "stdafx.h"
#include "v8.h"
#include <msclr\marshal.h>
#include "V8Bridge.h"
using namespace v8;
using namespace msclr::interop;
SearchResults = new ReactiveCollection<string>();
_SearchResultsVisibility = SearchResults.CollectionCountChanged.StartWith(0)
.Select(x => x > 0 ? Visibility.Visible : Visibility.Collapsed)
.ToProperty(this, x => x.SearchResultsVisibility);
#include "Stdafx.h"
#include "v8.h"
class NativeV8ScriptCompiler
{
v8::Persistent<v8::Context> _context;
v8::Persistent<v8::Function> _compiler;
public:
NativeV8ScriptCompiler(const char* library_code);
(2f10.2f94): Access violation - code c0000005 (first chance)
First chance exceptions are reported before any exception handling.
This exception may be expected and handled.
eax=00000000 ebx=2ebb0048 ecx=31a8e70c edx=2ebb0048 esi=2cacc670 edi=31a8e70c
eip=58e15caa esp=31a8e6d4 ebp=31a8e780 iopl=0 nv up ei ng nz na pe cy
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010287
V8Bridge!v8::HandleScope::HandleScope+0xda:
58e15caa 8b8864050000 mov ecx,dword ptr [eax+564h] ds:002b:00000564=????????
0:040> kn100
# ChildEBP RetAddr
namespace Leak
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

Creating Observable Sources

AsObservable
Case
Create
Defer
DoWhile
Empty
For
FromAsyncPattern

FromEvent

public static Func<T1, IObservable<TRet>> FromRestSharpPattern<T1, TRet>(Action<T1, Action<TRet>> restSharpFunc)
{
return new Func<T1, IObservable<TRet>>(param => {
var retObs = new AsyncSubject<TRet>();
try {
restSharpFunc(param, returnValue => {
retObs.OnNext(returnValue);
retObs.OnCompleted();
});
/* Window and Buffer
*
* Window and Buffer (Window's easier to use yet less powerful cousin) are
* operators that allow you to cut an input stream into "samples" in a variety
* of very powerful ways.
*
* Let's talk about Window first - the core idea of Window is, that we have an
* input stream, and a number of "Windows" that have a start and end. For
* example, "From 3pm to 4:30pm", or maybe "from when they click the button,
* until they let go" - another common Window is simply, "once we've seen 'n'
Interesting things to talk about re SassAndCoffee:
* Rails 3.1 recent support for Sass + CoffeeScript
* Death to fiddling
* Works with Cassini and IIS Express without any fiddiling
* Using original compilers
* Installs PkgDef to VS2010
* Focus on your users in NuGet packages
* Minification using UglifyJS (with awesome usability)