Fix: make ownCloud installer display in English language

OwnCloud is an interesting solution for setting up a file sharing cloud for a group of people.

However,one issue I’ve found with its Windows desktop client’s current version (which looks clean of any viruses since I always check first) is that if your Windows 10 is configured with a preferred language that the desktop client’s installer doesn’t have localization support for, then it doesn’t show up in English as you’d expect, but in Czech or someother language that most of us don’t know how to read.

Screenshot (493)

So I tried running it’s MSI installer (ownCloud-2.6.1.13407.13049.msi) with –? parameter from the command-line and the /g languageCode parameter mentioned there looked promising, but trying /g en for English didn’t work. I guessed it needed some specific language code number (and not double-letter language code like en for English), since the help text was mentioning to see Windows Installer SDK for more help.

After a quick search I found an article that suggested passing the parameter Productlanguage=1033 to an msi installer on the command-line for it to ALWAYS show in English. And indeed it worked.

Screenshot (494)

To open a command window one can click the Search icon on the windows taskbar and type CMD then press ENTER.

Then they can drag-drop the .MSI file of ownCloud installer onto the black command-line window that opens up and type an extra space char and then Productlanguage=1033 before pressing ENTER to launch the ownCloud installer in English. After that they can close the command-line window at anytime.

Since many users may be uncomfortable with such instructions, one could provide an msiEnglish.bat file that just contains

%1 Productlanguage=1033

User could drag-drop the .msi they want onto that msiEnglish.bat file and it would run the msi installer being displayed in English language, irrespective of any preferred language settings at the Windows operating system.

Of course the best thing would be if ownCloud fixed their desktop client installer to fallback to the Engish language (set it as default) if it can’t find localization strings for the currently prefered language of the user. Have filed an issue at https://github.com/owncloud/client/issues/7825

Fix: Buildbox activation issues on load

Buildbox is a wonderful game authoring tool (that spans the whole nocode-code continuum, including the low-code aspect). It now has a free version too with nice templates and tutorials included.

image

I had an issue with the Windows version (it also has an indentical MacOS-X version since it’s a Qt-based app) where it was complaining about activation issue at startup and couldn’t proceed.

To solve that you can remove activation info (which won’t be removed if you just do uinstall and reinstall) by deleteing the com.eightcell.buildbox subfolder at:

C:\Users\YOUR_PROFILE_NAME_HERE\AppData\Local\eightcell\Buildbox\

