Posts

Showing posts from August, 2018

Learning React Native, Chapter 3: Building Your First Application

Image
The purpose of this chapter is straightforward.  We will write our first app, and deploy it to a device. Setting Up Your Environment There are two approaches to developing React Native: create-react-native-app - used in this book most of the time.  It is quicker and easier installation, but only supports JS apps.   full react-native install - Allows writing Objective-C and Java components Developer Setup: Create React Native App npm install -g React Native uses the node package manager.  To us this, you will need to make sure you have Node.js installed.  Links: https://nodejs.org/en/download/ Creating Your Application with create-react-native-app create-react-native-app first_project This will install all the code you need to start writing a react native app. Previewing You App on iOS or Android Starting Your first project should be easy.  Run npm start From the terminal.  I had an issue starting my server, but the ins...

Getting Started with Arduino, Chapter 4: Really Getting Started with Arduino

Image
Anatomy of an interactive device An interactive device senses the environment using sensors and interacts with the real world using actuators. Sensors and Actuators Sensors and actuators are components that allow a piece of electronics to interact with the world.  Micro controllers can only process electric signals.  Our eyes are an example of a sensor.  They convert light into signals that are then processed by the brain.  In electronics, we can use an LDR (light-dependent resistor) or a photoresistor. Blinking an LED The first thing we are going to build is a blinking LED to test our newly installed Arduino.  The Arduino board is equipped with an LED on pin 13.  You can also connect your own LED to pin 13 on the board. LED components: K = cathode (negative) the shorter leg. A = anode (positive) longer leg   Anatomy of an LED We can start writing the code to make you LED blink once it is connected.  Write out the code, and c...

Learning React Native, Chapter 2: Working With React Native

How React Native Works? React works with a virtual DOM.  React computes the necessary changes in memory, and only refreshes the DOM when necessary.  React Native works in a similar fashion.  The virtual DOM is replaced with Native objects on the mobile platform.  There is nothing special about Android, iOS, or the web.  Those are the bridges that existed in React Native.  People have written bridges for Linux, OSX, and Windows. Rendering Lifecycles The page renders, components are mounted to the DOM, and then React Components are rendered.  When a state or props changes, the difference is computed in the Virtual DOM, and React renders the new components. Creating Components in React Native React Native components are largely the same as the React Components Working With Views Instead of using HTML elements, you use platform specific components for React Native.  The most basic which is similar to a in HTML.   Using JSX JSX i...

Learning React Native, Chapter 1: What is React Native

React Native is a JavaScript framework for building native iOS and Android apps.  React Native is based on Facebook's React UI tools.  It does not use web views like Cordova or Ionic, it translates your UI into real mobile native components.  React Native apps can also access platform features, like the camera or the location APIs.  This book promises to build both iOS and Android apps.  Advantages of React Native The main advantage of React Native is that is uses the host's rendering API's, not the web view of other platforms.  React works away from the main UI thread, so the app can maintain performance.  If you are used to React on the web, you can write mobile apps that seem native while using familiar tools. Developer Experience The React team has worked hard to have strong development tools and meaningful error messages.  Since React is JavaScript, you don't have to rebuild you app every time you need to see a change.  This should...

Getting Started with Arduino, Chapter 3 The Arduino Platform

The Arduino platform consists of both the hardware (board) and software (IDE).  Working on hardware used to mean building circuits from scratch.  With microprocessors, this functionality has now moved to the software. The Arduino Hardware The most popular board (at the time of this writing) is the Arduino Uno.  There are other boards, and these will be discussed in a later chapter.  The hardware consists of a small circuit and microcontroller.  The board also has 2 rows of strips at the top and the bottom, with these strips you can connect: sensors: senses things in the real world and converts them to digital signals.   actuators: converts digital signals into real world action.   The rows correspond to the following items: 14 Digital I/O pins: used to read from sensors and control actuators 6 Analog In pins: reads voltage from analogue sensors 6 Analog Out pins: provides analogue output Arduino can be powered from usb ports...

Go Programming Blueprints, Chapter 2, Adding User Accounts

A universal truth in programming is that there are relatively few unique unsolved problems.  What tasked with a new problem, always see what other solutions exist and how we can solve our new one.  In this instance, we are going to use open source solutions to auth against existing services. Handlers all the way down Everything we write will be http handlers.  This allows us to encapsulate objects as far down the chain as needed.  Making pretty social sign in page We get a quick lesson on bootstrap, and why and how to use it.  There are two methods to showing our bootst rap.  We can leave it hosted on a CDN or add it to our assets folder.  Endpoints with Dynamic Paths Go doesn't support the most robust path selections (/path/options), such as ruby on rails or Django python.  As with everything Go, there are open source packages we can use to help with this functionality.  We will use string.split to break our argument paths in the re...

Getting Started With Arduino, Chapter 2 The Arduino Way

The arduino way is a constant search for faster and more powerful ways to build prototypes. It is a process of tinkering and playing with electronics. Prototyping: The ability to build something quickly and see if it works, so you can stay motivated to move on the next step. Tinkering: The ability to play with your toys.  Whether to take apart an old thing and build something new, or just to see how it works.  Patching: Reduce the interuptions, keep the flow going. Visual programming environments were created to do just hat. Circuit Building: creative short-circuiting of low-voltage, battery-operating audio devices. Discovered by Reed Ghazala in 1966 on accident Keyboard Hacks: Taking keyboards, and making them work in new and interesting ways. We Love Junk!: Use it for something fun, most people are just throwing it away. Hacking Toys:   This is a great way to learn and teach others how to build new things, and to get over their fear of electronics.  ...

Getting Started With Arduino, Chapter 1 Introduction

The arduino is an open sourced hardware and software solution for rapidly prototyping electronic "things". Intended Audience This book was written for people without a large technical background.  There will be some coding and electronics knowledge imparted from reading this book.  This book is not designed for engineers.  It is designed for the hobbyist with minimal knowledge. What is Interaction Design? Interaction Design is a design discipline that puts prototyping at the center of the methodology.  This is the main philosophy behind the arduino platform. What is physical computing? Physical computing uses electronics to prototype new objects for designers and artists.  Arduino helps to bring these tools one step closer to the novice.  It does that by being easy to use, cheap to purchase, and harder to break. 

Bayesian Analyis with Python Chapter 2, Programming Probabilisticly

Probabilistic Programming Probabilistic programming allows clear separation between models and inference.  PP hides the details on how probabilities are performed, allowing you to focus on model specifications and analysis of results.  Inference Engines Non-Markovian Methods Grid computing Quadratic approximation Variational methods  Markovian Methods Monte Carlo Metropolis Hastings Markov Chain Hamiltonian Monte Carlo/NUTS Currently, Bayesian analysis using MCMC (Markov Chain Monte Carlo) methods, while bigger datasets are using variational methods. Non-Markovian Methods Can be faster than Markovian and provide a good starting point for Markovian methods. Grid Computing May be able to compute the prior even if it can not get the whole posterior.  An infinite number of points will get us the exact posterior.  Does not work well for many parameters.  Will end up spending the most time computing values with null contribution. Quadra...