How to use google code-prettify to show diff - google-code-prettify

I have a an application that can browse out code tree and can show individual source code that are nicely highlighted using google code google code-prettify
I want to add a feature that shows diff between version. I have the changes in git-diff format
my question is: it the google code prettify supports diff? are thre any code examples for this?

Related

Telerik RadSpreadsheet to PDF

I’m currently using web forms and VB.NET I’ve tried following the examples and docs on Teleriks website, however the results are not as expected. It appears that Telerik is taking a screen capture and turning that into a PDF.
What I’m needing is to export the spreadsheet that is displayed in the RadSpreadsheet control into a PDF document such that the results are identical to what’s being displayed.
I’m starting to wonder if Telerik doesn’t actually do anything but take screen shots and save them as a PDF. Even their demo does that. Does anyone know how to go about exporting the Excel file into a PDF? Again their documentation to me isn’t really clear.
there are several libraries used to process documents. They are called Telerik Document Processing. You can use them to generate, modify or convert documents. You could use the RadSpreadProcessing library to export your grid data and then convert the Workbook to a PDF document. Here is the documentation of the PDF export feature https://docs.telerik.com/devtools/document-processing/libraries/radspreadprocessing/formats-and-conversion/pdf/pdfformatprovider
The PDF documents generated this way are not screenshot, they are real PDF documents.

where can I download this code

I find a interesting website:http://www.brightpointinc.com/interactive/political_influence/
I want to learn its visualization using d3.
But when I download it, using right click button-------- save as The download page seems does not work. It seems lack some data, so I get back to the website to download some data, but it lacks some of them, can anyone send me an work version? thanks
As Lars says, your best bet is to look at the source code. To do this, you can use something like Chrome Developer Tools or Firebug for Firefox. I use the latter, so I'll take that as an example.
First, I'd right-click on the visualization itself, and click on Inspect Element with Firebug. This will pull up the HTML, which is only semi-helpful, since it only shows the output rather than the JavaScript code which created it.
To get at the JavaScript, you can use Firebug's Script tab. Most websites have more than one script, so you can hunt through the scripts being used by browsing through the dropdown menu in the second toolbar. The _buildChords.js script looks the most promising; that has some recognizable d3 code in it. You could check out the others to see what else they're calling (since it looks like there might be others - data.js, events.js, and so on).
Happy learning.

Possible to include an image in the meta data in code? VS 2013

I would like to be able to include a screenshot of a control inside my code, this way making control identification easier for new members on my team, is such a thing possible?
Maybe even the ability to just have the image on a network share with the path in a comment, and then have a plugin that when hovering over the link brings up the image?
EDIT (More detail):
I'm creating a test project, the application under test has over 1000 controls, some of them are similar in name and purpose, this can make it difficult at times for developers to reuse the API I am creating because the control name is simply not enough for quick identification of the control in use.
I use the word API very loosely too, none of this stuff will be consumed in web services, and it will always be white box with developers including a project reference and have direct access to the source code.
For every form in my application (The test one), I have a controls.cs file where all the controls for that form in the application under test are listed - This is where I want the hover to screenshot ability in the control definitions.
Another sure factor is that all developers will be using VS2013 (For now the base version), later this could be update 1 or 2.
As the initial author and senior developer on this project, these hover / image references (in the code) will be as useful to me personally as any 3rd party developers, or any later developers to join the initiative.
Thanks again, and I added a bounty!
I believe you can use Whole Tomato's free SourceLinks Visual Studio extension to do what you want - or at least get pretty close to it.
Built-in Functionality:
Out of the box, the extension allows you to specify comment patterns you want users to be able to take an action on. Once the patterns are specified, SourceLinks will highlight any occurrences of those patterns in the text editor. You will be able to double click the highlighted items and perform a pre-configured action (such as opening a link in an internal/external browser, or launching an executable).
You can see an example in the SourceLinks configuration dialog shown below:
(source: wholetomato.com)
So you could use this feature pretty painlessly to define a keyword such as Control Image and then put comments like the following in your code:
// Control Image: my_smart_list.jpg
SourceLinks would allow you double click this text, and you could have that configured to launch the image (using a file:// or http:// url depending on how and where your images are stored) either inside Visual Studio in it's internal browser, or in an external browser.
Custom Tooltips!
Now, if you want to put in some more effort into this and actually write some code, then SourceLinks allows you to create API Extensions to display custom tooltips when the user hovers over the marked text in the editor. The default installation of SourceLinks comes with sample API extensions that you can copy to create your own. See the article linked at the very top of the answer for more details on these samples.
This post in the SourceLinks forum informs us that SourceLinks expects the custom API Extension to return the tooltip value as FlowDocument XAML text. This is awesome news for us, because a FlowDocument can contain many types of elements, including formatted text, hyperlinks, and images.
Imanges in a Flow document can be specified both inline as well as externally.
Hope this helps!
I would use doxygen -- create the images somewhere in the source tree and use doxygen comments. You can embed the \image command in source comments (see docs) and doxygen will generate all the HTML documentation from there. I think doxygen is a great tool for documenting a codebase as you can generate the documentation directly from comments in the source and distribute or host the HTML separately.

Is there a way to export notes taken in Google Play books?

I have taken a series of notes in a book that I read on Google Play books. Is there a way to export these notes all together as a text document or some similar format?
Google has changed this and now if you have Android device you can get your notes on Google Drive. Simply do this:
Open Play Books on your Android device
Go to Settings
Save notes, highlights and bookmarks in Google Drive - turn this ON
This feature is still not perfect. The biggest problem I have is that page number is not recorded properly for most books. Instead, you just have link that opens the page in Google Play Books. Meaning, it'll probably work for you personally, but sharing notes and making sense of notes on different devices is problematic.
It isn't perfect but here is one way to do it. After doing this you will receive a zip file with your book(s) and an HTML (or JSON) file with your notes.
Follow this link to the Google Data Tools https://www.google.com/settings/takeout/downloads
Click the Create New Archive button
Click the Select None button
Go down to Google Play Books and flick the switch on
Hit the down arrow
Either download all or click on the Select Books radio (a popup will appear where you can select none again and search at the top)
After you have chosen your books, go to Next at the bottom
Pick your export options and you're good to go.
there is no such available function at the moment. I have submitted a request already, let's see what google developers say.
It works on some books and not others apparently. I can't produce a summary/review of Guttag's book for my class.I have the print version and just bought the Playbook version.

Guide for Carrot2 in PDF

Could you please say if there is a pdf (or doc) version of the documentation? If yes, where can I find it?
If such does not exist, I guess it would be great to create such.
PDF allows reading the file in Mendeley Desktop program, underlining parts that are important for me and putting comments. THis would be a great advantage to compare with the html version of the guide.
If you're using Chrome, just go to the Carrot2 online help manual and choose "Print...". In the "Destination" box on the left-hand side change it to "Save as PDF" and click OK. This functionality is built-in to Chrome by default.
For other browsers I'm sure there are add-ins/plugins you can find or you can always use a third-party PDF driver like PrimoPDF.

Resources