Article published on GeeksforGeeks

Always we prefer GeeksforGeeks to to get the solution of our problems, exploring new articles in the field of technology. One day I was thinking and searching how to write an article and contribute to geeksforgeeks.

While searching I got the way to contribute and pick the article from their suggestion list. There are various conditions while writing the article like, there should be no plagiarism, English should be prefect, no grammarly mistakes, etc.

I select the topic “How to set the CLASSPATH in Java”, and start writing on it. I was enjoying while writing the article on the new thing. I think it is a good way to explore more about the new things while writing the artciles. It takes one week in the reviewing process.

And finally my article was published on the site. πŸ™‚

Here is the link: https://www.geeksforgeeks.org/how-to-set-classpath-in-java/

Mouse Settings in Haiku

One day ago I tried to compile the latest code of haiku because on my side the mouse settings was not working differently for different mouses.

When I run the command “jam -q -j2 @nightly-raw”, with this command I got the error “jam command not found” which I was already installed in the haiku using command “pkgman install jam”. Then, what I did was I accessed the haiku partition from qemu in linux and replace the packages of haiku partition with “boot/system/packages”. I build the haiku using the command below

” ../configure –cross-tools-source ../../buildtools–build-cross-tools x86_64″

But again, I was facing the following error,

Before that I fetched the latest code of haiku using “git fetch” and “git pull origin master”. Then, I tried to compile the code of haiku and got the above error and post a mail in the haiku development list. I got the reply from the community member. I started the haiku to give a try to his solution. Suddenly, I noticed the mouse speed was very slow, I opened the preferences panel and adjust the mouse speed for both the mouses. Then, I noticed the code is now working on my side too. I think it was not running because of old code. πŸ™‚

30 days with Google Cloud

From the past many days I was solving the challenges of Google Cloud (Google Cloud Platform, offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, file storage, and YouTube). In the past days I solved 3 challenges names as:

1. Getting Started: Create and Manage Cloud Resources: Challenge Lab : In these labs we will get to know how to use basic features of google cloud like Projects, Resources, IAM Users, Roles, Permissions, APIs, and Cloud Shell.

2. Perform Foundational Infrastructure Tasks in Google Cloud: In these labs we get to know how to perform basic tasks in Cloud Storage using the Google Cloud Console, IAM unifies access control for Cloud Platform services into a single system to present a consistent set of operations, how to monitor a Google Compute Engine virtual machine (VM) instance with Cloud Monitoring, how to create and deploy a Cloud Function using the Cloud Platform Command Line, how to publish and consume messages with a pull subscriber, using the Google Cloud command line.

3. Setup and Configure a Cloud Environment in Google Cloud: In these labs we get to know fundamental SQL clauses and will get hands on practice running structured queries on BigQuery and Cloud SQL, how to create several VPC networks and VM instances and test connectivity across networks, how to launch a service using Deployment Manager, and monitor it using Cloud Monitoring. You will set up basic black box monitoring with Cloud Monitoring Dashboard and establish uptime check alert notification to trigger incident response.

And also, I am doing the online course names as “The joy of python computing from NPTEL”. As this is mandatory for 6 months training students to enroll one course and I choose this one because I want to get familiar with the python also.

In which I learned the basic of python and made the small programs, completing the assignments by my own and got the good marks also.

Also this is the month of Hactoberfest and as usual I am also the part of this contest this year too. So, trying to do some meaning full contribution this year.

In the meanwhile I am preparing for aptitude test also, so many placement drives comes to our college like Infosys, amazon, TCS, etc. πŸ™‚

Haiku is not compiling!

One of my GSoC task which is to set the mouse configurations for each mouse separately is now working on my mentor’s side but not on my side.

The code gets merged to master. On my side, I think some old files are still running on the back end of the new code. So, to make sure this I deleted the files and checked out the all-new code of haiku using “git pull origin master”.

After pulling the code, I needed to compile the haiku code, to get the latest updates using the command: “jam -q -j2 @nightly-raw/anyboot”
And getting the error as shown in the picture.

