Skip to content

Instantly share code, notes, and snippets.

View keineahnung2345's full-sized avatar
:octocat:
Focusing

keineahnung2345

:octocat:
Focusing
View GitHub Profile
@tats-u
tats-u / .editorconfig
Last active November 5, 2021 01:40
.editorconfig + C++ starter kit (Windows + Visual Studio 2019 + CMake)
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
tab_width = 8
@brunojppb
brunojppb / setup_redmine_4_ubuntu.md
Last active November 29, 2022 03:19
How to setup Redmine 4 on Ubuntu 18.04

How to setup Redmine 4 on Ubuntu 18.04

Prerequisites:

Full SSH root access or a user with sudo privileges.

Step 1: Connect to your Server

To connect to your server via SSH as the root user, use the following command:

@baiwfg2
baiwfg2 / CMakeLists.txt
Created September 29, 2018 12:42
How to use add_custom_target and add_custom_command correctly in cmake
# References:
# https://cmake.org/cmake/help/latest/command/add_custom_target.html
# https://samthursfield.wordpress.com/2015/11/21/cmake-dependencies-between-targets-and-files-and-custom-commands/
# https://gist.github.com/socantre/7ee63133a0a3a08f3990
# https://stackoverflow.com/questions/24163778/how-to-add-custom-target-that-depends-on-make-install
# https://stackoverflow.com/questions/30719275/add-custom-command-is-not-generating-a-target
# https://stackoverflow.com/questions/26024235/how-to-call-a-cmake-function-from-add-custom-target-command
# https://blog.csdn.net/gubenpeiyuan/article/details/51096777
cmake_minimum_required(VERSION 3.10)

PNG++ Installation on Ubuntu 16.04

Full documentation --> https://www.nongnu.org/pngpp/doc/0.2.9/

Requirements

The libpng it self, in Ubuntu 16.04 you can follow sudo apt install libpng12-dev.

The Steps

  1. Grab the lattest file here aka 0.2.9
  2. Go to download directory.
import torch
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
import torch.nn.functional as F
import matplotlib.pyplot as plt
import numpy as np
@Cartexius
Cartexius / install_gtest_ubuntu.md
Last active March 29, 2024 10:11
Install gtest in Ubuntu
@atinfinity
atinfinity / gpumat_memory_performance.cpp
Last active December 5, 2019 10:21
GpuMatのcudaMallocPitchが遅くなる再現コード
#include <opencv2/core.hpp>
#include <opencv2/core/cuda.hpp>
#include <cuda_runtime.h>
#include <device_launch_parameters.h>
#include <iostream>
int main(int argc, const char * argv[])
{
cudaFree(0); // dummy call
@maxim5
maxim5 / pretrained_word2vec_lstm_gen.py
Last active July 2, 2023 10:40
Text generator based on LSTM model with pre-trained Word2Vec embeddings in Keras
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'maxim'
import numpy as np
import gensim
import string
@hsinewu
hsinewu / kmp.cpp
Last active May 17, 2021 11:34
Knuth–Morris–Pratt algorithm in c++
#include <iostream>
#include <algorithm>
using namespace std;
int find_substring(string str, string pattern) {
// Step 0. Should not be empty string
if( str.size() == 0 || pattern.size() == 0)
return -1;
@ruslangrimov
ruslangrimov / keras-tensorflow-model-profiling.py
Last active October 15, 2019 20:51
Profiling a Keras-TensorFlow model
import tensorflow as tf
from tensorflow.python.client import timeline
from keras import backend as K
run_options = tf.RunOptions(trace_level=tf.RunOptions.FULL_TRACE)
run_metadata = tf.RunMetadata()
model = ... # A Keras model
fn = K.function(model.inputs, model.outputs, options=run_options, run_metadata=run_metadata)