Monday, November 29, 2021

Adding disk space to Linux VM in Parallels Desktop

 This is a two step project:


Step 1:  Get the storage

Step 2: Allocate it/make it known to the Linux VM


Step 1: 

Shut down the Linux VM

Use information here to assign more storage to the Linux VM

https://www.parallels.com/blogs/resize-your-parallels-desktop-vm/


Step 2:

Use gparted to add the additional storage to the Linux VM partition

Download the amd64 gparted from here https://gparted.org/download.php

Change the boot order to boot from CD/DVD

Set the DVD to point to the location of the iso file.




Tuesday, November 16, 2021

gnutools-gcc: dump switch

 #gcc #debugging 

details appended to fdump-rtl-pass generates messages during RTL transformations for the pass
for example:
-fdump-rtl-expand-details
produces gimple inline with its matching RTL, as well as messages on optimizations happening during expand pass.
output:

;; Generating RTL for gimple basic block 2


;; moveTo_state = 0;


(insn 10 9 0 (set (mem/c:SI (symbol_ref:SI ("|bss|moveTo_state") [flags 0x6] <var_decl 0x10382c630 moveTo_state>) [1 moveTo_state+0 S4 A32])

(const_int 0 [0])) "../library/PcCut/pccut.c":287 -1

(nil))

if some optimization doesn't react to adding details check if the pass uses TDF_DETAILS 
TDF_DETAILS is implemented in dumpfile.c


gnutools: learning resources

I have been working on GNU toolchain for about two years now.  I have worked on target ports, code upgrades, feature development and bug fixes in a target backend.

GCC has an internal document, gccint, but much of it is kept very high level.  

Developers can learn through seeing the results of an optimization, to assist a list of optimization switches and their description is provided, GCC developer-options.

In this space I intend to expand on these resources.

The information here is to augment the already in place resources highlighter above.

Tuesday, September 07, 2021

Do you expect to catch the cold and flu this year? fall - winter 2021

 Last time a cough kept me all night was 2018.  Per conversation on the social media (take it with a grain of salt --as anyone can be or do anything in the virtual world) I am not the only one who has not needed a good rest, a bowl of soup, hot tea and etc to get over a cold.

Lockdowns, masks, handwashing, they say is the reason we are getting as sick as often.  

I got my vaccines, and merely got tired a bit of a headache after both shots.

I was quite surprised when it took me three weeks to get over a cold.

I got it in early August.  It started with soar throat, and I developed a cough before I started sneezing.  Three days into it, and thick yellowish phlegm was pouring out of my nose, and mouth.  I was sleeping upright, and that only allowed for a few hours of shut eye.

It was pretty bad and pretty long.

When I told a friend that I am three weeks into a cold and I still feel under the weather, her response of 'that's strange' prompted me to look into the reason it being so drawn out.

I found a very good article online, on WebMD website on the topic.  It made a lot of sense.  To summarize: rest, stay hydrated, and manage symptoms were the key messages.

I failed in all three.

I cannot rest because I am a mom.  I was getting fluids on demand and it was by no means enough.  I was too wary of over the counter medication, e.g. Tylenol, because it is only a temp fix, and once they wear off the problems come back.

I learned, and I am documenting it here, because I have a feeling I need to remind myself these this year.  (I think there will be more germs and they will spread more this year (2021).  We are mingling more and our immune system has been out of practice for 18 months)

I learned to take the drugs soon after onset of the first symptoms, this to give my body chance to get the rest.  They say sleep boost the function of out immune system.

I learned to drink as much fluid as possible.

I also learned that gargling with salt water solution helps if done often and regularly.  

Since I am a mom, and I don't have a helping hand, I have been thinking of how could I avoid getting sick, or get the milder version of it.  These are things I have come up with:

Vitamin c intake (via food and supplement)

