Posts tagged ‘C#’

Using Multiple Database Types in an ASP.NET Core Web App

Sometimes, you might want to use one type of database, like MS SQL Server LocalDB, for development and a different type, like MySQL, on a production server. I’ll walk you through writing the code to use different database providers for Entity Framework (EF) depending on your environment: development or production. (more…)

December 4, 2019 at 2:53 pm Leave a comment

Hosting Multiple ASP.NET Core Sub-Sites on a Single Site Hosting Account

SubDomainButtonIf you have a Windows Server shared hosting account that only provides you with one web site, you are not really stuck with having just one site. In most cases, you can add additional sites by putting them in sub-folders (aka sub-directories) of the main site. (more…)

December 4, 2019 at 9:19 am Leave a comment

Publishing an ASP.NET Core Web App to a Low-Cost Windows Hosting Service

You’re developing an awesome ASP.NET Core web app and need to give it a home on the internet. If you expect your app to experience light or medium traffic1, you can use an inexpensive shared Windows Server, IIS hosting provider like SmarterASP.NET. Of course, alternatively, you could publish your site to a low cost Linux VPS hosting service, like Linode, but that could cost a bit more and configuring the server will be quite a bit more work.

(more…)

February 18, 2019 at 5:05 pm 3 comments

ASP.NET Core Razor Pages – Part 1

Introduction to Razor Pages

ASP.NET Core Razor Pages provide web developers with a way to create simple web applications (or web sites) using HTML, CSS, JavaScript, C# and the .NET library, but without the added complexity of the more powerful ASP.NET MVC framework. If you’ve used ASP.NET Web Forms, think of Razor Pages as an alternative that lets you just use standard HTML with helper code instead of dragging and dropping controls onto forms. (more…)

September 30, 2017 at 3:10 pm Leave a comment

Using the Android Fused Location Provider

location-clipart-map_pin

In this post, I’ll walk you through the code in a very minimal app that just demonstrates getting locaiton. This app was created using the Xamarin Android platform, so it is written in C# but still uses the Fused Location Provider API which is provided by Google Play Services . My code is available on GitHub in a Xamarin Studio / Visual Studio solution: Geolocation Demo.

(more…)

May 27, 2016 at 1:29 pm 2 comments

The Google Play Services APIs for Android

GooglePlayServices

Why Use the Google Play Services APIs?

Google Play Services (also known as Google APIs for Android) and abbreviated GPS, is a set of APIs that are delivered in the form of an app that can be updated via the Google Play Store. The reason Google provides these APIs this way is to reduce fragmentation of the Android platform. Fragmentation is a result of many different versions of Android running on devices out in the wild.

(more…)

May 27, 2016 at 9:05 am 1 comment

Learn to Write iOS Apps!

iPad+iPhoneNext term, Spring 2018, at Lane Community College, I will be teaching a course in iPad and iPhone app development, CS235IM. This is a beginning course  in writing apps for iPhones and iPads. We will be using the Xamarin platform to write native apps using C#.  This course is offered for college credit (4 credits) and will be offered both on-campus and online. Online students can participate from anywhere in the world and at any time of the day (or night)! (more…)

November 17, 2015 at 5:50 am 2 comments

Highest Demand Programming Languages in March 2015

ProgrammingLanguageListingsOnDiceA question that I hear frequently is: “Which programming language (or languages) should I learn? Usually the person asking is a student and what they really mean is, “What programming language will get me a job?!” My usual answer is that it’s more important to focus on learning concepts (like: inheritance, composition, polymorphism, data structures, design patterns, etc.) because these are pretty much the same regardless of language. If you learn C# in-depth, and then get a job where you need to use Java, you should be able to apply the concepts you know (and even a lot of the syntax) and pick up Java quickly. But, of course, you would still want to choose a language that is at least in the top dozen, as far as job demand. (more…)

March 27, 2015 at 3:11 pm 3 comments

C# Pass-by-reference – Concept and example

670px-Pass-a-Soccer-Ball-Step-3-Version-2One of the concepts that many of my beginning programming students find difficult to wrap their heads around is the different ways that arguments can be passed when a method is called.  The two mechanisms for passing an argument to a method are pass-by-value and pass-by-reference.

(No, this post isn’t about soccer, I just wanted to get you thinking about passing.)

Advice to new programmers: Skip this paragraph. But the rest of this post is for you!
Before launching into our discussion, I need to clarify that we’re only talking about what happens when we pass value types to method parameters. Value types are the types enum and struct. The numeric types and bool type that are built into C# are all actually structs and so they are all value types. Interestingly, strings are not value types, they are reference types, but that’s a topic for another post!

I should make another clarification too. When I talk about the code that calls a method, I refer to the variables passed to the method as arguments, but when I talk about the code that defines a method, I call the variables inside the parenthesis parameters.

Pass by Value
Let’s take a look at a “normal” C# method definition:

     int Sum(int num1, int num2)    // this method returns the sum of num1 and num2
     {
          return num1 + num2;
     }

(more…)

March 15, 2015 at 5:20 pm Leave a comment

Happy Pi Day!

It’s Pi day and it’s a once-every-hundred-years Pi day! It’s a spceial Pi day since the year ends in 15. So the date: 3-14-15, matches the number Pi to four decimal places: 3.1415.

Kash Farooq has provided a nice set blog posts showing different methods for calculating Pi using C#. Here they are:

Calculating Pi in C# part 1 – using series algorithms

Calculating Pi in C# part 2 – using the .NET BigInteger class

Calculating Pi in C# part 3 – using the BigRational class.

March 14, 2015 at 9:45 am Leave a comment

Older Posts


Bird’s Bits

Computers, software & the Internet

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 41 other followers