Today's Question:  What does your personal desk look like?        GIVE A SHOUT

SEARCH KEYWORD -- Check



  3 ways to remove duplicates in List

Frequently, we may have an ArrayList which stores many values, and we need to process the ArrayList and get what are the distinct values in the list, or we may want to count occurrence of each value in the ArrayList. We can remove the duplicates in a few ways. Here we propose 3 methods :     public static void main(String[] args){        //SuperClass sub=new SubClass();                String[...

   Java,List,Duplicate,Clear     2012-09-03 09:44:32

  How to Prevent a Data Breach: Guide For Businesses

The consequences of a data breach are nothing to joke about. From reputation damage to regulatory fines, it is a disaster for any business. So you should always strive to do your best to prevent it. But with so many steps to take, where do you even begin? Businesses of all shapes and sizes should follow this 8-step approach: 1. Outline Your Assets Your assets, whether digital or physical, should always remain in your sight. It should be the very first step you take. Picture anything that might r...

   DATA SECURITY     2020-03-04 08:16:44

  Content based HTTP Cache

Browsers may cache the webpages we visited, when user types a URL on the address bar, the browser may cache the webpage returned from server while displaying it. If there is no update on the webpage, then next time when the browser requests the same page, it will not download the page again, instead it will load the cached page. If the website explicitly specify that the page is updated, then the browser will download the page again from the server. What's HTTP Cache? You may be familiar with th...

   HTTP Cache,Web crawler     2013-05-24 05:12:59

  JavaScript finite state machine

Finite state machine is a very useful design model, it can be used to simulate many events in the world. In short, finite state machine has three features: Number of states is finite At any moment, one object can only be in one state In some condition, it will transfer from one state to another state In JavaScript, finite state machine can be applied in many places. For example, one menu element on a webpage. When the mouse hovers on the menu, the menu will show up, while the mouse moves away...

   JavaScript,Finite state machine,State     2013-09-02 11:00:57

  Essential Rules To Protect Your Credit Card When Shopping Online

You have to protect yourself and your credit card online while shopping. There are a number of ways to do this, but some prove more technical than others. Your basic best defense includes sensible use and layers of protection. The best way to do this is to pick and choose which stores at which you charge purchases. You can reduce the chance of losing your card details to a thief by declining to allow the retailer to store your credit card. Use a password manager to save your passwords and make a...

   SECURITY,CREDIT CARD,MASTERCARD     2019-10-09 08:40:07

  Basic Patterns for Everyday Programming

For most of you the patterns mentioned below should be nothing new. These are very basic stuff we slap into our code everyday and at times feels they are actually code smells than smart patterns. However, I've been doing some code reviewing lately and came across many code that lacks even these basic traits. So I thought of writing them down as a help for novice developers who would want to get a better grasp at these.These patterns are commonly applicable in most general purpose programming lan...

   Pattern,Code,NULL,Function,JavaScript,Assign default value     2011-11-23 08:03:55

  An Object is not a Hash

Following my article A String is not an Error, I want to bring attention to an issue that similarly applies to JavaScript in general, but has special relevance in the Node.JS environment. The problem boils down to the usage of {} as a data-structure where the keys are supplied by untrusted user input, and the mechanisms that are normally used to assert whether a key exists. Consider the example of a simple blog created with Express. We decide to store blog posts in memory in a {}, indexed ...

   Object,Hash,Node.js,JavaScript     2012-01-19 10:16:10

  Run executable jar on double click on Windows

Normally after installing Java, there will be an association between .jar and the javaw.exe. This enables the executable jar to be opened on double click. You can check the association by going to Control Panel -> Programs -> Default Programs -> Associate a file type or protocol with a program. The default program of a file type can be changed in this dialog. However sometimes there are cases where the file association for .jar may be altered after a third party application instal...

   JAVA,WINDOWS,JAR,EXECUTABLE JAR     2016-05-12 03:05:04

  A Programming Idiom You've Never Heard Of

Here are some sequences of events: Take the rake out of the shed, use it to pile up the leaves in the backyard, then put the rake back in the shed. Fly to Seattle, see the sights, then fly home. Put the key in the door, open it, then take the key out of the door. Wake-up your phone, check the time, then put it back to sleep. See the pattern? You do something, then do something else, then you undo the first thing. Or more accurately, the last step is the inverse of the first. Once you're aware ...

   Programming,Idiom,Strange     2012-01-04 08:12:25

  Error handling in GoLang

Error handling is one of the must talked topics for any programming language. The program would be more reliable and stable if errors are handled properly and timely. Each programming language has its own way to handle error, this applies to GoLang as well. This post will discuss more about GoLang's error handling mechanism. Error handling Before talking more about GoLang's error handling, we can see how different programming languages are handling errors. C's error check The most direct way of ...

   GOLANG,ERROR HANDLING,FLUENT INTERFACE     2021-03-06 21:36:08