Skip to content

Instantly share code, notes, and snippets.

View derofim's full-sized avatar

Den derofim

  • Google
  • USA
View GitHub Profile
@derofim
derofim / aloe.py
Last active March 5, 2017 20:48
stereo.py
""" Machine Learning Recipe """
# pylint: disable=C0103
# pylint: disable=E0401
# pylint: disable=maybe-no-member
# Python 2/3 compatibility
from __future__ import print_function
import numpy as np
import cv2
// (c) Denis Trofimov 2017
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SFML.Graphics;
using SFML.Window;
using SFML.System;
namespace Snake
#version 120
//#define NSAMPLES 8
#define NSAMPLES 16
//#define NSAMPLES 32
#define PI 3.14159265359
varying vec2 fTexcoord;
@derofim
derofim / ConsoleVariables.ini
Last active May 7, 2018 12:05
UE4 Optimize (light spam test)
;
; Optimize
r.DefaultFeature.MotionBlur=False
r.LightFunctionQuality=0
r.ShadowQuality=0
r.Shadow.CSM.MaxCascades=1
r.Shadow.MaxResolution=256
r.Shadow.RadiusThreshold=0.1
r.Shadow.DistanceScale=0.6
r.Shadow.CSM.TransitionScale=0
@derofim
derofim / Dog.java
Last active January 16, 2017 13:28
Is Java “pass-by-reference” or “pass-by-value”? http://stackoverflow.com/a/40523
public class Dog {
String m_name;
public Dog(String string) {
m_name = string;
}
String getName(){
return m_name;
}
@derofim
derofim / lightColor
Created January 14, 2017 10:44
lightColor
uniform vec2 lightpos;
uniform vec3 lightColor;
uniform float screenHeight;
uniform vec3 lightAttenuation;
uniform float radius;
uniform sampler2D texture;
void main()
{
@derofim
derofim / main.js
Created January 12, 2017 19:15
Печать с двух сторон (выводит страницы на распечатку)
// Печать с двух сторон (выводит страницы на распечатку)
//
// Программу можно запустить на https://jsfiddle.net/
// Вставьте этот javascript код, нажмите F12 и кнопку Run
// Меняйте переменные side, startPage, endPage
//
// Печать по диапозону [startPage;endPage]
// Сначала печатаем все страницы с side=1
// Вставляем распечатанную кипу в принтер
// Текст должен быть верх ногами и чистой сторой к нам
@derofim
derofim / Model.cpp
Created January 12, 2017 09:31 — forked from emmasteimann/Model.cpp
Assimp loader
#include "Model.hpp"
bool core::ModelLoader::loadModel(const char* fp, Model* m)
{
core::log("Loading " + (std::string)fp, core::green);
Assimp::Importer importer; // used to import the model
const aiScene* scene = importer.ReadFile(fp,
aiProcess_Triangulate |
#include <xlnt/xlnt.hpp>
#include <iostream>
void create() {
xlnt::workbook wb;
xlnt::worksheet ws = wb.active_sheet();
ws.cell("A1").value(5);
ws.cell("B2").value("string data");
ws.cell("C3").formula("=RAND()");
ws.merge_cells("C3:C4");
<ItemGroup>
<Object Include="D:\Tensorflow\tensorflow-master\tensorflow\contrib\cmake\build\tf_core_lib.dir\$(Configuration)\arena.obj">
<Filter>Object Libraries</Filter>
</Object>
<Object Include="D:\Tensorflow\tensorflow-master\tensorflow\contrib\cmake\build\tf_core_lib.dir\$(Configuration)\bitmap.obj">
<Filter>Object Libraries</Filter>
</Object>
<Object Include="D:\Tensorflow\tensorflow-master\tensorflow\contrib\cmake\build\tf_core_lib.dir\$(Configuration)\coding.obj">
<Filter>Object Libraries</Filter>
</Object>