Skip to content

Instantly share code, notes, and snippets.

@yousefhamza
yousefhamza / CoreData crash
Created June 8, 2023 13:52
Core data crash
data:text/text;charset=utf-8,
# Cause: Crash due to signal: SIGSEGV(SEGV_MAPERR) at 00000000
# Reported at: 2023-06-07 12:00:57 UTC
Thread 0 Unknown:
0 libsystem_kernel.dylib 0x1dc065c84 mach_msg2_trap + 8
1 libsystem_kernel.dylib 0x1dc078e2c mach_msg_overwrite + 539
2 libsystem_kernel.dylib 0x1dc0661c8 mach_msg + 23
3 CoreFoundation 0x19d3c6114 __CFRunLoopServiceMachPort + 159
@yousefhamza
yousefhamza / kernel.cu
Last active December 3, 2015 11:52
Soble algorithm in Cuda
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include <stdio.h>
#define BLOCKSIZE 2
#define THREADSIZE 3
void cpu_convolve(float *image, float *filter, float *result, unsigned int N) {
float sum;
for (unsigned int i = 1; i < N - 1; i++)
@yousefhamza
yousefhamza / parse_tabs.py
Last active November 9, 2015 13:58
Python script to parse tabbed files into JSON formats as {'name': <name>, 'children': [] }
__author__ = 'yousefhamza'
import json
import sys
if len(sys.argv) != 2:
print 'Usage: python parse_tabs.py <file name>'
exit()
tab_file = open(sys.argv[1])
json_stack = []
@yousefhamza
yousefhamza / git_extract_commits.sh
Created September 9, 2015 06:07 — forked from xinan/git_extract_commits.sh
This is a simple shell script to extract commits by a specified author in a git repository and format them as numbered patches. It is useful for GSoC code submission.
if ! [[ $# -eq 1 || $# -eq 2 || $# -eq 4 ]]; then
echo "Usage: $0 <author> [<start_date> <end_date>] [output_dir]"
echo "Example: $0 xinan@me.com 2015-05-25 2015-08-21 ./patches"
exit
fi
author=$1
if [ $# -gt 3 ]; then
output_dir=$4
@yousefhamza
yousefhamza / English.txt
Last active August 29, 2015 14:23
The localisation file for OpenMRS iOS app
/* Address */
"Address" = "Adresse";
/* Birth date of person */
"BirthDate" = "Geburtsdatum";
/* Is birth date estimated? */
"BirthDate Estimated" = "Geburtsdatum geschätzt";
/* Error message */