Direkt zum Hauptbereich

Posts

Posts mit dem Label "Class" werden angezeigt.

Pi And More 11 - R Script For Neuronal Net And Training

This is the R script used to create and train the neuronal net for the Python project . Please consider that the lines for the export of the neuron weights are disabled by the comment marker #. ################################## # # COMMON SAMPLE DATA HANDLING # ################################## load_samples = function (filename, attrib) { data = read.csv(filename, sep = "\t" ) # Remove result column data = data[, -5 ] # Calculate all combination with count of measure points n = aggregate(x ~ run + subset, data = data, FUN = length) # Keep only measurement with 80 points n = n[n[, 3 ] == 80 ,] # Create the training data matrix for non-matches dataset = matrix(ncol = 80 , nrow = 0 ) # Fill up the training data matrix with the valid cases (n) of data and transpose it for (i in 1 : dim(n)[ 1 ]) dataset = rbind(dataset, t(data $ x[(data $ run == n[i, 1 ]) & (data $ subset == n[i, 2 ])])) # add class column dataset = cbind(c(attr

Pi And More 11 - Python Blinker Class

This source code is part of the Python magnetic field sensor and detector project . This class only provides a simple flashing indicator light for the project. ######################################## # # Python Magnetic Field Logger and Detector # by Sebastian Folz # Introduced on Pi And More 11 # ######################################## # Don't use time module, because there is no valid time without WiFi import time import sqlite3 as lite from qmc5883 import QMC5883 import statistics # import functions for system calls from subprocess import call import sys # import pushbutton class from pushbutton import pushbutton, Push # import blink class from Blinker import Blink1, Blink2 from enum import Enum import RPi.GPIO as GPIO # fix copy bug with switched arguments from shutil import copyfile # Import own neural net class from MLP import MLNN TASTER = 38 LED = 40 LONG_CYCLES = 10 # 1.5 seconds COMMIT = 10 BINSIZE = 10 #

The tricky issue of Oracle, JDBC and Android

Since Christmas, I am proud owner of an Android powered smart phone (Samsung Galaxy S Plus). The first thing I wanted to do was coding an java app to connect to Oracle database and fire lots of queries into the DBMS. As you maybe know, a JDBC driver is needed for this intention. You can download it at Oracle Software Downloads ( http://www.oracle.com/technetwork/database/enterprise-edition/jdbc-112010-090769.html ). And as you also know, you need to add in Eclipse IDE as a JAR file to your project. If you now test your app with a connection code like the one below, you will get a lot of exceptions: Driver d = (Driver)Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); DriverManager.registerDriver((d)); Connection c = DriverManager.getConnection("jdbc:oracle:thin:@instance.server.com:1521:name", "user", "password"); I had not even been able to investigate what exception exactly does occur or where it does come from. It's ca