How to set comments generator in English locale& in visual studio? - visual-studio

I want to merge resorces file, but user 1 has resources file with russian comments (his visual studio in english, but generates russian comments, like
/// <summary>
/// Ищет локализованную строку, похожую на ANPR camera images receiving error.
/// </summary>
but I need
/// <summary>
/// Looks up a localized string similar to ANPR camera images receiving error.
/// </summary>
And there are a lot of such points in resource file to merge in smart git.
What could be suggested to resolve my issue?
Appreciate any help.

Related

Adobe Reader cannot read fonts from my project?

I am generating the PDF using iTextPdf version 5 and am using Calibri font inside that PDF. I have loaded that font from the src/resource/fonts folder as I am working with Boot. All is working fine as I can view that PDF in my project and download also except that when I am trying to open the PDF using Adobe Reader, than the page is showing something like that-
I have opened that PDF using Google Chrome, WPS office and other PDF Reader and that PDF is working perfectly fine but I can't seem to understand what is wrong when I am trying to view the PDF using Adobe. I have also attached the screenshot of PDF in WPS office below -
Here is the code that I have loaded the font in my PDF -
static URL calibriFont = UserProfileController.class.getResource("/static/fonts/Calibri Regular.ttf");
static Font namefont = FontFactory.getFont(calibriFont.toString(), 20, Font.BOLD, new BaseColor(139, 0, 0));
FontFactory.register(calibriFont.toString());
Here is the PDF File link shared below -
Sample PDF
In short
Additional data was added to the PDF after initial generation, introducing a cross reference error. Take the first 1019493 bytes of the file to get the original working file.
My first guess would be another program postprocessing the PDF incorrectly but as it turned out the iText objects were closed incorrectly resulting in that error.
In detail
The final version of the PDF you shared is not generated by iText, at least not by correct iText usage.
The file has a size of 1021972 bytes. The initial 1019493 bytes constitute a valid PDF.
The extra 2479 bytes extend the PDF providing some updated old object, some new objects, and a full cross reference table. And in this cross reference table the offset entry for the first new object 33 is incorrect, it should be 0001019493 (the first byte added after the original contents, i.e. the start of the first new object) but it is 0001018667 (the start of the cross reference table of the original PDF).
Thus, a PDF processor will incorrectly find the original cross references when looking for the new object 33.
As the object 33 happens to contain the FontDescriptor of the font Calibri in the updated object 1, an attempt to parse this font fails. This font is referenced from all document pages.
As a results, Adobe Reader stops drawing each page as soon as it comes across an instruction using that font.
Some other PDF viewers repair that error under the hood and, therefore, show you what you want to see.
The actual cause
In a comment you write
The error was coming due to PdfWriter instance object was closed before document.
Indeed, you are not expected to close the PdfWriter at all, and in particular not before the Document.
When requesting a PdfWriter using PdfWriter.getInstance for a Document, a PdfDocument instance is created and registered as listener of the Document; then a PdfWriter is created and registered as listener of the PdfDocument.
To finalize the PDF generation you are expected to close the Document. This will call its listeners' respective close methods, i.e. PdfDocument.close, which will finish some last objects, write them, and then call its own listener's close method, i.e. PdfWriter.close, which will write the cross references.
In your code you first explicitly called PdfWriter.close (which wrote the first cross reference table) and then Document.close (which caused PdfDocument to write some objects and then trigger PdfWriter.close again to write the second cross references). This incorrect sequence also resulted in an incorrect cross reference offset.
I have found the solution of my problem as what I was doing that, I have closed PdfWriter instance before the document. When I closed that instance after the document, it was working fine.

Google Project Tango, taking pictures while tracking motion

I'd like to use the Google Tango motion tracking while taking pictures. The Tango service precludes using the android camera API. From what I can tell, it's not possible to control the camera (ISO, exposure, white balance) or take still shots while the Tango service is running. True?
The online java API documents show that TangoConfig has a constant called KEY_BOOLEAN_COLORMODEAUTO, but the TangoConfig class declaration in the TangoSDK_Leibnitz.jar does not have it. Is there a way to control the camera? If the java API does not support this, does the C API?
Theoretically, the OnFrameAvailable is what you want - it returns a regular image stream from the color or fisheye camera via callbacks. That said, it was busted several releases ago, and for the latest release (Leibnitz) there seems to be some confusion over format, and some concern over stability. DO NOT try and acquire the camera yourself, or Tango looses access to it
From what i can tell, you have access in C API (and latest Leibniz release) to disabling auto camera config and then set ISO params (i tried yesterday), and the cloud acquisition AND color frame acquistion is running fine. But this seems to be for Color Cam only ( not explicitly said, but FishEye seems not tunable like this).
Extract of comment from tango_client_api. h :
"
The supported configuration parameters that can be set are:
///
/// <table>
/// <tr><td class="indexkey">boolean config_color_mode_auto</td><td
/// class="indexvalue">
/// Use auto-exposure/auto-whitebalance with the color camera. Defaults to
/// true, and
/// if true, the values for config_color_iso and config_color_exp are ignored.
/// </td></tr>
///
/// <tr><td class="indexkey">int32 config_color_iso</td><td
/// class="indexvalue">ISO value for the color camera.
/// One of 100, 200, 400 or 800. Default is 100. Only applied if
/// config_color_mode_auto is set to false.</td></tr>
///
/// <tr><td class="indexkey">int32 config_color_exp</td><td class="indexvalue">
/// Exposure value for the color camera, in nanoseconds. Default is
/// 11100000 (11.1 ms). Valid from 0 to 30000000. Only applied if
/// config_color_mode_auto is set to false.</td></tr>
...
"

Comments in Doxygen .dox file

I have a .dox file and want to insert some comments that will not be
displayed in the actual documentation.
Have tried using only //, Horever, when I tried, all the text ir removed.
/// \defgroup desc_polyhedra Polyhedra
///
// If you want to prevent that a word that corresponds to a
// documented class is replaced by a link you should put a % in
// front of the word.
///
/// \section Polyhedron
///
/// A polyhedron is a solid in three dimensions with flat faces,
/// straight edges and sharp corners or vertices.
///
/// Amongst the many examples of polyhedra, the Cuboid and
/// Prismatoid structures will be considered in more detail.
/// Here is a brief summary of cuboids and prismatoids.
A couple of options here:
Surround the text you want left alone with \cond ... \endcond
Have a completely separate comment section with only // - i.e. don't mix // in the middle of the /// section. What you are seeing is that the first // ends the doxygen comment block, so it stops coming out in the output.
Use HTML comment syntax within the doxygen section /// <--! A comment is here -->

Strip Images from Pasteboard

Can someone please guide how I can strip images from attributed text on the pasteboard?
EXAMPLE
I have a UITextView that supports NSAttributedString. If I allow a user to paste something from the pasteboard that includes an image (say a picture and some text that was copied from a web page in the Safari app), it will crash my app when I try to save it:
*** Assertion failure in -[NSHTMLReader _addAttachmentForElement:URL:needsParagraph:usePlaceholder:], /SourceCache/UIFoundation_Sim/UIFoundation-78/UIFoundation/TextSystem/NSHTMLReader.m:1478
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unable to find missing_image.tiff!'
This only occurs when an image is part of the source copy. Why it refers to tiff I don't know, as the source images I've been testing with are jpg and png.
As described in a related post with slightly different goal, my workaround to avoid the crash is to force the pasteboard to a regular string:
- (void)paste:(id)sender
{
UIPasteboard *pasteBoard = [UIPasteboard generalPasteboard];
NSString *string = pasteBoard.string;
[self insertText:string];
}
This does prevent a crash, but it also prevents the user from pasting any formatted text. Say bold, or italic that may have come from the Mail app.
So best I can tell, I need to strip any images from the pasteboard so as to allow the text formatting to be retained. Thanks for your help.

Issues with Chrome Mac and Flash

I have a simple 250k flash movie a page i'm developing. The flash movie causes scrolling, javascript animations, and overall performance to be slow.
Here's the code
<object type="application/x-shockwave-flash"
data="/media/slider.swf"
width="520" height="348">
<param name="autoplay" value="true">
<param name="movie" value="/media/slider.swf" />
<param name="quality" value="high"/>
</object>
The page performs normally on every other browser and OS pare i've tried it on. I've heard that the Chromes flash player on mac causes crashing and performance isn't great, but i'm having trouble finding a fix.
Any one having any success with this?
EDIT
Here's a sample page I put up real quick with the error. If you resize your browser and have the blue block visible with and without the flash, then hover you should see the error.
http://dev.danielcgold.com/flash/
I have tested your code and overall performance is not so bad, though scrolling is slow, indeed. :( Setting wmode param to opaque gives some improve, pastebin.com/FfQLjVbg, but also I suggest to decrease fps to 10 and review animaitons in your swf clip.

Resources