This image has an empty alt attribute; its file name is errors.png


I also drop a mail regarding this issue in the community mailing list but didn’t find any solution for it.
The second way I was tried because the issue is regarding the packages installed. I removed all the packages and replace the partition packages with the default packages which was present in the “/boot/system”
Restart the haiku, configured it, and install the necessary packages like jam, nasm, bison, flex again. But still when I tried to compile it, getting the same error.

Yesterday I found the issue on the haiku trac which is to set a button named as Disable Touchpad, by which the user can manually stop the touchpad when the mouse is attached with the laptop. At the time of outreachy I did this thing but in that, I just disable the touchpad settings when it is not connected. Now, I have to stop the working of the touchpad. So working on that.
In the meanwhile, I am also doing the C++programs on the HackerRank to polish my C++ skill. When I get bored from these two works I use flutter to make an app. πŸ™‚

GSoC 2020 Final Report

This is the final report of the GSoC 2020 project

The proposal is available here:

Work Done:
  • Added the icons for each connected device in the input preferences application.
  • Removed the unwanted devices from the device list when they are not connected to the computer.
  • Improved the look of 4th and 5th button of the mouse and added the 6th button of the mouse and its working.
  • Made the Joystick GUI.
  • Made the Wacom tablet GUI.
  • Implemented the input preferences to hold settings for each mouse separately.
Commits:

https://review.haiku-os.org/q/owner:preetpalok123%2540gmail.com

Weekly Blogs:

https://preetpalk.wordpress.com/

Work TO DO:
  • Implement the settings of Joystick.
  • Implement the working of a Wacom tablet.
  • Implement the settings of each mouse from the back end.
Struggles:

During the implementation of icons in the device list, I got the example from the media application and added the icons.

To add the 6th button of the mouse, I got the example from the other mouse buttons.

Implementation of mouse settings separately takes the time and it’s still in process. There is no example where I can get the idea. It is the research work for me.

I used the mapping concept to store the settings for each mouse with its name and is working fine on the GUI basis. Back end implementation is time-consuming. I am one step behind to the solution because I am unable to get the names of the mice in the input server. If I get the names some how it’s in the binary format!

While trying to solve this issue, if there is something happens wrong in the code the mouse and the keyboard stops working. To test the code each time I have to made the package and reboot the haiku. With that, the old packages also stops working due to the fault in the kernel.

Each time I have to need to re-install the haiku from the CD. It’s not enough while booting the haiku from CD, it shows the debugger window because of kernel fault and unable to install it.

For the above issue, If I access the haiku from Linux, the Linux does not know how to write on haiku!

The last option is to use qemu. I accessed the haiku partition from the haiku installed in the qemu and replaced the packages from /system/packages with /boot/system/packages. After doing this, the haiku runs successfully. I need to re-build it and installed the packages, again the time-consuming task.

While trying to resolve the issue, I don’t know whether the debugger window opens or not due to the changes added by me. Till now, I have to repeat the above steps about 5 times.

At the time of the timeline, I did not expected these type of issues. 😦

I have learnt so many new things in these three months about haiku and git.

I am also working with haiku after GSoC as a part of my 6 months of industrial training. And also try to complete my project. πŸ™‚

Thankyou πŸ™‚

Did not get the mouse names!

Still the mouse names are not getting printed in the logs. Even, I tried to print the age as a variable and assigned value 4 to it. Then, I tried to print it in the logs but , the garbage value is coming in both MouseSettings and Input Server files in the server side. InterfaceDefs connects the MouseSettings and the InputServer. The names are getting printed on the interface defs but not on the other side.

Now, I have no clue how to print the names. It is not possible to resolve the bug until I get the names printed.

With the hep of logs I came to know there was just one object of MouseSettings in the server side. Suppose if we connect the two mices, the settings get stored only for one because, the control runs the once. At the time of the second mouse it just find its name and stop. The control did not goes to the settings to save the current settings so , it becomes defaults.

