Skip to content

Instantly share code, notes, and snippets.

View doremi31618's full-sized avatar
😇
feel free to contact me

EricZhan doremi31618

😇
feel free to contact me
View GitHub Profile
const fs = require('fs');
const dotenv = require('dotenv');
const passport = require('passport');
const {Strategy} = require('passport-google-oauth20');
const cookieSession = require('cookie-session');
/* to do list */
/* 1. apply a set of google cloud api
* 2. init a .env file which include a set of your sensitve datas
* 3. app.use(setup_cookie);
module.exports = class Workbook{
constructor(){
if (this instanceof Workbook) return new Workbook();
this.SheetNames = [];
this.Sheets = {};
//define workbook optional object
this.wopt = {
bookType = 'xlsx',
bookSST: false,
// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel PerlinSea
#include "noiseSimplex.cginc"
// Create a RenderTexture with enableRandomWrite flag and set it
// with cs.SetTexture
RWStructuredBuffer<float3> _Positions;
uint _Resolution;
float _Amplitude;
float _Speed;
float _Time;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PerlinSeaParticleSystem : MonoBehaviour
{
[Header("Assign each script")]
[SerializeField] Mesh mesh = default;
[SerializeField] Material material = default;
[SerializeField] ComputeShader computeShader = default;
void display(void){
glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set background color to black and opaque
glClear(GL_COLOR_BUFFER_BIT); // Clear the color buffer (background)
glMatrixMode(GL_MODELVIEW); // To operate on Model-View matrix
glLoadIdentity();
//std::cout << (GLfloat)1/x << " : " << (GLfloat)1/y << std::endl;
float mouseX = mousePosition[0];
float mouseY = mousePosition[1];
% 作法參考資料 https://www.mathworks.com/matlabcentral/answers/9803-how-to-extract-the-frequency-and-amplitude-from-a-fft-and-save-the-values-in-separated-tables
fcn_path = '/Users/zhanminxiang/Desktop/BrainComputerInterface/BCI_new'; %輸入資料夾路徑
cd(fcn_path);
EEGlab_path = '/Users/zhanminxiang/Desktop/BrainComputerInterface/BCI_new/eeglab14_1_1b/eeglab.m';
loaddata_path = '/Users/zhanminxiang/Desktop/BrainComputerInterface/BCI_new/Homework/ARTRED.CNT'; %輸入AFTERED.CNT完整路徑
rest_data = cut(loaddata_path, EEGlab_path, fcn_path, 'rest', '11');
task_data = cut(loaddata_path, EEGlab_path, fcn_path, 'task', '21');
#include <GLUT/glut.h>
#include <iostream>
#define WIDTH 640
#define HEIGHT 480
void init(void);
void display(void);
//
// main.cpp
// OpenGL_ViewFrustumAdjustment
//
// Created by 詹閔翔 on 2020/5/5.
// Copyright © 2020 詹閔翔. All rights reserved.
//
#include <iostream>
#include <GLUT/glut.h>
#include <iostream>
#include <GLUT/glut.h>
#define WINDOW_WIDTH 250
#define WINDOW_HEIGHT 250
int main(int argc, char * argv[]) {
//init the glut
glutInit(&argc, argv);
#include <GLUT/glut.h>
#include <stdio.h>
void display(void);//宣告函數
int main(int argc, char* argv[])
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE);//設定顯示模式:深度、顏色(rgb)...
glutInitWindowPosition(0, 0);//視窗初始位置
glutInitWindowSize(300, 300);//視窗大小