How to prepare for a JAVASCRIPT interview

How to prepare for a JAVASCRIPT interview


  1. JS internal working - example event loop
  2. Closure
  3. Tricky syntax questions
  4. Promise and Observables
  5. Object Oriented Programming in JS
  6. Define, compare or explain ES5, ES6 and JS etc

How to prepare for JAVA interviews

How to prepare for JAVA interviews

Generally you would have heard the Job description  for a JAVA developer like the following lines:
 
Below is the job role open for

1. Strong programming expertise in java and j2ee, (It means you should be Good with multi-threading, collections, JVM and its internal working)
2. Strong with Data Structures and Algorithms (It means you should know about sorting, searching, B-Tree, etc techniques )
3. Good with Design and Design Patterns (should follow SOLID principles of programming)
4. Very good communication skills (should be a clean coder and should be able to read and write code which is readable)
5. Strong analytical and logical skills (should be able to remove redundant code from the existing system every now and should be able to improve the time complexity and data complexity of the code.)

 

Here's a simplest list of topics to prepare on before attending any JAVA interview.

  1. JVM Internal working
  2. Threading
  3. JAVA 8 - Lambda, functional interface's, Streams and other new features
  4. Collections and Collections internal working
  5. Tricky syntax and trick questions
  6. Design Patterns
Will soon elaborate on the above points for a better explanation on them, stating why.

How to Install latest angular version

Its pretty much easy and here's a list of steps for a beginner:

  1. Install latest nodeJS from https://nodejs.org/en/download/
  2. Incase if nodeJS is already installed then update your npm with command "npm update" 
  3. Install the latest angular-cli on global level using command "npm install -g @angular/cli@latest", This command is also required if you already have angular-cli older version installed, it will update it to the latest version for new project. As of now Angular 8.0.3 is the latest version.
  4. Once you install the latest angular-cli then run "ng new your-project-name-goes-here" with what ever options you like. To know more about the available options list visit https://angular.io/cli/new

PHP Code for Web / Content Scraping

Hi,

Today I am happy to share you a PHP code snippet / sample which scraps web content from website's far more faster then you think. Although this is just a sample, but you can code a awesome extension for your website or system which reads multiple website's in no time for new and better content.


Simple PHP Scraper
PHP has a DOMXpath function. I’m not going to explain how this function works, but with the script below you can easily scrape a list of URLs. Since it is PHP, use a cronjob to hourly, daily or weekly scrape the desired data. If you are not used to creating Xpath references, use Chrome plugin by selecting the data point and see the Xpath reference directly.

<?php
error_reporting(0);

$arr = array('URL_LINKS_GOES_HERE1','URL_LINKS_GOES_HERE2'); // insert list of URLs to scrape

echo "<table>";
foreach ($arr as &$value) {

$file = $DOCUMENT_ROOT. $value;
$doc = new DOMDocument();
$doc->loadHTMLFile($file);
$xpath = new DOMXpath($doc);

$elements = $xpath->query("XPATH_OF_CONTENT_ELEMENT"); // insert Xpath reference.
    
if (!is_null($elements)) {
 echo "<tr>";
 echo "<td>".$value."</td>";
  foreach ($elements as $element) {
 
 $nodes = $element->childNodes;
    foreach ($nodes as $node) {
      echo "<td>".$node->nodeValue. "</td>\n";
    }
 
  }
  echo "</tr>";
}

}
echo "</table>";
?>



Find the Nearest Number which ends with zero in JAVA

Simplest Code:

// round it off to zero - Number ending from 1 to 9 will become zero.

int MyNumber = new Double(MyNumber / 10).intValue();
MyNumber = MyNumber * 10;

// Compile and Run to Test it out

public class toZero{

     public static void main(String []args){
        int MyNumber = 1556;      
       
        MyNumber = new Double(MyNumber / 10).intValue();
        MyNumber = MyNumber * 10;

        System.out.println(MyNumber);
     }
}

Enable Column Sorting in a jtable - java

Easiest way to enable sorting in a jtable in desktop java is write line of code

jTableObject.setAutoCreateRowSorter(true);

JSON and JAVASCRIPT differences and code difference

Javascript Array: 

var obj = []; 
obj.push = 'Some VALUE'; Or var obj = ['SomeVALUE', 1, 2]; 
now to access them use obj[0] -- 0 stands the index No. 
*********************************************** 

