ms search text ifilter - file

I'm a newbie in MS Search so please forgive the dumb question :-)
I'm storing a large amount of specialized text files for a card game (bridge).
These files are plain textfiles with a specific format to describe a bridge game played in a championship.
The only difference with a regular .txt file is the file extension that is NOT ".txt" but ".lin"
What I need is implement a new iFilter that is an exact copy of the standard MS Search text iFilter, but with another file extension.
Is this possible by copy/pasting an existing filter and tweaking (tampering) its content?
Or do I have to use c# to edit the iFilter and recompile?

The Windows 7 SDK has a sample IFilter implementation that would be a good blue print for what you are trying to do. It contains a project called "SmpFilt" The code shows parsing of a text file with a custom file extension. You will need to modify the code to parse your text instead and pull out any custom attributes from your .lin files.
Unfortunately, you can no longer build custom IFilters with managed code (C#/VB, etc). The sample project is in c++. Windows 7 and Server 2008 won't load IFilters written in managed code.
Good luck.

Related

Is There a Way to Make a Mainstream Code Editor Treat the Contents of a Database Field as if it were a Code File?

I'm working with a scriptable CAD/CAM system that runs on Windows 10 whose built-in code pane is not very useful. The user-defined scripting code for this CAD/CAM system is not saved in text files, but rather, in a field in an SQL Server. I'm thinking there might be some way of setting up Visual Studio/VSCode (or maybe Notepad++) to work with the code in the database the same way it would do if were in a text file. I could probably set up some sort of .Net FileSystemWatcher utility that keeps a bunch of code files it sees in a directory synched with code in the SQL Server data field. But I have deadlines, and I'm supposed to be scripting this CAD/CAM system--not building tools to script the CAD/CAM system. Any ideas for a "quick fix"?

Parse and Display ESC/POS file in windows

I am trying to parse an ESC/POS file which is created by the POS Printer Driver and display it on windows. Unfortunately I couldn't find any parser / renderer for that and I've been researching this for 2 weeks now.
All the existing solutions are build for the other way around, meaning - for creating ESC/POS files but I need the opposite direction which is taking an existing ESC/POS file and display it in my windows application.
Does anyone have an idea how this can be done? Thanks!
The language is dead simple and well documented. Of course, there may be extensions for newer printers or other vendors, but in two weeks you could have written a parser.

How to use Sphinx3 in an application

I used Sphinx4 for some time which really fits my needs. I load a recognizer, pass the audio data to it and use the recognized String in my application.
Right now I'm working on a C application (C++ is unfortunately not an option) where I need something similar and thought that I could use Sphinx3 which is written in C.
The problem is that I don't really know how it is used inside an application and there is no "Hello World"-example as Sphinx4 provides it.
I already compiled and installed sphinxbase and sphinx3 and now I can include the sphinx header files in my application.
Now to my questions:
Is there a "simple" and well documented example application that uses sphinx3 from a C environment?
How can I load up the sphinx3 engine and call a recognizer with my binary audio data?
OR: Do I need to start an application like "sphinx3_decode" and call it from my own application? If so, is there an example application for that?
Thank you in advance!
Best regards,
Robert
It's not recommended to use Sphinx3. From the website:
Sphinx-3 is CMU’s large vocabulary speech recognition system. It’s
older C based decoder that we continue to maintain. It’s planned to
make it obsolete in the future, it’s still most accurate decoder for
large vocabulary tasks. We are using it as a baseline to check the
recognizer accuracy. This decoder is only intended for researchers who
want to evaluate bleeding edge methods in ASR like tree search method.
If you need to use a decoder you should use pocketsphinx. You can find the tutorial and the API documentation on the website
http://cmusphinx.sourceforge.net/wiki/tutorialpocketsphinx
http://cmusphinx.sourceforge.net/api/pocketsphinx/pocketsphinx_8h.html
I Recently worked on an Intregated Project on Punjabi Language.
Here are some steps that we used...
First we recorded the punjabi audio data in a vaccumed room in 16000 hz sample rate.
Then we took the recorded data and segmented it using Praat Software into small wav and raw files of 2 to 30 sec and saved them in a folder named train.
Then we took a system having Linux ie. Ubuntu and installed the required plug in like autoconfig, automake etc and untarred Sphinx 3 along with 4 packages that are cmuclmtk, pocketsphinx, sphinxbase, sphinxtrain.
Then according to the small wav files we made many files like transcription, dic, phone, filler, file id, ccs etc.
Then we opened the terminal and typed –"sphinx_fe” to check the whether the sphinx is functional or not.
Then we created an folder named “man” and then in terminal wrote its path.
Then we run the command- “sphinxtrain –t man setup”. By running this command an folder named “etc” will be formed in “man” folder containing files “feat_paramas” & ”config”.
Changes were made in the in the config file according to our data.
Then we moved all the files that we created before ie. transcription, dic in the etc folder in that is located in man folder.
Then we placed ‘lang1.sh” script in etc folder and remaining 4 scripts in man folder.
Then we opened the path for etc folder in terminal and run command- “lang1.sh”
Then we run series of commands in terminal – “mfcgen2.sh” then “verify3.sh” then “hmm4.sh” and at last “end-test.sh” to get the final result.
Rest if you have worked on Sphinx 4 then you may know about the files that are mentioned above in the steps. I hope this helps you.

.NET 3.5 - Open a PDF directly from stream in native viewer

I'm working on a WinForms C# 3.0 / .NET 3.5 project involving building some canned reports. One of the requirements of the project is to export to PDF format, and currently doing so to disk is working just fine. The question was raised, however, if it's possible to export the file to a stream and open it directly in the native viewer on the client, skipping entirely writing it to disk. I know that this is somewhat possible with ASP.Net through the use of Response.Write() headers and the like, but I need to try to do this with standard WinForms/WPF, and I've exhausted my own ideas for it. Anybody have any insight on how it might be done, if it's possible at all? Or does the file have to be written to disk first, then opened separately?
I think it is important that you ask yourself what you accomplish if you bypass the file system. Writing to a the standard temporary folder is a perfectly acceptable solution. This is typically how browsers let you view media files and pdfs. I would concentrate on writing a nice cleanup function, that removes the temporary file after it has been create. Also what would be the purpose of exporting to PDF if you are not saving the file?
Under Unix / Linux you could have made a named pipe in the file system. This make sense if you have a huge media stream that you want to buffer between applications. In the PDF case you win very little.
Export to a temporary folder. It is Ok.
You will need to write the PDF to a temp directory.
The only way to display a PDF from an in-memory stream is to embed a third-party PDF viewer control

How can I programmatically create PowerPoint presentations. On Linux. For Free.

I'd like to create a PowerPoint (not Javascript/HTML/PDF/Keynote/.mov) using code (any language, C preferred) for free.
(I've seen this SO question which references how to create them in C#)
Is this even possible? How can I write the raw bits that make up a PowerPoint file? Any good libraries for doing this?
UPDATE The Microsoft Reference Page for the binary format is here.
Open Office has an API. You can use the C++ bindings (doc available here). If you really need C, you'll have to do some wrapping.. but hey, it's Christmas, isn't it ;-)
Open Office has export functions to create .ppt compatible files.
PowerPoint you may not, but OpenOffice Impress you may. (Yoda style answer :) )
Take a look at the ODF Toolkit project. They aim to produce lots of libraries for generating this kind of content programatically.
Unless you're specifically interested in PowerPoint 2003 binary files, PowerPoint 2007 and up .PPTX files are actually a collection of XML files inside a zipped file. You can see that, by simply renaming a .pptx file to .zip and opening it.
You can create these XML files in any way you like, such as writing code to do it.
PresentationML defines the powerpoint XML documents, have a look here for example:
http://msdn.microsoft.com/en-us/openspecifications/hh295812.aspx
The standards could be found here:
http://www.ecma-international.org/publications/standards/Ecma-376.htm
If you don't mind going to Java, Apache POI provides readers and writers for most MS Office formats (up to the 2003 version anyway).

Resources