Skip to content

Instantly share code, notes, and snippets.

View aidevnn's full-sized avatar
🆓
Free

Maths Coder aidevnn

🆓
Free
View GitHub Profile
@aidevnn
aidevnn / poly_roots.c
Last active May 17, 2023 20:29
FlintARB complex roots of a polynomial with integer coefficients
/* This file is public domain. Author: Fredrik Johansson. */
// original code at
// https://github.com/fredrik-johansson/arb/blob/master/examples/poly_roots.c
// This code assumes that libflint-arb and all its dependencies are installed
// Use the arguments "-lflint-arb -lflint" to compile it
#include <string.h>
#include <ctype.h>
@aidevnn
aidevnn / CrazyPassions.cs
Last active December 5, 2022 01:47
Craziest passions to fuzz words of a text but staying readable.
Console.WriteLine("Hello, World!");
Random rnd = new();
string Change(string w)
{
var w0 = w.Trim();
if (w0.Length < 4)
return string.Join("", w0.OrderBy(c => rnd.NextDouble()));
@aidevnn
aidevnn / issue_driven_development.md
Created September 27, 2022 12:22
Issue-Driven Development

Issue-driven Development

Principle of issue-driven development is simple:

  • Always associate development to GitHub issue.

Issue-driven development achieves:

  • Modularity: Commits and branches are self-contained.
  • Granularity: Commits and branches intend a single Issue.
  • Transparency: Discussion on each edition can be seen on Issue.
@aidevnn
aidevnn / express.js
Last active January 17, 2021 11:40
Node.js Simple Http Server with Express with Get and Post methods.
const express = require('express')
const app = express()
const port = 3000
const templateForm = `
<title>NodeJs Simple Http Server</title>
<a href="/">Hello World, NodeJs v${process.versions.node}</a>
<br/>
<form method="post">
<span style="float: left; width: 100px">First name:</span><input type="text" name="fname"><br>
@aidevnn
aidevnn / server_http.js
Last active January 17, 2021 11:41
NodeJs Simple Http Server with Get and Post methods.
var http = require('http');
var qString = require('querystring');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('<title>NodeJs Simple Http Server</title>');
if (req.method === 'GET') {
res.write(`
<a href="/">Hello World, NodeJs v${process.versions.node}</a>
@aidevnn
aidevnn / index.php
Last active January 17, 2021 11:38
PHP Simple Http Server with Get and Post methods.
<title>PHP Simple Http Server</title>
<?php
if (empty($_POST)) {
?>
<a href="">Hello World, PHP <?php echo phpversion(); ?></a>
<br/>
<form method="post">
<span style="float: left; width: 100px">First name:</span><input type="text" name="fname"><br>
<span style="float: left; width: 100px">Last name:</span><input type="text" name="lname"><br>
<input type="submit" value="Submit">
@aidevnn
aidevnn / digitsCNN.py
Last active September 4, 2019 03:55
CNN on Digits handwrite dataset from scikit
import numpy as np
import keras
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D, BatchNormalization
from sklearn import datasets
def train_test_split(X, y, test_size=0.5):
""" Split the data into train and test sets """
# Split the training data from test data in the ratio specified in
@aidevnn
aidevnn / torch.xor.py
Last active April 17, 2019 04:38 — forked from user01/torch.xor.py
Toy XOR network with pyTorch
import torch
from torch.autograd import Variable
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
@aidevnn
aidevnn / xor.py
Last active April 17, 2019 02:10 — forked from stewartpark/xor.py
Simple XOR learning with keras and custom log callback
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation
from keras.optimizers import SGD
from keras.callbacks import Callback
import numpy as np
import time
from tabulate import tabulate
X = np.array([[0,0],[0,1],[1,0],[1,1]])
y = np.array([[0],[1],[1],[0]])