Blog

TheVerge-Feeds

  • Celebrate Star Trek: Discovery’s return with one of the best episodes of the most neglected Trek series
    by Noel Murray on January 18, 2019 at 4:46 pm

    There are so many streaming options available these days, and so many conflicting recommendations, that it’s hard to see through all the crap you could be watching. Each Friday, The Verge’s Cut the Crap column simplifies the choice by sorting through the overwhelming multitude of movies and TV shows on subscription services and recommending a single perfect thing to watch this weekend. What to watch “Yesteryear,” a 1973 episode of Star Trek: The Animated Series. Written by D.C. Fontana (a key contributor to the original 1960s Star Trek, who penned 10 episodes and served as the story editor), “Yesteryear” takes place in the wake of a routine fact-finding mission into a “time vortex.” Though Captain James T. Kirk and the USS Enterprise’s... Continue reading […]

  • Facebook Messenger’s redesign is finally rolling out to all
    by Jon Porter on January 18, 2019 at 4:44 pm

    Facebook Messenger’s redesign, which was first announced at Facebook’s F8 developer conference last May, is finally here. Its listing on both the App Store and the Google Play Store has been updated to show the new interface, and we’ve verified that it’s available across both operating systems, but the Messenger team has said that it might take a little time for the update to be available for everyone. The aim of the redesign is to make the chat client simpler and to put your messages front and center once again. But despite this, it’s taken a surprising amount of time to actually see a widespread release. Following its announcement in May, the redesign entered a prolonged rollout period in October, but since then, the only way to... Continue reading […]

  • GDPR complaints say Amazon, Spotify, and other streaming companies are breaking EU law
    by Colin Lecher on January 18, 2019 at 4:33 pm

    A series of complaints brought under Europe’s General Data Protection Regulation (GDPR), filed by an Austrian privacy activist, accuse eight major streaming companies of failing to comply with European Union law. GDPR, which went into effect last year, created a set of strict privacy rules around when data can be gathered and shared. Already, tech giants like Google and Facebook have faced questions about whether some of their practices align with the law. Group asked eight streaming providers for data The latest challenges have been filed by the privacy group noyb, led by activist Max Schrems. Under GDPR, consumers are allowed to request data that companies hold on them. As a test, noyb says it asked eight major streaming media... Continue reading […]

  • Garmin data used to convict British runner for the murder of two gangsters
    by Makena Kelly on January 18, 2019 at 4:19 pm

    A British runner, sous chef, and underworld hitman was sentenced to life behind bars for the murder of two other Manchester-area gangsters this week — all due to data found on his Garmin Forerunner, according to the BBC. Mark “Iceman” Fellows was under investigation for the murders of organized crime leader Paul “Mr. Big” Massey and his associate John Kinsella in 2015 when authorities decided to dig into his Garmin account data for evidence. While investigating Fellows, the Liverpool Echo reported, Manchester Police noticed the GPS smartwatch in photos of him running the 2014 Great Manchester 10K and searched for the device in his home. The Garmin showed Fellows traveling to areas around the home where Massey was killed The Garmin showed... Continue reading […]

  • Vergecast: Galaxy S10 and Pixel 3 ‘Lite’ leaks
    by Andrew Marino on January 18, 2019 at 3:54 pm

    This week on The Vergecast, Nilay, Paul, and Dieter run through a week of gadget news. Images of the Google Pixel 3 “Lite” and the Samsung Galaxy S10 have leaked, starting up a new season of phone releases. The crew also looks forward to what Google will do with its investment in Fossil’s smartwatch tech, Microsoft’s experiment with foldable devices, and how the Federal Trade Commission will react to Tim Cook’s call to give consumers more privacy. There’s a whole lot more in this week’s episode — including Paul’s weekly segment “Please replace magenta” — so listen to it all to stay informed. 06:28 - Google just spent $40 million for Fossil’s secret smartwatch tech 11:22 - Google Pixel 3 ‘Lite’ leaks in extensive video 18:45 - M... Continue reading […]

  • Verizon will offer free spam protection to all of its customers
    by Dami Lee on January 18, 2019 at 3:16 pm

    Verizon announced this week that it will offer free spam and robocall protection to its subscribers starting in March. The Call Filter service, which was previously available as a $3 add-on, will be offered for free to all Verizon customers with phones that support the features, including iPhones and Android phones. The move finally puts Verizon on par with competing carriers like T-Mobile and AT&T that have been offering the same spam filtering service for free. Preventing robocalls has been a difficult process because spammy callers have found ways to make spoof calls from local numbers, making it more likely that people will pick up the calls. In late 2018, the Federal Communications Commission mandated that carriers must adopt a new... Continue reading […]

  • Western Digital’s Black SSD gets upgraded performance and a heat sink for gaming
    by Chaim Gartenberg on January 18, 2019 at 3:05 pm

    Western Digital has announced an updated version of its WD Black SSD, the WD Black SN750, a more incremental update that looks to improve on performance from last year’s version. It’s also offering a heat sink-equipped variant that’s designed specifically for gaming. The second-generation drive keeps things largely the same as the original from a hardware perspective. AnandTech noted in its review that the changes are largely on the firmware side of things, optimizing the existing hardware for even better performance and speed. (There’s also a new 2TB model being added to the lineup along with the aforementioned heat sink versions, although those won’t be available until later this spring.) Image: Western Digital The... Continue reading […]

  • How to watch the only total lunar eclipse of 2019 this weekend
    by Loren Grush on January 18, 2019 at 2:00 pm

    The first — and only — total lunar eclipse of 2019 is happening on Sunday, January 20th, and those who live in North and South America will have a front row seat to the whole bloody show. During the eclipse, the Moon will turn a creepy shade of red, which is why these events are often referred to as Blood Moons. This particular eclipse is even more special than usual, as the Moon will be a tad closer to us than it normally is. There’s a lot going on with this event, so let’s break down this particular eclipse. Here’s how these events happen, what makes this one special, and why some people are calling this eclipse a “Super Blood Wolf Moon.” No, really. Sorry, please explain to me what a lunar eclipse is again? A lunar eclipse occurs... Continue reading […]

  • How to set up multiroom music playback with Google Home speakers
    by Barbara Krasnoff on January 18, 2019 at 2:00 pm

    One of the great advantages of having several Google Home speakers is the ability to play the same music throughout your house. Let’s say you’re cleaning the house, and you want to be able to move from the upstairs bedrooms to the downstairs living room without missing a beat. It’s really simple to set up, and it’s worth the five minutes it takes. (You can find out how to do the same thing with Amazon Echo speakers here.) First, go to your Google Home app on your phone. (If you don’t have it yet — and you should if you own a Google Home device — download it from Google Play or the iTunes App Store.) Then, tap on the “Account” icon, the rightmost icon at the bottom of your screen. Tap on “Set up or add” and then “Create... Continue reading […]

  • Microsoft to end Windows 10 Mobile updates and support in December
    by Tom Warren on January 18, 2019 at 1:41 pm

    Microsoft is planning to end support for Windows 10 Mobile devices in December. While Microsoft revealed back in 2017 that the company was no longer developing new features or hardware for Windows 10 Mobile, security and software updates have continued. These security updates will now cease on December 10th 2019, and devices will be unsupported after this date. “Windows 10 Mobile, version 1709 (released October 2017) is the last release of Windows 10 Mobile and Microsoft will end support on December 10, 2019,” reads a Microsoft support note that was updated this week. Microsoft is now recommending that Windows 10 Mobile users move to iOS or Android devices. “With the Windows 10 Mobile OS end of support, we recommend that customers move... Continue reading […]

