Hide whole code block and only show fragments or jump to the first fragment - gitpitch

I am creating a presentation about some Java stuff and I want to show some code.
I have the problem, that I want to present Java code and the first snippet is the import block if I use the Code Delimiter Slides.
If I use the Code Block Slides, the whole code shows up. This will distract the audience.
Is it possible to jump to the first fragment in a code block?

Is it possible to jump to the first fragment in a code block?
The answer is no, it is not currently possible.
GitPitch code-presenting gives you a way to step-into any code block, source file, or GIST. But the starting point is always as if you just opened the source code in your editor (you see the contents of the block, file, GIST).

Related

How to read from the internal clipboard of a Telerik Kendo Diagram?

I have a system that allows users to create multiple diagrams. I want to be able to copy a part of one diagram, close it, run another and paste in what I have copied. The problem is that the diagram.copy() and diagram.paste() functions use an internal clipboard which is lost when I close the original diagram, so there's nothing to paste when I open the other one.
I'm very new to Telerik, so I don't really know how to approach this. I tried digging through the documentation, but I couldn't see any way to interact with the internal clipboard other than the two functions.
Preferably I'd like to be able to read the internal clipboard, copy it to a global variable and then read the variable back when opening the destination diagram.
Or maybe there's a way to read the selected shapes into a variable without using the copy() function?
Reading the source code, I've found it's stored in the variable diagram._clipboard . You can run this sample and inspect: https://dojo.telerik.com/onunEkib
However, as an undocumented feature, this can change and break when upgrading your Kendo version. Plus, as this is the diagram's internal data, it can be invalid for the target diagram.
What I'd do is a custom copy button that gets the current selection through the select method.

Magnolia 5.5.6 Stories App Custom CKEditor Panel

The Magnolia-Team wrote (DevelopingCustomBlocks) that the RichTextFieldDefinition is not available for Blocks.
I would love to use content-editor in the future instead of pages. Is it possible to extent the editor panel
with (custom) plugins for the ckeditor (that I created to use with the RichTextField)? If yes could you give me a hint on how to accomplish that?
It is possible, and you can even use the standard RichTextField.
However before you start extending it, please make sure you understand idea behind new editor, it's working, structure of data it stores and how is that data manipulated later in order to not dig for yourself hole that would be hard to escape with custom extensions.
Whole editor is meant to be fluent for editing and very simple to manipulate offering maximum of freedom. Editor works with concept of blocks. Each hit of enter produces new block of type text. There's other types of blocks offered OOTB by Magnolia. Each different type of block is stored separately and it's rendering can be controlled by template. E.g. each text block becomes paragraph or div in html, depending on your choice. For other blocks, they might produce other types of elements. And this is where you need to become careful. If you extend CK editor, or start using default/old RichTextField, you will suddenly end up with block that already contains html, thus making it unpredictable what the output might look like after such block is processed by your template and whether resulting html is valid or well formatted. The less of html you get "baked in" in each block, the easier templating becomes later.
As for adding extra plugins to the text block, you can modify config.js of the editor, as for adding RichTextField you can just create block that will provide this field. However, keep in mind that with first you run into risk of introducing potentially dangerous html and with the second it's same risk of baking in dangerous html and on top breaking editor experience as RTF will not support same keyboard shortcuts available for other blocks.

How to dynamically create a breakpoint on an expression in chrome?

Say I have some code in production. I want to test that a particular item in a large list of items has some behavior. One way to accomplish this in development with the debugger statement is like this:
items.forEach(function(item){
// some code...
if (item.title.match(/foo/)) {
debugger;
}
// some more code...
});
With that code, you put a breakpoint in a list, only when the list item matches some expression. This makes it easy to debug only that one item, which may have some obscure bug in it. If you just try to put a breakpoint there by clicking the line, then it's going to pause at every item in the list, so you have to step through like 100 items before you get there which is super tedious.
One problem with the above is, it requires you to have the ability to edit the client-side JavaScript, which you can't really do in production.
So the question is, can you accomplish this same sort of thing, but purely using the Chrome Web Inspector? Maybe something to do with "watch expressions" (haven't found much on google about those). The ideal would be, from within the Chrome Web Inspector, add an expression like:
breakpoint:
line: 17
file: build.js
expression: item.title.match(/foo/)
The closest you will get to this without getting into Chrome's chrome.debugger APIs are conditional breakpoints.
If you truly want to do this programmatically, look into chrome.debugger.sendCommand with the Debugger.setBreakpoint command.

Matlab GUI gives error, but m file okaz

I`m absolutely new in Matlab, so I think it is a dumb question, but I would be really grateful for any help.
I had made a GUI with some slider. When I compile the m file everything works fine, there are no exceptions and the program do what it have to, but when I click on the fig file directly and try to move one of the sliders I got the following error:
??? Undefined function or method 'diference_GUI' for input arguments of type 'char'.
Error in ==>#(hObject,eventdata)diference_GUI('slider1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
I had found some forum, blog article in this topic, but I want able to solve. Try-Catch not good, because if I do it, I dont get any error message, but the program still don`t do what it need.
Thank you for your help, Karoly
Your question isn't quite clear, but I'm assuming that you've made a GUI called difference_GUI using GUIDE in MATLAB.
When you do this, you'll get two files, difference_GUI.m and difference_GUI.fig. At that point, you should basically leave difference_GUI.fig alone, without opening or modifying it. Start the GUI by typing difference_GUI, which will run the .m file, which uses the information in the .fig file to lay out the GUI.
If you need to modify the layout of a GUI that you've created in GUIDE, you can open the project again in GUIDE and make minor modifications to it, such as repositioning a slider - but if you need to make major changes to it, I personally find it easier to copy the algorithmic portion out of the .m file, create an entirely new project, relaid out, from scratch, and then paste the algorithmic portion back in to the new .m file.

Matlab GUI's managebuttons

I have to maintain a large MATLAB GUI, containing quite a few callback functions, each of which gets called at many points. At some point, I decided to rename one of the callbacks; in order not to have to go through GUIDE to manually modify each of the UI that calls it, I used the excellent gencode program to "unwrap" the .fig file, s/old_name/new_name/g, and recreate the .fig.
This seems to work well, except for one thing: when clicking on a button in a button group, I got a message telling me that the function manageButtons is unknown. After a bit of googling, I find that manageButtons is a nested function in childAddedCbk, which, I assume, is called by GUIDE as the GUI is created. Now, trying to move just manageButtons outside to its own, in-the-path file doesn't work either: the hgroup passed to it is an invalid handle object.
So... does anyone has a workaround for that? Any of the following will be appreciated:
changing all the callbacks in a GUI in a semi-automatic way, or
making the manageButtons get a valid handle, or
having gencode not break all that.
Thanks,
Antony
You can export the FIG + M file to single .m file. You will lose the ability to edit this with guide, but you will be able to do a simple regular expression replace on the resulting .m file.
In order to do so - use on the menu of GUIDE -> File -> Export.

Resources