Posts

Showing posts from 2010

PCBs

Silver Circuits Screaming Circuits - PCB + Assembly UltimatePCB - PCB + Assembly

Hibernate mapping

one -> many inverse

Java XML manipulation

http://www.petefreitag.com/item/445.cfm

Probabalistic classification

Naive Bayes classifier

You're a bad programmer embrace it

article

FCC testing costs and process

knowledgebase ~$5000 for FCC, Canada and European is extra, but not double Takes less than 30 days, ~1 week depending on backlog

Arduino derivatives

Boarduino RBBB FIO Teensy <- this is it Freeduino Sanguino Illuminato Parallel Seeeduino Seeeduino Mega hackaday seeddstudio engadget instructables

Ubuntu mount smb drive

HOWTO persistent HOWTO manual sudo apt-get install smbfs Example: create .smbcredentials file with: username= password= domain= chmod 600 .smbcredentials In fstab create and entry like: #rochester nas //roc-nas.foo.com/pathname /media/roc-nas cifs credentials=/home/username/.smbcredentials,dirmode=0777,file_mode=0777,iocharset=utf8,codepage=cp850,unicode 0 0 To mount: sudo mount /media/mount-name or sudo mount -a To unmount: sudo umount /media/mount-name or sudo umount -a

MOSFETs

tutorial

Dynamic SQL Oracle PL/SQL

Examples

Arduino MMC / SD card read/write

roland-riegel lib It includes * low-level MMC, SD and SDHC read/write routines * partition table support * a simple FAT16/FAT32 read/write implementation Seeeduino Raw and Fat16 HOWTO Detailed description

Bluetooth 3.0, WiFi combo chip BMC4325

Broadcom BMC4325 announcement

Android

Android files Common tasks HowTo Binding a List to a data cursor icon sizes and design Android icon examples or on local drive: android-sdk-linux_86/platforms/android-8/data/res Hierarchy Viewer layoutopt tool Layout Objects Example Views R.Stylable class RelativeLayout example Android graphical widget guide Tab examples Table example Table example w/divider Table row lines hack Table rounded border Table rounded border example 2 WebView - show simple content within an Activity Service Manifest service element Message Notification Intent guide Intent Intent example Security permissions A feature can be protected by at most one permission. Data storage Shared Preferences      Store private primitive data in key-value pairs. Internal Storage      Store private data on the device memory. External Storage      Store public data on the shared external storage. SQLite Databases      Store structured data in a private database. Content providers Must be implemented thread-safe. Call ContentRe

J2SE Bluetooth

HOWTO StackOverflow JSR-82 Discovery Oracle HOWTO include SPP rfcomm example

C/C++ stuff

typedef

J2ME bluetooth JSR-82

HOWTO Java.net Getting Started

Sensors

FSR FSR HowTo

VBox image keeps growing and running out of space

Clean it up Zero it Shut it down Compact it download SDelete sdelete -z -c c: shutdown the guest OS and virtualbox vditool SHRINK whatever.vdi VBoxManage modifyhd Win8.1.vdi compact

Regex

Dot does not match new line. Add one of the following to the pattern to support new line: (?m) multiline (?s) dot all

Micro platforms and comm

Hardware EcoWizard FLEX Mini MICAz Iris Mote NeoMote Sun SPOT Communications ANT 6LoWPAN DASH7 ONE-NET ZigBee Z-Wave Wibree WirelessHART

Arduino

On linux /usr/share/arduino /usr/share/doc/arduino /usr/share/arduino/libraries To install Messenger: download it sudo file-roller open it and navigate to /messenger/arduino/Messenger in the zip extract to /usr/share/arduino/libraries/ Arduino 0019 current rc1 has String object currently Arduino GA is 0018 ATMega8U2 USB OptiBootLoader faster Arduino as a programmer

Wireless technologies

Wifi 802.11 $44, 100Mb, 100M WiFly $44, 100Mb, 100M SHDC memory with WIFI $50 ZigBee 802.15.4 $20, 250 kb, 100M - 1 mile Bluetooth 802.15.1 < $20, 3Mb, 100M Cellular $64 + sevice 2G, 3G GSM, GPRS, EDGE, W-CDMA, UMTS, TDMA, CDMA, CDMA2000 1xRTT, CDMA2000 1xEV-DO, and CDMA2000 1xEV-DV 4G must have target peak data rates of up to approximately 100 Mbit/s for high mobility such as mobile access and up to approximately 1 Gbit/s for low mobility

AVR

AVR site ATmega1284P summary spec sheet

Android resources

