Thursday, 31 December 2015

How to Reset Your Forgotten Windows Password the Easy Way

How to Reset Your Forgotten Windows Password the Easy Way

image[2]
Forgetting your password is never any fun, but luckily there’s a really easy way to reset the password. All you need is a copy of the Windows installation disk and one simple command line trick.

Resetting Your Forgotten Windows Password

Boot off the Windows disk and select the “Repair your computer” option from the lower left-hand corner.
image
Follow through until you get to the option to open the Command Prompt, which you’ll want to select.
image
First you’ll want to type in the following command to backup the original sticky keys file:
copy c:\windows\system32\sethc.exe c:\
Then you’ll copy the command prompt executable (cmd.exe) over top of the sticky keys executable:
copy c:\windows\system32\cmd.exe c:\windows\system32\sethc.exe
image
Now you can reboot the PC.

Resetting the Password

Once you get to the login screen, hit the Shift key 5 times, and you’ll see an administrator mode command prompt.
image
Now to reset the password—just type the following command, replacing the username and password with the combination you want:
net user geek MyNewPassword
image
That’s all there is to it. Now you can login.
Of course, you’ll probably want to put the original sethc.exe file back, which you can do by rebooting into the installation CD, opening the command prompt, and copying the c:\sethc.exe file back to c:\windows\system32\sethc.exe.


Thanks & Regards
Vijay Vishwakarma 

The future of robot off-line programming


Future_of_Offline_Programming
If you drive a car, it makes little difference what brand it is: all cars are driven in essentially the same way. The same applies to computers. If you have a Windows PC, the user interfaces won’t be affected by your computer hardware. But this is definitely not the case for industrial robots.
The way you program an industrial robot strongly depends on the robot brand. You might think that a robot program looks like C++ or Visual Basic. The truth is that some robots are still programmed in assembler-like languages.
Because of the complexity of using an industrial robot, robot integrators and most manufacturers try to limit themselves to a single robot brand. Unfortunately, industrial robot manufacturers don’t offer completely equivalent product ranges, and their offers evolve constantly. Stäubli, for example, is one of the few manufacturers that offers robots suitable for humid environments, while FANUC is the only one to offer a medium-payload collaborative robot. Furthermore, a number of businesses work with calls for tenders. As a result, sometimes manufacturers end up with different robot brands.
The reason why robot-programming languages evolve slowly is probably due to the fact that industrial robots are extremely reliable and durable. Thus, robot manufacturers have to offer backward compatibility.
Further, selling spare parts and additional options is probably as lucrative as selling new robots. For this reason, robot manufacturers probably won’t change the fundamentals of their programming languages. For example, ABB is stuck using quaternions to represent orientation, even though a quaternion is as intuitive as using binary code instead of ASCII. Rather than changing quaternions with Euler angles (like every other robot manufacturer), ABB simply added functions that convert from one convention to the other. Robot programming languages probably looked fine a decade or two ago, but nowadays, engineers are used to modern programming languages like Java, C#, and Python.
FANUC, one of the leading four robot manufacturers, provides not one but two different programming languages: Teach Pendant (or TP) and KAREL. TP programs are binary files that can be edited through the robot’s teach pendant buttons (or touch screen for newer robots). TP files can also be compiled/decompiled from an LS file (human-readable ASCII file) TP programs offer a limited assembler-like functionality. Alternatively, with FANUC, you can program your own algorithms using a PC and KAREL (programming language based on Pascal), but KAREL does not allow you to do robot movements nor edit the program from the controller’s teach pendant.
You can purchase ROBOGUIDE off-line programing and simulation software for about US$2,500/year to off-line program FANUC robots. However, if you don’t have ROBOGUIDE’s WinOLP, you won’t be able to use LS programs unless you also have the option “ASCII Upload” in your FANUC robot controller, a paid software upgrade required for each robot. You also need ROBOGUIDE to edit and create KAREL programs.
Motoman robots are programmed using the INFORM programming language (JBI files). INFORM looks similar to Fanuc’s LS programs. The program variables are registers shared among all programs. However, Motoman also offers MotoCom for all their robots: a well-documented library that allows you to program the robot using C++, C# or Visual Basic (on Windows).
Programming ABB robots is simpler, and based on the RAPID programming language, which looks like Visual Basic. Furthermore, ABB provides RobotStudio, offering on-line programming and an excellent RAPID program editor for free as well as an easy file transfer through a network connection between a PC and the robot. Optionally, you can pay about US$1,500 US/year to have the simulator and offline programming tools.
KUKA robots require SRC programs written in their KRL programming language, usually edited using the free OrangeEdit editor unless you have the KUKA simulator Sim Pro (priced at about US$2,000). It is interesting to note that Kuka’s KRC4 controller is a Windows based computer and the teach pendant is a remote desktop of that computer. It is unpractical to modify programs from the teach pendant as the touch screen feels slow. One notable exception, however, is KUKA’s collaborative robot, LBR iiwa, which uses KUKA’s Sunrise controller and is programmed in Java.
We’ll stop here, because there are dozens of other robot manufacturers from all over the world. Some brands do not have offline programming software (such as Universal Robots); the user is then forced to program robots through the robot controller’s touchscreen (which is highly intuitive, but also very limited) or using an ASCII editor and their UR Script language (based on Python). Other robot manufacturers focus their efforts on having plugins for CAD software, like Mitsubishi who offers MelfaWorks for SolidWorks.
The fact that nobody has taken a step towards unifying the way robots are programmed is very disappointing. G-code was introduced in the 50s, shortly after Numerical Control, and most CNC controllers currently use it. No such common programming language exists for industrial robots.
A few companies offer robot off-line robot programming tools that support multiple robot brands, such as Octopuz, Delmia, Siemens NX, and RobotMaster. However, the price of these software tools ranges between US$15,000 and US$100,000 per license. Clearly, these solutions are too expensive for most small and medium sized companies. Furthermore, some of these software tools target very specific applications (e.g., machining only). The market of used industrial robots is growing steadily and it is now easier to find robots at affordable prices. Some robots still work perfectly even 25 years after they were manufactured. You can currently find used six-axis robots for only US$10,000, but you can’t buy second-hand off-line robot programming tools.
This is why we created RoboDK: a simulator for industrial robots that provides a new way to program industrial robots, more intuitive off-line programming and more affordable. The simulator supports a wide variety of applications, such as pick and place, painting or robot milling (optimization tools are provided to automatically convert CAM programs to robot programs). RoboDK is a spin-off from the CoRo laboratory, one of the largest robotics labs in Canada, where it was tested on all major industrial robot brands.
RoboDK’s library has more than 200 robots from 15 different robot manufacturers and we look forward to continue adding support for new robot brands. Any robot manufacturer is welcome to include their robots in RoboDK’s library, providing an open interface to be able to do off-line programming and online programming as well. Off-line programming is achieved by defining the robot’s brand post processor. The online programming is achieved by developing a robot driver that works as a bridge between the simulator and the robot. Then, it is possible to easily run robot programs step by step, retrieve the robot position or move to a specific position with a robot. This video shows an example with an UR10:
What makes RoboDK unique is that you can program any robot using Python and the RoboDK API. Python offers an immense library of tools for programming (for example, to convert SVG images to XY coordinates that can be followed by robots). You can then use object oriented programming with Python and RoboDK’s API and have code snippets like:
  1. <span style="font-family: consolas;"># robot is an object
  2. # target is a pose (4x4 matrix), defining position and orientation of the TCP
  3. robot.MoveJ(target*transl(0,0,-100)) # Move (joint) to the approach position
  4. robot.MoveL(target) # Move (linear) to the target
  5. CloseGripper() # Custom-defined action, such as grabbing a part
  6. robot.MoveL(target*transl(0,0,-100)) # Move back to the approach position</span>
