Friday, March 13, 2020

Manually Remove the Dependency DLL

https://stackoverflow.com/questions/34147484/unable-to-restore-remove-update-a-nuget-package-because-the-mentioned-versio
https://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform

Install-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -Version 2.0.1

You can manually remove the dependency by:
  1. Close Visual Studio (not a hard requirement, but helpful)
  2. In text editor, remove dependency from packages.config
  3. Remove package from packages/ directory
  4. In text editor, remove all references to package from .csproj file
  5. Start Visual Studio
  6. Reinstall package through NuGet

Tuesday, December 10, 2019

c# Challenges

https://www.csharpstar.com/csharp-program-to-calculate-factorial/

First Reverse
Description: For this challenge you will be reversing a string.
Have the function FirstReverse(str) take the str parameter being passed and return the string in reversed order. For example: if the input string is "Hello World and Coders" then your program should return the string sredoC dna dlroW olleH.
Examples
Input: "coderbyte"
Output: etybredoc

 using System;

class MainClass {
  public static string FirstReverse(string str) {
   
    string reverse = String.Empty;
 
    for (int i = str.Length - 1; i >= 0; i--)
    {
        reverse += str[i];
    }
    return reverse;
         
  }

  static void Main() {
    // keep this function call here
    Console.WriteLine(FirstReverse(Console.ReadLine()));
  }
 
}

Input: "I Love Code"
Output: edoC evoL I


First Factorial
Description: For this challenge you will be determining the factorial for a given number.
Have the function FirstFactorial(num) take the num parameter being passed and return the factorial of it. For example: if num = 4,
then your program should return (4 * 3 * 2 * 1) = 24. For the test cases, the range will be between 1 and 18 and the input will always be an integer.

using System;

class MainClass {
 
  public static int FirstFactorial(int num) {
    var result = 1;
    for(var i = num; i > 1; i--){
        result *= i;
    }
    return result;
  }

  static void Main() {
    // keep this function call here
    Console.WriteLine(FirstFactorial(Console.ReadLine()));
  }
 
}
Input: 4
Output: 24

Longest Word
Description: For this challenge you will be determining the largest word in a string.

Have the function LongestWord(sen) take the sen parameter being passed and return the largest word in the string.
If there are two or more words that are the same length, return the first word from the string with that length.
Ignore punctuation and assume sen will not be empty.
using System;
using System.Linq;

class MainClass {
  public static string LongestWord(string sen) {

    string[] words = sen.Split(' ');


    return words.OrderByDescending( s => s.Length ).First();;
         
  }

  static void Main() {
    // keep this function call here
    Console.WriteLine(LongestWord(Console.ReadLine()));
  }
 
}
Input: "I love dogs"
Output: love



Simple Adding
Description: For this challenge you will be adding up all the numbers from 1 to a certain argument.
Have the function SimpleAdding(num) add up all the numbers from 1 to num.
 For example: if the input is 4 then your program should return 10 because 1 + 2 + 3 + 4 = 10.
 For the test cases, the parameter num will be any number from 1 to 1000.
 using System;

class MainClass {
  public static int SimpleAdding(int num) {

    // code goes here
 
    int start = 0;
    for (int i = 1; i < num+1;i++){
     
        start = start + i;
    }
 
    num = start;
    return num;
         
  }

  static void Main() {
    // keep this function call here
    Console.WriteLine(SimpleAdding(Console.ReadLine()));
  }
 
}
Input: 12
Output: 78

Letter Capitalize
Description: For this challenge you will be capitalizing certain characters in a string.
using System;
using System.Globalization;

class MainClass {
  public static string LetterCapitalize(string str) {

    TextInfo myTI = new CultureInfo("en-US",false).TextInfo;
    return myTI.ToTitleCase(str);
 
  }

  static void Main() {
    // keep this function call here
    Console.WriteLine(LetterCapitalize(Console.ReadLine()));
  }
 
}

