background preloader

What Great .NET Developers Ought To Know (More .NET Interview Questions)

What Great .NET Developers Ought To Know (More .NET Interview Questions)
Related:  .NET / C#

Dot.Blog | MVVM : Gérer les données de Design de façon propre Read this article in your language IT | EN | DE | ES De Silverlight à WinRT en passant les Smartphones, sous Windows ou d’autres OS, les patterns de type MVVM sont devenues indispensables. Toutefois gérer des données de Design pour faciliter la création des UI est souvent mal géré ou oublié. MVVM “Générique” Il existe de nombreux frameworks pour gérer la séparation UI/Code, qu’ils soient basés sur MVVM, MVC ou d’autres patterns. C’est à la fois attirer votre attention sur le principe de fournir des données de design qui m’intéresse ici et la mise en œuvre de moyens simples réutilisables dans une multitude de contextes (quitte à les adapter). Silverlight L’exemple pourrait être fait avec WinRT, WPF, WP7 ou WP8 ou même d’autres technologies, cela n’a pas grande importance. Principes de base des données de design Tout d’abord j’aimerais insister sur la nécessité de proposer des données de design. Les données de design doivent être : Il ne s’agit que des grands principes de base. Lorem Ipsum

Interview Questions (Scott Hanselman) & Answers (Muhammad Adnan Amanaullah) :) - live wid knowledge :) Let’s answer Scott Hanselman interview questions. First of all, I would like to clear, purpose of this post is only educational/sharing knowledge. May be i am wrong and i would love if any1 of you correct me through commenting to this post with authentic references. i will really appreciate the contributors. Many days back I saw Scott hanselman website and kept reading his many other blogs and I found a list of interview questions which he said, he asked usually and he thinks should be known by .net guys at different levels. I got many (some wrote and answered as well) interview questions and put them at single platform just for knowledge sharing @ . Actually I always like to be part of interviews questions so I decided to write answer of them according to my little knowledge. I can say now, it’s really great learning/evaluation experience when I was thinking/writing their answers as to just skim them is another thing than to answer them.

Multi-threading in .NET In .NET 2.0+, if you want to have something run on another thread, you have a number of choices: The classical System.Threading.Thread classThe not-so-known System.Threading.ThreadPoolThe System.ComponentModel.BackgroundWorkerDelegates invoked asynchronously Let's see how we would do it in each case, and what would be the benefits. private void ThreadMethod(Object state) Using System.Threading.Thread You start a new System.Threading.Thread instance and pass it a pointer to the thread method wrapped in a System.Threading.ParameterizedThreadStart (for an optional state parameter) or System.Threading.ThreadStart delegate, then, you start it, by calling Start: Thread thread = new Thread(state => ThreadMethod(state)); thread.Start(state); As you can see, I am using the new .NET 3.5 lambda syntax for delegates. If you want to wait for the thread to exit, do this: thread.Join(timeout); Using System.Threading.ThreadPool Boolean result = ThreadPool.QueueUserWorkItem(ThreadMethod, state); handle.WaitOne();

Dot.Blog | De la bonne utilisation de Async/Await en C# Read this article in your language IT | EN | DE | ES [new:30:06/2014]Async et Await simplifient l’écriture des applications qui doivent rester fluides et réactives. Mais cela suffit-il à rendre les applications multitâches ? Async et Await Pour ceux qui éventuellement auraient loupé un épisode important des aventures de C#, sa vie, son œuvre en 5 tomes, voici un bref résumé de ce que sont les mots clés Async et Await et ce à quoi ils servent. C’est une question de méthode… De nombreuses méthodes ne retournent pas immédiatement le trait, elles peuvent effectuer des tâches assez longues, comme accéder à des ressources extérieures (Web, réseau, appareil de mesure externe ou interne tel le compas, le GPS, l’accéléromètre…). Toute méthode exécutée sur le thread principal bloque logiquement ce dernier or il est utilisé par l’OS pour gérer l’interface. Les threads ne sont pas des tâches De fait, les threads ne sont pas des tasks… async et await Fixons les choses asynchronisme ! Asynchronisme ! Run(menu);

Thread Synchronization in .NET This comes after my last post Multi-threading in .NET. There are several synchronization mechanisms you can use in your .NET applications, so choosing among them must be done wisely. First you must decide one thing: Do you need to synchronize threads in different processes on the same machine? If so, the available possibilities are: If you only want to synchronize threads inside a single process, you have more options, but first you must decide on this: Do you want all of your threads to be equally treated? If so, try these: All of the above classes, but you can skip setting the name of the synchronization object;System.Threading.Monitor (best known as the lock keyword): only one object at a time can have hold of the synchronization lock;System.Runtime.CompilerServices.MethodImplAttribute attribute: if used with System.Runtime.CompilerServices.MethodImplOptions.Synchronized option, marks a method as synchronized, so there can be only one thread at a time running it. Happy multi-threading!

