Sunday, July 31, 2016

What is the purpose of "imports" in project.json of .NET Core apps?

I was doing the tutorial "Building Your First Web API with ASP.NET Core MVC and Visual Studio" and after I finished it, I thought of trying to see if Moq will work with .NET Core.

Then I changed the content project.json file with the JSON below whose significant parts came from the "Testing your Console App" section of the tutorial "Getting started with .NET Core on Windows/Linux/macOS using the command line":

Then I tried to remove the "imports" part of the project.json file because I do not know what it was for. But this error pops up in Visual Studio:

... and errors like this in the Output window:
Package xunit.assert 2.1.0 is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Package xunit.assert 2.1.0 supports:
- dotnet (.NETPlatform,Version=v5.0)
- portable-net45+win8+wp8+wpa81 (.NETPortable,Version=v0.0,Profile=Profile259)

So I tried to look for the purpose of this "imports".

I found the docs for project.json but I do not understand what it is trying to say.

Will cause other packages targeting portable-net45+win8 to be usable when targeting netcoreapp1.0 with the current project.
What does that mean?

Then I tried to google for using this:
more explanation of "imports": "portable-net45+win8"
Google shows only one result which came from StackOverflow which led me to an article from the EF docs. It says this regarding EF:
Some of EF Core’s dependencies do not support .NET Standard yet. EF Core in .NET Standard and .NET Core projects may require adding “imports” to project.json as a temporary workaround.

The workaround is to manually import the portable profile “portable-net451+win8”. This forces NuGet to treat this binaries that match this profile as a compatible framework with .NET Standard, even though they are not. Although “portable-net451+win8” is not 100% compatible with .NET Standard, it is compatible enough for the transition from PCL to .NET Standard. Imports can be removed when EF’s dependencies eventually upgrade to .NET Standard.
That is a much better explanation! Even though I do not know what PCL is :) .

Happy coding!

Saturday, July 30, 2016

Why I Started Blogging (Reprise)

I recently started thinking about possible consequences of the things I said about the schools/colleges I attended in my previous blog posts: here and here.

I was thinking that these blog posts might drive away prospective employers or clients in the future because they might think I am a ranter.

Then I remembered that I have written something that sounds like those "rants" in my first blog post.

So I looked for that first blog post and read it again.


WOW! I was calm when I wrote that one. I was not ranting!!

And it made me remember the persons (I thought it was only one person) who said that "Programming is easy" and that "Programming Well is hard". They were David Malan and his co-professor on his video lecture for CS50 many years ago.

It also made me remember the first reason why I started blogging: it was to put my programming outputs online.

And then this one (this is really good):
I'm not saying that I have never learned anything from the schools I attended. In fact, there are things that I believe I could have not known had I not attended these schools (tama ba akong grammar?[Is my grammar correct]). So I have learned many important things from my schools.

But it is the "well" part of programming that I need to know now. And I have to find it somewhere else.
And this one also:
I am also planning to pursue a degree in mathematics in the near future if I have time and enough money.
I thought that this mathematics degree thing only came to my mind a few months ago. But it was already there five years ago.

... So if you are a potential employer or client, please don't be afraid of hiring me.

Those two blog posts I linked to above are just part of my journey as a programmer.

