Sql Imp Query

 

Select * from(
SELECT 0 as SORTCOLUMN, -1 AS [KEY], ‘Select’ AS [VALUE]
UNION all
SELECT 1 AS SORTCOLUMN, PARAMALLOWEDVALUEID AS [KEY], PARAMETERVALUE AS [VALUE]
FROM ICM_COMMPARAMALLOWDVALUE where PARAMETERID = 1 AND ISACTIVE = 1) tbl order by case when SORTCOLUMN=0 then 3 else 1 end,[value]

Advertisements

C# 7.0 Features

C# language some Keys to know:

1. In C# language to know the which dot net version you are using at run time you can use “Enviourment.Version”.
You can also find;
Console.WriteLine(Environment.Version);
Console.WriteLine(Environment.OSVersion);
Console.WriteLine(Environment.ProcessorCount);
Console.WriteLine(Environment.MachineName);

2. C# 7.0 Features :-
— 1. Touples:-
— 2. Tuple Deconstruction :- Any object can be deconstructed by defining a Deconstruct method in the class:
for example :-
class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }

public void Deconstruct(out string firstName, out string lastName)
{
firstName = FirstName;
lastName = LastName;
}
}

var person = new Person { FirstName = “John”, LastName = “Smith” };
var (localFirstName, localLastName) = person;

In this case, the (localFirstName, localLastName) = person syntax is invoking Deconstruct on the person.

— An alternative approach for the Person class is to define the Name itself as a Tuple. Consider the following:

Example:- class Person
{
public (string First, string Last) Name { get; }

public Person((string FirstName, string LastName) name)
{
Name = name;
}
}

Then you can instantiate a person like so (where we can take a tuple as an argument):

var person = new Person((“Jane”, “Smith”));

var firstName = person.Name.First; // “Jane”
var lastName = person.Name.Last; // “Smith”

— Touple Intialization :-

You can also arbitrarily create tuples in code:

var name = (“John”, “Smith”);
Console.WriteLine(name.Item1);
// Outputs John

Console.WriteLine(name.Item2);
// Outputs Smith

When creating a tuple, you can assign ad-hoc item names to the members of the tuple:

var name = (first: “John”, middle: “Q”, last: “Smith”);
Console.WriteLine(name.first);
// Outputs John

 

— 3. Out var declaration

The out var declaration is a simple feature to improve readability. It allows a variable to be declared at the same time that is it passed as an out parameter.

A variable declared this way is scoped to the remainder of the body at the point in which it is declared.

In C# 7.0, you can inline the declaration of the variable passed to the out parameter, eliminating the need for a separate variable declaration:-

Example :-

if (int.TryParse(input, out var value))
{
Foo(value); // ok
}
else
{
Foo(value); // value is zero
}

Foo(value); // still ok, the value in scope within the remainder of the body

If some of the parameters that a function returns in out is not needed you can use the discard operator _.

p.GetCoordinates(out var x, out _); // I only care about x

An out var declaration can be used with any existing function which already has out parameters. The function declaration syntax remains the same, and no additional requirements are needed to make the function compatible with an out var declaration. This feature is simply syntactic sugar.

Another feature of out var declaration is that it can be used with anonymous types.
7.0
Example:-
var a = new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
var groupedByMod2 = a.Select(x => new
{
Source = x,
Mod2 = x % 2
})
.GroupBy(x => x.Mod2)
.ToDictionary(g => g.Key, g => g.ToArray());
if (groupedByMod2.TryGetValue(1, out var oddElements))
{
Console.WriteLine(oddElements.Length);
}

In this code we create a Dictionary with int key and array of anonymous type value. In the previous version of C# it was impossible to use TryGetValue method here since it required you to declare the out variable (which is of anonymous type!). However, with out var we do not need to explicitly specify the type of the out variable.

 

Find live frequency of Character in string using Java Script.

In this blog i am going to show you a simple program where you find frequency of character in a string using JavaScript.

