Skip to content

Instantly share code, notes, and snippets.

View bitsnaps's full-sized avatar
🌍
Working @ CorpoSense

Ibrahim H. bitsnaps

🌍
Working @ CorpoSense
View GitHub Profile
@bitsnaps
bitsnaps / InstallGLPK.md
Last active February 11, 2023 16:31
Setup and install glpk on Windows 7

GLPK Installation process on Windows 7 SP1

Prerequists:

  • Visual C++ (for GLPK v4.65 you'll need VC v2010 Express)

  • Download the latest GLPK zip package: https://sourceforge.net/projects/winglpk/files/winglpk/ then extract its content to the C:\glpk.

  • Create the environment variable %GLPK_HOME% pointing to the C:\glpk path you've created, and add to the system path the following value: SET PATH=%PATH%;%GLPK_HOME%\w64

@bitsnaps
bitsnaps / JScienceTest.groovy
Created September 25, 2022 22:04 — forked from kimukou/JScienceTest.groovy
JScienceTest.groovy
// reference http://www.geocities.jp/tomtomf/JScience/JScience.htm
//
@GrabResolver (name='jcurl-repository', root='http://jcurl.berlios.de/m2/repo/')
@Grab(group = 'org.jscience', module='jscience', version='4.3.1')
import org.jscience.mathematics.number.Complex
import org.jscience.mathematics.vector.ComplexMatrix
//計算結果の出力様関数
def show(cm) {
@bitsnaps
bitsnaps / base64coding.groovy
Created September 24, 2022 09:45 — forked from mujahidk/base64coding.groovy
Base64 encoding and decoding in Groovy.
def text = "Going to convert this to Base64 encoding!"
// Encode
def encoded = text.bytes.encodeBase64().toString()
println encoded
// Decode
byte[] decoded = encoded.decodeBase64()
println new String(decoded)
@bitsnaps
bitsnaps / upper_confidence_bound.py
Last active July 30, 2022 14:08 — forked from devamitranjan/UCB.py
Upper Confidence Bound Implementation
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
class UpperConfidenceBound:
def __init__(self, dataframe, N, m):
self.__dataset = dataframe
self.__N = N
self.__m = m
@bitsnaps
bitsnaps / plot_rbm_logistic_classification.py
Last active July 29, 2022 05:45 — forked from understar/plot_rbm_logistic_classification.py
scikit-learn RBM feature extraction and logistic classification
"""
Update: (07.29.2022): Fix: train_test_split import
==============================================================
Restricted Boltzmann Machine features for digit classification
==============================================================
For greyscale image data where pixel values can be interpreted as degrees of
blackness on a white background, like handwritten digit recognition, the
Bernoulli Restricted Boltzmann machine model (:class:`BernoulliRBM
<sklearn.neural_network.BernoulliRBM>`) can perform effective non-linear
@bitsnaps
bitsnaps / App.groovy
Created July 26, 2022 15:44
Groovy and Renjin the embedded R language engine
package demo
import javax.script.*
import org.renjin.script.*
class App {
static void main(String[] args){
// init values
int[] values = [1,2,3]
// Create a Renjin engine:
@bitsnaps
bitsnaps / gist_to_github_repo.md
Last active August 18, 2024 09:14 — forked from ishu3101/gist_to_github_repo.md
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@bitsnaps
bitsnaps / App.vue
Created May 7, 2022 16:43 — forked from bricksroo/App.vue
Reveal.js in Vue
<template>
<div id="app">
<!-- <img src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/> -->
<div class="reveal">
<div class="slides">
<section>Single Horizontal Slide</section>
<section>
<section>Vertical Slide 1</section>
<section>Vertical Slide 2</section>
@bitsnaps
bitsnaps / simplest_tf.py
Last active November 11, 2021 09:05
keras (tensorflow) simplest linear model example
# Simplest linear model with keras 2.1.3 (using tensorflow backed) it worked with python 3.5
import numpy as np
import keras
model = keras.Sequential( [keras.layers.Dense(units=1, input_shape=[1])] )
model.compile(optimizer='sgd', loss='mean_squared_error')
# y = 2x - 1
xs = np.array([-1.0, 0.0, 1.0, 2.0, 3.0, 4.0])
ys = np.array([-3.0, -1.0, 1.0, 3.0, 5.0, 7.0])
@bitsnaps
bitsnaps / groovyc.groovy
Last active August 26, 2021 19:56
Activate Type Checking and Compile Static for all Groovy classes in Gradle (or Android) project
// We know we can apply type checking and compile static on all groovy classes, the good news you can do this on gradle build, so it'll be applied in every class in your project, this works in android project.
/*/ In gradle project:
apply plugin: 'groovy'
compileGroovy.groovyOptions.configurationScript = file('gradle/config/groovyc.groovy')
// In Android project (app/build.gradle)
androidGroovy {
options {
configure(groovyOptions) {