See Accessing Resources in Code If all you require is the ability to read raw data (such as a video or audio file), then save the file in the res/raw/ directory and read a stream of bytes using openRawResource(). get an instance of Resources with Context.getResources() never modify the R.java file by hand—it is generated by the aapt tool when your project is compiled. ViewGroup = layout View = widge: button, checkbox, etc.

Fast Arduino servo response

HOWTO On Duemilanove board powered exclusively from USB, the power drops out with the servo powered from the board +5V. Need external power for servos! 1 Orange = PWM 2 Red = +5V 3 Brown = Gnd +-- |1 \ |2 | |3 / +--

Android widgets

Horizontal Slider

Android video capture

slashdot

Android Camera

Take picture Take and save picture

Bluetooth, Wifi interference

Sharing 2.4 GHz band Bluetooth interferes with Wifi typically less than 25% Cisco 20 myths old but simple explanation of the interference issue bluetooth access points

Business Models

Revenue Development The Case Against Free Free! Why $0 is the Future of Business Viral Video Strategies Sales Complexity

Android sensors

Orientation Diagram getOrientation

Arduino programmer

located in /usr/shar/arduino preferences ~/.arduino/preferences.txt To dump all communication during loading set: upload.verbose=true

AvrDude

Can program AVR chips via serial from file. AVRDUDE can be used effectively via the command line to read or write all chip memory types (eeprom, flash, fuse bits, lock bits, signature bytes) or via an interactive (terminal) mode. Using AVRDUDE from the command line works well for programming the entire memory of the chip from the contents of a file, while interactive mode is useful for exploring memory contents, modifying individual bytes of eeprom, programming fuse/lock bits, etc. AVRDUDE tutorial Some info on uploading on the Eclipse page

Reset Circuit

Schematic

Ubuntu Bluetooth pairing

FireFly Linux gtkterm gtkterm -p /dev/rfcomm0 -s 115200 --------------------------- Open System -> Preferences -> Bluetooth Manager Adapter -> Search - be sure remote is discoverable Device -> Pair - accept and confirm Can send files, must confirm on remote end ----------------------------- To connect RN-41 connect USB Applications -> Accessories -> Serial port terminal Configuration -> Port select /dev/ttyUSBx, 115200, 8,N,1 select local echo Enter $$$ to enter command mode on RN-41 should return OK ----------------------------- Open terminal and enter: sudo getty 115200 /dev/rfcomm0 ----------------------------- In Bluetooth Manager select RN-41 device Right click and select SPP - should connect In Serial port terminal turn off local echo and hit Enter - should see login screen ------------------------------ Haven't found command line howto hcitool scan sudo hcitool cc 00:06:66:05:04:62 then right click and pair with pin then right click and select SPP /dev/r

Android Arduino toolkit/library

Amarino

Arduino memory

Practical Arduino pg 365

Arduino IDE Ubuntu

Arduino playground sudo add-apt-repository ppa:arduino-ubuntu-team sudo apt-get update sudo apt-get install arduino

Ubuntu serial port

Download GUI Serial Port Terminal or Command line minicom list connections: dmesg | grep tty

Sensors

Current

Arduino Bluetooth

HOWTO

uControllers

ATmega328P

Robotics

Robot Marketplace Cheap servos

Remote control

Engadget Gizmodo SparkFun Ardunio and sensors $20-150 TINI $109 BasicStamp $60-100 Sensors

Bluetooth sensor project

Java bluetooth API Java bluetooth API part 2 Java Bluetooth library Bluetooth sensor project Bluetooth serial adapter USB Bluetooth adapter $17.95 USB Bluetooth adapter $8.99 BlueTooth RFID reader Bluetooth Ardunio board Bluetooth Mate and bluetooth command set and specs Class 2 $18.95 Class 2 $21.50

Ubuntu 9.10 partitioning issues

Can't manipulate partitions. FATAL ERROR: Bad logical partition 6: enlarged logical partitions overlap Was trying to fix grub2 Was able to resolve it by rebooting and deleting one partition, then unable to delete the next, but after rebooting could delete one more. Continued until they were all removed, then recreated them.

Bloom filter for key value storage

bloom filter provides quicker resolution for key value storage used by google big table

Technology choices

Okta - Building your house on a rock Java -> eye on Scala Tomcat JQuery Spring Hibernate MySQL Cloud IAAS Muti-Tenancy high up in the application

Ubuntu automate display settings

HOWTO /etc/X11/xorg.conf xrandr --output DFP1 --mode 1280x768 xrandr --output DFP_EXTTMDS --mode 1776x1000 left 1280x768 right 1776x1000 Virtual 3200 1091 xrandr --output DFP1 --mode 1280x1024 xrandr --output DFP_EXTTMDS --mode 1920x1080 left 1280x1024 right 1920x1080

