text

Vim - how to store and execute commonly used commands?

If I wanted to process a batch of text files with the same set of commands for example: :set tw=50 gggqG Can I save the above and run it with a shortcut command? ...

C#: How to bind the text of a winforms button to a resource

We have a resource file with lots of translated strings used various places in our application. Is there a better way for binding for example the text of a button to a certain string? Currently we are usually just doing something like this in the constructor, in a Load event handler or in a method called by one of those: someButton.Tex...

Blank text editor in Vis Studio

I have just installed VS 2005. I created a project. I added code to the project and then debugged the code. The program ran ok. I save the project. Everything saves fine. I go to open the project and the text editor is blank, or so it appears. After further investigation I notice that the code is there but I just can't see it. I ...

Content of h1 tag is invisible until moused over in IE 6

The bizarre symptom I'm seeing on this page (only when viewing with IE 6) is that the text of the <h1> tag is invisible when the page is loaded or resized, but appears when I mouse over the region where it appears in the upper-left corner. I haven't seen this with any other browser, and the only CSS attributes I'm modifying for any h1 ta...

Inserting Line at Specified Position of a Text File in Python

Hi, I have a text file which looks like this: blah blah foo1 bar1 foo1 bar2 foo1 bar3 foo2 bar4 foo2 bar5 blah blah Now I want to insert 'foo bar' between 'foo1 bar3' and 'foo2 bar4'. This is how I did it: import shutil txt = '1.txt' tmptxt = '1.txt.tmp' with open(tmptxt, 'w') as outfile: with open(txt, 'r') as infile: ...

Problems using MySQL FULLTEXT search

I have already posted a question about this, but the situation has changed sufficiently to warrant a new one. I have a MySQL table called aromaProducts in which there are 7 columns with the FULLTEXT index, and which has three records in it. When I make a query against it like: SELECT * FROM aromaProducts WHERE MATCH (title) AGAINST ('...

Is there a Python module for converting RTF to plain text?

Ideally, I'd like a module or library that doesn't require superuser access to install; I have limited privileges in my working environment. ...

Measuring text width in Qt

Using the Qt framework, how do I measure the width (in pixels) of a piece of text rendered with a given font/style? ...

How to update a printed message in terminal without reprinting (Linux)

I want to make a progress bar for my terminal application that would work something like: [XXXXXXX ] which would give a visual indication of how much time there is left before the process completes. I know I can do something like printing more and more X's by adding them to the string and then simply printf, but that would lo...

Keywords from String

Hi there, Does anyone know of an available PHP function that takes a piece of text, with say a few hundreds of words long and produces an array of keywords? Ie. the most important, frequently occuring unique terms? Thanks Philip ...

Parsing a XML File and Replacing Chosen Node With Values From Text File

I wrote a C# Winforms program to take a XML file and load values from a text file into each occurrence of that field which the user specifies on the UI. For whatever reason, the program inserts a carriage return on any nodes which don't contain a value. For example, it will do that to <example></example> whereas it will not misbehave on ...

Why does my text keep highlighting?

I am making a "toast" in vb.net, and whenever it pops up, all the text in the body textbox is ALWAYS highlighted...how can I remove the highlight programmatically? Thanks! Here is the code which seems to be automatically highlighting: Dim i As Integer toast.HeaderL.Text = headertext toast.BodyL.Text = contenttext ...

Mathematics textbook for program analysis

Im going to do a course on program analyis (dataflow analysis, abstract interpretation etc). What mathematics textbook will cover all the prerequisite math for this topic? ...

Java newbie: infinite loop searching for specific text in a file

I'm needing to locate a string on a particular line in a text file that is composed of several lines of strings. However, my loop to find the text or the end of the file is eternally searching. I know the string is in the file. Here is the code I am using to locate the text - but be warned, if you try it on your system even with a simple...

Algorithm for centering text based on length and font with vb .net

I'm making a user control, and I manually draw the text string, but I can't seem to keep it centered. I need it to stay centered no matter what the font, or string length. Thanks ...

Can someone help me with Dynamic Page Titles in Actionscript 3 Please?

HELP! How would I fix this Actionscript 3.0 so that it creates a Dynamic Page title for each page? I am new to Actionscript 3.0 and I am trying to generate a page title using Dynamic Text for each page. I have four pages in my site, and here is the actionscript that I have so far: stop () function createTitle (whichpage:String) { pageTi...

How can I resize an NSTextField to fit the text that it holds?

I'm using an NSTextField to display lines of text that will be printed on a printer with a variable paper size (the printer prints to a spool, which is cut to the appropriate length when the job is done). I can generate the text no problem, but I need to know how big to make the NSTextField (vertically) so that it exactly contains all o...

Why is duplicate text being rendered onto the Z buffer of a different texture when using D3DXFont::DrawText?

I've been stumbling over this for a while and was wondering if anyone has run into this problem before. The application I'm working on is divided into multiple data plots and a single timeline at the bottom of the screen. Each plot (which is actually multiple textures layered on top of each other) as well as the timeline is rendered to...

Java OpenGL Text Rendering

I have a GLCanvas on which I want to render some text. I'm actually using a 3rd party library that extends GLCanvas and it is doing most of the GL rendering. The 3rd party tool allows you to display images on it, so I've been creating images of the text and displaying it on the GLCanvas. That works, except the text doesn't really look t...

How to write XPath to capture text that is not tagged

I'm trying to scrap customer reviews from a site and ran into an interesting set-up. <div class="Review"> <img class="stars" etc> <b>ReviewerName</b> - yyyy-mm-dd <br/> <p>Review</p> <a>was this helpful links</a> <hr/> <br/> <!-- Repeat above for additional reviews. --> </div> For the life of me I can't come up with ...