Skip to content

Instantly share code, notes, and snippets.

View foxpy's full-sized avatar
🏠
Working from home

Murad foxpy

🏠
Working from home
  • Hadron Labs
  • Cyprus, Nicosia
  • 15:21 (UTC +03:00)
View GitHub Profile
@foxpy
foxpy / floats.txt
Last active April 21, 2021 03:45
floats
; cat demo.c
#include <stdio.h>
int main(void) {
double d = 0.00000001337;
for (int i = 0; i < 100; ++i) {
printf("%02d: %130.100f\n", i, d);
d *= 2.0;
}
}
@foxpy
foxpy / sample-output.txt
Last active April 21, 2021 03:50
Little C program kinda showing structure of fp64
True zero first:
0000000000000000000000000000000000000000000000000000000000000000: 0x0000000000000000: 0.0000
True half second:
0011111111100000000000000000000000000000000000000000000000000000: 0x3fe0000000000000: 0.5000
True one third:
0011111111110000000000000000000000000000000000000000000000000000: 0x3ff0000000000000: 1.0000
Now from -1.0 to 1.0:
1011111111110000000000000000000000000000000000000000000000000000: 0xbff0000000000000: -1.0000
1011111111101100110011001100110011001100110011001100110011001101: 0xbfeccccccccccccd: -0.9000
@foxpy
foxpy / backtrace0.log
Last active March 17, 2020 10:01
TDesktop crashes
─── Output/messages ─────────────────────────────────────────────────────────────────────────────
[Thread 0x7fffae7fc700 (LWP 136928) exited]
[Thread 0x7fffad7fa700 (LWP 136927) exited]
[Thread 0x7fffadffb700 (LWP 136926) exited]
[Thread 0x7fffaeffd700 (LWP 136924) exited]
[Thread 0x7fffb4a01700 (LWP 136920) exited]
[Thread 0x7fffb5b04700 (LWP 136918) exited]
[Thread 0x7fffb77fe700 (LWP 136916) exited]
[Thread 0x7fffb7fff700 (LWP 136914) exited]
[Thread 0x7fffcce45700 (LWP 136913) exited]
@foxpy
foxpy / Microsoft.PowerShell_profile.ps1
Last active May 5, 2020 01:33
My custom PowerShell profile. Run with ` -nologo` command line argument. WARNING: Save in Windows-1252!
# Popular Unix shell command `fortune`
# Download `fortune.txt` from https://www.bgreco.net/fortune.txt
# and place it in PowerShell profile folder
function fortune() {
[System.IO.File]::ReadAllText((Split-Path $profile)+'\fortune.txt') -replace "`r`n", "`n" -split "`n%`n" | Get-Random
}
# CPU temperature taken from MSACPI (run command as admin)
# Thanks https://gist.github.com/jeffa00/9577816