Next time you run Buildbox.exe it will show activation dialog and you can enter your registration key (even the free version has one that you can download from your free account at http://buildbox.com)

With the latest Buildbox 3 there seems to exist an extra com.eightcell.buildbox3 subfolder that you could delete or just rename the main.iblicense files in there to main._iblicense. The launch Buidlbox again to see the activation dialog.

image

There probably exists some bug in Buildbox that causes one to repeat this action often.
So you could add a RESET_BUILDBOX_LICENSE.BAT file to your desktop with the following commands to delete the license file:

del "%AppData%\..\Local\eightcell\Buildbox\com.eightcell.buildbox3\main.iblicense"
@pause

HowTo: disable video autoplay in Chromium-based Microsoft Edge

Getting really annoyed by YouTube’s insistence to autoplay (and not even stop the previously playing video) everytime you navigate to a browser tab that shows YouTube content (say using CTRL+TAB / SHIFT+CTRL+TAB to find a tab you’re looking for when you have too many and they only manage to fit their icons so no title to pick one)?

The way to stop it in the newest Microsoft Edge browser (that’s based on the Chromium engine, same one that Google Chrome uses), is to press the three dots button at the top-right and select Settings.

image

When at Settings, select “Site permissions”, scroll down and click the arrow button on the far right to open “Media autoplay”

image

Finally, select “Limit” from the dropdown menu.

image

And you’re done.

Fix: Acer Aspire One (AS1) ZG5 blank screen at startup

Seems Acer Aspire One (AS1) ZG5 can have a recurring problem, esp. if its battery is near its end of life. If it shuts down abruptly its BIOS settings seem to get corrupted and its BIOS instead of discarding them seems to freeze.

Luckily they have a way to update the BIOS via USB key at machine power up. Flashing the BIOS (even to the same version) will fix the issue. Probably resetting the BIOS NVRAM data would do the same, but since you can’t boot this is the way to do it (without fiddling with the hardware directly that is).

The process suggested by ACER in case you come across this issue is the following:

Create a recovery USB drive to update the Bios on the unit.

The specific steps to perform this recovery with the USB drive are:

1. Download & Extract BIOS_Acer_3310_A_AOA110 & AOA150 (found in  https://www.acer.com/ac/en/US/content/support-product/60?b=1)

2. Rename the Bios name from 3310.fd to zg5ia32.fd

3. Copy zg5ia32.fd and Flashit.exe to USB flash drive.

4. Start the restoration process:

  1. Plug the AC Adapter into the unit.
  2. Insert the USB flash drive into a USB port.
  3. Press and Hold down the Fn and the Esc keys together.
  4. Keep these keys held down and press power.
  5. When the unit’s power light comes on release the Fn and Esc keys.
  6. After the keys have been released the power light will start to blink.
  7. Let the unit run and after approximately 1 to 7 minutes, the unit should reboot.
  8. Video should now be restored.

Can also see the process in this video:

https://www.youtube.com/watch?v=iHkGkw9EE8c&feature=emb_logo

See my comment there with the newer links I have above, have fixed the links they had (since they had old broken ACER links they eventually provided the file themselves) so that you download the BIOS from ACER directly, to be safer and to be sure you always get the latest BIOS (aka 3310 at the time of writing).

Categories: Posts Tags: , , , , , , , ,

MySQL DATETIME vs TIMESTAMP and the year 2038

Judging from MySQL documentation at https://dev.mysql.com/doc/refman/8.0/en/datetime.html, it sounds best to use DATETIME rather than TIMESTAMP if you want your database to be future proof. After all 2038 is only 18+ years away.

The DATETIME type is used for values that contain both date and time parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to '9999-12-31 23:59:59'.

The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC.

Btw, another issue that sounds problematic, at least conceptually, is that one can use the CURRENT_TIMESTAMP to initialize auto-updated columns with the current datetime (aka NOW()), but since the TIMESTAMP type is supposed to be up to 2038, wonder why the CURRENT_TIMESTAMP would be a difference (aka return a value that would overflow TIMESTAMP columns, but still work fine – aka return the accurate datetime – for DATETIME columns after the year 2038).

https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html

At the very least, I’d avoid mixing those data types in the same database, for consistency reasons.

HowTo: Reset browser cache of CSS files upon ASP.net MVC app publish

On an ASP.net MVC webapp I’m maintaining, I had the issue that due to caching of older CSS (stylesheet) files in the browser, if the user didn’t press F5/refresh, it wasn’t showing you some message (since I had added the class .center-horiz-vert in the CSS that didn’t exist in the older cached css the browser had).

Instead of changing web.config to stop cachine of CSS files (in which case it would bring the CSS on every page load which is an overkill), I expanded on an idea mentioned by Maxim Kornilov on SO (https://stackoverflow.com/a/12992813/903783), on making the CSS URLs webapp version specific.

I added a fake version parameter to the URLs with the build number as value so that till I publish a new build the browser caches the CSS, but when I upload a new build it brings the new one since it cache with the url as a key (that now includes the build number as a dummy url parameter that the webserver will ignore and just fetch the CSS file when requested)

Maxim’s example was in ASP/ASP.net WebForms syntax instead of MVC’s and Razor Pages’ newer Razor syntax), so I contributed my solution for the case of an ASP.net MVC webapp that wants to serve a fresh copy of CSS files on every new build that you publish (will do this whether the CSS file has changed or not) so that browsers don’t use older cached copies of the file. Obviously this expands to any kind of files you link/load into your webpages via a URL.

1) Added to the webapp’s main class (was called MvcApplication) in Global.asax.cs

#region Versioning

public static string Version => 
typeof(MvcApplication).Assembly.GetName().Version.ToString();
//note: syntax requires C# version >=6 public static DateTime LastUpdated =>
File.GetLastWriteTime(typeof(MvcApplication).Assembly.Location); #endregion

the someProperty => someReadOnlyExpression syntax is just shorthand for someProperty { get { return … ;} } possible since C# 6

2) in its Content/_Layout.cshtml file I used to have the following to show build number and build datetime (based on the webapp’s main assembly) on the page footer:

Version @ViewContext.Controller.GetType().Assembly.GetName().Version 
(@string.Format("{0:yyyy/MM/dd-HH:mm:ss}",
@File.GetLastWriteTime(ViewContext.Controller.GetType().Assembly.Location)))

which I changed to the simpler:

Version @somewebappname.MvcApplication.Version
(@string.Format("{0:yyyy/MM/dd-HH:mm:ss}",
somewebappname.MvcApplication.LastUpdated))

3) it was loading the CSS via hardcoded link in _Layout.cshtml (still refactoring it) which I changed to:

<link href='@Url.Content("~/Content/Site.css?version=" + 
somewebappname.MvcApplication.Version)' rel="stylesheet" type="text/css" />

so if one right-clicks in the webpage and they do view source they see:

<link href='/Content/Site.css?version=2.1.5435.22633' 
rel="stylesheet" type="text/css" />

that is the CSS url is version specific thanks to the dummy parameter version

If a random number was used instead it would fetch the CSS at every page load which is usually undesired, especially if you are already pushing a new webapp build instead of individual page changes to the web server (so that you do have access to a build number that you can inject into URLs).

Note that to achieve auto-incrementing of build number, at Properties/AssemblyInfo.cs I have (see How to have an auto incrementing version number (Visual Studio)?):

// Version information for an assembly consists of the following four values:
//
//      Major Version
//      Minor Version 
//      Build Number
//      Revision
//
// You can specify all the values or you can default the Revision 
// and Build Numbers by using the '*' as shown below: [assembly: AssemblyVersion("1.0.*")] //[assembly: AssemblyFileVersion("1.0.*")]
// don't use boh AssemblyVersion and AssemblyFileVersion with auto-increment

Fix: “A numeric comparison was attempted” at VS build (Costura.Fody)

After upgrading from Visual Studio 2017 to Visual Studio 2019 I was able to update NuGet packages Fody and Costura.Fody of a solution that needed them (to package assembly DLLs inside console EXEcutables) and the solution was rebuilding fine.

However after I synced the solution via a Git repository on another machine and installed the newer Visual Studio there too, I rebuilt the solution in order to fetch/rebuild NuGet packages too and although everything seemed to rebuild fine, when I was using a plain build instead of a rebuild all I was getting at Errors dialog for each project that was using Costura.Fody:

Error

A numeric comparison was attempted on "$(MsBuildMajorVersion)" that evaluates to "" instead of a number, in condition "($(MsBuildMajorVersion) < 16)".  

To fix this I had to uninstall and reinstall Costura.Fody NuGet package (it wasn’t needed to uninstall/reinstall the Fody NuGet package itself) on the solution’s projects that were using it and then all was rebuilding/building fine again on that other machine.

Fix: Invalid Firmware Image at Dell Inspiron 3537 BIOS update

For some time now I was trying to update the BIOS of an older Dell Inspiron 3537 laptop from inside Windows (with the InsydeFlash application that the respective Dell update package employs), only to get a blue screen saying Invalid Firmware Image upon reboot and the BIOS update was skipped every time.

Since that update was fixing a critical security issue (Intel Security Advisory INTEL-SA-00115 – CVE-2018-3639 & CVE-2018-3640), I decided to do some more research on it. I eventually came to the conclusion that since I had A9 BIOS version, I needed to install BIOS version A10 first (which addresses CVE-2017-5715 and associated Intel Reboot issue), then try the BIOS version A11 update that the Dell Support online was offering.

Luckily there was a Dell BIOS update guide that was suggesting to visit Dell downloads catalog to find older updates, from where I found all Dell Inspiron 3537 updates and was able to locate the A10 BIOS update.

Updating the BIOS from version A9 (the version I had, as displayed at “Current BIOS” field on the InsydeFlash UI) to A10 and then after reboot from A10 to A11 with the respective update executables worked fine. Can confirm the update is done by launching the update once more and then just Cancel.

image

HowTo: round a number up to N decimal digits in Javascript

Was just trying to round-off some Google Maps coordinates for display in Javascript up to 3 decimal digits and that was a bit like a blast from the past (the end of the ‘90s to be more accurate)…

So here’s my contributed answer at:
https://stackoverflow.com/questions/2221167/javascript-formatting-a-rounded-number-to-n-decimals

