Thursday, May 24, 2018

Mobile First Approach Are you serious

Today I was surprised by a Angular Video I was listening regarding Form.IO. I was surprised to find out that Mobile first approach is old now. The new Approach is API First. And forms are generated at client side on the fly from the same schema which API uses. bit of a surprise. for details Please trying registering to form.io website.

Wireframing the webapplication pages

In my previous experience in Smartline. I got an opportunity to work on Wireframing new webpages for the development team. I found it extreamely difficult to fix a design which the customer or Buissness needed because everytime i think it's final buissness will come back and ask some changes. i was confused how to go about it. Other challange was to identify the Javascript technologies avialabe to provide that UI changes that can be easily slipped into the Asp.net MVC infrastructure which was used by the develpment tool.

Below is one good wireframing tool i found out

https://balsamiq.com/ and nice youtube video for training on this. https://www.youtube.com/watch?v=IrpXjcpCf_k


Tuesday, December 1, 2015

coding using GIT

I have been using GIT since few months and it was challange as I had been using Visual Source Safe and Microsoft Team foundation Server since last 10 years of my experience and the terms used in GIT were totally different. So, below are few challanges I faced.

What is CLONE: Before started working you have to get the code on your machine. For that you have to clone the code. you can clone directly in source tree from Master branch of repository.              
What is PULL : Whenever you want your code to be updated with other developer changes you need to press pull. but pull is very powerfull command and it will try to get the latest code and try to merge the latest with your changes. So, chances are it will merge something wrongly with your code changes. So, better you can use Fetch and Rebase instead of Pull.

What is MERGE :

What is FETCH : Fetch will just take the latest version but incase any merge required it will not do that automatically. So, chances of getting your code changes merge automatically are not there as in case of Pull. So, you are safe.

What is REBASE : Rebase is a megical command which I should have known few months before rather than right now because I wasted so, much of my time thinking about if my changes will be overwritten by Pull request and just update your changes to the repository and avoid making changes. And lot of time i had to listen from other developers that my code changes pushed to the repository is conflicting with their changes.
So, below is the definition.

          Instead of cramming all changes into a merge commit, a rebase preserves the original commits. The project's history then looks as if it had evolved in a single, straight line. No indication remains that it had been split into multiple branches at some point.
end-situation-for-rebase
After a rebase, it looks as if development had never split into different branches
Let's walk through a rebase operation step by step. The scenario is simple: we want to integrate the changes from branch-B into branch-A, using rebase.

starting-situation-before-rebase
An example scenario before starting the rebase
The command for this is very easy:
$ git rebase branch-B

First, Git will "undo" all commits on branch-A that happened after the lines began to branch out (after the common ancestor commit). Of course, it won't discard them but rather save them away, temporarily.
rebase-step-1
Step 1
Next, it applies the commits from branch-B that we want to integrate. At this point, both branches look exactly the same.
rebase-step-2
Step 2
In the final step, the new commits on branch-A are now reapplied - but on a new position, on top of the integrated commits from branch-B (they are re-based).
The result looks like development had happened in a straight line. Instead of a merge commit that contains all the combined changes, the original commit structure was preserved.
rebase-step-3
Step 3

What is

last Challange.
     
            How to sync our Fork from the Upstream.

Before you can use upstream name you have to define the upstream repository for your fork that you can do through sourcetree.


      1. Open your forked repo in SourceTree.
      2. Select Repository -> Repository Settings in the menu bar.
      3. In the Remotes pane, press Add.
      4. Enter any name you like (often upstream or master) and the URL / path to the parent repo.
      5. Press OK, then OK              

    1. You can open Git Bash widow
    2.  move to your local fork directory then type below. 
Below are the command you can execute in GIT BASH once you have set the upstream.

                               git fetch upstream\master 
                               git rebase upstream\master 

below image will explain what's happening.


Tuesday, November 6, 2012

Using RamDisk to boost machine performance

1. download and install dataram ramdisk software
2. create a ramdisk on R Drive with NTFS Compression
3. map the temp folder as below. this bat file will only map the temp folder while the bat file is running and once you key press the bat file it will ignore the temp folder in ramdisk and create another temp folder in normal hard disk to use. so, this bat file will work only till its running.

bat file details as below for mkdir file




robocopy "c:\windows\TEMP" "R:\cache\windowsTEMP" /S /E
rmdir "c:\windows\TEMP"
MKDIR "R:\cache\windowsTEMP"
mklink /J  "c:\windows\TEMP" "R:\cache\windowsTEMP"

