Skip to content

Instantly share code, notes, and snippets.

@ArchKudo
ArchKudo / style.css
Last active August 29, 2015 14:07 — forked from uriel1998/style.css
/* You may notice that my CSS file is organized in a fairly straightforward and */
/* static way. This is intentional, folks. You can do a LOT fancier - but I'm */
/* operating under a KISS principle here. Otherwise it's too easy to have more */
/* than one style applying to any line and making troubleshooting difficult. */
/* My goal is portability and it NEVER distracting from the text. */
/* Put any additional fonts you REQUIRE here. I recommend using additional fonts */
/* only when you MUST; and always define a fallback. Please note that if you have */
/* the font in a sub-directory, you must define it properly in the src portion */
@ArchKudo
ArchKudo / WAP.c
Created February 21, 2016 04:11
Q.NO.2 from SPA Question Bank
#include <stdio.h>
#ifndef WAP2
#define MAX 1000
#define TERM(count) (((2 * count) - 1) / (2 * count))
float factorial(int count) {
return count == 0 ? (1) : count * factorial(count - 1);
}
int fibo(int count) {
if (count > 0) {
@ArchKudo
ArchKudo / calculator.c
Last active February 21, 2016 04:39
Q.NO.5 from SPA Q.Bank
#include <stdio.h>
void calc_if(void) {
int a, b;
char op;
printf("Enter expression: ");
scanf("%d %c %d", &a, &op, &b);
if (op == '+') {
printf("Addition: %d\n", a + b);
} else if (op == '-') {
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Starting TWRP 2.7.1.0 on Thu Jan 1 00:00:23 1970
I:Internal path defined: '/data/media/0'
I:External path defined: '/external_sd'
I:Mount: Unable to find partition for path '/data'
RECOVERY_SDCARD_ON_DATA := true
I:Lun file '/sys/devices/platform/usb_mass_storage/lun0/file' does not exist, USB storage mode disabled
TW_HAS_DOWNLOAD_MODE := true
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
int **allocate_matrix(int rows, int cols) {
// Setup Rows
int **matrix = calloc(rows, sizeof(matrix));
// Setup Corresponding Columns
@ArchKudo
ArchKudo / gist:c482737470ccff6e35f0e5c7241223ff
Created January 14, 2017 04:24
Gnome Shell Stack Trace
Jan 14 09:49:51 hbar systemd-coredump[7604]: Process 7450 (gnome-shell) of user 1000 dumped core.
Stack trace of thread 7450:
#0 0x00007f2de1b7f04f raise (libc.so.6)
#1 0x00007f2de1b8047a abort (libc.so.6)
#2 0x00007f2de21782a5 g_assertion_message (libglib-2.0.so.0)
#3 0x00007f2de217833a g_assertion_message_expr (libglib-2.0.so.0)
#4 0x00007f2de31641d3 gtk_icon_info_load_icon_finish (libgtk-3.so.0)
#5 0x00007f2de3164258 n/a (libgtk-3.so.0)
#6 0x00007f2de26f6323 n/a (libgio-2.0.so.0)
Jan 14 14:13:25 hbar gnome-session-binary[858]: Unrecoverable failure in required component org.gnome.Shell.desktop
Jan 14 14:14:07 hbar gnome-session-binary[3415]: Unrecoverable failure in required component org.gnome.Shell.desktop
Jan 14 14:14:08 hbar systemd-coredump[3587]: Process 3431 (gnome-shell) of user 1000 dumped core.
Stack trace of thread 3431:
#0 0x00007fde99e1604f raise (libc.so.6)
#1 0x00007fde99e1747a abort (libc.so.6)
#2 0x00007fde9a40f2a5 g_assertion_message (libglib-2.0.so.0)
#3 0x00007fde9a40f33a g_assertion_message_expr (libglib-2.0.so.0)
#4 0x00007fde9b3fb1d3 gtk_icon_info_load_icon_finish (libgtk-3.so.0)
@ArchKudo
ArchKudo / journalctl.txt
Created July 6, 2017 07:33
journalctl -b > journalctl.txt
-- Logs begin at Sat 2017-04-08 15:33:49 IST, end at Thu 2017-07-06 11:56:15 IST. --
Jul 06 11:45:51 localhost kernel: Linux version 4.11.7-1-ARCH (builduser@tobias) (gcc version 7.1.1 20170621 (GCC) ) #1 SMP PREEMPT Sat Jun 24 09:07:09 CEST 2017
Jul 06 11:45:51 localhost kernel: Command line: BOOT_IMAGE=/vmlinuz-linux root=/dev/mapper/encrypt-root rw rd.luks.uuid=fb2a1e44-3624-4520-b8f8-f4fd9f3f2511 quiet
Jul 06 11:45:51 localhost kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
Jul 06 11:45:51 localhost kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
Jul 06 11:45:51 localhost kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
Jul 06 11:45:51 localhost kernel: x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
Jul 06 11:45:51 localhost kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format.
Jul 06 11:45:51 localhost kernel: e820: BIOS-provided physical RAM map:
Jul 06 11:45:51 localhost kernel: BIOS-e8
from functools import reduce
import operator
mat = [[11, 2, 4], [4, 5, 6], [10, 8, -12]]
def diff_sum(a, b):
return abs(sum(a) - sum(b))
@ArchKudo
ArchKudo / app.py
Last active March 9, 2018 15:38
Toga Font
import toga
from toga.constants import MONOSPACE, SMALL_CAPS
from toga.style import Pack
def build(app):
box = toga.Box()
label = toga.Label('Hello world', style=Pack(font_variant=SMALL_CAPS)) # Replacing with font_family=monospace or font_size=20 works
label.style.padding = 100
label.style.flex = 1