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
_hashCode java/lang/Object.hashCode()I | |
_getClass java/lang/Object.getClass()Ljava/lang/Class; | |
_clone java/lang/Object.clone()Ljava/lang/Object; | |
_dabs java/lang/Math.abs(D)D | |
_dsin java/lang/Math.sin(D)D | |
_dcos java/lang/Math.cos(D)D | |
_dtan java/lang/Math.tan(D)D | |
_datan2 java/lang/Math.atan2(DD)D | |
_dsqrt java/lang/Math.sqrt(D)D | |
_dlog java/lang/Math.log(D)D |
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
public static List<T> Query<T>(this DataContext db, string sql, object param = null, int? commandTimeout = null, IDbTransaction transaction = null, [CallerFilePath]string fromFile = null, [CallerLineNumber]int onLine = 0, string comment = null) | |
{ | |
using (db.Connection.EnsureOpen()) | |
{ | |
try | |
{ | |
return db.Connection.Query<T>(MarkSqlString(sql, fromFile, onLine, comment), param, transaction ?? db.Transaction, true, commandTimeout).AsDapperList(); | |
} | |
catch (SqlException ex) when (ex.Is(SqlErrorCode.DatabaseReadOnly_3906)) | |
{ |
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 Main() | |
{ | |
var array = new byte[10000000]; | |
var initBlk = new InitblkMemoryHelper(); | |
var loop = new LoopMemoryHelper(); | |
// First run for JIT warmup and type initialization | |
initBlk.Memset(array, 0, array.Length, 42); | |
loop.Memset(array, 0, array.Length, 42); |
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
public static class AssemblyHelper | |
{ | |
/// <summary> | |
/// Gets the list of concrete generic type instances used in an assembly. | |
/// See remarks | |
/// </summary> | |
/// <param name="assembly">The assembly</param> | |
/// <returns>The list of generic type instances</returns> | |
/// <remarks> | |
/// Note that this method is fetching only direct type instances (through type, method argument or fields) |
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
/** | |
veh_hook Vectored Exception Handler hooking library | |
Version: 24-March-2008 | |
**/ | |
#define WINVER 0x0501 | |
#define _WIN32_WINNT 0x0501 | |
#include <windows.h> | |
#include "veh_hook.h" | |
static veh_list_t* list = NULL; |
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.Concurrent; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
internal class ILFieldBuilder | |
{ | |
private static readonly AssemblyBuilder AssemblyBuilder = | |
AssemblyBuilder.DefineDynamicAssembly( | |
new AssemblyName(nameof(ILFieldBuilder)), |
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 Microsoft.Diagnostics.Tracing; | |
using Microsoft.Diagnostics.Tracing.Parsers; | |
using Microsoft.Diagnostics.Tracing.Parsers.Clr; | |
using Microsoft.Diagnostics.Tracing.Session; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; |
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
// Runnable from Linqpad 5 | |
// Must install the Sigil nuget package and include the Sigil namespace | |
void Main() | |
{ | |
var createSample = GetMapperDelegate(); | |
// try it out | |
createSample(23, "Hello").Dump(); | |
} |
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.Runtime.InteropServices; | |
namespace EvilArray | |
{ | |
/// <summary> | |
/// Cast an array of structs to an array of byte[] | |
/// </summary> | |
class Program | |
{ |
NewerOlder