Custom layouts, Sublime text 2 - sublimetext2

I've been working with a 2 column system so far but feel I'm needing a third and that 3 spread across the screen doesn't give much of a view without adjusting the width every time.
It's there a way to get the grid layout but have the bottom half of the screen one file.
I know it's a long shot but wondering if anyone knows of anything
Found that you can edit for custom layouts in Packages/default/Main.sublime-menu
Having problems saving though error in trying to parse file: expected value in ~/library/application support/sublime text 2/packages/default/Main.sublime-menu:407:21
Edited: for better layout
Found something that is similar, been trying to mod it but don't understand how the cells work
This one is similar
"args":
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [
[0, 0, 1, 2], // (0.0, 0.0) -> (0.5, 1.0)
[1, 0, 2, 1], // (0.5, 0.0) -> (1.0, 0.5)
[1, 1, 2, 2] // (0.5, 0.5) -> (1.0, 1.0)
]
}
which gives

Assuming these are just coordinates with 0,0 at the upper left, something like this should work:
[0, 0, 1, 1],
[1, 0, 2, 1],
[0, 1, 2, 2]
Edit: Just tested, and it does.
Create the file Main.sublime-menu in your Packages > User folder (best to leave the default menu alone) and put the following code in it:
[{
"id": "view",
"children": [{
"id": "layout",
"children": [{
"command": "set_layout",
"caption" : "Custom: 3 Pane",
"mnemonic": "C",
"args": {
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.5, 1.0],
"cells": [
[0, 0, 1, 1],
[1, 0, 2, 1],
[0, 1, 2, 2]
]
}
}]
}]
}]
You will see Custom: 3 Pane in your layout options. No need to restart Sublime Text.
For anyone interested, here is a gist containing this layout as well as a flipped version.

This was very helpful for visualizing what points the coordinates are referring to: http://www.sublimetext.com/forum/viewtopic.php?f=6&t=7284&start=0&hilit=set+layout

Related

How to build pre-calculated histogram in Vega-Lite?

VegaLite can bin and aggregate himself. But I have complex calculation and build histogram separately.
The resulting data is following
bins = [1, 2, 3, 4] // 4 edges
// |1-2|2-3|3-4| // 3 bars
counts = [1, 2, 1]
The problem is - how to properly display bar edges - there are 3 bars, but 4 edges.
You can specify bin start and endpoints using the x and x2 encodings. It's also helpful to specify bin='binned' which tells Vega-Lite that the data is pre-binned & triggers the same display defaults used when a bin operation appears in the specification. For example (editor link):
{
"data": {
"values": [
{"bin1": 1, "bin2": 2, "counts": 1},
{"bin1": 2, "bin2": 3, "counts": 2},
{"bin1": 3, "bin2": 4, "counts": 1}
]
},
"mark": "bar",
"encoding": {
"x": {"field": "bin1", "type": "quantitative", "bin": "binned"},
"x2": {"field": "bin2"},
"y": {"field": "counts", "type": "quantitative"}
}
}
For more information, see Using Vega-Lite with Binned data.

set_layout settings in Sublime Text 3

I just changed my OS from W10 to a Linux distro. I installed Sublime Text 3 and started to configure everything as I had in my other OS so I could start programming. Right now I am trying to include some custom layouts but I'm having a problem.
This is a layout I wanted to make:
So I wrote this:
{
"keys": ["alt+shift+5"],
"command": "set_layout",
"args":
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 0.33, 0.5, 0.66, 1.0],
"cells": [
[0, 0, 2, 1],
[2, 0, 4, 1],
[0, 1, 1, 2],
[1, 1, 3, 2],
[3, 1, 4, 2]
]
}
}
But this is not working for me right now.
Trying to apply that layout generates an error message in the Sublime console (View > Show Console):
invalid cell: (2,0 4,1)
That sort of catches me by surprise because generally the set_layout command takes what you give it without doing any error checking, which can get you into sticky situations like weird rendering errors or putting panes outside of the visible area of the window.
In any case, modifying the layout to something like the following solves the problem, which re-orders the cell layouts.
{
"cols":[0.0, 0.5, 1.0],
"rows":[0.0, 0.33, 0.5, 0.67, 1.0 ,
"cells":[
[0, 0, 1, 2],
[1, 0, 2, 1],
[0, 2, 1, 4],
[1, 1, 2, 3],
[1, 3, 2, 4]
]
}

Do I have to reorganize the data to animate it on time, using Unity and C#?

My Json file looks something like this (it's huge, so this is just simplified):
{
"foo": {
"id": [
20,
1,
3,
4,
60,
1,
],
"times": [
330.89,
5.33,
353.89,
33.89,
14.5,
207.5,
]
},
"poo": {
"id": [
20,
1,
3,
4,
60,
1,
],
"times": [
3.5,
323.89,
97.7,
154.5,
27.5,
265.60,
]
}
}
I have a similar json file as the one above, but a much more complex one. What I want to do is to use the "time" and "id" data and perform an action for the right "id" at the exact time. So the variables id and times are actually mapped to each other (has the same index). Is there a method to take out the right id for the right time to perform an action without having too many complicated loops?

Mathematica, combine ContourPlot3D and ListPointPlot3D

I would like to combine a 3-dimensional function plot with some 3D Points. Some lines that work separately are:
D3Plot= ContourPlot3D[x^2+y^2+z^2== 2, {x, 0, 2}, {y, 0, 2}, {z, 0,2}, ColorFunction -> Function[{x, y, z}, Hue[1*(1 - z)]]]
and:
atest3D = {{1, 1, 1}, {2, 1, 1}, {1, 2, 1}, {1, 1, 2}, {2, 2, 2}};
However, I get some problems when combining them together:
Show[atest3D,D3Plot,AxesOrigin -> {0, 0, 0}, PlotRange -> {{0, 3}, {0, 3}, {0, 3}}]
Is there any way to get this to work or some other way to show these two plots together?
Something like this?
Show[D3Plot, Graphics3D[{Red, PointSize[0.1], Point[atest3D]}], PlotRange -> All]
Is there also any way to make the points always viewable, also if they are on the other side of the surface?

Web inspector not working correctly in sublime text 2

When I try to run web inspect in sublime text 2 it produces this error:
[619:1799:0524/104420:ERROR:process_singleton_mac.cc(103)] Unable to obtain profile lock.
[Finished in 0.1s with exit code 20]
The following it my configuration file:
{
"chrome_path": {
"osx": "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
"windows": "C:\\Program Files\\Google\\Chrome\\chrome.exe",
"linux": "/usr/bin/google-chrome"
},
"chrome_profile": "Default",
"chrome_remote_port": "9222",
"breakpoint_scope": "swi.breakpoint",
"current_line_scope": "swi.current",
"interactive_scope": "mcol_0088CCFF.settings",
"stack_layout": {
"cols": [0.0, 0.6, 1.0],
"rows": [0.0, 0.7, 1.0],
"cells": [[0, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]]
},
"console_layout": {
"cols": [0.0, 0.6, 1.0],
"rows": [0.0, 0.7, 1.0],
"cells": [[0, 0, 2, 1], [0, 1, 1, 2], [1, 1, 2, 2]]
},
"reload_on_start": true,
"reload_on_save": true,
"set_script_source": false,
"open_stack_current_in_new_tab": false,
"pause_on_exceptions": "uncaught",
"breaks": {}
}
Know what is causing this error?
Got this same error, that happens when Chrome is already running. Try closing Chrome and then hit the command in Sublime Text "Start Google Chrome with remote debug port 9222"