text

why does this method return the same random string each time?

I need to create a block of unique lines to test a different project im working on. so i created a simple program to generate a random string of X length. The issue is that if i call it once i get a random string if i call it again (in a for loop for example I get the same string for the entire execution of the loop. I have a feeling ...

Removal of ¶ (pilcrow) from pasted text

Users are pasting text from Lotus Notes into my VBA application. This is then being stored in Access. Sometimes the pasted text includes what I assume is a carriage return which, when pasted into a single line form control, is displayed in the application's forms as ¶. However, as this won't paste in to the VBE, I am unable to add thi...

Find the word the mouse is over for Text component (Flex/Actionscript)

Is it possible (if so how) to find out what word the cursor/mouse is over when it is moving over a < mx:Text > component? So for example as the user moves the mouse along a sentence (inside text component), each word will highlight as they go (I know you can highlight while pressing the mouse button down - but that not how I wish to do i...

How to convert byte[] to that text format?

Hello, I can say I don't know what I'm asking for help,because I don't know the format,but I've got a picture. I have a byte[] array ,how do I convert it to that format below(in right)? Its not plain ascii. ...

Turn a single sed command into a reusable Textmate command

I have 7 lines of text: a b c d e f g Now I want to add characters to the end of each line, to end up with: a, b, c, d, e, f, g, I found that I can use the "sed" command and run my selection through sed using "Filter through command" in Textmate sed 's/$/,/' Now, one question remains: how do I turn this into a Textmate command t...

How to get text right clicked + ctrl from any program and use it in my own program?

what I wanna do is similar to any text hooking app like Runtimeeditor and many more. But the difference is that I am making a dictionary and want to add a functionality of quickly searching words from any program. So I wanted to make some hooking stuff to get the text which is right clicked and ctrl is pressed at the same time. I mean th...

Text rendering control in GDI+

I've been struggling for a while with the text rendering in GDI+. We are dynamically generating images of headlines but there seems to be a lot to whish for in the library. I can set the font, font size and a few other things but I cannot control row height or letter spacing. I have built my own class that takes a generated text image,...

Modify a .txt file in Java

I have a text file that I want to edit using Java. It has many thousands of lines. I basically want to iterate through the lines and change/edit/delete some text. This will need to happen quite often. From the solutions I saw on other sites, the general approach seems to be: Open the existing file using a BufferedReader Read each l...

How to separate content from a file that is a container for binary and other forms of content

I am trying to parse some .txt files. These files serve as containers for a variable number of 'children' files that are set off or identified within the container with SGML tags. With python I can easily separate the children files. However I am having trouble writing the binary content back out as a binary file (say a gif or jpg). ...

Is there a way to convert from a string to pure code in C++?

I know that its possible to read from a .txt file and then convert various parts of that into string, char, and int values, but is it possible to take a string and use it as real code in the program? Code: string codeblock1="cout<<This is a test;"; string codeblock2="int array[5]={0,6,6,3,5};}"; int i; cin>>i; if(i) { execute(codeblo...

Is there a function that returns the character/string at a point in a .txt? (C++)

I know its possible to get a part of a .txt, then convert it to an integer, then store it in a variable, but is it possible to to that in a single declaration. (The variable needs to be global). Ie: [data.txt] 1020 [convert_data.cpp] #include<fstream> fstream convert("data.txt"); //way to declare something equal to A PARTICULAR POINT i...

How to get over "Cannot fetch into text, ntext, and image variables." on SQL Server?

I'm getting this error message: Msg 16927, Level 16, State 1, Procedure GetWfGenProcessParameters, Line 21 Cannot fetch into text, ntext, and image variables. I realy need to make this cursor work with text data. Is there any way to get over this error? ...

Replace an Expression Within Text Boundaries

I have a rather annoying issue that I solved using a simple recursive method in Java. However, I'm looking for a better way to do this. The initial problem involved the presence of whitespace within a Quoted Printable/Base64 encoded Mime header - which as I read the RFC 2047 specification - isn't allowed. This means that decoding fail...

[java] call system text editor

I have Java desktop application that works with CSV files. And i want add some functionality. At this moment i need to open selected file with default system text editor. When i run my program on Windows i have no problems, just by calling notepad.exe, but what to do with *nix systems? One way of solution is to customly set the way to pr...

JSONobject to JSONtext

how can i convert a JSON Object to JSONtext in a javascript function. i should pass the JSONtext as a string to JSP. ...

Android: Can not change the text appears in AlertDialog

Today I faced a very weird problem. In my game I create AlertDialog to show the user next level challenges when one is succeeded. So, the corresponding code is like this. when the game is succeeded showDialog(R.id.display_success) is called and the following code is executed. So, I am expecting to execute this code in every call. Howeve...

State machine for syntax coloring

Hello. I'm currently learning how lexers and parsers work, and i have following question about state machine. For example, i need to colorize text by following rule: For this rule simple state transition table will look like this: current event next action IDLE $ COLOR - COLOR any - OnColor() COLOR \n IDLE - Th...

Cocoa: What NSTextView the insertion point is currently blinking in?

Hi! Given an NSApp object (aka [NSApplication sharedApplication]), how can I get the currently active NSTextView, where the insertion point is blinking right now (if there is one)? :-) I can go [[NSApp keyWindow] contentView] and try traversing the whole view hierarchy, but that seems too hard. Ideal code would be: [NSApp focusedTextVi...

Append text to input field

I need to append some text to an input field... ...

Text packing algorithm

I bet somebody has solved this before, but my searches have come up empty. I want to pack a list of words into a buffer, keeping track of the starting position and length of each word. The trick is that I'd like to pack the buffer efficiently by eliminating the redundancy. Example: doll dollhouse house These can be packed into the bu...