Wednesday, March 4, 2026

App Prompt

 I want to create a medical related application using plain html and JavaScript. The app should support both mobile, tab and desktop web. Local storage database to store the entire app data in JSON format Export / Import JSON functionality to share the data Installable PWA Offline support (Service Worker) Local notifications (browser-based) The app will have home, medicines, Archived Medicines, medical tests page and Profile Page Home Page: Has Gallery Grid view with list of cards, each card is a image and title to navigate to the remaining pages Medicine Page: has a header(Title, filter, sort), list and "+" floating icon, on "+" icon click opens a popup. this popup has the following input fields(Medicine name(Mandatory), uses, composition details, image, Medicine Dosage Times(Mandatory)(have a "+" icon to add each dosage time), check box to start the medication(if unchecked lifelong checkbox and the start and end date inputs will be disabled, if checked either start and end date or lifelong has to be set mandatorily), check box to show lifelong option, Start Date and End Date to be used(lifelong check box disables this field), with check box to setup alarm if checked for each dose of the day, and more details editor), save button to save the details. the saved medicines if have checked for alarm, then check for Start medication true option, if it is true, check for start and end date and if today is in the range they show as local notifications on every day dose. The list contains the saved medication only if the medication is checked for start medication and today is in range of the start and end date. the medications will be sorted based on the upcoming dosage daily time. if today is out of the start and ed date range then the medication will have a JSON property as course completed true, archived to true, other wise both are false will be displayed in the list. each list item shows medicine name, time, status(done for day, done for now), doses: completed doses/total doses per day followed by only single button done/pending for the current dosage, then resets on next dosage time, followed by menu icon, on menu click opens popup that popup contains buttons "Edit, Archive, Delete, Course Completed", Edit opens the pre filled add popup to edit the data, except for name, composition remaining are editable. Archive sets the JSON property Archived to true, Start medication checkbox value to false Delete option deletes the medicine form the medicines JSON list Completed Course option sets the JSON property Archived to true and course completed property to true, Start medication checkbox value to false. Archived Medicines page: this is similar to Medicines page but sorting is not needed, filter is not needed, instead need a search to search the medicines in the list. each list item shows medicine name, time, status(done for day, done for now), doses: completed doses/total doses per day followed by only single button Edit. On Edit opens the pre filled add popup to edit the data, except for name, composition remaining are editable. if Start medication checkbox is made to true, the JSON options convert the archived to false. but start and end date or lifelong has to be set mandatorily. on save the list gets modified/ Medical Tests Page: has a header(Title, filter(drop down name, test type), sort( dropdown name, test type, date-Time), view as dropdown(list, graph)), list and "+" floating icon, on "+" icon click opens a popup. this popup has the following input fields(Test Type, age, sample situation, sample type, Test Date, Test Time, Test Result, Notes. Test type is auto adaptable and auto fill field(means, when user enters first time, it records the entry into local db with page name, field name, list of strings so far entered and when user enters the similar next time it shows a list of suggestions from saved list to autofill). Sample situation has the common items dropdown like fasting, after breakfast, just before lunch, After Lunch, evening, before dinner, after dinner, before sleep Sample type is also adaptable Here except for notes every field is mandatory. the test results once added can be seen in list items and can be with sorted based on date, name, test type. if graph is selected, user have to select the date range, test tye, sample type(multiple options for the same type is to be allowed). based on the date range an results the graph is plotted. Profile Page: user will have a profile screen, here user able to add his name, mobile, email, address, dob, gender, with save button to save the data, export all data, import data(data will be in JSON format) the export/import button saves all the profile, medicines, tests, auto fill data based on page data to the local drive in .json file Need a professional look, Coding i to be given with proper comments to understand in later point of time as well

Wednesday, February 11, 2026

Code Transfer

Good catch — and you're right 👍

In **.NET MAUI**, there is **NO built-in `PressGestureRecognizer`** (unlike some Xamarin plugins). So we must **implement long-press manually** using a **Timer + Touch events**.

Let me show you the **correct MAUI-native solution** for:

> ✅ Long press to enable drag
> ✅ Normal tap to open menu
> ✅ Smooth dragging

---

# ✅ Correct Long-Press Implementation in .NET MAUI

We’ll use:

* `PanGestureRecognizer` → movement
* `TapGestureRecognizer` → click
* `DispatcherTimer` → long-press detection

---

# 🧱 Updated Working Gesture Logic

### Add these fields:

```csharp
bool isDragging;
bool isMenuOpen;
bool isLongPressTriggered;

DispatcherTimer longPressTimer;
const int LongPressDuration = 350; // milliseconds
```

---

# 🧠 Setup Gestures Correctly

```csharp
void SetupGestures()
{
    longPressTimer = new DispatcherTimer
    {
        Interval = TimeSpan.FromMilliseconds(LongPressDuration)
    };

    longPressTimer.Tick += (s, e) =>
    {
        longPressTimer.Stop();
        isLongPressTriggered = true;
        StartDrag();
    };

    var pan = new PanGestureRecognizer();
    pan.PanUpdated += Pan_PanUpdated;
    FloatingContainer.GestureRecognizers.Add(pan);

    var tap = new TapGestureRecognizer();
    tap.Tapped += MainIcon_Tapped;
    FloatingContainer.GestureRecognizers.Add(tap);

    var outsideTap = new TapGestureRecognizer();
    outsideTap.Tapped += (s, e) => StopDrag();
    Overlay.GestureRecognizers.Add(outsideTap);

    var closeTap = new TapGestureRecognizer();
    closeTap.Tapped += (s, e) => StopDrag();
    CloseIcon.GestureRecognizers.Add(closeTap);

    FloatingContainer.Touch += FloatingContainer_Touch;
}
```

---

# 🖐️ Long Press Detection (REAL MAUI Way)

```csharp
private void FloatingContainer_Touch(object sender, TouchEventArgs e)
{
    if (e.Type == TouchEventType.Pressed)
    {
        isLongPressTriggered = false;
        longPressTimer.Start();
    }
    else if (e.Type == TouchEventType.Released)
    {
        longPressTimer.Stop();
    }
}
```

> ⚠️ Touch events require **CommunityToolkit.Maui**

---

# 📦 Enable Touch Events (IMPORTANT)

Install toolkit:

```bash
dotnet add package CommunityToolkit.Maui
```

In `MauiProgram.cs`:

```csharp
builder.UseMauiCommunityToolkit();
```

---

# 🧠 Pan Gesture (drag only after long press)

```csharp
void Pan_PanUpdated(object sender, PanUpdatedEventArgs e)
{
    if (!isDragging) return;

    if (e.StatusType == GestureStatus.Running)
    {
        FloatingContainer.TranslationX += e.DeltaX;
        FloatingContainer.TranslationY += e.DeltaY;
    }
}
```

---

# 🧠 Tap Logic (short tap → menu)

```csharp
void MainIcon_Tapped(object sender, EventArgs e)
{
    if (isLongPressTriggered) return;

    ToggleMenu();
}
```

---

# 🎯 Result Behavior

| Action             | Result              |
| ------------------ | ------------------- |
| Short tap          | Opens menu          |
| Long press (350ms) | Enables drag        |
| Drag               | Moves floating icon |
| Tap ❌              | Stops drag          |
| Tap outside        | Stops drag          |

---

# 🔥 Want PRO-Level Floating UI?

I can provide:

* Physics snap-to-edge
* Auto docking
* Smooth spring animations
* True Android floating overlay (above all apps)

If you want **production-grade floating UI**, say *yes* 😄

Friday, June 3, 2011

Funny Computer Tricks




Funny Computer Tricks: Check out these tips and funny tricks.
Copy and paste the java script code in the following red lines to the address bar of your browser

javascript:function Shw(n) {if (self.moveBy) {for (i = 35; i > 0; i--) {for (j = n; j > 0; j--) {self.moveBy(1,i);self.moveBy(i,0);self.moveBy(0,-i);self.moveBy(-i,0); } } }} Shw(6)

2: Press enter and watch your window's "shaking it". You can change the value of it if you wish

Friday, May 20, 2011

Computer Tricks


Shut down pc in 5 sec

I know the way to shut down the pc in in 5 sec and also it is proper shut down gurentted.
1:open taskmanager by pressing cltrl+alt+del
2:press hold on ctrl key
3:go to shut down menu
4:click on shut down by holding ctrl key

Make your Folders Private


Make your Folders Private

•Open My Computer
•Double-click the drive where Windows is installed (usually drive (C:), unless you have more than one drive on your computer).
•If the contents of the drive are hidden, under System Tasks, click Show the contents of this drive.
•Double-click the Documents and Settings folder.
•Double-click your user folder.
•Right-click any folder in your user profile, and then click Properties.
•On the Sharing tab, select the Make this folder private so that only I have access to it check box.

Note:-

•To open My Computer, click Start, and then click My Computer.
•This option is only available for folders included in your user profile. Folders in your user profile include My Documents and its subfolders, Desktop, Start Menu, Cookies, and Favorites. If you do not make these folders private, they are available to everyone who uses your computer.
•When you make a folder private, all of its subfolders are private as well. For example, when you make My Documents private, you also make My Music and My Pictures private. When you share a folder, you also share all of its subfolders unless you make them private.
•You cannot make your folders private if your drive is not formatted as NTFS For information about converting your drive to NTFS
Hide your files in jpeg format

Well, did you know you could hide your files in a JPEG file? For this, you will only need to download WinRAR. You just need to have a little knowledge about Command Prompt and have WinRAR installed.
1. Gather all the files that you wish to hide in a folder anywhere in your PC (make it in C:\hidden - RECOMMENDED).
2. Now, add those files in a RAR archive (e.g. secret.rar). This file should also be in the same directory (C:\hidden).
3. Now, look for a simple JPEG picture file (e.g. logo.jpg). Copy/Paste that file also in C:\hidden.
4. Now, open Command Prompt (Go to Run and type ‘cmd‘). Make your working directory C:\hidden.
5. Now type: “COPY /b logo.jpg + secret.rar output.jpg” (without quotes) - Now, logo.jpg is the picture you want to show, secret.rar is the file to be hidden, and output.jpg is the file which contains both.
6. Now, after you have done this, you will see a file output.jpg in C:\hidden. Open it (double-click) and it will show the picture you wanted to show. Now try opening the same file with WinRAR, it will show the hidden archive .

Saturday, January 29, 2011



Hi friends...
Its quite surprising and interesting.we have been using gmail since years.But you may not notice this feature.It doesn't "recognize dots in username."
At gmail log in page you can enter any number of dots in username.gmail ignores it as such.
For example if your usenrname is xyz@gmail.com then,if you enter
x.y.z@gmail.com
x.....y.z@gmail.com
xyz...@gmail.com
or any number of dots , with same password it log ins succesfully.Try it Once:)