C++ – pointer being freed was not allocated error

Welcome to the exciting world of C++! Short answer: you’re passing Store as a value. All your menu functions should take a Store& or Store* instead. When you’re passing Store as a value then an implicit copy is done (so the mainStore variable is never actually modified). When you return from the function the Store::~Store … Read more

Geometric Mean: is there a built-in?

Here is a vectorized, zero- and NA-tolerant function for calculating geometric mean in R. The verbose mean calculation involving length(x) is necessary for the cases where x contains non-positive values. Thanks to @ben-bolker for noting the na.rm pass-through and @Gregor for making sure it works correctly. I think some of the comments are related to … Read more

Categories R

Data Manipulation in R: ‘X’ must be atomic

The problem is that salary_var is a list containing a single-element. The call to sort() is then trying to sort a list, not an atomic element. You can see that salary_var is a list by running str(salary_var). If you omit the c(), you’ll instead end up with a data frame with a single column, which … Read more

Cannot npm install due to node-gyp: binding.gyp not found

I have been working on this all day and have tried lots of different things: Uninstalling node and installing latest version Using the –msvs_version= flag set to 2010, 2011, 2012, 2013, 2015 Deleting the .node-gyp folder Adding python path to .npmrc like so: python=C:\Python27\python.exe npm -g install npm@next Running node-gyp rebuild and node-gyp configure Following … Read more

Send attachments with PHP Mail()?

I agree with @MihaiIorga in the comments – use the PHPMailer script. You sound like you’re rejecting it because you want the easier option. Trust me, PHPMailer is the easier option by a very large margin compared to trying to do it yourself with PHP’s built-in mail() function. PHP’s mail() function really isn’t very good. … Read more

Wait .5 seconds before continuing code VB.net

I have a code and I want it to wait somewhere in the middle before going forward. After the WebBrowser1.Document.Window.DomWindow.execscript(“checkPasswordConfirm();”,”JavaScript”) I want it to wait .5 seconds and then do the rest of the code.

Missing files, DirectX SDK (d3dx9.lib, d3dx9.h)

The DirectX SDK installation will add a system environment variable DXSDK_DIR that holds the path to wherever the SDK was installed to. Instead of inserting an absolute path in your Include and Library Directories, I’d recommend using this variable to set the Include and Library path for DX dependencies. As Include Directory add: $(DXSDK_DIR)Include As … Read more