g++: sorry, unimplemented: non-trivial designated initializers not supported

Posted on

g++ (version g++ (GCC) 4.8.1 20130603 (Red Hat 4.8.1-1)) report: $ g++ -std=c++11 solution.cpp -o sol solution.cpp: In function ‘int main()’: solution.cpp:50:57: sorry, unimplemented: non-trivial designated initializers not supported Stat init_stat {.depth = 0, .moves = tv, .vec = init}; ^ solution.cpp:50:57: sorry, unimplemented: non-trivial designated initializers not supported solution.cpp:50:57: sorry, unimplemented: non-trivial designated initializers
Read more

How to remove cookies for a certain site in Chrome?

Posted on

How to remove cookies for a specific site/domain in Chrome? I just want to delete the cookies by one site, not the whole cookies stored by my browser. In Chrome’s settings (open chrome://settings/ in the URL bar): Search for “cookie” and you will find “Privacy” -> “Content Settings”. Click the button “Content Settings”. In the
Read more

Mount Ext4 Partitions in Windows in read-only mode

Posted on

How to mount Ext4 partitions from Linux in Windows in read-only mode? Read-only is required to ensure safety. Mounting is required so that traditional programs can use the partition without any changes. Ext2Fsd is a great tool for this. Ext2Fsd is a file system driver which allows accessing (both reading and writing) ext2, ext3 or
Read more

Run cron jobs with environmental variables for an account

Posted on

A common error for configuring cron is to use environmental variables for an account in the cron command. However, cron will run the commands without these variables defined. In the crontab -e, adding . $HOME/.profile before the commands play the trick. For example: 0 */8 * * * . $HOME/.profile; ~/bin/my-command Cron is started by
Read more

How to reset the Disqus WordPress plugin installation

Posted on

How to reset the Disqus WordPress plugin installation? After deactivating/activating the Disqus WordPress plugin, the ID and others are the same as the old ones. What I need is to change the Disqus forum ID for a WordPress installation. Find all the tuples in the _option table of WordPress that contains “disqus” and delete them.
Read more

Broken links checker for sites

Posted on

Tools to check broken links for websites. This tool is great for broken link checking: http://www.brokenlinkcheck.com/ . It check all your site automatically. W3C also has a tool to check a single page: http://validator.w3.org/checklink There is also an open-source tool LinkChecker: http://wummel.github.io/linkchecker/ If you are using WordPress, a plugin is also available: http://wordpress.org/plugins/broken-link-checker/

Installing WordPress in a sub directory while working for the whole site

Posted on

How to install WordPress in a sub directory while working for the whole site? Putting the WordPress files in the root directory seems messy. A method is introduced here: http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory The process to move WordPress into its own directory is as follows: Create the new location for the core WordPress files to be stored (we
Read more

Shared hosting services with SSH enabled

Posted on

Which shared hosting services have SSH enabled? SSH is a great tool for management and development. Lots shared hosting services support SSH. Here is a non-complete list: Dreamhost SSH on dreamhost: http://wiki.dreamhost.com/Enabling_Shell_Access BlueHost SSH on BlueHost: http://my.bluehost.com/cgi/help/180 GoDaddy SSH on GoDaddy: http://support.godaddy.com/help/article/4942 HostGator SSH on HostGator: http://support.hostgator.com/articles/hosting-guide/lets-get-started/how-do-i-get-and-use-ssh-access HostMonster SSH on HostMonster: http://my.hostmonster.com/cgi/help/180 ServerGrove SSH on
Read more

How to host a domain registered in another account in a Dreamhost account

Posted on

How to host a domain name registered in another account in one Dreamhost account. Simply trying to add the new domain, it reports: Error! You can’t add that domain: already in our system You need to delete the domain from your hosting (DNS) from the account first. Don’t worry, the domain name is still there
Read more

Excerpt in homepage, category, tag and author pages for WordPress theme Twenty Thriteen

Posted on

Excerpt in homepage, category, tag and author pages for WordPress theme Twenty Thriteen. Also add the “read more” link after the excerpt. The patch: diff –git a/wp-content/themes/twentythirteen/content.php b/wp-content/themes/twentythirteen/content.php index 4f61b22..53b4686 100644 — a/wp-content/themes/twentythirteen/content.php +++ b/wp-content/themes/twentythirteen/content.php @@ -30,7 +30,7 @@ </div><!– .entry-meta –> </header><!– .entry-header –> – <?php if ( is_search() ) : // Only display
Read more

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