… which will move the robot to a specific target through an approach position. Many examples are available in our library (with and without Python).
There is no doubt that one day a robot programmer will have the choice to program any robot brand using a universal programming language such as Python. Robot programmers as well as companies prefer this option as they do not depend on brand-specific tools. Kudos to Mecademic, another spin-off of CoRo, who offers the first industrial robot arm that can be controlled with any modern programming language.
RoboDK has been downloaded more than 2,000 times since we launched it in January 2015. RoboDK has also attracted universities as a tool for learning industrial robotics as well as new robot manufacturers all over the world. We also welcome integrators to develop their technology using RoboDK’s API. The advantage is that they can develop their technology with one robot brand and deploy it with any other robot brand.
RoboDK can be tried for free, it will remain free for educational purposes and is the most affordable offline programming solution available.

Monday, 28 December 2015

6 Key Components to Effective Leadership



Much has been written about developing and practicing effective leadership skills. Books by Jim Collins, Stephen Covey, Dale Carnegie, Jack Welch and Lee Iacocca, to name just a few, have addressed this topic from several perspectives. Thousands of articles have also delved into this subject. What this blog suggests is that there are a few skills/traits that are common in the most effective leaders of any organization.

1 Honesty and Integrity

Great leaders create an organizational culture built on these two core values and hold all employees accountable to them. Without honesty and integrity as fundamental cornerstones of an organization, they will rarely succeed long term. And creating such a culture starts at the top of the organization. Everyone watches the leader and takes their cues as to what is acceptable behavior.
Effective leaders must also be trustworthy. They are recognized for always telling the truth and for practicing the highest standards of ethical conduct. Subordinates believe them and do not feel that their leader has hidden agendas. Good leaders readily admit their mistakes. Although difficult to do, this shows they are honest and can be trusted.
Great leaders show they have the best interests of the company in mind rather than their own personal gain, by making good on their commitments. They hold themselves accountable for their actions and decisions, and encourage their employees to do likewise.
Transparency is also important, even when there is bad news to share. Employees know when things are not going well. Trying to put a positive spin without acknowledging the organization’s difficulties will cost the leader his or her credibility. Sharing both the bad and the good creates deeper trust and respect.

2 Outstanding Self Awareness

A leader must understand their own strengths and weaknesses. All of us have faults and instinctive behaviors that produce unintended results and/or consequences. It is critical for a leader to really know themselves, admit their shortcomings and ask for their help in addressing them. This demonstrates humility and humanizes the leader. No one is perfect and if a leader acts like they are, they will lose credibility and trust. In the worst case they will be seen as arrogant and intimidating.
Great leaders seek and welcome feedback and dissenting opinions. They encourage different perspectives and challenge conventional thinking. They create healthy discussions and debates, but also know when to move the conversations forward. And they are able to maintain their composure in difficult/stressful situations.
Effective leaders practice servant style leadership, trusting subordinates to do their jobs and providing them the necessary resources and guidance that allows them to do their jobs successfully and efficiently. Obviously different situations may require different management styles. An authoritative style may be necessary in some situations, especially during a crisis. But more often, a servant leadership style that demonstrates that leaders are there to help rather than simply telling others what to do, produces far better results.
Great leaders demonstrate empathy, show humility and genuinely care about others. Taking time to listen to associates and their ideas, learning something personal about subordinates and their families and asking for their opinions are wonderful examples of how to do this well.
Finally, getting 360 degree feedback from your team about your leadership strengths and weaknesses is essential to creating good self awareness.

