CREATE AN ASP NET WEB FORMS LAYERED APPLICATION FROM SCRATCH

Hi there, this is my first YouTube serie, hope you like it.

In this serie I summarize a much of knowledge from my earlier ASP.NET Web forms experiences.

I hope you learn something.

Part 1. Intro
https://youtu.be/YpiM2BcfRzI

Part 2. Setup The Development Environment
https://youtu.be/bjzwx0r1TkU

Part 3. Create the SQL Database
https://youtu.be/DCRVNzu8cB0

Part 4. Create the DAL (Data Access Layer)
https://youtu.be/uHV9IGPo6F4

Part 5. Create the BLL (Business Logic Layer)
https://youtu.be/S6jChlkJgtk

Part 6. Cerate the UI (User Interface) ASP.NET Web Forms
https://youtu.be/LrdbSTKIhM0

Mario

 

Data Structures Implemented In C#

This article covers different  data structures and how to implement them from the ground.

This article will try no to cover List<T>, Dictionary<T> or any other data structure included in the .NET Framework but implementing a Class that achieve the same result in an optimal way.

Linked List

There are different kind of Linked list, we will start with the Singly Linked List.

A singly linked list is a series of Nodes linked in a sequence from the head node to the tail node.

Includes the following elements.

  • Head. First element of the list if any.
  • Tail. Last element of the list, may be equals to head when only one node is available.
  • Nodes. Node that contains a reference to a child and a value.

Insertion is fast since we know the tail we can just directly insert a new element in the list.

It’s considered a list with a dynamic size since we can always add elements to the list. The list can grow indefinitely. Compared to arrays that always have a fixed size.

The .NET framework has List<> and LinkedList<>, for the purposes of this post we will not cover these data types but create own classes using base data types.

Insert

Since we already know the tail we just add the new node as a child of the tail and the new tail is the added element. Insertion of nodes for linked list are assumed that it will be a new tail and head keeps intact.

Search

We start searching from head and go over its children and grand children and so on until we find the value or we end without results.

Delete

There are many scenarios when deleting nodes. The easiest scenario is to delete the head, we make the new head the child’s head.

Traverse the Linked List

It’s an easy operation, we just navigate from head to tail, node by note.

Traverse in reverse

An algorithm to do a traverse in revers will be put here.

Doubly Linked List

It’s a list that contains reference to the child and parent node, in other words node.NextNode and node.PreviousNode. With this kind of linked list doing a reverse traverse is much more efficient compared to a singly linked list.

If we plan to insert a node we need to take into account to update the Previous node and Next node.

This is all by know in regards linked list.

Binary Search Tree (BST)

Below is an example of a Binary Search Tree, it’s also known as an Unbalanced Binary Search Tree

   5
  / \
3    7 
 \     \
   4    8
           \
            10
            /
           9

The logic of this data structure is this.

  • There only a parent node
  • Nodes can have at most 2 child nodes, left and right
  • Left node always will be lower than parent, right node the opposite

Insert Nodes

To insert nodes we will use a recursive method to repetitively compare either if the inserted value is lower or greater than current node and to check if there is already a left or right child, if there is already a child we send the child as input to the recursive array.

[A CODE EXAMPLE OF INSERTION WILL BE HERE]

Search Node

We have also a recursive array that looks for a value until it can find it or reach the end of the array.