Input: "hello world"
Output: Hello World

Word Count
Description: For this challenge you will be determining how many words a sentence contains.
Have the function WordCount(str) take the str string parameter being passed and return the number of words the string contains (e.g. "Never eat shredded wheat or cake" would return 6). Words will be separated by single spaces.
Examples
Input: "Hello World"
Output: 2

using System;
using System.Collections.Generic;
using System.Linq;

class MainClass {
  public static int WordCount(string str) {

    var inputString = str.Split(' ');
    int WordCount = 0;
    foreach (var s in inputString)
    {
        WordCount++;
    }

    return WordCount;
         
  }

  static void Main() {
    // keep this function call here
    Console.WriteLine(WordCount(Console.ReadLine()));
  }
 
}

Palindrome String
static void Main(string[] args)
{
    string _inputstr, _reversestr = string.Empty;
    Console.Write("Enter a string : ");
    _inputstr = Console.ReadLine();
    if (_inputstr != null)
    {
        for (int i = _inputstr.Length - 1; i >= 0; i--)
        {
            _reversestr += _inputstr[i].ToString();
        }
        if (_reversestr == _inputstr)
        {
            Console.WriteLine("String is Palindrome Input = {0} and Output= {1}", _inputstr, _reversestr);
        }
        else
        {
            Console.WriteLine("String is not Palindrome Input = {0} and Output= {1}", _inputstr, _reversestr);
        }
    }
    Console.ReadLine();
}

Reverse Polish notation / Post-fix notation

image.png
using System;
using System.Collections;
using System.Text.RegularExpressions;

class MainClass
{    
    static void Main()
    {
        string result = Evaluate("2 12 + 7 /");
        Console.WriteLine("Reverse Polish notation output : " + result);
        Console.ReadLine();
    }  

    public static string Evaluate(string postfixExpression)
    {
        Regex _operandRegex = new Regex(@"-?[0-9]+");
        Regex _operatorRegex = new Regex(@"[+\-*\/]");

        var tokens = new Stack();
        string[] rawTokens = postfixExpression.Split(' ');
        foreach (var t in rawTokens)
        {
            if (_operandRegex.IsMatch(t))
                tokens.Push(t);
            else if (_operatorRegex.IsMatch(t))
            {
                var t1 = tokens.Pop().ToString();
                var t2 = tokens.Pop().ToString();
                var op = t;

                var result = EvaluateSingleExpression(t2, t1, op);
                if (result != null)
                    tokens.Push(result);
            }
        }
        if (tokens.Count > 0)
            return tokens.Pop().ToString();

        return "";
    }


    private static string EvaluateSingleExpression(string value1, string value2, string strOperator)
    {
        var operand1 = Convert.ToDouble(value1);
        var operand2 = Convert.ToDouble(value2);

        switch (strOperator)
        {
            case "+":
                var plusRsult = operand1 + operand2;
                return Convert.ToString(plusRsult);
            case "-":
                var minusRsult = operand1 - operand2;
                return Convert.ToString(minusRsult);
            case "/":
                var divisionRsult = operand1 / operand2;
                return Convert.ToString(divisionRsult);
            case "*":
                var multiplicationRsult = operand1 / operand2;
                return Convert.ToString(multiplicationRsult);
            default:
                Console.WriteLine("An unexpected value");
                break;
        }
        return null;
    }

}


Monday, March 11, 2019

.NET Core

https://www.talkingdotnet.com/asp-net-core-interview-questions/.
https://www.youtube.com/watch?v=u2S4TkkACVc



.Net Core
.Net Framework
Library
.Net Core Libraries
.Net Framework Libraries
Replace
appsettings.json
Startup.cs
ConfigurationBuilder


Web.Config
global.asax
ConfigurationManager

Windows Form
Windows Form Application

XAML based Universal Windows apps



Monday, July 2, 2018

Malaysia


 

Mohammad Nazmul Huda Rubol Chowdhury

