I am a programmer but I hate grammar. Here you will find what I did, doing , will do ... Scattered pieces of knowledge that I have deleted from my mind to the trash bin through out my boring daily coding life. I will also report some of my failures in life so dear to me not success, because I have always learnt much only when I fail.
Saturday, November 26, 2016
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!
Sunday, September 4, 2016
Saturday, September 3, 2016
Friday, August 5, 2016
Monday, August 1, 2016
Sunday, July 31, 2016
Saturday, July 30, 2016
Sunday, July 17, 2016
Saturday, June 18, 2016
Friday, May 27, 2016
Thursday, April 28, 2016
Tuesday, April 26, 2016
Monday, April 18, 2016
Thursday, April 14, 2016
Friday, April 8, 2016
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...
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
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:
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 :
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.
Here are some steps that you may follow to get it running on your device out of the box.
- 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
- Connect your phone to the computer with a USB cable.
- Make sure your phone is open and not locked.
- Open the terminal and navigation to your main project directory. You should now see sometime like the below content. > cd HelloIonicProject
- Adding your current platform - if Android : > ionic platform add android
- Adding your current platform - if ios : > ionic platform add ios
- Now it is time to build our project on it. if android : > ionic build android
- Now it is time to build our project on it. if ios : > ionic build ios
- Your may do this, to copy all the files into the specified platform : > cordova prepare
- Finally run it for android : > ionic run android
- Finally run it for ios : > ionic run ios
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..
> 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
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.
ompi_info
Then it returns a list of information and your Open MPI version information will be shown on first or second line.
Subscribe to:
Posts (Atom)