/How To

Generate a Random Integer in Python

In this example we can see how to generate a random number in Python. import random x = random.randint(0,200) print x In the first row we import Python random module. It's contains different useful functions to generate random numbers. In the second row we use function randint from the imported module to generate integer between [...]

By |2017-11-25T22:19:08+00:00November 25th, 2017|Categories: How To|Tags: , |0 Comments

Install pip on Windows

What is pip? The pip command is a tool for installing and managing Python packages, such as those found in the Python Package Index. It makes the community's wealth of libraries accessible to everyone. New users are no longer excluded from using community libraries by the prohibitive difficulty of setup. It's a replacement for easy_install. When [...]

By |2017-11-25T17:10:07+00:00November 21st, 2017|Categories: How To|Tags: , |0 Comments

Adding an Options Page in WordPress Settings Menu

When you want to add an options page in WordPress, you need to use function add_options_page. This example will create one page containing a simple sting: add_action( 'admin_menu', 'my_menu' ); function my_menu() { add_options_page( 'Menu Title', 'Page Title', 'manage_options', 'page-slug', 'callback_fn' ); } function callback_fn() { echo "Some text"; } First part of the example adds [...]

By |2017-07-07T23:52:26+00:00July 7th, 2017|Categories: How To|Tags: , |0 Comments

Flush DNS cache in Google Chrome

Chrome is a browser that uses its own DNS cache. To flush(clear) the existing cache, we need to complete the following steps: Navigate to chrome: // net-internals / # dns page Click "Clear host cache" button In some cases, clearing the DNS cache is not sufficient and you need to clear socket pool: Navigate to chrome: // net-internals / [...]

By |2017-05-26T21:52:24+00:00May 26th, 2017|Categories: How To|Tags: , |0 Comments

Mean Value with R

In this example I'll show you how to find the average value of a vector using R language. First we declare a vector with the numbers we want to find the average of and write in the variable a. The declaration of the vector is obtained by the command "c" (derived from "combine"). The assignment to [...]

By |2017-05-09T21:56:45+00:00May 8th, 2017|Categories: How To|Tags: , |0 Comments

Generating Sound Signal in C#

Using C# you can generate a simple beep signal from a computer. This can be achieved using the following console application code: using System; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { Console.Beep(440, 1000); } } } When you start the program you will hear the sound lasting one second. We use [...]

By |2017-04-18T21:58:11+00:00April 17th, 2017|Categories: How To|Tags: , , |0 Comments