tag:blogger.com,1999:blog-86051193127507665232024-03-05T21:48:22.955+05:30Nitin's blogTips | Tricks | C# | ASP.NET | JQuery | Javascript | SQL | Angular | ArticlesUnknownnoreply@blogger.comBlogger69125tag:blogger.com,1999:blog-8605119312750766523.post-39975733477019863552023-05-16T08:50:00.000+05:302023-05-16T08:50:13.292+05:30Mobile first css media queriesMobile first css media queries to adjust UI controls for various resolutions:
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-77328215524760999062023-05-02T22:20:00.022+05:302023-05-02T23:10:29.085+05:30Installing .NET on Android
This runs .NET natively
not in a vm
not in a container
no need to have root access or jailbreaking your android
.NET runs natively on android in user space
Install Termux apk on android
pkg install proot
pkg install proot-distro
proot-distro allows to install linux which runs along with android os. This is not a vm so we get native performance.
proot-distro commands:
proot-distro listUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-8691673739014393632023-03-02T11:00:00.003+05:302023-03-02T12:05:55.005+05:30Amplifieing analog audio output from 3.5mm audio jack with PAM8403 amplifier
Aim
In this
post we will develop an amplifier which amplifies 3.5mm analog audio output, You can use the circuit as a speaker for PC.
Introduction
Required Electronic Components:
1. PAM8403 Class D 3W amplifier
2. 3.3V 5.5V FT232RL FTDI USB to TTL Serial Adapter Module
3. 5V 3A USB power supply
4. USB Cable, A-Male to Mini-B Cord USB cable
5. 3W Speaker
6. Jumper Wires
7. AUX Cable
Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-56424248005517203732023-02-27T19:30:00.014+05:302023-04-22T17:50:50.617+05:30C#: Convert any time to time in any timezone
You can use this to convert any server time to india time or any other time zone
here's possible list of all zone IDs which can be used in this method: https://nodatime.org/TimeZones
First add reference to NodaTime nuget package which is built by the ultimate Jon Skeet
Pun intended
/*
1. Jon Skeet can divide by zero.
2. When Jon Skeet's code fails to compile the compiler apologises.
3. If Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-66131455522837972822023-01-28T11:26:00.028+05:302023-02-15T12:38:50.008+05:30Lifetime unlimited money through manual SWP in mutual funds
The ₹1 lac example:
Invest a lump sum in multiple high performing equity mutual fund e.g. ₹1lac
Wait for 1+ year - yea! Let it grow for sometime
Withdraw ₹1k per month on a fixed date (to minimize loss: withdraw only if mutual fund returns are greater than or equal to 13%)
More realistic example
Suppose you have ₹1k society maintainance bill:
Real-Time excel Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-12575209635473565102023-01-27T19:11:00.002+05:302023-02-02T21:29:42.749+05:30GF: marathi memeUnknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-45874933807320421882023-01-19T18:25:00.007+05:302023-02-02T21:29:59.545+05:30परीक्षा: marathi memeUnknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-72783774016924264622022-10-31T15:43:00.016+05:302023-01-20T13:22:03.614+05:30Arduino for Beginners: IoT basicsAim
In this
article we will have high level overview of Arduino, its parts, sensors and how
we can use it with Internet of Things aka IoT sensors. I will take you step by
step in creating your first simple Arduino project and reading data from IoT temperature
sensor.
Introduction
Arduino is
open source programmable circuit board which you can use for creating
electronic hardware. This board Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-50918947599907817952022-08-22T19:59:00.017+05:302022-08-22T21:46:12.002+05:30TicWatch Pro - my new smart watchLong ago I saw this watch "TicWatch Pro",
I was hesitant to buy smart watches because their battery life and thinking that whats the use of buying a smart watch "Its just gonna just show Time", Now in 2022 I purchased latest version, I am quite impressed by TicWatch Pro features.
Dual layerd display - old digital style mode and smart mode
Upto 30 days battery life in essential Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-53949791700376797672022-08-03T23:14:00.017+05:302022-08-24T06:56:10.453+05:30Fix: No 'Access-Control-Allow-Origin' header is present on the requested resourceI came across following error when executing AJAX request to another external site from source site over https protocol Access to XMLHttpRequest at 'https://destination.com/test.svc/test' from origin 'https://source.com/test.html' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.The fix for this issue is adding custom headers 'Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-45745784796121936232022-07-12T21:35:00.011+05:302022-08-15T22:29:58.447+05:30Windows: One click Hibernate, Shudown & Lock batch filesOne click hibernate, lock & shutdown batch files:
Hibernate.bat (You need to enable hibernation on windows)
@echo off
setlocal
:PROMPT
SET /P AREYOUSURE=Are you sure (Y/[N])?
IF /I "%AREYOUSURE%" NEQ "Y" GOTO END
echo Hibernating...
cd c:\
shutdown /h /t 0 /c "immediate hibernate"
:END
endlocal
Lock.bat
@echo off
setlocal
Rundll32.exe user32.dll,LockWorkStation
:END
endlocal
Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-63910708157620919472022-07-05T23:59:00.004+05:302022-07-06T00:02:27.706+05:30Schedule auto backup of SQL database at specific locationYou can use this SQL script to backup particular database to a specific location,
-----------------------------------------------------------------
-- ***** Backup Database Script - by Nitin Sawant nitin@nitinsawant.com *****
--
-- Modify only two variables
-- 1. @sourcedatabaseName
-- 2. @restoreDirectory
--
-- Date Created: Jul 05, 2022
-----------------------------------------------Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-65250237667999476742022-06-09T13:47:00.005+05:302022-06-10T11:46:22.955+05:30Configuring DNS over TLS in OpenWRT<!--[if gte mso 9]>
<![endif]--><!--[if gte mso 9]>
Normal
0
false
false
false
EN-US
X-NONE
X-NONE
<![endif]--><!--[if gte mso 9]>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-59865173956757266332022-05-09T18:40:00.005+05:302022-12-02T15:26:52.287+05:30Restart Openwrt router periodically at specific timeSSH to the Openwrt routerEnter following command to edit the CRON jobcrontab -eAdd the following line there and save the file(press ESCAPE and then :wq).0 8,20 * * * sleep 70 && touch /etc/banner && reboot Now reboot the cron service
/etc/init.d/cron restart
This will reboot the router everyday at 08:00 AM and 08:00 PM Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-51826583997734949732021-11-28T22:26:00.004+05:302021-11-28T22:29:21.437+05:30Enumerating an enum in C# | Interview QuestionTo enumerate an enum type you can use Enum.GetValues method as followsenum Animals{ Cat, Dog, Mouse, Monkey}void Main(){ var allAnimals = Enum.GetValues(typeof(Animals)); Console.WriteLine(allAnimals.Length); foreach(var animal in allAnimals) {  Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-27486801513843148542021-11-27T10:07:00.003+05:302021-11-27T10:09:29.062+05:30What is the difference between String and string in C#?Example (note the case):
string s = "Hello world!";
String s = "Hello world!";
What are the guidelines for the use of each? And what are the differences?
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-39104008084138247912021-10-06T09:48:00.000+05:302021-10-06T09:48:07.036+05:30OpenShell Angry Birds Start Menu icon for Windows 11Open shell download: https://github.com/Open-Shell/Open-Shell-Menu Right click above image and save into your machine,now open 'Open-Shell' start menu settings and select the "Start Menu Style tab" 1. Mark the Replace Start button checkbox and Select the custom style as shown in above image2. Pick the downloaded imageand press OKNow on Windows 11 theUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-46829261284559926112021-07-25T22:39:00.009+05:302022-08-08T17:25:41.601+05:30Securing internet access of all of your devices using VPN with single configuration on router This
was just an experiment, I wanted to be invisible to my ISP so that ISP
won’t log my site visits etc. so I decided to setup VPN, I guess there is
no other more secure way that this. AIM: Securing internet access of all of your devices using VPN You can connect all the connected devices to the router to VPN without any configuration or any VPN software on client device. Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-14997987132978287582021-07-21T15:59:00.006+05:302021-07-21T15:59:59.093+05:30MSSQL issue fix: Cannot drop database because it is currently in use
While executing the MSSQL query
drop database TestDb
If you get this error "Cannot drop database because it is currently in use", you can force delete that MSSQL database by terminating all the processes which are using it
DECLARE @DBName varchar(50) = 'TestDb'
WHILE EXISTS(select NULL from sys.databases where name = @DBName )
BEGIN
DECLARE @SQL varchar(max)
SELECT @SQL = Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-41224195653363249612021-07-21T15:53:00.000+05:302021-07-21T15:53:39.600+05:30Webinar Registration and Payment collection: My new C#.NET project on GitHubWebinar registration C#.NET Code showcase project Source Codehttps://github.com/nitinjs/webinar-registration-systemWebinar Registration System
This C#.NET project allows registering for the webinars and accept payments for the registration, Payments are accepted through Stripe API
This project is based on aspnetboilerplate web application framework read moreProject Setup
Make sure that you updateUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-65775295205419425172021-02-12T15:06:00.000+05:302021-02-12T15:06:51.391+05:30Change openwrt luci web ui port on your router
To change openwrt luci web ui port on your router having
openwrt.
Open Winscp (https://winscp.net/eng/download.php)
Go to `Session` => `New Session` menu
Select File protocol: SCP
Enter Host name: 192.168.1.1
Port Number: 22
User name: root
Password: YOUR_ROOT_PASS
Hit `Login` button
Then navigate to `/etc/config` <!--[if gte mso 9]>
<![endif]--><!--[if gte Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-2521627847261915032020-10-16T13:52:00.008+05:302020-10-16T13:54:05.584+05:30Adding rounded corners to controls in Xamarin Forms Application To add rounded corners to controls in Xamarin Forms Application add reference to the nuget package "Xamarin.Forms.PancakeView"add nuget package reference of "Xamarin.Android.Support.Compat" to "Android" project in the solutionin the xaml file for the ContentPage add following attributexmlns:yummy="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"to add Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-8605119312750766523.post-68817787763537402052020-08-16T10:22:00.002+05:302020-08-16T10:22:20.137+05:30Steps to enable https on your IIS website with free certificate from ZeroSSLDownload from ZeroSSL Download openssl library from
https://wiki.openssl.org/index.php/Binaries set path to the extracted directory execute following command to convert the crt file to pfx file so that it can be recognized by IIS certificate manageropenssl pkcs12 -export -out certificate.pfx -inkey private.key -in certificate.crt -certfile ca_bundle.crt import the pfx in iis&Unknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-56654087278284071862020-08-10T20:07:00.003+05:302020-08-10T20:19:05.956+05:30BigBlueButton .NET API releasedgo ahead to github repo: https://github.com/nitinjs/bigbluebutton-api-dotnet
Roadmap:
No
Feature
status
1.
basic api executions
✅
2.
sample console client app
✅
3.
first release
✅
4.
asp.net demo app
🚧
created by Nitin Sawant
Installation instructions
BigBlueButton requires Ubuntu 16.04 64-bit
STEP1
you need to create "A" record in your DNS zone file and point it toUnknownnoreply@blogger.com0Mumbai, Maharashtra, India19.0759837 72.8776559-9.2342501361788472 37.721405899999993 47.386217536178847 108.0339059tag:blogger.com,1999:blog-8605119312750766523.post-63042717591636545432020-03-11T10:13:00.001+05:302020-03-11T10:20:39.584+05:30IoT Particle: Parsing JSON into array of objectssuppose your JSON is as follows
String scheduleJson = "[{\"hour\":1.5, \"isFlash\": true}, {\"hour\":2, \"isFlash\": false}, {\"hour\":7.30, \"isFlash\": true}, {\"hour\":8, \"isFlash\": false}]";
we create a class representation of above JSON
class Schedule{
public:
float hour;
bool isFlash;
};
From Libraries menu in Particle web IDE add reference to Unknownnoreply@blogger.com0