As of Go 1.16, the GO111MODULE environment variable is treated as "on" by default, meaning Go expects to find a go.mod file, and no longer falls back to pre-module GOPATH behavior.
Welcome to my Technology Hotspot
Sunday, March 26, 2023
Go error: go : go.mod file not found in current directory or any parent directory; (working on GOPATH/src)
Friday, March 10, 2023
𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐐𝐮𝐞𝐬𝐭𝐢𝐨𝐧𝐬 | Amazon 2022
Amidst the massive layoffs in Tech industry in these tough times, there are many of us preparing right now for interviews.
LeetCode is a good source to look at the current level of questions.
Below is the list of questions currently being asked by Amazon in the last 3 to 4 months.
-- 𝐆𝐫𝐚𝐩𝐡𝐬
1) Process Ordering - https://lnkd.in/dN4ErKyE
2) Number of Islands - https://lnkd.in/dHQJGhPJ
3) k Jumps on Grid - https://lnkd.in/dKM_ETsM)
-- 𝐓𝐫𝐢𝐞
1) Finding Prefix in Dictionary - https://lnkd.in/dpRvFDq5
-- 𝐓𝐫𝐞𝐞
1) Binary Tree Top Down View - https://lnkd.in/dmun-Pn3
2) Traversing binary tree in an outward manner.
3) Diameter of a binary tree [Path is needed] - https://lnkd.in/dH-w_DQV
-- 𝐒𝐥𝐢𝐝𝐢𝐧𝐠 𝐰𝐢𝐧𝐝𝐨𝐰
1) Contains Duplicates III - https://lnkd.in/djcWHTaX
2) Minimum Window Substring [Variation of this question] - https://lnkd.in/dPfnQZmr
-- 𝐋𝐢𝐧𝐤𝐞𝐝 𝐋𝐢𝐬𝐭
1) Reverse a Linked List II - https://lnkd.in/diHAJZUJ
2) Remove Loop From Linked List - https://lnkd.in/d-zVawwX
3) Reverse a Linked List in k-groups - https://lnkd.in/de99T3hQ
-- 𝐁𝐢𝐧𝐚𝐫𝐲 𝐒𝐞𝐚𝐫𝐜𝐡
1) Search In rotate sorted Array - https://lnkd.in/djxEpFxF
-- 𝐀𝐫𝐫𝐚𝐲𝐬
1) Max bandWidth [Priority Queue, Sorting] - https://lnkd.in/d6JE2xpz
2) Next permutation - https://lnkd.in/dk9cHQbw
3) Largest Rectangle in Histogram - https://lnkd.in/dQHQcF-5
Credits - Sandeep Kumar
Follow Aman Barnwal for more. ❤️️
Join my Telegram group for 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐨𝐮𝐫𝐜𝐞𝐬 👉https://lnkd.in/gDBqRNBw
Wednesday, March 8, 2023
How to access WSL2 Linux files from Windows file explorer?
File Management
- Open File Explorer
- Type \\wsl$ on address bar
- Press Enter
Sunday, March 5, 2023
𝐒𝐲𝐬𝐭𝐞𝐦 𝐃𝐞𝐬𝐢𝐠𝐧 𝐆𝐨𝐥𝐝𝐦𝐢𝐧𝐞 ❤️️
System Design rounds are an important part of the Software Engineering interview process because they test a candidate's ability to design and implement large-scale systems.
Here is the list of some amazing resource on System Design -
✅ Things you must know in System Design
👉System design basics: https://bit.ly/3SuUR0Y
👉Horizontal and vertical scaling: https://bit.ly/3slq5xh
👉 Load balancing and Message queues: https://bit.ly/3sp0FP4
👉High-level design and low-level design, Consistent Hashing, Monolithic and Microservices architecture: https://bit.ly/3DnEfEm
👉 Caching, Indexing, Proxies: https://bit.ly/3SvyVDc
👉 Networking, How Browsers work, Content Network Delivery ( CDN): https://bit.ly/3TOHQRb
👉 Database Sharding, CAP Theorem, Database schema Design: https://bit.ly/3CZtfLN
👉 Concurrency, API, Components + OOP + Abstraction : https://bit.ly/3sqQrhj
👉 Estimation and Planning, Performance: https://bit.ly/3z9dSPN
👉 Map Reduce, Patterns, and Microservices: https://bit.ly/3zcsfmv
👉 SQL vs NoSQL and Cloud: https://bit.ly/3z8Aa49
👉 Most Popular System Design Questions: https://bit.ly/3Dp40Ux
✅ System Design Case Studies
👉 Design Netflix: https://bit.ly/3GrAUG1
👉 Design Reddit: https://bit.ly/3OgGJrL
👉 Design Messenger App : https://bit.ly/3DoAAXi
👉 Design Instagram: https://bit.ly/3BFeHlh
👉 Design Dropbox: https://bit.ly/3SnhncU
👉 Design Youtube: https://bit.ly/3dFyvvy
👉 Design Tinder: https://bit.ly/3Mcyj3X
👉 Design Yelp: https://bit.ly/3E7IgO5
👉 Design Whatsapp: https://bit.ly/3M2GOhP
👉 Design URL shortener : https://bit.ly/3xP078x
👉 Design Amazon Prime Video: https://bit.ly/3hVpWP4
👉 Design Twitter: https://bit.ly/3qIG9Ih
👉 Design Uber: https://bit.ly/3fyvnlT
👉 Design TikTok : https://bit.ly/3UUlKxP
👉 Design Facebook's Newsfeed: https://bit.ly/3RldaW7
👉 Design Web Crawler: https://bit.ly/3DPZTBB
👉 Design API Rate Limiter: https://bit.ly/3BIVuh7
✅ All solved case studies: https://bit.ly/3dCG1rc
👉 System Design Important terms - https://bit.ly/3Om9d3H
👉 Most Popular System Design Questions: https://bit.ly/3E9oH7K
👉 Complete System Design Basics Series: https://bit.ly/3rG1cfr
Save this post for later.
Follow Aman Barnwal for more. ❤️️
Join my Telegram group for 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐏𝐫𝐞𝐩𝐚𝐫𝐚𝐭𝐢𝐨𝐧 𝐑𝐞𝐬𝐨𝐮𝐫𝐜𝐞𝐬 👉https://lnkd.in/gDBqRNBw
Tuesday, February 28, 2023
API architectural styles
The following image displays the most common architectural styles for APIs.
🔹 1. REST REST, which was proposed in 2000, is the most widely used style for APIs. It is often utilized between front-end clients and back-end services, and it adheres to six architectural constraints. The payload format may be JSON, XML, HTML, or plain text.
🔹 2. GraphQL Meta proposed GraphQL in 2015. It provides a schema and type system that is ideal for complicated systems where entities' relationships are graph-like. In the diagram below, GraphQL can retrieve user and order information in one call, while REST necessitates multiple calls.
GraphQL does not replace REST but can be built upon existing REST services.
🔹 3. Web socket Web socket is a protocol that enables full-duplex communications over TCP. Clients create web sockets to receive real-time updates from back-end services. Unlike REST, which always "pulls" data, web socket allows data to be "pushed".
🔹 4. Webhook Webhooks are frequently used for third-party asynchronous API calls. In the diagram below, Stripe or Paypal is used for payment channels, and a webhook for payment results is registered. When a third-party payment service is completed, it notifies the payment service if the payment was successful or failed. Webhook calls are usually part of the system's state machine.
🔹 5. gRPC gRPC, which was released in 2016, is used for communications among microservices. The gRPC library handles encoding/decoding and data transmission.
🔹 6. SOAP SOAP stands for Simple Object Access Protocol, and its payload is only XML, making it suitable for internal system communications.
Friday, February 17, 2023
Difference between Hub Switch Router & Firewall
Hub
Hubs are used to connect multiple devices in a network. They’re less likely to be seen in business or corporate networks than in home networks. Hubs are wired devices and are not as smart as switches or routers.
Offering greater efficiency for traffic delivery and improving the overall throughput of data, switches are smarter than hubs but not as smart as routers
Thursday, February 16, 2023
UX ದೃಷ್ಟಿಕೋನದಿಂದ ಎಲ್ಲಾ ಪೂರ್ವಾಪೇಕ್ಷಿತ ತಪಾಸಣೆಗಳನ್ನು ಒಂದೇ ಪರದೆಯಲ್ಲಿ ತೋರಿಸುವುದು ಅಥವಾ ಅವುಗಳನ್ನು ಬಹು ಪರದೆಗಳಾಗಿ ವಿಭಜಿಸುವುದು ಉತ್ತಮವೇ?
UX ದೃಷ್ಟಿಕೋನದಿಂದ, ಪೂರ್ವಾಪೇಕ್ಷಿತ ಚೆಕ್ಗಳು ಹಲವಾರು ಅಥವಾ ಸಂಕೀರ್ಣವಾಗಿದ್ದರೆ ಅವುಗಳನ್ನು ಬಹು ಪರದೆಗಳಾಗಿ ವಿಭಜಿಸುವುದು ಉತ್ತಮವಾಗಿದೆ, ವಿಶೇಷವಾಗಿ ಅವುಗಳಿಗೆ ಬಳಕೆದಾರರ ಇನ್ಪುಟ್ ಅಥವಾ ಪರಸ್ಪರ ಕ್ರಿಯೆಯ ಅಗತ್ಯವಿದ್ದರೆ. ಒಂದೇ ಪರದೆಯ ಮೇಲೆ ಬಹು ಪೂರ್ವಾಪೇಕ್ಷಿತ ತಪಾಸಣೆಗಳನ್ನು ಪ್ರದರ್ಶಿಸಿದಾಗ, ಅದು ಬಳಕೆದಾರರಿಗೆ ಅಗಾಧವಾಗಿರಬಹುದು ಮತ್ತು ಯಾವ ಚೆಕ್ಗಳನ್ನು ಪೂರ್ಣಗೊಳಿಸಲಾಗಿದೆ ಮತ್ತು ಯಾವವುಗಳು ಬಾಕಿ ಉಳಿದಿವೆ ಎಂಬುದನ್ನು ಅರ್ಥಮಾಡಿಕೊಳ್ಳಲು ಕಷ್ಟವಾಗಬಹುದು.
From UX perspective is it good to show all prerequisite checks in a single screen or split them into multiple screens?
When multiple prerequisite checks are displayed on a single screen, it can be overwhelming for the user, and it may be difficult to understand which checks have been completed and which ones are outstanding. This can lead to confusion, frustration, and errors.
Splitting the prerequisite checks into multiple screens can make the process more manageable for the user. Each screen can focus on a specific task or set of tasks, with clear instructions and feedback on completion. This can help the user feel more in control of the process and less overwhelmed by the overall number of prerequisite checks.
However, if the prerequisite checks are simple and can be completed quickly, it may be appropriate to display them all on a single screen, provided they are clearly organized and easy to understand. In this case, a single screen can be more efficient and faster for the user, and it can also provide a sense of progress as they complete each check.
In summary, the decision to split or combine prerequisite checks into screens depends on the number and complexity of the checks, the amount of user input required, and the overall user experience goals of the application or website.
Thursday, February 2, 2023
Netflix strategy on preventing password sharing
Tuesday, November 8, 2022
How to use WMI from a .NET Application
A .NET developer can use WMI to obtain information about drivers installed on the client machine, verify whether the system is licensed or not, check for hardware configuration and a lot more.
Quoting Linus Torvalds, “Talk is cheap. Show me the code”, let’s get to the basics of WMI usage. To get data through WMI, a SQL-like query is used. The specific query type is called WQL (WMI Query Language). Don’t let the name confuse you. It is still very similar to SQL.
Before diving into code, you should know that Windows comes with a tool called WMI Test Tool, which lets you test WQL queries, to check their correctness and returned results. It is a bit harder to track wrong query results in code, so this tool can save some time for the developer. To run it, just start the Run dialog (or the Command Prompt) and type wbemtest.
Once it is started, you will see a window like this:


