Skip to content

Instantly share code, notes, and snippets.

View eWizardII's full-sized avatar

Solomon Abiola eWizardII

View GitHub Profile
@eWizardII
eWizardII / main.c
Created June 2, 2020 03:38
ble_device_version1
/**
* Copyright (c) 2014 - 2018, Nordic Semiconductor ASA
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
@eWizardII
eWizardII / test.js
Created May 25, 2020 17:40
Code Snippet - BLE Sensor
function* readTemperature(device: Device): Generator<*, boolean, *> {
global.Buffer = global.Buffer || require('buffer').Buffer
try {
const services: Array<Service> = yield call([device, device.services]);
for (const service of services) {
const characteristics: Array<Characteristic> = yield call([
service,
service.characteristics,
]);
@eWizardII
eWizardII / cis_442d_1.md
Created January 5, 2017 01:54
How to solve the issues with running the commands such as pwd and ls (Windows Users)

Oh look this is a markdown file like from class... :P This will help you with problems you may be running into in your Windows system

  1. Close jupyter notebook (all the tabs on your browser, and the command prompts)
  2. http://git-scm.com/download/win download this
  3. Click next till you get to a screen that has an option that is in red
  4. Select the last option this will install unix tools on your windows machine
  5. Click next for all the following screens
  6. Install the application
  7. Test to make sure things work
  8. Launch command prompt
@eWizardII
eWizardII / logfile
Created January 20, 2015 14:11
Logfile
01-20 08:48:52.365 21628-21628/com.tigerblood.node I/ParseAlarm﹕ ParseAlarm Called!
01-20 08:48:54.195 28711-28711/com.tigerblood.node D/AndroidRuntime﹕ Shutting down VM
01-20 08:48:54.195 28711-28711/com.tigerblood.node W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x41784da0)
01-20 08:48:54.205 28711-28711/com.tigerblood.node E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.tigerblood.node, PID: 28711
java.lang.RuntimeException: Unable to start service com.tigerblood.node.LocationIntentService@429cf7c0 with null: java.lang.NullPointerException
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2814)
at android.app.ActivityThread.access$2100(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
@eWizardII
eWizardII / Java
Created June 18, 2014 02:50
Java File With Problems
package com.kk.kblock;
/**
* Created by general on 6/10/2014.
*/
import android.bluetooth.BluetoothManager;
import android.content.Context;
import android.app.Activity;
import android.content.pm.PackageManager;
/*
* Copyright (C) 2013 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
#!/bin/bash
TESTIP=192.168.1.1
ping -c4 ${TESTIP} > /dev/null
if [ $? != 0 ]
then
logger -t $0 "WiFi seems down, restarting"
ifdown --force wlan0
import os, numpy, PIL
from PIL import Image
# Access all PNG files in directory
allfiles=os.listdir(os.getcwd())
imlist=[filename for filename in allfiles if filename[-4:] in [".jpg",".JPG"]]
# Assuming all images are the same size, get dimensions of first image
w,h=Image.open(imlist[0]).size
N=len(imlist)
@eWizardII
eWizardII / IMU
Created October 2, 2013 19:45
Program Main
package com.walk.program;
import edu.umich.hbcl.imuClinicalMonitor.imuProcessing.BasicIMUProcessingAlgorithmCleaned;
import edu.umich.hbcl.imuClinicalMonitor.imuProcessing.ColumnVector;
import edu.umich.hbcl.imuClinicalMonitor.imuProcessing.FootTrajectory;
import edu.umich.hbcl.imuClinicalMonitor.imuProcessing.TimeRange;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Vector;
@eWizardII
eWizardII / Main
Created September 29, 2013 23:04
Full Program
from PIL import Image
import numpy as np
from PIL import ImageChops
import subprocess
import math
import datetime
from PIL import ImageFont
from PIL import ImageDraw
from collections import deque