JSON Array and manipulations: 

Example 
var obj = { name : value, anotherName : anotherValue };  // if JS Variable used
var obj = { 'name' : 'value', 'anotherName' : 'anotherValue' }; // if JS Strings are used
Or Else
 ips[ipId] = {}; 
ips[ipId]['name'] = value; 
ips[ipId]['anotherName'] = anotherValue;
now - 
JSON.stringify(object); // gets you the string of the JSON Object
// No need to parse, no need to use JSON.parse as the variable holds the JSON Object only.
if you want to create a JSON Object from string or reverse engineer JSON.stringify() Method then use JSON.parse();

Also, You can use string variables to specify the names of the properties:
var name = 'name'; // name is variable - changing its value often
obj[name] = value; // note that their are no single quotes near name variable;
name = 'anotherName';
obj[name] = anotherValue;a

REGULAR EXPRESSION FOR INDIA PAN CARD NUMBER

REGULAR EXPRESSION TO VALIDATE TEXTBOX FOR INDIA PAN CARD NUMBER


We can use Regular Expression to validate indian pan card number in textbox . Regular expression for India Pan Card Number
^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$

Inline HTML Code (which can be used): <input type="text" size="15" required pattern="^([a-zA-Z]){5}([0-9]){4}([a-zA-Z]){1}?$" />

CSS Code - Changes the Color after validation takes place.

input:valid {
    background: #afa; /* green input*/
}
input:invalid {
    background: #faa; /* red input */
}


example shown on - http://jsfiddle.net/BenedictLewis/mA3MV/

Sublime Text Editor for Coders


Sublime Text is a sophisticated text editor for code, markup and prose.
You'll love the slick user interface, extraordinary features and amazing performance.

Some things users love about Sublime Text

Goto Anything

Use Goto Anything to open files with only a few keystrokes, and instantly jump to symbols, lines or words.
Triggered with Ctrl+P, it is possible to:
  • Type part of a file name to open it.
  • Type @ to jump to symbols, # to search within the file, and : to go to a line number.
These shortcuts can be combined, so tp@rf may take you to a function read_file within a file text_parser.py. Similarly, tp:100 would take you to line 100 of the same file.

Multiple Selections

Make ten changes at the same time, not one change ten times. Multiple selections allow you to interactively change many lines at once, rename variables with ease, and manipulate files faster than ever.
Try pressing Ctrl+Shift+L to split the selection into lines and Ctrl+D to select the next occurrence of the selected word. To make multiple selections with the mouse, take a look at the Column Selection documentation.

Command Palette

The Command Palette holds infrequently used functionality, like sorting, changing the syntax and changing the indentation settings. With just a few keystrokes, you can search for what you want, without ever having to navigate through the menus or remember obscure key bindings.
Show the Command Palette with Ctrl+Shift+P.

Distraction Free Mode

When you need to focus, Distraction Free Mode is there to help you out. Distraction Free Mode is full screen, chrome free editing, with nothing but your text in the center of the screen. You can incrementally show elements of the UI, such as tabs and the find panel, as you need them.
You can enter Distraction Free Mode using the View/Enter Distraction Free Mode menu.

Split Editing

Get the most out of your wide screen monitor with split editing support. Edit files side by side, or edit two locations in the one file. You can edit with as many rows and columns as you wish.
Take advantage of multiple monitors by editing with multiple windows, and using multiple splits in each window.
Take a look at the View/Layout menu for split editing options. To open multiple views into the one file, use the File/New View into File menu item.

Instant Project Switch

Projects in Sublime Text capture the full contents of the workspace, including modified and unsaved files. You can switch between projects in a manner similar to Goto Anything, and the switch is instant, with no save prompts - all your modifications will be restored next time the project is opened.

Plugin API

Sublime Text has a powerful, Python based plugin API. Along with the API, it comes with a built in Python console to interactively experiment in real time.

Customize Anything

Key Bindings, Menus, Snippets, Macros, Completions and more - just about everything in Sublime Text is customizable with simple JSON files. This system gives you flexibility as settings can be specified on a per-file type and per-project basis.

Cross Platform

