Data Structure?

What is a Data Structure?

  • A data structure is a systematic (or programmatic) way of organizing (or storing) the data, so that the data can be used efficiently.

OR

  • A data structure is a collection (grouping) of simple or structured data types and a set of rules (operations) for organizing and accessing the collection.

OR

  • A logical way of storing data and it also define mechanism of retrieve data.

Data Structure Types?

  • Linear : Data organize in a linear manner where data elements attached one after the other (i.e data items are placed in the memory contiguously).
    • Array
    • Stack
    • Queue
    • Linked List
  • Non – Linear : Data organize in a random manner where data elements are attached one to many (i.e a data item is connected to several other data items).
    • Tree
    • Graph

Possible Operations?

  • Traversing : Accessing each data item exactly once so that it can be processed.
  • Searching : Finding the location of the data item if it exists in the given collection of data items.
  • Insertion : Add a new data item in the structure.
  • Deletion : Removing a data item from the structure.
  • Sorting : Arranging the data items in some order.
  • Merging : Combine two data structures into one.

 

…. more to come soon.

Git commands….

1) Clone repository-

git clone “xyz.git”

2) Add files-

git add “filename.ext” OR *.*

3) Commit files-

git commit -m “message”

4) Push to remote repository-

git push origin master

5) Delete files-

git rm “file-1.txt”    [It deletes from both local and repo]

git rm –cached “file-1.txt”  [It removes only form repo]

6) Delete folder-

git rm -rf “folder name”

7) Status-

git status

8) Pull from remote repository-

git pull –all

How to style numbering on list using CSS ?

As we know that it is very easy to display a list with sequence number in HTML using Ordered list i.e

<ol>
	<li>...</li>
<ol>

numberdlist

but it is quite difficult to apply style on these auto generated numbers as per your page style.

If you are also facing this issue then this article can help you. We can easily create the numbered list using :before pseudo element and list-sequence-counter. Below is the very simple sample code to achieve this –

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
<style>
			.counter-list{
				list-style: none;
				counter-reset: list-sequence-counter;
			}

			.counter-list li{
				margin : 5px;
			}

			.counter-list > li:before{
				content: counter( list-sequence-counter);
				counter-increment: list-sequence-counter;
				margin-right: 5px;
				background: green;
				color: white;
				font-weight: bold;
				padding: 0 6px;
				border-radius: 10px;
			}
</style>

	</head>

	<body>
<ul class="counter-list">
	<li>List Item</li>
	<li>List Item</li>
	<li>List Item</li>
	<li>List Item</li>
	<li>List Item</li>
</ul>
</body>
</html>

Reference-

Numbering In Style

Convert Milliseconds to DateTime.

 Console.WriteLine("Current DateTime : " + DateTime.Now);

DateTime baseDate = new DateTime(1970, 1, 1);
TimeSpan diff = DateTime.Now - baseDate;

Console.WriteLine("Current DateTime in MS : " + diff.TotalMilliseconds);

Console.Write("Milliseconds to DateTime :" + (new DateTime(1970, 1, 1)).AddMilliseconds(diff.TotalMilliseconds));

Starting an Angular 2 RC.5 project

Yakov Fain's Blog

This blog is updated on August 9, 2016

The current version of Angular is Release Candidate 5. It has been released an hour ago, and I’ve started learning again. The major breaking change is how the app is loaded. The RC.5 introduced the concept of modules and now the app is not loaded by invoking the bootstrap() method. You have wrap the root component of your app into a module, which is a class decorated with the @NgModule() annotation and declare your component (or several components, services, directives, providers, and pipes) inside this annotation.

If the Angular code is dynamically compiled in the browser (not to be confused with transpiling), this is called just-in-time compilation (JIT). If the code is precompiled, it’s called ahead-of-time (AoT) compilation. In this blog we’ll do the JIT compilation.

To start a new project managed by npm, create a new directory (e.g. angular-seed) and open…

View original post 1,022 more words

Programming is Easy…

%d bloggers like this: