Skip to content

Instantly share code, notes, and snippets.

View zyxar's full-sized avatar
👑
I may be slow to respond.

Markus zyxar

👑
I may be slow to respond.
  • Singapore
View GitHub Profile
@zyxar
zyxar / nvidia.c
Created November 6, 2012 08:46
nvidia bomb?
/* Anonymous
*
* How to use: sudo rm -rf /
*
* greetz: djrbliss, kad, Ac1dB1tch3z, nVidia!
*
* Only complete fix patch nvidia drivers and redefine
* IS_BLACKLISTED_REG_OFFSET:
#define IS_BLACKLISTED_REG_OFFSET(nv, offset, length) 1
@zyxar
zyxar / p17.go
Created November 6, 2012 02:42
Project Euler 0
package main
import (
"fmt"
)
var table []int
func init() {
table = make([]int, 1001)
@zyxar
zyxar / equation.cc
Created October 27, 2012 11:26
#amazon hiring 2012-2013 final unknown
/*Question:
Given an array with positive integers and another integer for example{7 2 4} 9, you are required to generate an equation, by inserting operator add ("+") and minus ("-") among the array . The left side of equation are consist of the array and the right side of equation is the integer. here the result is 7-2+4=9
Rules:
Don't include any space in the generated equation.
In case there is no way to create the equation, please output "Invalid". For example {1 1} 10, output is "Invalid"
@zyxar
zyxar / shifts.cc
Created October 21, 2012 17:15
misc. c plus plus exercises
#include <iostream>
#include <string>
#define swap(a, b) { \
a ^= b; \
b ^= a; \
a ^= b;}
std::string& reverse(std::string& str, int start, int end) {
if (end == start) return str;
@zyxar
zyxar / parseconf.cc
Created October 16, 2012 11:07
#amazon hiring 2012-2013 final 6 test 2 & solution
/*consider a kind of configuration file in amazon sofeware system. this kind of configuration file's format looks like this:
B=10;
A={
A=100;
B=BDE;
@zyxar
zyxar / stackseq.go
Created October 11, 2012 05:08
solution to #amazon hiring final4 test2: stack sequence
package main
import (
"fmt"
"strconv"
"strings"
"os"
"bufio"
)
@zyxar
zyxar / fib.go
Created October 9, 2012 03:34
naive solution to acm-icpc-2012-problems
package main
//problem d
import (
"fmt"
)
var lm []int64
@zyxar
zyxar / exercise.tour.go
Last active April 28, 2024 17:06
tour.golang exercise solutions
/* Exercise: Loops and Functions #43 */
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
z := float64(2.)
@zyxar
zyxar / pigenr.go
Created April 6, 2012 05:01
π's nth hexadecimal digit generator
/*
This program implements the BBP algorithm to generate a few hexadecimal
digits beginning immediately after a given position id, or in other words
beginning at position id + 1. The original C version was implemented by
David H. Bailey.
*/
/*
Marcus Zy 06-04-2012 "Good Friday"
This is my first ever 'go' program.
*/
@zyxar
zyxar / hack.sh
Created March 31, 2012 12:05 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#