UserScripts
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 <avr/boot.h> | |
void print_val(char *msg, uint8_t val) | |
{ | |
Serial.print(msg); | |
Serial.println(val, HEX); | |
} | |
void setup(void) | |
{ |
a block with length 0.35m, width 0.25m, height 0.35m weighs 12kg. How deep does it sink in sea water?
To determine how deep the block sinks in sea water, we need to consider the buoyant force acting on the block and compare it to the weight of the block.
The buoyant force is equal to the weight of the water displaced by the block. In this case, the block is submerged in sea water, which has a density of approximately 1,025 kg/m³.
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
""" | |
Written by GPT3 from this English prompt (with one tweak to the prompt, to get | |
the timestamp parameter to not error out, and PEP8 fixes): | |
---- | |
1. Open a sqlite database with a name like `2022-07-17 17.48.19.db` or | |
`2021-04-11 08.44.16.db` | |
2. Inside is a table called `locations`, with headers [LOCTYPE INTEGER, | |
TIMESTAMP BIGINT, LATITUDE REAL, LONGITUDE REAL,ALTITUDE REAL, ACCURACY |
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
#!/usr/bin/python | |
data = "asdfg" | |
bps = 115200 | |
num_databits=8 | |
parity = 'n' | |
num_stopbits = 1 | |
lvl_0 = 3.3 | |
lvl_1 = 0.0 |
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> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <sys/ipc.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
void touch(char *file_name) { | |
FILE *fp; | |
if ((fp = fopen(file_name, "w")) == 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
candump -t A can0 | sed -e 's/ (.* \(.*\)\.\(...\).*) *can. *\([0-9A-F]*\) *\[.*\] */\1.\2 R \3 /g' -e 's/[\r\n]*$/\r/' | nc -l -p 1457 2>&1 | sed -u -n -e 's/^\([^ ]*\) /\1#/g;s/ //g;s/\r//g;/^$/!p;' | while IFS="" read CMD ; do cansend can0 $CMD ; done | |
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
/* | |
NASAClipper_I2C_to_NMEA v0.5.2 | |
Decode the NASA Clipper Data into a NMEA compatible serial string | |
written by Peter Holtermann | |
with additions from Victor Klein | |
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
/* | |
step.c | |
Program to verify new algorithm for linear acceleration. | |
Author: Pramod Ranade <pramod.ranade@spjsystems.com> | |
*/ | |
#include <stdio.h> | |
#if defined(_WIN32) || defined(_WIN64) | |
#include <io.h> | |
#endif |
NewerOlder