Ubuntu 10.04 64 Flash player

HOWTO

Android as uController

Serial cable Android - ardunio robot

Compiz Fusion

Scale plugin shows all windows on single screen for selection and then takes you to the appropriate desktop showing the window.

Performance

Ubuntu 9.10 ext4 copy disk->disk ~22-29MB/sec ~25MB/sec avg ~1.4GB/min ~10min to copy 14GB

Java DNS cache

Replace Java DNS with dnsjava Prior to Java 6 DNS resolutions were cached forever. Defaults: Java 6 DNS positive responses are cached for 30 seconds and negative responses for 10 seconds -Dsun.net.inetaddr.ttl=3600 By default, when a security manager is installed, in order to protect against DNS spoofing attacks, the result of positive host name resolutions are cached forever. When a security manager is not installed, the default behavior is to cache entries for a finite (implementation dependent) period of time. The result of unsuccessful host name resolution is cached for a very short period of time (10 seconds) to improve performance.

HTML and CSS

div and span

Adobe Reader Install - Ubuntu

HOWTO

JBoss

Scan rate to detect changes, i.e., jsp <JBOSS-INSTALL_DIR>\server\<server config>\conf\jboss-service.xml <!-- Frequency in milliseconds to rescan the URLs for changes --> <attribute name="ScanPeriod">5000

JNDI testing

OOC-JNDI

Trillion node network

Trillions video trillion node network scalability - no central authorities (registration, namespaces, ontologies) no device individual attention tracktability size can't increase complexity comprehensiveness bit, byte, name/value Internet of Things

JBoss SecurityManager

Secure Coding Guidelines - see section 6 for how security is checked JBoss classloding JBoss SecurityManager HOWTO Class.getProtectionDomain().getPermissions() Discovering an apps security requirements Policy Security and Permissions Classes, Methods, and Permissions Prevent Thread creation

Oracle

Reduce I/O with cluster tables Tuning Disk I/O Monitoring I/O select * from gv$sysstat where name like '%IO%' HOWTO Tuning FAQ Disk I/O

Jetty

JAX-WS with Jetty

NTFS Links

HOWTO

Symmetric key encryption

HOWTO

Flash Flex

Adobe Flash Builder 4 DualPanel reversible component

Google Protocol Buffer, ASN.1, COM, CORBA, Thrift, etc.

Google Protocol Buffers FAQ Interchange vs. RPC Why not XML

NIO

Server/Client examples Getting Started with NIO NIO don't need a thread per connection with all threads waiting for something to happen Java 1.4, 5, 6 introduction

Firewall hole punching UDP

How to punch a hole in a firewall for UDP UDP code examples wikipedia Session Traversal Utilities for NAT (STUN) Interactive Connectivity Establishment (ICE) jSTUN

Ubuntu remote desktop slow

Super fast remote desktop NoMachine protocol Ubuntu 9.10 HOWTO FreeNX HOWTO

Java threads out of memory native threads

Increasing heap can exacerbate the problem

JBoss EE Dynamic Web App

Tutorial

war-less development with jetty

Maven Jetty Plugin HOWTO Maven Jetty Plugin mvn jetty:run-exploded mojo Deploying a webapp to jetty HOWTO Executable jar with Embedded jetty

Caching, Distributed Caching, Replication, JGroups

Articles

Use temp table instead of large IN clause for performance

Oracle limits to 1000 entries in an IN clause Some queries run faster joining to temp table

Resizing a VBox virtual disk

HOWTO

Dynamically set log4j level

logLevel = Logger.getLogger(Fubar.class).getLevel(); Logger.getLogger(Fubar.class).setLevel(Level.FATAL);

Oracle statistics

EXEC DBMS_UTILITY.analyze_schema('schema_name','COMPUTE') ANALYZE cluster clusterName compute statistics; ANALYZE table tableName {compute|estimate|delete) statistics options ANALYZE index indexName {compute|estimate|delete) statistics options ANALYZE cluster clusterName {compute|estimate|delete) statistics options

Ubuntu xrdp

HOWTO

Ubuntu 9.10 couldn't login as root

I also couldn't access Synaptic Package Manager If you want to be able to login as root, you need to define a password for root: :~$ sudo passwd Password: Enter new UNIX password: Retype new UNIX password:

Ubuntu 9.10 sshd

You need to install it manually and it automatically starts the daemon sudo apt-get install openssh-server

svn

