Thursday, October 13, 2016

[Just For Fun] blowing in the log

How many lines of code must a man write down
Before you call him a geek developer?
How many C 's codes must  be compiled? 
Before she learns undefined behaivour?
Yes, and how many times must the memory leaks get take 
Before they believe in Garbage Collector?
The answer, my friend, is blowin' in the log
The answer is blowin' in the debug mode

Yes, and how many years can a feature exist
Before it's  covered as deprecated ?
Yes, and how many years can some people develop CLR
Before they're allowed to be free?
Yes, and how many times can a man turn C++
And pretend that he just doesn't C?
The answer, my friend, is blowin' in the log
The answer is blowin' in the log
Yes, and how many times must a man look up to language specs
Before he can see the while statement not compile?
Yes, and how many ears must one man have
Before he can hear advantages of high order functions?
Yes, and how many lost wake-up problem will it take 'till he knows
That too many applications have not  been wait free?
The answer, my friend, is blowin' in the log
The answer is blowin' in the la debug 


listen(
)->BobDylan.toSing();



*this post contains not personal opinion only for fun :)

Monday, August 29, 2016

Very BigInteger

java.lang.BigInteger is very helpful but I think we should use this class with correct implementation.
If you use this class for keeping Integer values and convert them  into int type you need checking the returned value if it is too big for integer. According to specification,  soft warning is shown but many developers omit this information mostly.


intValue

public int intValue()
Converts this BigInteger to an int. This conversion is analogous to a narrowing primitive conversion from long to int as defined in section 5.1.3 of The Java™ Language Specification: if this BigInteger is too big to fit in an int, only the low-order 32 bits are returned. Note that this conversion can lose information about the overall magnitude of the BigInteger value as well as return a result with the opposite sign.
Specified by:
intValue in class Number
Returns:
this BigInteger converted to an int.


Source: https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html

Thursday, February 4, 2016

Sample IoT Application for Remote Power Control

We* designed and developed a system based on wireless control mechanism. The GUI controls the system outputs, turning on/off the light and also the other control unit is the fan. 

Through the introduction of the Internet-of-Things technology, anybody may establish own wireless sensor networks and  Internet-of-Things applications. It is very easy to combine with  GUI interface and control the electricity switch.

In the following figure, the system structure and technical properties of an application on wireless controlled outputs for both light and machine control can be seen.




The structure is working at ISM band with 2.4 GHz central frequency ad 2Mbps bandwidth to air with maximal distance of 100 meters.  First, the study began with 2Mbps bandwidth and approximately 25m indoor distance was operated successfully, however, due to the very small amount of data transfer, it has become apparent that we don’t need a bandwidth of 2Mbps, thus, in order to increase the distance, we reduced the bandwidth to 256 Kbps and the maximum communication distance then reached to 100 meters.

In the center of the system, we use the Raspberry PI with Linux operating system, which is used as HUB or "Central Management Unit" with the connection accessed via 3G / GPRS or other ADSL or fiber over the Web. 

Sockets, sensors or RS232 - RS485 clients are equipped with the "Arduino Pro Mini" model microcontroller cards. 

Clients communicate with HUB through Nordic NRF24L01+ transceiver.

Today, the "Zigbee" protocol is commonly used in some areas such as the mesh network, the Smart Home Network, etc. Because of the "Zigbee" increases our of R & D costs and also because of the additional cost of bringing ZigBee development license, Nordic companies’ lower cost of tranciever NRF24L01 + model is preferred in this work.

Also, due allowing development, the development of our own communication protocol continues at the same time.

Basic NRF24L01 procedure is used on the system we are currently working on, but to create an advanced protocol and provide a standard, our development process still continues to take the advantage of all the opportunities of mesh network. 

The GUI interface is used to control the two system output over Raspberry Pi mainboard. 

Sample views of power control  can be seen in the following images.

 

We developed a controlling API which is named as “Bohemian API”. The Bohemian API is developed by Java EE7 standards and runs on Glassfish Server on Raspberry Pi. Running a GUI application in Raspberry Pi, which shows that it is very costly for memory and CPU usage. More lightweight web application is required for similar applications. We worked with the Glassfish in the very first time. It is really lightweight :) because we did not expect to run our application.

We determined to configure a new protocol which is automatically configured and used with other transceivers such as NRF24L01, automatically allowing to establish a self-forming network, secure, and allowing to extend NRF24L01’s 6 node star network structure to thousands node.

We see that the communication and interaction of connected devices could be simpler to manage them. The communication standards as architectural standard model and security models are necessarily parts of the Internet of Things.

Video: https://www.youtube.com/watch?v=aJ6TQlwmBB8  


*Goksal Adiguzel
*Arzu Behiye Tarimci
*Asuman Savascihabes


Creative Commons License


Author's comments in this blog are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.