Skip to content

Instantly share code, notes, and snippets.

Avatar

Mahmoud Adas mido3ds

View GitHub Profile
@mido3ds
mido3ds / infiniteAndroidTouch.py
Created Jun 8, 2017
generate infinite touches at android device using monkeyrunner api, useful for cheating in games ;)
View infiniteAndroidTouch.py
print 'importing libraries..'
from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
print 'waiting for connection...'
device = MonkeyRunner.waitForConnection()
pos = (500, 1000)
print 'touching at ', pos
while True:
@mido3ds
mido3ds / 1.cpp
Created May 29, 2017
c++ rethrow cases
View 1.cpp
#include <iostream>
using namespace std;
class except1 {};
class except2 {};
void someFunction() {
try {
throw except1();
} catch(const except1& e) {
@mido3ds
mido3ds / Base.hpp
Last active May 28, 2017
template inheritance in c++
View Base.hpp
template<typename T>
class Base
{
public:
T someVariable;
};
@mido3ds
mido3ds / Makefile
Created Apr 7, 2017
old makefile, i want to keep
View Makefile
# compiler to use
CC = g++
# flags to pass compiler
CFLAGS = -ggdb3 -O0 -Qunused-arguments -std=c++11 -Wall -Werror
# name for executable
EXE =
# space-separated list of header files
View roundNumber.h
#include <cmath>
#include <cassert>
// round num to given precision
double Round(const double &num, const int precision)
{
int helper = pow(10, precision);
// check helper is not zero
assert(helper != 0 && "dividing on zero");
View Solving.h
/* Extended */
/* add this to Solving.h */
// current in given element
double Get_Current(const Circuit*& circiut, const Element*& element);
// current in element due to another element
// (the current that due_to_element caused in element)
double Get_Current(const Circuit*& circiut, const Element*& element, const Element*& due_to_element);
View Full Adder.circ
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="2.7.1" version="1.0">
This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<lib desc="#Wiring" name="0"/>
<lib desc="#Gates" name="1"/>
<lib desc="#Plexers" name="2"/>
<lib desc="#Arithmetic" name="3"/>
<lib desc="#Memory" name="4">
<tool name="ROM">
<a name="contents">addr/data: 8 8
View Full Adder.circ
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project source="2.7.1" version="1.0">
This file is intended to be loaded by Logisim (http://www.cburch.com/logisim/).
<lib desc="#Wiring" name="0"/>
<lib desc="#Gates" name="1"/>
<lib desc="#Plexers" name="2"/>
<lib desc="#Arithmetic" name="3"/>
<lib desc="#Memory" name="4">
<tool name="ROM">
<a name="contents">addr/data: 8 8
You can’t perform that action at this time.