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
TEXT ·CompareAndSwapDPointer(SB),4,$0 | |
MOVQ addr+0(FP), SI | |
MOVQ old+8(FP), AX | |
MOVQ old+16(FP), DX | |
MOVQ new+24(FP), BX | |
MOVQ new+32(FP), CX | |
LOCK // forgot this one | |
// CMPXCHG16B (SI) | |
BYTE $0x48; BYTE $0x0F; BYTE $0xC7; BYTE $0x0E |
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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
c := sync.NewCond(&sync.Mutex{}) |
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
#include <stdio.h> | |
int main() | |
{ | |
int c = 1, n = 0; | |
while (n < 10) | |
{ | |
int c2 = c * c; | |
for (int a = 1; a < c; a++) | |
{ |
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
1- calls mmap on the disk device | |
2- looks for zip headers | |
3- retrieves the begining of the zip file | |
4- check if it contains a mimetype file with the expected mimetype | |
5- save the result to a file |
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
#!/bin/sh | |
if [ "*$1" == "*" ]; then | |
echo "usage: extract.sh src dst" | |
fi | |
if [ "*$2" == "*" ]; then | |
echo "usage: extract.sh src dst" | |
fi |
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
package main | |
import ( | |
"database/sql" | |
"flag" | |
"fmt" | |
"log" | |
"time" | |
// Yes ... this is required !!! |
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
package main | |
import ( | |
"database/sql" | |
"flag" | |
"fmt" | |
"log" | |
_ "github.com/go-sql-driver/mysql" | |
) |
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
// -Wall -O2 -nostdlib -nostartfiles -ffreestanding -mcpu=arm1176jzf-s -mtune=arm1176jzf-s -mhard-float | |
void foobar() | |
{ | |
uint8 buf[11] = { 0 }; | |
for (int i = 0; i < sizeof(buf); i++) | |
{ | |
uint8 x = buf[i]; | |
uint32 a = (uint32) &buf[i]; | |
uart_putx(a); |
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
module top( | |
input CLK, | |
output USBPU, | |
output PIN_24, | |
); | |
assign USBPU = 0; // disable USB | |
wire clk115200hz; | |
dclk0 d0(.clk16mhz(CLK), .clk115200hz(clk115200hz)); | |
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
#include <immintrin.h> | |
#include <inttypes.h> | |
#include <stdio.h> | |
char * sprint_m256(__m256 v) { | |
static char tmp[256]; | |
snprintf(tmp, sizeof tmp, "[%8.2f, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f, %8.2f]", | |
v[7], v[6], v[5], v[4], v[3], v[2], v[1], v[0]); | |
return tmp; | |
} |
OlderNewer