Today i finally solve a big problem in my current node js project. Actually i have a requirement to write data in existing excel document. I already have an excel so i just need to open it and write some data and then save it. But unfortunately i unable to find a way to do this from a long time. After googling a lot i found a node module "xlsx-populate". Its fulfill my requirement. You can check the more detail about it from git hub link

Below is my server code of nodeJS  :'/writeEmployeeDataExcel',function(req,res){
var data = req.body;
var filename = "alkalmazottak.xlsx"; /**This is my new file name**/
var newfilelocation = "../client/app/downloads/"+filename; /**This is new location of file**/
var readexistingfile = "../client/app/downloads/employeeTemp.xlsx";/**This is existing doc that i want to read**/
var workbook = Workbook.fromFile(readexistingfile, function (err, workbook){
if (err) return res.status(500).send(err);
var sheet = workbook.getSheet(0);
var i=0;
for (var rowNum = 2; rowNum < parseInt(data.length)+2; rowNum++) {
var row = sheet.getRow(rowNum);
var title = (data[i]['title']!='') ? data[i]['title'] : '';
var lastname = (data[i]['last_name']!='') ? data[i]['last_name'] : '';
var firstname = (data[i]['first_name']!='') ? data[i]['first_name'] : '';
var email = (data[i]['email']!='') ? data[i]['email'] : '';
for (var colNum = 2; colNum < 6; colNum++) {
var cell = row.getCell(colNum);
(colNum==2) ? cell.setValue(title) : '';
(colNum==3) ? cell.setValue(lastname) : '';
(colNum==4) ? cell.setValue(firstname) : '';
(colNum==5) ? cell.setValue(email) : '';
fs.exists("../client/app/downloads/"+filename, function(exists) {
if (exists) {



Preview :

Chears :)
Happy coding

I am stuck in a form validation to change password where i need to take a specific length of password (like combination of special characters, alphabets and numbers) from user and confirm it by re-enter password. Actually i am using the ng-pattern property of angular js to match the password of both input boxes but the problem is ng-pattern is only match if your are passing simple string. It don't work to match the string with the special charecters.
See example-

Not Working :

<input type="password" name="password" class="span4" ng-model="user.password" ng-pattern="/^(?=(?:[^A-Z]*[A-Z]){2})(?=[^!@#$&*\%\^\)\(]*[!@#$&*\%\^\)\(])(?=(?:[^0-9]*[0-9]){2}).{8,}$/">

<input type="password" name="password2" class="span4" ng-model="user.password2" ng-pattern="user.password">

Working :

<input type="password" id="password" name="password" ng-model="user.password" ng-pattern="/^(?=(?:[^A-Z]*[A-Z]){2})(?=[^!@#$&*\%\^\)\(]*[!@#$&*\%\^\)\(])(?=(?:[^0-9]*[0-9]){2}).{8,}$/">

<input type="password" name="password2" class="span4" ng-model="user.password2" pw-check="password">

So to match the password of both text boxes input i created a simple directive (pwCheck) below is my compleate code :

Below is my directive :

.directive('pwCheck', [function () {
return {
require: 'ngModel',
link: function (scope, elem, attrs, ctrl) {
var firstPassword = '#' + attrs.pwCheck;
elem.add(firstPassword).on('keyup', function () {
scope.$apply(function () {
var v = elem.val()===$(firstPassword).val();
ctrl.$setValidity('pwmatch', v);

Below is my html code :

<form name="registerForm" id="registerForm" ng-submit="editAccountPassword(user, registerForm)" class="form-horizontal" novalidate>
<div class="modal-body">
<div class="col-md-12">
<span class="alert alert-danger ng-cloak" ng-show="registerForm.password2.$error.pwmatch && !registerForm.password.$error.pattern">Passwords should match !!</span>
<div class="col-md-12">
<span class="alert alert-danger ng-cloak" ng-show="registerForm.password.$error.pattern">Password should be minimum 8 character long and it should contain 2 upper case letters, 1 special character, 2 digits & 1 lower case letter</span>

<div class="widget-content">
<div class="control-group">
<label for="password" class="col-md-4 col-sm-4 col-xs-12 field-name text-padding">New Password</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<input type="password" id="password" name="password" class="span4" ng-model="user.password" required="" ng-pattern="/^(?=(?:[^A-Z]*[A-Z]){2})(?=[^!@#$&*\)\(]*[!@#$&*\)\(])(?=(?:[^0-9]*[0-9]){2}).{8,}$/">

<div class="control-group" ng-class="{'has-error': registerForm.password2.$invalid && registerForm.password2.$dirty}">
<label for="password" class="col-md-4 col-sm-4 col-xs-12 field-name text-padding">{{'Retype New Password' | translate}}</label>
<div class="col-md-8 col-sm-8 col-xs-12">
<input type="password" name="password2" class="span4" ng-model="user.password2" required="" pw-check="password">

Preview :

Happy Coding :)

You want to know why you aren't hired?  It's really simple actually, three things.  See if any one of these is your personal kryptonite:

Not studying 21 hours per week:
It doesn't matter if you are self studying, going through Free Code Camp, or an online boot camp.  If you are not on your computer every night for at least 3 hours, you will never have the technical skills required to land an entry level tech job.  This is the most common mistake I see with people who are trying to break into the tech scene.  Sitting on Twitter or coding chats for 3 hours, sharing "great resources" is not studying.  It's okay to do occasionally, but if that becomes your pattern, you won't get hired anytime soon.

Don't have good people skills:
Only 50% of getting hired for an entry level tech position is technical ability.  The other 50% is people skills and knowing how to market yourself.  The best birthday gift I ever receiveed was a used worn out copy of "How to Win Friends and Influence People" by Dale Carnegie.  My Aunt gave me the book and 1 stick of Wrigleys chewing gum for my 14th birthday.  I guess I was a rude bad breathed teenager :-)  That book changed my life, I always get compliments about my ability to connect with people.  How can you nail interviews if you can't connect with people or you come across as rude?  What's the sweetest sound to any person?  hint: it's in the book ( and no I don't get any kickbacks )

Don't know how to sell yourself:
I learned this skill from listening to an interview of Robert Kiyosaki.  He talked about how he wasn't a great writer, but he was a best selling author!  He made it very clear that he wasn't going to ever challenge the great works of fiction.  He talked about how important it is to understand selling, if you ever want to make serious money.  I am always shocked by how many technical people are way under payed.  I have worked with senior level architects for test automation that were just terrible, yet highly paid.  On the flip side I know many talented and skilled developers who make far below what they are worth.  If you don't learn to sell yourself and abilities, you won't be able to nail interviews or even get interviews in the first place.

There are obviously other things that are important to know, but the above 3 are the most common issues that I see.  It's not rocket science or magic to land a tech job.  People all over the U.S. landed tech jobs today, you can join the ranks by following the above list!  Don't give up, you can do this!

Posted in Uncategorized.