Skip to content

Instantly share code, notes, and snippets.

View lag945's full-sized avatar
🐶
Focusing

Laguna Du lag945

🐶
Focusing
  • Taiwan
View GitHub Profile
@lag945
lag945 / svg2png.cpp
Last active September 14, 2022 02:30
C++ exmaple convert svg to png with resvg library.
#include <iostream>
#include <stb_image_write.h>
#include <resvg.h>
int main()
{
resvg_options* opt = resvg_options_create();
resvg_options_load_system_fonts(opt);
resvg_render_tree* tree;
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libplatform/libplatform.h"
#include "v8-context.h"
#include "v8-initialization.h"
#include "v8-isolate.h"
@lag945
lag945 / google-tips
Created July 15, 2022 04:07 — forked from qwo/google-tips
Google Recruiter Candidate Tips ..
xxx,
Thanks again for taking the time to speak with me and for sending me your information. I'm excited to tell you that we would like to move forward in the process!
One of our coordinators will be emailing you within the next week from an @google.com domain with the date and time of your phone interview. In the meantime, I've included some preparation materials (below.)
Please note this will be a technical interview that will last for approximately 45 minutes. Google takes an academic approach to the interviewing process. This means that we are interested in your thought process, your approach to problem solving as well as your coding abilities. You may be asked questions that relate to technical knowledge, algorithms, coding, performance, how to test solutions, and perhaps your interest in Google products. The best advice that I can give you is to treat the interview like a conversation, talk through the problems, and please feel free to ask the interviewer if you are not clear with any of the questio
@lag945
lag945 / egl_angle_x11.cpp
Last active July 15, 2022 03:25
Desktop 3D with EGL+ANGLE+Ubuntu18.04LTS
#include <X11/Xlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <EGL/egl.h>
#include <EGL/eglplatform.h>
#include <GLES3/gl3.h>
//g++ -out eglX11 eglX11.cpp -lX11 -lEGL-lGLESv2 -I<angle>/include -L<angle>/Release -Wl,-rpath=<angle>/Release
@lag945
lag945 / glfwAngle.cpp
Last active July 11, 2022 09:27
cross-platform gles with glfw+angle
#include <iostream>
#include <GLES3/gl3.h>
#include <GLFW/glfw3.h>
using namespace std;
void glErrorLog() {
GLuint glError = glGetError();
if (glError != GL_NO_ERROR) {
@lag945
lag945 / egl_angle_win.cpp
Last active July 11, 2022 09:26
Desktop 3D with EGL+ANGLE+Windows
#include <iostream>
#include <EGL/egl.h>
#include <EGL/eglplatform.h>
#include <GLES3/gl3.h>
#include <sstream>
using namespace std;
//based on https://github.com/SaschaWillems/openglcpp/blob/master/eglExample/eglExample/eglExample/eglExample.cpp
@lag945
lag945 / glfwTest.cpp
Last active July 4, 2022 07:25
Multi-platform for OpenGL demo. GLFW+GLAD
#include <iostream>
//#define GLFW_INCLUDE_NONE
#include <glad/glad.h>
#include <GLFW/glfw3.h>
int main()
{
GLFWwindow* window;
/* Initialize the library */
@lag945
lag945 / PriorityQueue.hpp
Created May 20, 2022 07:25
STL Priority Queue for Structure or Class
#include <iostream>
#include <queue>
//source https://www.geeksforgeeks.org/stl-priority-queue-for-structure-or-class/
class Person {
public:
int age;
float height;
@lag945
lag945 / array2tiff.py
Created January 14, 2020 07:15
將PilotGaea double matrix 轉成 geotifff
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 09:03:09 2020
@author: User
"""
import os
from osgeo import gdal
from osgeo import osr
@lag945
lag945 / TaiwanLottery.sol
Last active November 30, 2022 06:14
Web3 Taiwan Lottery Smart Contract
pragma solidity ^0.4.25;
contract TaiwanLottery {
//參考範例 https://ithelp.ithome.com.tw/articles/10205760
//賭注資料結構
struct BettingData
{
address Player;
uint8 A1;
uint8 A2;