Arrange Cytoscape network windows using the API (Version 3) - cytoscape

I'm developing a bundle app for Cytoscape 3. In this app I need a funcionality very similar to the build-in View > Arrange Network Windows > Grid, or Ctrl+G.
However, I cannot seem to find anything in Cytoscape's API that allows me to arrange network windows.
The source code behind the build-in funcionality can be found here: https://github.com/cytoscape/cytoscape-impl/blob/cbd6ae7202a2137d0224862aa371b82c1ec9a7a7/swing-application-impl/src/main/java/org/cytoscape/internal/view/CyDesktopManager.java#L81
As you can see I need a reference to the JDesktopPane, how do I get this through the API?

I don't think there is clean API-way of achieving what I want. You can however do it as follows:
In your activator you are able to retrieve a CySwingApplication reference: getService(bc, CySwingApplication.class), from which you can call the method .getJFrame(). You can recursively scan through all swing Container components with until you find a component of the type JDesktopPane. When you call .getAllFrames() of the JDesktopPane you can do whatever with you network windows (JInternalFrame).

Related

iOS can you view SVN repository on iPhone/iPad via PuTTY Pagent?

I currently develop on a Windows PC and store the code in an SVN repository that is accessed via a combination of SVN, PuTTY, and Pageant. I would like to be able to view code in the repository on an iPad but I am unsure if this is possible because of the PuTTY and Pageant element?
I'm just researching this at the moment and can see there is an SVN client for iOS but I'm not sure how to get the PuTTY/Pageant working with this?
No code to show
I hope it is possible to view the files as I going to remote locations and don't have the ability to carry a laptop and would like to be able to use my phone
Why do you think that you need SVN client to view data in your repository? You could use a web interface instead. For example, take a look at the web UI built in VisualSVN Server. It works great with mobile web browsers, activates automatically and works out of the box (no configuration required) when you use VisualSVN Server.
Note that Apache+DAV_svn supports (very) basic repository browsing capabilities and there is more functional ViewVC. But they both need manual installation and setup.

Accessing the DOM between two renderers in Electron

Is it possible to do this in Electron:
I want to duplicate a video to a 2nd screen.
This is easyly done, by invoking the following 50 times/second:
canvas_context_2nd_screen.drawImage(video_1st_screen,0,0,width_canvas_2nd,height_canvas_2nd);
but in electron i have to communicate via IPC...
any ideas? is it possible in nw.js?
It is supported in NW.js. As DOM windows are in the same renderer process by default, and the Node.js context is shared between them:
http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/
This can be changed to be separate though.

VSCode extension IPC with UI inside HTML preview

I wish to develop a unit test runner extension for VSCode. The extension should display discovered tests grouped into expandable hierarchy, annotate run status, display output and errors for each test, provide run/debug commands on different levels, and of course the red/green bar.
Roughly spearating this into "model" and "view", I plan to implement the model in the extension process, and I plan to implement the view as HTML preview based on a TextDocumentContentProvider. (Is there a better approach?)
Now, the model and the view should communicate with each other. I want to implement the view as a single-page application. The view will send commands to the model, and the model will send events to the view (or the view will poll the model for events). The view will update itself according to received events.
My question is, what communication technique should I use? Can HTML page inside the HTML preview access VSCode/Atom/Electron/Node APIs? Can I share object instances, or do some lightweight IPC? By far I didn't figure out.
I've found that I can invoke VSCode commands or refresh the entire page, when the user clicks a link with href set to specific scheme (command:// or the one I registered for my TextDocumentContentProvider).
I do succeed to open an HTTP listener (http.createServer) in the extension process, and communicate through XMLHttpRequest on the HTML preview side. But it looks to me like a heavy overkill.
I wonder if there are more appropriate ways to do this?
Almenon is referring to the currently proposed Webview API that was released in version 1.21 (Feb 2018). For the time being, this appears to be a much better approach for HTML previews. But in order to use the API, there are special instructions. From the release notes:
These APIs are still proposed, so in order to use it, you must opt into it by adding a "enableProposedApi": true to package.json and you'll have to copy the vscode.proposed.d.ts into your extension project.
What isn't clarified (and probably should be) is how to add the downloaded declaration file to a project. One way to do it is place the file in $/node_modules/vscode, next to vscode.d.ts, which is generated during postinstall. Then add the following line to the top of vscode.d.ts:
/// <reference path="vscode.proposed.d.ts" />
That will link the type declaration files. To make this part of the installation process, write a build task to do it and then call it in the vscode:postinstall script in package.json.
VSCode has a new API that makes this easier.
https://github.com/Microsoft/vscode/issues/43713
You can find the new API here
To try the new API:
Add "enableProposedApi": true to your package.json
Manually download vscode.proposed.d.ts and add it to your project: https://raw.githubusercontent.com/Microsoft/vscode/master/src/vs/vscode.proposed.d.ts
Run your extension with the latest VS Code insiders build

Accessing the current activity when running an NunitLite test

I've got an ISettings interface which is implemented in a platform-specific manner on Mono For Android and iOS. For Mono For Android, I'm using Activity.GetSharedPreferences to implement my settings - and this works fine from my application.
However, I want to be able to test this with NunitLite (which I'm using successfully to test my other core code).
The problem is that for my test fixture, I need an Activity on which to call GetSharedPreferences. Is there a way of accessing the currently running Activity either generically or via the NunitLite implementation?
James
You can access Shared preferences via:
Application.Context.GetSharedPreferences("whatever", FileCreationMode.Private)
You don't need an activity.

I want to use EtherPad (or a clone). My site is running Ruby on Rails. API or local install?

I'd like to utilize an etherpad interface on my website. Two questions:
1) is there any site with an etherpad api that I could just call remotely?
2) if not, how much trouble is it to install scala and have the two run concurrently?
Thanks
Check out http://piratepad.net and http://ietherpad.com
And you can embed those etherpad instances using a simple iframe as suggested here: http://etherpad.com/ep/blog/posts/embedding-etherpad
There doesn't seem to be a proper API yet for more robust interactions.
The original etherpad.com has now gone away but at that link there is a list of clones.
The instructions for embedding etherpads seems to have gone away with the rest of etherpad.com but I believe it's as simple as this:
<div id="ep">
<iframe src="http://etherpad.com/foo?fullScreen=1"></iframe>
</div>
Replace "etherpad.com" with whatever clone you're using, "foo" with the name of your pad, and you may or may not want to change that fullScreen=1 to fullScreen=0 (or leave it off altogether).
Installing scala might mean a few things:
Installing the SDK (i.e. scalac)
Installing the runtime
Assuming you mean the runtime, scala runs entirely on the Java Virtual Machine (JVM) so assuming you have 1.5+ JVM installed, you can run scala programs on it easily (Scala just compiles down to bytecode, after all). All a scala program requires is a few JARs on the classpath (scala-library and scala-compiler)
Now there is a better solution Etherpad Lite it is easily installable and embedable. See http://etherpad.org

Resources