Skip to main content

Posts

Showing posts from October, 2014

String Cloning

String Copy Functions Coders, programmers and all the rookies who are new to programming always use string copy functions.As the name suggests, these are standard library functions which copies one string into other.Here we'll discuss two standard functions: strcpy() : which copies the whole string into another strncpy() : which copies a part of one string into another Syntax The first function takes 2 arguments: strcpy(char *target, char *source) ; The second function takes 3 arguments: strncpy(char *target, char *source, int n) ; Here "n" represents the number of characters which are to be copied into another string Working Example #include #include int main() { int n ; char source[25], target[25] ; strcpy(source, "fetch-info.blogspot.com") ; strncpy(target, source, 10) ; printf("Source String: %s\n", source) ; printf("Target String: %s",target) ; return 0 ; } OUTPUT Source String: fetch-info.bl

Is your blog SECURE..??

Your Blog is already in the "cloud" A couple of days prior, I got an email from Sam who lives up to expectations for "Singlehop, an organization that has some expertise in distributed computing." He clarified that "Because of late occasions like Heartbleed, the Target break and the spilling of superstar photographs to people in general, the world is swirling about "the cloud." On the other hand, you may be pondering what precisely it is and what it does. We are trusting you would be intrigued by offering a post to your perusers about distributed computing in regular life. More or less, the cloud is an approach to store information remotely, as opposed to on your home machine. This provides for you simple access to your photographs, archives, and different records from anyplace whenever. We are trusting that by spreading mindfulness about how the cloud functions, we can help other people settle on more astute choices about what they post/offer

CSS Selectors

CSS Selectors >As I told you in the last article that CSS selector is used to determine which html element of your web page you want to style.In this post, you'll get to know about a lot of CSS selectors which you can use while styling your web page.I have provided you a list with a brief description of the selector.If you want to know the format of using a CSS selector then read about CSS Syntax here then you can read and understand the list easily. Selector Example Example description CSS . class .intro Selects all elements with class="intro" 1 # id #firstname Selects the element with id="firstname" 1 * * Selects all elements 2 element p Selects all <p> elements 1 element,element div, p Selects all <div> elements and all <p> elements 1 element element div p Selects all &l

Marvel's "Avengers:Age of Ultron" Trailer Released

Avengers are Back..... So guys.. Wait for the Avengers: Age of Ultron has come near to the end.Marvel has released the official trailer of the Movie And it is clear that the movie will be released in the upcoming May.Here i have provided you a full list of countries where the release date of the movie has been planned.. The synopsis of the movie have not been revealed yet but the trailer says a lot itself about this grand movie.. You can Enjoy the trailer here directly....

Google URL Shortener

Google URL Shortener URL (Uniform Source Locator) is like a pointer which points to a web address.Sometimes these pointers have a very massive name that it comes out to be difficult for you to remember them.The solution to this problem is very simple.Google is the God of Networking and hence here is nothing in which google can't help you.Google announced this service in 2009 and it is very effective because it keeps a record of number of clicks the shortened url get and also generates a QR Code for web pages. You can use Google url Shortener directly without any need to sign in.The benefit of using this service after signing in to your account is that you can analyse your history and the number of clicks. Here is a very short procedure of using Google URL shortener.... Go to Google URL Shortener. Paste your long url in the input field. And then click on "Shorten URL". A shorten url will appear which you can use as an alternative to your original UR

How to add gadgets to your blog

How to add gadgets to your blog Gadgets/widgets are important part of your blog.People always wonder about how to add various gadgets to their blog.Though there are many blogging platforms,this article covers only the blogger which is a publishing tool supported by Google. There are two types of gadgets which you can add to your blog to make your blog more interactive. Blogger Gadgets External Gadgets Blogger Gadgets Blogger gadgets are those gadgets which are offered by blogger and can be easily added to your blog.Here are a few steps you need to follow. Log into your blogger account. Go to the Layout tab in the left of the menu There you will see many slots with a label "Add a Gadget". Click on the slot and a list of gadgets will appear from which you can select any gadget you want. After adding the gadget, you can drag to your recommended position  where you like it to be appeared. After following all the steps, Click on Save arrangements and Ta-

CSS Syntax