T2-13A-06-01, icon city, Jalan no.1 , sungai way, petaling jaya, Selangor.
Postal: 47300
Telephone : +60178855673
Rubol30@gmail.com

Wednesday, February 14, 2018

Oracle

Oracle SQL Functions

https://www.tutorialspoint.com/oracle_sql_online_training/index.asp

https://www.youtube.com/user/completeitpro/playlists

Oracle WITH clause

https://www.youtube.com/watch?v=t5P-yS1R3qQ


WITH sample_data AS
(
SELECT 'DEVELOPMENT' A, 1 k, 18 w, 397 c, 0 r FROM dual UNION ALL
SELECT 'HT' A, 43 k, 21 w, 673 c, 0 r FROM dual UNION ALL
SELECT 'LT' A, 83 k, 14 w, 7955 c, 60 r FROM dual 
)
   -- end of sample_data mimicking real table
SELECT t.*, k+w+c+r total FROM sample_data t;

https://stackoverflow.com/questions/35860050/oracle-grand-total-row-and-column-wise
PIVOT
https://community.oracle.com/thread/3950818?start=0&tstart=0


Derived Table
https://www.youtube.com/watch?v=FwcAkH8UyEA&list=PL08903FB7ACA1C2FB&index=48

CTE (common table expressions)

With EmployeeCount (Column names are Optional)



Pivot

Unpivot

Calculating a Grand Total for a Column

https://docs.oracle.com/cd/E57185_01/RAFWU/ch07s07s06s01.html

Oracle DECODE Function
 https://www.youtube.com/watch?v=JzNv8RnEJ3A

Derived tables and common table expressions :
 https://www.youtube.com/watch?v=FwcAkH8UyEA&list=PL08903FB7ACA1C2FB&index=48


Table:
1.       lu_day  2. v_aggr_process_testassy 3. lu_model_mfgid
Relation
select *  FROM       v_aggr_process_testassy v1 INNER JOIN lu_model_mfgid l2
ON v1.mfgid = l2.mfgid  AND v1.deid=l2.deid
INNER JOIN lu_day v2
 ON v1.asmdate = v2.day_id
Keyword
Round :

decode and case:
The Oracle/PLSQL DECODE function has the functionality of an IF-THEN-ELSE statement.
DECODE (expression, search, result [, search, result]... [,default] )
SELECT first_name, country, DECODE(country, 'USA', 'North America', 'UK', 'Europe', 'Other') AS Decode_Result  FROM customers;
SELECT DECODE(NULL, NULL, 1, 0) FROM DUAL;
 CASE statement allows you to perform an IF-THEN-ELSE check within an SQL statement.
SELECT first_name, last_name, country,
CASE
  WHEN country = 'USA' THEN 'North America'
  WHEN country = 'Canada' THEN 'North America'
  WHEN country = 'UK' THEN 'Europe'
  WHEN country = 'France' THEN 'Europe'
  ELSE 'Unknown'
END Continent
FROM customers
ORDER BY first_name, last_name;



Thursday, August 24, 2017

Application SQL

String formatted = String.Format("({0}) {1}-{2}", phoneNo.Substring(0, 3), phoneNo.Substring(3, 3), phoneNo.Substring(6, 4));




