Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

JavaScript - Learn how to find the difference in multiple arrays using reduce

So when we talk about iteration on arrays in JavaScript, first thing comes in mind is traditional loops, but here we are discussing something that might surprise you that is array reduce() method, so first I’ll tell you, how does array redu...

How to Fetch data from Plist in Swift?

Hi Property List  or plist files provide a convenient way to store and access our data. Data can be stored in the form of array as well as Dictionary. It supports various primitive types such as boolean, data, date, number, and string. ...

Arrays and Hash In Ruby

Ruby's arrays and hashes collections having indexes. They can also be said as indexed collections. Arrays and hashes store collections of objects which can be accessed using a key. Both arrays and hashes grow as needed to hold...

Jquery Arrays: Creation and Manipulation

jQuery.makeArray() is used to transforms any array like object to JavaScript Array. This function is useful for making an element into a array list. Here in this line of code i used one div for explaining the box, in which the data of LI can be d...

Iterators and its usage in ruby

In Ruby, iterators are methods basically used by the collections. Collections are a set of objects. Hashes & Arrays are the example of collections. Iteration is a process by which we can get or set the elements in collections. We will discuss...

An Overview of javascript within a form

Hello everyone , Today in my blog with the help of an example i.e cake form I have illustrated the use of array, if and else statement and JavaScript functions .   Basically the form helps in calculating the price of the cake depending...

split ,find_index , map and capitalize methods in Ruby

Strings in Ruby have an instance method namely split that splits the given String and returns an array of substrings based on the separator given as an argument to it. have a look at these examples: gauravjhadiyal@gauravjhadiyal:~$ irb 2...

find_all method in ruby.

The find_all method has to do with arrays in Ruby.This method simply iterates through all the elements in an array and meanwhile test each of them against a test condition and finally returns an array containing all elements for which the test re...

Merging An Array Using JavaScript

Hello reader's, Today in my blog I will discuss about the merging an array using JavaScript.   Basically the term “Merge” means to combine or join two array into a single array.   In JavaScript , for merging ...

Array Conditions and selecting specific fields to find or retrieve from database (Active records)

Array Conditions and selecting specific fields to find or retrieve from database through Active records Array Conditions To retrieve some specific data from the database we use the where method which gets the records in the form o...

Array and operations on array

Array is used to keep collection of objects. Array in ruby can have any type of objects together. Using array in ruby: >> a = [] >> arr = [1, 0, 7] >> arr[2] # => 7 >> arr.size # => 3 >> arr = ["stri...

How to shuffle an array

Hi all, Shuffling an array means randomly re-arranging the content of an array .Shuffling algorithm can be used in many places now days like in card games, music player , media player etc. Shuffling of an array can be done in two ways. ...

Associative array in PHP

The element of an Array in PHP by default are accessed by the index number i.e. the position in which the element or value is stored in the array. For example : <?php $temperature = array(10, 20, 30, 25); echo "Delhi temperature : ...

How to pass array argument to bash file from php

I was facing this issue of passing the array from php to the bash file. To pass array to bash file write the following lines of code. Php Code: $array= $countries_array; // Countries array from database shell_exec('sh get_countries.sh '....

How to push values in array in jQuery?

Sometimes we need to insert valuse in an array, we can do this by using push() method of jQuery very easily. Example     <!doctype html> <html lang="en"> <head> <meta charset="utf-...

Array of dates between two dates

Hello Friends, To create an array of dates between two dates you may use the following code: 1.Create an NSMutableArray NSMutableArray *datesArray = [NSMutableArray new];   2.Set the date formatter according to your requi...

Sorting an Array ios

Hello Readers, To sort an array in ios you may use the following code snippet: // Name of the key on basis of which you want to sort NSSortDescriptor *dateDescriptor = [NSSortDescriptor sor...

how does foreach loop exactaly work in php

The foreach function in php will be used for a easy way to iterate over the loop and it is only used in array and objects or It will give you an error when you try to use it on a variable with different data type. Syntax: foreach(array_e...

Arrays in JavaScript

JavaScript Arrays : Array is a like a container which contains the same type of objects or elements. Arrays has fixed length. We can access the array elements using the index value.The index of the array starts from 0. Example of creating ...

How to load string array value from string.xml in android

Using below code I have created a load string array value from string.xml. String is a simple resource using the value provided in the name attribute. So we can combine string resources with other simple resourecs in the xml file. Below code will...

ARRAY IN C

ARRAY IN C Arrays is a data structure that can store similar type of data. IN other words an array is a collection of homogenous data (same type of data), which are stored in contiguous memory locations. In an array the first element goes t...

Sorting an array containing mantle model as object

Hi all, To sort an mantle array containing mantle model as object ,You can easily sort by multiple keys by adding more than one to the array. Using custom comparator-methods is possible as well. NSSortDescriptor *sortDescriptor; s...

each, collect and map in ruby

1> 'each' will loop through each element of the array and evaluate whatever is return inside the block, but it returns the original array without any change. a = [5,10,15,20] => [5, 10, 15, 20] a.each {|t| t+2} => [5, 10, 15, 20...

Using reject in ruby to delete elements selectively from an array

1> To delete an element from an array, use reject as shown below: arr = ['a','b','c','d','e'] arr.reject! { |i| i.match('d')} Result :=> ["a", "b", "c", "e"] 2> To delete particular keys from the array whose elements are ...

Applying limit and offset to array

In rails we can apply limit and offset to arrays in different ways. 1> Using "slice" method. slice takes 2 arguments, the first one being the "starting_index" & the second one is the "number_of_elements". syntax :- arrayob...

How to use in_array in php to find value in a array list?

You can take reference form below example to find the value in an array list using php in_array. Suppose you have a list of Favorite List items (for example a list of colors names) and you want search your color is exist in list or not exist. ...

Arrays in C#

Array in C# works as it works in any other language except few differences. When we declare an array we must use a square bracket ([ ]) after the data type. int[ ] number Unlike c arrays, in c# size of array is not part of its type. This...

6 useful code chunks for java coders.

Convert Java util.Date to sql.Date This piece of code shows how to convert a java util Date into a sql Date for use in database. java.util.Date util_date = new java.util.Date(); java.sql.Date sql_date = new java.sql.Date(util_date.getT...
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: