Max array length in OCaml

Posted on

What’s the max array length in OCaml. You can check it by: # Sys.max_array_length;; On 64-bit machine: # Sys.max_array_length;; – : int = 18014398509481983 On a 32-bit machne: # Sys.max_array_length;; – : int = 4194303 This is due to the memory representation of arrays. 64 Bit machines are better here. And AFAIK, OCaml was developed
Read more

Installing Fedora 19, Error “you have not created a bootloader stage1 target device”

Posted on

Installing Fedora 19, Error “you have not created a bootloader stage1 target device” . It seems appear from Fedora 15: http://forums.fedoraforum.org/showthread.php?t=271743 This can be solved by adding noefi nogpt to the kernel parameters when booting the Linux for installation in grub as follows. Note: the “_” between nogpt and root is the cursor, not the
Read more

How to change strings in MySQL tables

Posted on

How to change strings in MySQL tables? e.g. I want to change domain.com to www.domain.com. Use the REPLACE functions of MySQL: http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace One example is like this: UPDATE table SET field = REPLACE(field, ‘domain.com’, ‘www.domain.com’) WHERE field LIKE ‘%domain.com%’ The WHERE clause is not needed but can make execution faster.

How to change the maximum execution time and memory size allowed for PHP

Posted on

I see this message in the error log of httpd: PHP Fatal error: Maximum execution time of 30 seconds exceeded in and PHP Fatal error: Allowed memory size of 268435456 bytes exhausted How to change them to a longer and larger value? To change the allowed maximum memory usage of PHP: Set memory_limit = 256M
Read more

How to find out and change the storage engine of tables in MySQL

Posted on

How to find out and change the storage engine of tables in MySQL databases? Find out the storage engine of a table in a database: SELECT ENGINE FROM information_schema.TABLES WHERE TABLE_SCHEMA = ‘database’ AND TABLE_NAME = ‘table’ Change the storage engine of a table: ALTER TABLE table ENGINE = type type can be innodb or
Read more

How to install WordPress on Fedora 19

Posted on

How to install the latest WordPress on a newly installed Fedora 19? Thanks! First, install the LAMP (you already have ‘L’) stack: # yum install httpd php php-mysql mysql-server php-gd and start these services: # systemctl start mysqld.service httpd.service Then, install WordPress on the LAMP stack following the tutorials on the Web. Two good ones
Read more

How to choose the number of mappers and reducers in Hadoop

Posted on

How to choose the number of mappers and reducers in Hadoop to get good job performance? The Hadoop Wiki gives a discussion on this: http://wiki.apache.org/hadoop/HowManyMapsAndReduces Some valuable points: About the number of Maps: The number of maps is usually driven by the number of DFS blocks in the input files. Although that causes people to
Read more

Specifying –no-print-directory within the Makefile

Posted on

The –no-print-directory option of make tells make not to print the message about entering and leaving the working directory. However, how to specify the –no-print-directory inside the Makefile itself? Add this line to the Makefile: MAKEFLAGS += –no-print-directory You can also set MAKEFLAGS in a makefile, to specify additional flags that should also be in
Read more

How to spawn a background process in a bash script

Posted on

For example, I want to spawn many ssh background processes in one bash script: for i in `cat ./all-hosts` do ssh $i “ifconfig | grep Link” done Simply adding a & to the ssh commands does not work. Here is the script that works: for i in `cat ./all-hosts` do ssh $i “ifconfig | grep
Read more

MySQL at Facebook

Posted on

Facebook uses lots MySQL databases. Any information about how Facebook scales MySQL? Some information on the Web: MySQL at Facebook’s page https://www.facebook.com/MySQLatFacebook?filter=1 A post by Ryan Thiessen, Database Operations at Facebook on Quora: http://www.quora.com/Facebook-Engineering/How-does-Facebook-structure-MySQL-so-that-it-is-robust-and-scalable And more: http://mashable.com/2011/12/15/facebook-timeline-mysql/ http://gigaom.com/2011/12/06/facebook-shares-some-secrets-on-making-mysql-scale/ http://www.wired.com/wiredenterprise/2011/12/facebook-timeline-anatomy “A lot of people are surprised that for this shiny new thing for Facebook, we’re using
Read more

Cache at Facebook

Posted on

About caching system at Facebook. According to: https://www.facebook.com/notes/facebook-engineering/monitoring-cache-with-claspin/10151076705703920 Facebook has two major cache systems: Memcache, which is a simple lookaside cache with most of its smarts in the client, and TAO, a caching graph database that does its own queries to MySQL. The NSDI’13 paper introduces more about Memcache: https://www.usenix.org/conference/nsdi13/scaling-memcache-facebook The USENIX ATC’13 paper introduces
Read more