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

SEARCH KEYWORD -- rand



  A trap about PHP random number

The method to get random number in PHP is very simple, we only need to use rand() function. int rand ( int $min , int $max ) One function call can return the random number in a specified range. But in fact, the random number in computer is actually pseudorandomness, generally to increase the randomness, we may set a random seed before calling rand(). void srand ([ int $seed ] ) According to other language features, we should pass a time value as a parameter to the srand() function, generally...

   PHP,rand,srand,mt_rand     2013-06-07 09:10:10

  Only fast languages are interesting

If this isn’t a Zawinski quote, it should be. I have avoided the JVM my entire life. I am presently confronted with problems which fit in the JVM; JVM libraries, concurrency, giant data: all that good stuff. Rather than doing something insane like learning Java, I figured I’d learn me some Clojure. Why not? It’s got everything I need: JVM guts, lispy goodness; what is not to love? Well, as it turns out, one enormous, gaping lacuna is Clojure’s numerics performanc...

   Fast language,Clojure,Perl,JVM SLOW,Lush     2011-11-30 11:16:01

  Ensure triggering transitionend event in JavaScript

CSS3 Transition has been widely used in modern web app development to offer users animations. Traditionally animations of element in HTML are controlled by JavaScript. If fancy animation is desired, then third party plugins can be installed in browsers such as Flash, Silverlight, Java Applet etc. With CSS3, animations can be easily achieved like a charm. Transition is one of the many features provided by CSS3. It can be used to transit one element from one state to another state smoothly within ...

   CSS3 TRANSITION, TRANSITIONEND, FORCE FIRE TRANSITIONEND     2015-05-09 08:56:51

  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

  Good programmer made bad designers

I got an email request to publish this article a few days ago.I was actually on the verge of moving the email to the trash when I noticed the first name of the author: Rand.For those of you not familiar with the Wheel of Time series, the main character’s name is Rand.I admit that it’s an embarrassing weak reason to respond to a strange email, but reading some 10,000 pages of a fantasy series obviously messes with your mind.Then again, it’s probably no stranger than...

   Programmer,Designer,Comparison     2011-08-29 22:06:33

  Remote form submission

Remote form submission is way of submitting HTML forms from local to a particular remote server. This is used by many advertisers, spammers or even hackers to submit bad data to other websites in order to get what they want. They can write some automation scripts to help them do spamming. How can people do remote form submission and how to prevent this kind of attacks? Since a website can be accessed by almost every one, so one can save a local copy of a HTML form of a website through File->S...

   PHP,Security,Remote form submission     2013-07-14 01:04:49

  Shell script common interview questions

Shell script is frequently used when monitoring system status on Linux. It's not an easy task to write shell script but it's a very important skill for developers and system administrators to ease work and automate common tasks. This post will share some common interview questions about shell script. 1. Get random characters(8 characters) Method 1 # echo $RANDOM |md5sum |cut -c 1-8 471b94f2 Method 2 # openssl rand -base64 4 vg3BEg== Method 3 # cat /proc/sys/kernel/random/uuid |cut -c 1-8 ed...

   LINUX,INTERVIEW,SHELL SCRIPT     2018-09-28 10:46:00

  PHP to integrate with Sign in with Google

Google has a huge user base and hence it provides an authentication service for third party service to integrate with them so that people can sign in with Google in their services. Google also adopts OAuth 2 to provide this kind of Open ID connect service. This post will introduce how to integrate with sign in with Google functionality in your PHP website.  Create a client app on Google The first step you should follow is to create a Google app, you can follow the post here to create the p...

   PHP,GOOGLE API,OPEN API,SIGN IN WITH GOOGLE     2019-03-03 02:00:09

  Want to be a software engineer? Go to university

This editorial was originally submitted to the Sydney Morning Herald in response to an editorial proclaiming that people wanting to become software engineers should not attend university and instead learn a current popular programming language.   Over the past few years I’ve developed software for large corporations, started the Vodafail campaign, co-founded Mijura and represented Australia in the global Robocup (humanoid robotic soccer) competition. I graduated from University...

   Software engineer,University,Systematic study,Research     2011-12-07 08:48:54

  Our Go Cache Library Choices

In Build a Go KV Cache from Scratch in 20 minutes, I walked you through what matters when writing a local cache, and eventually implemented one, whose performance was beaten badly by that of the popular go-cache on Github though. However, the bright side is that we can learn a lot from those excellent Github Go cache products, studying their features, applicable scenarios, and implementations, and extracting what we need. In this article, I will mainly analyze and compare the four...

   GOLANG,CACHE,GO-CACHE,BIGCACHE,GOURPCACHE     2022-04-16 07:48:11