3 Vision

Outstanding leaders see the whole picture and do not get too focused on specific tasks or initiatives. They have deep knowledge of related industries/organizations and are seen as strategic thinkers. They often have strong networks and consistently identify important trends early in their life cycle. They are very good at communicating a vision of the future and getting organizational buy-in.
Strong leaders know their target customers, understand the organization's value proposition and also, its competitive weaknesses. They focus on enhancing core competencies of the organization and developing the skills and capabilities that will enhance their value proposition.
They are excellent at establishing clear goals and objectives for the organization, and for their direct subordinates. Importantly, they are also able to provide clear and convincing rationale that supports their vision of the future.

4 Courage

To have courage requires confidence. The best leaders are very confident in themselves and their ideas, which allows them to be decisive. But, they must be able to exude that confidence without conveying arrogance or intimidation!
Great leaders have the ability to make tough decisions and are willing to take risks, even when conventional wisdom would dictate otherwise. They must be willing to stand alone if they believe in their convictions. This is directly related to their visionary skills, strategic thinking and their self confidence.
They are also able to recognize when they need the expertise or knowledge of others and are not afraid to admit it.

5 Communication Skills

Great leaders do not have to be great orators or exceptional writers. What is required is that they are inspirational and persuasive. They can speak and write to the audience’s level, focusing on the WIFM (“What’s in it for me”). They communicate in a way that generates buy-in and willing followers. Because if you can’t succeed in doing those two things, you cannot effectively lead.
Good leaders must always be truthful, even delivering the bad news when appropriate. But, they generally exude a positive attitude and are seen as optimistic, even in the most troubling of times.
Even if they do not have a professional background or training in sales, leaders often exhibit elements of effective selling skills. They have the ability to advance their ideas in a logical and understandable way to all levels of the organization.

6 Team Builder

Great leaders must have outstanding team building skills. This requires first and foremost the ability to attract and retain top talent.
Every great leader knows they cannot do it alone and that having the best talent enhances the opportunity for success. They know they need to build a team with complementary skill sets and experiences and constantly look to bring in people that know more than they do (this is because they are confident).
Importantly, they also understand that a team performs best when its members have differing personalities and styles, to expand perspectives when problem solving and avoid getting caught up in “group think.”
A good leader is often more of a facilitator of the team, able to generate healthy discussions and generate consensus. Great leaders know that if the team believes in, and is committed to a strategy or plan, the chance of success goes up immensely. The team becomes passionate about doing what they said they would do. Conversely, when a team feels that the leader will force them to do what he or she thinks is best, innovation is lost and there is little passion.
The best leaders are highly organized and trust the team members to do their respective jobs. The leader becomes a delegator, setting clear expectations and providing on-going feedback.
Finally, effective leaders regularly and publicly recognize others. They are quick to accept blame for failures, even when they may have not been directly responsible. And are just as quick to give others credit for successes rather than themselves.


Saturday, 26 December 2015

5 Best Practices for Integrating Small-Medium Size Businesses

The Current Mergers and Acquisitions Marketplace

As the economic recovery from the “Great Recession” has been considerably slower than expected, companies have increasingly turned toward mergers and acquisitions as a way to accelerate sales growth and improve market share. Consequently, both the number and pace of M&A transactions have risen rapidly over these last three years.
Unfortunately, the data suggest that the vast majority of these deals will not deliver the value that was originally projected. Even worse, many of these acquisitions will actually fail!
However, you can avoid such failure by following 5 best practices, especially when integrating small-medium size businesses:


#1: Understand the Cultural Fit

Cultural fit can break an acquisition
If you decided to acquire a company, and they agreed, there was likely an obvious strategic fit. Assuming the appropriate due diligence was conducted, a mutually beneficial financial agreement was also reached. However, those were the easy parts of the transaction. Most mergers/acquisitions fail because there was not a good cultural fit.
It is critical to deeply explore the culture of a potential acquisition and assess how that culture fits with that of your own business. Remember, the culture starts at the top of the organization and permeates all levels of the company. Even if the acquired company’s owner/CEO is not staying on board post acquisition, the culture that leader created over the years will remain. If that culture conflicts with yours, you should consider abandoning the deal!
Trust me, I speak from experience! We have made the mistake of thinking we could change the culture of an acquired company, and we have suffered the resulting consequences. By the time you impose your culture on the new company, many key people will have either left of their own volition or because you decided to terminate them. In a small-medium size business, most of the value is tied directly to the employees that work there. If several leave for any reason, the sustained value of that business is severely jeopardized.

#2: Communicate, Communicate, Communicate

Frequent communication is vital
It is impossible to over-communicate with both your existing and newly acquired employees post acquisition. Communication is the first step in establishing trust with the new employees and to clear up any misperceptions with your existing ones.
First, prior to beginning due diligence, appoint a communications team that will be on-site several times during the first year post acquisition. This team will be the cornerstone of developing trust with the new employees, demonstrating the culture of your company, and identifying best practices that can be deployed elsewhere in the business.
Second, remember that the first time you address the newly acquired employees, they will not hear anything! They will be in a state of shock and will only be concerned about how this change will impact their personal lives. They will be assuming the worst and immediately be worried about their employment security, their compensation, their benefits, and how they will explain this to their family and friends.
Even telling them that they will keep their jobs, maintain their current compensation levels, and receive better benefits won't allay their concerns and anxieties. They simply won't hear you, or believe you. Therefore, your communication strategy must focus on telling them the same things repeatedly and consistently.
HR, the communications team, and - especially - the CEO must be very visible for the first several months, getting to know each employee personally. These one-on-one interactions will pay dividends for years as they begin to learn about, and later, trust their new leaders. Having the personal eye-to-eye contact and showing the willingness to listen to them (as opposed to telling them what you think they want to hear) cannot be overstressed.
Third, don't forget about communicating with your existing employees about this new acquisition. They will be interested to learn more about the group, what they do, how they fit strategically within the company, and how this might also affect their employment. They actually may have many of the same fears and anxieties as those of the newly acquired employees!

