Thursday, October 22, 2015

Different encoding systems for "Hello" example:


ANSI
48 65 6C 6C 6F

Unicode (little-endian) encoding with no BOM.
48 00 65 00 6C 00 6C 00 6F 00

Unicode (little-endian) encoding with BOM
FF FE 48 00 65 00 6C 00 6C 00 6F 00

Unicode (big-endian) encoding with no BOM
00 48 00 65 00 6C 00 6C 00 6F

Unicode (big-endian) encoding with BOM
FE FF 00 48 00 65 00 6C 00 6C 00 6F

UTF-8 encoding
EF BB BF 48 65 6C 6C 6F

UTF-7 encoding
2B 2F 76 38 2D 48 65 6C 6C 6F



Reference:
http://blogs.msdn.com/b/oldnewthing/archive/2004/03/24/95235.aspx

Friday, October 16, 2015

How to fix issue "The target GatherAllFilesToPublish does not exist"?

#1 Option:
Add following tag into project file:
  <Target Name="GatherAllFilesToPublish">
  </Target>
But will output all of source files into web site.

#2 Option:
Replace
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="false"/>
To
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

Reference:
http://forums.asp.net/t/1838524.aspx?The+target+GatherAllFilesToPublish+does+not+exist

Wednesday, October 7, 2015

INTENTION REVEALING INTERFACES from DDD

Excerpt from DDD book:


"The beauty of objects is their ability to encapsulate all that so that client code is simple and can be interpreted in terms of higher-level concepts.
But if the interface doesn’t tell the client developer what he needs to know in order to use the object effectively, he will have to dig into the internals and understand the details. A reader of the client code will have to do that same. Then most of the value of the encapsulation is lost. We are always fighting cognitive overload. If the client developer’s mind is flooded with detail about how a component does its job, his mind isn’t clear to work out the intricacies of the client design. This is true even when the same person is playing both roles, developing and using his own code, because even if he doesn’t have to learn those details, there is a limit to how many factors he can consider at once."


It is so true if working on a larger dev team.

Thursday, September 24, 2015

Another way to talk about CQRS/Event Sourcing

"A more promising model, used in some systems, is to think of a database as an always-growing collection of immutable facts. You can query it at some point in time — but that’s still old, imperative style thinking. A more fruitful approach is to take the streams of facts as they come in, and functionally process them in real-time."

Turning the database inside-out with Apache Samz
https://martin.kleppmann.com/2015/03/04/turning-the-database-inside-out.html

Monday, September 14, 2015

How to swap two numbers without third variable?

int first,second ;
first = 1;
second = 2;
first = first + second;
second = first - second;
first = first - second;

Friday, August 14, 2015

Practicing Programming

https://sites.google.com/site/steveyegge2/practicing-programming

Practicing to make skills better, no problem, but many Programming technologies are going away all the time.

Monday, August 10, 2015

Architects Should Code: The Architect's Misconception

Architecture Spike

The architect could lead a development spike focused on architectural discovery or delivery. A spike is a functional, proof of concept implementation for some aspect of the architecture used to identify or mitigate risk by exploring a new technology.

http://www.infoq.com/articles/architects-should-code-bryson?utm_source=reddit&utm_medium=link&utm_campaign=external



Tuesday, August 4, 2015

How to solve log4net not writing into database problem

log4net not writing into database problem
Turn on debug, no problem found. At last, change bufferSize from 400 to 1
<bufferSize value="1" />
Everything is working fine.


References:
http://stackoverflow.com/questions/756125/how-to-track-down-log4net-problems

Thursday, July 30, 2015

How to compare two tables schema by SQL query in MS SQL?

How to compare two tables schema  by SQL query in MS SQL?
SELECT name,system_type_id,user_type_id,max_length,precision,scale,collation_name,is_nullable into #Tablescehma1
FROM sys.columns WHERE object_id = OBJECT_ID('TABLE1')

SELECT name,system_type_id,user_type_id,max_length,precision,scale,collation_name,is_nullable into #Tablescehma2
FROM sys.columns WHERE object_id = OBJECT_ID('TABLE2')

select * from #Tablescehma1
except
select * from #Tablescehma2

Monday, July 27, 2015

Secondary skills for software engineers

Secondary skills for software engineers
http://radek.io/2015/07/27/secondary-skills-for-software-engineers/

What are the most important skills?
1. Language(s)
2. Problem
3. Naming
4. Communication
??

Thursday, July 23, 2015

In ASP.NET Logout: GET or POST?

In ASP.NET Logout: GET or POST?

I just switch from POST to GET, and tested in Chrome, no problem found for now
Suggestion from Stackoverflow
http://stackoverflow.com/questions/3521290/logout-get-or-post