Note:- Before starts this simple demo i believe that you must have basic knowledge on JavaScript.

Let start;

To do this demo first we need to design a simple web page where we have one textbox where we need to enter some text and we find the frequency accordingly.

In this example bellow all the functionality are defined inside JavaScript function called as “GetFrequency()

 

<html>
<head>
<meta name=”viewport” content=”width=device-width” />
<title>TestKey</title>
</head>
<body>

<h2>Get Frequency of Character from a string</h2>

Enter Your Text :

 </body>

</html>

<scripts>

var charkey = “”;
function GetTheKey(e) {
charkey = document.getElementById(“txtData”).value.substring(document.getElementById(“txtData”).value.length – 1);
}
function GetFrequency(e) {
debugger
var count = 1;
var value = document.getElementById(“txtData”).value;
if (e.which <= 90 && e.which >= 48) {
var checkCount = 0;
var keyChar = e.key;
if (value.length > 1) {
for (var i = 0; i < value.length – 1; i++) {
if (keyChar == value[i]) {
count++;
}
else
continue;
}

if (count > 1) {
for (var i = 1; i < count; i++) {
if (i != count) {
if (document.getElementById(keyChar + i) != null) {
var eleData = document.getElementById(keyChar + i).innerHTML.replace(/.$/, count);
document.getElementById(keyChar + i).innerHTML = eleData;
checkCount++;
}
}
}
}
if (checkCount == 0) {

var lable = document.createElement(“lable”);
lable.textContent = “The frequency of character ” + keyChar + ” is ” + count;
lable.id = keyChar + count;
document.getElementById(“result”).appendChild(lable);
var br = document.createElement(“br”);
document.getElementById(“result”).appendChild(br);
}
checkCount = 0;
count = 1;
}
else {
var lable = document.createElement(“lable”);
lable.textContent = “The frequency of character ” + keyChar + ” is ” + 1;
lable.id = keyChar + count;
document.getElementById(“result”).appendChild(lable);
var br = document.createElement(“br”);
document.getElementById(“result”).appendChild(br);
count = 1;
}
}
else if (e.which == 8) {
// if (document.getElementById(“txtData”).selectionStart != 0) {

if (document.getElementById(“result”).lastChild != null) {
var ele = document.getElementById(“result”).lastChild;
document.getElementById(“result”).lastChild.remove();
if (document.getElementById(“result”).lastChild != null) {
var iNum = document.getElementById(charkey + count).innerHTML.substring(document.getElementById(charkey + count).innerHTML.length – 1);
if (parseInt(iNum) > 1) {
var eledata = document.getElementById(charkey + count).innerHTML.replace(/.$/, iNum – 1);
document.getElementById(charkey + count).innerHTML = eledata;
document.getElementById(“result”).appendChild(ele);
}
else {
document.getElementById(“result”).lastChild.remove();
}
}
}
}
//}

}

</scripts>

Note:- Do copy and paste above code and remove the last character ‘s’ from script tag.

Any thing not work for you feel free to drop a comment in the comment box; always happy to listen your feedback.

Happy Coading 🙂

#Share2Know @SURYAN_Mode

 

IT Industry Journey.

A Few word about my IT Experience and some career advice what I learned.

IT Journey!!!

Greeting all of You !!!

I have completed 4.7 year in IT industry, apart from that working on many Dot Net Developer Community since last 4 years with providing on-line training many Dot Net Developer Pro on various Dot Net Technology.
Yes it’s true that; It’s an beginning of my IT career more year to go now.
So friends I am not an Tech Guru or Tech Expert to advice you; but yes i can tell you
what i learn in my career in this small amount of time.

I started my career as a .Net Developer in a company called as Focussoftnet and I worked there for 4.7 year. I resigned that company recently and going to start my IT Journey in another MNC company.

