This file contains hidden or 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
Parent-window.html | |
this.$el.append('<iframe id="iframeDocument" src="/Iframe.html"></iframe>'); | |
loadIframe = function() { | |
var $iframeDocument = $('#iframeDocument').get(0).contentWindow.document; | |
$('#iframeContent', $iframeDocument).append( myHtml ); | |
} | |
This file contains hidden or 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
var GpsMock = { | |
mockSetIntervalId : null, | |
mock : function( x, y ) { | |
var setIntervalId; | |
if( navigator.geolocation ) { | |
var self = this; | |
if( !x ) { | |
//start x y not set, try to get 'REAL' current location and use it | |
navigator.geolocation.getCurrentPosition( | |
function success(position) { self.mock(position.coords.longitude, position.coords.latitude) }, |
This file contains hidden or 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
[OperationContract] | |
[WebInvoke(Method = "GET", BodyStyle = WebMessageBodyStyle.WrappedRequest, ResponseFormat = WebMessageFormat.Json, | |
UriTemplate = "/proxy/?url={url}")] | |
String proxy_GET(string url); | |
[OperationContract] | |
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, | |
RequestFormat = WebMessageFormat.Xml, ResponseFormat = WebMessageFormat.Xml, | |
UriTemplate = "/proxy/?url={url}")] | |
XElement proxy_POST(string url, XElement postData); |
This file contains hidden or 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
//const __m128 half = _mm_set1_ps(0.5f); | |
//set our packed floats to 1.5f | |
__m256 half256ps = _mm256_set1_ps(1.5f); | |
//make room for our 256bits result variable | |
__m256i result256i; | |
unsigned X, X0, X1, X2, X3, X4, X5, X6, X7; |
This file contains hidden or 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
//rax = 450 * rbx | |
imulq $450, %rbx, %rax ## imm = 0x1C2 | |
//another way to do rax = 450 * rbx | |
//cycle wise, this is on par with imul instruction above | |
leaq (%rbx,%rbx,8), %rax //rax=9*rbx | |
leaq (%rax,%rax,4), %rax //rax=rax*5 == 45*rbx | |
leaq (%rax,%rax,4), %rax //rax=rax*5 == 225*rbx | |
shlq $1,%rax //rax=rax*2 == 450*rbx |
This file contains hidden or 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
__m128 __attribute__ ((noinline)) test_parameterPassing( | |
__m128 m128param1, //%xmm0 | |
unsigned u1, //%edi | |
float f1, float f2, //%xmm1, %xmm2 | |
unsigned u2, unsigned u3, //%esi, %edx | |
double d1, double d2, //%xmm3, %xmm4 | |
unsigned u4, unsigned u5, //%ecx, %r8d | |
double d3, double d4, double d5, double d6, //%xmm5, %xmm6, %xmm7, stack | |
unsigned u6, unsigned u7, unsigned u8 //%r9d, stack, stack | |
) { |
This file contains hidden or 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
printf("m128i.m128_u32[0] = %04X _ before\n", m128i.m128_u32[0]); | |
printf("m128i.m128_u32[1] = %04X _ before\n", m128i.m128_u32[1]); | |
printf("m128i.m128_u32[2] = %04X _ before\n", m128i.m128_u32[2]); | |
printf("m128i.m128_u32[3] = %04X _ before\n", m128i.m128_u32[3]); | |
__asm { | |
pxor xmm5, xmm5 | |
//vpshufd xmm5, m128i, 0xAA | |
vpshufd xmm5, m128i, 0x55 | |
//0x00 set all elems to 1st elem, 0000 0000 |
This file contains hidden or 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 test_parameterPassing_pointer( double *d1p, | |
__m256 *m256_1p, __m128 *m128_1p, | |
__m256 m256_1) { | |
double mul1 = (*d1p) + (*d1p); | |
double *m256_dp = ((double*)m256_1p); | |
double *m128_dp = ((double*)m128_1p); | |
double mul2 = m256_dp[0] * mul1 - m128_dp[1]; |
This file contains hidden or 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 test_vinsertps() { | |
__m128i m128_1; | |
unsigned long long allOneLL = 0x2222222211111111LL; | |
unsigned long long allTwoLL = 0x4444444433333333LL; | |
((unsigned long long*)&m128_1)[0] = allOneLL; | |
((unsigned long long*)&m128_1)[1] = allTwoLL; |
This file contains hidden or 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 test_punpckldq() { | |
__m128i m128_1; | |
__asm { | |
mov r8d, 0x11112222 | |
mov r9d, 0x33334444 | |
mov r10d,0x55556666 | |
mov r11d,0x77778888 | |
movd xmm8, r8d |