... and I have never complained online about my previous employers and clients. They were good employers. They were not perfect (and I don't really know what a perfect employer is.. and I am not perfect) but they were good.

I worked for Jairosolutions and Mynd Dynamic (with Common Census as our client) in the past. I resigned from Mynd Dynamic last May because I wanted to finish my bachelor's degree in CS because I want to get a degree in mathematics.
But because of some personal problems, I think I'm going to stop my schooling again and concentrate on honing my programming skills in .NET Core and Angular2 and maybe Xamarin and look for a job that needs these kinds of skills.

Sunday, July 10, 2016

My first graph problem solved: "10928 - My Dear Neighbours"

[UPDATE (July 27, 2016): I remember that this is not really the first graph problem I solved. It is, rather, the first graph problem on UVA Online Judge that I solved. I was already able to solve a graph problem when I took the free Stanford course named CS106B last 2011. But I already forgot how I solved it.]

I am so excited!!!

I solved my first graph related problem: the UVA Online Judge's problem #10928 "My Dear Neighbours".

This might just be a very simple problem but at least I am able to get started with solving graph problems.

Picture taken from

Here is my solution:

My actual solution is actually here.

Happy coding!!!

Friday, July 8, 2016

Kidapawan Programmers Club

I have always wanted to be part of a coding club since first year in college. But there are no coding clubs in the schools (in our city) where I went to study.

So few months ago, when I decided to resign from my job and go back to college to finish by bachelor's degree, I said to myself that I am going to start a coding club and will recruit students that are very interested in programming from all colleges in our city; and I am going to name the club "Kidapawan Programmers Club".

I had two goals for starting this club:
  1. The club members (including me) will help each other solve programming contest problems like those in UVA Online Judge. (At the moment, I am able to solve only those simple ad hoc problems and some simple problems that involve the use of basic data structures like stack and queue. I am hoping that the club will be able to recruit someone who can help us solve more complex problems like problems on graphs and computational geometry.)
  2. The club members will help each other study how to create software systems that are easy to maintain and to write code that are easy to read.
As part of goal number two, I also wanted to instill in the minds of the club members (including me) this idea that Robert Martin said in his blog post titled "A Little Architecture":
"The important decisions that a Software Architect makes are the ones that allow you to NOT make the decisions about the database, and the webserver, and the frameworks."

The original plan was to recruit from all colleges that have IT courses in our city, but I was only able to recruit from the school I am currently studying in because I became lazy in looking for ways to recruit from other schools when these thoughts came to my mind:
(1) it will be hard to find a meeting place if the club members are coming from different schools, and
(2) it will also be hard to find a schedule so that all the club members will be present during the meetings.

But I am hoping that many aspiring programmers from other schools will join the club someday (if the club will continue to exist many years from now).

We already started meeting yesterday, July 7, 2016.

The things we discussed and will be discussing during our meetings might seem very simple to many sophisticated programmers out there but please be patient with us. We are hoping that this club will help improve the programming abilities of the club members and will help "increase the lower bound" (as Steven and Felix Halim says regarding Competitive Programming) of IT and computer science education in our city.

Here are some links if you want to know more about the club:
The club's Facebook group -
The club's GitHub -

Here is the link for the list of club members:
By the time this article is written, the club has only 5 members:
  • Jeremiah (Jboy) M. Flaga (ako!)
  • Dinah Joy Sarino BolaƱos
  • Ian Keir G. Abes
  • Charlemagne Bulaybulay Ociones
  • Rollie Jan Suerte Relampagos
I hope we, the club members, will become successful programmers someday.

Happy coding!!! and please pardon my English :D

[UPDATE (July 29, 2016): I think I failed in leading the club. After our first two meetings, the club members do not seem to be interested anymore. So I asked them to give me just two meetings to discuss to them an introduction to Unit Testing and TDD, and Layered Architecture. Then after that we can end the club. I think one of the reasons why they became uninterested with the club is because we failed to recruit more students to join the club. Maybe another thing is that my lectures are boring?? :) (One member slept in the middle of our discussion during our second meeting. The reason might be because I was just kind of reviewing our previous lesson and failed to give new knowledge to them. I think I can understand because I myself tend to become bored if the lesson is "balik-balik")

...but I do not understand why other IT and Computer Science students in our school would not want to join a programming club. Maybe they do not know that many IT/CS degrees in the Philippines are substandard. Maybe they do not know that in our school, our graduating students know only a fraction of what freshmen students of other schools know. tsk tsk.

(or maybe I'm comparing apples to oranges on that one?? I'm sorry for that. Okay I'm going to change it to a safer statment: "Maybe they do not know that our graduating students only know a small fraction of what graduating students of other schools know")

...Or maybe they are not really interested in programming even though they have the potential of becoming good programmers. (Take note that we were trying to recruit only those students who excel or are trying to excel in their programming classes.)

I think I am going to suggest to the current members of the club that we will create another club that is open to everyone in our school (no entrance test) as suggested by one faculty in our school. I do not have any idea yet what we are going to do in that kind of club. Maybe we will just try to answer programming related questions of anyone who joins?]

[ANOTHER UPDATE (still July 29, 2016):

Regarding my criticisms on the colleges/schools where I went to study...

I am not trying to criticize all the teachers/instructors in the schools I went to. I can say that half of them are good teachers. The other half are not good.

I'm not sure if I can blame the 'not so good' teachers for being not good because they might just be products of teachers who are also not good.

I'm also not sure also if I can blame the administration of the schools I went to because they might not know that they will be offering substandard IT/CS education when they decided to offer them.

But if they knew that they will be offering a substandard IT/CS education and decided to offer it anyway, I will not be afraid to accuse them of being liars -- they are lying to those students who want to study IT/CS badly. These students will be able to find a school in other places if they can't find a school that offer these courses nearby.

But I will still be happy and thankful if they will find a way to solve this problem of offering substandard IT/CS education. I hope that my words above will serve as constructive criticism.

If you are reading this and you are part of the problem, maybe you will be angry with me now. But please be angry only for a very short time, then after that, do your best to become part of the solution to the problem.

In the previous years -- 2008, 2009, 2011 -- and today, 2016, our IT/CS education might be substandard but if you will tell yourself to be part of the solution from now on, then maybe by the year 2030 we will be one of the best IT/CS educators in our country.]