I learned many things in this company; special thanks to my Project Manager and our VP for their advice and support; always heartily thanks to Azizur Reheman (PM) for all time support and giving best suggestion and showing a right path, also giving me always R&D type of Task.
I really thankful sir for your faith and believe over me and giving such type of challenging work; as a fresher you know well it’s difficult for me to complete it; but i really happy that you giving me that task as an opportunity to use all my knowledge and ideas, yes it took time to complete but due to your support and giving me time i made all this possible.

These are few bellow points what i learned in this year of experience;

If You are a Fresher Joining to any Company What You do :-

1. As you are fresher it means you required to work on any technology what company gives you.

Tips To Remember:- Here keep in mind always that if you are although a fresher and you did specialized in any technology which company required today; for eg:.Net,Java,PHP and etc then you can apply for that company where you matched your technology; so that you are 90% sure that you are going to work on that technology what you already have specialized. May be you are thinking why 90% not 100% Right ???
Yes Not 100% because you are fresher; so keep in mind if company don’t have any project currently on that particular technology then you required to work on what you get. So set up your mind like that and be flexible.

Their is a way to avoid this 10% too. The idea is before apply the Job first check the Job description clearly what they mentioned and if you all round then in HR round Just clarify once again what technology i am going to work and tell what specialized you have; so many case you get the same technology what you have specialized. So don’t bother about this 10%; just focus on your technology.

2. Once you joined in a company as fresher then don’t think that you can get work on project immediately. Actually it’s differ company to company. Yes you got work immediately if company has running project.
In my career i see many of us frustrated
that i am not getting work; just i am going to office and coming back; also not getting the work what i needed.
May be many of us face same problem; i have also face the same; but i utilize my time on different way without frustrated. The best thing i need to say what i followed; if company won’t giving you work immediately then start learning by your own. Start to practice the concepts. Their are lots of project at Github you can just download it and start doing by your self; otherwise start Google on a particular topic then you get lots of resource on that to read.
If you think you already have all the knowledge with you and you required work to do then the best thing i can suggest that their are lots of open source project available at Github; you just need to login and start contributing your ideas inside that project. Now you might think that what is my benefit??
Right ??
Yes; First of all you get some new ideas and knowledge as well as more importantly people in community going to recognize you if you are a good contributor .In IT industry you required a good connection over all type of people around the globe. As a fresher if you started contributing your ideas inside the project then in very few time you might well recognized inside the community which helps you a lot in your IT Journey.
If you start your career as a Software Developer then you should required to have the art of Self Learning; this only helps you in life long.

Note :- If you need more details about this how can you contribute? for all type of query i am always available and happy to help you. You find all details of me here..

3. Do your task first what given to you; if you finish the task before the time then just inform to your reporting manger; Yes you need to inform not sit ideal why so ???
Because you are joined as a fresher keep in mind to build up your image and make recognize between many employee you should tell so that you create a positive view in front of your Reporting manger.

Now you might think what was it’s advantage ?
You got confirmation very quickly and the hike also good :). Here i am not saying it this happen to all company but yes it true many company treats you as good employee.

4. Don’t be show more your talent.
Yes you should say what you have asked; not say more then that.If you understand the environment and you think your view is required then tell.
Key Point :- Build up Your image through your work not by saying in word.
You only know to whom over you can show your talent show your talent when required and get value of this.

5.Build a good relationship To Everyone :-
As you joined as fresher keep respect to everyone and make yourself more flexible. If any body wants your help share your ideas.
Key Point :- Always make your self update and share the new thing with other and make a good connection among all.

6. Don’t go on your believe always goes on what is the realty.
If you goes on your believe and think yourself it may be like that;
for eg: A task given to you and the task is not clear to you while it is giving; so don’t imagine your self that the task would be like that; do not do this just go and ask once again who ever giving you.
Key Point :- Do not be heighted to ask; if you get fear to ask then you can not rectify the mistake and waste you time. So ask as many time you won’t understand the task. If you ask then only it crate a confidence with in you and the team lead who is giving you task he get positive attitude to-wards you.

Lastly thanks to All My Team Member whom with I worked on.