Sublime Text is available for OS X, Windows and Linux. One license is all you need to use Sublime Text on every computer you own, no matter what operating system it uses.
Sublime Text uses a custom UI toolkit, optimized for speed and beauty, while taking advantage of native functionality on each platform.
--- Above Information is from  http://www.sublimetext.com/  - 10th August 2015

Plugins for PHP development in sublime text editor

Visit the following Links for the list of Important Plugins for Sublime 

1. http://neverstopbuilding.com/sublime-plugins-for-php
2. http://wasil.org/sublime-text-3-perfect-php-development-set-up


6+ Reasons Why Authors Should Avoid GoDaddy

Avoid-GoDaddy-Bad-Evil
There was a time when I had almost 40 domains with GoDaddy. I started using them ten years ago, back when GoDaddy was a new website with dungeon low prices.
Now I don’t own a single domain with GoDaddy.
Here are seven reasons why you should move away from GoDaddy:

#1 GoDaddy Has Terrible Support

I had one client who had constant trouble with her email because GoDaddy support constantly gave her wrong advice. She would have a small problem with her email and would call GoDaddy. By the end of the call her email would be totally broken.
Finally, she hired me to conference in with the GoDaddy representative and interrupt each time the GoDaddy rep would give her bad information. I had to interrupt a lot.
Update: GoDaddy has made some improvements in the last few years in the support arena. They offer better support than they used to. I don’t think this reason alone is reason to move away from them. But it is not the only reason to avoid GoDaddy.

#2 GoDaddy is Overpriced

GoDaddy lures customers in with prices that look low.
GoDaddy makes it look like .com domains cost $1.99 per year when in reality domains cost $10 for the first year and $15 for every year after that.
Price Comparison:
  • GoDaddy ($24.94/year)
    • $14.99/year for Domain Renewal
    • $2.95/year for Email Forwarding
    • $7.00/year for WhoIs Protection
  • Na*********.com ($13.57/year)
    • $10.69/year Domain Renewal
    • $0.00/year Email Forwarding
    • $2.88/year for WhoIs Protection
GoDaddy also charges you extra for things Na******** throws in for free, like landing page customization. Now these prices go on sale from time to time so your millage may vary. The key is to focus on the renewal price. Sale prices typically only apply to the first year.

#3 GoDaddy is Hard to Use

I cringe any time I hear a novice say they bought a domain on GoDaddy.
GoDaddy spends so much time trying to up-sell customers that it is hard to buy what you came to buy. If you don’t know what you are doing, you may find yourself paying for all sorts of things you don’t need. These added services can make your domain harder to use.
You have to be fairly savvy to use GoDaddy and not get ripped off.

#4 GoDaddy Hosting is Slow

iThemes, a major WordPress theme development company, blasted GoDaddy for overselling hosting space. GoDaddy puts thousands of websites on a single server. All those websites compete for server processing time and bandwidth. This causes the sites to run slow, especially if any of them are popular. The GoDaddy speed issues are exacerbated by the fact that Google now penalizes slow sites on its search results.
Not only is the hosting slow but making server changes is slow as well.
If you change the wrong thing you may not know anything is broken for thirty minutes and it may take another thirty minutes to “unchange” whatever it is you broke.

#5 GoDaddy Gives Too Little Control

Not only is GoDaddy slow but their server back end is difficult to use and limited. Instead of giving users an industry standard admin interface (like cPanel or Plesk), they give users a proprietary admin interface that is more interested in selling you more GoDaddy products than in giving you the tools you need.
This makes it harder (i.e. more expensive) to do simple things on GoDaddy.

#6 GoDaddy Uses Smut to Sell

Some people are more concerned about the moral degradation of our country than others. Many people feel the country is moving in the wrong direction. Let me just say that GoDaddy is no force for good in our culture. GoDaddy notoriously has the most offensive Super Bowl ads every year. Each year they submit ads that are deemed too inappropriate even for TV.
They then feature these “too hot for TV” ads on their homepage.
Even the ads that do get approved objectify woman’s bodies and degrade women into objects of lust for the purpose of making money. This is inappropriate, uncalled for, and not something conscientious people should support with their money. If we allow companies to manipulate our sexual desires to make a profit, how can we say we are any better than animals?
Authors can do better than GoDaddy.

#7 GoDaddy Backed SOPA & PIPA


