Skip to content

Instantly share code, notes, and snippets.

Popa Marius Adrian mariuz

Block or report user

Report or block mariuz

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MIvanchev
MIvanchev / article.md
Last active Oct 11, 2019
Ever wondered what it takes to run Windows software on ARM? Then this article might be for you!
@berk76
berk76 / com_exe.md
Last active Feb 9, 2018
DOS: com vs exe
View com_exe.md

COM vs. EXE Program

EXE program can have any size whereas COM program can have maximally 64kB (just one segment).

COM Program

At the beginning of program there is program segment prefix (PSP). Because COM program is stored only in one segment so PSP occupies first 256 bytes (100h). Therefore start point begins at 100h. Values of segment registers are set to the begin of segment and don’t change during executing.

COM program in memory:

@berk76
berk76 / c_asm.md
Last active Feb 9, 2018
DOS: TASM and C
View c_asm.md

How to combine Assembly and C in DOS

This gist is showing an example of C program calling routine written in assembly.

Some theory

  • C is case sensitive so it is necessary to use /ml switch in TASM
  • C compiler uses leading underscore (_) character for function names
  • parameters are passed to function in stack and integer return value is passed back in AX register
  • stack cleaning is done by caller
@roboshoes
roboshoes / Spherical.cs
Last active Nov 22, 2017
Implementation of spherical coordinates in C# (based on https://github.com/mrdoob/three.js/blob/master/src/math/Spherical.js)
View Spherical.cs
using UnityEngine;
public struct Spherical {
public float Radius;
public float Phi;
public float Theta;
Spherical( float radius = 1f, float phi = 0f, float theta = 0f ) {
Radius = radius;
@ryderstorm
ryderstorm / installing_rmagick_ubuntu_16.04.txt
Last active Sep 18, 2019
Installing rmagick gem on Ubuntu 16.04
View installing_rmagick_ubuntu_16.04.txt
# the instructions from here: https://stackoverflow.com/questions/3704919/installing-rmagick-on-ubuntu/31089915#31089915
# worked, but only after I added in line 8
sudo apt-get purge graphicsmagick graphicsmagick-dbg imagemagick-common imagemagick imagemagick-6.q16 libmagickcore-6-headers libmagickwand-dev graphicsmagick-libmagick-dev-compat
sudo apt-get autoremove
sudo apt-get install imagemagick libmagickwand-dev
sudo ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
gem install rmagick
@wojtha
wojtha / migrate_rubocop_style_to_layout.rb
Last active Jan 10, 2019
Ruby script to migrate Rubocop settings from Style to Layout
View migrate_rubocop_style_to_layout.rb
# Fixes complains such as:
# .rubocop.yml: Style/IndentationConsistency has the wrong namespace - should be Layout
# .rubocop.yml: Style/IndentationWidth has the wrong namespace - should be Layout
# .rubocop.yml: Style/DotPosition has the wrong namespace - should be Layout
layouts = %w[
AccessModifierIndentation
AlignArray
AlignHash
AlignParameters
@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active Oct 15, 2019
FFmpeg cheat sheet for 360 video
View ffmpeg-cheatsheet.md

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
View FixFbxModelPostprocessor.cs
/**
* Author: David Asmuth
* Contact: piranha771@gmail.com
* License: Public domain
*
* Converts the .fbx model
* from Blender orientation system (Z is up, Y is forward)
* to the Unity3D orientation system (Y is up, Z is forward)
*/
using System.IO;
@nakagami
nakagami / PyConJP2016.rst
Last active Apr 2, 2017
How to write python database driver (PyCon JP 2016 talk)
View PyConJP2016.rst
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to write python database driver
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- https://pycon.jp/2016/ja/schedule/presentation/13/
- https://www.youtube.com/watch?v=ax2WmQ_MSXs
- https://togetter.com/li/1028521
========================================
Preface
@karpathy
karpathy / pg-pong.py
Created May 30, 2016
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
View pg-pong.py
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
You can’t perform that action at this time.