Converting .rtf to .pdf in Haskell [closed] - pdf

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have a .rtf document (with an image, it's not just text), what haskell libraries are there out there to help me in my quest, or is it way easier than it appears?

Some years ago, I wrote a parser (in Perl) for a very limited and specialized subset of RTF, and even that was a huge project. It would be great if you want to write a general RTF parser in Haskell; but if you need to get work done, I recommend using an existing product.
Besides MS Word and web services suggested by others, here are a few other open source possibilities:
OpenOffice.Org has a good cross-platform RTF parser, though it might take some work to get it to run without human intervention.
GNU UnRtf
rtfreader, a port to Unix of Microsoft's reference parser.
rtf2latex2e
rtf2html
rtf2tex, rtf2latex, rtf2text, and rtf2troff for Unix from the early 1990's are still available, they might even still work on modern systems.
All except the last are available on MacPorts. Check your local Linux distribution for availability there. Follow the above links to see which of the above are available for Windows.
All of the above are in C, so it's possible to create Haskell bindings to them using FFI, with varying degrees of difficulty. The only one which I would expect to be really hard is OpenOffice.Org.

Call a web service to do the work such as the PDF Converter Services. It supports RTF.
I worked on this product so obviously I am biased. It works very well though, lots of happy users.

The first tool I would turn to is pandoc, however, it looks like it can only write .rtf, not parse it. Similarly txt2rtf supports writing .rtf, not reading it.
On the pdf side, HPDF has support for generating pdfs, and HsHaruPDF has some support for reading pdfs. line2pdf can generate pdf from ascii input.
Is it possible to convert the .rtf into a form pandoc can recognize?

Related

Scripting engine for OS X application [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am going to develop an application for OS X and I need some scripting engine for it.
The purpose of the scripts is to receive a text on their input (HTML file in most cases), parse it in some way and return the data to my app. These scripts should be easily editable by the users, therefore they should have some common used syntax like C or pascal.
Can you suggest some lightweight solution for this?
Thanks!
PS. I am new to OS X development, trying to switch from Windows...
Two suggestions:
Javascript, try the V8 engine. http://code.google.com/p/v8/ Very popular, likely familiar syntax to many.
Lua. http://www.lua.org Extremely lightweight and simple to connect. If your script editors write scripts for World of Warcraft, for example, they will know Lua.
In general AppleScript/Automator actions are easy for the end user to work with since the technology includes a GUI for building scripts without much programming knowledge. For experienced developers used to other languages, they can be a bit too friendly/loose and have a somewhat different syntax (more like plain English). The good thing is that they can also call other languages as needed, so a developer familiar with Perl or whatever could incorporate that into an AppleScript or Automator action.
Since you're talking about parsing text, Perl itself would be a good solution - again there's some difference in syntax, but the scripts can be rather compact and the basics of parsing aren't too difficult to learn. I haven't personally incorporated Perl into an OS X app, I've just used it on the command line, so I don't know if there are any pitfalls to that approach.
One additional advantage to AppleScript is that you can make your application itself scriptable so that users could automate the functions of your application into a larger workflow.
I would suggest downloading the free TextWrangler application by Bare Bones Software, or a similar developer's text editor, to see how they incorporate scripting into the application. This may give you additional insight into your approach.
LUA seems to be a good choice.

Tool to migrate from Embedded SQL to ODBC [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have a bunch of C code accessing database (Oracle, DB2 and Sybase) through Embedded SQL : the base code is the same, but with three different precompilers, three sort of executables are built, one for each database/platform.
I works perfectly fine, but we need now migrate to a solution using ODBC access.
The problem is : what tools / api can be used ? A direct way seems to write a custom precompiler (or modify an existent) to wrap all SQL and host variables calls to calls on an ODBC connection.
Can somebody recommend tools for that task or api to keep it simple ?
Or is it a simpler way, another approach ?
Thank you
As is usual for such situations, there are likely no off shelf answers; people's codebases always have a number of surprise in them, and the combination prevents a COTs tool from ever being economical for individual situations.
What you want is a program transformation system (PTS), with a C front end, that can be customized to parse embedded SQL. Such tools can apply source-to-source rewrite rules ("if you see this pattern, then replace it by that pattern") to solve the problem.
These tools require some pretty technical effort to configure. In your case, you'd have to adjust a C front end to handle embedded SQL; that's typically not in C parsers. (How is it that you can process this stuff in its current form?) You'll have trouble with the C preprocessor, because people do abusive things with it that really violate a parsers nested-structures-view of the universe. Then you'll have to write and test the rules.
This effort is a sunk cost to be traded against the effort of doing the work by hand or some more ad hoc scripting (e.g., Perl) that partially does the job leaving you to clean it up. Our experience is that it is not worth the trouble below 100K SLOC, and that you have no chance of manual/ad hoc remediation above 1M SLOC, and in between your mileage will vary.
At these intermediate sizes, you can agonize over the tradeoffs; that costs energy and time, too. Sometimes its just better to bite the bullet and do it any way you can an clean it up.
Our DMS Software Reengineering Toolkit is one of these PTS. It has a customizable C parser and preprocessor, precisely to help deal with these configuration troubles. The other PTSs mentioned in the Wikipedia article, do not, I beleive, have any serious C parser associated with them. (I'm the guy behind DMS).

Open source test report generation tool [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Background
The QA department where I work has a lot of automated blackbox tests that interact with our applications via the GUI and the command line. Currently, the automated tests output their results to standard out where we then manually enter the final pass/fail result into a spreadsheet.
We would prefer to have a system where the automated test automatically saves detailed test results to a file. We would then have a web page that the testers and developers could access to view the detailed test results and any necessary attachments. It would generate reports of the test results by project and version number.
Question:
What system would you recommend for test report generation? We need a system where our tests will automatically be inserted into new reports and that is preferably open source. I'm interested in what your company actually uses or what you have found useful in managing test results.
Our QA department is capable of building a simplified version of this system from scratch, however we would prefer not to reinvent this.
We are now using Testopia. it is integrated with Bugzilla, it is nice to have everything at the ame place. It uses the same XMLRPC API interface as Bugzilla.
reStructuredText is a very happy medium between writing to stdout and formal documentation. There are several scripts to convert from rst to other formats such as html.
You could mostly keep the system you have in place -- you'd only have to add a couple "tags" around the text, but unlike HTML tags, these are more readable characters. In fact, it's very close to the markdown you use when asking/answering here on StackOverflow.
The stdout text remains overall very readable by humans, but then it's as simple as adding one script in the chain to render to HTML or PDF for instance.
This page has a very good example of what it looks like in plain text and rendered forms.
Maven has an an extensive site mechanism, it does require you to bend to its will though, so that might rule it out for you.
Once configured you get a standard set of reports generated on each build, that can be packaged as a jar if you wish, or deployed directly to your build results site. There are plugins for many of the major reporting tools, such as Cobertura/Emma, Junit, JDepend etc.
The maven-site-plugin publishes its own sites if you want to have a look.

cognos API and examples [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Can anyone point me to a cognos API document and some example code? The best for me is that the API can be access thru python. But examples in other languages are good also.
The Cognos SDK for .net is horrible; I know because I just spent 3+ days trying to get even basic functionality working. Its clear that the person who developed the sample applications has no idea how to work with Web Services or .net.
I managed to find a Cognos.WSDL file that you can try to use to generate your own proxy classes; but; its not WS-I compatible and thus won't work with wsdl.exe
The cognosdotnet.dll and cognosdotnetassembly's are overbloated. There are nearly 1000 classes defined in there. They basically wrapped up their entire API set into a single assembly.
Cognosdotnet.dll defines all the types; and many of them are confusing to work with; but all the raw materials you need are there.
Cognosdotnetassembly.dll defines the serializers. Why they even include them is beyond me. This file is huge (46MB) and provides zero value. The problem is that there is a dependency on this assembly with the type definitions (cognosdotnet.dll).
What I ended up doing was taking Refelector; and code generating the cognosdotnet.dll; then removed the dependency on the serializers. I then created my own wrappers around it to make the API more friendly.
I would recomend starting with the reportrunner example as a starting point; to at least try and get your connectivity working etc..
You haven't indicated which version of Cognos you're seeking assistance for, but if it's for Cognos 8, you should have the full API docs and sample code if you have the Cognos 8 SDK.
The SDK samples are provided mostly in Java, though some are .NET.
The SDK Developer Guide (again, Cognos 8) should contain enough information to help you get started on putting your own library together.

Compare and contrast the lightweight markup languages [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
Please identify the most popular lightweight markup languages and compare their strengths and weaknesses. These languages should be general-purpose markup for technical prose, such as for documentation (for example, Haml doesn't count).
See also: Markdown versus ReStructuredText
I know of three main languages used commonly in the greater programming and tech community: Textile, Markdown, and reStructuredText. All three can be learned in a couple of hours or "winged" with the cheat sheet nearby.
Textile
Used by Redmine and the Ruby community
113 questions currently tagged on Stack Overflow
The most similar to HTML, but least readable source
Easiest nested lists of all three languages
Not understandable to non-programmers or the HTML-ignorant
Ideal for complex short documents (with links, nested lists, code, custom HTML); for example: short documentation, how-tos, blog or CMS content
Syntax reference
Markdown
Doesn't seem to have a home language "community" but...
1274 questions tagged on Stack Overflow*
Emphasizes source code readability, similar to email traditions
Straightforward HTML embedding (you just type the tags out)
No way to make tables besides embedding HTML
You know it already if you know Stack Overflow
Easy to learn if you already know reStructuredText
Automatic email address obfuscation for the format <address#example.com> (with angle brackets)
Syntax reference
reStructuredText (A.K.A. ReST)
Popular in the Python community
285 questions tagged on Stack Overflow
A bit persnickety about whitespace and alignment if you ask me
Lists (especially nested lists) and paragraphs always seem to get in fights
Readable by non-programmers
Only format which can build a table of contents (via an extension in the Python reference implementation)
Directly converts to other formats like PDF and XML
Ideal for large documents with lots of prose (e.g. an alternative to docbook for a user manual)
Syntax reference
You might also consider asciidoc
relatively readable markup
straightforward command-line use
some might perceive it as relatively 'picky' (vs. flexible) with respect to syntax
docbook and (x)html output
The Wikipedia page on lightweight markup languages has a good comparison between the various options, as well as showing syntax for common uses (headings, bold, italics, etc.)
I am attempting to cover all the various lightweight markup languages here:
http://www.subspacefield.org/~travis/static_blog_generators.html
As you can see, it started with "how can I make a secure blog" - i.e. one that generates static HTML, and I found myself ensnared in markup languages, templating systems, etc.
Update
I refocused only on LWMLs with python implementations, and theyre here:
http://www.subspacefield.org/~travis/python_lightweight_markup_languages.html
So far I've tried markdown and ReST, and I like the latter better for anything but
HTML snippets embedded in other pages. Tables, cross refs, indirect links, etc...
for documentation?
how about doxygen?
I've use it for some of c/c++ project that I need to documentize.
Even you can 'abuse' it just like doxygen author uses for doxygen documentation