I installed the Guna theme which brings a nice color scheme that I would like to keep; however, the theme comes with a clock and weather widget that I can't remove even if I set the theme back to default.
I have tried setting the layer where the clock texture is contained, to have zero opacity, but then the most I got it to do was showing the clock in a different color.
The following lines are in the Guna theme's default settings, starting at line 166:
{
"class": "sidebar_container",
"layer0.texture": "Guna/assets/simple/sidebar/sidebar-bg-clock-nb.png",
"layer0.inner_margin": [15, 55, 15, 0],
//"layer0.inner_margin": [15, 70, 15, 0],
//"layer0.inner_margin": [15, 92, 15, 0],
"layer0.tint": "color(var(--background))",
"layer0.opacity": 1,
"content_margin": [0, 45, 0, 0],
//"content_margin": [0, 60, 0, 0],
//"content_margin": [0, 82, 0, 0],
},
{
"class": "sidebar_container",
"settings": ["gnwidgx"],
"layer0.texture": "Guna/assets/simple/sidebar/sidebar-bg-nb.png",
"layer0.inner_margin": [15, 55, 15, 0],
"layer0.tint": "color(var(--background))",
"layer0.opacity": 1,
"content_margin": [0, 0, 0, 0]
}
I tried setting the content margin to [0,0] for the clock widget (like I've seen it's possible to do to hide file icons), like so:
{
"variables": {
},
"rules":
[
{
"class": "sidebar_container",
"content_margin": [0,0],
"layer0.opacity": 0
},
{
"class": "sidebar_container",
"content_margin": [0,0],
"layer1.opacity": 0
}
]
}
And the result is this: every sidebar element, including the files and folders, bugs out and leaves a trail as if I were shift+dragging everything in mspaint.
Thanks in advance!
Apparently Guna has a setting that adds the widgets (clock, weather, etc.) to all themes. Fortunately, it can be turned off. Select Preferences → Package Settings → Guna → Settings and add the following to the right pane:
"sidebar_widget_on_other_theme": false,
You can turn off the widgets in Guna itself with this setting:
"sidebar_widget": [],
Valid values for that array are empty (as above) or any combination of "clock", "weather", and "date".
Save the right pane when you're done, and the settings should be applied immediately. If not, you might need to restart Sublime.
Related
xCoordinates = {45, 40, 35, 30, 25, 20, 15, 10, 5, 0}
yCoordinates = {0.6, 1.3, 1.5, 2.4, 5, 5.2, 5.3, 6, 6.4, 6.6}
plotData = Transpose#{xCoordinates, yCoordinates}
Show[ListPlot[plotData], Plot[Fit[plotData, {1, x}, x], {x, 0, 45}]]
I executed these in order and got 3 errors saying "general::ivar : ... is not a variable" then General::stop : further output of General::ivar will be suppressed during this calculation.
The ListPlot is displayed, but without the Fit line. Can anyone please explain where the error in my code is, and what this error means?
EDIT: Also generated the messages
RGBColor called with 1 argument; 3 or 4 arguments are expected.
and
Coordinate Skeleton[10] should be a pair of numbers, or a Scaled or Offset form.
What do these mean?
See the Details section on Plot.
"Plot has attribute HoldAll and evaluates f only after assigning specific numerical values to x."
To fix the problem evaluate the fit outside of the Plot function.
xCoordinates = {45, 40, 35, 30, 25, 20, 15, 10, 5, 0};
yCoordinates = {0.6, 1.3, 1.5, 2.4, 5, 5.2, 5.3, 6, 6.4, 6.6};
plotData = Transpose#{xCoordinates, yCoordinates};
fit = Fit[plotData, {1, x}, x];
Show[ListPlot[plotData], Plot[fit, {x, 0, 45}]]
I always use dark colors for editor
With sublimetext3 I can not change the color of the sidebar, how to do it?
There are two options. The first is to download a theme from Package Control that has dark backgrounds - I personally prefer Theme - Soda with the Soda Dark 3.sublime-theme setting in your user preferences.
The other option is to modify your .sublime-theme file yourself. The following will set the background of the sidebar to black:
{
"class": "sidebar_container",
"layer0.tint": [0, 0, 0], // this is the color setting
"layer0.opacity": 1.0,
"layer0.inner_margin": [1, 1, 2, 1],
"content_margin": [0, 0, 1, 0]
},
I have a HandsOnTable with mergeCells option, on particular event I make a server call which gives me updated data and hence merge cells options also need to be updated.
For e.g. before server call, grouping was for every 5 rows, but after it's for 4 rows.
I used hot.updateSettings(hotOptions) in which mergeCells of hotOptions is updated, but it does not update the setting.
Before server call:
var hotOptions =
{
data: Handsontable.helper.createSpreadsheetData(5,5),
colWidths: [47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47],
rowHeaders: true,
colHeaders: true,
contextMenu: true,
mergeCells: [
{row: 0, col: 0, rowspan: 2, colspan: 2},
{row: 3, col: 3, rowspan: 2, colspan: 2}
]
};
hot = new Handsontable(container, hotOptions);
After server call:
hotOptions.mergeCells = [
{row: 0, col: 0, rowspan: 3, colspan: 3},
{row: 0, col: 3, rowspan: 2, colspan: 1}
];
//just to prove that data is updating
hotOptions.colWidths = [100, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47];
hot.updateSettings(hotOptions);
I can destroy earlier HOT instance and create new one with new options (attached fiddle does this), but I want to achieve the same with updateSettings.
More details: http://jsfiddle.net/ru53zo3o/1/
I think I have fixed this.
Just before calling updateSettings of the HOT instance, update its mergeCells attribute with the new instance of Handsontable.MergeCells object by passing updated mergeCells array as an attribute.
hotOptions.mergeCells = [{row: 0, col: 0, rowspan: 2, colspan: 3} ];
hot.mergeCells = new Handsontable.MergeCells(hotOptions.mergeCells);
hot.updateSettings(hotOptions);
See it working here: http://jsfiddle.net/gncb55jp/3/
In the meantime you could keep track of your "cells to merge" in an object array, then modify that array once you get the new data. Afterwards you can call render(). Definitely a workaround, but it will tide you over if you need to have it ready for a deadline of any kind while your waiting for the next release.
I thought I knew how FromDigits works, but it's doing something crazy now.
n[[990;;]]
FromDigits[n[[990;;]]]
outputs:
{9, 50, 0, 50, 1, 50, 2, 50, 3, 50, 4, 50, 5, 50, 6, 50, 7, 50, 8, 50, 9}
1405060708091011121309
instead of, you know, 950050150...
what's going on?
Documentation says that
FromDigits : constructs an integer from the list of its decimal digits.
So each number in the array must be less that 10 (decimal digits) for a simple concatenation.
Digits larger than the base are "carried": For example
FromDigits[{7, 11, 0, 0, 0, 122}] will give 810122
For more information go to http://reference.wolfram.com/language/ref/FromDigits.html
I think "string hacking" might be what you are asking for. This
myn = {9, 50, 0, 50, 1, 50, 2, 50, 3, 50, 4, 50, 5, 50, 6, 50, 7, 50, 8, 50, 9};
ToExpression[StringReplace[ToString[myn], ", " -> ""]][[1]]
gives you this integer
9500501502503504505506507508509
That turns your list into a string, replaces each comma space separator with nothing, turns that resulting string back into an integer and discards the now unneeded curly brackets.
A couple other ways..
FromDigits#Flatten#IntegerDigits#
{9, 50, 0, 50, 1, 50, 2, 50, 3, 50, 4, 50, 5, 50, 6, 50, 7, 50, 8, 50, 9}
9500501502503504505506507508509
(ToString /# # // StringJoin // ToExpression) &#
{9, 50, 0, 50, 1, 50, 2, 50, 3, 50, 4, 50, 5, 50, 6, 50, 7, 50, 8, 50, 9}
9500501502503504505506507508509
I'm very new to mongodb, I've done simple stuff like storing and retrieving documents.
I have a collection of documents (thousands and growing) with and embedded array of integers (can be as large as 5000 integers) between 0 and 255
Example Mongo Collection Data:
{
"name": "item1",
"values": [1, 93, 45, 67, 89, 1, 2, 32, 45]
},
{
"name": "item2",
"values": [1, 23, 45, 123, 1, 5, 89, 14, 22]
},
{
"name": "item3",
"values": [23, 1, 44, 78, 89, 22, 150, 23, 12]
},
{
"name": "item4",
"values": [90, 23, 11, 67, 29, 1, 2, 1, 45]
}
Comparison would be:
pseudo code:
distance = 0
for a in passed_in_item
for b in mongo_collection
distance += a - b
end
end
an example passed in array (same as the ones in the mongo document, they will always be the same length):
[1, 93, 45, 67, 89, 1, 2, 32, 45]
I'd like to pass in an array of integers as a query and difference it against the array in the document to find the one with the least difference. Is this the sort of thing map reduce is good at and how would I roughly go about it? An example would be great. Also eventually I'd like the passed in array to come from another document in Mongo in a different collection.
Thanks!