Tuple class With tuple class (available from version .Net 4.0) our function can return more then one value. I’ll show you on a simple example. Imagine that we want to return cars with brand and model but the type of car is common to all these cars. Let’s see, we’ve got three cars – AudiWięcej oTuple Class – C#[…]
Get out from smog – part VII
In a previous posts. I showed you how to calculate distance between points. It’s time to get current location from user. We will take care of this in our view.
We’ll use for this method getCurrentPosition from geolocation. Czytaj więcej O tej wersji„Get out form smog” – get current location from user …
Strategy pattern What is the strategy pattern? Via wikipedia For instance, a class that performs validation on incoming data may use a strategy pattern to select a validation algorithm based on the type of data, the source of the data, user choice, or other discriminating factors. These factors are not known for each case untilWięcej oStrategy pattern[…]
Get out from smog – part VI
Today, my application show you where is the cleanest air within 100km from my current localization(Kraków).
First, I focus only on pollution dust – PM10. So, I modyficated class ParseStringToArray.
Get out from smog – part V Today post will be about depencendy injection.And run all the written functions as a whole. Uses for this Autofac and Autofac.Mvc – to inject depencencies on the contollers. I created class to register depencencies.
public class AutofacConfig
public static void ConfigureAutofac()
var builder = new ContainerBuilder();
var container = builder.Build();
We register the interface to a particular class and the ability to injectWięcej o„Get out form smog” – dependency injection[…]
Send dynamic list to controller Today I’ll show you how to add items to dynamic list and then send values to controller. In the first step, let’s create simple web page based on Bootstrap and JQuery. Assume that we make a recipe for the cake. From combobox we choose some piece and we put the amountWięcej oSending data from dynamic list – ASP.NET Core MVC.[…]
LinkedList When we need to put some collections into stack(LIFO) or queue(FIFO). The soulition is simple, we create class Stack if we need a „last in first out” strategy and we got some method like insert object to the top of the stack(PUSH), return last element(POP or PEEK). Similary in Queue function(Enqueue) adds object onWięcej oLinkedList – example[…]
Get out from smog – part IV As i mentioned in a previous post. I create a class that will be calculated the distance in kilometers between the measuring stations and a latitudes, longitudes. First we have to calculate distance in kilometers between latidute and longtidute points. Haversine formula In this example, I use HaversineWięcej o„Get out from smog” – claculate the distance[…]
Get out from smog – part III To measure the distance from the measuring station to current locaction of the user. Is required accurate data such as – latitude and logitude measurement station. Google provide useful api. I send a request to the address https://maps.googleapis.com/maps/api/geocode/json?address= and my adress station and api return me json withWięcej o„Get out from smog” – obtaining precise location[…]
Today I’ll show you how can you freez table columns/rows on website in simple way. The best for it will be another great and powerful tool plug-in for JQuery library DataTables.
In our example we need to include some scripts and styles like this: Czytaj więcej O tej wersjiFreeze table columns – DataTables …