Need help!! 😦

Set up Haiku again!

So, in my last blog, I write about nothing is working in haiku even Haiku is not started.

Yesterday I set up the Haiku again finally! πŸ™‚

I was trying to install it again from the DVD, but when I booted haiku from it the debugger window comes again, which is due to the errors in the kernel.

I got frustrated at that time because there is no progress in the work due to these type of things happening and I don’t know any solution for that. Then, I access the haiku partition from the haiku which is running in the qemu by following the command:

“qemu-system-x86_64 -hda haiku-nightly-anyboot.iso -accel kvm -m 512M -usbdevice mouse -hdb /dev/sda4”

where “/dev/sda4” refers to the name of the partition and “-usbdevice mouse” refers to the usb device which will be shown in the haiku also in the input preferences application.

photo_2020-08-09_20-37-52

I mount the haiku partition in qemu but I did not get the code and other things that were in the haiku before! After taking help from PulkoMandy I found the Haiku icons were placed on each other. :p

When I accessed the partition I resolve the issue in the input server due to which the debugger window comes. I made the package again and run that. But still, the debugger window was coming.

Then, Pulkomandy told me to replace theΒ  ” /Haiku1/system/packages” with ” /boot/system/packages” in its place. After replacing, the haiku comes to the real state and starts without a debugger. πŸ™‚

But, I removed the packages from the haiku. So, when I tried to jam the code. I was getting the error “jam command was not found!”

To resolve that I need to build the haiku again and for that, I used this link below:

https://www.haiku-os.org/guides/building/

Then, again I was getting the errors, “jam was not found, nasm was not found”

photo_2020-08-10_14-00-06

To resolve that I used “pkgman install cmd:gcc”, “pkgman install jam”Β  and “pkgman install nasm”.

Before I jam the whole haiku once, also face one more error.

Screenshot from 2020-08-11 23-27-06

I need to install more packages, which were installed by using these commands:

“rm -rf /system/packages/administrative/transaction-*”
“pkgman full-sync”
“pkgman install haiku_devel”
“reboot”

Finally, it starts without any error and I jam the whole haiku once again. πŸ™‚

Today the guest arrived at our home, So will start work tomorrow.