CSS Syntax Introduction to CSS CSS refers to the cascading sheet styles which is a new way to design web pages.It comes to great significance because of its portability.Those who are known to programming know that we can include or import files to our program.Using CSS we can import or link other cascading styles int our webpage without retyping the code.Its really useful when you design big webpages of thousands of lines of code.Before we learn all the properties of CSS we first must know its syntax. CSS syntax CSS is a styling way which means that is should start and end with some specific tag which would tell the browser that "hey!This part is for styling and don't display it".That specific tag is.. <style> :- start of style code </style> :-end of style code CSS syntax consists of 2 elements;- 1.CSS selector                                                           2. Block of code CSS selector is a tag which determines which element o

Android 5.0: Lollipop

Android Family's New member A new member has joined the google android's family and its name is LOLLIPOP-More powerful than its ancestors and most ambitious release on android with over 5000 new APIs for developers . Lollipop is made for a world where moving throughout the day means interacting with a bunch of different screens—from phones and tablets to TVs. With more devices connecting together, your expectation is that things just work. With Lollipop, it’s easier than ever to pick up where you left off, so the songs, photos, apps, and even recent searches from one of your Android devices can be immediately enjoyed across all the other ones. Lollipop Forest Release Date If you're buying a Nexus 6 or Nexus 9, you can get Android Lollipop from November 3rd (if you're in the UK, you'll be able to pre-order in November and receive your phablet or tablet within a few weeks). But if you already have a Nexus 5, 7 or 10 you should get it in a free over-the-a

Bubble Sort

Bubble Sorting Among variaous other sorting algorithm, bubble sort algorithm is one of the popular and frequently used algorithm to sort elements either in ascending or descending order. Bubble sort algorithm starts by comparing the first two elements of an array and swapping if necessary, i.e., if you want to sort the elements of array in ascending order and if the first element is greater than second then, you need to swap the elements but, if the first element is smaller than second, you mustn't swap the element. Then, again second and third elements are compared and swapped if it is necessary and this process go on until last and second last element is compared and swapped. This completes the first step of bubble sort. If there are  n  elements to be sorted then, the process mentioned above should be repeated  n-1  times to get required result. But, for better performance, in second step, last and second last elements are not compared becuase, the proper element is a

Insertion Sorting-Some Extra Stuff

Insertion Sorting Intro:- Insertion sort is one of the many sorting algorithms which implements sorting in a very elegant way. It is much less efficient on large lists than more advanced algorithms such as  quicksort , heapsort, or  merge sort .Its algo is easy to understand.If the first few objects are already sorted, an unsorted object can be inserted in the sorted set in proper place. This is called insertion sort. An algorithm consider the elements one at a time, inserting each in its suitable place among those already considered (keeping them sorted). Insertion sort is an example of an incremental  algorithm; it builds the sorted sequence one number at a time. This is perhaps the simplest example of the incremental insertion technique, where we build up a complicated structure on n items by first building it on n − 1 items and then making the necessary changes to fix things in adding the last item. The given sequences are typically stored in arrays.  Click Here for exa

Selection Sort