#3: Educate - Play the Role of a Coach

Provide examples and positive reinforcement
As executives, we often make the mistake of assuming the new owners or managers understand and know how to do many of the employee relations and administrative tasks that we take for granted. We forget that many of those things, and the jargon we use to describe them, have been incorporated in our culture for years. Some examples are things like:
  • Strategic planning
  • Performance management
  • Budgeting and forecasting
  • Company policies and procedures
  • Servant leadership
  • Succession planning
  • Information sharing
  • and management practices/traditions.
The acquired company may have been doing some or all of these things, but perhaps not in the same way or with the same convictions as you.
It is important to play the role as a teacher/coach during the first couple of years post acquisition to assist the management of the newly acquired company. Show them how to do it the first time, or at least provide examples they can use as templates. Encourage them to try these new processes while letting them know you will be there to help if needed. This will speed integration, build trust with new management, and infuse your culture into the new company more quickly.

#4: Listen

Encourage feedback
The newly acquired company succeeded and had value because they were doing many things right. We should remind ourselves that it will be far more important to listen to their ideas and feedback than to tell them how good we are, or why our way is better.
Best practices in both companies should be identified and shared to attain maximum value post-acquisition. Listening to their questions, concerns, and suggestions is far more important than telling them about how successful your company has been!

#5: Follow Through on Promises

Follow through on your promises
Be careful what you say, because all eyes will be watching to see if you keep your word. One slip-up and your credibility is doomed! If a promise or commitment is made, it must be followed through. The integrity of the organization is at stake, as is yours as a leader!

The Integration of Sales & Marketing

Historical Perspective

Many of us grew up in a business model where sales and marketing were considered two separate functions:
  • Sales was responsible for identifying, qualifying, creating and managing customer relationships. They were the “face-to-the-customer” and were accountable for achieving the sales goals of the company.
  • Marketing was responsible for branding, advertising, lead generation, printed collateral, trade show exhibits and promotional items. It primarily served in a sales support function and operated as a separate “silo” in the corporate organizational structure.
This model has existed for decades with very little change, even though all other aspects of business were changing dramatically with the advancement of technology. Think of advanced manufacturing, lean principles, quality control initiatives, supply chain management, enterprise software implementation, outsourcing, etc.
So is that old sales and marketing model still applicable today? I think not!

Changing Customer Expectations

Let’s be totally honest. Customer expectations have changed dramatically over the last decade. First, they have neither the time nor the desire to see “salespeople.” Just ask any of your salespeople how easy is it to get an appointment to see a customer these days.
Instead they want trusted partners that can provide them a solution to their problem, and only when they need it. And how do they find and determine who those potential trusted partners might be? That’s right - through a Google search. This trend will only accelerate as our younger workforce takes a more prominent role in making supplier and purchasing decisions. Did you know that Millennials now outnumber Baby Boomers?
That means that customers are increasingly relying on generic web searches to find what they need. If your website does not provide a great customer experience, one that has the information they need and is easily navigable and intuitive, they will move on quickly.
Also, customers want access to information 24/7 with the ability to see technical content, price and availability information in real time, and on any one of a myriad of mobile devices. Can a customer place an order in your business system directly from their mobile phone at 11pm?

Re-engineering Sales Processes

All of these changing behaviors and expectations forces us to re-evaluate and reengineer our sales processes. Customers expect to be able to engage with us in multiple ways. No longer does “one-face-to-the-customer” work. They want 24/7 access to information through eCommerce and web portal options, immediate and technically competent phone assistance, and partners who can help assess their business challenges and suggest potential solutions.
At Cross Company, we have re-engineered our sales processes to provide multiple channels for customer access as follows:
Cross Company's Channels to Market | Copyright 2014 All Rights Reserved

Inbound Vs. Outbound Marketing

Another change that has taken place is the transition from outbound marketing techniques to inbound marketing. Mass mailings and email blasts, although still used, are far less effective as lead generation strategies. Instead, customers will find you - or your competitor - when they need something.
Again, they default to the internet to accomplish this. They conduct searches and make decisions based on their experiences with selected websites. Making sure your website is near the top of page one of a search is critical. Thus Search Engine Optimization (SEO) is so important. To maximize your SEO, you must stay abreast with the Google algorithms used to determine positioning. A well designed website with rich content that is constantly updated and expanded is the minimum price of admission. Blogs, videos and whitepapers will significantly increase traffic to your website. Constantly evaluating your website’s performance using analytics is also essential.
Customers will also research salespeople on the internet before agreeing to meet with them. Will they find an interesting, knowledgeable person? Are your salespeople’s LinkedIn profiles professional and contain a clear value proposition? Have they published blogs, videos and whitepapers that lend credibility to their expertise? Can they afford not to take this opportunity to differentiate themselves from their competition?
Our experience with this transition to inbound marketing has been profound. We have been contacted by customers that we had never called on or known, informing us that they had selected us to be their partner on specific projects. This has resulted in significant orders and is one of the main reasons we are outperforming the market.