Share code between WPF and Universal Apps with PRISM This will be a series of blog posts that deals with sharing code and XAML between WPF and Universal Apps. This first part is about the basic project set-up and sharing ViewModels. In following parts we will take a look at sharing XAML (with a preprocessor) and unifying concepts such as navigation. Intro We have so many platforms to code for these days: windows desktop, tablets, phones, the web, even xbox. One of the issues stemming from this abundance is that there are a ton of SDKs that have quite similar APIs, but also some subtle and not-so subtle differences that make cross-platform development a real pain. Having said that, it is worth noting that the new “Universal Apps” are a huge step in the right direction. With Silverlight going away focus is coming back to WPF with great force. Traditional desktop apps are substantially more different than apps for phones/tablets but there is nothing wrong with trying to share code, especially if you are targeting both platforms. The Basics

To Do - clojure-clr - GitHub In no particular order, here are some of the pending development tasks. Implement printf The format function in core.clj depends on Java’s String.format, a printf-style formatter. There is no BCL equivalent, so we will have to implement it. This has been partially written. Still awaiting completion: extend float spec to BigDecimal arguments extend float spec to System.Decimal implement HexFloat spec implement grouping for General Float spec implement grouping for integer spec / BigInteger arguments Loading of standard environment There are several .clj files that are part of the standard environment of ClojureJVM that we have not translated yet. clojure/xml.clj The implementation relies extensively on SAX parsers as defined in org.xml.sax and javax.xml.parsers. Proxy and genclass Implement bean (in core_proxy.clj). Testing There are more than 500 unit tests for the basic runtime libraries in the Clojure.Tests project. There should be a set of tests developed for compiler functionality. seque

Top 10 Unity best practices: Naming Conventions : gamedev Full Screen Mode in C#. Free source code and programming help Download source files - 8.66 Kb Introduction There are situations where you want your application to go into a full screen presentation mode. How to do it? I am presenting a simple solution using C#. When the F11 key is pressed, I create another form that has its WindowState property set to Maximized, the background color is set to Black. The trick here is to set the main application's form's owner to that of the second form. Conclusion Here is just a simple method for an application to enter to a full screen mode without writing a lot of resizing code in the main application.

Multi-Targeting .NET Standard Class Libraries | Gigi Labs The .NET family has grown quite a bit, and to be honest, it’s a bit of a confusing mess. As I already explained in “Migrating Dandago.Finance to .NET Core“, there are now several different types of class library you can choose from (including different kinds of portable class libraries), different ideas of cross-platform (.NET Core vs Universal Windows Platform), different frameworks, and .NET Standard. Let’s consider the following image, which shows three different .NET-based frameworks in relation to .NET Standard: Image credit: .NET Core, .NET Framework, Xamarin – The “WHAT and WHEN to use it” Your applications will typically be built for one of the frameworks on top (e.g. .NET Framework). This means that class libraries that target .NET Standard have maximum compatibility, but there’s a cost: not all APIs are available for .NET Standard, and targeting .NET Standard is only compatible with certain recent versions of those frameworks. For the most part, this is okay.

If you haven't heard There seem to be more readers of my posts than there used to be, so I wanted to mention a project I've been slowly working on. I've been porting MIT Scheme to the .NET CLR. MIT Scheme has two major components: the ‘microcode’ which provides the memory model and the primitives, and the ‘runtime’ which is the Scheme code and libraries that come with the system. Once upon a time, the ‘microcode’ really was microcode. I'm doing this for fun and to try out different ideas I've had about interpreter implementation. So why am I bringing this up? As I have mentioned in earlier posts, the two things that an interpreter does most is variable lookup and continuation management. When an interpreter compatible environment is used, there is little choice but to represent the environment as a linked list of frames. In my attempted port of Object Lisp, I would get this all the time. Ok, back to my version of MIT-Scheme.

.NET Framework Development Guide This section explains how to create, configure, debug, secure, and deploy your .NET Framework apps. The section also provides information about technology areas such as dynamic programming, interoperability, extensibility, memory management, and threading. .NET Framework Class Library Supplies syntax, code examples, and usage information for each class that is contained in the .NET Framework namespaces. Designing a .NET Computer Developing Renraku has led me to some interesting thoughts, not the least of which is the feasibility of a .NET computer. Existing computers know only a few core things: Move to/from memory and registersBranchPerform arithmetic All the other smarts are built on top of that, leaving us with layer upon layer of complexity. The CPU will execute raw CIL blobs and exposes hardware interfaces and interrupts. Since the CPU is going to be executing CIL directly, it's going to have to deal with object initialization, virtual method lookups, array allocation, memory manager, and many other tasks that existing systems handle purely in software. Hypervisor The hypervisor, like everything else, will be built completely in managed code. The hypervisor provides a standardized interface to talk to drivers and memory, which are verified. Bootloader The bootloader is a standard .NET binary, and its job is simply to hand control off to the OS. Unlike most OSes, it won't get free reign over the system.

Related: