Oct 142018
 

If you have created a table in Microsoft SQL and along with a table you have a column with a default value, then the name of the constraint will be generate by the SQL framework unless given. This will be will have some random GUID which will keep it hard to know when you want to drop a column. There could be certain sitations where you want to directly delete the column and there are situations where the column should be dropped without having the knowldge of constaint name.

You can acheive that by using the following sql

 

 

 

 

 Posted by at 10:49 pm
Oct 022018
 
featured image

If you are not familiar with the blockchain key concepts i would suggest this previous article.

Blockchain is a technology that enables us to move resources on the provided decentralize database. Now those resources could be anything that provides us value. Its is transparent among the parties or nodes that are involved which makes it more trusted system.

Concept of Blockchain:

The concept of blockchain was introduced in 1991 by a group of scientists who proposed  to timestamp documents digitally in order to validate them. Once a document was timestamp a hash of the complete document was calculated. This hash was used to validate the document. Any tiny change in the document will change the hash and it will invalidate the document. But unfortunately it was not practiced that much until 2009 by Satoshe Nakamoto.  He created the crypto currency Bitcoin using blockchain technology.  

concept of bc

Now that a very important point here about a very general and common misconception  between Bitcoin and blockchain that they’re one of the same things but they’re not.  Bitcoin is a digital currency where as blockchain is a technology used by the bitcoin. 

 

Case study:

In this case study we’re going to discuss a very basic example of money transfer.  The Scenario is where we  want to transfer money from one point to another. Lets say A is in Sweden and wants to transfer 5 dollars to B in Pakistan. As there is no direct line so A will have to use a third party service. The 5 dollars will be transferred via the third party who will transfer the money to B in  Pakistan. Lets say the third party charge some fee and the transfer is done in 2 days.  Now during those two days you don’t have any transparency on what the third part is doing with your money or is the money transferred or not.

case study 1

 

So we have three general problems here that we want to discuss the fee, the time that the third party took and transparency of the third party process. Now lets address these problem in more detail by consider another example. 

 

Long transaction time:

So we have three person A, B and C.  In the very beginning we say that A has 10 dollars. We are going to maintain this in a record which will be our open ledger.. The very first block of the blockchain is called the genesis block.  B has 7 dollars and C has 5 dollars.  Lets say A wants to transfer 7 dollars to B. The address of A B and C are basically the public keys on which the money is transferred. This will be added as a transaction to the ledger and the transaction is performed. B want to transfer 5 dollars to C which will also be added to the ledger and so will our last transaction which is C transfer 5 dollars to A. Now if you see this open ledger is actually the transfer which is done instantly. This open ledger here is called the blockchain  So we have fixed the problem with the long transaction time by instantly maintaining the record in an open ledger but our solution is still like the third party where our ledger is hosted an one place which could be a single point of failure.

 

Transparency:

To address this problem we will distribute the ledger to each node that is involved in the network.  So now we have a distributed block chain. By doing that we eliminated the problem of trust less ledger in fact now its more visible to all the parties and they can validate the ledger at any time. As we have solved the problem by distributing blockchain. we have now another problem of synchronizing the ledger so that is updated on each node on the network. The problem here is that A can say that C transferred 10 dollars to A and add it to its block chain so how will the other nodes know that it was an invalid transaction. 

To understand this part of the system where we will have to look at another example. Lets say this is our network and this the block chain for that network. Lets say A wants to transfer 2 dollars to C. When the transaction occurs a block in created but not yet validated. The difference between creation and validation of block is that anyone can create a block but it has to be validated before it could enter to all the blockchain.  When the block is created it will distributed to these special nodes in the network that will perform validation. These special nodes are called miner. Miner are just ordinary nodes except that have provided high computation speed to compute the validation of the block. Once they validate a block they are rewarded with a small amount. 

validation

