Recently, I found CPU usage stagnating at 100%. Task manager showed that aggregated CPU usage of all my processes consumed was much less than that. Check processes owned by all users, I found WDFME.exe consuming CPU heavily. It seemed quite unnecessary as my hard disk is of Seagate and the "WD" in the name suggested "Western Digital". So, I killed it. It is essentially the software that comes along with Western digital external hard drives. As it turns out, it is not necessary and it a known resource hog.
Here I write about various events I was involved in and ideas that inspired me. Recently, it is more of a linux blog because I have been doing a lot of work on it. However, off and on I write on various other things that my mind just can't let go easily.
Monday, 27 July 2015
Wednesday, 22 July 2015
Concatenating wide character strings
Today I was looking at concatenating multiple wide character strings. I was dealing with PWSTRs. As it turns out, I needed to use wstring to do it. The following code illustrates the method.
std::wstring mywstring(mystring);
std::wstring concatted_stdstr = L"hello " + mywstring + L" blah";
LPWSTR concatenated = concatted_stdstr.c_str();
However, the above gives us a read-only value for the concatenated string. We can use wcsdup() to get a writeable copy. Otherwise, we can cast the read-only string to a writeable one as follows.
PWSTR value = const_cast (concatenated);
std::wstring mywstring(mystring);
std::wstring concatted_stdstr = L"hello " + mywstring + L" blah";
LPWSTR concatenated = concatted_stdstr.c_str();
However, the above gives us a read-only value for the concatenated string. We can use wcsdup() to get a writeable copy. Otherwise, we can cast the read-only string to a writeable one as follows.
PWSTR value = const_cast
Monday, 6 July 2015
Failed optimization probably
Uber drives are taking a longer route because of some misbehaving optimization in Google maps it seems. When a cab is booked near the main gate of Pearl Village (as shown below) the route shown to the driver is optimised one.
However, when a booking is done from the far end of the society, the cabbie is shown a rather long route. A part of this way is actually a dirt road.
Uber should consider feedback from its drivers regarding such cases.
Thursday, 2 July 2015
HolidayIQ share feature broken
The HolidayIQ app did not have share facility before so you could only read their blogs when you get a push notification but not share it with somebody. Recently, I was glad to see the share feature in their app. However, when I tried using it by sharing on WhatsApp, it seems they messed up again. The shared URL is a shortened URL so the problem is not quite apparent on first sight but when a person opens the URL in a browser on a phone that does not have the app, the URL does not work with a message that the URL was not understood (This message was from Firefox. Other browsers will have similar issues.). The problem is that the URL specifies incorrect protocol. Instead of http:// the shortened URL expands to one starting with holiday:// With phones that have the app, this URL is opened in the HolidayIQ app and causes no issues. However, I think they should use a http:// URL while sharing.
Subscribe to:
Posts (Atom)