eCommerce Strategy

As already mentioned, customers are increasingly demanding to transact business through an easy to use, intuitive, Amazon-like webstore. If you do not provide them this option, you will lose customers!
A successful eCommerce webstore starts with SEO positioning. Without it, they will never find you. You will likely have to spend advertising dollars to initially drive traffic to your site.
It also requires high-quality digital photos of products, complete and accurate product descriptions, technical specifications, pricing, availability and recommendations of complementary products. It must be easy to view on a mobile device of any size and load quickly.
Building a successful eCommerce platform takes work and investment. Without both, it will fail.

Sales & Marketing Are Now Joined As One

Clearly there is a confluence of sales and marketing departments taking place. One is no more important than the other, and in today’s environment they cannot succeed without each other.
It will become increasingly difficult to generate sales growth relying solely on an outside sales team. They will need modern marketing to help create professional looking content and SEO positioning to create inbound leads. They will need to collaborate to differentiate themselves from their competition.
In turn, marketing will need highly trained and specialized sales teams to provide telephone support and customized onsite services. Marketing will also need their technical expertise and industry experience to create the rich content needed to drive traffic to their websites and webstores.
In the final analysis, they can no longer act like independent silos in an organization. They, along with their IT teammates (think eCommerce integrated with ERP business systems and CRM software) are now joined as one. They must all work together for a company to maximize its sales potential.
Please let me hear your thoughts on this subject.

Friday, 25 December 2015

Online Payment System with BrainTree PayPal using PHP

Are you working for e-commerce project? Then you should have a better and secure payment system. I suggest you setup you project with BrainTree API, it is very powerful and quick. This is accepting most commonly used Cards, PayPal, Android Pay and etc. This post will explain you how to design a cart and order system with BrainTree payment process using PHP and MySQL. Take a quick look the live demo and try demo transaction.

Payment System with BrainTree PayPal using PHP


Download Script     Live Demo

Database Design
To build the eCommerce system, you have to create four basic tables such as Users, Producs, Orders and Cart.

User Table
User table contains all the users registration details.
CREATE TABLE Users(
user_id INT  PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(50),
password VARCHAR(100),
email VARCHAR(100)
);

Payment System User Table

Products Table
This contains all of the product details.
CREATE TABLE Products(
product_id INT PRIMARY KEY AUTO_INCREMENT,
product_name VARCHAR(200),
product_desc TEXT,
price FLOAT
);

Payment System Products Table

Orders Table
User successful orders store here with BrainTree status code.
CREATE TABLE Orders(
order_id INT PRIMARY KEY AUTO_INCREMENT,
user_id_fk INT,
created INT,
price FLOAT,
FOREIGN KEY(user_id_fk) REFERENCES Users(user_id)
);

Payment System Orders Table

Payment System with BrainTree PayPal User table design

Cart Table
This table contains all the user cart details. Cart order_id_fk is a foreign key, it references to Orders order_id. This will update once the user Order is successful.
CREATE TABLE Cart(
cart_id INT PRIMARY KEY AUTO_INCREMENT,
product_id_fk INT,
user_id_fk INT,
order_id_fk INT,
cart_status enum('0','1') DEFAULT '0',
FOREIGN KEY(product_id_fk) REFERENCES Products(product_id),
FOREIGN KEY(user_id_fk) REFERENCES Users(user_id),
FOREIGN KEY(order_id_fk) REFERENCES Orders(order_id)
);

Payment System Cart Table

Payment System with BrainTree PayPal cart database design

Payment Form & System Design
This project contains three folders called js,includes and uploads with PHP files.

braintree
-- braintree.php //BrainTree library file
js
-- jquery.min.js
-- jquery.creditCardValidator.js
index.php
cardProcess.php
functions.php
db.php

Payment form contains Card Number, Card Name, Expiry Date and CVV(Secure Number).

Payment System with BrainTree PayPal cart database design

HTML5 Code
Simple HTML5 code
<form method="post"  id="paymentForm">
Payment details
<ul>

<li>
<label>Card Number </label>
<input type="text" name="card_number" id="card_number"  maxlength="20" placeholder="1234 5678 9012 3456"/>
</li>
<li>
<label>Name on Card</label>
<input type="text" name="card_name" id="card_name" placeholder="Srinivas Tamada"/>
</li>
<li class="vertical">

<ul>
<li>
<label>Expires</label>
<input type="text" name="expiry_month" id="expiry_month" maxlength="2" placeholder="MM" />
<input type="text" name="expiry_year" id="expiry_year" maxlength="2" placeholder="YY" />
</li>
<li>
<label>CVV</label>
<input type="text" name="cvv" id="cvv" maxlength="3" placeholder="123" />
</li>
</ul>

</li>
<li>
<input type="submit" id="paymentButton" value="Proceed" disabled="true" class="disable">
</li>
</ul>
</form>
<div id="orderInfo"></div>

CSS Code
*{margin: 0px; padding:0px;}
ul {list-style: none;}
label{padding:8px 0px 8px 0px;}
#paymentForm label
{
color: #555;
display: block;
font-size: 14px;
font-weight: 400;
}
#paymentForm input[type=text]
{
background-color: #FFFFFF;
border: 1px solid #E5E5E5;
color: #333333;
display: block;
font-size: 18px;
height: 32px;
padding: 0 5px;
width: 275px;
}
#paymentForm li {margin: 8px 0;}
#orderInfo{display:none}
.disable{opacity: 0.2}
.vertical li
{
float: left;
width: 140px;
}