[Insert c# algorithm here]

Delete Node

Delete a node is a little more complex and you will need to do more validations.

[Insert algorithm here]

Other tasks

There are other tasks that you can perform for a BST, some of them are listed below.

  • Find node
  • Find node´s parent
  • Find greatest and smallest value in BST

Series Of Post vs Single Page Post

This is a kind of experiment that I will do for a future serie of content that I’m currently working on.

Today I’ve been thinking on how to organize future content for my blog. I’m planning a series on how to implement and use data structures in C#, at first I though on create just a post series but then realized some of the disadvantages.

Disadvantages on post series for your blog

  • Mix with other content, unless you have all your contented prepared you will be unable to organize your regular post with your new content series. It’s just the that the blog format is not designed to these kind of content, it’s supposed to be kind of a journal instead of educational well organized curricula. Blogs are intended to just share updates from time to time not to organize content, well, as far as the default settings that you will find in common CMS blogging systems like wordpress or blogspot. I know that you may be thinking, you can create pages and organize bunch of pages and link to a centralized Index page, yeah that works fine, it just that you need to do all the work an how to make your content menu accessible and well linked, it’s an overhead that you have to deal with and the more content you add the more complex manage your data is.

My thinking is to create a single post and put all my series in one page, well organized, let´s see how it goes. My plan is to create a single page on data structures and put all the content there, I will just edit the same post to add more and more content with the time. I know that this is not the best way to organize content in terms or CEO because apparently the more pages you have the more visibility your content is. I think that depends, at the end of the day the people may find the main article as many times as the sum of separated pages, I have never done this before so I will share my results with the time.

Disadvantages on having a single page content

  • Not too good for CEO, people might get lost with a bunch of content.
  • Current visitor will not receive post updates. So far my visitor count is so low so I’m not worried about it but if you have an audience this is visibility problem, you may be creating content that your current audience is not aware of.

Anyways, I´ll do the experiment and will let  you know if that is better other that the overhead of organizing bunch of links and pages.

Mario.

Been Reviewing Glassdoor Interview Questions

I’ve been reviewing interview questions on top companies at glassdoor.com, I will be posting content based on common questions like data structures in future posts. This is for senior software engineer.

I’m not sure if I want to organize the content or just randomly post an article for each of the items in my list, I will figure out. I will combine these kind of posts with other regular posts on programming in general.

This is a short post, it’s just a heads up on what is going on.
Mario

C# Array, Print Values. For and Foreach way

Hi there, I’ve started a little serie on documenting the way c# and all the basic elements work, in this post I will just share my code on how an array is iterated by a for and a foreach by using a new console application.

The instructions below.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Arrays
{
    class Program
    {
        static void Main(string[] args)
        {
            //create an empty array with size 10.
            int[] numbers = new int[5];


            // set values
            numbers[0] = 11;
            numbers[1] = 22;
            numbers[2] = 33;
            numbers[3] = 44;
            numbers[4] = 55;

            //print values for method
            for (int i = 0; i < numbers.Length; i++)
            {
                Console.WriteLine(numbers[i]);
            }

            //print values foreach method
            foreach (var item in numbers)
            {
                Console.WriteLine(item);
            }
        }
    }
}

 

 

Code Highlighter For WordPress, Installation Guide

I was looking for a code highlighter and I wanted to share this with you.

To start…

Search for “Code Highlighter”. Install WP Code Highlight.js (I did a research before installing and seemed to be reliable)

Wait just couple of seconds until it is installed

Once installed activate (on your own risk, worked for me =))

 

Then you might want to see the settings and make sure it’s ok, I did just to make sure the languages I was looking for were available.

I just highlighted the languages that I will most likely use on my blog for future posts… You might find others…

This is the instructions that are provided with the plugin, I tried the CODE way but it’s awful, messed the indentation, I recommend to use PRE instead.

This is how i used the plugin for the first time, I selected Text and inserted a PRE CODE as suggested by the instructions.

 

This is the final result. (image), automatically detected the language but you can also specify.

I hope you find this article useful.

New Year Post, Random Thoughts, Reading For 2017

This is the first post of the year, I hope I can accomplish my goals and you too. This year I have just one main goal and I will work everyday to be a step closer to it.

As I said in previous post I’ve been making some changes on my social networks, I’ve stopped watching almost 90% of the entertainment YouTube channels that I used to watch on a daily basis, started following other YouTube channels in my interest areas such as programming, c#, web development, online learning and so on. So far I noticed a huge improvement of productivity on my spare time, gaining more passion every day on programming and languages just for fun.

I also re-enabled my twitter account, did the exact same that my YouTube, stopped following 100% of entertainment twitter accounts and started following about 50 to 100 total new people related to programming, learning and so on in both languages Spanish and English, also noticed a huge improvement in productivity on my spare time, just for fun I read more interesting tech related articles and get news related to the industry and also have fun.

And finally, I started again readings books from start to finish this year, for years I’ve been reading summaries, important chapters, and jumping to the information that I need from book to book by googling and doing sniper searchers with a great success I mean, I find and understand everything that I want from the internet but I just started to have the felling that I don’t have a strong knowledge in some areas because of the way I search for information, this new year I will combine sniper searches with audio-books and readings from cover to cover to get the best of both worlds, strong knowledge on important topics and just general understanding on casual readings.

That is all for this post I hope you have your goals set and start to work on them if that applies to you.

Thanks
Mario