Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια

 

Αρχική σελίδα Ιστολόγια Συζητήσεις Εκθέσεις Φωτογραφιών Αρχειοθήκες

dotNETZone.gr Weblogs

  • Logstash pipelines

    Sample IIS log pipeline with logstash https://t.co/DMbg6y4Bqg Advertisements...
    03-06-2019, 10:49 από count zero στο count zero
    Δημοσίευση στην κατηγορία:
  • Vue.js

    Lengthy tutorial for Vue.js and other useful tools. https://www.infoq.com/articles/vue-getting-started-aws-bulma Advertisements...
    01-11-2018, 14:23 από count zero στο count zero
    Δημοσίευση στην κατηγορία:
  • Enumerations, bitwise operators and flags

    Enumerations are a simple and efficient way to deal with a set of values. The most common way to use an enumeration is to use its values separately. There are however times when we want to use a combination of the enumeration's values. In that case we can use bitwise operators. To make things easier, we can also use flags.     Enumeration Let's start using a simple enumeration example. Enumerations are structs consisting of a set of values the type can be assigned. So let's use an enumeration of payment methods. Here's the enumeration.   public enum   PaymentMethods {     None = 0,     Cash = 1,     Cheque = 2,     CreditCard = 3 }   We can now use this enumeration to connect PaymentMethod values with their integer representation. For example   int   creditCard = 3; PaymentMethods creditCardMethod = (   PaymentMethods )creditCard; or int   creditCard = ( int )   PaymentMethods .CreditCard;   It is...
    19-07-2017, 09:51 από το μέλος k badas στο .NET Hints
  • Getting random values

    You do not have to be working on some gambling project in order to request for a random number. Things like that happen all the time. Either you may need to pick a random product to show out of a list or you may want to present some results randomly ordered. Anyway, getting a random number is something you will need to do from time to time. To get a random number we may use the Random or the RNGCryptoServiceProvider class. We are going to find out what is the difference between them and talk about what makes a random number.     Randomness Let's start with the basics. What makes a random number? A number is considered random when there is no method to predict what that will be before it is presented. You may think of this as something obvious, however it is not.   Let's say someone asked you to pick a number between 1 and 10 and you picked 5. Why would that be? Maybe that is because you like number 5, or you like the fact it is located in the middle of the 1 to 10 range, or because of a subconscious...
    25-06-2017, 18:34 από το μέλος k badas στο .NET Hints
  • Yield and iterator methods

    All around C#, there are over a few dozen keywords. One of them, which is rarely used and is sometimes misunderstood, is yield. However, if used properly, yield can help in optimizing your code. Let's take a look at how it works.   What does yield do?   Let's get to what yield does using an example. We are going to create a method that returns a Fibonacci sequence. You have probably heard what Fibonacci numbers are, from your first for loop classes. So, a Fibonacci sequence is a series of numbers in which each number is the sum of the two preceding numbers. Well, this may not be the exciting way you would expect to implement yield, but I guess this will make things easier to grasp. So let's write the following code.     string   fibonacciSequence = ""; foreach   ( int   f   in   FibonacciEnum(10))      fibonacciSequence += f +   " " ;   The following method returns a Fibonacci sequence.   private   IEnumerable...
    11-06-2017, 19:32 από το μέλος k badas στο .NET Hints
  • Session in ASP.NET MVC applications

    Session is a simple and nice way to store info in memory and has been used in ASP.NET for a long time. Since MVC came out, there were many people out there saying that session should be abandoned and replaced by other methods while others said that there is no problem using session the way we used to. As this may confuse developers that are not highly experienced in MVC, let's see what actually happens here.   Before MVC Web Forms have been the basic model for a developer who has been working on ASP.NET, for a long time. Web Forms was the result of Microsoft's efforts to create a web application based on windows standards. By default, web is stateless. If I send a request, this is supposed to be a request of its own, no matter what the history between me and the web server has been. To use a RESTful model, info should be sent using GET, POST requests, cookies etc. However, this model did not resemble windows applications. In order to avoid this, developers started using state management tools, like session...
    21-11-2016, 21:04 από το μέλος k badas στο .NET Hints
  • Boolean types - To null or not to null?

    Boolean types are quite common to be found within a database. Alike many other types there are boolean and nullable boolean types. Simple boolean types consist of two values: True and False. Nullable ones offer null as a third choice. So, do we really need this third option in our database or source code and if so how should we deal with it?   Nullable types Nullable bool is not the only type that accepts null values. For example we got nullable integers and nullable DateTimes. So, what is the meaning of null? To put it simply null means we have no idea what the value is.  So if, you got a nullable int, its values could be 10, 100, 0 or null. Now, 10 and 100 are standard values. So is 0, even if it actually refers to the number of zero objects. However null tells us that we do not know if the value is any one of these. Supposing int refers to the Bahamas' number of citizens. Setting null value to that variable does not imply that the Bahamas do not exist or have no citizens or that there is no record...
    29-05-2016, 18:28 από το μέλος k badas στο .NET Hints
  • HTML on-line tools

    HTML Encoder HTML Decoder HTML-CSS-JS Prettyfier HTML Compression & more...
    27-05-2016, 14:42 από count zero στο count zero
    Δημοσίευση στην κατηγορία: ,
  • Shorten your URLs using goo.gl

    Shortened URLs have slowly turned into one of the latest trends. Even though it's been about 15 years they've been helping people having difficulty with limited character messaging applications and SMS, social networks sharing such limitations have caused some major increment in their use. We are going to see what shortened URLs are, and how we can create our own, using goo.gl API.   What is a shortened URL?   A shortened URL is a URL that redirects to the same address as the one requested. For example you can use goo.gl (Google's URL shortener service) to create a shortened URL by visiting https://goo.gl/ and placing the URL you want to shorten. If you place http://dotnethints.com/  you get http://goo.gl/5nIcLC.   Now, if you hit that new address on your browser you will head to that URL shortener's company site. The original URL will be found and you will be automatically redirected to your destination. Keep in mind that shortened URLs are supposed to last forever.   So, we may use shortened...
    11-04-2016, 20:42 από το μέλος k badas στο .NET Hints
  • Shallow and deep copying objects

      Working as a developer I have created quite a lot of objects. Most of them were unique. There were some of them, however, that were created by copying already existing objects. C# provides us with a few techniques to accomplish this, keeping in mind whether we want to create a copy that keeps all data the prototype had, or how to deal with the referenced types contained within that object. Shallow and deep copies A way to understand things better is to create a class called Book. What we're going to do, is try to copy Book objects. Here's the class.   public class   Book {      public string   Name {   get ;   set ; }      public double   Price { get ; set ; }        public   Writer   Author { get ; set ; }   public   Book ( string name, double price, Writer author)     {         Name = name;         Price = price;        ...
    28-02-2016, 11:38 από το μέλος k badas στο .NET Hints
  • Choosing between fields, properties and methods

    I once told a friend of mine that programming is much like chess. In some cases it is; for example when you know where you want to get but there are so many paths to follow. Choosing between fields, properties and methods when you want to store a value temporarily or retrieve it, can be described as some of these scenarios. There was a time I created a class and wanted to store some data, but I was not sure which was the best way to do it. Should I create a simple private variable where I would store the value, use a property and some extra auxiliary variable, or instead avoid getters and setters and use nothing more than a method? Since there may be some developers out there sometimes confused with such questions, I thought of writing an article about it.   Is there a problem at all?   To get started, let's create a class called MartialArtist which holds a single important piece of information: the martial artist's name. Here's the code.   public class   MartialArtist {    ...
    08-02-2016, 20:06 από το μέλος k badas στο .NET Hints
  • Deferred execution on LINQ to Entities

    Many people use entity framework but are not aware of what deferred execution is and how it may affect their projects. In this article, we are going to have a little talk about it and see how things work.   LINQ to entities and deferred execution   We take into account that we all have some understanding of entity and LINQ or lambda expressions.   To go through this post we created a table called Videogames containing four columns (ID, Name, MainCharacterName and Publisher) and filled it with some popular vintage videogames. Let's start with the following piece of code.     string   videogameNames =   "" ; var   MarioVideogames = db.Videogames.Where(v => v.MainCharacterName ==   "Mario" );   foreach   ( var   videogame   in   MarioVideogames)   videogameNames += videogame.Name +   "<br/>" ;     Let's say our table contained only two Videogames having Mario MainCharacterName:  Super...
    07-11-2015, 18:28 από το μέλος k badas στο .NET Hints
  • Get All tables row count without using Count(*) function

    Η δύναμη της συνήθειας είναι το μεγαλύτερο ναρκωτικό του μυαλού και δεν το αφήνει να σκεφτεί αποδοτικά. Αλήθεια πόσες φορές κάνουμε μηχανικά κάποια πράγματα επειδή τα έχουμε συνηθίσει στα τόσα χρόνια που κάνουμε αυτή την δουλειά ; http://www.sqlschool.gr/blog/get-all-tables-row-count-without-using-count-function-1058.aspx...
    25-10-2015, 23:33 από το μέλος Antonios Chatzipavlis στο Rocking with Knowledge for .NET programming
  • SQL Server 2016 New features - The sys.dm_exec_function_stats DMV

    Τα User Defined Functions (UDF) είναι γνωστά στους περισσότερους. Η χρήση τους είναι μεγάλη αλλά αρκετές φορές χρησιμοποιούνται λάθος κυρίως λόγο της άγνοιας που υπάρχει γύρω από την εκτέλεση ενός UDF και ιδιαίτερα όταν αυτό εμπλέκεται μέσα σε ένα query. Οι περισσότεροι συγκρίνοντας το execution plan ενός query χωρίς UDF και με UDF βλέπουν ότι το query cost είναι μικρότερο σε αυτό που χρησιμοποιεί το UDF και αμέσως θεωρούν ότι αυτό είναι και το καλύτερο. Για ακόμα μια φορά θα τονίσω ότι δεν υπάρχει έτσι απλά καλό ή καλύτερο όλα είναι εξάρτηση από πολλούς παράγοντες όπως την ποσότητα και ποιότητα των δεδομένων των indexes κλπ http://www.sqlschool.gr/blog/sql-server-2016-new-features-the-sys-dm_exec_function_stats-dmv-1057.aspx...
    16-10-2015, 00:10 από το μέλος Antonios Chatzipavlis στο Rocking with Knowledge for .NET programming
  • SQL Server 2016 New features - The sys.dm_exec_session_wait_stats DMV

    Καθημερινά ένας DBA ή DB developer έχει να αντιμετωπίσει αρκετούς αστάθμητους τις περισσότερες φορές παράγοντες που επηρεάζουν το performance. Πιστέψτε με ότι αυτό είναι μια δουλεία που απαιτεί σχολαστικότητα γνώση της αρχιτεκτονικής τόσο του SQL Server όσο και της database. Για να κάνεις αυτή την δουλεία θα πρέπει να έχει μελετήσει αρκετά και να έχεις κάνει αρκετή πρακτική εξάσκηση για την απόκτηση εμπειρίας. Ακόμα και ένας τέτοιος άνθρωπος πάντα επιζητά τρόπους να κάνει λιγότερο δύσκολη την δουλεία του και η χαρά του είναι μεγάλη όταν ανακαλύπτει ότι το αγαπημένο του εργαλείο έκδοση με την έκδοση του δίνει περισσότερες δυνατότητες για αυτό το task. Από τα βασικά εργαλεία μας στον SQL Server είναι τα Dynamic Management Views (DMV). Αρκετά από αυτά είναι κυρίαρχα εργαλεία στο performance troubleshooting. http://www.sqlschool.gr/blog/sql-server-2016-new-features-the-sys-dm_exec_session_wait_stats-dmv-1056.aspx...
    14-10-2015, 00:54 από το μέλος Antonios Chatzipavlis στο Rocking with Knowledge for .NET programming
    Δημοσίευση στην κατηγορία:
  • A Look At Akka.NET

    Nice article about Akka.Net http://www.codeproject.com/Articles/1007161/A-Look-At-Akka-NET...
    29-09-2015, 13:49 από count zero στο count zero
    Δημοσίευση στην κατηγορία:
  • Create a secure socket layer WCF service

    We have already seen how to create a WCF service. This time we are going to see how to combine a WCF service with SSL security, which will be a trickier thing to do.   To reach our goal, we need to take three steps. Step one is to create a WCF Service. Step two is to install a certificate for authentication. Step three is to bring the two first steps together. Since creating a secure socket layer for a website takes more than just a few words. I am planning on writing some future article about that. In order to apply the following methods, a reader should either already have a secure website or, if unable to wait, find a proper article since there are quite a lot out there.   Concerning WCF services     This is the article   where we created a WCF service. However since this task is more complex, we will start by repeating a few things.   To create a WCF service, we create a service (svc) file. This is where we place the code to execute when the service is requested.   The svc...
    27-09-2015, 12:26 από το μέλος k badas στο .NET Hints
  • Monitor Connection Pooling as SQL Server DBA

    Το connection pooling είναι μια cache από database connections που σκοπό έχει αυτά που είναι ελεύθερα στην cache αυτή να μπορούν να επαναχρησιμοποιηθούν κάθε φορά που κάποιος ζητάει να κάνει connect στην database. Η χρησιμότητα του connection pooling είναι αρκετά σημαντική στην εκτέλεση διαδικασιών πάνω στην database από το application καθώς με αυτό τον τρόπο γίνεται αφενός γρηγορότερη επικοινωνία αφετέρου καταναλώνονται λιγότεροι πόροι. http://www.sqlschool.gr/blog/monitor-connection-pooling-as-sql-server-dba-1050.aspx...
    15-09-2015, 22:46 από το μέλος Antonios Chatzipavlis στο Rocking with Knowledge for .NET programming
  • Using an API App in a Logic App – Cloud Cover Show episode

    Introduction A couple of weeks ago, I’ve joined my good colleague Chris Risner at the Channel 9 studio and we’ve talked about API Apps and App Service in general. After receiving quite a few e-mails about the demo I’ve shown, I’ve decided to break it down a bit more and create a step by step […]...
    29-07-2015, 06:43 από The PK Blog στο The PK blog
    Δημοσίευση στην κατηγορία: ,
  • Let's talk about GUIDs

    I've been using GUIDs for a long time, even though I had no actual clue of what they were. Well, I did know what they were; they looked like 32 hex digit strings separated by hyphens that looked like that A1F5B524-B197-4787-A6FF-38BC0C8D2B01. And they were unique, so I knew that if I had lots of them within my database tables and inserted yet another one, that would be different from all the rest. Then, one day it came to me that it might be interesting to find out what GUIDs actually are, so I did some search.     What is a GUID?   GUIDs are stored as 128-bit values but are usually displayed as 32 hexadecimal digits separated by hyphens, so they can be easier for a human to read, for example A1F5B524-B197-4787-A6FF-38BC0C8D2B01. These groups, containing 8, 4, 4, 4 and 12 hex digits respectively.   GUIDs (that stand for Globally Unique Identifiers) are also called UUIDs (Universally Unique Identifiers). Actually UUID was the first term to show up. When Microsoft decided to use UUIDs they preferred...
    17-07-2015, 23:43 από το μέλος k badas στο .NET Hints
  • Auditing Reports Execution in SSRS

    Ένα από τα services του SQL Server είναι τα Reporting Services τα οποία παρέχουν ένα εξαιρετικά ευέλικτο τρόπο να μεταδίδεται η πληροφορία στους τελικούς χρήστες. Η χρήση τους από τις εταιρίες και τους οργανισμούς έχει αυξηθεί σε υπερθετικό βαθμό και κανείς θα βρει μεγάλο αριθμό από reports να εκτελούνται καθημερινά στις υποδομές αυτών των εταιρειών. Είναι φυσικό κάποια στιγμή να χρειαζόμαστε να παρακολουθήσουμε ποια είναι αυτά που χρησιμοποιούνται, πόσο συχνά χρησιμοποιούνται, πόσο χρόνο χρειάζονται για να εκτελεστούν ποιοι είναι οι χρήστες και ποια reports εκτελούν. Οι παραπάνω λόγοι είναι μερικοί και κάνουν επιτακτική την ανάγκη να έχεις αρχικά ενεργοποιημένο το auditing στα SSRS και στην συνέχεια να έχεις μια διαδικασία που να κάνει την ζωή σου ευκολότερη. Πέρα όμως από αυτούς το τελευταίο διάστημα είχα αρκετές ανάγκες στον εργασιακό μου χώρο για auditing από επιθεώρηση πάνω στoυς SSRS servers που έχω αλλά και πολλές ερωτήσεις από τους μαθητές μου στα πρόσφατα BI σεμινάρια που έκανα. http://www.sqlschool.gr/blog/auditing-reports-execution-in-ssrs-1038.asp...
    23-06-2015, 23:13 από το μέλος Antonios Chatzipavlis στο Rocking with Knowledge for .NET programming
  • How to set the RetryPolicy on the API App client

    Introduction When you want to consume your API App from your application our Visual Studio tooling does all the magic (aka generation) for you. Because of Swagger, we can generate the code of the API App client with two clicks. All you have to do is point the API App Client SDK to your API […]...
    16-06-2015, 20:43 από The PK Blog στο The PK blog
    Δημοσίευση στην κατηγορία: ,
  • Taking advantage of API Management for API Apps

    Introduction Once you publish your API App using any of the tutorials we provide (.NET, Node.js, Java) you might want to take advantage of the advanced API Management capabilities of by Azure API Management, capabilities like throttling, interactive console and documentation, usage analytics and many more. Creating an API Management account If you don’t have an […]...
    12-06-2015, 08:57 από The PK Blog στο The PK blog
    Δημοσίευση στην κατηγορία: ,
  • Use your routing system to create a multilingual web forms project

    In a   previous article   we talked about multilingual sites. This time we are going to see how we can place that info in the page URL, using ASP.NET's routing system, and create this way an entirely different version of a website, depending on the language selected.   Why, you may ask, would I choose Web Forms to do this instead of using MVC's way better routing system? Well, no matter how deprecated Web Forms may become, websites based on that will still remain out there for a long time, so it may still be useful to some. And, after all, no matter what they look like right now, who doesn't like reading stuff concerning Web Forms?   Why messing with the URL?   To begin with, what we're talking about is not storing the info in the query string; instead we’ll try out the actual URL body. Actually, language info could as well be stored using cookies or other means. What do we get by using this MyWebsite/en/contact.aspx instead of MyWebsite/contact.aspx?lang=en or simply store language on...
    13-05-2015, 00:18 από το μέλος k badas στο .NET Hints
  • Why am I getting “A route named ‘swagger_docs’ is already in the route collection” after I publish my API App?

    Question: After publishing my API App I’m getting the yellow error screen of ASP.NET. The error message says “A route named ‘swagger_docs’ is already in the route collection”. How can I fix this? Answer: This is not related to API Apps per se but more around Web API. What triggers the error is pretty simple: […]...
    04-04-2015, 00:17 από The PK Blog στο The PK blog
    Δημοσίευση στην κατηγορία: , ,
Περισσότερες Δημοσιεύσεις Επόμενη »
Με χρήση του Community Server (Commercial Edition), από την Telligent Systems