JavaScript
Validating the payment form using Regular Expressions.
<script src="js/jquery.min.js"></script>
<script src="js/jquery.creditCardValidator.js"></script>
<script>
$(document).ready(function()
{
/* Form Validation */
$("#paymentForm input[type=text]").on("keyup",function()
{
var cardValid=$("#card_number").attr('rel');
var C=$("#card_name").val();
var M=$("#expiry_month").val();
var Y=$("#expiry_year").val();
var CVV=$("#cvv").val();
var expName =/^[a-z ,.'-]+$/i;
var expMonth = /^01|02|03|04|05|06|07|08|09|10|11|12$/;
var expYear = /^16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31$/;
var expCVV=/^[0-9]{3,3}$/;

if(cardValid>0 && expName.test(C) && expMonth.test(M) && expYear.test(Y)
&& expCVV.test(CVV) && parseInt(cardCheck)>0)
{
$('#paymentButton').prop('disabled', false);
$('#paymentButton').removeClass('disable');
}
else
{
$('#paymentButton').prop('disabled', true);
$('#paymentButton').addClass('disable');
}
});

/* Card Validation */
cardValidate();

/*Payment Form */
$("#paymentForm").submit(function()
{
//.......
});

});
</script> 

Card Validation
Credit Card Validation using jquery.validateCreditCard plugin.
/* Credit Card Type Check */
function cardValidate()
{
$('#card_number').validateCreditCard(function(result)
{
var N=$(this).val();
var C=$(this).attr("class");
$(this).attr("class","");
if(result && N.length>0)
{
$(this).addClass(result.card_type.name);

if(result.valid && result.length_valid && result.luhn_valid)
{
$(this).addClass('valid');
$(this).attr("rel","1");
}
else
{
$(this).attr("rel","1");
}

}
else
{
$(this).removeClass(C);
}
});
}


Ajax Payment Process
BrainTree Payment process with Jquery Ajax, here $(this).serialize() get all the form input values and posting to cardProcess.php. Once order is successful, use will get the Order status message.
/*Payment Form */
$("#paymentForm").submit(function()
{
var datastring = $(this).serialize();
$.ajax({
type: "POST",
url: "cardProcess.php",
data: datastring,
dataType: "json",
beforeSend: function(){  $("#paymentButton").val('Processing..') },
success: function(data)
{
$.each(data.OrderStatus, function(i,data)
{
var HTML;
if(data)
{
$("#paymentGrid").slideUp("slow");
$("#orderInfo").fadeIn("slow");

if(data.status == '1')
{
HTML="Order <span>"+data.orderID+"</span> has been created successfully.";
}
else if(data.status == '2')
{
HTML="Transaction has been failed, please use other card.";
}
else
{
HTML="Card number is not valid, please use other card.";
}

$("#orderInfo").html(HTML);
}
});
},
error: function(){ alert('Network Error'); }
});
return false;
});

BrainTree Integration
Create a sandbox account at sandbox.braintreegateway.com for testing process.

Payment System with BrainTree PayPal using PHP

Go to Account -> My User scroll down you will find API keys.
Payment System with BrainTree PayPal using PHP

You will find merchantId, publicKey and privateKey
Payment System with BrainTree PayPal using PHP
cardProcess.php
Here you have to modify with your BrainTree merchandID, pulicKey and privateKey. This is update Orders table, once the transaction is successful. Always maintain/store cart total price value in session. Once testing is done, you can modify environment value from sandbox to production.
<?php
include 'db.php';
include 'functions.php';
$session_price =$_SESSION['session_price']; //Cart Total Price 
if($_SERVER["REQUEST_METHOD"] == "POST" )
{
$card_number=str_replace("+","",$_POST['card_number']);
$card_name=$_POST['card_number'];
$expiry_month=$_POST['expiry_month'];
$expiry_year=$_POST['expiry_year'];
$cvv=$_POST['cvv'];
$expirationDate=$expiry_month.'/'.$expiry_year;

require_once 'braintree/Braintree.php';
Braintree_Configuration::environment('sandbox'); // Change to production
Braintree_Configuration::merchantId('Merchant_ID');
Braintree_Configuration::publicKey('Public_Key');
Braintree_Configuration::privateKey('Private_Key');
//BrainTree payment process
$result = Braintree_Transaction::sale(array(
'amount' => $price,
'creditCard' => array(
'number' => $card_number,
'cardholderName' => $card_name,
'expirationDate' => $expirationDate,
'cvv' => $cvv
)
));

if ($result->success)
{
if($result->transaction->id)
{
$braintreeCode=$result->transaction->id;
updateUserOrder($braintreeCode,$session_user_id,$session_price); //Order table update. 
}
}
else if ($result->transaction)
{
echo '{"OrderStatus": [{"status":"2"}]}';
}
else 
{
echo '{"OrderStatus": [{"status":"0"}]}';
}
}
?>

Update User Order
This will update orders table, based on the BrainTree status code. Cart table status will change 0 to 1 with order id.
<?php
function updateUserOrder($braintreeCode,$session_user_id,$session_price)
{
$db = getDB();
$sql = "INSERT INTO Orders(user_id_fk,created,braintreeCode)VALUES(:user_id,:created,:braintreeCode)";
$stmt = $db->prepare($sql);
$stmt->bindParam("user_id", $session_user_id);
$time=time();
$stmt->bindParam("created", $time);
$stmt->bindParam("braintreeCode", $braintreeCode);
$stmt->execute();

$sql1 = "SELECT order_id FROM Orders WHERE user_id_fk=:user_id ORDER BY order_id DESC LIMIT 1";
$stmt1 = $db-> prepare($sql1);
$stmt1-> bindParam("user_id", $session_user_id);
$stmt1-> execute();
$OrderDetails = $stmt1->fetchAll(PDO::FETCH_OBJ);
$order_id=$OrderDetails[0]->order_id;

$sql2 = "UPDATE Cart SET order_id_fk=:order_id,cart_status='1',price=:price WHERE cart_status='0' AND user_id_fk=:user_id";
$stmt2 = $db-> prepare($sql2);
$stmt2-> bindParam("user_id", $session_user_id);
$stmt2-> bindParam("order_id", $order_id);
$stmt2-> bindParam("price", $session_price);
$stmt2-> execute();
$db = null;
echo '{"OrderStatus": [{"status":"1", "orderID":"'.$order_id.'"}]}';
}
?>

Get User Cart Details
Getting card details based on user session id.
<?php
function getUserCartDetails($session_user_id)
{
$db = getDB();
$sql = "SELECT P.product_name,P.price FROM Users U, Cart C, Products P WHERE U.user_id=C.user_id_fk AND P.product_id = C.product_id_fk AND C.user_id_fk=:user_id AND C.cart_status='0'";
$stmt = $db->prepare($sql);
$stmt->bindParam("user_id", $session_user_id);
$stmt->execute();
$getUserCartDetails = $stmt->fetchAll(PDO::FETCH_OBJ);
$db = null;
return $getUserCartDetails;
}
?>

Live Demo


db.php
You have to modify username, password and databaseName values. Make sure enable PDO extension in PHP.ini.
<?php
function getDB() {
$dbhost="localhost";
$dbuser="username";
$dbpass="password";
$dbname="databaseName";
$dbConnection = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass);
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $dbConnection;
}