Selection Sorting Selection sort algorithm starts by compairing first two elements of an array and swapping if necessary, i.e., if you want to sort the elements of array in ascending order and if the first element is greater than second then, you need to swap the elements but, if the first element is smaller than second, leave the elements as it is. Then, again first element and third element are compared and swapped if necessary. This process goes on until first and last element of an array is compared. This completes the first step of selection sort. If there are  n  elements to be sorted then, the process mentioned above should be repeated  n-1  times to get required result. But, for better performance, in second step, comparison starts from second element because after first step, the required number is automatically placed at the first (i.e, In case of sorting in ascending order, smallest element will be at first and in case of sorting in descending order, largest ele

How Cyclone Hudhud got its name

Nomenclature of Cyclones This is the thing i am sure you didn't know earlier.Almost everyone understands what does a cyclone mean But what you don't know is that there is a committee/organisation which takes care of the names given to these disastrous happening.And the most interesting thing is that the name which is to be given to a cyclone must not hurt someone's feelings and must be remembered easily. Did you know Cyclone Hudhud, expected to hit India's south-eastern coast on Sunday afternoon, was "born" in Oman? Hudhud in Visakhapatnam

Hard Truth About Albert Einstein

Einstein was a ladies' man: Einstein's Wives and Affairs....:-o First wife, Mileva Mileva Maric was the only female physics major at the Polytechnic in Zurich, where Einstein went to college. During their second semester, Einstein and Mileva began to take interest in each other. Their relationship developed into a romance that eventually led to marriage, in spite of strong opposition from Einstein's family (especially his mother). Second Wife, Elsa After Einstein divorced Mileva (his infidelity was listed as one of the reasons for the split), he soon married his cousin Elsa Lowenthal. Actually, Einstein also considered marrying Elsa's daughter (from her first marriage) Ilse, but she demurred: Before marrying Elsa, he had considered marrying her daughter, Ilse, instead. According to Overbye, “She (Ilse, who was 18 years younger than Einstein) was not attracted to Albert, she loved him as a father, and she had the good sense not to get involved. But it wa

Algorithmic Complexity

Algorithmic Complexity Introduction Algorithmic complexity is concerned about how fast or slow particular algorithm performs. We define complexity as a numerical function T(n) - time versus the input size n . We want to define time taken by an algorithm without depending on the implementation details. But you agree that T(n) does depend on the implementation! A given algorithm will take different amounts of time on the same inputs depending on such factors as: processor speed; instruction set, disk speed, brand of compiler and etc. The way around is to estimate efficiency of each algorithm asymptotically . We will measure time T(n) as the number of elementary "steps" (defined in any way), provided each such step takes constant time. Let us consider two classical examples: addition of two integers. We will add two integers digit by digit (or bit by bit), and this will define a "step" in our computational model. Therefore, we say that addition of two n-bit

Sorting-A New Approach

Run-Time Sorting There are so many ways to sort numbers like quick sort , heap sort, selection sort, merge sort , insertion sort etc but there is another way to sort numbers.This method sorts the numbers during run-time.It implies that as you enter the new number, the number is stored in the sorted order in the array.The best things about this method are.. It does not require a link-list. There is no limit on the numbers of input.You can enter as many numbers as you want. Algorithm Firstly create a memory block using malloc(), then input a number. Find the place where the number is to be stored in the array. Its very simple and can easily be implemented.Its complexity analysis hasn't done yet.The following pic can help you understand the method.

Merge-Sort

Merge Sorting Merge sorting also works on the principle of "divide and conquer".The algorithm of merge sort is quite different from that of quick-sort but its best case performance is also O(nlog(n)).The step by step process is- Divide the unsorted list into n sublists, each containing 1 element (a list of 1 element is considered sorted). Repeatedly merge sublists to produce new sorted sublists until there is only 1 sublist remaining. This will be the sorted list. How it is actually implemented is described here.... Firstly divide the given array of n elements into n individual numbers. Then compare the adjacent elements and merge them in the sorted order. Then compare the corresponding elements of the resulting lists and arrange them in the sorted order. And finally the sorted list will be obtained. The following link will help you in understanding it. Want to see the example code..?? CLICK HERE Complexity Analysis of Merge Sort Worst Case Ti

Quick-Sort

Quick Sort, as the name suggests, sorts any list very quickly. Quick sort is not stable search, but it is very fast and requires very less aditional space. It is based on the rule of Divide and Conquer (also called partition-exchange sort ). This algorithm divides the list into three main parts : Elements less than the Pivot element Pivot element Elements greater than the pivot element As the image suggests, a pivot is selected at first which is 4 in our case.It then compares the other members with the pivot and divides the list into three main parts as discussed above. The next step is to call this function recursively.It will return one number if only one member is left in any of the three parts. Complexity Analysis of Quick Sort Worst Case Time Complexity : O(n 2 ) Best Case Time Complexity : O(n log n) Average Time Complexity : O(n log n) Space Complexity : O(n log n) Space required by quick sort is very less, only O(n log n) additional space is re

Diwali : An Incredible Festival

DIWALI || An Epic Festival DIWALI Diwali is the festival of cultural, religious and spiritual significance (means the awareness and celebration of the inner light) for Hindus. According to the Hindu mythology it is believed that there is something which is pure, never-ending, unchanging and eternal beyond our physical body as well as mind called Atman. People celebrate Diwali to enjoy the triumph of truth over the sin.

Creating An Array of Variable Size-2

Another Method for Array of Variable Size So, I have already introduced you to a new method to create an array of variable size but there is a drawback in that method. (Those who have not red that method yet can have a look at it. Click here ) And the drawback is that you have to create another function to create that array and sometimes you need to enter a variable of which the array size is selected and that variable is to be entered in the middle of your program then you have to call the another function to create the array in middle of your program.And suppose if the variable in inside a loop then array is created so many times but you need only the first case.In that scenario, the previous method would not be suitable. But for small programs that method is still valuable. Here i am presenting you another method to do our job. That method is based on the technique of dynamic memory allocation.Here what we do is that we create a pointer variable and then required