C#- Collection

We had posted about  array before. however C# also includes specialized classes that hold many values or objects in a specific series, that are called ‘collection’.
There are two types of collections available in C#: non-generic collections and generic collections.and now we are going to learn about non-generic collections

Every collection class implements the IEnumerable interface so values from the collection can be accessed using a foreach loop.

The System.Collections namespace includes following non-generic collections.

Non-generic Collections Usage
ArrayList ArrayList stores objects of any type like an array. However, there is no need to specify the size of the ArrayList like with an array as it grows automatically.
SortedList SortedList stores key and value pairs. It automatically arranges elements in ascending order of key by default. C# includes both, generic and non-generic SortedList collection.
Stack Stack stores the values in LIFO style (Last In First Out). It provides a Push() method to add a value and Pop() & Peek() methods to retrieve values. C# includes both, generic and non-generic Stack.
Queue Queue stores the values in FIFO style (First In First Out). It keeps the order in which the values were added. It provides an Enqueue() method to add values and a Dequeue() method to retrieve values from the collection. C# includes generic and non-generic Queue.
Hashtable Hashtable stores key and value pairs. It retrieves the values by comparing the hash value of the keys.
BitArray BitArray manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0).

we will take the above one by one and learn more about them in the next couple of blog posts :).

C# – Array

