Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
// Declare the queue name | |
string QueueName = "QTransactions"; | |
// Create a new connection factory for the queue | |
var factory = new ConnectionFactory(); | |
// Because Rabbit is installed locally, we can run it on localhost | |
factory.HostName = "127.0.0.1"; | |
using (var connection = factory.CreateConnection()) | |
using (var channel = connection.CreateModel()) | |
{ |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
########## Variables | |
dir=~/dotfiles # dotfiles directory | |
olddir=~/dotfiles_old # old dotfiles backup directory | |
files=".bashrc .vimrc .vim" # list of files/folders to symlink in homedir | |
########## | |
# create dotfiles_old in homedir | |
echo "Creating $olddir for backup of any existing dotfiles in ~" |
#include <avr/sleep.h> | |
#include <avr/interrupt.h> | |
#include <Heart.h> | |
/* | |
Android Beating Heart V2- Sketch | |
Marcos Placona 2019 | |
*/ | |
const int switchPin = 3; |
<cfscript> | |
QueueName = "QTransactions"; | |
durable = true; | |
loadPaths = arrayNew(1); | |
loadPaths[1] = expandPath("lib/rabbitmq-java-client-bin-2.8.4/rabbitmq-client.jar"); | |
// load jars | |
javaLoader = createObject("component", "lib.javaloader.JavaLoader").init(loadPaths); |
#include <Bounce2.h> | |
#define BUTTON_PIN PB4 | |
#define led1Pin PB0 | |
#define led2Pin PB1 | |
#define led3Pin PB2 | |
#define led4Pin PB3 | |
#define switchPin PB4 | |
#define delayInterval 100 | |
Bounce debouncer = Bounce(); // Instantiate a Bounce object |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_main) | |
- val myData = DataSource() | |
- tvMagicNumber.text = myData.getMagicNumber().toString() | |
+ val model = ViewModelProviders.of(this).get(DataSource::class.java) | |
+ tvMagicNumber.text = model.getMagicNumber().toString() | |
} |
package uk.co.placona.jetpackdemo1 | |
- class DataSource { | |
+ import android.arch.lifecycle.ViewModel | |
+ | |
+ class DataSource: ViewModel() { | |
private val tag = MainActivity::class.java.simpleName | |
private lateinit var myRandomNumber:Number |
implementation 'com.android.support:appcompat-v7:28.0.0' | |
implementation 'com.android.support.constraint:constraint-layout:1.1.3' | |
+ def lifecycle_version = "1.1.1" | |
+ implementation "android.arch.lifecycle:extensions:$lifecycle_version" | |
testImplementation 'junit:junit:4.12' | |
androidTestImplementation 'com.android.support.test:runner:1.0.2' | |
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' |
private fun createMagicNumber(){ | |
myRandomNumber = (1..42).shuffled().first() | |
} |