Skip to content

Instantly share code, notes, and snippets.

View evil.cs
private static void ChangeToReturnFalse(MethodInfo methodInfo)
{
var intPtrConstructor = typeof(IntPtr).GetConstructor(new[] { typeof(void*) });
var method = new DynamicMethod("ChangeToReturnFalse", typeof(IntPtr), Type.EmptyTypes, typeof(ServiceLocationModule));
var generator = method.GetILGenerator();
generator.Emit(OpCodes.Ldftn, methodInfo);
generator.Emit(OpCodes.Newobj, intPtrConstructor);
generator.Emit(OpCodes.Ret);
var addressFunctor = (Func<IntPtr>)method.CreateDelegate(typeof(Func<IntPtr>));
var address = addressFunctor();
View Test.cs
using System;
using System.Reflection.Emit;
class Program
{
delegate object FuncObjectObject(Object o);
static void Main(string[] args)
{
var dm = new DynamicMethod("", typeof(object), new [] { typeof(object) });
View Action.il
.assembly ActionTest {}
.assembly extern mscorlib
{
.ver 4:0:0:0
.publickeytoken = (B7 7A 5C 56 19 34 E0 89)
}
.namespace Test
{
View a.The Code You Run.cs
using System;
class Program
{
static void Main()
{
Console.WriteLine("Hello, CoreCLR!");
}
}
View gist:141dcbeed7079af1662e
vb6 vba vb homework grails coldfusion flash iphone air sifr ms-access db2 vbscript perl sap jpa gql java-ee magento ipad qt weblogic blackberry gwt pentaho wordpress mac corba intellij-idea lucene safari seo redis itouch ant antlr ada gtk doctrine lotus tomcat jcl mongodb netlogo nosql smalltalk beamer spring symbian agile firebird samba jasper-reports sybase fortran qtp itunes sqlite soapui acrobat actionscript* flex* cocoa* struts* ruby* zend* *php* java-* joomla* maven* *hibernate* ipod* xcode* jboss* dotnetnuke* *facebook* java groovy* *jaxb* kanban iphone* telerik osx python* jsf* jquery* r latex oracle* android* devexpress umbraco* wolfram-mathematica awk sed *dreamweaver* symfony* crystal-reports* alfresco *postgres* dojo* codeigniter* xbap oscommerce cucumber mod-rewrite mysql* jpa* extjs semantic-web kohana* django* sqlalchemy cufon birt .htaccess inno-setup jira drupal* postscript swf* automapper ssas jms asterisk amazon-ecs ios* delphi* labview jvm* *payment* *dynamics* yahoo-pipes websphere* siebe
View BloomFilter.cs
namespace BloomFilter
{
using System;
using System.Collections;
/// <summary>
/// Bloom filter.
/// </summary>
/// <typeparam name="T">Item type </typeparam>
public class Filter<T>
View PerformanceRelated.txt
Everything I Ever Learned About JVM Performance Tuning @Twitter- by Attila Szegedi
http://www.infoq.com/presentations/JVM-Performance-Tuning-twitter (video & slides)
9 Fallacies of Java Performance - by Ben Evans
http://www.infoq.com/articles/9_Fallacies_Java_Performance (video & slides)
Visualizing Java GC - by Ben Evans
http://www.infoq.com/presentations/Visualizing-Java-GC (video & slides)