Is there a way to fix corrupt myfaces captcha image? - jsf-2

I'm using JSF myfaces 2.0. The captcha image is corrupted on screen. The OS is RHEL 7.4.
I'm using new OS, RHEL 7.4. I downloaded tomahawk20 sources and debugged the code. Found that captcha text is generated properly in class CAPTCHAImageGenerator.class. However, captcha image is corrupted (geometric shapes in the box like triangle, line, arrow, carrot symbol etc.) on screen.
Expected: Captcha must be readable.

I solved it on my own. The drawTextOnImage function of CAPTCHAImageGenerator class in tomahawk20 uses Arial font. Pls. install Arial font on your machine and retry. It will work. enjoy!

Related

Printed Plots are all Black with Octave in Cygwin using gnuplot

I've been trying to setup Octave in cygwin and it was straight forward to get it up and running, however I cannot print plots to a file properly. When I plot in Octave I see the plot on the screen correctly, but printing it to a file only results in a black rectangle with axis markers.
From what I've researched it appears that gnuplot 5.0 has a bug in it (http://savannah.gnu.org/bugs/?42838). I tried reverting to gnuplot 4, but it did not work in cygwin and complained about not having the cyggd-2.dll file. I tried finding the package in cygwin that had this file (libgd2) but it doesn't exist in cygwin's package repository anymore and has been replaced by libgd3.
I also tried upgrading to gnuplot 5.1 by downloading the binaries from (http://www.tatsuromatsuoka.com/gnuplot/Eng/cygbin/). However, this didn't seem to resolve the problem; though it's possible that I did not install them correctly.
At this point I'm not sure what else to try. I've tried different file output formats, but all give the same black rectangle with visible axes. I tried EPS, PNG, JPEG, and PDF.
Has anyone been able to get Octave to correctly print figures with gnuplot 5 in cygwin? If so, how? What do I need to do?
Could I possibly use another graphics toolkit? I looked into using FLTK, but couldn't get that to work either. I can register the FLTK graphics toolkit, but when I attempt to instruct Octave to use FLTK for the graphics toolkit I receive the following error: __init_fltk__: no graphics DISPLAY available
I could get around by manually pointing to gnuplot 4.6 which I had on another cygwin installation
i.e. replace /usr/bin/gnuplot.exe with 4.6-version and copy folder /usr/share/gnuplot/4.6/
I'm using Octave 3.8.2 on a windows7x86 machine

How to change Opencv image viewer?

I have installed OpenCV on my desktop and laptop which they have Ubuntu 14, and i have some problem with its image viewer.
First of all when i type :
./facedetect --cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_frontalface_alt.xml" --nested-cascade="/usr/local/share/OpenCV/haarcascades/haarcascade_eye.xml" --scale=1.5 [address of my image]
It shows my image with its image viewer , but it isn't resizabe on my desktop and it don't show control buttons at top of it on my laptop.
How can i fix these problem or can i change its image viewer ?
Opencv uses in many demo applications its own GUI (highgui), its features are limited and are platform-dependent. For example, I think that the "auto-zoom" feature that enables you to see the pixel values is available only on Windows. And, although recent versions added some Qt support to add somes features (buttons,...), the app has to be build to enable these features, and this is probably not the case in your example.
However, you can always edit the code of these apps (here, the facedetect app) so that it just saves the images on disk, instead of showing them on screen. Then rebuild. Or add yourself the buttons you want, see the manual.

TextMate ToolTip Fonts

i'm new to textmate.
for the "complie&run" job for the java bundle, i set the output: "Show in tooltip" format "text". Everything works exactly as it should. The problem is the tooltip font is not proportional to the font of the text. for ex, doing a "Command+" or "Command-" doesn't proportionately change the font-size of the tooltip.
i also tried $defaults write -g NSToolTipsFontSize 24.0 which does a good job for chrome/safari browser apps (tooltip gets larger) but not for mate.
To know exactly what i mean here's the dropbox link: TextMate ToolTip Image
i am using textmate2, lion 10.7 on a macbookpro.
thank you all in advance.
I'm using Mavericks and needed that as well but could not get NSToolTipsFontSize to work; upon requesting the support staff at to help, they have added the support for that in their edge build.
Now I can use
$defaults write com.macromates.TextMate.preview NSToolTipsFontSize 24
I checked it and it works for me. Please see their response below:-
We’ve added support for this value now, it is available in the current edge build. Go into Preferences and do to the Software Update tab and hold option while clicking check now, you will get r9569 with this added.
(Note that this won’t cover popups created via TMDialog but only those created as output from bundle items, but this will cover 95%+ of the cases.)
com.macromates.TextMate.preview did not work for me on Mac OS 10.13 with TextMate 2.0 RC 10... Below default command rather worked
defaults write com.macromates.TextMate NSToolTipsFontSize 24

measureit alternative in firefox?

I used to use an add-on for firefox called measureit. Now its not working because of firefox keeps updating all the time and the developer hasn't come out with a version of measure it that is supported by newer versions of firefox. Does anyone know a good pixel ruler add-on for FF?
You could download the web developer toolbar. It has a ruler built in. Once you install it, it will appear in your menu bars in firefox. Click on miscellaneous, then click on display ruler.
You could also try searching "pixel ruler".
Not a Firefox extension (it's a Windows app), but you can try Ruler. It's a simple too that does what it says. You don't even need to install it, just click and use.
It can stay on top of other windows, you can drag the borders to resize and switch between vertical and horizontal rulers. You can even open multiple instances.
I had the same issue with MeasureIt, it stops working with some Firefox updates. I found Ruler and been happy with it so far.
Since I upgraded Firefox Developer Edition there have been serious incompatibilities with my previous add-ons.
Measureit add-on is one of the extensions that are not up to date with the new browser.
I found this alternative that works just fine though not as good as Measure it. https://addons.mozilla.org/en-US/firefox/addon/browser-ruler/
If you are on Firefox developer option click on the tools icons > choose to Get more tools > search for 'ruler' and add it.

Any good PDF export filter that works with Fast Report?

I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices.
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also didn't work. So I'm searching for another option.
If you know or use a PDF export filter which works with Fast Report, please let me know.
November 2015: Fast Report now have PDF/A support, with this option enabled the PDFs are fine on all platforms.
October 2014 - Fast Report 5 still seems to generate "Windows-only" PDF. A production-ready solution for this problem would be a benefit for cross-platform developers, given that Fast Report is the report generator bundled with Delphi.
Here is a fresh example generated with the Fast Report 5 demo, displayed with Adobe Reader 11 on Android 4.4:
And on Windows:
Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available.
I'm not sure that should be taken literally, considering PDF is supposed to be a cross platform format. It more likely means they don't actually have the time, equipment or expertise to test with those platforms. The PDF export filter that I'm using is the one built into Fast Report! It surely has some bugs, but I managed to work around them. And I think that might also work for you: Start with a simple document that does export properly, start adding features until it brakes, then you know what brakes it and you'll know how to work around the problem.
From my experience, here's what got me into trouble:
Rounded corners in the PDF document didn't look like the ones in the Fast Report preview. My fix: Found a combination of settings that made the exported PDF look exactly like the preview document. For me rounded corners were just a cosmetic feature, and with cosmetics there's no "One Look"; The alternative worked just fine. This might actually be fixed in the most recent version, but I didn't bother changing the document to test.
Transparency issues and outline issues. When working with the Fast Report editor (and when looking at it's previews) it's easy to overlap objects. You don't see this because of the object opacity. When exporting to PDF overlapped objects somehow managed to "print" outlines, and it obviously looked ugly. My fix: pay closer attention to those objects, make sure they don't overlap or make sure they don't generate outlines if no outlines are supposed to be seen.
Also make sure you test using ADOBE Reader, on any of the given platforms. If it works with the Adobe reader but doesn't work with other readers, there might be a bug in the 3rd party reader!
Edit: Here (link) is a sample PDF document generated by my Fast Reports application. I have no idea what kinds of documents you generate, but in my book that's a mighty complex document. Notice the diagonal line that starts where the table data ends, notice the embedded images (bar code, stamp, signature).
I opened that document on the following mobile devices:
iPad, running iOS: The document renders 90% ok. Images are not rendered at all, but they're not important to my document (and that's very likely a problem with the iOS reader). All the fancy colored lines and rounded corners are properly rendered. Some text is not properly rendered, and I'm pretty sure that didn't render because the "box" that contains it is too small for the contents. That most likely happens because I didn't embed the TTF fonts into the PDF and the Apple font on iOS didn't perfectly match the Microsoft font that was used on Windows.
Samsung Galaxy S2, running Android 2.3: The document renders 100% correctly.
Samsung Something(??), running Windows Mobile 6.5 and the FoxReader: The document is totally gibberish: pictures showed up but the spacing between letters was messed so bad it's impossible to read. I blame the reader, it's not Acrobat and it probably wanted to be "smart". And it broke it's teeth in my text encoding, because my text is not English.
About the PDF format: A document is "PDF" if it conforms to the standard, here's some Wikipedia info on that. In theory a PDF document should render exactly the same way any way you look at it, but there are forces at play that might work against this:
Not all readers are "Adobe Acrobat". In theory they're all compatible, in practice they're most like not 100% compatible.
PDFs that don't embed fonts depend on the fonts available on the host system. If they're not the exact same fonts there's trouble ahead, because they might have slightly differing sizes. Since we're talking about PDF's that were generated on Windows and opened on iOS or Android, those are obviously different platforms and they're guaranteed to use different fonts (because fonts are licensed, and I doubt Microsoft will licence it's fonts to Apple. I also doubt Apple would want Microsoft fonts). One possible solution is embedding fonts, but that makes your PDF files significantly larger.
AFAIK you can export your Fast Report pages as metafiles (i.e. vectorial Windows format, which is in fact a raw serialization of GDI commands).
Then you could be able to render those metafiles into PDF using our Open Source SynPDF library. It works from Delphi 5 up to XE, is Unicode ready, can embed true type fonts, and even create PDF/A files.
It is also able to export metafiles included in reports as vectorial pictures (and not bitmaps), and could therefore highly increase the pdf quality and at the same time shrink its size.
See for instance how it can be used for QuickReport. A similar technical should be used with Fast Report.
The Gnostice support answered my e-mail which I reported that their trial installer didn't work and send me some tips about which could be the problem and I was able to install it.
The company I work for already bought me a license and I already replaced the Fast Report Export Filter, which was a task as simple as droping 2 components on the same Form as the frxReport Object and setting 2 or 3 properties.
Also, to export the report programatically was also 2 lines of code and the information was easily found in their FAQ.
In the end, based on the recomendations and after looking for other options just to find abandoned components which doesn't have any updates for years, the Gnostice eDocEngine was the best solution.
Just hope they make their installer a little more "Programmer Friendly" as if it had complained about the lack of Fast Report's units in the search path I would've been able to at least have an idea of what was going on, instead of just getting an error and blaming them for having a trial installer which didn't work.
After replacing the filter and generating the PDF's using the eDocEngine component, the PDFs now work the same in iOS, OSX and Android.
Here is my workaround solution. It's not an universal one, but helped me in my case.
The main idea: use in report font with small file size (I've found Arial-like font with cyrillic charset with size 57kb). So the exported files can be 100-200 kb.
Details is here:
http://dev-doc.blogspot.com/2013/03/fastreport-4-font-reading-and-huge-file.html
I use wPDF from WPcubed components, it's really a great product, good value for money
You can always install one of the PDF printers. These are in fact PDF convertors that install as windows printer. They work from any application including FastReprt components - just print on them.

Resources