It lets you connect to a namespace on your local Windows computer. You can use your credentials (although for most queries this is not a requirement) and select the impersonation and authentication levels (once again, for most queries the default settings are acceptable). Once you click connect, you will be able to execute WMI queries, as well as perform other tasks (for example, enumerate classes in a superclass to review its possibilities).
Before creating a query, you need to understand what information you want to obtain. The query is executed against a WMI class – you can read the complete list here. Let’s take the Win32_Processor class as an example here. Querying against this class will give us information about the CPU installed on a machine. If the machine runs with multiple CPUs, a query result will be returned for each one of them.
The Win32_Processor class exposes the following properties:
AddressWidth
Architecture
Availability
Caption
ConfigManagerErrorCode
ConfigManagerUserConfig
CpuStatus
CreationClassName
CurrentClockSpeed
CurrentVoltage
DataWidth
Description
DeviceID
ErrorCleared
ErrorDescription
ExtClock
Family
InstallDate
L2CacheSize
L2CacheSpeed
L3CacheSize
L3CacheSpeed
LastErrorCode
Level
LoadPercentage
Manufacturer
MaxClockSpeed
Name
NumberOfCores
NumberOfLogicalProcessors
OtherFamilyDescription
PNPDeviceID
PowerManagementCapabilities[]
PowerManagementSupported
ProcessorId
ProcessorType
Revision
Role
SocketDesignation
Status
StatusInfo
Stepping
SystemCreationClassName
SystemName
UniqueId
UpgradeMethod
Version
VoltageCaps
Most of these are have self-descriptive names, but if you are ever confused about one of them, you can always refer to the MSDN documentation for the class, that explains each one of them.
Now, let’s try to get the values of the above mentioned properties in your .NET application. In my examples I am using C#, but if you are using another .NET language, you shouldn’t have a problem adapting the code.
First, you need to add a reference to the System.Management and System. Management.Instrumentation namespaces. This is done by right-clicking on References in the Solution Explorer and selecting Add Reference. Then, you can select the above mentioned libraries from the .NET list:

