TheVerge-Feeds

  • Boeing 737 Max airplane crashes: all of the news, updates, and analyses
    by Andrew J. Hawkins on March 21, 2019 at 2:37 pm

    Two deadly crashes, with investigators initially focusing on faulty anti-stall technology Continue reading […]

  • Google’s Stadia looks like an early beta of the future of gaming
    by Tom Warren on March 21, 2019 at 2:00 pm

    “The future of gaming is not a box,” according to Google. “It’s a place.” Just like how humans have built stadiums for sports over hundreds of years, Google believes it’s building a virtual stadium, aptly dubbed Stadia, for the future of games to be played anywhere. You won’t need an expensive gaming PC or a dedicated game console. Instead, you’ll just need access to Google’s Chrome browser to instantly play games on a phone, tablet, PC, or TV. It’s a bold vision for where gaming is heading, and Google hopes its Stadia cloud streaming service will make it a reality. Google may have just unveiled the future of gaming at the Game Developers Conference (GDC), but it’s a future the company has left us knowing very little about. ... Continue reading […]

  • T-Mobile starts testing wireless home internet service
    by Jacob Kastrenakes on March 21, 2019 at 1:57 pm

    T-Mobile is starting to pilot a wireless home internet service, offering unlimited LTE data to the home for $50 per month. At launch, the service has extremely limited availability. T-Mobile says it plans to reach just 50,000 homes by the end of the year, primarily in rural markets and markets with limited internet options. The pilot service is meant to test T-Mobile’s ability to deliver a high-speed home internet connection ahead of its 5G rollout. Eventually, T-Mobile plans to launch wireless home internet that relies on 5G, offering much faster service. For now, T-Mobile is only promising speeds of 50 Mbps over LTE — which is acceptable but not particularly fast — whereas the 5G service is supposed to deliver over 100 Mbps. T-Mobile... Continue reading […]

  • Microsoft starts notifying Windows 7 users about end of support
    by Tom Warren on March 21, 2019 at 1:56 pm

    Microsoft has started rolling out an update to Windows 7 that will notify existing users about the end of the support. The software maker is stopping support of Windows 7 on January 14th, 2020, and it’s now starting to warn about this cutoff date. Microsoft is using a notification to warn Windows 7 users, similar to the prompts the company used to get people to upgrade to Windows 7. Microsoft’s end of support date means that Windows 7 users will no longer receive security updates, and the company wants consumers to upgrade to Windows 10 PCs instead. While the notification doesn’t mention Windows 10, Microsoft links to a new Windows 7 site that encourages consumers to upgrade their PCs. Microsoft revealed earlier this month that these... Continue reading […]

  • Tesla accuses self-driving startup Zoox and former employees of trade secret theft
    by Sean O'Kane on March 21, 2019 at 1:24 pm

    Tesla filed two lawsuits late on Wednesday against multiple former employees and the self-driving startup Zoox for allegedly misappropriating the company’s trade secrets. The Silicon Valley automaker claims that four former employees stole “proprietary information and trade secrets to help Zoox leapfrog past years of work needed to develop and run its own warehousing, logistics, and inventory control operations.” Tesla also claims in a separate case that a former employee stole source code related to the company’s Autopilot driver assistance feature before taking a job at Chinese electric automaker Xiaopeng Motors, or XPeng. Tesla says the group’s alleged theft was “blatant and intentional” Tesla says the four former employees who... Continue reading […]

  • Apple’s show time special event: what to expect from the TV and news service announcements
    by Chris Welch on March 21, 2019 at 1:00 pm

    Apple CEO Tim Cook will take the stage at the Steve Jobs Theater on Monday to unveil two new subscription services for the company. One is a highly anticipated video service that will put Apple in direct competition with Netflix, Amazon Prime Video, Hulu, and other streaming heavyweights. The other is an all-in-one subscription news / magazine service that could change the way many iPhone owners keep up with current events and their favorite publications. The company spent the first half of this week making new hardware announcements — including new iPads, iMacs, and AirPods — so that all focus at the event will be on its latest software and services. Apple Video Apple has spent years finding its way to this point. One of the more... Continue reading […]

  • Dark Souls creator Hidetaka Miyazaki on changing direction with Sekiro: Shadows Die Twice
    by Andrew Webster on March 21, 2019 at 1:00 pm

    For the last decade, From Software has been known primarily for one thing: demanding action role-playing games set in dark, intricately designed worlds. Starting with seminal Demon’s Souls, then continuing with the Dark Souls trilogy and the gothic masterpiece Bloodborne, From, led by director Hidetaka Miyazaki, established a distinct flavor of action, making the studio a household name and influencing countless developers. But lately, the studio has started to change course. It started last year with the short, mournful VR experience Déraciné, which retained many of the studio’s hallmarks — including cryptic, layered storytelling and a gothic fantasy setting — but it fused them with a completely different style of game. Now, Miyazaki... Continue reading […]

  • WhatsApp Business begins to roll out on iOS
    by Jon Porter on March 21, 2019 at 12:55 pm

    WhatsApp Business, a separate version of WhatsApp that’s designed to allow businesses to communicate with their customers, has begun to launch on iOS. WABetaInfo reports that it discovered the app on the Mexican App Store, and users have subsequently reported that the app is also available in France and Brazil. WhatsApp Business was first released on Android in January last year. The app is significant for WhatsApp because it’s one of the few ways the Facebook-owned service monetizes itself directly. Although businesses can respond to customers for free if they do so within 24 hours, Facebook will charge them after this initial period. Last year, a WhatsApp executive said that the service would also start showing ads to general users... Continue reading […]

  • Upload filters and one-hour takedowns: the EU’s latest fight against terrorism online, explained
    by Jon Porter on March 21, 2019 at 12:00 pm

    The EU wants to stop online extremist content in its tracks Continue reading […]

  • Microsoft’s disc-less Xbox One S reportedly launching May 7th
    by Tom Warren on March 21, 2019 at 11:42 am

    Microsoft’s disc-less Xbox One S console will reportedly launch on May 7th. Windows Central has obtained documents that indicate this is the launch date, alongside leaked box art images that the site has recreated. Microsoft is said to be calling this console the “Xbox One S All-Digital edition,” signaling a new model without the typical Blu-ray drive. It’s not clear how much cheaper this model will be, but the removal of a Blu-ray drive will definitely drive down the price. Microsoft has not yet publicly acknowledged the company is even creating a disc-less version of the Xbox One S, but rumors previously pointed towards a mid-April announce and May retail date. Microsoft is also reportedly including a 1TBB HDD on this new digital... Continue reading […]

Please follow and like us:

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 :).

Please follow and like us:

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.
Please follow and like us:

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.
Please follow and like us:

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!!
Please follow and like us:

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.
Please follow and like us:

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
Please follow and like us:

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.

Please follow and like us:

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

Please follow and like us:

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.

Please follow and like us: