- // Author: Arda Basoglu, [email protected]
- // This example demonstrates the use of map like (like hash map in Java and dictionary in C#) data structure
- // The code is tested with a machine Node.js installed
- // If you have Node.js installed on your machine run the script by writing "node map.example.js" on the console
- // create a map
- var map = {};
- // Add key, value pairs into the map with random strings
- for (var i = 0; i < 500; i++) {
- var item =generateRandomString();
- var value = generateRandomString();
- map[item] = value;
- };
- // Output every key, value pair onto the screen
- for (var i in map) {
- }
- // The function required for generating random strings
- function generateRandomString()
- {
- var randomString = "";
- var randomStringSource = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- for( var i=0; i < 5; i++ ){
- }
- return randomString;
- }
0 Comments
How to fix the installation problem of the module "pg" for Node in Mac OS X Problem
When you issue npm install pg command to instal pg package for Node on your Mac OS X, you might get an error like this "...error: The program ['pg_config'] is required" Error simply implies that pg installation cannot find pg_config file. Solution 1. First make sure you installed PostgreSQL. 2. Find the path to your pg_config file. In my case it is /Library/PostreSQL/8.4/bin/pg_config 3. Open the Terminal and enter the following commands one by one PG_CONFIG=/Library/PostreSQL/8.4/bin/pg_config export PG_CONFIG npm install pg |
AuthorArda Basoglu is a digital marketing agency owner, software engineer/developer, musician. Worked for several companies: TWB, BNB Software, PINC Solutions, hakia, Nurol, NTV. Archives
October 2023
Categories
All
|