wtorek, 28 lutego 2017

Astronauts exists. I've just meet one

In 2001 Joel Spolsky has wrote his great blog post about Software Astronauts. I have readed it in 2006, some times heard about astronauts in conferences but never meet any one in my professional life. Up to day. 

The best describe of "typical astronaut" we can find in legendary speak of Wojciech Seliga in Confitura 2012 (java concefence) in 7.45-9.00 (minute) link to his speach

Our astronaut:
- is old 
- excessive opinion about himself
- don't like to write code
- don't understand business domain (this is real scary)
- don't understand our company culture
- don't understand product that we are making (he treats it like another CRUD but we are not making CRUD app)
- all the time talk about the abstraction
- all the time talk about breaking changes in current architecture
- try to fix problems that don't exists
- making conflicts in team

czwartek, 23 lutego 2017

.NET Standard Library (Portable library)

About few months ago me and my team have started new project in .net core. We wanted to use the newest technology that is on market (in .net world). After few months we discovered, that not every component in .net ecosystem is written in ".net core way". For example EntityFramework (at this moment there is version EF.core) or WCF (at this moment we still need to use .net 4.6.2).

In one project we have library (.dll) that was used by:
a) .net 4.6.2 solutions (WCF)
b) .net core solutions (our main Web App, tests, and others)

First we used .net core library, after that we have changed to .net 4.6.2 library (and git have problems with branch changes old/new library). But in situations, when we need to use some library in both, .net core and .net 4.6.2 solution there is better way. It's called .NET STANDARD LIBRARY.

.NET STANDARD LIBRARY is a new library type project (.dll) that can be used in many different project types in example: .net 4.6.2, .net core, mobile applications. It have some limitations, but in general this is a big step in good direction.


There is good blog post in MSDN -> https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/

If you newer heard about .net standard library you should read about it.

poniedziałek, 24 października 2016

RevDeBug

In last Thursday I have pleasure to take part in Warwaw .NET User Group and hear about new logging tool named "RevDeBug".

RevDeBug is a .net tool, that can be joined to any .net solution at compile time and after compiled into .net solution it collect information about call stack. It's not "error call stack" that we know from standard exception stacktrace. It collects any information, about how code was executed so we can watch how aplication works line by line like we usually do it in debuger. But this time, this code is from production/uat/whatever server.

For me it is quite interesting tool. Maybe I will use it in future in production when I find some very tricky error. 

Cons: 
- logs can be really huge, in example 1GB of logs can be taken in 15-20 minutes (or maybe even less)
- performance - every logging tool working live on production lowers performance of our application

https://www.revdebug.com/ -> project web site

Session about RevDeBug in English (from .net Leipzig Meetup)







niedziela, 14 sierpnia 2016

HTML 5 Local Storage vs Cookies

While I was solving Weekly Javascript Chalange Task 3 I ask my self a quite interesting question. What is a difference between Local Storage and Cookies?
Somebody already asked that question on SO:  http://stackoverflow.com/questions/3220660/local-storage-vs-cookies ,and there is a very good answer:

Cookies and local storage serve different purposes. Cookies are primarily for reading server-side, local storage can only be read client-side. So the question is, in your app, who needs this data — the client or the server?
If it's your client (your JavaScript), then by all means switch. You're wasting bandwidth by sending all the data in each HTTP header.
If it's your server, local storage isn't so useful because you'd have to forward the data along somehow (with Ajax or hidden form fields or something). This might be okay if the server only needs a small subset of the total data for each request.
You'll want to leave your session cookie as a cookie either way though.
As per the technical difference, and also my understanding:
  1. Apart from being an old way of saving data, Cookies give you a limit of 4096 bytes (4095, actually) - its per cookie. Local Storage is as big as 5MB per domain - SO Question also mentions it
  2. localStorage is an implementation of the Storage Interface. It stores data with no expiration date, and gets cleared only through JavaScript, or clearing the Browser Cache / Locally Stored Data - unlike cookie expiry.

 Why I mention about it? For two reasons:
a) I use this blog as my notepad, that I sometimes visit
b) this question have a great "interview question" potential



sobota, 13 sierpnia 2016

Weekly JavaScript Challenge

This note is to promote some great event that I have found in internet.

Michał Miszczyszyn is one of polish javascript community leader and he starts new weekly javascript chalange. It works, that Michał ones a week create new javascript task, and any competitor can join and try to solve that task. After that time (about one week) Michał takes responses and makes code review.
When he finish code reviews he put task review on his blog.

