Skip to content

Instantly share code, notes, and snippets.

View arturmkrtchyan's full-sized avatar

Artur Mkrtchyan arturmkrtchyan

View GitHub Profile
@arturmkrtchyan
arturmkrtchyan / gist:c56f64e2a4f65cfebb2a
Created October 15, 2015 14:03 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@arturmkrtchyan
arturmkrtchyan / Intro.md
Last active October 13, 2016 16:27
Machine Learning Introduction

Machine Learning Algorithm families

Supervised Learning (e.g. classification, anomaly detection, regression)

  • Input data is called training data and has a known label or result such as spam/not-spam or a stock price at a time.
  • A model is prepared through a training process where it is required to make predictions and is corrected when those predictions are wrong. The training process continues until the model achieves a desired level of accuracy on the training data.
  • Example problems are classification and regression.
  • Example algorithms include Logistic Regression and the Back Propagation Neural Network.

Unsupervised Learning (e.g. clustering and dimensionality reduction)

  • Input data is not labelled and does not have a known result.
import jdk.incubator.http.*;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder(URI.create("http://www.google.com")).GET().build();
HttpResponse response = client.send(request, HttpResponse.BodyHandler.asString())
System.out.println(response.body())
@arturmkrtchyan
arturmkrtchyan / softr_add_user_email_and_record_id_to_form.html
Created February 19, 2021 18:10
Softr Add User Email and RecordID to a Form
<script>
document.addEventListener("DOMContentLoaded", function () {
const emailFieldName = 'Email';
const jobIdFieldName = 'JobID';
const formId = 'submitreferral';
const userEmail = getUserEmail();
const recordId = getUrlParam('recordId');
function loadVimeoThumbnail(url, callback){
$.ajax({
type:'GET',
url: 'https://vimeo.com/api/oembed.json?url=' + encodeURIComponent(url),
dataType: 'json',
success: callback
});
}
function isVimeo(url) {

part 1

<script>
document.addEventListener("DOMContentLoaded", function() {
    $('[id=sw-email-capture-submit-btn]').click(function() {
          if($('.sw-input-invalid').length) {
              return;
          }
<script>
document.addEventListener("DOMContentLoaded", function () {
/* Intercept into Airtable call */
window['records'] = [];
$.ajaxSetup({
dataFilter: function (data, type) {
<script>
document.addEventListener("DOMContentLoaded", function () {
const forms = ['form1', 'form2', 'form3', 'form4'];
const emailFieldName = 'Email';
const userEmail = getUserEmail();
forms.forEach(form => {
$('#' + form).append('<input class="sw-form-capture-element" id="sw-form-capture-Email" type="hidden" data-type="short_text" name="'+emailFieldName+'" value="'+userEmail+'">');
<script>
document.addEventListener("DOMContentLoaded", function () {
const emailFieldName = 'email';
const formId = 'form2';
const userEmail = getUserEmail();
$('#' + formId).append('<input class="sw-form-capture-element" id="sw-form-capture-Email" type="hidden" data-type="short_text" name="'+emailFieldName+'" value="'+userEmail+'">');
$('#sw-form-capture-submit-btn').click(function() {
<script>
document.addEventListener("DOMContentLoaded", function () {
$.ajaxPrefilter(function(options, originalOptions, jqXHR) {
console.log(options);
if(options.url.includes('hooks.zapier.com')) {
const data = JSON.parse(originalOptions.data);
data['LOGGED_IN_USER_EMAIL'] = getUserEmail();
options.data = JSON.stringify(data);
}
});