An array is a special type of data type which can store fixed number of values sequentially using special syntax.

The following image shows how an array stores values sequentially.


 

As you can see in the above figure, index is a number starting from 0, which stores the value. You can store a fixed number of values in an array. Array index will be increased by 1 sequentially till the maximum specified array size.

Array Declaration

An array can be declare using a type name followed by square brackets [].

Example: Array declaration in C#
int[] intArray; // can store int values
bool[] boolArray; // can store boolean values

string[] stringArray; // can store string values

double[] doubleArray; // can store double values
byte[] byteArray; // can store byte values
Courses[] customClassArray; // can store instances of Courses class

Initialization

An array can be declared and initialized at the same time using the new keyword. The following example shows the way of initializing an array.

Example: Array Declaration & Initialization
// defining array with size 5. add values later on
int[] intArraySample1 = new int[5]; 
// defining array with size 5 and adding values at the same time
int[] intArraySample2 = new int[5]{1, 2, 3, 4, 5};
// defining array with 5 elements which indicates the size of an array
int[] intArraySample3 = {1, 2, 3, 4, 5};

In the above example, the first statement declares & initializes int type array that can store five int values. The size of the array is specified in square brackets. The second statement, does the same thing, but it also assignes values to each indexes in curley brackets { }. The third statement directly initializes an int array with the values without giving any size. Here, size of an array will automatically be number of values.

Initialization without giving size is NOT valid. For example, the following example would give compile time error.

Example: Wrong way of initializing an array
int[] intArray = new int[]; // compiler error: must give size of an array

Late initialization

Arrays can be initialized after declaration. It is not necessary to declare and initialize at the same time using new keyword. Consider the following example.

Example: Late initialization of an Array
string[] strArray1, strArray2;

strArray1 = new string[5]{ "1st Element",
                           "2nd Element", 
                           "3rd Element",
                           "4th Element",
                           "5th Element" 
                          };


strArray2 = new string[]{ "1st Element",
                           "2nd Element",
                           "3rd Element",
                           "4th Element", 
                           "5th Element" 
                          };

However, in the case of late initialization, it must be initialized with the new keyword as above. It cannot be initialize by only assigning values to the array.

The following initialization is NOT valid:

Example: Wrong way of initializing an array
string[] strArray;

strArray = {"1st Element","2nd Element","3rd Element","4th Element" };

Accessing Array Elements

As shown above, values can be assigned to an array at the time of initialization. However, value can also be assigned to individual index randomly as shown below.

Example: Assigning values to array index
int[] intArray = new int[5];
intArray[0] = 10;
intArray[1] = 20;
intArray[2] = 30;
intArray[3] = 40;
intArray[4] = 50;

In the same way, you can retrieve values at a particular index, as below:

Example: Accessing Array elements

intArray[0];  //returns 10
intArray[2];  //returns 30

Use a for loop to access the values from all the indexes of an array by using length property of an array.

Example: Accessing Array elements using for loop
int[] intArray = new int[5]{10, 20, 30, 40, 50 };

for(int i = 0; i < intArray.Length; i++)
    Console.WriteLine(intArray[i]);   
10 
20
30
40
50

Array properties and methods

Method Name Description
GetLength(int dimension) Returns the number of elements in the specified dimension.
GetLowerBound(int dimension) Returns the lowest index of the specified dimension.
GetUpperBound(int dimension) Returns the highest index of the specified dimension.
GetValue(int index) Returns the value at the specified index.
Property Description
Length Returns the total number of elements in the array.

Array Helper Class

.NET provides an abstract class, Array, as a base class for all arrays. It provides static methods for creating, manipulating, searching, and sorting arrays.

For example, use the Array.Sort() method to sort the values:

Example: Array Helper class
int[] intArr = new int[5]{ 2, 4, 1, 3, 5};

Array.Sort(intArr);

Array.Reverse(intArr);

You can create an instance of an Array that starts with index 1 (not default starting index 0) using Array class as shown below:

Example: Array Helper class
Array array = Array.CreateInstance(typeof(int),new int[1]{5},new int[1]{1});

array.SetValue(1, 1);
array.SetValue(2, 2);
array.SetValue(3, 3);
array.SetValue(4, 4);
array.SetValue(5, 5);

