A new take on an old idea of using EMA (Exponential moving averages) to aide in making stock trading decisions. This is a new version of my previous script.
This strategy/study also makes some assumed long buy/sells (With a cap of $5K per trade) of the stock to provide a report of the performance based on the time period.
I still have not had the time to invest in trying to execute these in a timely manner, but always fun to speculate and run some hypothetical scenarios.
TOS v2GitHub Gist: instantly share code, notes, and snippets.
I have never really used Apple Script, but recently had the desire to backup all my Apple Photos to my local NAS. I currently have all my photos organized in a Folder -> Album structure so pulled this Apple Script together together to get this done. Create a new Apple Script (*.scpt) and select the source Photos Folder and a location to save the files on your filesystem. Note: Slashes in the name case folders to be created 🙁
Being an app developer, friends, family and co-workers often ask the question, how much does an app cost? This is a nice breakdown from Couchbase on the elements, stages and how long each stage of the development lifecycle takes, which helps with cost estimates.
Building an Apple PassKit app has been an interesting endeavor. Internally at SAP we recently built a small Business Card application which allows employees to create a digital business card, and subsequently generate a individual and customized wallet pass, allowing them to quickly retrieve it, without having to find the app, and open it on their device. Having a wallet pass lets users simply double tap the lock button, authenticate and see a collection of their passes.
Creating a pass has a unique requirement in that an application cannot simply create the pass directly on the device, or in the app. A pass needs to be generated server side, and signed with the appropriate signing certificate. In our case we utilized a small Typescript Node.JS server, which has a single API endpoint which accepts the information needed to populate the business card pass. The API then returns a signed .pkpass file. A .pkpass at its simplest form is simply a zipped bundle of assets and JSON files which describes the key fields and their respective values.read more
Over the past few years I have found myself re-implementing and re-writing basic features of server, web, mobile or service components. Registration, Login, Forgot Password, Notifications, Search, Help, FAQ, Contact Us, Maps are just a few I can think of, where half way through the development everything seems familiar and I have a case of deja vu. No doubt I have written or implemented a library or service which performs this specific function.
While developing the Changd app I found myself in one of the deja vu moments while writing the email notification service, and decided to pause development, and fix the root cause. After multiple Github issues to support a variety of notification providers, I came across Apprise, a python library which supports multiple notification provides. Since there was not a Node.js implementation, I decided to use Apprise as inspiration and influence for a Node.js library which I aptly named “Reach”.read more
A fun project to build a drawing bot which uses linear motors, belts, and a servo to take digitized line art and physically draw it on paper, in a plotter like fashion. Here are a couple resources which are helpful.
One of the benefits of Quantum Computing is their ability to generate truly random numbers.
Since classical computers are deterministic machines, governed by algorithms, they are inherently predictable. Therefor any number generated by a classical computer, even if it seems complex is actually based on a set of conditions or algorithm, which therefor makes it a “pseudo random number”, rather than truly random.
To generate truly random numbers you need to rely on a physical processor or phenomena that are unpredictable, examples of this include radioactive decay, electronic noise or even atmospheric noise.
Since QC is essentially based on a physical process and the probabilistic nature of quantum mechanics, its qubits can exist in a superposition state, this means they can represent a combination of 0 and 1 simultaneously, this state/property can be harnessed by QRNG (Quantum random number generators) to produce truly random numbers.
As a fun project, I decided to build a small physical QRNG using an Arduino, laser diode, beam splitter and two photo resistors. The basic premise is that you pulse the laser, it sends a wave/particle (both!) through the beam splitter, 50% of the time it should hit one of the two photo resistors, providing you with a random string of “1”s or “0”s.
While a very simple, basic and small example, it is a fun experiment. Check out OpenQbit.com if you would like to build your own. To make this a little easier, I laser cut a template/outline for the beam splitter for holding each of the components.
/* Annotated QRNGv1 Firmware V1.1
Author: Noah G. Wood
Modified: Paul Aschmann
Copyright (c) 2019 Spooky Manufacturing, LLC
License: GPLv3.0
*/
int triggerPin = 2; // This pin will pulse our quantum circuit
int hPin = A0; // This pin measures the horizontal polarized photons
int vPin = A1; // This pin measures the vertically polarized photons
float H = 0;
float V = 0;
long previousMillis = 0;
long interval = 1000;
float maxH = 0;
float maxV = 0;
void setup() {
// Just setting up triggerPin and serial connection
//pinMode(13, OUTPUT);
pinMode(triggerPin, OUTPUT);
Serial.begin(9600);
}
int Random() {
// Pulse the laser
digitalWrite(triggerPin, HIGH);
//delay(1);
digitalWrite(triggerPin, LOW);
}
void loop() {
// The main program
// Run our program and print the random bit to serial
//delay(1000);
unsigned long currentMillis = millis();
if (currentMillis - previousMillis > interval) {
previousMillis = currentMillis;
Random();
}
// Read the photoresistors
H = analogRead(hPin);
V = analogRead(vPin);
// Determine random bit
if (H > V) { // More photons in the H mode, return 0
Serial.println("-------------------- > H: ");
Serial.println(H);
Serial.println("V: ");
Serial.println(V);
if (H > maxH) {
maxH = H;
Serial.println("New max H");
}
} else if (V > H) { // More photons in the V mode, return 1
Serial.println("-------------------- > V: ");
Serial.println(V);
Serial.println("H: ");
Serial.println(H);
if (V > maxV) {
maxV = V;
Serial.println("New max V");
}
} else {
Serial.println("Same values");
}
delay(1000);
}
read more
Generating true random strings using classical computers is not as easy as you may think. Unlike deterministic processes that follow specific algorithms and patterns, achieving true randomness poses a challenge in the realm of classical computing. Classical computers operate based on predetermined instructions and logical operations, which inherently lack the inherent unpredictability required for true randomness.
In contrast, true randomness involves an element of unpredictability that goes beyond the deterministic nature of classical computing. Attempts to generate random strings on classical computers often involve algorithms that simulate randomness, but these are ultimately constrained by the deterministic nature of the underlying hardware and software.read more
You must be logged in to post a comment.