mkdir "R:\cache\Chrome Cache"
robocopy "C:\Users\sshukla\AppData\Local\Google\Chrome\User Data\Default\Cache" "R:\cache\Chrome Cache" /S /E
rmdir "C:\Users\sshukla\AppData\Local\Google\Chrome\User Data\Default\Cache"
mklink /J "C:\Users\sshukla\AppData\Local\Google\Chrome\User Data\Default\Cache" "R:\cache\Chrome Cache"

pause

rmdir "c:\windows\TEMP"
MKDIR "c:\windows\TEMP"
robocopy "R:\cache\windowsTEMP" "c:\windows\TEMP" /S /E

rmdir "C:\Users\sshukla\AppData\Local\Google\Chrome\User Data\Default\Cache"
MKDIR "C:\Users\sshukla\AppData\Local\Google\Chrome\User Data\Default\Cache"
robocopy "R:\cache\Chrome Cache" "C:\Users\sshukla\AppData\Local\Google\Chrome\User Data\Default\Cache" /S /E





Thursday, October 25, 2012

Migrate VMWare Harddisk VMDK to Microsoft Virtual machine hard disk VHD format

Hi I found a nice tool to convert fromatVMDK format to VHD format this is required now a days as VHD format allows to add a virtual hard disk as new partition and dual boot option.

So, if you wants to fully utilize your hardware capabilities its better to use VHD with a new partition and making it dual boot option.

http://vmtoolkit.com/files/folders/converters/entry8.aspx

Regards,

Sam

Monday, May 28, 2012

.Net with Oracle : Working with Multiple Result Sets


Working with Multiple Result Sets
Oracle does not support batch queries, so you cannot return multiple result sets from a command. With a stored procedure, returning multiple result sets is similar to returning a single result set; you have to use REF CURSOR output parameters. To return multiple result sets, use multiple REF CURSOR output parameters.
The package spec that returns two result sets—all EMPLOYEES and JOBS records—follows:
CREATE OR REPLACE PACKAGE SELECT_EMPLOYEES_JOBS AS
TYPE T_CURSOR IS REF CURSOR;
PROCEDURE GetEmployeesAndJobs (
    cur_Employees OUT T_CURSOR,   
    cur_Jobs OUT T_CURSOR
);
END SELECT_EMPLOYEES_JOBS;

The package body follows:
CREATE OR REPLACE PACKAGE BODY SELECT_EMPLOYEES_JOBS AS
PROCEDURE GetEmployeesAndJobs
(
    cur_Employees OUT T_CURSOR,
    cur_Jobs OUT T_CURSOR
)
IS
BEGIN
    -- return all EMPLOYEES records
    OPEN cur_Employees FOR
    SELECT * FROM Employees;

    -- return all JOBS records
    OPEN cur_Jobs FOR
    SELECT * FROM Jobs;
END GetEmployeesAndJobs;
END SELECT_EMPLOYEES_JOBS;

The following code shows how to fill two related tables in a DataSet using the two result sets returned from the above package:
// create the connection
OracleConnection conn = new OracleConnection("Data Source=oracledb;
    User Id=UserID;Password=Password;");

// define the command for the stored procedure
OracleCommand cmd = new OracleCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT_EMPLOYEES_JOBS.GetEmployeesAndJobs";

// add the parameters including the two REF CURSOR types to retrieve
// the two result sets
cmd.Parameters.Add("cur_Employees", OracleType.Cursor).Direction =
    ParameterDirection.Output;
cmd.Parameters.Add("cur_Jobs", OracleType.Cursor).Direction =
    ParameterDirection.Output;
cmd.CommandType = CommandType.StoredProcedure;

// create the DataAdapter and map tables
OracleDataAdapter da = new OracleDataAdapter(cmd);
da.TableMappings.Add("Table", "EMPLOYEES");
da.TableMappings.Add("Table1", "JOBS");

// create and fill the DataSet
DataSet ds = new DataSet();
da.Fill(ds);

// create a relation
ds.Relations.Add("EMPLOYEES_JOBS_RELATION",
   ds.Tables["JOBS"].Columns["JOB_ID"],
   ds.Tables["EMPLOYEES"].Columns["JOB_ID"]);

// output the second employee (zero-based array) and job title
// based on the relation
Console.WriteLine("Employee ID: " +
    ds.Tables["EMPLOYEES"].Rows[1]["EMPLOYEE_ID"] +
    "; Job Title: " +
    ds.Tables["EMPLOYEES"].Rows[1].GetParentRow(
    "EMPLOYEES_JOBS_RELATION")["JOB_TITLE"]);

The console output shows the job title for the second employee:
Employee ID: 101; Job Title: Administration Vice President