Nothing is working :(

In the past days, I was trying to print the names of the mouses in the Syslog by writing the Syslog statement in the input server-side. But, I was getting the names in the binary format. Which means the code was storing the names of the mouses with its settings.

binary_format

binary_conversion

In the input preferences side, the names and the settings were getting stored and printed as shown below:

interface_Defs

The settings were stored for each mouse and get retrieved also.

To make sure the server code was working I was trying to print the names. Then, I send the commit to Gerrit to review and find the reason why I was getting the binary format.

My mentor told me to split the commit into small parts. To do this, I first checked out the code into the branch, then I made the branches inside from each and split the code, send the commit. So, others can easily review it.

My mentor made a few changes in the code, I checked out that from Gerrit. According to him now the settings should be work! But, he forgets to take a USB mouse with him at his parent’s place.

He made the comments in the code, I was dealing with that. I made changes to solve those comments. When I made a package to test the settings the debugger window comes again. I know where is the error now. But, have no way to solve it. The debugger window comes the keyboard, mouse both are not working now. Also, the old packages are not working due to kernel.

pckage_stooped

Pulko suggests me to install the haiku again. I have a graphic card problem with my laptop and not easy for me to install it. Then, he told me to solve this issue which is to enable failsafe graphics drive in the haiku bootloader and edit the kernel settings to make it permanent.

Yesterday night, when I was trying to install the haiku form DVD. I saw the DVD tray is not coming out. I tried it manually and with the command “eject” also. But, nothing is working now.

The second option I have was to mount the haiku partition in ubuntu and to test the code use qemu. I mount the partition but, it is the read-only mode and the ubuntu does not know how to write to the haiku filesystem. I take the backup in the ubuntu.

error

Today is Sunday, the shop is closed. 😦

I split the code into the branches, then checked out the latest changes made by Pulko. I saw the code in the first branch does not show in the second branch. I searched on the internet and find I have to keep rebase each branch with its parent branch.

Like I have made the branches like A -> B -> C…

To get the branch A code in the B I need to rebase it like go to branch B, using “git checkout B” and run the command “git rebase A”. Now, we are rebasing the code of A into B and vice-versa.

After that, when I was sending the commit to Gerrit, I face an error due to multiple commits have the same commit id. To solve this, I need to squash the commit which has the same commit id.

Eg: the commits are in the form A -> B -> C ->D…

I need to squash A and D. To do this I run the following commands:

“git -i HEAD~N where N = 4”

Now the commit are like:

pick A

pick B

pick C

pick D

we need to squash A and D, for that we change the sequence of the commits like:

pick A

squash D

pick B

pick C

Now, using squash the A and D will be squashed and the B and C will remain as it is. πŸ™‚

Then, the terminal window open in which we have to select which commit message we have to take commit 1 or commit 2 and the change id also.

 

 

 

 

Debugger window opens!

From yesterday I was trying to figure out my work but, didn’t get any output. The package was not installed, I was getting the error shown in the picture.

error

Then, I find out this error is because I didn’t update the code from the origin master.

By the following commands, the problem gets solved.

  • git fetch –prune

git fetch –prune is the best utility for cleaning outdated branches. It will connect to a shared remote repository remote and fetch all remote branch refs. It will then delete remote refs that are no longer in use on the remote repository

  • git rebase origin master

This command is used to rebase the current branch with the master to get the latest commit from the master.

While rebase I got the conflicts in the file /src/preferences/input/MouseSettings.cpp

I solved those conflicts manually and then, add it which tells the git the particular conflicts are resolved now.

Basically, the conflicts occur when we try to overwrite the file, like to overwrite the data on data. At that time the git confuses which data has to take and which not.

Then, I build the package again, install it when I run the input preferences and try to change the mouse type, the debugger window opens, after killing it. The mouse hangs and stops working. I didn’t know why it’s coming!

I also tried to save the report using “save-report” command in the debugger and little bit find out the error is in input_server files. I tried to hit and trial method to get rid of debugger but it’s not. 😦

Today, first I changed all the logs in all the files means I write the log which makes some sense and easy to find using the “grep” command.

I send the commit to Gerrit today and now waiting for replies. I tried every logic that comes to my mind but still unable to resolve this mouse configuration issue.

I have also learnt new commands in git.

  • git show <branch-name>: path/to/file

This command is used when the user wants to read the file from another branch from the current branch.

  • git checkout <branch-name> path/to/file

This command is used when the user wantsΒ  to copy the file from another branch to the current branch.

  • git rebase ~iHEADN

The above command is used when the user wants to squash the several commits to one commit. Where N means the number of commits the user wants to commit.

After applying the command the editor open, where all the commits are written with the word “pick”. Replace the “pick” with squash for those commits which we want to squash.

Well, I explained the squash concept in just a small sentence. But, when I was dealing with it I made three new branches because I was using it for the first time. First and the second try was not successful. Finally, in the third try, I squash my commits in one.

Also, its advice to keep the latest code in your branch to get rid of silly errors. πŸ™‚

 

 

 

 

Tracer crashed!

While working, when I changed the code to solve the bug, I made a package to compile all the changes. Made the package, install it and then, restart the laptop to check the new haiku. Suddenly, the tracer crashed, nothing is working in the new haiku.

First I understand the flow of code by writing it on the copy.

2020-07-23

GUI -> InputWindow.h ->InputMouse.h -> InterfaceDefs.h -> InputServer.h

This is the complete workflow of code. I have printed so many logs in the code to check the flow of each file like when the particular function called. But, I was unable to test it because the tracer crashed, nothing was working in the new package.

I send the patch to the Gerrit for review, PulkoMandy reviewed it and he was gettings the error while compiling the code.

photo_2020-07-23_11-15-16

One error was removed by replacing the %d with the B_PRIdint32 while printing the integer value. And the second one is because I have two files with the name MouseSettings.h on two different paths. The server is confusing while file it has to take. So, to resolve this I keep the one file in the headers/private/input and remove the MoseSettings.h from src/preferences/input. And give its path to the Jamfile of the input preferences code.

The error resolved. PulkoMandy tests the output on another haiku, but I do not have another haiku installed on my system. Logs were printed in his side.

He suggests me other ways to test the output using ‘ssh’, qmeu, download haiku in the pen drive for testing.

What I did I have a very old laptop of my brother, its screen, keyboard, mouse nothing was working on that laptop. I attached the TV screen, USB mouse, keyboard to use it and to see the output logs.

Current setup:

WhatsApp Image 2020-07-21 at 5.49.42 PM

So, what I have done in the code was, currently, the code is just for one mouse, when the setting of another mouse comes, it gets overwritten.

I made a tow different functions in the InputfaceDefs.h get_multiple_mouse_type and set_multiple_mouse_type. In which they will get the mouse_name with the mouse type value. Each mouse has a type value which gets stored in it with its name to keep them unique.

I replaced get_mouse_type and set_mouse_type with get_multiple_mouse_type and set_multiple_mouse_type in the MouseSettings.cpp. Because we were storing the types of different mouses.

In the InputServer.h file, I have made a function which will return the MouseSettings.

MouseSettings*

InputServer:: GetMouseSettings(BString mouse_name)

This function will check if the name of the mouse is stored previously in the data then, it will retrieved its settings otherwise it will point to new. I made an object of MultipleMouseSettings class which is present in the MouseSettings.cpp. Using this class I checking the stored and retrieve back the settings.

To test this I have printed some logs inside the functions but they are not getting printed!!!

At night I was sending the code to the Gerrit but, it’s not uploaded. SO, today I will send the commit again so, others can also view what I did.

I got the reply to why the tracer is crashed:

The main problem is that reusing MouseSettings.cpp in input_server, it’s trying to get the current values from itself. So the part of the code that talks to input_server (using get_mouse_map and the other functions from InterfaceDefs) must be used only in Input preferences.

Now, I don’t know how to remove these functions So, today I have fixed a video col meeting with my mentor to come out of this.

Hope so, will complete this work soon!!!

I attended the meeting with PulkoMandy from 9:00 pm to 11:00 pm.Β  In which first I explain the changes what I have made briefly the logic which I have used. He pulls the code in his system and build it and run it before the meeting start.

On my side when the tracer crashed nothing is working, but on his side, the mouse is working because he is using the table mouse. So, it is easy to debug the code using the debugger. We find the error in the get_mouse_map status. It is calling itself, again and again, to get the value that’s why the haiku becomes slow and crashed.

To resolve this error, he made the changes in the src/add-ons/input_server/filters/shortcut_catcher/KeyInfos.cpp. Basically, to add the NULL check to take it out from the code. Because get_mouse_map() is returning the NULL. To take this out from the code NULL check is necessary.

Now, the tracer error is not more. But, he comments the _RetrieveSettings code for sometimes, by this now the mouse is moving but not working. Like not function is now called/working.Β  While trying to solve the error, his mouse is also stopped working. He is using haiku in qmeu (QEMU is a hosted virtual machine monitor: it emulates the machine’s processor through dynamic binary translation and provides a set of different hardware and device models for the machine, enabling it to run a variety of guest operating systems.) and able to see the logs, From where he came to know, that the logs that I have printed in the functions to debug are not written which means those functions are not be called.

One thing I didn’t understand and also forget to ask him like we are making the two objects of MouseSettings, in the InputMouse.cpp and in the InputServer and in between there is an InterfaceDefs.h to make a sing between the two objects. Where the code flow after reaching to the InputServer.h?

After keep on trying we thought to continue the meeting tomorrow, till then, both will try to solve the error above.

 

 

 

 

Create a free website or blog at WordPress.com.

Up ↑