GoDaddy backed one of the most destructive laws ever to threaten the internet. It was only after 50,000 GoDaddy users left in protest that they changed course.
While I applaud GoDaddy for finally coming out against SOPA, the fact is that we can’t trust them to protect the internet. It also shows us that if enough people transfer away from GoDaddy due to the offensive ads, that they might change course on that as well.

The Good News

You are not stuck with GoDaddy.
There are also a lot of better hosting providers.

Security considerations in websites



Web development takes into account many security considerations, such as data entry error checking through forms, filtering output, and encryption. Malicious practices such as SQL injection can be executed by users with ill intent yet with only primitive knowledge of web development as a whole. Scripts can be used to exploit websites by granting unauthorized access to malicious users that try to collect information such as email addresses, passwords and protected content like credit card numbers.

Practical web development




Basic
In practice, many web developers will have basic interdisciplinary skills / roles, including:
  • Graphic design / web design
  • Information architecture and copy-writing/copy-editing with web usability, accessibility and search engine optimization in mind
The above list is a simple website development hierarchy and can be extended to include all client side and server side aspects. It is still important to remember that web development is generally split up into client side coding, covering aspects such as the layout and design, and server side coding, which covers the website's functionality and back-end systems.
Advanced
Some more advanced web developers will also have these interdisciplinary skills / roles:

Negative sides of the Zodiac Signs

Don`t we all hide a certain aspect of our personality from the world? Nobody`s an angel and there is a wicked side to everyone.

Here`s revealing what your friend or lover will probably never ever tell you or even you will not tell anyone - the darkest and deepest secrets of the different sun signs

Aries
Most Arians tend to be chauvinistic, there is nobody who they think is worthy enough of even standing before them. Well, if that were true all the leaders of the world would be Aries. Their ego is bigger than the universe and dare you hurt it, you would have to deal with that vicious tongue of theirs that pierces straight through the heart. And last but not the least, they are insanely self-obsessed.

Taurus
The lazy bulls have this special quality about them that surely sets them a thousand miles apart from the rest and that is called avarice. Greed can drive them insane; they crave for all the luxury in the world but don`t want to work hard for it. Funny, isn`t it?

Gemini
Do you really think your Gemini friend listens when you share your problems with him/her? For one, they do not and even if they do, then all that we can say is God bless you. Geminis only know how to talk, they never listen. Well, only sometimes when they think the gossip to be juicy enough and at the blink of an eye they will be telling your most intimate secrets to everybody.

Cancer
The crabs are so nice that it hurts, but they do have a wicked side like everybody else, may be not as wicked though, and depends on how you look at it. They tend to be clingy and dependable, emotionally unstable and freak out at the silliest of things.

Leo
Now, how can a dangerous animal like Lion be nice? Proud and loud, Leos, just like their fire mates Aries, have a thing for being boisterous. Cross their line of fire and you`d be sorry you met them in the first place.

Virgo
Their sugar coated words should never be trusted. Beneath that calm and composed exterior is a cunning person who doesn`t really mean it when he/she says that they admire you. And yes, how can one forget about their knack for perfection or rather irritating need to poke their nose in every matter, whether it concerns them or not,  all the time.

Libra
No the scales do not turn in their favour, not this time. Vanity conscious and power hungry, this air sign literally takes the symbol of their sign, the scales too seriously. They can be so finicky and obsessed about equality that it makes them go crazy.

Scorpio
You probably were expecting a lot of "good things" about the Scorpio and well, you wouldn`t be disappointed. There are actually a lot of good things that you didn`t know (or already knew) about them. Manipulative, selfish, controlling all that`s fine but the best thing is they never forgive. Revenge is a dish best served cold and the Scorpio out of all the signs understands it the best.

