Skip to content

Instantly share code, notes, and snippets.

View azriel91's full-sized avatar
🤍
instilling peace

Azriel Hoh azriel91

🤍
instilling peace
View GitHub Profile
@azriel91
azriel91 / Biicode Complexities Feedback.md
Last active August 29, 2015 14:12
Biicode Complexities Feedback

Complexity Feedback

Understand CMake

CMake reads like a bash script, so try to understand how an existing library is built before attempting to convert it to a Bii compatible format.

Scope

Setting a variable in a subdirectory doesn't set it in parent scope. e.g. setting BII_path_to_main_SRC from a subdirectory will not set it in the parent scope. You need to explicitly tell it to.

@azriel91
azriel91 / Lessons Learnt.md
Last active August 29, 2015 14:14
Lessons learnt converting CppMicroServices to a Biicode compatible format (Biicode blog post)

Lessons Learnt

This post summarizes the lessons learnt from adapting the CppMicroServices framework to a Biicode compatible format. It does not go into detail about the actual modifications, but focuses on the

Background

CppMicroServices is an implementation of the OSGi framework, which enables runtime dependency injection. Modules of code (bundles) can be loaded and unloaded at runtime. In the case of CppMicroServices, bundles are either shipped in the form of shared libraries, or statically linked into the executable.

Based on packaging principles, bundles should be packaged and released separately - so that they can be depended on individually. Biicode's dependency management through blocks is suitable as a dependency management tool that supports this flow.

public class Solution5 {
static int getValue(final int lastFunctionOperator, final String term) {
switch (lastFunctionOperator) {
case 0:
return Integer.parseInt(term);
case 1:
return Integer.parseInt(term);
case 2:
return -1 * Integer.parseInt(term);

Hi,

I stumbled upon snap-ci when reading an interview about Go. I had previously tried an old version of Go for a day a long time ago.

Essentially I'm looking for a hosted service which supports:

  • builds across multiple OSes
  • environment variable matrices
  • version controlled build configuration
  • complete pipeline definition, with fan-in/fan-out capabilities
@azriel91
azriel91 / conan_quickstart.md
Last active May 15, 2017 16:03
Conan Quickstart document, WIP. Meant to be a tutorial.

Conan Quickstart

Background

In software development, build and dependency management is a complex topic to solve, especially when a dependency is not simply requiring a certain version of a library and its transitive dependencies, but also stating the following:

  • options: flags that affect what features are enabled or disabled
  • compiler: application and version
  • build mode: static or shared objects
  • build type: debug or release builds
@azriel91
azriel91 / choosing_a_programming_language.md
Last active April 3, 2016 02:16
checklist when picking a programming language

Choosing a Programming Language

  • Does it support cross platform from the same source?
  • Memory management
  • Standard library
    • data structures
    • threading
    • io
    • networking
  • Is there a dependency injection framework?
@azriel91
azriel91 / static_lifetime_issue.rs
Last active December 17, 2016 02:42
Minimal example to reproduce issue
trait Task {}
trait Display {}
struct SomethingTask<'d> {
displays: Vec<&'d Display>,
}
impl<'d> Task for SomethingTask<'d> {}
struct MyDisplay;
impl Display for MyDisplay {}
@azriel91
azriel91 / hashmap_of_unknown_types.rs
Last active March 10, 2017 19:56
Test the ability to store a hashmap where the value can be a reference to arbitrary types.
use std::collections::HashMap;
use std::sync::{Arc, Mutex};
use std::rc::Rc;
use std::sync::mpsc::{self, Sender, Receiver};
mod app_menu {
pub const ID: &'static str = module_path!();
pub trait Input {
fn listen(&self, message: String);
fn silence(&self);
let mut collection_buffer = Vec::with_capacity(input_buffer.len());
let mut input_iter = input_buffer.drain(..);
loop {
if let Some(input) = input_iter.next() {
let result = context.as_ref()
.unwrap()
.listener_tx
.send(input);
// if we fail to send, it implies the listener has stopped listening
azrie@timberwolf MINGW64 ~
$ curl -L https://www.maybank2u.com.my
<HEAD>
<SCRIPT language="Javascript">
<!--
window.location="http://www.maybank2u.com";
//-->
</SCRIPT>
</HEAD>