Skip to content

Instantly share code, notes, and snippets.

Synther Lawrence synther

Block or report user

Report or block synther

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:37dcdbdc6d47351a460a
out_curr[3] = ((new_nal_len >> 0) & 0xFF); // move byte 3 to byte 0
b384: e59d302c ldr r3, [sp, #44] ; 0x2c
b388: e2832003 add r2, r3, #3
b38c: e59d3034 ldr r3, [sp, #52] ; 0x34
b390: e20330ff and r3, r3, #255 ; 0xff
b394: e5c23000 strb r3, [r2]
out_curr[2] = ((new_nal_len >> 8) & 0xFF); // move byte 2 to byte 1
b398: e59d302c ldr r3, [sp, #44] ; 0x2c
b39c: e2832002 add r2, r3, #2
b3a0: e59d3034 ldr r3, [sp, #52] ; 0x34
View ESP8266 Arduino Mega
//#include <SoftwareSerial.h>
//use mega Serial 2 for serial monitor; Serial 1 on pins 19 (RX) and 18 (TX);// Serial2 on pins 17 (RX) and 16 (TX), Serial3 on pins 15 (RX) and 14 (TX).
#define SSID "enter SSID here"
#define PASS "enter password here"
#define DST_IP "220.181.111.85" //baidu.com
//SoftwareSerial dbgSerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
View gist:0393464afc7e755bbe33
[ 1638.680000] UDP: bad checksum. From 22.68.187.255:59015 to xxx.xxx.my.ip:53 ulen 43
[ 1639.080000] UDP: bad checksum. From 83.134.124.244:8706 to xxx.xxx.my.ip:53 ulen 51
[ 1641.980000] __ratelimit: 11 callbacks suppressed
[ 1641.990000] UDP: bad checksum. From 118.149.245.188:57576 to xxx.xxx.my.ip:53 ulen 51
[ 1641.990000] UDP: bad checksum. From 68.76.24.191:40791 to xxx.xxx.my.ip:53 ulen 51
[ 1642.590000] UDP: bad checksum. From 53.112.49.173:39565 to xxx.xxx.my.ip:53 ulen 51
[ 1643.100000] UDP: bad checksum. From 93.74.202.243:33673 to xxx.xxx.my.ip:53 ulen 43
[ 1643.760000] UDP: bad checksum. From 62.196.183.91:13029 to xxx.xxx.my.ip:53 ulen 47
[ 1643.940000] UDP: bad checksum. From 44.100.134.31:56551 to xxx.xxx.my.ip:53 ulen 43
[ 1644.070000] UDP: bad checksum. From 116.176.222.45:50575 to xxx.xxx.my.ip:53 ulen 43
View queue.h
/*
* List definitions.
*/
#define LIST_HEAD(name, type) \
struct name { \
struct type *lh_first; /* first element */ \
}
#define LIST_HEAD_INITIALIZER(head) \
{ NULL }
View gist:eeeb7e5b4596f6ed3774
#!/bin/bash
if [ $# -ne 1 ]; then
echo "$0 <device id|device name>"
exit 1
fi
i=0
while read label min delim max; do
if [ $i -eq 0 ]; then
@synther
synther / gist:d376100a8bae896d0caf
Last active Feb 6, 2020
linux signals cheat sheet
View gist:d376100a8bae896d0caf
Signal Value Action Comment
SIGHUP 1 Term Hangup detected on controlling terminal or death of controlling process
SIGINT 2 Term Interrupt from keyboard
SIGQUIT 3 Core Quit from keyboard
SIGILL 4 Core Illegal Instruction
SIGABRT 6 Core Abort signal from abort(3)
SIGFPE 8 Core Floating point exception
SIGKILL 9 Term Kill signal
SIGSEGV 11 Core Invalid memory reference
SIGPIPE 13 Term Broken pipe: write to pipe with no readers
@synther
synther / hierarchic
Last active Dec 11, 2015
Реализация метода анализа иерархий для принятия решений в условиях неопределенности. Предполагаем, что весовые коэффициенты уже известны
View hierarchic
/**
* Created with IntelliJ IDEA.
* User: Synther
* Date: 20.01.13
* Time: 14:19
*/
abstract class Node
case class Criterion(weight: Double, child: List[Node]) extends Node
case class Alternative(weights: List[Double]) extends Node
@synther
synther / 1 - Program.java
Created Jul 22, 2012
Implementing a method wrapper (using java.lang.reflect.Proxy)
View 1 - Program.java
package com.inalgebra.proxytest;
import com.inalgebra.proxy.MethodWrapper;
import java.lang.reflect.Method;
/**
* Created with IntelliJ IDEA.
* User: synther
* Date: 7/22/12
@synther
synther / gist:2631238
Created May 7, 2012
Java - Unsafe reference publication
View gist:2631238
class Data {
private Object ob1 = new Object();
private Object ob2 = new Object();
private Object ob3 = new Object();
private Object ob4 = new Object();
@synther
synther / roman.scala
Created Jan 22, 2012
Из римских чисел в арабские. Пример из книги
View roman.scala
def roman(in: List[Char]): Int = in match {
case 'I' :: 'V' :: rest => 4 + roman(rest)
case 'I' :: 'X' :: rest => 9 + roman(rest)
case 'I' :: rest => 1 + roman(rest)
case 'V' :: rest => 5 + roman(rest)
case 'X' :: 'L' :: rest => 40 + roman(rest)
case 'X' :: 'C' :: rest => 90 + roman(rest)
case 'X' :: rest => 10 + roman(rest)
case 'L' :: rest => 50 + roman(rest)
case 'C' :: 'D' :: rest => 400 + roman(rest)
You can’t perform that action at this time.