Posts

Showing posts from September, 2022

Finding something inside windows

 got an error while running azure-js-sdk package: : File C:\Users\<path>\AppData\Roaming\npm\rush.ps1 cannot be loaded. The file C:\Users\<path>\AppData\Roaming found it's solution also in one of the post:  [Solved] AppData\Roaming\npm\ng.ps1 cannot be loaded because running scripts is disabled on this system (techstrology.com) it says about deleting rush.ps1 file but i wasn't able to find it's parent folder. Later I found that this inside an hidden folder, this article helped in fixing the issue: How to Find and Use the AppData Folder in Windows (lifewire.com)

Using Azure Cosmos DB JavaScript sdk

Image
  Azure cosmos DB  is Microsoft's proprietary globally distributed, multi-model database service "for managing data at planet-scale" launched in May 2017. [1]  It is schema-agnostic, horizontally scalable, and generally classified as a  NoSQL  database. We have discussed about setting up a cosmos DB client from Azure CLI in our last post:  https://thenoobsoftwareengineerblog.blogspot.com/2022/09/setting-up-cosmos-db.html In this post we would discuss about setting up database using one of their most popular sdk which is Java script one. Let's start with it, upon searching google this is the first link which comes up: Azure Cosmos DB client library for JavaScript | Microsoft Learn This is from the Microsoft (creator of cosmos DB) and by going through it i found it to be quite useful document. Let me follow it for connecting it my account which I created in my last post. Or maybe before that let's try creating a Database and container associated.  This d...

Setting up Azure Cosmos DB

Image
 Ok, let's take it one by one. Let's start with setting up of a cosmos DB cluster. But before that lets discuss some general info about cosmos db.  What is cosmos DB? If you search Wikipedia, you will get following result. Azure Cosmos DB  is Microsoft's proprietary globally distributed, multi-model database service "for managing data at planet-scale" launched in May 2017. [1]  It is schema-agnostic, horizontally scalable, and generally classified as a  NoSQL  database. So, I can understand that it's a Microsoft provided NoSQL datastore which provides different properties as mentioned in its description. I am not going into the details of these properties in this article as it's beyond the scope of it. I would only discuss about how to set it up. Now, let's jump on to the setup of cosmos DB. How to setup cosmos DB?  In order to do it, you need an azure account. In order to create a free one, you can use:  Create Your Azure Free Account Today | Mic...

Using keyword in c#

Image
 While learning c# many times I came across this kind of code:   I have seen using keyword while adding up variables from new name spaces. Upon searching I found that it is used for defining up scope of a variable and that variable is disposed once we reach outside the scope. e.g., in this example client variable can be used in the curly braces mentioned.  This is about the usage of this using keyword but still pros and cons of developing these kinds of constructs is unclear to me. I need to explore more...

How I learned Asnyc c#

Image
Asynchronous programming and design patterns have become quite common in every programming language and C# is no exception here. I was learning c# recently and so sharing my learning experience for this specific territory.  Before going into it, a natural question would be why I am learning it? Let's try to answer that first: Pros and Cons of Async Programming: Async programming is generally used when we have I/O bound tasks so thread won't get blocked upon I/O bound tasks and can utilize CPU well. It is also good for CPU bound code.... by executing CPU bound tasks in background. If you go through any courses, they will start with Async and Await so let's discuss about them first: Async Await  The core of Async programming is Task and Task<T> object models. For I/O bound processes await method can be used for the method which are implementing async and returning Task or Task<T> object. For CPU bound processes we can use await method over the background processes...

How I learned LINQ query Fundamentals

Image
Some days back, I joined my new organization, and I came to know that my team extensively uses c# for their development purposes and I came from java background. By surfing through internet and watching some videos I was able to grasp basics of c# then started exploring code base my team. I saw that there are quite a lot of code pieces like: I found it bit difficult to understand as these are not part of c# syntax so after doing some google searches, I found that this is part of something called LINQ(Language-Integrated) queries which provides solution for object-relational mapping and simplifies operation between objects and data sources. Obviously, I had to learn more about it and become an advanced user, as my team is using it extensively.  Random thought: Yeah, it's okay I have to learn LINQ queries since my team is using it but why exactly they are using it?? Let's analyze advantages of LINQ: Familiar language: Developers don't have to learn a new query language for ...