Skip to content

Instantly share code, notes, and snippets.

View yuikns's full-sized avatar

Yu yuikns

  • 02:58 (UTC +08:00)
View GitHub Profile
class Solution {
public:
//
int minOfNext(vector<int>& v1, vector<int>& v2, int n1, int n2, int o1, int o2) {
if(n1 > o1 && n2 > o2) {
return min(v1[o1],v2[o2]);
} else if(n1 > o1) {
return v1[o1];
} else {
return v2[o2];
@yuikns
yuikns / assert_cuda.c
Created November 5, 2016 16:19 — forked from allanmac/assert_cuda.c
A tiny example of CUDA + OpenGL interop with write-only surfaces and CUDA kernels. Uses GLFW+GLAD.
//
//
//
#include <stdlib.h>
#include <stdio.h>
//
//
//
JsonData = [
{
key: "Serie1",
values: [
{'Data1': 1,
'Data2': 2,
'Data3': 3,
'Data4': 4,
'Data5': 5
},
<?php
/**
*Plugin Name: SomeMoreSentence
*Version: 0.1
*Plugin URI: http://argcv.com
*Description: append some more sentence after the end of your post
*Author: Yu Jing
*Author URI: http://argcv.com/about
*/
@yuikns
yuikns / index.java
Last active December 23, 2016 20:53
package com.argcv.util;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@yuikns
yuikns / vsftpd.conf
Last active November 20, 2022 08:12
Example config file /etc/vsftpd/vsftpd.conf
# Example config file /etc/vsftpd/vsftpd.conf
#
# The default compiled in settings are fairly paranoid. This sample file
# loosens things up a bit, to make the ftp daemon more usable.
# Please see vsftpd.conf.5 for all compiled in defaults.
#
# READ THIS: This example file is NOT an exhaustive list of vsftpd options.
# Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's
# capabilities.
#
@yuikns
yuikns / Makefile
Last active February 21, 2017 16:53
an example for makefile
CC := cc
CXX := c++
CP := @cp
MV := @mv
DEL := @rm -rf
LIBS := -ldl -lpthread -lm #-L lib/
INFLAGS := -I include/
from numpy import exp, array, random, dot
training_set_inputs = array([[0, 0, 1], [1, 1, 1], [1, 0, 1], [0, 1, 1]])
training_set_outputs = array([[0, 1, 1, 0]]).T
random.seed(1)
synaptic_weights = 2 * random.random((3, 1)) - 1
for iteration in range(100):
output = 1 / (1 + exp(-(dot(training_set_inputs, synaptic_weights))))
synaptic_weights += dot(training_set_inputs.T, (training_set_outputs - output) * output * (1 - output))
print (1 / (1 + exp(-(dot(array([1, 0, 0]), synaptic_weights)))))
dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
dnf -y install ffmpeg ffmpeg-libs ffmpeg-devel gstreamer-ffmpeg