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

SEARCH KEYWORD -- Algorithm



  Big file transfer in Linux

It's very common that we need to transfer files between two different hosts such as backups. It is also an very simple task, we can use scp or rsync to complete the task well. But what if the file is very big, it may take some time to transfer it. How can we transfer a big file with high speed? Here we propose one solution. Copy file If we copy one uncompressed file, then we should follow below steps: Compress data Send it to another host Uncompress the data Verify the data integrity This will...

   Linux, SCP,ZIP     2013-01-10 05:55:50

  Implementing DESede/ECB/NoPadding cipher algorithm in GoLang

By default, GoLang doesn't provide the ECB mode cipher for DESede though there is CBC mode provided. In cases we need to encrypt/decrypt data with ECB mode, we need to implement those by ourselves. This mode is frequently used when encrypting/decrypting PIN block which is small block data less than 16 bytes. In this post, we will introduce how to implement the DESede/ECB/NoPadding algorithm in GoLang by using the existing cipher support. Here we will not cover how DESede works in detail, instead...

   SECURITY,SAMPLE,GOLANG,DES,DESEDE,3DES     2019-07-29 06:43:50

  Find max subarray of an array

In computer science, the maximum subarray problem is the task of finding the contiguous subarray within a one-dimensional array of numbers (containing at least one positive number) which has the largest sum. For example, for the sequence of values −2, 1, −3, 4, −1, 2, 1, −5, 4; the contiguous subarray with the largest sum is 4, −1, 2, 1, with sum 6. The problem was first posed by Ulf Grenander of Brown University in 1977,...

   Max Subarray, Divide and conquer,Kadane     2013-04-22 11:50:35

  Solve Hibernate "Too many connections" issue in MySQL

When working with Hibernate and MySQL, sometimes some exceptions will be thrown after sometime. The exception may seem like : java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections" This means there are too many active connections on the MySQL, you can use SHOW STATUS LIKE '%Threads_connected%'; to check the active connections to MySQL. If you want to change the maximum connections allowed to MySQL. You can execute: set global max_co...

   MySQL,Hibernate,Clos     2013-09-04 22:20:49

  sorting in C++: 3 times faster than C.

If you don't know C++ well, you might be surprised how fast C++ can be sometimes. This is especially true when code involved is small, because then inlining - which is what C++ is very good at - and templating, which makes excessive inlining possible in the first place - has the most effect. The following code compares C and C++ sorting:  #include <iostream>#include <algorithm>#include <vector>#include "stop_watch.inl" // see https://...

   C++,Sorting,C,faster,efficiency     2012-03-17 12:59:45

  Why should we drop or reduce use of MD5?

MD5 is a frequently used one-way hash algorithm, it is commonly used in following situations: Check data integrity. We take hash of the data stored in two different places and compare them. If the hash results are the same, then there is no need to check the actual data. This utilizes the collision-resistant feature. Two different data block will have little chance that their hash values will be the same. Many data service providers use such technique to check repeated data to avoild repeating...

   MD5,Vulnerability,attack     2012-09-29 04:47:49

  Permutation algorithm with JavaScript

In secondary school, we have learned permutation. Basically, for n numbers, the number of permutations for these n numbers can be calculated to n! which is called 'n factorial'. But to display all the permutations on the screen, we need to use a recursive function. The problem is how to write this function.  Next I write a program to display the permutations for n numbers with JavaScript. First, we need to understand that from these n numbers, we can first take any one number from it, and t...

   JavaScript,Permutation,Algorithm,Impleme     2011-09-21 12:02:35

  Implementation of Tower of Hanoi

The Tower of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape. The objective of the puzzle is to move the entire stack to another rod, obeying the following rules: Only one disk may be moved at a time. Each move consists of taking the upper disk fro...

   Algorithm,Tower of Hanoi     2012-08-20 02:15:55

  Java API vs Framework

What is the difference between a Java Library and a framework? The two concepts are essentially important for a Java developer. The most important difference between a library and a framework is Inversion of Control. It means that when you call a library you are in control. But with a framework, the control is inverted: the framework calls you. (This is called the Hollywood Principle: Don’t call Us, We’ll call You.) This is pretty much the definition of a framework. Basicall...

   Difference,API,Framework,Library,Java     2011-12-19 13:40:33

  Advantages Associated with Semantic SEO Searches

Today, all businesses are aware of the fact that SEO is an integral part of their online endeavors. However, some of them do not really know or understand the way SEO works and how things are changing in the SEO landscape. Do you have any idea about some positive effects of SEO and how this specific shift has affected the way people search online and exactly how search results would be ranked? SEO has been there for decades now. However, only since the year 2000 onwards, Google has proactively ...

   ALGORITHM,SEO,SEMANTIC SEO,ADVANTAGEST,HUMMINGBIRD     2018-08-14 01:02:16