Skip to content

Instantly share code, notes, and snippets.

@yousry
yousry / Main.scala
Created February 6, 2017 13:11
Playing with Breeze
package de.yousry.linearalgebra
import scala.language.postfixOps
import breeze.linalg.{DenseMatrix, DenseVector}
import breeze.numerics._
import com.typesafe.scalalogging.LazyLogging
// To Start: LD_PRELOAD=/usr/lib/libcblas.so sbt
/**
@yousry
yousry / OptiB.mm
Created December 13, 2016 09:27
Sourcecode for: Deconstruction of Optical Illusions
int main (int argc, const char * argv[])
{
@autoreleasepool {
YAVector2i *res = [[YAVector2i alloc] initVals: 800 : 800];
float defGrey = 150.0f / 255.0f;
YAVector4f *backColor = [[YAVector4f alloc] initVals: defGrey : defGrey : defGrey : 1];
YACanvas *canvas = [[YACanvas alloc] initResolution: res Color: backColor];
@yousry
yousry / OptiA.mm
Created December 13, 2016 09:24
Sourcecode for: Deconstruction of Optical Illusions
int main (int argc, const char * argv[])
{
@autoreleasepool {
YAVector2i *res = [[YAVector2i alloc] initVals: 800 : 800];
YAVector4f *backColor = [[YAVector4f alloc] initVals: 0.99 : 0.99 : 0.99 : 1];
YACanvas *canvas = [[YACanvas alloc] initResolution: res Color: backColor];
float lineW = 9;
float lineSP = res.x / 25;
//
// Carrot.mm
//
// Created by Yousry Abdallah.
// Copyright 2016 yousry.de. All rights reserved.
#include <string>
#import "YATextureArray.h"
@yousry
yousry / ProbabilisticSteganography
Created October 13, 2016 12:19
Draft Probabilistic Steganography
#define ToRadian(x) ((x) * M_PI / 180.0f)
#define ToDegree(x) ((x) * 180.0f / M_PI)
#define ToGrad(x) ((x) * M_PI / 360.0f)
static const NSString* TAG = @"main";
static NSMutableArray* visited = [NSMutableArray new];
@yousry
yousry / collectLibs.sh
Created October 8, 2016 15:44
Collect all dynamic libraries for a linux binary
#!/usr/bin/bash
# collectLibs.sh
# copy dynamic libraries for an application into a local lib folder
# The only argument is the filename
filename=$1
lddraw=`ldd $1`
IFS=$'\n' read -rd '' -a lddlines <<<"$lddraw"
#!/bin/bash
INCLUDEDLIBS=(libc.so.6 libdl.so.2 libstdc++.so.6 libm.so.6 libpthread.so.0 libresolv.so.2 libGL.so.1 libdrm.so.2 libxcb.so.1 libX11.so.6 libgio-2.0.so.0 libgdk-x11-2.0.so.0 libgtk-x11-2.0.so.0 libasound.so.2 libgdk_pixbuf-2.0.so.0 libfontconfig.so.1 libselinux.so.1 libcom_err.so.2 libcrypt.so.1 libexpat.so.1 libgcc_s.so.1 libglib-2.0.so.0 libgpg-error.so.0 libgssapi_krb5.so.2 libhcrypto.so.4 libhx509.so.5 libICE.so.6 libidn.so.11 libk5crypto.so.3 libkeyutils.so.1 libkrb5.so.26 libkrb5.so.3 libkrb5support.so.0 libm.so.6 libp11-kit.so.0 libpcre.so.3 libpthread.so.0 libresolv.so.2 libroken.so.18 librt.so.1 libSM.so.6 libusb-1.0.so.0 libuuid.so.1 libwind.so.0 libz.so.1 libGL.so.1 libdrm.so.2 libgobject-2.0.so.0)
for i in ${INCLUDEDLIBS[@]};
do
rm $i
done
@yousry
yousry / updateClang.sh
Created August 9, 2016 07:36
Update Clang sources with all Subprojects
#!/usr/bin/bash
d=`find . -name ".svn"`
IFS=$'\n' read -rd '' -a dlines <<<"$d"
for dline in "${dlines[@]}"
do
pushd .
p=`dirname $dline`
@yousry
yousry / checkoutClang.sh
Created August 9, 2016 07:34
Checkout Clang with Tools, Runtime, libcxx and abi
#!/usr/bin/bash
svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
cd llvm/tools
svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
cd ../..
cd llvm/tools/clang/tools
svn co http://llvm.org/svn/llvm-project/clang-tools-extra/trunk extra
cd ../../../..
cd llvm/projects
@yousry
yousry / subliminal stimuli demo
Created November 14, 2014 15:48
Source code for: "Adding subliminal stimuli in real-time to audio recordings" (http://www.yousry.de/adding-subliminal-stimuli-in-real-time-to-audio-recordingssprachmodul-v2-0/)
#include <stdlib.h>
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
#include <stdbool.h>
#include <math.h>
#include "simpleAudio.h"
int main(int argc, char** argv)