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

SEARCH KEYWORD -- Replace



  Linux Kernel is replacing HTTP link with HTTPS

Linux kernel is in the process of replacing the HTTP links in its source code with HTTPS links. HTTPS is considered more secure than HTTP and can prevent lots of attacks like Man-In-The-Middle attack.  Currently there are more than 150 patches submitted by Linux Kernel developers to replace these HTTP links.  One thing to be noted is this replacement process is not a manual search and replace process. Indeed, some scripts are created to find out these links and try to find whethe...

   LINUX KERNEL,HTTP,HTTPS     2020-08-08 01:35:20

  trim() in JavaScript

In the past, JavaScript didn't define the trim() function for String object. This makes web programmers frustrated since they often need to implement this function themselves if they want to handle user inputs. The new version of ECMA-262 introduces the trim() function.15.5.4.20   String.prototype.trim ( )     The following steps are taken:     1.   Call CheckObjectCoercible passing the this value as its argument.   2.   Let S...

   JavaScript,trim(),implementation     2012-07-19 10:58:01

  Resolve SystemStackError issue when resolving IP address in Ruby

In Ruby, Resolv is the default DNS resolution implementation. It can be used to resolve IP address of a hostname. To use it, one just needs to require 'resolv' in the code. But sometimes, a user would want to check /etc/hosts first or some other mechanisms to resolve an IP address. In this case, one can require 'resolv-replace' and then replace the default DNS resolvers with customized DNS resolvers. For example, using resolv-replace, one would write require 'resolv-replace' Resolv::DefaultResol...

   RUBY,RUBY ON RAILS,NETWORK     2017-07-08 09:54:35

  An alternative way to parse URL in JavaScript

Normally when we need to process URL in JavaScript, we may use the location object. Then we can use location.hostname,location.href,location.port etc to get the information we need. In this post, we will parse an URL with an alternative way. We can use an URL to create a DOM object by calling document.createElement("a"). The complete code is: function parseURL(url) { var a = document.createElement('a'); a.href = url; return { source: url, protocol: a.protocol.replace(':',''), host: a.ho...

   URL,location,parse     2014-03-03 07:05:11

  Highly efficient PHP code writing

Next are some tips for writing highly efficient PHP codes. They are described below: 0. Use single quote to replace double quote, this will be better since PHP will serach for variables in double quoted strings. Note, only echo can do this; 1. If we can define methods of a class as static, then do it. It will increase access speed by 4 times; 2. $row["id"] is 7 times faster than $row[id]; 3. echo is faster than print, and also use echo's multiple parameter format such as echo $str1,$str2 inst...

   PHP,Code writing,High efficient,Tips     2011-07-23 12:35:50

  Apple investigating new iPad WiFi issues, tells AppleCare to replace affected units

According to an internal AppleCare document, Apple is actively investigating a series of WiFi-related issues affecting the third-generation iPad. Since the new iPad’s launch, many users have been complaining about third-generation iPad WiFi issues ranging from connection drops, slow download and upload speeds, or the device’s inability to even pickup local WiFi networks. A thread discussing the issue exists on Apple’s online support forums has almost amassed 700 repl...

   Apple,iPad,Wifi,Hardware issue     2012-04-06 01:37:59

  Using msmtp to replace sendmail

sendmail is a mail client in Linux with many vulnerabilities and tedius configuration steps, many system administrators have disabled using it. Then how do we know what happens if a crontab script executes with error? Actually there are some replacements for sendmail, one is ssmtp, but this application is no longer maintained, we even cannot find its source code on Google. Fortunately, we can use msmtp to replace sendmail. The address : http://msmtp.sourceforge.net/ 1. Installation After downloa...

   sendmail, msmtp, replacement     2012-09-27 11:41:48

  Do NOT use boolean variable as function parameters

We follow lots of coding styles and coding standards when we do programming, but we may frequently forget one. The forgotten one is that do not use boolean parameter as the function parameters. The reason is it would greatly reduce the readability of the code. Don't believe it? When you read the following code, what does this code mean? widget->repaint(false); Do not repaint? Or what does this mean? After looking at the document, we know that this parameter is whether ...

   CODING STYLE,BOOLEAN,FUNCTION PARAMETER,CODING STANDARD,METHOD PARAMETER     2012-04-22 02:38:45

  Getting started with C++ TR1 regular expressions

Overview This article is written for the benefit of someone familiar with regular expressions but not with the use of regular expressions in C++ via the TR1 (C++ Standards Committee Technical Report 1) extensions. Comparisons will be made with Perl for those familiar with Perl, though no knowledge of Perl is required. The focus is not on the syntax of regular expressions per se but rather how to use regular expressions to search for patterns and make replacements. Support for TR1 ext...

   Regular expression,Replace,TR1,Extension     2011-08-14 07:25:20

  10 HTML5 Demos to Make You Forget About Flash

You’ve probably been hearing a lot lately about how Flash is a dying technology and how it’ll soon be replaced by HTML5. Personally, I think that it will slowly replace Flash for some things, but Flash will always have a place, especially for developing complex games and rich internet applications. If you’ve yet to see what HTML5 can do, I’ve rounded up 10 demos that show off some of its capabilities. So what do you think – will HTML5 replace Flash? Canvas ...

   HTML5,CSS,Next web,Flash     2011-07-01 10:13:19