for (int i = 1; i <= array.Length; i++)
    Console.WriteLine("Array value {0} at position {1}", array.GetValue(i), i);
Output:

Array value 1 at position 1
Array value 2 at position 2
Array value 3 at position 3
Array value 4 at position 4
Array value 5 at position 5

 never forget  :
  1. An Array stores values in a series starting with a zero-based index.
  2. The size of an array must be specified while initialization.
  3. An Array values can be accessed using indexer.
  4. An Array can be single dimensional, multi-dimensional and jagged array.
  5. The Array helper class includes utility methods for arrays.

C# Variable

Example: C# Variable

namespace CSharpTutorials
{
    class Program
    {
        static void Main(string[] args)
        {
            string message = "Hello World!!";

            Console.WriteLine(message);
        }
    }
}

The variable in C# is nothing but a name given to a data value. In the above example, message is the name of the variable that stores the string data value “Hello World!!”. As the name suggests, the contents of a variable can vary, i.e., you can change the value of a variable at any time.

In C#, a variable is always defined with a data type. The following is the syntax variable declaration and initialization.

Variable Syntax:
<data type> <variable name>;

<datatype> <variable name> = <value>;

A variable can be declared and initialized later or it can be declared and initialized at the same time. In the following example, the first statement declares a variable called “message” without assigning any value to it. In the second statement, a value is assigned to the “message” variable.

Example: Variable Declaration
string message;

// value can be assigned after it declared 
message = "Hello World!!";

In the following example, variable is declared and initialized (a value is assigned to it) at the same time.

Example: Variable Declaration & Initialization
string message = "Hello World!!";

Multiple variables of the same data type can be declared and initialized in a single line separated by commas.

Example: Multiple Declarations
int i, j, k, l = 0;

int amount, num;

When declaring multiple variables of the same data type, you can put them in multiple lines for the sake of readability; even if split across multiple lines, the compiler will consider it to be one statement, until it encounters a semicolon (;).

Example: Multi-Line Declarations
int i, j, 
    k, 
    l = 0;

The value of a variable can be assigned to another variable of the same data type. However, a value must be assigned to a variable before using it.

Example: Variable Assignment
int i = 100;

int j = i; // value of j will be 100

The following example would give a compile time error because string value cannot be assinged to a int type variable.

Example: Invalid Variable Assignment
string message = "Hello World!!";

int i = message; // compile time error

You must assign a value to a variable before using it otherwise the compiler will give an error. For example, in the following code, we have declared a variable called i without assigning any value to it. If we then try to display the value of the variable on the console, we will get a compile time error.

Example: Invalid Variable Assignment
int i;

//Following will give compile time error: "Use of unassigned local variable 'i'"
int j = i;
Console.WriteLine(j); 
 Points to Remember :
  1. The variable is a name given to a data value.
  2. A variable holds the value of specific data type e.g string, int, float etc.
  3. A variable can be declared and initialized in separate statements and also in the single statement.
  4. The value of a variable can be changed at any time throught out the program as long as it is accessible.
  5. Multiple variables can be defined seperated by comma (,) in a single or multiple line till semicolon(;).
  6. A value must be assigned to a variable before using it otherwise it will give compile time error.

First C# Hello World Program

Every console application starts from the Main() method of Program class. The following example code displays “Hello World!!” on the console.

Example: Simple Console Project with C#

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace CSharpTutorials
{
    class Program
    {
            static void Main(string[] args)
        {
            string message = "Hello World!!";
            Console.WriteLine(message);
        }
    }
}

The following image illustrates the important parts of the above example.

Let’s understand the above C# structure.

  1. Every .NET application takes the reference of the necessary .NET framework namespaces that it is planning to use with the “using” keyword e.g. using System.Text
  2. Declare the namespace for the current class using the “namespace” keyword e.g. namespace CSharpTutorials.FirstProgram
  3. We then declared a class using the “class” keyword: class Program
  4. The Main() is a method of Program class which is the entry point of the console application.
  5. String is a data type.
  6. ‘message’ is a variable, that holds a value of a specified data type.
  7. “Hello World!!” is the value of the message variable.
  8. Console is a .NET framework class. WriteLine() is a method which you can use to display messages to the console.
 Note:
Every line or statement in C# must end with a semicolon (;).

Compile and Run C# Program

