Welcome

Troves being gleaned while surfing on the Internet mostly about computer/IT/system skills and tricks, Welcome here ...
Powered By Blogger

Disclaimer

This blog is written by the owner with real practices and tests and intended to hold all original posts except there is a clear declaration for referencing from others. Thanks for tagging with the source link or other tips for reference from here if you would like to quote partial or full text from posts in this blog.

Friday, August 8, 2014

WinEdit: Cannot Jump from PDF to LaTex source?

You may have already known about the convenient feature of WinEdit LaTex environment that allows you to jump from the generated PDF line, when clicking that line, back to the corresponding tex source line in the WinEdit editor window. This is immensely helpful and conducive to efficient Tex editing and revising. 

However, somehow you may find that the feature suddenly fails to work. That happens to me recently, making a lot of headaches when fiddling with how to fix it and bring the nice feature back to work. 

Regardless of how other online posts complicated this solution, here is the quick steps:

1. Download Sumatra PDF reader and install it (to avoid unnecessary trouble, just install it to the default folder, for instance 'C:\Program Files (x86)").

2. Open your WinEdit and get into 'Options' (from the main menu) -> 'Execution Modes'

3. In 'PDF Viewer' tab, set Sumatra PDF reader (the executable SumatraPDF.exe) as the 'PDF Viewer Executable'; leave 'Use --synctex switch when --src is enabled' unchecked; fill '--synctex=1' in SyncTex switch box

4. Move to the 'Console Applications' tab, choose 'PDFTexify' in the navigation menu on the left-hand side, fill '--pdf --tex-option=--synctex=-1' in the 'Switches' box.

5. Ctrl+Shift+'P' (or choose 'PDFTexify' from the 'Tex'->'PDF' menu items) to build your PDF; save settings and get back to your editing environment.

6. Now try to double click a line in the PDF, the beautiful functionality should play like a charm!


Solve PDF font-embedding really quick

To make your PDF files easy to view by others who may have a different font environment from where you generated the PDFs, you are usually in want of embedding all fonts in the files. In fact, many of the professional publishing agencies, such as the Conference Publishing System (CPS) of IEEE or ACM, have set mandatory requirements in that regard on the paper authors preparing the camera-ready versions.

This is the most straightforward recipe:

1. Open you problematic PDF in any application that provides a capability of printing (such as Acrobat Reader or Acrobat Pro).

2. Go to 'print' page and choose 'Acrobat PDF' as the printer.

3. Get into "properties" of the printer.

4. In the 'Adobe PDF Setting' tab, get into 'edit' next to the 'Default Settings' item.

5. Get into 'Fonts' from the navigation menu. 

6. Choose the 'Embed all fonts' checkbox. 

7. Select 'All' items in the 'Never Embed' listbox and Remove all of them.

8. Save the settings (a new setting will be created which can be used next time upon the same need) and go back to the 'print' page. 

9. Print your PDF into another PDF, where all fonts are now embedded.

10. Problem should be solved already. 

* To check if all fonts have been embedded: 
In Acrobat Reader/Pro, go to 'properties' from the 'File' menu, look into the 'Font' tab, 
for each successfully embedded font, there should be something like '(Embedded subset)'. 

Friday, April 4, 2014

Passing reference by value in Java

Having been sticking to C/C++ for a decade, I know relatively clearly about the notion of "passing by value" and "passing by reference/address", and the memory models behind them. Embarrassingly, however, it is just a recent clarification that "passing reference by value", a freak concept in Java, is not only in essence unequivocally different from the preceding two, but really closely related to them. Most important, this nuance in name but connections underneath is what has been confusing me for all times I was intensively programming in Java for the past two years.

Without re-spinning the explanation, I just simply summarize toward the gist about this topic, using the information in courtesy of Dale King, by posting the core question and the thorough answer to it.


Does Java pass objects by reference or by value? 

The answer is NO! (that is, Java neither passes objects by reference nor does that by value!)

The fact is that Java has no facility whatsoever to pass an object to any function, and the reason is that Java has no variables that contain objects.

It is common to confound the concept of an object reference variable with that of an object instance, but all object instances in Java are allocated on the heap and can only be accessed through object references.

So if I have the following assignment:

String g = new String( "Hello" );

 
The variable g does not contain the string "Hello", it contains a reference (or pointer) to an object instance that contains the string "Hello".

Java only has variables that hold primitives or object references. Both are passed by value. Now, it comes naturally that Java does pass (object's) reference by value. if the parameter being passes is an object (rather than a primitive type of value).