/* User Sessions */
session_start();
$session_user_id=$_SESSION['user_id'];

Thursday, 24 December 2015

Microsoft Excel 2010: Advanced Training

Course Description

A Verifiable Certificate of Completion is presented to all students who undertake this Excel course.
This Excel 2010 advanced training course, follows up from the Beginners Excel 2010 course by delving even deeper into the features and functions of this powerful spreadsheet software.
Microsoft Excel 2010 is much more than a quick way to add up numbers. In this online course, you will learn advanced features such as nesting IF statements, how to calculate the Mean of a group of numbers using AVERAGEIF, SUMIF and more. You will learn about performing lookups with HLOOKUP and VLOOKUP. This tutorial also covers Sparklines, and goes in-depth with Pivot Tables and Charts. Finally, you will learn how to create and record your own Macros.
This advanced Excel video course is not for beginners. You should have a firm grasp of the basics before taking this Advanced Excel training course. By the conclusion of this advanced computer software tutorial for Microsoft Excel 2010, you will have mastered the advanced features and functions of this software. Working files are included to allow you to follow along with the same Excel files the author trains you with.
Full details

What am I going to get from this course?

  • Over 135 lectures and 8.5 hours of content!
  • Learn Advanced Microsoft Excel 2010 from a professional trainer from your own desk.
  • 136 lectures (8.5 hours of content) teaching you lookups, advanced IF statements, Macros, Sparklines, and much more!
  • Suitable advanced Excel users. ideal for users who learn faster when shown.
  • Visual training method, offering users increased retention and accelerated learning.
  • Breaks even the most complex applications down into simplistic steps.

Curriculum

