Deleting an object in C++

Isn’t this the normal way to free the memory associated with an object? This is a common way of managing dynamically allocated memory, but it’s not a good way to do so. This sort of code is brittle because it is not exception-safe: if an exception is thrown between when you create the object and … Read more

Where to place/find the systemjs.config.js file in an angularJS2 project?

You need to create a “systemjs.config.js” file and load it from index.html, like a regular script: Make sure you also include System.JS before the config script: The following script loads the first module: By default (according to your systemjs.config.js), SystemJS will look for app.js or app/main.js. In your systemjs.config.js file, you want to map the … Read more

What is the difference between a map and a dictionary?

Two terms for the same thing: “Map” is used by Java, C++ “Dictionary” is used by .Net, Python “Associative array” is used by PHP “Map” is the correct mathematical term, but it is avoided because it has a separate meaning in functional programming. Some languages use still other terms (“Object” in Javascript, “Hash” in Ruby, “Table” in Lua), but those all … Read more

How to update a package in R?

You can’t do this I’m afraid, well, not with update.packages(). You need to call install.packages(“R2jags”) instead. You can’t install R2jags in the current session because you have already loaded the current version into the session. If you need to, save any objects you can’t easily recreate, and quit out of R. Then start a new R session, immediately run install.packages(“R2jags”), then … Read more

Categories R

Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

Html.Partial returns a String. Html.RenderPartial calls Write internally and returns void. The basic usage is: In the snippet above, both calls will yield the same result. While one can store the output of Html.Partial in a variable or return it from a method, one cannot do this with Html.RenderParti Html.Partial returns a String. Html.RenderPartial calls Write internally and returns void. The basic usage is: In the snippet above, both calls will yield … Read more

Excel – SUMIFS for multiple columns

I would suggest to use SUMPRODUCT rather than SUMIFS. You can build something like that : The downside of SUMPRODUCT is that you can’t use a whole column (for example you cannot write SUMPRODUCT((B:B=”Sales”…)), this would generate an error). Hope this helps.

How to apply a CSS filter to a background image

Check out this pen. You will have to use two different containers, one for the background image and the other for your content. In the example, I have created two containers, .background-image and .content. Both of them are placed with position: fixed and left: 0; right: 0;. The difference in displaying them comes from the z-index values which have been set differently for the … Read more

Visual studio 2019 freezes when debugging

Visual studio 2019 freezes when debugging Please try the following steps: 1) disable any third party extensions under Extensions–>Manage Extensions in case some other extensions cause this abnormal behavior. 2) close VS, delete bin and obj folder and then restart your project. If you project uses packages.config to manage nuget packages, please run update-package -reinstall under Tools–>NuGet Package Manager–>Package Manager Console to prevent nuget package references from … Read more