Post/Redirect/Get or PRG in short is a common pattern used amongst many web applications, that was designed to prevent duplicate submissions of the forms. Not using such pattern may result e.g. in multiple transactions by POSTing the same form twice, which is something that we definitely do not want to see in our applications. Although, it’s quite easy to be implemented in it’s purest form, it’s a little bit more tricky if we want to save the input data provided by the user (let’s say the form has a lo...
Daj się poznać 2016 2913 dni, 20 minut temu 150 źrodło rozwiń
Wspominałem niedawno, że w pracy nie trzeba robić wszystkiego szablonowo. Można się postarać i uczyć, rozwijać siebie i innych. Nieważna jest firma, korporacja w której pracujesz. Nieważne jest stanowisko, które zajmujesz. Ważne jest tylko czy chcesz. Dziś opiszę jak testować aplikację C# za pomocą F#. Po co to robić? To jeden z powodów. A właściwie 10 (i więcej). A oprócz tego dla przyjemności i rozwoju. Nauczenia się czegoś nowego w pracy zamiast po pracy...
Sztuka programowania 2917 dni, 23 godziny, 58 minut temu 155 źrodło rozwiń
SendGrid is one of the most popular services for delivering the email messages. It allows sending both, the regular, plain text email messages as well as the templated ones (called “transactional”). On top of that, it has also some other cool features such as marketing templates. In this post, I’m going to describe the way that the Warden project has been integrated with this service.
Daj się poznać 2016 2920 dni, 19 godzin, 1 minutę temu 46 źrodło rozwiń
W poprzedniej części wątku WPFowego projektu MemoryVisualizer skupiłem się na przypomnieniu, czym jest i jak implementować komendę (interfejs ICommand) w C#. Dla przypomnienia, napisałem ogólne rozwiązanie, któremu podaje się odpowiednie metody, dzięki czemu jest ca...
Daj się poznać 2016 2924 dni, 23 godziny, 57 minut temu 195 źrodło rozwiń
Pagination is (should be) a well-known concept for most of the developers. Whether we want to execute an optimized query on a database that will fetch just a small subset of all available records or increase the web service throughput by returning less data than it’s needed – it all boils down to the efficient usage of the pagination. I’m going to present my approach to this mechanism, both for the MSSQL and MongoDB databases, yet it can be also used in any other scenario such as in memory pagination.
Daj się poznać 2016 2925 dni, 20 godzin, 44 minuty temu 75 źrodło rozwiń
W C# 7.0 operator Is, a konkretniej dopasowywanie typów, zostało ulepszone. We wcześniejszych wersjach, byliśmy zmuszeni do pisania kodu. Jeśli zmienna jest danego typu, automatycznie zostanie zrzutowana. Innymi słowy, za pomocą jednego operatora wykonujemy 3 operacje: sprawdzenie typu, zrzutowanie oraz wykonanie instrukcji warunkowej. W poprzednich wersjach, możliwe było zrobienie czegoś podobnego, ale powstały kod zwykłe był mniej przejrzysty.
Architektura 2920 dni, 31 minut temu 354 źrodło rozwiń
Opis projektu MemoryVisualizera toczy się w kilku wątkach. Jednym z nich jest moja przygoda z F# w kontekście WPF. Po pierwszej części, w której w ogólności opisywałem jak możemy “pożenić” WPF z F#, pora kolejne kroki. Ale wcześniej potrzebne nam będzie krótkie przypomnienie z WPF w C#.
Daj się poznać 2016 2927 dni, 27 minut temu 66 źrodło rozwiń
In my latest post, I’ve stated that one day I’d like to provide some kind of UI for the users, that would visualize what’s going on in their system that is being monitored by the Warden. As you may have noticed, this special day has come quite fast. In this post, I’ll present the first prototype of the web interface design (that took me just a couple of minutes to complete).
Daj się poznać 2016 2927 dni, 27 minut temu 75 źrodło rozwiń
Big changes related to the Warden project – it has been totally rewritten to the new .NET Core in order to support cross-platform capabilities (at least in a future). The functionality per se (including API) didn’t change, yet from now on you can use Warden with the new DNX runtime. If you’re interested in the migration process, a current status of this update (including the supported parts of the project) and what are the next goals – take a look at the whole post.
Daj się poznać 2016 2927 dni, 19 godzin, 27 minut temu 77 źrodło rozwiń
In today’s post, I’ll briefly describe one of the most recent watchers responsible for the Redis monitoring. Of course, it is a part of the Warden project, therefore, all of the features such as hooks and integrations are available. Let’s not waste anymore time and start with the code examples.
Daj się poznać 2016 2934 dni, 39 minut temu 50 źrodło rozwiń
Dzisiaj artykuł o wstrzykiwaniu zależności. Każda poważniejsza aplikacja w obiektowym języku programowania powinna implementować zasadę odwróconego sterowania (IoC), a jej poszczególne modułu powinny być luźno powiązane (loose coupling).
Sztuka programowania 2932 dni, 21 godzin, 56 minut temu 871 źrodło rozwiń
W dzisiejszym wpisie chciałbym przedstawić nowe narzędzie udostępnione w Visual Studio 2015 jakim jest okno C# Interactive. Jest ono dostępne od wydania Update 1. Jeśli kiedykolwiek zdarzało wam się irytować podczas tworzenia kolejnego projektu Console Application tylko po to aby wypróbować działanie kawałka kodu na pewno ucieszy was fakt że za pomocą C# Interactive już tego nie będziecie musieli robić Okno to dostarcza mechanizm REPL...
Quite recently I’ve started working on new features for the Warden project and published the first prelease version to the NuGet (along with other packages that are meant to be additional plugins). In this post, I will discuss the available extensions that are basically responsible for making the fluent API even more fluent and the integrations that are a totally new thing, implemented as separate plugins (similarly to the watchers), which provide a quick access to the external services that can be part...
Daj się poznać 2016 2935 dni, 14 godzin, 26 minut temu 38 źrodło rozwiń
Daj się poznać 2016 2935 dni, 22 godziny, 47 minut temu 23 źrodło rozwiń
Jak wiemy delegaty w języku C# zawierają referencje do metod o określonych wcześniej parametrach oraz typie jaki dana metoda zwraca.
Sztuka programowania 2935 dni, 37 minut temu 138 źrodło rozwiń
W tym odcinku piszemy testy do generatora fali trójkątnej oraz generujemy wykresy tej fali do excela. Generator powinien tworzyć bufor jak najmniejszej długości tak aby tworzył ciągłą falę trójkątną 20kHz dla zadanej częstotliwości próbkowania.
Daj się poznać 2016 2938 dni, 16 godzin, 4 minuty temu 36 źrodło rozwiń
Any Kronos client will be available to use three basic commandsInsertGetDelete In future I want to add few more, like Count and GetKeys. Each of requests to the server serialized to binary form is preceded by few bytes of meta-data, including RequestType. In code its represented as a Request class, which in addition to type has two generic methods. At the beginning they might look difficult, but they are quite simple. First of them is responsible for sending any request to the server via special connec...
Architektura 2939 dni, 23 godziny, 41 minut temu 41 źrodło rozwiń
Immutability is a quite old concept that is mostly related to the functional programming, however, it’s also (maybe not so widely) used in the object oriented programming. An immutable variable/object can not be mutated, which means that once it’s been initialized it will never change it’s original value/reference (unless it’s deallocated). This approach results in some great benefits such as out of the box thread safety, yet in the OOP world, it does seem to be quite often abused or even not used at al...
Sztuka programowania 2939 dni, 23 godziny, 41 minut temu 68 źrodło rozwiń
Nie raz i nie dwa zdarzało mi się mieć potrzebę posiadania więcej niż jednego guzika na formie. Zawsze ale to zawsze miałem problem z tym jak to dobrze rozegrać. Aż wreszcie trafiłem na dobrą odpowiedź na SO.Model i Forma Załóżmy taki model danych, jakiś prosty viewmodel dla użytkownika.: Następnie aby go przesłać z powrotem do kontrolera zdefiniowałem taki model: Typ pola action jest także zdefiniowany. Teraz gdzieś na widoku tworzę formę, która umożliwi mi wpisanie ...
Programując w ASP .NET MVC często mamy potrzebę zmapować jeden obiekt na inny, może to być np. encja pobrana z bazy danych, którą trzeba pozbawić niektórych właściwości i przekazać do dalszych warstw naszej aplikacji, lub – w prostszy ujęciu – konwersja modelu na View Model, którym napełnimy widok naszej aplikacji.
Sztuka programowania 2935 dni, 14 godzin, 26 minut temu 220 źrodło rozwiń