Merge branch range to working copy branch (possibly head of trunk) Have branch or trunk checked out and in a state ready to accept the merge Browse the history of the branch to merge - need to know the version before the start of the change range to merge (n) and the version at the end of the change range to merge (m) From the dir that is receiving the merge: svn merge -r n:m svn-url-of-source-branch --dry-run Validate that the merge changes are what you desire to occur: svn merge -r n:m svn-url-of-source-branch Resolve any conflicts, test, and commit.

TCP connections

If both a client and server simultaneously close a connection there is a race condition that may result in the connection hanging and not closing for minutes. Both sides of the connection may simultaneously send a FIN to the other side and both may end up waiting for an ACK or RST until the default TCP timeout; which is typically double MSL (maximum segment life time) or 4 minutes. Having the client do a read until EOF is signaled before closing avoids the issue. RFC 793 [Postel 1981] specifies the MSL as 2 minutes. Common implementation values, however, are 30 seconds, 1 minute and 2 minutes. Description and diagrams of why simultaneous close results in time-wait TCP state and sequence diagrams showing how and why the simultaneous close results in long timeouts TCP protocol diagram including simultaneous close SO_LINGER From here: The tcp_close_wait_interval is 4 minutes. This variable defines how long a host would wait in the TIME_WAIT state. This implies that the host which is st

Ubuntu 9.10 64 Oracle XE install for sql*plus

HOWTO Just needed the sql*plus tool and a small test db. Used port 8181 and db listener 1522 Because I want a full version of Oracle on a VM to use the default ports. http://127.0.0.1:8181/apex

VNC to Ubuntu 9.10 doesn't update

use gconf-editor to set /desktop/gnome/remote_session/disable_xdamage to disabled extension is a temporary workaround although it requires more bandwidth - really slow Another fix: Disable Compiz System -> Preferences -> Appearance -> Visual Effects = None Install x11vnc: sudo apt-get install x11vnc Start x11vnc x11vnc --noxdamage --passwd XXX -forever

Ubuntu 9.10 Windows don't resize across displays

use the keyboard shortcut Alt-F8 or Alt-MiddleMouse Nobody has found a config setting yet.

sed

Examples strip the first part of a log4j file so we can do a compare of a diagnostic dump sed 's/^.*\[//' test > test2

maven

mvn dependency:tree Maven tips

osgi

State of OSGi

deepEquals

org.apache.commons.lang.ObjectUtils public boolean deepEquals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ThisClass other = (ThisClass) o; if(!ObjectUtils.equals(this.getFoo(), other.getFoo())) { return false; } if(!ObjectUtils.equals(this.getBar(), other.getBar())) { return false; } ... return true; } Also need to cascade into collections. Pass along a result object to track status and differences for reporting. Don't fail fast because reporting differences is extremely useful for debugging.

Java Open Single Sign-On JOSSO

Project home

Java Math Expression Parser

Singular Systems JEP Docs Other solutions including ANTL and other open source

Browser testing

Selenium ThoughtWorks

Eclipse buttons don't work fix

export GDK_NATIVE_WINDOWS=1 before starting Eclipse ...

HowTo change JBoss ear/war deploy directory

If your IDE and/or maven builds and ear/war in /home/tcollinsworth/svn/someApp/someProj/target/blah In $JBOSS_HOME/server/ServerName/conf/jboss-service.xml add: <attribute name="URLs"> deploy/,file:/home/tcollinsworth/svn/someApp/someProj/target/blah </attribute> From here And here Web apps require changing profile.xml

Installing Oracle on Linux

HOTOs Versions HowTo Oracle 11g in XUbuntu

HowTo install SQL*PLUS on Ubuntu 9.10

Download the Instant Client Package Basic and SQL*PLUS zips from here. Create a directory and unzip them both into that directory, they unzip into the same sub-dir The sql*plus .rpm files don't download properly, they just show partial data in firefox. Besides you would need alien to install the .rpm files since ubuntu used .deb. gedit ~/.bashrc Add the following editing paths as appropriate: PATH=.:$PATH:/home/tcollinsworth/Oracle/instantclient_10_2 export LD_LIBRARY_PATH=/home/tcollinsworth/Oracle/instantclient_10_2 export TNS_ADMIN=~ gedit ~/tnsnames.ora Add the following editing as appropriate: YOUR_ALIAS_NAME = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = someHostname.company.com)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = YOUR_SERVICE_NAME) (SERVER = DEDICATED) ) ) Reload the .bashrc with: . ~/.bashrc Connect to oracle with: >sqlplus user/pwd@your_alias_name Followed this blog

PowerMock

