October 17, 2010 Uncategorized No comments
October 17, 2010 Uncategorized No comments
NuPack is package manager for .NET introduced to help developers easily work with 3rd party libraries.
Here is great post on NuPack, I would recommend to read.
But as I promised in twitter to have blog post called “What the hack is NuPack”, I need to post this.
So,… downloading…
After it get downloaded and installed, we have one additional menu item in same place where we do have “add reference”:
So what does “Add Package Reference” do?
It takes a look on the feed for packages, where you see 3rd party you can add. On the picture below I just added AutoMapper, by clicking “Install”.
I can easily search for other components and install them. On the picture below I easily searched for my favorite ORM – Nhibernate and installed it. But if you ever worked with it you know that it depends on few other 3rd party, such as log4net, etc. Great news! They all get installed automatically.
Physically it puts config file within your project and locate all your components under folder ”packages” along with your solution file, like below:
After that I got interested to know how it behaves with couple of solutions all in SAME folder, and figured out that it works just fine – it puts everything into same folder.
Everywhere I read about nupack they all declare that it is solution related, so I have one folder for solution. But as you may know I work with enterprise project and we keep all 3rd party in separate location where dozen (20-30) solutions are looking for references. And it looks that I do not have possibility to configure NuPack to put “packages” folder in another place. Or I’m missing something. Please let me know.
EDITED (Oct 17, 11:39PM): I already got an answer for my question:
So to shortly summarize:
NuPack allows you easily fetch whole range of different 3rd party components and momentarily add references to your projects without need to manually go and download them, then unpack and reference. Also NuPack allows you easily manage all of your components, allowing you update them and do other cool stuff. Go and check it out!
October 17, 2010 Uncategorized 2 comments
I guess all bloggers know about such things as Google Analytics and Feedburner. But if you are not blogger, in few words those are statistics engines analyzing site’s visits. I’m keeping eye on statistics and here just want to share some information and thank you all.
Here is where from you all guys are:
Just another more deterministic representation of the same information:
Sadly, but I turned on Google Analytics only in the end of this summer, so pictures above do not represent whole life-time of my blog.
But feedburner states following about my Subscribers:
I have 30 readers on average for the whole time of existing of this blog. Most recent average numbers are near 50.
Also accordingly to feedburner I have:
Also I have 256 comments.
All of this shows me that my blog is getting more popular and it continues paying me back…
I have few posts on learning English and its importance for software engineer. For example my article “English classes in outsourcing company” became very popular for some reason, at least feedburner states that it was viewed 130 times and I got some feedback from at least 4 people on that post.
This post is also about English but this time it is very short. I just want to recommend one of the English podcasts. It is called:
I’ve been listening to this podcast for a few weeks and I would say that this is great and awesome tool to learn English and to understand lot of worlds usage deeply. I’m listening to it when getting to the work and back from it.
Ok, for example, do you know what does “to pimp the car” means? Ok let start with noun – “pimp”, which means bad guy who supervises prostitutes, but when we use it as verb it could literally mean to do what pimp does, but in application to car it means to add many different features to it and make it looking awesome or maybe not really awesome. You decide: Google search images
And that is not all – podcast just brings lot of interesting stuff you may learn to better understand not only English but USA as well, also differences between British and USA English.
Guys, from ESLPOD thank you very much!!!
October 17, 2010 Career, Opinion, Success No comments
Job and happiness
Cheese
Money table
You can put as Deposit | MDeposit (e.g. 10000) | -be honest | |
You need per day | PerDay (e.g. 100) | PerMonth=PerDay*30 | -calculated |
Per day to be happy | PerDayHappy (e.g. 500) | PayMonthHappy=PerDayHappy*30 | -up to you |
Ave. bank interest | InterestRate (e.g. 0.12) | MInterest=YouHave*InterestRate/12 | -depends on banks |
You are safe: | YouAreSafe=PerMonth*6 | YouHave > YouAreSafe ? (“you are more or less in good situation”) : (“Hey man, do you think about the future?”) | -if you do not have enough to live half a year, something is definitely bad with your budget |
You can live without need to work | YouHaveEnough=PerMonth*12/InterestRate | YouHave > YouHaveEnough ? (“you can stop working without impact on your life”) : (“it is too hard to reach this since needs often increase ”) | months you have to wait to reach this goal:(YouHaveEnough-YouHave)/(MDeposit+MInterest) |
You are free, or even rich | YouHappy=PerMonthHappy*12/InterestRate | YouHave > YouHappy ? (“hey! you are rich”):(“almost none reach this, since they start spending too much when they have enough”) | months you have to wait to reach this goal: (YouHappy-YouHave)/(MDeposit+MInterest) |
What do I recommend to help you find out if some job is for you?
Job of my dream
Questions:
Also I was looking for some other good lists of questions. One is more general and other is awesome list of questions from stackoverflow.
Awesome questions list from stackoverflow
Here below in dark-blue is complete list of questions composed by Rob Wells on stackoverflow. This is copy-paste (!). All rights are reserved for stackoverflow and I do not pretend to be author of any part of it. Please follow this link to see original question.
Questions for development:
Questions about estimating:
Questions regarding the team:
Questions regarding personnel type policies:
Questions about management:
For the manager:
Then I ask them to answer the same kinds of questions for the company as a whole, explaining that I consider there’s such a thing as a company “personality” that usually emanates from the top. I ask how that has changed over the years (if they’ve been there very long).
Further questions on management:
Questions on the work environment:
Miscellaneous questions:
Hope you liked this blog post. Looking forward to hear from you guys!
October 6, 2010 .NET, Deployment 13 comments
So few days ago I faced with issue of 3rd party references.
My original question on stackoverflow:
What is the best approach to use 3rd party that uses another version of other 3rd party (log4net) already used in the system?
I got (as for now) two answers and I would like to try them out.
So I created 3 projects, one references log4net of version of 1.2.10.0 and another references 1.2.9.0. Both of them are referenced in client console application, which also references one of the log4net assemblies. In client application I’m trying to execute code that requires log4net in both of the assemblies.
Below is projects layout:
When I execute my code I’m getting error:
In order to resolve this I tried suggestion one by one…
Suggestion number 1
Accordingly to MSDN there is possibility to redirect code execution to assembly with higher version, just with using following configuration:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net"
publicKeyToken="b32731d11ce58905"
culture="neutral" />
<bindingRedirect oldVersion="1.2.9.0"
newVersion="1.2.10.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I’ve tried it and it did not work. Reason is that we cannot do redirection between assemblies with different PublicKeyToken-s. log4net 1.2.9.0 has “b32731d11ce58905” and log4net 1.2.10.0 has “1b44e1d426115821”. Also see this stackoverflow question.
Suggestion number 2
Use GAC. So when I install those two assemblies into GAC:
In this case code works, but suggestion doesn’t work for us, since we do not want to gac assemblies we use.
Other suggestions
So I’ve been thinking about another approach.
Approaches that require rebuilding our code with different version of log4net are not suitable for us. At least for now.
Another thing about which I’ve been thinking is to load those assemblies into different application domain or host 3rd party that uses 1.2.9.0 under different WinService. Both of these are cumbersome solutions and I like to avoid them.
YOUR SUGGESTION
If you have some ideas, could you please let me know!
[EDITED 7 Oct, 2010 11PM]
Do you know what is the most interesting about all of this? It is how it has finished. We contacted those guys, who developed component we now should use. They gave us know, that they were encountering issues with updating on-the-fly configuration file for log4net 1.2.10.0. By their words, new version of log4net is not capable of doing this. So they sent as simple application that demonstrates this, and indeed, after updating config when app is running, 1.2.10.0 did not catch up new configuration, but 1.2.9.0 was working just fine. This surprised me very much, so I went to this download page and downloaded latest binaries. When I tried it got working!!! Actually I guess that they simply used version of log4net buit with references to .net framework 1.1, and we should use one built with .net 2.0 (Yeah! Actually if you would download you will see.)
After all of this, they created new sub-release of their sources especially for us and they were able to fix some minor bug. Great news! Unexpected end of story! :)
October 5, 2010 OOP, UML 2 comments
Shame on me, but I have to admit that yesterday I had doubts about what is aggregation and composition. As everyone of us would do I started googling and found some of very useful and helpful explanations.
Two examples to start with
For example, we have table in room, we say that room aggregates table. Table can live without parent object (room).
Example of composition would be college composing faculties. Faculty cannot live without college.
Challenge
When I talked about this two examples with my friend he challenged following verification:
“If child cannot live without parent we have composition and when child can live without parent we have aggregation.” He gave me example of queue build upon list, he stated that this always was an example of composition to him. In this case queue has field _innerList (or something like that), but indeed being child list can be moved out of queue and conceptually we can operate with different lists in our system. So the rule of child-parent doesn’t apply. Even more it is applicable vise verse – queue (parent) cannot live without list (child).
So I found following to be the best way to distinguish:
Relational/UML point of view
If you would read this wiki page. You will also find that aggregation is more general term then composition. They explain this from a bit another point, point of relations.
Above relation on the picture shows composition and is marked as filled diamond, below relation shows aggregation as more generalization of composition, without restriction to have child elements (Monday our pound is full of ducks and Tuesday there is no ducks at all).
I would love to hear from you thoughts on how we can help others distinguish this more quicker.
October 4, 2010 Book Reviews 6 comments
I read this book, and you know what? I’m disappointed by it. I has lot of ideas that do NOT glue with current world Agile ideas. Book states that everything should be designed and specified up to smallest details and after that developers start code. Also as one of improvements of the process was to omit unit testing o_O. Regardless of this I liked ideas about how managers should deal with people, bosses, deadlines, team sizes.About team sizes: If team is huge it will not lead to good design or effective utilization of resources – it will lead to enormous amount of meetings, discussions, etc, and in the end you could even get worse results!
October 3, 2010 Design Patterns No comments
VISITOR
public interface IVisitor { void Visit(OfficeBuilding building); void Visit(Floor floor); void Visit(Room room); }
public class ElectricitySystemValidator : IVisitor { public void Visit(OfficeBuilding building) { var electricityState = (building.ElectricitySystemId > 1000) ? "Good" : "Bad"; Console.WriteLine(string.Format("Main electric shield in building {0} is in {1} state.", building.BuildingName, electricityState)); } public void Visit(Floor floor) { Console.WriteLine(string.Format("Diagnosting electricity on floor {0}.", floor.FloorNumber)); } public void Visit(Room room) { Console.WriteLine(string.Format("Diagnosting electricity in room {0}.", room.RoomNumber)); } }
public class Floor : IElement { private readonly IList<Room> _rooms = new List<Room>(); public int FloorNumber { get; private set; } public IEnumerable<Room> Rooms { get { return _rooms; } } public Floor(int floorNumber) { FloorNumber = floorNumber; } public void AddRoom(Room room) { _rooms.Add(room); } public void Accept(IVisitor visitor) { visitor.Visit(this); foreach (var room in Rooms) { room.Accept(visitor); } } }
Source code elements in diagram
Usage
var floor1 = new Floor(1); floor1.AddRoom(new Room(100)); floor1.AddRoom(new Room(101)); floor1.AddRoom(new Room(102)); var floor2 = new Floor(2); floor2.AddRoom(new Room(200)); floor2.AddRoom(new Room(201)); floor2.AddRoom(new Room(202)); var myFirmOffice = new OfficeBuilding("[Design Patterns Center]", 25, 990); myFirmOffice.AddFloor(floor1); myFirmOffice.AddFloor(floor2); var electrician = new ElectricitySystemValidator(); myFirmOffice.Accept(electrician); var plumber = new PlumbingSystemValidator(); myFirmOffice.Accept(plumber);
Main electric shield in building [Design Patterns Center] is in Bad state.
Diagnosting electricity on floor 1.
Diagnosting electricity in room 100.
Diagnosting electricity in room 101.
Diagnosting electricity in room 102.
Diagnosting electricity on floor 2.
Diagnosting electricity in room 200.
Diagnosting electricity in room 201.
Diagnosting electricity in room 202.
Plumbing state of building [Design Patterns Center] probably is in Good condition, since builing is New.
Diagnosting plumbing on floor 1.
Diagnosting plumbing on floor 2.
Classic UML diagram
September 26, 2010 C#, Design Patterns, Java, Opinion, Personal, Success 12 comments
Yeah, title sounds not logically, but you will understand in a few why it is still relevant to this blog post.
It was and it is a good idea to…
In one of my blog posts I’ve decided to have all of the GoF Design Patterns written with Java. And idea itself is very good. Having all of the design patterns written by your own with you own examples gives you understanding of the DP that you cannot gain anywhere else plus to that if you have industrial experience of using all of them you can start think that you are guru of DP.
Process of writing my post on one of the Design Patterns looks like this: I read chapter of the GoF book on the particular DP, then I think up my own example if I do not have it already in my mind and after I’m done with some preliminary ideas I search over the internet for interesting articles on it and probably rethink some of the aspects of my example. After all of that I proceed to writing blog post and source code with Java.
Conclusion: Awesome and probably one of the best ways of learning DP is to have your own example of using it and industrial experience.
Design Patterns articles
One of the intents of having DP written in Java was to familiarize with that language. But it turns out that I did not learn much from Java (except of few things). Also few months ago I started keeping up Tuesday’s Design Pattern on the Lviv .NET User Group Page. Since it is .NET specific UG, I used to do following: 1) translate and 2) translate. In first place it is translation from English to Ukrainian and in second from Java to C#. When with item number one I have to apply some logic and rephrasing I cannot say the same about second item. I just copy code-paste code into Visual Studio and change few keywords. So what do I learn regarding of Java in this case?
I will continue learning Java, but I have to consider better way of doing it. I will also continue writing about Design Patterns, but with examples in C#.
Conclusion: Learning another programming language (Java) is really great idea, but be sure that you choose right approach of doing this.
First free e-book
On the road to Lviv I got perfect idea to start my first book. Of course this cannot be comprehensive stunning author’s book, but I have to start with something. In other words some probing book and this could be this “try it” case. I’m almost sure that there are no books about GoF Design Patterns in Ukrainian. (I suppose that there are in Russian, which can be easily understandable for most Ukrainians…)
How this book will be different?
Why do I need it?
I understand that this book might not be popular at all. But I have to start with something and plus to this it will help me familiarize with the whole process and build my confidence for future.
Also if you have some doubts about my idea I have a question for you: “Have you ever dreamt about your own book? If yes, do you have at least small book written?”
Conclusion: Never be skeptic about starting your first book. It might be a huge step to your success as anything else you are hesitating about but still dreaming about it!
September 23, 2010 Personal 9 comments
So I finally bought high performance machine for my blogging :).
Why I was not satisfied with my previous laptop?
Comparison of Dell Studio 1535 and Dell Studio XPS 1647
So here is comparison of what I had and what I have now:
Dell Studio 1535 |
Dell Studio XPS 1647 |
Processor Intel® Core™ 2 Duo T5850 2.16GHz |
Processor Intel® Core™ i7-620M Processor 2.66GHz (3.33GHz Turbo Mode, 4MB Cache) |
Display LCD(1280×800) |
LCD Panel Edge-to-Edge FHD Widescreen 15.6 inch WLED LCD (1920×1080) W/2.0 MP |
CD ROM/DVD ROM DVD Super Multi |
CD ROM/DVD ROM 8X Slot Load CD/DVD Burner (Dual Layer DVD+/-R Drive) |
Memory 2GB DDR2-667 |
Memory 4GB Shared Dual Channel DDR3 at 1333MHz |
Hard Drive 320GB 5400 |
Hard Drive |
Video Card
ATI Mobility Radeon™ HD 3450 |
Video Card ATI Mobility Radeon™ HD 5730 – 1GB |
Sound High Definition Audio |
Sound High Definition Audio 2.0 with SRS Premium Sound |
Wireless Dell Wireless 1397 WLAN Mini-Card |
Wireless Intel® 5300 WLAN Wireless-N (3×3) Mini Card |
Battery 56 Whr Lithium Ion Battery (6 cell) |
Battery 85 WHr 6-cell Lithium Ion Primary Battery |
Windows Experience Comparison
Dell Studio 1535:
Dell Studio XPS 1647:
My personal comparison
Getting everything up and running
Latest cents
(*) Ok, I have it, but I gave up using it.