How to use OCaml as a script language?

Posted on

How to use OCaml as a script language like bash and python? It will be good that I can write a script in OCaml and directly invoke it. For example, I write a script named “script.ml” and then I can invoke it directly by $ ./script.ml Thanks! Three helloworld scripts: script3.ml #! /usr/bin/env ocaml print_string
Read more

Is cin much slower than scanf in C++?

Posted on

I frequently hear that cin is significantly slower than scanf in C++. Is this true? And how to improve the efficiency of cin? It is really nice to use most of time. One discussion about that cin is very slow is here: http://apps.topcoder.com/forums/?module=Thread&threadID=508058&start=0&mc=7 In short: cin is not always slower (can be faster actually, see
Read more

Printing Integers in Hexadecimal Format in Python

Posted on

Printing integers in hexadecimal format in Python is a simple task that can be accomplished using the built-in hex() function. By following the steps outlined in this post, you can easily print integers in hexadecimal format in Python. Additionally, by using string formatting, you can control the format of the hexadecimal output to suit your
Read more

Are You Wanting to Learn a Programming Language? Read Before Your Make a Choice

Posted on

Making a career choice is difficult. And, if you have decided on becoming a programmer, the difficulty is just beginning. The most important thing is to first decide the language that you want to learn and this is often the most difficult decision. The good part is that you know you need to focus on
Read more

How to Upload Large Files to Amazon S3 with AWS CLI

Posted on

Amazon S3 is a widely used public cloud storage system. S3 allows an object/file to be up to 5TB which is enough for most applications. The AWS Management Console provides a Web-based interface for users to upload and manage files in S3 buckets. However, uploading a large files that is 100s of GB is not
Read more

How to Configure Linux Kernel Video Mode for 32-bit and 16-bit Boot Protocols

Posted on

The Linux kernel has a generic driver for a graphic framebuffer named vesafb on intel boxes. It provides a nice large console for most of modern displays. Setting VESA modes for Linux kernel with 32-bit and 16-bit boot protocol are different. We introduce both methods here. Linux kernel with 32-bit boot protocol For machine with
Read more

Installing ns-2 and ns-3 on Fedora Linux

Posted on

ns is a discrete-event network simulator targeted primarily for research and educational use. There are two version of ns, ns-2 and ns-3, which are quite different with each other in the implementation and method to use them. In this post, we introduce how to install ns-2 and ns-3 on Fedora Linux 15. Install ns-2.34 on
Read more

Compiz-fusion on Fedora

Posted on

1. Install relevant packages #yum install ccsm emerald-themes compizconfig-backend-gconf fusion-icon-gtk emerald compiz-fusion compiz-fusion-gnome libcompizconfig compiz-gnome compiz-bcop compiz compizconfig-python compiz-fusion-extras compiz-fusion-extras-gnome 2. Start compiz-fusion by using command “fusion-icon”. It can be found in “Applications -> system tools -> fusion-icon”. It will be more convenient if “fusion-icon” is added to autostart list by adding a entry in
Read more