Saturday, June 24, 2017
Android app Netduino plus to monitor and open garage door
Android app Netduino plus to monitor and open garage door

I have started a new blog on the Netduino plus board. This is my first foray into embedded programming. I just received an Arduino Uno board and a Netduino plus board. I am going to chronicle a home automation project that includes the following elements (I will be documenting everything you need if you want to join me!)
- Netduino plus with garage door sensor
- Open and close the garage door with the Netduino plus
- Send commands to the Netduino over HTTP
- A RESTful webservice that talks to the Netduino plus over HTTP
- Write an Android app that talks to the RESTful webservice that talks to the Netduino
- An Android app to monitor my garage door and open/close it.
- Blog about my embedded projects and code examples (http://netduinohacking.blogspot.com/)
- Arduino (an open-source electronics prototyping platform)
- Netduino plus
Available link for download
Friday, June 23, 2017
An Open Letter to Manchester Cathedral and the CoE about secular digital guidelines
An Open Letter to Manchester Cathedral and the CoE about secular digital guidelines
Following this article. Ive decided to send this open letter to the Very Reverend Rogers Govender of Manchester Cathedral about his "sacred digital guidelines."
Dear Very Reverend Rogers Govender,
This open letter is in response to the article located here in the Times, which details four "sacred digital guidelines" youve created for games developers to sign up to. For completeness these rules are:
1. Respect our sacred spaces as places of prayer, worship, peace, learning and heritage.
2. Do not assume that sacred space interiors are copyright free.
3. Get permission from the faith leaders who are responsible for the building interiors you want to clone.
4. Support the work of those engaged in resisting the culture of gun crime and those involved in promoting the work of conflict resolution.
Whilst I agree entirely with number 4, I, and many others, have concerns with the first 3 guidelines. As is often the case with freedom of speech and censorship you have to defend works of little value to protect the rights of those which are of worth. As in defending the puerile and offensive Danish Mohammad cartoons in order that intellectually stimulating works like "Jerry Springer the Opera" and "The Satanic Verses" are also defended. I feel this is the case with the mediocre "Resistance: Fall of Man." Whilst R:FoM did not itseld critique the Church of England, your response would curtail that ability.
As such, I feel it is necessary to reply with this open letter (which will be located on http://skeptobot.blogspot.com) with the following "secular digital guidelines" that I wish the CoE to sign up to when interacting with "new digital media" which includes, but is not limited too, games, blogs, social networks, MMOGs (Massively Multiplayer Online Games), online video and podcasts.
These "Secular digital guidelines" are:
1. Respect our right to criticise and ridicule elements of a faith we find offensive or untrue.
To do so is an attempt to close down dialogue that can improve both the secular and religious world views. No one likes being offended by something, but thankfully "not being offended" is not a human right.
2. Do not assume that you own the copyright of your sacred spaces and other historical religious imagery.
Manchester Cathedral (which began being built in 1215) is like most religious buildings in the UK, in that it was constructed during a Feudal system of government and church that exploited and tithed the populace to build such buildings. As such the general public has as much right to the image of the church as any member of the faith. Let alone the idea of copyright lasting 800 years. And this is before any consideration of fair use.
3. Do not assume that people must get permission to recreate and image these religious spaces and works.
Whilst clearly, any considerate artist, composer, writer, blogger, podcaster or designer, should inform you of their intentions, do not presume they require your permission. For example politically critical television shows would fall apart if they had to get permissions for all their satirical works. To require permission from such people effectively acts as a form of censorship.
4. Support the attempts to reduce the conflict, violence, wars and terrorism caused by differing religious beliefs.
Whilst adults playing violent video games may indeed concern you, many secular and religous people, who can distinguish between reality and fantasy, would rather you focus your efforts on the real world violence caused by religion.
This is not meant to be critical of your faith, and in no way ignores the countless good works of the CoE but is just encourage proper interaction in this new electronic landscape of communication, debate and dialogue - where everyone owns a printing press.
I you support this proposal I include a form for you to print, sign and return, as well as a hard copy that will be posted today. If you do not support it, then I politely request an explanation why, that can be included on the site.
Best Regards,
Skeptobot
Ill detail any response I receive. If you wish to encourage a response to this letter please digg.
Available link for download
Sunday, May 28, 2017
Andy Murray Angelique Kerber named top seeds for Australian Open
Andy Murray Angelique Kerber named top seeds for Australian Open

British maestro Murray will be aiming to clinch his first title at Melbourne Park after losing in the final of the tournament for five times, including in 2011, 2013, 2015 and 2016 to Serbian rival Novak Djokovic, who is seeded two.
Meanwhile, Kerber, reigning Australian and US Open champion, will head to Australia hoping to defend her first Grand Slam title, Sport24 reported.
The Australian Open will stick with the current rankings when its seeds 32 players in each of the mens and womens 128-player singles draws.
Wimbledon finallist Milos Raonic is seeded-third in the mens seedings, with US Open champion Stan Wawrinka, Kei Nishikori, Gael Monfils, Marin Cilic, Dominic Thiem, 14-time Grand Slam champion Rafael Nadal and Tomas Berdych completing the top 10.
As far as list of top 10 womens seeds is concerned, former world number one Serena Williams is seeded No. 2, followed by Agnieszka Radwanska, Simona Halep, Karolina Pliskova, Dominika Cibulkoa, Garbine Muguruza, Svetlana Kuznetsova, Johanna Konta and Carla Suarez Navarro.
Swiss star Roger Federer, who has won the Australian Open four times, will start at No.17 as he makes a comeback after six-month long injury layoff.
Federer recently slipped to No. 17 in the rankings after Grigor Dimitrov won the Brisbane International and moved up to No 15.
Available link for download
Sunday, May 14, 2017
An Open Letter To IPCC Chairman Rajendra K Pachauri
An Open Letter To IPCC Chairman Rajendra K Pachauri
Dear Sir,
I regret to inform you that I have withdrawn my support for your continuing role as chairman of the IPCC. Please resign your chairmanship immediately after reading this message. You may take the rest of the day off.
It was thanks to our help that you became chairman of the IPCC in the first place. Weve never trusted the IPCC and the previous IPCC chairman, Dr Watson, was one of those so-called "Climate Scientists". So we had him ousted. We certainly didnt want a "scientist" chairing the IPCC - too close to the "science" you see and therefore too dependent on grant money.
No what we needed was someone with industry links who could make money the good old fashioned way. So we picked you, in light of your industrial links and your qualifications in Economics and Railway Engineering (at a time when trains correctly bellowed co2!). To seal the deal, your directorship of an energy and environment research institute made you a relevant candidate for the position.
Remember? No? Perhaps you dont recall how you became chair of the IPCC? Its hard to deny when its in print in a 2002 NYT article:
Auto manufacturers and oil companies have long seen Dr. Watson as a foe, and their lobbyists have said that Dr. Pachauri, who has worked with industry in the past, was clearly preferable.
If only you had remembered who put you there. Too late. Youve overstepped the mark with your continued insistence that human activity is warming the climate. I guess reading too many IPCC reports made you go all "sciencey".
How quick you forgot the industry symposiums on co2-is-life! And you are a railway engineer? What are you doing chairing the IPCC if you are a railway engineer? It should be a climate scientist in charge - no wonder we dont trust the IPCC if its being chaired by a railway engineer.
And we hear you are a director of an energy and environment research institute? That you have links to industry? I suppose you stand to benefit financially from all this? So you are not only unqualified to head the IPCC, but possibly in the pocket of industry too?! This is a scandal! How can the IPCC be so corrupt?
Then to top it off I just heard you wrote a book?!
Just stop. Stop now. Last month I believed in manmade global warming. I trusted science. I thought climate science was the best. But thanks to your activities I no longer trust the IPCC or climate science. I can only hope in a very sincere way that somehow the good name of science will survive.
With a tear in my eye,
Inferno
Chief Climate Scientist and Chairman of the DenialDepot Climate Science Blog
P.S. dont steal the pens when you leave
Available link for download
Monday, April 24, 2017
Alternatives of Open Session In View OSIV
Alternatives of Open Session In View OSIV
session.connect() : It is a function that will be called on a Session object it is responsible for establishing the connection with the database.
session.disconnect() : It will release the connection resources. It doesnt mean you are closing the connection.
session.flush() : this function is used to serialize the data to the database. If you have something in the session that is not submitted to DB you can submit them using session.flush().
So here is the utility class that you can take :
HibernateUtil.java
You can easily understand the HibernateUtil class we have use the Thread Local design pattern that you can see her.
public class HibernateUtil {
@Autowired
private static SessionFactory sessionFactory;
private static final ThreadLocalthreadsession=new ThreadLocal ();
private static final ThreadLocalthreadtransaction=new ThreadLocal ();
public SessionFactory getSessionFactory() {
return sessionFactory;
}
public void setSessionFactory(SessionFactory sessionFactory) {
this.sessionFactory = sessionFactory;
}
public void connect() {
try {
Session session=threadsession.get();
if(session==null) {
getSession();
session=threadsession.get();
}
session.reconnect();
}
catch(Exception e) {
e.printStackTrace();
}
}
public void diconnect() {
Session session=threadsession.get();
session.disconnect();
}
public Session getSession() {
Session session=threadsession.get();
try {
if(session==null) {
session=sessionFactory.openSession();
threadsession.set(session);
}
}
catch(Exception e) {
e.printStackTrace();
}
return session;
}
public void closeSession() {
try {
Session session=threadsession.get();
threadsession.set(null);
if(session!=null && session.isOpen())
session.close();
}
catch(Exception e) {
e.printStackTrace();
}
}
public void beginTransaction() {
Transaction tx=threadtransaction.get();
try {
if(tx==null) {
tx=getSession().beginTransaction();
threadtransaction.set(tx);
}
}
catch(Exception e) {
e.printStackTrace();
}
}
public void commitTransaction() {
Transaction tx=threadtransaction.get();
try {
if(tx!=null && !tx.wasCommitted() && !tx.wasRolledBack())
tx.commit();
threadtransaction.set(null);
}
catch(Exception e) {
rollbackTransaction();
e.printStackTrace();
}
}
public void rollbackTransaction() {
Transaction tx=threadtransaction.get();
try {
threadtransaction.set(null);
if(tx!=null && !tx.wasCommitted() && !tx.wasRolledBack()) {
tx.rollback();
}
}
catch(Exception e) {
e.printStackTrace();
}
finally {
closeSession();
}
}
}
I am taking one interceptor from where we can call the functions from out utility class and you can call it by using AOP.
here is the code that you can apply on your service layer using AOP.
ConnectionService.java
public class ConnectionService {
@Autowired
HibernateUtil2 hutil;
public void startConnection() {
hutil.connect();
hutil.beginTransaction();
System.out.println("before");
}
public void closeConnection() {
System.out.println("after");
hutil.commitTransaction();
hutil.diconnect();
hutil.getSession().flush();
}
}
Now you have to configure this in spring configuration file and you have done.
LazyInitializationException: Session has been closed
Available link for download
Friday, March 10, 2017
Android app to monitor open and close garage door
Android app to monitor open and close garage door
Have you ever wanted to know if your garage door is open without having to go and check it? There have been many blog posts to light an LED when you leave your garage door open, but I want something more convenient. I decided to write an Android app that would allow me to monitor my garage door and even open or close from anywhere. I am going to provide complete instructions for building the required hardware and the android app code.
![]() |
| Monitor your garage door with an Android app |
- Using a Netduino board (or an Arduino board with an Ethernet shield) build a sensor to detect if the garage door is open or closed. I chose an infrared phototransistor so I would not have to make physical contact with the door and because its cheap! Like $1.13 cheap!
Build and program a garage door sensor - To open or close the garage door I wired an Optoisolator to a spare garage door opener.
Build and program a garage door opener
Open and close garage door with your Netduino - Write a program (or you might hear it referred to as a sketch) to check the sensor and determine if the door is open or close and report it back over HTTP
- Even though its not required, I wrote a second RESTful webservice to talk to the Netduino web server (see diagram). That way the Netduino webserver is never exposed outside my private network. I have another computer with the RESTful webservice that has a layer of authentication that is exposed to the internet.
- And finally an Android app that will display if the garage door is open or closed as well as open or close it. Here are step by step instructions (with complete source code) for writing the Android App.
Available link for download
Tuesday, February 14, 2017
An open letter to Lord Drayson
An open letter to Lord Drayson
A brief email Ive just sent to Lord Paul Drayson on a minor comment he just made during the excellent debate he had with Ben Goldacre earlier this evening at the Ri. Whilst this topic is funny, the genuine fear Ive seen in people means that I must mention it.
Dear Lord Drayson,
Firstly, congratulations with the debate. I think you raised some very valid points. Furthermore, I commend you for reaching out via such debates and twitter.
However, I feel I must quickly raise an issue I had with a comment you made at the end of the debate. Just minutes ago, you declared that the medias coverage over whether the LHC could pull the Earth into a black hole was a GOOD thing. You suggest that it got people interested and thinking and that this sensationalism was good for science.
I must strongly disagree. I have a PhD in Physics and as a result, during the course of my work (and in the course of my blog) I have had to explain, comfort and reassure numerous members of the public that they were not under threat from Physicists stepping on the toes of the gods. People have come to me explaining that their children were in tears and couldnt sleep with fear. Whilst we all found it funny, It was not a joke to them.
I might even go further and suggest that you believe that these outrageous statements are justified because deep down no one really took the medias story seriously. In doing so, you are relying on the very same mistrust of the media that you earlier claimed did not exist.
Whilst I do not wish to inflate the importance of this issue, I do feel you should know the pain it caused a small minority of people and the issue this presents for mainstream media. The coverage of the LHC was lacking. I shall be posting this email as an open message on my blog tomorrow.
Best Regards,
Bill
Just a comment about the blog, its NOT dead. My excuse is that I have been suffering from severe 2nd degree burns on my leg and foot and so have been in and out of hospital for FAR TOO LONG now. As I get better the site should come back to life.
Available link for download
Sunday, January 29, 2017
An Open Challenge to Advocates of Tax Cuts
An Open Challenge to Advocates of Tax Cuts
It is easy to rant about the unfairness of ANY tax. Anti-tax advocates are making U.S. fiscal problems worse, not better. They add to a culture of fiscal irresponsibility in which we demand government services, but are unwilling to pay for them. Please do not misunderstand me. I am not opposed to the reduction or elimination of ANY government programs. But until such a time as politicians are willing to upset the portions of the electorate that benefit from government largesse by reducing their benefits, the responsible behavior is to pay for current government services rather than passing trillions of dollars of debt to our children, grandchildren, and future generations.
Keep ranting if it makes you feel better. But unless you support HIGHER taxes (on someone) or reduced government spending (on things YOU benefit from), then you are part of the problem, not the solution.
I await your plans for increasing federal government revenues or specific recommendations for $1.5 trillion (or more) in cuts to government services.
Available link for download
