My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label world wide web learners consortium. Show all posts
Showing posts with label world wide web learners consortium. Show all posts

Friday, June 29, 2018

Null conditional operator : Question mark (?) before Variable

One of the reader recently asked about the new kind of operator that we use in C# 6.0. He noticed that in the VS - 2015, there is a use of new operator as following. And, he wanted about what it is:
Eg: public class A {
   string method1 { get; set; }
}
..
var a = new A();
var foo = "anwar";
if(a?.method1 != foo) {
   //somecode
}

So, let me explain this brief concept!

It's the null conditional operator. It basically means to evaluate the first operand. If that is null, stop, with a result of null. If not, evaluate the second operand as a member of the first operand.

In the above example, the point is that if a is null, then a?.method1() will evaluate to null rather than throwing an exception.  It will then compare that null reference with foo, using string class overload, and find that they are not equal and execution will go into the body of the if statement.

In addition, it can be very useful when flattening a hierarchy and/or mapping objects. iEg, Instead of:

if (Model.Model2 == null
  || Model.Model2.Model3 == null
  || Model.Model2.Model3.Model4 == null
  || Model.Model2.Model3.Model4.Name == null)
{
  mapped.Name = "default"
}
else
{
  mapped.Name = Model.Model2.Model3.Model4.Name;
}
It can be written like (same logic as above)

mapped.Name = Model.Model2?.Model3?.Model4?.Name ?? "default";

So, with this I end. Go, grab a cuppa coffee. I will still do Cheers :)

Wednesday, May 23, 2018

What is SMSC number : Indian Mobile Operators - How does it work and how to change SMSC Number in Android phones

A Short Message Service Center (SMSC) is a network element in the mobile telephone network. Its purpose is to store, forward, convert and deliver Short Message Service (SMS) messages.

The flow of message in mobile network system happens as follows:

  1. From mobile to another mobile - referred to as MO-MT (Mobile Originated - Mobile Terminated)
  2. From mobile to a content provider (also known as Large Account / ESME) - referred to as MO-AT (Mobile Originated - Application Terminated)
  3. From application to a mobile - referred to as AO-MT (Application Originated - Mobile Terminated)


We should remember that An SMS message is stored temporarily in the SMS center if the recipient mobile phone is unavailable. It is possible on most mobile handsets to specify an expiry period after which the SMS message will be deleted from the SMS center. Once deleted, the SMS message will no longer be available for dispatch to the recipient mobile phone (even if it comes on line). The validity period should be regarded by the handset user as a request, as the SMSC itself can be configured to ignore or otherwise handle message delivery schedules.


Sometimes you face problem in sending SMS or Changing SMS center number. While sending SMS you will get ‘unable to send’ error, this Error is mainly caused by Mobile SMS center number is changed. You can change this number in your mobile Network/SMS settings


Following is the list of SMSC numbers (latest) for leading mobile operators in India:

  • Aircel sms center number +919809099060
  • Airtel sms service center number +919895051914
  • Jio sms center number +917010075009
  • BSNL sms center number +919440099997
  • Idea sms service center number +919847099996
  • Reliance sms service center number +919020000500
  • Tata Docomo sms service center number +919032055002
  • Uninor/Telenor sms center number +919084051550
  • Vodafone SMS center number +919846000040


An SMS centre (SMSC) is responsible for handling the SMS operations of a wireless network.

  1. When an SMS message is sent from a mobile phone, it will first reach an SMS centre.
  2. The SMS centre then forwards the SMS message towards the destination.
  3. The main duty of an SMSC is to route SMS messages and regulate the process. If the recipient is unavailable (for example, when the mobile phone is switched off), the SMSC will store the SMS message.
  4. It will forward the SMS message when the recipient is available and the message's expiry period is not exceeded.

Guess what! This completes the full information you should know.

Wednesday, November 8, 2017

What is Chocolatey and how to install : Step by step guide from W3LC.com about the new and cool Windows Package Manager

To start with, Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). You must have also heard in past about npm as a package manager for NodeJs.
It is much like similar thing - The package manager, to be specific!

Chocolatey is a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure.

It includes all aspects of managing Windows software (installers, zip archives, runtime binaries, internal and 3rd party software) using a packaging framework that
understands both versioning and dependency requirements.



It is open source andyYou can host your own sources and add them to Chocolatey, you can extend Chocolatey's capabilities.

How to Install Chocolatey

It's easy, you know just like grabbing a Vodka Shot. But without a hole in pocket! It's free, in case you're wondering untill now.

Steps:

1. Ensure that you are using an administrative shell.

2. Copy the text specific to your command shell.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

3. Paste in shell and press Enter

4. Wait for a few seconds and let the command execute.



5. [Optional] If you are using PowerShell.exe instead of Windows command prompt, there is an additional step. You must ensure Get-ExecutionPolicy is not Restricted.

a. Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.

b. Use following command istead of the earlier mentioned in point 2.
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))


And Voila! Its done!


References:
https://chocolatey.org/about
http://www.w3lc.com