Section 1: Getting Started With This Excel Course
Working Files - Download These First
Text
How Advanced Does The Advanced Get?
Preview
04:57
Using The Included Excel Files
Preview
01:41
New In Excel 2010 - The Sparkline
Preview
03:36
Section 2: The Excel IF Function
The Syntax Of IF
Preview
06:02
Nesting The IF Statement In Excel
Preview
06:45
Use The AND Operator To Reduce Quantity Of Nested IFs
Preview
04:09
Use The OR Operator To Reduce Quantity Of Nested IFs
Preview
03:17
The NOT Operator Within AND And OR Statements
Preview
02:47
SUMIF For Selective Adding Up
Preview
05:04
COUNTIF For Selective Counting
Preview
03:52
AVERAGEIF For The Mean Of Cells That Meet Our Criteria
Preview
02:34
Multiple Criteria Within The Same SUM AVERAGE And COUNT Functions
Preview
07:17
Section 3: Performing Lookup in Excel
VLOOKUP Explained
Preview
03:43
Applied Examples for VLOOKUP
Preview
10:03
HLOOKUP Explained
Preview
03:01
HLOOKUP In Action
Preview
06:37
Looking For A Near Match In A Lookup
Preview
04:51
Checking For Missing Data In A Lookup
Preview
05:45
Extending The Size Of A Lookup Table
Preview
04:14
Nested LOOKUPs In Excel
Preview
04:28
Section 4: Excel Data Functions
The MATCH Function Explained
08:14
The INDEX Function Syntax
05:06
How To Stop Nonexistent Row Or Column Lookups In INDEX
02:41
The CHOOSE Lookup Function
02:37
Section 5: Excel Math Functions
Working With TIME
05:55
Rounding To Fractional Values
03:35
MOD For Working Out Remainders
02:18
Generating A Random Number
02:33
Pick A List Item At Random
03:05
Calculating Loan Repayments Using PMT
02:55
Excel - Investment Calculations Using PMT
02:59
Working Out Depreciation
04:21
Working Out Different Parts Of A Loan Calculation
04:58
Section 6: Arrays In Excel
What Is An Array And An Array Formula
03:00
Creating And Using An Array Formula
03:29
Conditional Evaluation In An Array Formula
03:42
The Very Clever TRANSPOSE Array Function
03:32
Section 7: Excel Functions For Working With Text
LEN And TRIM Two Very Useful Text Functions
02:44
Using LEFT And RIGHT For String Extraction
03:36
FIND And MID Working Together To Extract Parts Of Strings
04:15
Build Strings From Multiple Cells
03:58
Excel - Changing The Case Of Text In Cells
02:56
REPLACE And SUBSTITUTE In Action
05:12
Formatting Numeric Values With A Text String Using TEXT
05:09
Extracting The Values From The Text Functions We Have Used
03:00
Section 8: Other Useful Excel Functions
Welcome To IS Functions
02:45
Error Checking With ISERR ISERROR ISNA And IFERROR
08:06
The OFFSET Formula Explained
03:17
Dynamic Named Ranges Using The OFFSET Function
05:48
Use The INDIRECT Function To Build Dynamic Formulas
05:59
Dealing With INDIRECT Errors
01:46
Use Formulas To Determine An Excel Filename And Or Sheet Name
05:43
Section 9: Sparklines
Creating A Sparkline In Excel
03:06
Change The Design Of Sparklines
03:38
Dealing with Empty Cells
01:57
Comparing One Sparkline To Another by Altering Vertical Scale
02:57
Removing Sparklines From A Sheet
01:35
Section 10: Outlining
Outlining Explained
02:35
Creating An Outline Automatically
02:34
Creating An Outline Manually
02:58
Manually Removing Data From An Outline
03:25
Removing The Outlining From A Worksheet
00:55
Adjusting A Grouping Created By Automatic Outlining
03:54
Section 11: Custom Views In Excel
Creating A Custom View Of A Worksheet
02:48
Changing From One Custom View To Another
01:34
Editing A Custom View
01:14
How To Delete A Custom View
01:20
Section 12: Scenario
Setting Up A Scenario And Entering Values
04:17
Display The Scenario Values
02:01
Editing The Values Of A Scenario
01:32
Deleting A Scenario
01:06
Merge Scenarios From Different Sheets
02:13
Getting A Summary Of All Scenarios
04:28
Section 13: Auditing And Troubleshooting Formulas
Description Of Tracer Arrows
01:00
Tracing Precedents And Dependents
02:56
Remove Tracer Arrows
01:54
Error Checking Using Auditing Tools
04:23
Step By Step Processing Of Formula To Help With Troubleshooting
02:55
Excel - Utilizing The Watch Window
03:48
Section 14: Pivot Tables In Excel
What Is A Pivot Table
04:19
Steps To Create A Pivot Table In Excel
06:56
Rearranging Fields In A Pivot Table
03:50
Changing The Math Of The Data Summary
03:03
Number Format Control Of The Summary Area
03:17
Creating A Second (Or More) Pivot Table On The Same Data
03:01
Moving A Pivot Table
03:05
Removing A Pivot Table
01:55
Making Use Of The Report Filter Option
05:47
Sorting A Pivot Tables Columns
03:30
Displaying Values As A Percentage
05:00
Refreshing A Pivot Table Manually Or Semi-Automatically
02:56
Drilling Down Behind The Pivot Table Summaries
04:06
Applying Pivot Table Styles
03:14
Creating Your Own Custom Pivot Table Style
03:39
Copying A Pivot Table Style Between Workbooks
02:13
Using More Than One Field In Row And Column Headings
05:01
Disabling And Enabling Grand And Sub Totals
05:53
Filtering Columns And Rows Within A Pivot Table
06:08
Dealing With Empty (NULL) Cells
02:25
Exploring The Additional Pivot Table Options
04:07
Introducing The Slicer Tool
03:54
Managing Your Slices
03:25
Formatting Your Slices
03:07
Connecting A Pivot Table To SQL Server
05:27
External Connection Refresh Rate And Password Saving
02:20
Section 15: Excel Pivot Charts
Creating A Pivot Chart
04:26
Altering Chart Types Formats And Layouts
03:10
Advanced Layout Control Of A Pivot Chart
04:25
Filtering A Pivot Chart
03:14
Hiding Pivot Chart Elements
02:24
Moving A Pivot Chart Between Sheets
02:57
Deleting A Pivot Chart (With Care)
02:40
Section 16: Goal Seek And Solver
Using Goal Seek To Carry Out What If Analysis
07:17
Using SOLVER To Carry Out What if Analysis
05:23
Excel - Activating The SOLVER Add In
02:13
Add Constraints Into A SOLVER Problem
05:25
Alberts Cafe Solver Solution
08:13
Section 17: Macros In Excel
What Is A Macro
02:35
Creating Storing And Running Your First Macro
05:29
Using Relative Or Absolute Referencing During Recording
03:53
Saving Workbooks With Macros Issues
02:49
Opening Files Containing Macros
04:11
The PERSONAL Workbook
01:21
How To Delete Macros
02:46
Use A Macro For Formatting
02:36
Trigger A Macro With A Keyboard Shortcut
03:16
Using Form Buttons To Trigger Macros
02:42
Customizing The Form Buttons In Excel
03:15
Assigning Macros To Ribbon Icons
03:17
Create Your Own Ribbon
03:17
Remove Options From Ribbons
02:00
View And Edit Macro Code
03:54
Add A Confirmation Dialog Box To Macros
04:05
How To Get The Excel Working Files
00:16

The Future of Remote Work, According to Startups

  The Future of Remote Work, According to Startups No matter where in the world you log in from—Silicon Valley, London, and beyond—COVID-19 ...