Sagittarius
The saying - "promises are meant to be broken" was probably by a Sagittarius. To a Sagittarian, life without adventure is so plain and boring that they need to do everything adventurous (read stupid) to get their adrenaline pumping, even if it means breaking someone`s heart (but they do realize it later).

Capricorn
Goats and devilish? You`d probably say no way but here`s letting you on a little secret-they are selfish, very selfish indeed. One has to give it to the Capricorns for maintaining such a saintly image.

Aquarius
Aquarians have a deep desire for fame and they will do anything for it. Being detached is one thing and backstabbing is another but to an Aquarian they are all the same. They do so unintentionally though, if that is any consolation.

Pisces
Round and round the fish goes, planning the next best move to get what it wants. Sweet on the outside and "God knows what" on the inside, Pisceans can be really deceptive and manipulative. A grown up Piscean may even cry or bawl like a kid to get what he wants.

DON'T MISS The Right Job for Zodiac signs

There are no right or wrong people or right or wrong jobs. This situation is more like the right people stuck with the wrong career option, or the wrong people taken for the right job. So, how will we deal with this confusion? Let`s take a look at what astrology has to say about this. Let your zodiac sign help you guide your career path. You never know, you might just make the most of it, starting today!

Aries:

Aries make great artists and sportsmen. People of this sign cannot take too much of interference with their work. These guys make great researchers, scientists and engineers too. They like to work at their pace and in their style. No, that doesn`t mean they can`t take orders, but try letting them be on their own and they`ll come up with the best results!

Taurus:

Taureans are creative souls. They have a taste for art and are talented entertainers. These guys cannot go by the hardcore corporate rules. They find it hard to breathe in a dishonest environment. Being great money managers, banking and accounting jobs are also great career options for them.

Gemini:

Geminis make outstanding journalists. Due to their innate nosy nature, these people fit perfectly in this profession. A Gemini person has strong verbal skills; a talk show host is a great option too! Translators, Public Relations, company HR and other such professions are more suitable for this bunch.

Cancer:

Cancerians can find their perfect stop as a judge or a lawyer. With their perfect sense of judgment, and ability to not let wrong happen, these people will do just great. Being affectionate and very caring, they make great nurses too! As writers, artists and filmmakers, Cancer is known to outshine most other signs.

Leo:

Leo loves to be the center of attraction, a clerical job involving backend paperwork would be so frustrating for him. A Leo actor might be the most satisfied person on earth! With oh-so-much-attention, what more could he ask for! These guys make excellent spokespersons or publicists.

Virgo:

Computer scientists, engineers, financial advisers and architects; you`ll find Virgos perform outstandingly in these professions. With an eye for detail, these jobs are some of the best options for this lot.

Libra:

Librans have a balanced temperament. These people know how to balance things and are very serious about making no mistakes in that. With such unbiased approach, Librans prove to be great teachers and counselors. Librans also have a thing for beauty. Stylists, beauticians and interior decorators are also some perfect options for them. The legal field attracts Librans and most Librans are doing well as lawyers and judges.

Scorpio:

Scorpions are very dedicated and hard working professionals. They are very secretive and at the same time, willing to know other people`s problems and secrets. These people will fit well as investigators. They also make great therapists and hypnotists. Don`t be startled to find a scorpion working in the science lab or as a researcher.

Sagittarius:

Sagittarians are the always-happy ones. They like solving problems and bringing a smile on others` faces. Psychiatrists, school counselors, customer service desks, managers, they`ll excel in all these career options!

Capricorn:

With a very high level of concentration, Capricorns prove to be perfect doctors and electrical engineers; they are the perfect choice for project managers too! Work which requires a lot of reading, analyzing and writing are also perfect for them.

Aquarius:

Aquarians are free birds, restricting them to a 9 to 5 schedule will suffocate them. The urge to do something different, independently, makes flexible working conditions favourable for this sign. Excellence in the field of science and technology is expected from an Aquarian person. Social work and politics are also preferable fields for them.

Pisces:

Pisceans have very strong visual imagination. A creative field such as animation is one of the best options for them, with confirmed success! Other career options include photography, filmmaking, and teaching.

4 Strategies For Remembering Everything You Learn

If you're going to learn anything, you need two kinds of prior knowledge:
• knowledge about the subject at hand, like math, history, or programming
• knowledge about how learning actually works

    The bad news: Our education system kinda skips one of them, which is terrifying, given that your ability to learn is such a huge predictor of success in life, from achieving in academics to getting ahead at work. It all requires mastering skill after skill.

     "Parents and educators are pretty good at imparting the first kind of knowledge," shares psych writer Annie Murphy Paul. "We're comfortable talking about concrete information: names, dates, numbers, facts. But the guidance we offer on the act of learning itself — the 'metacognitive' aspects of learning — is more hit-or-miss, and it shows."

    To wit, new education research shows that low-achieving students have "substantial deficits" in their understanding of the cognitive strategies that allow people to learn well. This, Paul says, suggests that part of the reason students perform poorly is that they don't know a lot about how learning actually works.

