It is possible to “officially” ignore files by extension, or ignore files & directories by name, but the option to do so is found under the “Server Options” of Surround which might be locked down by the administrator, and even if it isn’t, the changes would apply to all users which might not be desired.
However, I did stumble across one possible solution, (functional though inelegant), for just a single single client or user to set up a personal set of ignored files/folders.
All you have to do is set the files or folders as “hidden” in Windows Explorer. Then, Surround just ignores them. It’s sufficient to hide just a parent folder – the hidden attribute for any subfiles or subfolders won’t matter, Surround will ignore them all as long as the parent folder is hidden. Hidden files won’t show up anywhere in Surround, either when looking at “Working Directory Differences” or in the “Add Files” dialog.
While this isn’t as flexible as defining a set of rules (say, all files of a certain extension) it’s better than nothing.
I like the xlsx package in R for its simplicity. However, I would always have a problem reading columns as numeric with the
read.xlsx reads numeric columns properly, but it’s slow for large data sets.
read.xlsx2 doesn’t guess the type of each column so it just reads everything as strings. It’s not immediately obvious from the documentation how to fix this without a bit of extra digging.
You actually have to look into the documentation of
readColumns to see that if you pass
colClasses=NA then it will guess the column type
So, use this:
data = read.xlsx2("path_to_xlsx_file.xlsx", sheetIndex=1, colClasses=NA)
It is often useful to update the location of scatter plot points overlaid on a Matlab figure, especially when displaying the incremental results of iterative algorithms. In order to do this, the existing scatter plot points need to be deleted prior to redrawing new scatter points.
In order to delete points which have been plotted on an axis with
scatter(), the following code can be used:
delete(findobj(gca, 'type', 'patch'));
It is not immediately obvious from the documentation, but scatter points are considered to be a “patch” type object. Thus, this line of code finds all patch objects on the current axes and deletes them.
To delete the 2D lines drawn by Matlab’s
plot() function a similar statement can be used, in this case by changing the type to the more obvious value of “line”:
delete(findobj(gca, 'type', 'line'));
Generating a universally unique identifier (UUID) can be very useful for a variety of tasks where you need a unique way to identify something. While a UUID is not technically guaranteed to be unique, the identifier space is so large (128-bit) that it can be treated as unique for most purposes.
It is simple to generate a UUID string in MATLAB by using its built in Java Virtual Machine:
uuid = char(java.util.UUID.randomUUID);
The function java.util.UUID.randomUUID() will return an object of type java.util.UUID, but this can be typecasted into a MATLAB string through the char() function. Simple!
I recently bought the Honeywell 50250-S HEPA Round Air Purifier from Amazon. It was nearly half price from Amazon Warehouse Deals since it was a returned unit, but it was listed as “Like New” so I gave it a shot. It turns out the unit would not turn on, but after I took apart the control panel I realized that one of the wires of the power cable was loose. Once I connected it back to the right spot, it worked perfectly. Now I know why it was a returned unit.
The purifier seems to do a pretty good job at removing odors, but it is noisy and uses a decent amount of power. How much power? Well, the purifier has three speed settings: High, Medium, and Low, which you can select with the knob shown:
I used my Kill-A-Watt to measure how many watts the purifier used at each speed level:
So, as you can see, the High speed setting uses a whopping 200 W of power. Medium reduces the consumption to 165 W, while Low uses 103 W.
At $0.15/kWh, that means the air purifier would have a yearly cost of $263 on High, $217 on Medium, or $135 on Low if run 24/7 – not exactly insignificant, and all of which are more than what I paid for the unit in the first place!