Saturday, November 26, 2016

Hardware Programming # 02 Client Server vs Master Slave

Hardware Programming # 01 Popular Modbus libraries

Dev Tips#16 MUST KNOW to Prevent slow computer and unwanted pop up with...

Dev Tips#15 Socket application on network drive unhandled exception Syst...

unhandled exception: System.Net.Sockets.SocketException: An invalid argument was supplied

I came across this issue working with the nmodbus library on visual studio. I initially created the project on the local drive and it works, then I move the project to the network drive and suddenly the IDE started throwing this error. It is only after spending several hours troubleshooting without that I came to know that the project was the network drive. This solution may not be the ultimate one but if you face a similar scenerio with the same setup it may be a helpful way out...Have fun! 

Wednesday, April 6, 2016

trying to open unclosed connection

When having the error, the first thing to do is to restarting your mongo database.
If the error still persist, chances are that your connection statement is as below:

var dbUrl= 'mongodb://localhost:27017/test';
mongoose.connect(dbUrl);

To solve it , change connect to createConnection

var dbUrl= 'mongodb://localhost:27017/test';
mongoose.createConnection(dbUrl);


It should be working now, if not drop me a comment and will come to your rescue...


Monday, March 14, 2016

TypeError: require(...).connect is not a function

I recently had  a hard time trying to fix this issue.
I initially wrote these lines below to establish my connection:

var databaseUrl = "localhost/school";
var collections = ["student", "professor"]
var db = require("mongojs").connect(databaseUrl, collections);
var http = require("http");


Now it seems that since 1.x , mongojs no longer support the connect function,
instead we should replace the third line with:


var db = require("mongojs")(databaseUrl, collections);


Source: https://github.com/mafintosh/mongojs/issues/286


 

the default storage engine 'wiredtiger' is not available issue solved

I have created my data/db in the bin folder, for more about the installation watch this tutorial

Now to start mongod, instead of :

mongod --dbpath ./data/db

Do this instead:

mongod --storageEngine=mmapv1 --dbpath ./data/db

Hope it helps:



mongodb unclean shutdown detected

Are you having this error message : mongodb unclean shutdown detected ?
In my system I have my data/db under the bin folder
if you are using linux :

sudo rm /data/db/mongod.lock
sudo mongod --dbpath /data/db --repair
sudo mongod --storageEngine=mmapv1 --dbpath ./data/db
 
 
if you are using windows:
 
Go to your data/db directory:
1. delelte mongod.lock file
2. mongod --dbpath ./data/db --repair
3. mongod --storageEngine=mmapv1 --dbpath ./data/db 
 
More about the issue here 
 
 
 
 
 

Friday, February 26, 2016

How to run ionic on real device.

Are you developing an apps with ionic and planning to deploy it on a real device ?  Cool !
Here are some  steps that you may follow to get it running on your device out of the box.
  1. Make sure that the Developer Option of your Phone is activated, if not here is a tutorial to help you out.     http://www.greenbot.com/article/2457986/how-to-enable-developer-options-on-your-android-phone-or-tablet.html
  2. Connect your phone to the computer with a USB cable.
  3. Make sure your phone is open and not locked.
  4. Open the terminal and navigation to your main project directory. You should now see sometime like the below content. > cd  HelloIonicProject 
  5. Adding your current platform - if Android :  > ionic platform add android
  6.  Adding your current platform - if ios :  > ionic platform add ios
  7.  Now it is time to build our project on it. if android : > ionic build android
  8. Now it is time to build our project on it. if ios :  > ionic build ios
  9. Your may do this, to copy all the files into the specified platform : > cordova prepare
  10. Finally run it for android : > ionic run android
  11. Finally run it for ios : > ionic run ios
Hope you make it !

Thursday, February 25, 2016

change ionic address

If you are using ionic there are times where you would like to switch between network interfaces. Either from localhost to a static ip, to a wireless network and so on. By the running the following ionic command, all network interfaces your PC is connected to , are scanned and you presented with a list from you have to choose by typing just a number (1,2,3,..).

> ionic address


You are prompted with :


Here I choose the localhost by typing 3.

Hope it suits your query..

Monday, February 15, 2016

Why does a Servlet has no constructor ?

A Servlet class does not have a constructor because a programmer never instantiate it. Rather the container creates instances whenever it is  needed.

Sunday, January 17, 2016

Where is the netbeans.conf location ?

On windows :

C:\Program Files\NetBeans 8.0\etc

On linux:

/usr/share/netbeans/etc/netbeans.conf




Tuesday, January 12, 2016

Check Open MPI Version

Sometime it is a bit confusing to check the version of the Open MPI installed in your system. You can easily do it by running the following command.

ompi_info 



Then it returns a list of information and your Open MPI version information will be shown on first or second line.