Tips: Designing Views and Using Bootstrap

When you create MVC project with Visual Studio, by default Bootstrap is ready to use.  Bootstrap is mobile friendly CSS, ready to use out of the box. If you are not ultra picky about design, I recommend to use it.  And even if you are, you can still use Bootstrap as a base and make great views.

Here is my memo for design Views.

Bootstrap is mobile first design, so do design in mobile mode first, then create desktop / tablet design using media specific customizes CSS properties.

Example below, if the screen width is more than 768px, then apply this CSS properties, which give 150px padding at top.

for less (and more screen sizes)

 

Reference:

Bootstrap http://getbootstrap.com/

Hypothesis Driven Thinking

When you are to go after some issues or building strategies, one of the effective approach is to have hypotheses driving thinking.

What is hypotheses driving thinking?

That is to build the best guesstimated answers to occurring problems at that moment.

It is the best answer as of this moment snapshot.

As clean and effective data are generated as time goes by, the answer may be different from your hypotheses, and that’s even OK.  The hypotheses has a purpose as a guides to problem solving and not necessary need to be an answer.

Why is this good or need it?

Things are uncertain, not clear, there is no person that knows everything or can answer everything, therefore having hypotheses and start building data and strategy sometimes is the best you can do.

Good and not so good hypotheses.

Your good guesstimated answer can even be better one

by checking followings;

  • Think and see things from the other side.  Imagine being the user, being the competitor, being in the field.

  • Think and see things from two extreme sides.

  • Think and see things from clean start.  Forget everything you know and think for now, start fresh from zero.

And in order to solve problems, the hypotheses must drive actions. So, think about how you want to drive actions from your hypotheses too.

more to continue.

 

Millions of To-Do and priorities

My memo for, when you have millions of to-do and marking proper priority.

  1. Decide what I don’t do, instead what to do.
  2. Segment 1 to do into multiple to do. Make 1 big to do into small to-do.
  3. Cross out old to-do. (sorry old to-do)
  4. Put due day a day early (.. like this is possible??)
  5. Be specific about to-do action.
  6. Don’t worry so much about priority.
  7. 70% is good enough. (indeed there is always tomorrow, and day after tomorrow)
  8. Put your to-do in matrix like below instead of in list style.

2016-02-16

 

 

 

Azure Search Autoindexing DocumentDB Data

Hello.

Isn’t that nice, if you can sync (index) your DocumentDB data to Azure Search in auto schedule? Yap, so that’s what we will do today.  At the end, your DocumentDB data will automatically be indexed to Azure Search, and be able to search from Azure Search like you are searching DocumentDB data.

Azure Search Index DocumentDB Data on Schedule

Original and great walk through tutorial is here at https://azure.microsoft.com/en-us/documentation/articles/documentdb-search-indexer/.   This is my version of walking through this tutorial.

Previously I have cover a bit about Azure Search and DocumentDB so if you are not too familiar with what they are and capable of, please refer to, Mastering Azure DocumentDB Part 1 and Mastering Azure Search.

To auto index your DocumentDB to Search, you need to have two things.  1 is data source and 2 is indexer.

Continue reading “Azure Search Autoindexing DocumentDB Data”

ETL to OLAP

My memo; ETL to OLAP, is the basic flow of how data is born and used for data analytic.

ETL stands for extract, transform and load.  OLAP stands for online analytic process.  (don’t know why L is there..)

 

Mr. E is responsible for pull data into or onto preliminary database.  Mr. E may face different data sources in different format, but make them all in one unified happy data.

Mr. T is responsible for transforming data, like cleaning, reshaping, combining, filtering etc.

Mr. L is responsible for loading data for other application to be accessible, usable.

Team OLAP is responsible for reading data and generating insights.

And there are Mr. HTAP, MOLAP, ROLAP, HOLAP in the team OLAP, whom I ll introduce with more details later.

If you want total freedom and equalization you may call all or some of them Mr. , Ms. or Mrs, or however you want to call them, depending on your preference.

ASP.Net Web API 2 and AMCHARTS

Amcharts is one of the best js base chart service out there today.   Amcharts takes JSON data and display all sorts of neat charts.  Here, I am generating JSON data through ASP.Net Web API 2 and show AmCharts graphs.

I followed tutorial document from Amcharts (https://www.amcharts.com/tutorials/using-data-loader-to-connect-charts-to-mysql-data-base/).  This tutorial goes over how to query data from mySQL then generate JSON data then display charts in PHP, but we don’t have to worry about MySQL or PHP, we just create and fetch JSON data from API and goes from there.

First, we will have to know what type of data you want to generate.  We can generalize shape of data we want to work with.  Graphs usually are generated from table of data (or in this case JSON data that fits in table).  If you are to work with 2D graphs, then we will need to generate 2 dimensions of data, x and y. And that’s what we do today.

Let’s start with something simple.  I have system log stored in my DB,  X being time, call it category, Y being some value of some log properties, call it value1 and value2.

Continue reading “ASP.Net Web API 2 and AMCHARTS”

Using Cache in ASP.Net MVC

If you want to make your pages faster to load, you can make use of Cache by using Cache filter.

If you simply want to add Cache capability for a one page, then add

This will give you 120 seconds of cache.

If you want to manage cache for multiple pages, then I recommend creating profiles and manage it at Web.config like below,

then calling these profiles like below;

You can read more detail at : https://msdn.microsoft.com/en-us/library/system.web.mvc.outputcacheattribute(v=vs.118).aspx

Trying to get first letter of string in Linq

My error today;

LINQ to Entities does not recognize the method ‘Char get_Chars(Int32)’ method, and this method cannot be translated into a store expression.

I was trying to get list of records that matches fist letter of string.  But I guess it’s not as simple as just

but this worked.