Inspired by a tweet by @gokulr, I tried continuing the chat a bit further. The first two questions are similar to the ones by him.
Tuesday, April 18, 2023
Monday, April 10, 2023
FIX - Touchpad issue on HP Pavilion x360 convertible 14 with Windows 11
My HP Pavilion x360 laptop with Windows 11 had a nasty touchpad issue last week. The touchpad stopped working suddenly after the laptop was unlocked or came out of hibernation. It worked when OS was restarted, but soon thereafter it kept on getting disabled. Even the Bluetooth and other devices -> Touchpad option was gone. There was no Touchpad enabling option anywhere in the system. Had to use the touchscreen for navigation as the pointer/cursor also vanished when this used to happen. Searched all over the web with no solution... until today.
Found a fix that seems to be working with no vanishing touchpad issues anymore. It is simple on this system.
Go to device manager -> Human Interface Devices
Among the two I2C drivers, one icon was showing issue. Tried disabling and enabling using right click ...but it didn't solve the issue. Then uninstalled that driver and rebooted. It gets reinstalled on reboot, and the annoying issue is finally resolved.
If the above process does not work, then try this:
First disable I2C HID Device, then Disable HP-compliant system controller, then enable I2C HID Device. It works for me! 🙌
Thursday, March 30, 2023
Critical section code
Many students of Operating Systems get confused on some simple concepts such as critical section. Instead of memorizing the definition of critical section, it is better to understand it with the help of a simple example.
Suppose there is a global variable that may be accessed (i.e. read/write) by two or more threads at the same time, then the part where the two threads read/write the value of the variable needs protection. It simply means that only one thread should be able to read or update the value at a time. Otherwise, the value of the variable may end up wrong. Let us understand this problem with an example:
Let's say there is a global variable int x (with initial value 0)
Now, if you want to increment the value of the global variable two times using two threads T1 and T2. the expected value of x at the end of two increments is 2.
Now the following sequence of event may happen (with the action result after the --> ):
T1 reads value of x --> reads 0
T2 reads value of x --> reads 0
T1 increments x --- > x becomes 1
T2 increments x --- > x becomes 1 because T2 had also read 0
So, the final value of global variable x is 1, not 2. This was not what was expected. The part of the code where the two threads accessed the value of x is a critical section that needs protection.
As mentioned earlier, the critical section needs to be protected from simultaneous access by multiple threads. Mutex is a simple locking mechanism to do that. A mutex is nothing but a lock. Before entering the critical code, a thread must acquire the lock. If the lock is unavailable, the thread must wait (it is blocked). A lock is unavailable when some other thread has already acquired the lock. When the other thread goes out of critical section code, it must release the lock (unlock). The waiting thread can then enter the critical section. The above sequence of events then becomes:
T1 request the lock --> acquires lock
T1 reads value of x --> reads 0
T2 requests the lock --> blocks
T1 increments x --- > x becomes 1
reads value of x --> reads 1
T1 increments x --- > x becomes 2
Thursday, March 23, 2023
Resources to learn NLP
Q. Which youtube videos and blogs should I start with to learn NLP?
ChatGPT answers:
There are many great YouTube videos and blogs that can help you get started with learning Natural Language Processing (NLP). Here are a few resources to consider:
- YouTube Channels:
- Natural Language Processing with Python by sentdex
- NLP Tutorial using Python NLTK (Natural Language Toolkit) by Edureka
- Deep Learning for Natural Language Processing by Stanford University
- Blogs:
- The Natural Language Processing Blog (https://nlpprogress.com/)
- Towards Data Science (https://towardsdatascience.com/tagged/nlp)
- NLP for Hackers (https://nlpforhackers.io/)
- Courses:
- Natural Language Processing with Python on Udemy
- Applied Natural Language Processing on Coursera by University of Michigan
- Deep Learning for Natural Language Processing on Coursera by National Research University of Higher School of Economics
It's important to note that NLP is a vast field with many different sub-topics and techniques. It may be helpful to start with an introductory course or tutorial to gain a broad understanding of the field, and then dive deeper into specific topics that interest you. Good luck with your NLP learning journey!
Steps to install PyTorch on VMware workstation (Ubuntu guest)
The following is the list of steps to install pytorch 2.0 in VMware workstation (Ubuntu guest): $ mkdir ~/pytorch $ mkdir ~/pytorch/as...
-
Recently one of my computers' Linux partition was deleted by mistake. As the Linux partition held the multi-boot information, it made th...
-
Most wannabe geeks would say Linux, though it is just a kernel and not an OS. Some would answer Ubuntu or Gentoo depending on which is the &...
-
Here is a probabilistic solution to the two General's problem; it gives a high probability of succcess if the number of messages(messeng...