Vitamin D intake (sunshine and supplement

Drink a lot of water in the day and pee often (no holding! happens quite often being busy:)

Have a restful sleep - sleep on time, and don't wake up too early

Exercise, walk, yoga and pilates


That's it for now. :)

Wednesday, May 19, 2021

Preventing cancer : reducing the risks by Beliveau, Richard

I copied and pasted the below from the summary provided for the "Preventing Cancer, reducing the risks" by Beliveau, Richard


I have seen family, and friends fight the disease.  Nothing in life compares to or prepares one for it.  One day you are living as much of a normal life as possible and then cancer happens.  It puts every little aspect of one's life in a different perspective.  I don't know where I am going with all this.  Perhaps the honest truth is that I want to minimize my risk, and so here comes the next bit.  


These recommendations are from a book summary.  The books is called "Preventing cancer: reducing the risks".  It's by Richard Beliveau.  


I put them here, because I want to have them somewhere I can refer to them easily and frequently.

 

"The ten recommendations to preventing cancer are: 

1. Don't smoke. 

2. Stay as lean as possible. 

3. Limit the consumption of red meat to about one pound per week. Also helpful, marinate red meat in virgin olive oil with garlic and lemon juice or herbs like thyme or rosemary; add turmeric or related spices to ground beef. 

4. Eat a variety of fruits, vegetables, pulses (like lentils) and whole grains. Eat "superfoods" like green tea, blueberries, crucifers, garlic and tomatoes. 

5. Be physically active for at least 30 minutes every day. 

6. Limit daily alcohol consumption to two glasses for men and one for women. Better yet, drink red wine and even better, drink red pinot noir. Also, avoid mouthwash with alcohol.

 7. Limit consumption of salt. Use spices, especially Indian spices like turmeric. 

8. Avoid unnecessary sun exposure. 

9. For extra protection, vaccinate girls against HPV. Breastfeed for six months, avoid pollution and nanomaterials, get eight hours' sleep. 

10. Do not use supplements to prevent cancer." 

Thursday, May 13, 2021

Fixing network issue in VM machine running Windows 10 running in Parallels Desktop on Mac

 I have a VM setup in Parallels Desktop on my Mac.  The VM is running Windows 10 OS.  My internet connection works fine on my Mac; more expilicity I can browse the public and private domains, no problem!  


But in Windows VM, I have problems.  I am not able to get to private domains.  My VM is configured in Shared Network and I am connected to VPN on my Mac.  So, I should be able to use the VPN connection with my VM if its Network is Configured in Shared mode.  Which is, screenshot below.



However, I am not able to get to anything via the domain name.  e.g. in DOS command ping parallels.com times out.  

I can access domains via their IP but not their hostname.

Everything is pointing to DNS server not being working properly.  

On Parallels' Knowledge Base this problem is documented as: "

Unable to perform DNS requests over TCP in Shared network"

I include link to this page, as well as to all other pages on Internet that helped me debug and resolve the problem.  Unfortunately, it was not one stop shop.

I was on an older version of Parallels Desktop for Business Edition so, I 'Uninstalled' Parallels tool from  my VM, by going to Control Panel > Uninstall a Program.  After a complete reboot, I reinstalled the Parallels Tools.  Then I tried the ping command again.  Still not responding.  

I found another article: "

Network Troubleshooting your Parallels Desktop VM"


And compared the output of ipconfig /all run on my system with what was documented here.  All the information, the suggested IP, and the DNS servers matched what it is supposed to be in Shared Network configuration.

So, I decided to try the second suggestion from the first article.  "
  1. Assign DNS server manually in Windows network settings."

To do so: I did the following (which was recommendation from a colleague).  I have crossed out the DNS addresses and DNS suffixes, because this information is unique.


After doing above, my problem got resolved. 

I reinstalled the Parallels tools.  But, maybe all I needed to do, was to do the last step, that is manually assign the DNS servers. 

References:

 


Thursday, April 22, 2021

Python 2.7, its last release, its end of life, and how to transition to Python 3

 Python 2.7.18 is the last release of Python 2.

As of January 1st, 2020 no new bug reports, fixes, or changes will be made to Python 2, and Python 2 is no longer supported.

Python 3, is not backward compatible.  python.org suggest running 2to3 tool to automatically convert Python 2 to Python 3.

Here is an example:  

The ConfigParser module has been renamed to configparser in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3.

ref: https://docs.python.org/2/library/configparser.html


Tuesday, March 30, 2021

Floating point number madness

 We'd like to represent floating point numbers in binary format.


The IEEE 754 format uses the 32-bit to encode a single precision floating point number as follow.


31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

|    |___Exponent________| |_____________Fraction___________________________|

Sign         



Normal: There is a one to the left of the fraction.   

                     (-1)S   x 1.x2e-127

Signed Zero:  Exponent=0 Fraction=0    

                     (-1)S  x 0

Subnormal/Denormal: Exponent=0 shifted by 1 But considering all the fraction values between 0 & 1  

                     (-1)S  x 0.f x 2-126

Infinity pos/neg Exponent=255 Fraction=0

                      (-1)S oo

NaN Exponent = 255 Fraction!=0

                       (-1)S   if b22=0 qNaN 

                                 if b22=1 sNan

b22 is bit 22nd of the Fraction 

Thursday, January 28, 2021

Vaccines, stay-at-home how to survive another year of COVID19 pandemic!

 We have been in lockdown since December 26, 2020, and an additional "stay-at-home" order since January 12, 2021.  The schools have been shut down since the break for holiday season.  


The government started administering vaccines begining December 15, 2020.  


The numbers are coming down.  In my city the average weekly new cases are in the 1500/day.


Is it due to vaccines or due to people staying-at-home?


It's more likely to be from people staying-at-home, and more specifically children staying at home.  Prior to the schools closing, there were outbreaks* at about 150+ schools in the province of Ontario.  These contributed to the increase in the transmission in the community.  


The lock-downs/stay-at-home cannot be a long term solution.  Vaccine is being rolled out at a snail pace, and it's about to get slower as companies are re-thinking distribution and countries are thinking of new policies around vaccine distribution.


Vaccines are showing some flaws.  Given the speed they were developed and approved, it doesn't surprise me that they have side-effects, and one may still get it even after being fully vaccinated*.  In addition new variants of the virus, which are more transmissible and more deadly are popping up.


When it started a year ago around this time, I admit, it threw me off balance so much that all I could care of was to be able to pass one more day without getting it.  When the numbers started going down last summer, I had a glimmer of hope that maybe the virus has taken its course and it's dying out on its own, sort of like Spanish Flu.  Things are different now.  


The measures in place, plus the new variants paint a depressing picture.  How and when can we go back to living again?


I definitely don't know the answer today.  

 

*Outbreak: 2 or more cases of COVID-19 positive within 14 days. 

*Fully vaccinated: both shots administered