What a great oportunity for learning new language with code review. Seems great. What you think about it?

I think, that I try to solve some challenges in my free time, but not guarantee that they where will appear regular.

Links:
Michał blog: https://typeofweb.com
Michał blog posts about chalange: https://typeofweb.com/tag/weekly-javascript-challenge/
facebook group where we can find news about new challenge: https://www.facebook.com/groups/1131907053499522/
First task event: https://www.facebook.com/events/997187053723327/
My solutions on github: https://github.com/zchpit/WeeklyJavaScriptChallenge
My solution for task 1 in jsFindle: https://jsfiddle.net/vknqwnb8/15/

niedziela, 31 lipca 2016

Review of tools for PDF generate in .net

 This is my first blog post in English, so fill free to add your comment if any part is incomprehensible.

We have many pdf libraries that we can use, but none of them are perfect and all of them have some advantages and disadvantages. Here is my little experience with generating PDF file in .net framework with generating reports both, in a browser on demand and large numbers in bash/console by night.

Crystal_Reports - big, commercial library develop by big company
Pros: 
- can be really fast
Cons: 
- ugly (at least not pretty) reports
- works on my machine issue (your report can be seen different in different machine, in example on server what can be frustrating when troubleshooting). 

SQL_Server_Reporting_Services - big library that comes with commercial licence for MS SQL Server
Pros:
- quite pretty
- have many in common with office / excel, so you BI can help you in building reports
- can use custom fonts
Cons:
Local Mode:
- have memory leaks (you will see it when you try generate PDF in large numbers)
- more complicated reports can be really slow (reporting services team upgrading reporting services from .net 3.5 to 4.0 made bug with grouping rows in table).
- don't have justify text 
- you can't "copy/paste" document from MS Word
Server Mode:
- sometimes there are issue with authentication and priviliges
- you can't use collection of your objects as data source (it was a reason why I choose Local Mode).
- don't have justify text 
- you can't "copy/paste" document from MS Word

Wkhtmltopdf - open source library made by google for converting html into pdf
Pros:
- quite fast
Cons:
- graph from jQuery library are medium quality (in magnification you can see pixels)
- few options for editing text

MS Word Interop - native MS Word API for CRUD operations in word documents
Pros:
- best MS Word document projection
Cons:
- slow
- need to have MS Office Word installed on working machine
- requires a little work and workarounds when we want to use it from task scheduler ( http://stackoverflow.com/questions/1006923/automating-office-via-windows-service-on-server-2008/1680214#1680214 )
- requires a much more work when we want to use it from IIS 

Telerik - Kendo-UI - commercial library to creating great html, and export it to pdf
Pros:
- quite pretty
- write html and just export it into pdf
Cons:
- have trouble with custom fonts 
- pdf generation could be faster 

sobota, 2 lipca 2016

ELMAH

ELMAH, czyli Error Logging Modules And Handlers (ELMAH) - jest to biblioteka/moduł dostępny za darmo służący do zarządzania oraz monitorowania błędów w oprogramowaniu. Moduł ten oparty jest na śledzeniu zdarzeń i można go podpiąć do istniejącej aplikacji bez zmiany ani jednej linii kodu (zmiany wykonujemy tylko w konfiguracji). Główne zadania ELMAH-a, to obsługa, zarządzanie, monitorowanie, eskalacja błędów, ze szczególnym uwzględnieniem błędów nieobsłużonych.

Główne zalety/funkcjonalności ELMAHA:
- prostota konfiguracji
- prosty interfejs webowy pokazujący szczegółowe dane
- odkładanie błędów do bazy danych / plików xml / etc
- przechwytywanie i logowanie nieobsłużonych błędów
- wysyłanie maili i notyfikacji w momencie wystąpienia błędów
- logowanie wszystkich lub tylko wybranych typów błędów
- darmowa biblioteka
- możliwość logowania w sposób "tradycyjny" z poziomu C#
( ErrorSignal.FromCurrentContext().Raise(e); )


Z tego tez powodu uważam, że warto się przyjrzeć tej bibliotece bliżej.

Linki:
- http://code.google.com/p/elmah/
- http://www.asp.net/web-forms/overview/older-versions-getting-started/deploying-web-site-projects/logging-error-details-with-elmah-cs