FAQ Database Discussion Community


Restricting access to some lines in JTextArea?

java,text,jtextarea
I wanted to make a JTextArea where the user can't erase the previous line. Just like the Command Prompt in Windows and the terminal in Linux, you can't edit previous lines. This is what I've come up with, but it doesn't seem to work, and I can only come up...

Trying to get just the text from a node with filter(), but is returning an object?

javascript,jquery,dom,text
I am simply trying to extract the text without any of the elements from a DOM node with var textIWant = $('.classname').contents().filter(function(){ return this.nodeType === 3; })[1]; This returns to me what looks like a string in the console, something untrimmed like.. " text I want " so when I...

how can I add text to these rectangles?

python,text,menu,pygame,python-3.4
This is the code I have started to use to make a start menu. # we need some colours!! black = (0,0,0) white = (255,255,200) red = (200,0,0) green = (0, 200, 0) bright_red = (255, 0 ,0) bright_green = (0, 255, 0) bright_white = (255, 255, 255) def main():...

Align rows in text file with command line

text,command-line
I have data in a text file where data rows are repeated after several columns and each new block shares the first column of row labels. I'd like to use the command line to get align the rows into a single table. The data text file looks like: Values SampleA...

StreamWriter not appending to file, instead creating a new file in different directory

c#,file,text,file-io,streamwriter
I am attempting to write from one file to a temp file after making certain changes to some of the data in the source file. This was working until I extracted this logic into its own function. After running some tests I noticed that only the first line was being...

Add blank line before a certain phrase in a text file in Linux?

linux,text,grep,kali-linux
I'm using Kali Linux, trying to sort out some input from Nmap. Basically, I ran a scan from NMap, and need to extract specific pieces of information from it. I've got it to show everything I need using the following command: cat discovery.txt | grep 'Nmap scan report for\|Service Info:...

JQuery add a whitespace to each new text node to prevent clumping on extraction

jquery,text,whitespace
What I do is I want to transform <div id=master> Blah <span id=crap>Blah1</span> <div id=crap2>Blah2</div> <b>Blah3</b> </div> to <div id=master> Blah <span id=crap> Blah1 </span> <div id=crap2> Blah2 </div> <b> Blah3 </b> </div> because when I extract all the text from all elements inside master it becomes looking like this...

Forcing RTL order in a JTextArea

java,text,bidirectional
I am trying to force a JTextArea (and other text components through my application) to allow users to type RTL. This works correctly for input such as Arabic, but I must also be able to set it to apply this to standard text. Therefore, if I type "hello!" it will...

Read text file from specific position and store in two arrays

c#,arrays,file,text
I have text file which contains line like this: @relation SMILEfeatures @attribute pcm_LOGenergy_sma_range numeric @attribute pcm_LOGenergy_sma_maxPos numeric @attribute pcm_LOGenergy_sma_minPos numeric... Where are about 6000 lines of these attributes, after attributes where are lines like this: @data 1.283827e+01,3.800000e+01,2.000000e+00,5.331364e+00 1.850000e+02,4.054457e+01,4.500000e+01,3.200000e+01... I need to seperate these strings in two different arrays. So far...

Removing the blank positions (x,y) from a text file in Python?

python,text
I'm working on object tracking from video files, I have 5 to 6 objects in each frame of the video. Due to some bugs in the code there are some frames that are skipped and show as blank spaces in the text file . Like below 5.0 2.3 5.4 5.2...

How do i split text to a different column or remove a text from the original column?

excel,vba,excel-vba,text,split
I've copied a column of data starting from D9 to D-whatever, the copied data have both decimal value and text. The data varies in each cell in column D Example D9 : 1675.87 L/s D10 : 1555.87 L/s D11 : 1635.87 L/s This is my code i tried.. Dim c...

Corona sdk not view random text

text,random,lua,corona
I'm have a problem because when I touch my button sometimes my text doe not appear and I do not understand what is wrong. Code: function randomText(event) display.remove(mmDis) local a = {"Cristiano ronaldo jest najlepszy!", "messi jest dobry!","lewandowski jest ok","diego lopez to bramkarz realu"} com = (a[math.random(1,#a)]) local mmDis =...

Make text appear on hover

html,css,text,hover
So I need the text to appear on hover over the image (it doesnt have to be a link if that is too difficult) html <div id="con"> <div id="box1"> <p id="text1"> <a href="url">DESTINATION</a>SS </p> </div> css #con { width:1024px; height:670px; background-color: #161717; } #box1 { float:left; font-size:25px; width:388px; height:477px; background-image:...

HTML make your own