Skip to content

Instantly share code, notes, and snippets.

View lighth7015's full-sized avatar
Perpetually exhausted.

Robert Butler lighth7015

Perpetually exhausted.
View GitHub Profile
@lighth7015
lighth7015 / Makefile
Created February 5, 2020 18:38
Help target
help: ## Display usage and built-in help information.
$(shell printf "echo \"\"")
$(shell printf "echo \" %-20s %s\"" "Giza SDK Help" "Displays usage and built-in help information.")
$(shell printf "echo \"\"")
$(shell printf "echo \" ┌──────────────────────────────────────────────────────────────────────────────┐\"")
$(shell printf "echo \" │ %-76s │\"" "Available Targets:" )
$(shell printf "echo \" ├──────────────────────────────────────────────────────────────────────────────┤\"")
for target in $(MAKE_TARGETS); do \
echo "$${target}"; \
@lighth7015
lighth7015 / ProcessorInfo.py
Last active February 7, 2020 17:16
ProcessorInfo.py
import os.path, re
from typing import List
""" Query processor info (UNIX/win32)"""
isfloat = lambda value: len(tuple(it for it in str(value.strip()).partition('.') if len(it) > 0)) == 3
tofloat = lambda value: float(str(value).strip()) if isfloat(value) else None
tofloatif = lambda value: tofloat(value) or value
class LogicalProcessor(object):
def __init__(self, args) -> None:
self.processor = args.get('processor', '')
import re, os.path as path
class Makefile(object):
def __init__(self, filename):
if path.exists(filename):
self.handle = open(filename)
def get(self, name, default = None):
value = default
@lighth7015
lighth7015 / mditest.cpp
Created February 10, 2020 04:10
MDI Test
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/scrolwin.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/string.h>
#include <wx/frame.h>
#include <wx/aui/aui.h>
@lighth7015
lighth7015 / test.c
Last active February 11, 2020 10:43
FindWindow()
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <inttypes.h>
#include <xcb/xcb.h>
const char hPropName[] = "HWND";
#include "base.h"
#include "application.h"
MainApplication app;
MainApplication::MainApplication(const char* caption)
: Fl_Double_Window(640, 480, caption)
, menubar( 0, 0, 480, menuHeight)
, workspace( 0, 0, 280, 60, "")
{
@lighth7015
lighth7015 / README.md
Created February 16, 2020 17:31
std::shared_ptr crash
(gdb) r
Starting program: /home/robert_/C++/intervue/bin/x86_64-pc-linux-gnu/debug/client 
/usr/lib/../share/gcc-9.2.0/python/libstdcxx/v6/xmethods.py:731: SyntaxWarning: list indices must be integers or slices, not str; perhaps you missed a comma?
  refcounts = ['_M_refcount']['_M_pi']
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
height is 16

ID = 1, Position = (231, 2)
@lighth7015
lighth7015 / tar.c
Created February 16, 2020 20:18
tar.c
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include <sys/stat.h>
#include <sys/mman.h>
@lighth7015
lighth7015 / readme.md
Created February 18, 2020 05:36
waf runtim error
My code here

Setting top to                           : directory-it-doesnt-matter
Setting out to                           : directory-it-doesnt-matter
Traceback (most recent call last):
  File "/lib/python3.8/site-packages/waf/waflib/Scripting.py", line 159, in waf_entry_point
    run_commands()
  File "/lib/python3.8/site-packages/waf/waflib/Scripting.py", line 255, in run_commands
 ctx = run_command(cmd_name)
@lighth7015
lighth7015 / aolnet.ccl
Created February 19, 2020 09:49
CCL file
!----------------------------------------------------------------------
! AOLNET.CCL
!----------------------------------------------------------------------
Title "AOLnet"
ID 4
DriverType 1
-Label 0 { Label 0 }
IfConnects 2 1