public IEnumerable<CcCensusUploadHistory> GetAllCensusUploadHistoryByDataTypeIDAllocation(int allocationNumber, int dataTypeID)
        {
            return base.UnitOfWork.Db.Fetch<CcCensusUploadHistory>(@"SELECT ccCensusUploadHistory.ccStatusID, ccCensusUploadHistory.censusUploadDate , ccCensusUploadHistory.censusfilePath, ccCensusUploadHistory.Version, ccCensusUploadHistory.Category,ccCensusUploadHistory.Description,ccCensusUploadHistory.censusFileName, ccCensusUploadHistory.FinalizedBy, ccStatus.PlanID, ccStatus.[allocationNumber]
  FROM(ccCensusUploadHistory INNER JOIN ccStatus ON ccCensusUploadHistory.ccStatusID = ccStatus.ccStatus_ID)  INNER JOIN AllocationDataRequests ON(ccStatus.allocationNumber = AllocationDataRequests.AllocationNumber) AND(ccStatus.planID = AllocationDataRequests.PlanNumber)
                                                                        WHERE ccStatus.[allocationNumber] = @0
                                                                        AND AllocationDataRequests.[DataTypeID] = @1", allocationNumber , dataTypeID);

        }    




ALTER PROCEDURE [dbo].[Pr_CaseDetails] @CaseId int  
AS

SELECT C.CaseID, P.PlanName
                FROM  tblCase C
LEFT JOIN PlanAccount P on P.PlanNumber =C.PlanNumber
WHERE C.CaseID = @CaseId



------------------------------------------------------------------------------------------------------

ALTER PROCEDURE [dbo].[pr_un_project_GetAllocationDataItemList]
-- Add the parameters for the stored procedure here
  @ProjectID int,
  @userName nvarchar(50)
--, @max int

AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;

IF NOT EXISTS (SELECT * FROM AllocationDataRequests WHERE ProjectID = @ProjectID AND DataTypeID = 1)
BEGIN
INSERT Into AllocationDataRequests (AllocationNumber, PlanNumber, PlanClientNumber, ClientNumber, DataTypeID, DataRequestStatus,
ProjectTypeID, ProjectID, CreatedBy, DateCreated, PlanName, Recordkeeper)
SELECT Project.ProjectID, PlanAccount.PlanNumber, PlanAccount.PlanClientNumber, PlanAccount.ClientNumber, 1 AS DataItem,
Case when PlanAccount.[CensusRequired]=1  then 'Not Requested' else 'Not Required' end AS DataItemStatus, 4 as ProjectTypeID,
Project.ProjectID as ProjectID,
@userName, Getdate(), PlanAccount.PlanName, r.RecordkeeperProduct
FROM PlanAccount INNER JOIN Project ON PlanAccount.PlanNumber = Project.AccountID and Project.ProjectTypeID=4
Inner Join Recordkeeper r On PlanAccount.Recordkeeper=r.RecordkeeperNumber
WHERE Project.ProjectID = @ProjectID
END

Monday, January 30, 2017

Cursor with Function

DECLARE @result INT
     EXEC master.dbo.xp_fileexist '\\sharebear\client_project_folders\453064052\Allocations\Rony.txt', @result OUTPUT
Select @result

USE [TPAManager_be]
GO
/****** Object:  UserDefinedFunction [dbo].[fc_FileExists]    Script Date: 1/30/2017 05:40:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER FUNCTION [dbo].[fc_FileExists](@path varchar(8000))
RETURNS BIT
AS
BEGIN
     DECLARE @result INT
     EXEC master.dbo.xp_fileexist @path, @result OUTPUT
     RETURN cast(@result as bit)
END;


-----------------------CURSOR---ForEach Loop------------
DECLARE cur_savings CURSOR FOR
Select FilePathID,ProjectID,FilePath  from ProjectFile where AccountID=453064052 and ProjectID=50752 and WebAccess=1

DECLARE @ProjectID int,@AccountID int,@strSql VARCHAR(4000),@Path varchar(200),@cmd varchar(1000)
OPEN cur_savings

FETCH NEXT FROM cur_savings INTO @AccountID,@ProjectID,@Path

WHILE @@FETCH_STATUS = 0
BEGIN

--create table #File(AccountID Int,ProjectID Int,FileExist Bit)

insert #File
Select @AccountID,@ProjectID,dbo.[fc_FileExists] (@Path)

   FETCH NEXT FROM cur_savings  INTO @AccountID,@ProjectID,@Path
END

CLOSE cur_savings
DEALLOCATE cur_savings
GO


Select * from #File where FileExist=0

Sunday, January 29, 2017

My Pitch! (Recommended)

 I am a Microsoft Certified Software Developer.  I have 8+ years of experience developing software using C#, MSSQL, and web technologies such as Asp.Net Web Form and Asp.Net MVC, Angular JS, JQuery, HTML, JavaScript, and CSS.
Strong Knowledge   of SDLC processes e.g.; Agile, Waterfall, SCRUM 
My Highest Degree:
M. Sc. in Management Information System (MIS),

 B.Sc. in Computer & Information System (CIS)

Thursday, September 15, 2016

university-rankings

http://www.topuniversities.com/university-rankings/world-university-rankings/2016
http://learnenglish.britishcouncil.org/en/word-street/notting-hill-scene-1

http://www.titastelegraph.com/2016/09/08/%E0%A6%AC%E0%A6%BF%E0%A6%B6%E0%A7%8D%E0%A6%AC%E0%A7%87%E0%A6%B0-%E0%A6%B8%E0%A7%87%E0%A6%B0%E0%A6%BE-%E0%A6%AC%E0%A6%BF%E0%A6%B6%E0%A7%8D%E0%A6%AC%E0%A6%AC%E0%A6%BF%E0%A6%A6%E0%A7%8D%E0%A6%AF%E0%A6%BE/#.V9t6e_l95pg

Wednesday, August 31, 2016

Debug

using System.Data.SqlClient;
using System.Configuration;
using System.Data;

//SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["TPAManager_beConnectionString"].ToString());
            //conn.Open();

            //SqlDataAdapter dap = new SqlDataAdapter("exec pr_ReadyGoFiduciaryKGetFundTrailingReturnsByProductId 256", conn);
            //DataTable t = new DataTable();
            //dap.Fill(t);
            //conn.Close();



Monday, August 1, 2016

Microsoft MVP

BLOG

My story and Tips to become Microsoft MVP

By Syed Shanu  Jul 01, 2016
Received my first Microsoft Prestigious MVP Award.

Received my first Microsoft Prestigious MVP Award 
Today, I’m so happy and excited to share with you all that I have received the most prestigious Microsoft Most Valuable Professional (MVP) award. This day will be a memorable day in my life. Today morning, I received an email from Microsoft that I have been awarded the prestigious Microsoft MVP for Visual Studio and Development Technologies. 
 
Thank You Microsoft, India MVP Lead Biplab Paul and the entire Microsoft Team on considering me for Microsoft MVP award.
I would like to dedicate this Microsoft MVP Award to my parents who are not with me today. With all their blessing today I have achieved my life time goal.
Thank You Message:
I would also like to thank my family and friends for their understanding, support and encouragement.
I would also like to thank all my articles readers; with all your support, positive and negative feedback, I learned a lot, improving myself and with all your support today, I have received this prestigious Microsoft MVP award.
I would also like to thank our company CEO and all our colleagues for supporting and encouraging me.
I would also like to thank Dinesh Beniwal, Praveen Moosad, Mahesh chand, Atul Gupta and the entire C# Corner family for supporting and encouraging me.
I would also like to Thank Chris Maunder, Sean Ewington and entire Code project family for supporting and encouraging me.
I would also like to thank Ed Price and entire Microsoft TechNet Wiki family for supporting and encouraging me.
I would also like to thank Vincent Maverick Durano, Rahul Saxena, Gaurav Kumar Arora, Ronen Ariely and all others who have always supported and encouraged me to reach this success.
I believe this is not the end and I will continue my contribution for all community as same before and I believe I can give some more quality of article Thank you all :)
Now I’m a Microsoft MVP. I feel very proud and happy :)
Tips to become a Microsoft MVP
  1. Contribute more to the community by providing quality articles.
  2. Be active in community technical forums
  3. Write more innovative articles.
  4. You can write on any technologies.
  5. Be active in Twitter and in Facebook community groups.
  6. Usually, you contribute for 1 year before you nominate yourself for the Microsoft MVP. (for example if start contribute from July 2016 then till August 2016 continue your contribution as articles and in forums)
  7. Nomination to become Microsoft MVP by two ways. 1) Nominate by yourself, 2) Previous MVP's can nominate you.
  8. After a year completion you can nominate by yourself to become Microsoft MVP from the Microsoft MVP web site (https://mvp.microsoft.com/).But before you nominate be sure you have contributed for 1 year with Quality article and also in technical forums.
  9. Any previous MVP's can also nominate you.
  10. In my case I have nominated by me, I nominated myself 3 times but didn't get the award in first 2 tries. Third time, I nominated after 1 year of completion and finally got it.
  11. Thanks to Vincent Maverick Durano, who is 8-times Microsoft MVP. He messages me personally 1 month before and asked me why you didn't apply for Microsoft MVP. I replied that I already tried 2-times. He said ok I will nominate you. He was the first person who asked me for my Microsoft MVP award. He nominated me, after he nominated me, I got an mail from Microsoft as your friend has nominated you and also on the same day I got another email from Microsoft as I have been considered for the MVP award.
  12. Note: * Don't contribute just for the MVP. If you contribute only for that then sorry you are on a wrong path. Teaching others and contributions should be from our heart, be true to yourself and teach others. When I stared contribution to community I didn't know about MVP. I stared contributions in 2014. I was happy in the way as my articles are useful for someone. I will be happy even if one person get benefit from our article. Getting MVP is not an easy job. I have contributed for 2 years and so far, I have written nearly 70 articles. Whenever I publish articles, I feel it’s my first and best than previous and I always like to write innovative articles that make me feel better and think to make something new.
  13. Most important is we need passion and we need to love what we are doing. If we like and love what we are doing then we can get all the success.
About me: A Short Story about me, Sorry if I’m boring you all J
I started learning computer from my high school and during my under graduate, I started loving programing and in Post Graduation, I started working and playing with computer. Yes during my Masters' degree, I created a Website for a historical place named Thirumnalai Nayak Palace (google it to know about the palace) in our home town Madurai Tamil Nadu, India. I individually created a web site for the historical palace using ASP during the year 2003. I was in my 1st year of MCA when I created and hosted this website. I went to the historical place and collected all information and with their permission, I was the first to create the website. I planned to make a website which will be useful for tourists of the city. I  added all the information in that site and also few more important details and place to see in our city. I got very good response from family, friends, college and also from our city local newspaper. The published my work and website details in the newspaper. That was my my first job in computer field and from that time I love to work with computer and started my career.
After I completed my Masters' degree, I went to Chennai for a 6 month project work. My brother referred me to a company. I went there and the CEO gave me a project titled, “Ship Warehouse Management". He didn’t give much details but explained me the overall project details and ask me to get information myself. He said total project duration is for 15 days and I have to complete the warehouse management project within that time. I accepted the challenge. I visited a Ship Warehouse Company near Paris corner in Chennai. I didn't know anyone there but I went there and explained that I’m a student and I’m collecting information to complete my project. That company person helped me a lot and explained me in detail about warehouse management for ships. Then I started designing and building my project and created using JSP and SQL Server.
I completed my college project in 15 days which is actual duration is 6 month. I went to the company and demoed our CEO. He approved my work and pretty much offered me a job. I was so happy to hear that news and started my career from there. Today, I have 10+ years of experience in the field.
Why I’m telling this is if you love what you do then you will have more confidence in yourself and you can achieve all the success in your life.
  1. Be positive and teach what you know. Take criticism well and improve yourself.
  2. Community is like our family. Don’t be afraid to ask any doubt if you have. All of us are here to help and learn.
Hard Work, Hard work and Hard Work until you achieve. After achieve your goal, Don’t stop your community activities. Continue, Continue and Continue till you retired :)