Now, to the actual code. I am going to create a function that can be called from anywhere in the code to simplify this task.void GetCPUInfo()
{
ManagementObjectSearcher searcher = new ManagementObjectSearcher("SELECT * FROM Win32_Processor");
foreach (ManagementObject obj in searcher.Get())
{
if (!(obj == null))
Debug.Print(obj.Properties["CpuStatus"].Value.ToString());
}
}
The ManagementObjectSearcher is the key element here – it gets the returned properties based on the query. The parameter I am passing to it when instantiating is the actual query. As you see, it is very similar to SQL. My current query will retrieve all properties available in Win32_Processor. I iterate through them (note that each result is a ManagementObject – the property holder, in this case will be a separate instance for each CPU that is found) and print in the Output window the value of the CpuStatus property:

The 1 here is exactly what is returned. It is a good practice to consult the documentation before reading specific properties, to understand the possible returned values. 1 for CpuStatus means that the CPU is installed and is active.
Important note: Some of the readers might be curious, why there is a null value verification. Some of the classes require user authentication to get the correct data and some properties are simply not available, being the cause of multiple exceptions, depending on the authentication methods and property types. Therefore, to avoid exceptions, this code security measure is used here.
If only one property is needed to be retrieved, then the query can be organized like this:SELECT CpuStatus FROM Win32_Processor
The important thing to remember here is that when you only retrieve one property, the rest of them are unavailable for that specific query result. Therefore, trying to get their value will cause an exception.
Courtesy: Original source is from Denzel D at - https://dzone.com/articles/how-use-wmi-net-application
Featured
TechBytes on Linux
This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...
Popular Posts
-
This is a growing list of Linux commands which might come handy for the of Linux users. 1. Found out i had to set the date like this: ...
-
To set a PDF viewer as the default on Mac OS X: Select any PDF file from Finder. Control-click to open the menu. ... Choose Get...
-
ಮ್ಯಾಕ್ ಬುಕ್ ನಲ್ಲಿ ಕನ್ನಡ ದಲ್ಲಿ ಟೈಪ್ ಮಾಡಲು ಲಿಪಿಕ ಎನ್ನುವ ಈ ಕೆಳಗಿನ ಲಿಂಕ್ ಅನ್ನು ಕ್ಲಿಕ್ ಮಾಡಿ .pkg ಫೈಲ್ ಅನ್ನು ಡೌನ್ ಲೋಡ್ ಮಾಡಿ ಅದನ್ನು ಇನ್ಸ್ತಾಲ್ ಮಾಡಿ...
