Skip to content

Instantly share code, notes, and snippets.

class Package {
func setPrice(price : Int64) throws ->Int64{
if(price < 0 || price == 0){
throw ParseError.zerolimit
}
return price
}
}
class Pro : Package {
@barron9
barron9 / balancemaker.swift
Last active May 26, 2021 22:44
balancemaker.swift
/*
License
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
*/
func balancemaker(B:Bool)-> (Int)->Int{
func right(src: Int)->Int{
return src==0 ? 0 : src - 1
}
func left(src: Int)->Int{
@barron9
barron9 / RXLookingGlass.cs
Created May 2, 2021 21:39 — forked from MattRix/RXLookingGlass.cs
This class wraps an internal Unity method that lets you to check if a ray intersects a mesh. Place it in an Editor folder.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System;
using System.Linq;
using System.Reflection;
[InitializeOnLoad]
public class RXLookingGlass
{
@barron9
barron9 / reference_cycle_leak_test_swift_5.3.swift
Last active January 24, 2021 13:31
reference_cycle_leak_test_swift_5.3.swift
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
while (true){
var paragraph: HTMLElement? = HTMLElement(name: "p", text: "hello, world")
using System;
using System.Runtime.InteropServices;
// ReSharper disable SuspiciousTypeConversion.Global
// ReSharper disable InconsistentNaming
namespace VideoPlayerController
{
/// <summary>
/// Controls audio using the Windows CoreAudio API
/// from: http://stackoverflow.com/questions/14306048/controling-volume-mixer
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.locks.ReentrantLock;
public class process {
private final ReentrantLock lock = new ReentrantLock();
long start = 0;
#!/usr/bin/python # This is server.py file
import socket # Import socket module
import pyaudio
import wave
import time
CHUNK = 4096
FORMAT = pyaudio.paInt16
CHANNELS = 2
@barron9
barron9 / gist:56bdc2227c584d10b91be43a1c521fab
Last active November 23, 2020 06:53
ios-android-deploy.sh
#!/bin/bash
#git reset --hard HEAD~1
sudo rm -rf android/app/build/*
git pull origin master
cat android/app/build.gradle | sed "s/versionName.*\".*\"/versionName \"`date +%F:%H.%M`\"/" > android/app/build.gradle
cat app.json | sed "s/\"version\":.*\".*\"/\"version\": \"`date +%F:%H.%M`\"/" > app.json
cat package.json | sed "s/\"version\":.*\".*\"/\"version\": \"`date +%F:%H.%M`\"/" > package.json
cat ios/App.xcodeproj/project.pbxproj | sed "s/MARKETING_VERSION =.*;/MARKETING_VERSION = `date +%F:%H.%M`;/" > ios/App.xcodeproj/project.pbxproj
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
sh ./fix_anrdoid_duplicate_resources.sh
# Free API V1
**PeakStocks** is a financial forecaster API which uses deep learning/AI in behind. API Basically serves stock, crypto, indexes, futures daily - so limited periodically option available in FREE version. If you want to learn about Peakstocks more , you can go https://www.peakstocks.de.
## Paid Version
Subscription is available for enterprises so anyone can use this servise as a financial indicator/predictor.
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tensorflow as tf
from sklearn.model_selection import train_test_split
from tensorflow.keras.models import Model
from sklearn.metrics import accuracy_score, precision_score, recall_score
from tensorflow.keras import layers, losses
# Download the dataset