In order to see the output of the above C# program, we have to compile it and run it by pressing Ctrl + F5, or clicking Run button or by clicking the “Debug” menu and clicking “Start Without Debugging”. You will see following output in the console:

Output:
Hello World!!

C# Access modifiers

Access modifiers are applied on the declaration of the class, method, properties, fields and other members. They define the accessibility of the class and its members.

Access Modifiers Usage
public The Public modifier allows any part of the program in the same assembly or another assembly to access the type and its members.
private The Private modifier restricts other parts of the program from accessing the type and its members. Only code in the same class or struct can access it.
internal The Internal modifier allows other program code in the same assembly to access the type or its members. This is default access modifiers if no modifier is specified.
protected The Protected modifier allows codes in the same class or a class that derives from that class to access the type or its members.

C# Version History

C# is a simple & powerful object-oriented programming language developed by Microsoft.

C# has evolved much since its first release in 2002. C# was introduced with .NET Framework 1.0 and the current version of C# is 6.0.

The following table lists important features introduced in each version of C#:

Version Important Features
C# 1.0
  • Basic features
C# 2.0
  • Generics
  • Partial types
  • Anonymous methods
  • Iterators
  • Nullable types
  • Private setters (properties)
  • Method group conversions (delegates)
  • Covariance and Contra-variance
  • Static classes
C# 3.0
  • Implicitly typed local variables
  • Object and collection initializers
  • Auto-Implemented properties
  • Anonymous types
  • Extension methods
  • Query expressions
  • Lambda expressions
  • Expression trees
  • Partial Methods
C# 4.0
  • Dynamic binding (late binding)
  • Named and optional arguments
  • Generic co- and contravariance
  • Embedded interop types
C# 5.0
  • Async features
  • Caller information
C# 6.0
  • Expression Bodied Methods
  • Auto-property initializer
  • nameof Expression
  • Primary constructor
  • Await in catch block
  • Exception Filter
  • String Interpolation
C# 7.0
  • out variables
  • Tuples
  • Discards
  • Pattern Matching
  • Local functions
  • Generalized async return types
  • throw Expressions

C# – Get Started

C# is an elegant and type-safe object-oriented language that enables developers to build a variety of secure and robust applications that run on the .NET Framework. You can use C# to create Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Visual C# provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to make it easier to develop applications based on the C# language and the .NET Framework.

And here in developersportal.net we are going to post a C# tutorials that will help you learn the essentials of C#, from the basic to advance level topics.

These tutorials are designed for beginners and professionals who want to learn C# step-by-step.

Add Developersportal.net to your favorite and follow us on our Facebook page.

How To Create  multiple site collections with new content databases 

To Create  multiple site  collections with new content databases , follow the bellow steps

1-  create web application  ex:   http://Developersportal.net

2 – from application management > manage web application

3 – select your web app and go to managed path

4 – inter the path and from type combo box select “Explicit inclusion” ex: http://Developersportal.net/Sharepoint

5 – create new content database using SharePoint management shell (run as admin)

 

New-SPContentDatabase -Name wss_Content_SharePoint-WebApplication http://Developersportal.net
6 - create the new site collection by running the bellow powershell script

$url = "http://Developersportal.ner/Sharepoint"
$ContentDatabase = "wss_Content_SharePoint"
$WebsiteName = "Sharepoint"
$WebsiteDesc = "Sharepoint site"
$Template = "STS#1"
$PrimaryLogin = "developersportal\sp_farm"
$PrimaryDisplay = "sp_farm"
$PrimaryEmail = "admin@developersportal.net"

New-SPSite -Url $url 
–ContentDatabase $ContentDatabase 
-Name $WebsiteName 
–Description $WebsiteDesc  
-Template $Template 
-OwnerAlias $PrimaryLogin 
–OwnerEmail $PrimaryEmail


Enjoy your new site collection

It’s official: Microsoft has acquired GitHub for $7.5 billion

After much speculation, Microsoft has confirmed its acquisition of the social coding platform Github in an all-stock deal worth $7.5 billion.

The acquisition is expected to close by the end of the year, subject to regulatory approval.

As part of the purchase, Microsoft is installing a new CEO. Former Xamarin chief Nat Friedman will replace the outgoing GitHub CEO and co-founder, Chris Wanstrath. Microsoft says that Wandstrath will join the company as a technical fellow.

The deal is unlikely to change the day-to-day running of GitHub. Microsoft says that the service will continue to run independently, and will retain its “developer ethos.”

This story is developing.