I really miss the work environment and all of You Guys !!

Hope to See you soon Guys !!

Hope You like this article and it helps you on your way in IT Life.

Share your valuable comments.

 

Suryakanta Nayak,  Software Engineer
SuryakantaN@Solutionsoftware.com
 – Health Plan Partner of the Year

#Share@Know

 

 

Few line for Developer’s; Must Read !!!

We are the developer who working today with different technology. Every day handling different situation; and also getting different problem where we might think that we are getting stuck after doing many search over internet; now it’s time to take help for some one else.
Is not it ??
Yes; so what we do is ask some one other developer or any of our friends Right ?
Yes;
But, still we are not finding any solution then ???
If you ask me then I have answer.
My answer is visiting any technical Forum and asks the same question there.
Who are new to .Net technology might be do not know about what is forum ??

and how it is working ?
Let me tell you;

Today we have lots of technical forum to ask the question; if you are working on .Net technology then we have specific forum for each technology. Today’s many developer are actively answering the question and what I saw one of the best technical forum for web development is Asp.net forum.
Apart from that another best one for any Microsoft technology related query is MSDN.Com.
You can ask any question/doubts there.
Don’t think that you can get answer immediately ; yes you can get the answer immediately if and only if you ask the question in appropriate manner.

So what I mean by appropriate manner?

    • Your question not so much lengthy explanation with unnecessary things; so make as much as smaller and keep it as simple.
    • Post your code if you think explanation required code stuff to understand.
    • Always choose the appropriate categories while posting the question that is most important.

So don’t be hesitated to asking your question; it’s not like that you can get your response quickly; but remember you definitely get the answer as depends upon how you explain the question. What I saw in my case maximum within four to five hour I get the response. So keep penance!!!
I am not saying that you can improve your way of asking question in one day but if you do it regularly then definitely I say you can improve a lot and you get quick response from other developers.
If you are asking question in Asp.net forum and MSDN forum then I definitely sure that you can get response to your question; in rare case you can not get; but most probably all the question get solved very quickly.

How it’s working ?
Many of us actually don’t know how the forum works; it’s not like that you are only asking question and getting response; behind the seance there are lots of stuff happen;
Basically if you are asking question in any Microsoft forum then Microsoft has it’s own moderator (moderator are the developer who have lots of experience and actively working with community and also their are various Microsoft Most Valuable Professional  (MVP))who are going to check your question whether your question related to Microsoft technology or not and also they check on which categories you are asking question. If they found any point of time your question is invalid then they can immediately remove it from forum and they send you a private message about this.
So keep in Mind this while posting question!!!
Many developer today actively contributing their valuable response in MSDN forum.
Which makes you guarantee that you get your response quickly.

If you see that many days happen you are not getting any response of your question or valid answer of your question then the best way is just open another thread and ask same question in different manner.

Last one for all; Use forum also answer the question as well; not only ask the question. So do regular visit to forum and try to read the question as you can; and on the way of reading one by one question when you feel that you can answer it just answer it by click on reply.
If you do so you are now actively work with community on a bidirectional manner.

Last but Not the List:-
We all asking the question but it’s important to keep in mind that once your question get resolved make the question mark as answer so it’s helps the community to recognize that what are the question resolved till the date. A part from that if you mark as answer then it means that you are actively engaged with that thread.

If you are belong to .Net Techies then;
Some of the best forum where you get directly in by just simple sign in:-
1) All in One as I told above i.e. is MSDN Forum
2) If specific to web technology then Asp.net Forum
3) C# Corner Forum
4) CodeProject Forum

So what we see form above that we are not alone today we have whole community with us.
If we are working on .Net technology then we have many more developer from across the country whom we can get collaborate by asking the question and get the response.
Keep asking and visiting forum.
That’s all;
Hope above information help you.
You can find my thread on MSDN forum Here

Please give me your valuable feedback and tell me if any thing i left here.

Thanks.

Happy Coading. 🙂