This works for rounding to N digits (if you just want to truncate to N digits remove the Math.round call and use the Math.trunc one):

function roundN(value, digits) {
   var tenToN = 10 ** digits;
   return /*Math.trunc*/(Math.round(value * tenToN)) / tenToN;
}

Had to resort to such logic at Java in the past when I was authoring data manipulation E-Slate components. That is since I had found out that adding 0.1 many times to 0 you’d end up with some unexpectedly long decimal part (this is due to floating point arithmetics).

A user comment at Format number to always show 2 decimal places calls this technique scaling.

Some mention there are cases that don’t round as expected and at http://www.jacklmoore.com/notes/rounding-in-javascript/ this is suggested instead:

function round(value, decimals) {
  return Number(Math.round(value+'e'+decimals)+'e-'+decimals);
}

image

HowTo: remove Javascript imports from OpenLayers map examples

OpenLayers is a fine alternative to the map visualization part of Google Maps Platform, however many of its examples sometimes use features from future and server-side Javascript versions, like “imports”.

Based on lou’s answer at https://stackoverflow.com/questions/51093964/why-examples-dont-work-a-struggle-with-imports/56549364, here’s a fix I just did to make the Marker animation example work when you just copy-paste the example code in an .html file without any pre-processing:

<head>
<meta charset="UTF-8">
<title>Marker Animation</title>
<link rel="stylesheet" href=https://openlayers.org/en/v5.3.0/css/ol.css 
type="text/css"> <!-- The line below is only needed for old environments like
Internet Explorer and Android 4.x --> src="https://cdn.polyfill.io/v2/polyfill.min.js?
features=requestAnimationFrame,Element.prototype.classList,URL">
MAKE THE ABOVE A SINGLE ROW
http://br

MAKE THE ABOVE A SINGLE ROW
</head> <body>
<label for="speed"> speed:&nbsp; <input id="speed" type="range" min="10" max="999" step="10" value="60"> </label> <button id="start-animation">Start Animation</button> <script> var Feature = ol.Feature; //import Feature from 'ol/Feature.js';
var Map = ol.Map; //import Map from 'ol/Map.js';
var View = ol.View; //import View from 'ol/View.js';
var Polyline = ol.format.Polyline;
//import Polyline from 'ol/format/Polyline.js';
var Point = ol.geom.Point; //import Point from 'ol/geom/Point.js';
var {Tile, Vector} = ol.layer;
//import {Tile as TileLayer, Vector as VectorLayer} from 'ol/layer.js'; var TileLayer = Tile; var VectorLayer = Vector;
//var BingMaps = ol.source.BingMaps;
//import BingMaps from 'ol/source/BingMaps.js';
var VectorSource = ol.source.Vector;
//import VectorSource from 'ol/source/Vector.js';
var {Circle, Fill, Icon, Stroke, Style} = ol.style;
//import {Circle as CircleStyle, Fill, Icon, Stroke, Style}
// from 'ol/style.js'; var CircleStyle = Circle; // This long string is placed here due to jsFiddle limitations. // It is usually loaded with AJAX. var polyline = [ ...

and to use an ESRI sattelite map or OpenStreetMap (plain) map instead of Bing Maps one (which requires a key), do this extra edit to the Marker animation example:

  var map = new Map({
    target: document.getElementById('map'),
    loadTilesWhileAnimating: true,
    view: new View({
      center: center,
      zoom: 10,
      minZoom: 2,
      maxZoom: 19
    }),
    layers: [
      new TileLayer({
        source:
            //new ol.source.OSM()

            new ol.source.XYZ({
              attributions: ['Powered by Esri',
                             'Source: Esri, DigitalGlobe, GeoEye, \
Earthstar Geographics, CNES/Airbus DS, USDA,\
USGS, AeroGRID, IGN, and the GIS User Community'], attributionsCollapsible: false,
url:
'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/
MapServer/tile/{z}/{y}/{x}',

MAKE THE ABOVE A SINGLE ROW
maxZoom: 23 }) /* new BingMaps({ imagerySet: 'AerialWithLabels', key: 'Bing Maps Key from http://www.bingmapsportal.com/ here' }) */ }), vectorLayer ] });

Here’s the modified result:

image

%d bloggers like this: