W zasadzie możnaby zapytać po co wynajdywać koło na nowo skoro chociażby przez NuGet można pobrać gotowe pagery (czy jak to nazwać). Praktyka jednak pokazuje, że czasem musimy stworzyć stronicowanie z uwzględnieniem dodatkowych funkcjonalności, których gotowe narzędzia nie posiadają, a nawet gdy dysponujemy ich kodem źródłowym i możemy go zmodyfikować to grzebanie w czyimś kodzie okazuje się często niełatwe. wink W artykule przedstawię więc jak zbudować własne narzędzie do stronicowania czy też paginacji...
Po wstępie i omówieniu różnic między testami jednostkowymi, a integracyjnymi, czas na omówienie jak strukturalnie powinien wyglądać wzorcowy test jednostkowy. Będzie to pewnie najkrótszy wpis tej serii, ale jednocześnie jeden z najważniejszych. Pozwoli bowiem na pierwszy kontakt z testem jednostkowym w praktyce.
Sztuka programowania 2756 dni, 12 godzin, 41 minut temu 141 źrodło rozwiń
Kolejna część artykułu o GC. Zapraszam do lektury: http://msdn.microsoft.com/pl-pl/library/garbage-collector-cz-4-wycieki-pamieci
Sztuka programowania 2756 dni, 12 godzin, 41 minut temu 178 źrodło rozwiń
Gdy MyEnum nie ma wartości -13, to poniższy kod się wykona poprawnie i w enumie będziemy mieli wartość spoza zakresu enuma. var myEnum = (MyEnum) -13; Właściwa treść Mamy enum: enum MyEnum { One = 1 } I chcemy wykonać prostą operacje utworzenia tego enuma, tyle że posiadamy jedynie wartość liczbową (z zewnętrznego źródła danych). Akurat tak pechowo się stało, że mamy nie istn...
Sztuka programowania 2757 dni, 13 godzin, 15 minut temu 150 źrodło rozwiń
Introduction to MVC In the last few years a software architecture changed very heavily. From desktop (forms) application which were very popular in Windows XP users move to SOA and now completely start using web based solution hosting in a cloud. Of course such evolution is not something bad, just the opposite in my opinion because web based application are highly scalable, better secured and available from each place in the Earth where user has an Internet connection. Such a big changes in software ...
Ten wpis będzie po trosze prywatą ;). Nazbierało mi się kilka różnych skryptów, zazwyczaj są to pojedyncze polecenia SQL, które warto mieć pod ręką. No właśnie ;). Rzecz w tym, że nie zawsze pod tą ręką są, a tu na blogu praktycznie w 99% przypadków by były. Zatem dzielę się nimi, a przy okazji zapewniam sobie ich większą dostępność dla siebie. Na początek skrypt ...
Bazy danych i XML 2759 dni, 8 godzin, 54 minuty temu 218 źrodło rozwiń
Have you ever forgotten to lock your computer and went for a lunch? If so then you know what can happen. Your coworkers can send invitation for a party at your place to all co-workers (using your e-mail). They can also mess up with your desktop icons and much, much other fun stuff. The best solution is always lock the system. However sometimes we forget about it. Once I was bored after work I created WinForms application, which starts playing scary sound whe...
W poprzednim wpisie pisałem o pierwszym bloku grupującym – BatchBlock. Dziś czas przyszedł na kolejny element, tym razem JoinBlock. JoinBlock grupuje elementy podane na wejście w formie Tuple (pisałem o tej klasie kiedyś na blogu). Jeśli zatem podamy na wejście dwa integer’y, na wyjściu pojawi się Tuple
Sztuka programowania 2759 dni, 8 godzin, 54 minuty temu 26 źrodło rozwiń
Garść cytatów w kontekście Test Driven Development. Można je wykorzystać przy różnych okazjach, np. przy tworzeniu prezentacji albo przy rodzinnych bankietach ;)
Sometimes its easier to reaload only part of the website witout reloading whole page. Thanks to AJAX technology such aproach is possible and easy to code. Lets begin. Firstly we need to configure our environment so we must have a Visual Studio with MVC 3 Razor isntalled on it. Razor can be obtained from here. After installation process completed , the second step is to set up a new WebStie project (Picture 1.) Picture 1.After you confirm Your project type choise, next window starts. On it You s...
When we use the Entity Framework (EF) in multilayer information systems sometimes we want to extend classes generated by EF by adding some common properties or functions. Such operation cant be conduct on *.edmx data model so we need to make some improvement in our solution. Lets begin... Lets assumed that in our soulution we have only three layer (three project):Client console application which has reference to the second layer - 'ConsoleApplication' project nameClass library project with class i...
Architektura 2760 dni, 16 godzin, 52 minuty temu 73 źrodło rozwiń
Last week I get interesting task to develop. The task was to search input text in PDF file stored in database as FileStream. The task implementation took me some time so I decided to share it with other developers. Here we are going to use SQL Server 2008 R2 (x64 Developers Edition), external driver from Adobe, Full-Text Search technology and FileStream technology.Because this sems a little bit comlicated let`s make this topic clear and do it step by step. 1) Enable FileStream - this part is prett...
Bazy danych i XML 2760 dni, 16 godzin, 52 minuty temu 85 źrodło rozwiń
Since SQL SERVER 2005 it is possible to store XML data in database by using dedicated data type - XML. This type solved many programming problems such storing XML data as simple text which was very unpleasant to maintenance and detecting errors in document structure. Now stroring XML data is very simple and requires only the creation of column in XML data type. But sometimes we may want to do reverse operation. I mean generating XML document or fragment from non XML columns in a single SELECT statement....
Bazy danych i XML 2760 dni, 16 godzin, 52 minuty temu 31 źrodło rozwiń
Almost in each modern website project one of the feature is suggesting user possible items to select when he start typing one of them. Such functionality is done by using control named autocomplete. Under the hood it consists of at least three elements:UI control which allow user to type some text - mainly this in HTML input of text typeServer-side function which serves data to be auto-completedClient-side logic (written in JavaScript) which , by using AJAX, send request to the server asynchronously and...
In SQL SERVER 2005 the most common data type for storing BLOBs was an IMAGE datatype. When SQL Server 2008 and later SQL SERVER 2008 R2 occured the image datatypes coexists with several new and recomended by Mictosoft BLOB datatypes such varbinary(MAX). Let`s have a look: varbinary(max) /binary(n) variables store variable-length binary data of approximately n bytes, may store a maximum of 2 gigabytes.image variables store up to 2 gigabytes of data and are commonly used to store any type of data fi...
Bazy danych i XML 2761 dni, 10 godzin, 48 minut temu 22 źrodło rozwiń
In many of my projects including last one I need to user N-Tier architecture for my application. This is very good approach because you can centralize your business logic and have many type of clients (WWW, mobile devices) thanks WCF and REST technology. The other thing is that most of business solutions displays some data in tabular format knows as grids and grid has always one problem: number of records increasing in time. So we need to ask ourselves do we really need to display all the data together ...
Sztuka programowania 2761 dni, 10 godzin, 48 minut temu 124 źrodło rozwiń
An asynchronous operations become very popular in modern programming because by using its developers can take full advantage of multicore processors and perform several operation at the same time. Multithreding exists in ASP.NET since 2.0 version but it was very sophisticated to use it. However starting from .NET 4.5, ASP.NET is fully compatible with all these great features. To demonstrate how to start with the asynchronous operation in ASP.NET 4.5 I`ve created very simple solution which consist of ...
In June 3 – 6, there was Tech Ed North America conference in New Orleans. The videos are available on channel9. I have watched a few very good sessions, and I can recommend you especially 5 of them.
AutoResetEvent\ManualResetEvent może być używany do synchronizacji międzyprocesowej tak samo jak np. mutex. Posiada podobny zestaw metod do tworzenia obiektu z nazwą oraz późniejszego jego otwierania. Aby móc go użyć do synchronizacji międzyprocesowej należy oczywiście nadać obiektowi nazwę – tak samo jak to jest z Mutex. W tym problem, że konstruktory ManualResetEvent czy AutoResetEvent nie przyjmują takich parametrów. Zaglądając jednak do dokumentacji dowiemy się, że:publicsealedclass ManualResetEvent...
Sztuka programowania 2763 dni, 16 godzin, 26 minut temu 66 źrodło rozwiń
Zakładam, że polecenia update języka T-SQL nie trzeba nikomu przedstawiać. Jest to jedno z jego czterech podstawowych poleceń. Służy do aktualizacji zawartości kolumn tabeli. Zakładam jednak, że niewiele osób wie, iż polecenie to potrafi także aktualizować...
Bazy danych i XML 2765 dni, 17 godzin, 24 minuty temu 166 źrodło rozwiń