Uses custom classloader and bytecode manipulation for testing of static methods, constructors, final classes, etc. Suppress unwanted behaviors in parent classes, etc.

Sun Java System Directory Server

Uninstall procedure

Error libstdc++-libc6.2-2.so.3 on Ubuntu

error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory There is lots of old info out there about fixing this that points to missing pages. Also there is lots of solutions that just don't work with latest Ubuntu 9.10 karmic koala. Simplest solution: Download and install it from here and select install with deb libdb.so.3 Download it from here and select install with deb libgdbm.so.2 bin/nsperl: error while loading shared libraries: libgdbm.so.2: cannot open shared object file: No such file or directory sudo ln -s /usr/lib/libgdbm.so.3 /usr/lib/libgdbm.so.2 Issues found trying to install Sun One LDAP 5.2 on Ubuntu 9.10 Karkic Koala

Response time impact

Amazon claim that just an extra one tenth of a second on their response times will cost them 1% in sales. Google said they noticed that just a half a second increase in latency caused traffic to drop by a fifth. From blog on Brewer's CAP Theorem

Windows tools - not on *nix :(

xmlshell lightweight xml editor baretail tabbed tailing for windows

LDAP

LDAPAdmin

Red Hat / Cent OS networking config

/etc/hosts   127.0.0.1 localhost.localdomain localhost   ::1 localhost6.localdomain6 localhost6 /etc/sysconfig/network   NETWORKING=yes   NETWORKING_IPV6=yes   HOSTNAME=localhost.localdomain /etc/sysconfig/network-scripts/ifcfg-<interface-name, i.e., eth0>   TYPE=Ethernet   DEVICE=eth0   BOOTPROTO=static   IPADDR=192.168.1.21   NETMASK=255.255.255.0   USERCTL=yes   HWADDR=00:0C:29:CA:5F:05   IPV6INIT=no   IPV6_AUTOCONF=no   ONBOOT=yes   GATEWAY=192.168.1.1   NETWORK=192.168.1.0   HOSTNAME=someHostName /etc/resolv.conf search axeda.com   nameserver 192.168.0.28   nameserver 192.168.0.23 /etc/hostname - set via above CentOS network config CentOS network config files

Starting and killing X / gdm

sudo /etc/init.d/gdm start sudo /etc/init.d/gdm stop or startx sudo killall gdm

Ubuntu with ATI video low res mode

On Ubuntu 9.10 Karmic Koala, Dell Studio 1737 with ATI, the display config became corrupted and the system would only boot into low res mode. I often reconfiguring the display for dual mode and disable the laptop display to force the menus onto the larger external display then re-enable the laptop display to use both spaces. This was working fine on Ubuntu 8.10 Intrepid Ibex. After updating to 9.10 the display settings become corrupted while attempting this same sequence of operations. To fix it, delete: /etc/X11/xorg.conf Then execute: dpkg-reconfigure xserver-xorg Reconfiguring the display alone didn't work.

VMWare ESXi

To get the client, connect to ESXi server via browser and there is a menu where you can download the client. Connect to a server and click on console to administer the OS. To get the mouse out of vSphere client ctrl+alt To copy vm instance from one system to another use vmconverter When copying from one environment to another the encoding may conflict: File already has an encoding of "UTF-8". Cannot open configuration file ... Fix encoding by following this blog entry.

JBoss

Enable jmx-console: jboss-eap-4.3\jboss-as\server\ServiceLink\conf\props\jmx-console-users.properties uncomment admin=admin Clear work dir when context destroyed (undeploy): DeleteWorkDirOnContextDestroy in: $JBOSS/server/default/deploy/jboss.web.deployer/META-INF/jboss-service.xml

How to take screenshots of droid

HOWTO

Droid as modem - tethered to Ubuntu

HOWTO

EE transaction management

Old but a nice review

Google Wave

How Google Wave changed his life

JMX for TDD Integration and Acceptance Tests

While designing and implementing a test that has to wait for multiple sequential asynchronous steps to occur, it became apparent that JXM is a very good solution to sleeps in tests to avoid the flakey and long running test problem. It not only provides an alternative means of communication both into and out of the system, but it also provides event notification. This solution will work nicely for both integration and acceptance tests. After the test code executes whatever is necessary to cause asynchronous executions, it can go into a timeout loop waiting for completion events via JMX. Upon receiving the appropriate events and/or inspecting appropriate state following those events, the test should immediately proceed with any queries and assertions. The JMX solution involves creating a JMX MBean interface for the threads and registering them during thread startup initialization. The threads will increment counters indicating particular actions and fire appropriate events. The test

JAXB Marshal nested structures

With and without adapters