It's a culture-wide issue.

    Henry Roediger and Mark McDaniel,  psychologists at  Washington University in St. Louis   and coauthors of "Make It Stick: The Science Of Successful Learning," say that "how we teach and study is largely a mix of theory, lore, and intuition."

     So let's cut through that lore. Here are learning strategies that really work.
Force yourself to recall.  

The least-fun part of effective learning is that it's hard. In fact, the "Make It Stick" authors contend that when learning if difficult, you're doing your best learning, in the same way that lifting a weight at the limit of your capacity makes you strongest. 


It's simple, though not easy, to take advantage of this: force yourself to recall a fact. Flashcards are a great ally in this, since they force you to supply answers.
 
Don't fall for fluency.
When you're reading something and it feels easy, what you're experiencing is fluency.
It'll only get you in trouble.

Example: Say, for instance, you're at the airport and you're trying to remember which gate your flight to Chicago is waiting for you at. You look at the terminal monitors — it's B44. You think to yourself, oh, B44, that's easy. Then you walk away, idly check your phone, and instantly forget where you're going.

The alternative: You read the gate number. Then you turn away from the monitor and ask yourself, what's the gate? If you can recall that it's B44, you're good to go.
Connect the new thing to the old things.
"The more you can explain about the way your new learning relates to prior knowledge," the  "Make It Stick" authors write,  "the stronger your grasp of the new learning will be, and the more connections you create that will help you remember it later."

When you're weaving in new threads into your pre-existing web of knowledge, you're elaborating. 
One killer technique is to come up with real-life examples of principles you've just uncovered. If you've just learned about slant rhyme, you could read poems that exhibit it. If you've just discovered heat transfer, you could think of the way a warm cup of cocoa disperses warmth into your hands on a cold winter's day.

Reflect, reflect, reflect.

Looking back helps.  In a Harvard Business School study , employees who were onboarded to a call center had  22.8% higher performance than the control group when they spent just 15 minutes reflecting on their work at the end of the day.

"When people have the opportunity to reflect, they experience a boost in self-efficacy," HBS professor Francesca Gino tells us. "They feel more confident that they can achieve things. As a result, they put more effort into what they're doing and what they learn."
While reflecting may seem like it leads to working less, it leads to achieving more.

5 Great Open Source Project Management Platforms


5 Great Open Source Project Management Platforms

Open-source has been gaining momentum for some time now. It seems that every year, more companies have been adopting open-source solutions to meet their business objectives. In fact, the results of the 2013 Future of Open Source Survey revealed that 62 percent of respondents believe that more than 50 percent of purchased software will be open source in the next five years.
Open-source software is most often-used for one of four reasons:
  1. Low Cost
  2. Better Security
  3. Freedom from Vendor Contracts
  4. Better Quality

Best method to learn a programming language?

Best method to learn a programming language?

What could be the best way / Method to learn a new programming language
Or
Whats the secret behind successful programmers...
Or
Which is the best IDE for a beginner programmer


Well... the answer is very simple but the work & energy needed is huge....

What is expected Income From a Website

What Is The Expected Income From a Website ...By Scott Cameron


  • Initial Nothing Period


One bad thing about creating a website is that there is a “Nothing” period in the money you can generate. Building a website takes time and to begin with you can’t even have visitors until you have your site built and populated with content. If done well that step may take some time and effort. Then depending on the type of website you have built it may even take quite a bit of time before you even earn your first dollar. But don’t worry the long term rewards from a website really outweigh this initial “Nothing” Period.


Top Ten Software Architecture Mistakes

Top Ten Software Architecture Mistakes by Niclas Nilsson

Scoping Woes. "This is the sort of situation where a simple travel booking system ends up with full expense claim management facilities being built into it, with inevitable repercussions for project costs, timescales and quality...It is really true that no security is needed beyond simple login? Once logged into the system can users really perform any system operation?"

Not Casting Your Net Widely. "A related mistake that many of us have made is to focus on just a couple of our system stakeholders – classically the acquirer (who is paying for the system) and the end users get all of the attention."