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 clr | |
clr.AddReference('CorDebug') | |
from System.Reflection import Assembly | |
ipy = Assembly.GetEntryAssembly().Location | |
import sys | |
py_file = sys.argv[1] | |
cmd_line = "\"%s\" -D \"%s\"" % (ipy, py_file) | |
from System.Threading import AutoResetEvent |
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
open System.IO | |
open System.Net | |
open System.Net.Sockets | |
open Microsoft.FSharp.Control | |
open Extensions | |
let rec relay_loop (http:HttpListener) (socket:Socket) = | |
async { | |
// Async.Any (http.AsyncGetContext(), socket.AsyncReceive()) |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<style> | |
.twitter_user | |
{ | |
font-weight: bold; | |
} | |
#tweets |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<title></title> | |
<style type="text/css"> | |
.twitter_user | |
{ | |
font-weight: bold; | |
} | |
#tweets |
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 XML2JSON(doc) { | |
function workhorse(tw) { | |
var curNode = tw.currentNode; | |
if (curNode.nodeType === 3) { | |
return curNode.nodeValue; | |
} | |
var obj = {} |
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
using System; | |
using System.Linq; | |
using System.Runtime.InteropServices; | |
using System.Runtime.InteropServices.WindowsRuntime; | |
class WinRTInterop | |
{ | |
public class ResolvedNamespaces |
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
class WinRTInterop | |
{ | |
public static IMetaDataDispenser GetMetadataDispenser() | |
{ | |
var clsid = new Guid("{E5CB7A31-7512-11d2-89CE-0080C792E5D8}"); //CLSID_CorMetaDataDispenser | |
//var iid = new Guid("{31BCFCE2-DAFB-11D2-9F81-00C04F79A0A3}"); //IID_IMetaDataDispenserEx | |
var iid = new Guid("{809C652E-7396-11D2-9771-00A0C9B4D50C}"); //IID_IMetaDataDispenser | |
object ppv; | |
var hr = MetaDataGetDispenser(clsid, iid, out ppv); |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace MetadataReader | |
{ | |
using HRESULT = System.UInt32; |
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
//note, this wrapper funtion returns the metadata file name and token | |
//it immediately releases the importer pointer | |
static Tuple<string, UInt32> ResolveTypeName(string typename) | |
{ | |
string path; | |
object importer = null; | |
UInt32 token; | |
try | |
{ |
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
static string[] ParseTypeName(string typename) | |
{ | |
UInt32 partsCount; | |
IntPtr[] typeNameParts = null; | |
try | |
{ | |
var hr = RoParseTypeName(typename, out partsCount, out typeNameParts); | |
var parts = partsCount == 0 ? new string[0] : typeNameParts.Select(p => WindowsRuntimeMarshal.PtrToStringHString(p)).ToArray(); |
OlderNewer