For our block we have to calculate the hash of the block which some could say is a really quick operation so why this high computational power is needed. Usually there are some blockchain rules that are enforced on the block validation that the hash of the block should start with 5 zero. This is called the difficulty of the block. I will discuss these topics in detail in my later videos. Lets get back to our block so once our intended block is published to the nodes all the miners will pick up the block and start computing the hash the block. Let say B was able to generate the hash before D so B will add the key that it used to generate the hash, add it to its local block chain and broadcast it to the network.  When A receives the block it will validate the hash by using the same key in the block and once validated A will add the block to its block chain and wait for the next block. 

 

The reward system for the miners is very complex and very important part of the block because it contributes to your currency. I hope you all understand the concept. We touched these concept which I will explain in more detail in my later lectures. 

 Posted by at 2:15 pm
Jul 122017
 

Though the concept is really simple but there is always an edge confusion between the two. Lets discuss them one by one using example. To understand the concept of Abstract lets consider one of this easy case domain problem. Lets discuss the characteristics of an animal. An animal can have 4 legs if its a horse and two legs if its a Kangaroo (ok you can argue that the arms are legs as well but lets assume that its only two legs and two arms). When i define a object of such characteristics i cant really say directly that an animal has 4 legs. I mean in real life it could have 4 but not when its a Kangaroo. Let me define the two processes separately

If we have a domain case where we say that we cannot haven’t an object of Animal class because we don’t know if it would have 4 or 6 legs. but we could have Horse or Kangaroo objects. Then we define the animal class abstract. What it will do it one it could restrict the type animal to be instantiated and secondly it would force all the child classes to implement the base class abstract method.

If we have a domain case where we have a Passenger class which could travel with ticket. But if its European passenger then we need to check the passport only and if its Non European passenger then we need to check the Passport and visa. To implement that check the example below where the base class(Passenger) method is overridden by the child class based on their nature

 

 

 

 

 

 Posted by at 4:38 pm
Jul 032016
 

In this post i am going to explain how to create a DB using #. So lets get down with the code

This class is the control class through which we are going to call the helper methods. I have started coding directly as it is easier to understand it via running code. If you dont understand it or have problems running it just say the word and will try to add to Git so its easily accessible to download.

 

This class is the helper class being used. We will use this class to execute the script.

This is the script file that is used to create the script. The script is well commented so that you can see the details of the application

 

 Posted by at 8:02 am
Jun 202016
 
Many people have this confusion of understing URL but most people thinks its too late. When i move to web development i had no idea of internals as i just assumed that things magically worked out. I think its better to learn the basics to get more grip on terms and infrastructure for better understanding.
 So lets see a URL
http://www.food.com:80/local/street/food#/carrot
So lets see the differnet part of this URL.
http:// is the URL scheme. Meanning how we will access the web page.
www.food.com Next is the host name. You can also have IP address here but its really hard for people and business to remember the IP address of a web page so there is a user friendly name. In this case the food.com is the host name. When you make this request the DNS (Domain name server) will resolve (get information related to that domain ) the domain name and route you to the address of that domain.
80 This is the port number. You might be thinking that this information is not really added in all the URLs that you usualy have so whaty do you need it here. This is the default port on which the server is listning to all the http requests. If you dont specify it the browser will internally add it. If you have any other port you can specify that externally and the browser will work accordingly.
 local/street/food this is the path. indicating where you want to go on the web site. In this case i want to go to local directory and street and the the page food.
 #/carrot The last bit is the fragment Its not always that it could be the name of the resource that we want to access or some html or any other page. In this case it means that on food page go to the carrot part of the page (which could be by the end of the page) so when you open the page you will be automatically redirected to the end of the page.
 Posted by at 3:47 pm
Jun 182016
 

Hello

I got a recent question in which how to use if within switch. I would not prefer it but here is the code

 Posted by at 9:02 am
Jun 082016
 

When you have a cutting edge business idea it’s not enough. You need to have a team to build it some good tests and quality engineer to test it but will that be enough or do you need more?

