Tuesday, July 30, 2024

An exception of type 'System.DllNotFoundException' occurred in System.Data.SQLite.dll but was not handled in user code Additional information: Unable to load DLL 'SQLite.Interop.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

folders named X64 and X86 Copy "SQLite.Interop.dll" to both folders after creating them inside the release or debug folders. 

Deprecation Listener added for a 'DOMSubtreeModified' mutation event. Support for this event type has been removed, and this event will no longer be fired. See chromestatus com/feature/5083947249172480 for more information.

[Deprecation] Listener added for a 'DOMSubtreeModified' mutation event. Support for this event type has been removed, and this event will no longer be fired. See https://chromestatus.com/feature/5083947249172480 for more information. 

old code
 $('.lg-map-text').bind("DOMSubtreeModified", function () {

           if ($('.lg-map-text').text() != "") {

                var getHtml = $('.lg-map-text');

              var state = getHtml["0"].children[1].value;

               if (state != undefined) {

                    GetDescription(state);

                    $('html, body').animate({

                        scrollTop: $('.whitesec').offset().top

                    }, 800

            );

                }

           }

        });


new changes 

// Function to be called when the mutation is observed

function onMutation(mutationsList, observer) {

    // Iterate through all mutations

    for (let mutation of mutationsList) {

        // Check if the mutation is a change to the text content

        if (mutation.type === 'childList' || mutation.type === 'subtree') {

            // Check if the element has text content

            if ($('.lg-map-text').text() != "") {

                var getHtml = $('.lg-map-text');

                var state = getHtml[0].children[1].value;

                if (state != undefined) {

                    GetDescription(state);

                    $('html, body').animate({

                        scrollTop: $('.whitesec').offset().top

                    }, 800);

                }

            }

        }

    }

}


// Select the target node

var targetNode = document.querySelector('.lg-map-text');


// Create a new MutationObserver instance and pass the callback function

var observer = new MutationObserver(onMutation);


// Options for the observer (which mutations to observe)

var config = { childList: true, subtree: true };


// Start observing the target node for configured mutations

observer.observe(targetNode, config);


Sunday, July 28, 2024

differences between an abstract class and an interface in C#

 The main differences between an abstract class and an interface in C# are as follows:


1. **Instantiation**: An abstract class cannot be instantiated on its own, while an interface cannot be instantiated at all. Abstract classes are designed to be base classes that provide a common definition for derived classes, while interfaces define a contract that implementing classes must adhere to.


2. **Implementation**: An abstract class can have both abstract and non-abstract methods, allowing it to provide a partial implementation of its members. In contrast, an interface can only have method signatures without any implementation. Implementing classes must provide the implementation for all interface members.


3. **Inheritance**: A class can inherit from only one abstract class, but it can implement multiple interfaces. This allows for a form of multiple inheritance through interfaces, where a class can inherit behavior from multiple sources.


4. **Access Modifiers**: Abstract classes can have access modifiers (e.g., public, private, protected) that provide fine-grained control over their members. Interfaces, on the other hand, have public access by default and cannot specify different access modifiers for their members.


Here's an example to illustrate the difference:


```csharp

// Abstract class

public abstract class Animal

{

    public abstract void MakeSound();


    public void Sleep()

    {

        Console.WriteLine("Zzzz...");

    }

}


// Interface

public interface IJumpable

{

    void Jump();

}


// Derived class implementing an abstract class and an interface

public class Cat : Animal, IJumpable

{

    public override void MakeSound()

    {

        Console.WriteLine("Meow!");

    }


    public void Jump()

    {

        Console.WriteLine("Jumping high!");

    }

}


// Usage

public static void Main()

{

    Cat cat = new Cat();

    cat.MakeSound(); // Output: Meow!

    cat.Sleep(); // Output: Zzzz...

    cat.Jump(); // Output: Jumping high!

}

```


In the example above, the `Animal` class is an abstract class that provides a partial implementation of the `MakeSound` method and a non-abstract `Sleep` method. The `IJumpable` interface defines the `Jump` method. The `Cat` class inherits from the `Animal` class and implements the `IJumpable` interface, providing the necessary implementations for all the inherited members.


I hope this example helps clarify the difference between abstract classes and interfaces in C#. Let me know if you have any further questions!