I think the best rough strategy to launch a product is to prototyping first to get a working solution for your idea once you have that you need to hire a team for development, some good marketing, and some sales people if the profit model is to sell it and so on. But how will you get the budget you could always partner up with investors but there are also other ways to be funded.

Crowd funding is one of the options but you can’t just go there and ask for money you should at least prepare the below mentioned points before hitting to any of those sites.

Business Idea

Describe your business idea now it could be text but if it’s an animation or some nice scripted short client you will grab more attentions check out these crazy intro videos which are really cool

http://www.videobrewery.com/blog/10-best-startup-explainer-videos-ever

Financial Timeline

The funders are really interested in how you will spend the money and it’s even better if you tell them and how and when (considering the stage of the project you are in). Defining a timeline give them the overview of project lifecycle. There are many tools that could generate fancy timelines so use them.

Team

For transparency give the intro of the team that is involved and if possible a small interview of each member explaining about them and how they feel to be a part of that project.

Perks

That’s the best and the tricky part. Perks are something that you offer to your funders it could be many within a project starting from 1$ to as much as possible. But keeping a low amount is the best strategy. For low cost perks you can offer laptop stickers, t-shirts, mugs etc. For high paying funders you could offer them early bird release of your product.

Famous crowd funding sites

http://www.cuttingedgecapital.com/the-crowdfunding-platform-explosion/

The best practice is to hire a technical writer who could fix these technical documents and videos for you. There are many crowd funding exporters available who are really good at what they do and they can pitch your product better.

 Posted by at 4:35 pm
Feb 102015
 
fb-image

So where are the things you need
Download these software

  • JDK (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html)
  • WAMP(only for SQL)
  • Tomcat (http://apache.mirrors.spacedump.net/tomcat/tomcat-8/v8.0.18/bin/apache-tomcat-8.0.18.zip)
  • Agilefant (http://sourceforge.net/projects/agilefant/)

JDK
Install it and set environment variables – this can be different on different computers so check the path
JAVA_HOME C:\Program Files (x86)\Java\jdk1.8.0_31\bin
JRE_HOME C:\Program Files (x86)\Java\jre7

Wamp
download wamp server (that is just to get the sql its quite easy) install it and to run it dont run skype or IIS
Start the server and run SQL console click enter for no password after that run these commands

 

Agilefant

unzip it and open the war file with win rar and under the WEB-INF folder open agilefant.conf
username = “agilefant”
password = “123456”
url = “jdbc:mysql://localhost/agilefant?relaxAutoCommit=true&;autoReconnect=true&;useUnicode=true&;characterEncoding=utf-8&;autoReconnectForPools=true”
and hit save

Tomcat

Unzip it and open the tomcat-user file.xml under apache-tomcat-8.0.18\conf path
now replace this

with this

 

 

Open the bin folder and run the startup.bat file

Open this link in the browser localhost:8080

Click manager app

Enter username tomcat pass tomcat

In the deploy section open the war file and click deploy and its done

Access it using http://localhost:8080/agilefant

Login pass is admin and secret

 Posted by at 12:08 pm
Jan 152015
 
fb_icon_325x325

There are soo many social network which hosts differnet types of behaviour. If you want to chat with pictures you can use Snap chat, if you want to only post pictures you can use Instagram and lets not forget the mother of all social network that is Facebook. But are they leaving good impact on us? How often are we using them?

According to Forbes and i qoute

“In the U.S., over 12.2 billion collective hours are being spent browsing on a social network every day.  This is costing the U.S. economy around $650 billion per year based on each social media user costing a company roughly $4,452 per year, according to data compiled by LearnStuff.com.”

That is a huge lost both in terms of money and in terms of productivity.

You can easily identify that either you are an addict or not by just obsoving you routine.

Are you waking up on time just just because you start using your phone during the night?

Do you intrerupt yourself just because you want to see some new notifications?

Do you worry when your phone is about to die?

How do you spend your time when your phone run out of battery?

What is the first thing you do when you wake up?

and many more.

 

 Posted by at 3:26 pm