FAQ Database Discussion Community


Javascript show / hide on click multi ID

javascript,text,show-hide
Im work with this script : I want to show/hide text on click, with a single id it works great ( add a fade animation will be great ) but I'm not able to add another ID .. someone could help me ?! THANKS function showHide(shID) { if (document.getElementById(shID)) {...

Replace text between two special characters

regex,r,text,replace
I have a character vector as: x<- "\t\t<taxon id=\"TOT_F50\"/>" and y<- "TOT_A01" and I want replace TOT_F50 with the text in y ("TOT_A01"). Do you know how to replace the text between " and \ (i.e. "TOT_F50) ? ...

Making 3 columns of text aligned at the same height or line all the time even while re sizing window

html,css,text,alignment,height
CSS: I want to make 3 columns of text aligned at the same height or line all the time even when I resize the window. To illustrate what I am talking about please take a look at the images by following this link: https://drive.google.com/file/d/0BywbaHflqMTERFVrNF84YlBUbTg/view?usp=sharing The problem is that the third...

importing specific information of a text file into a matrix

matlab,text,matrix
I do appreciate your helps! Thanks in advance! I have a huge text file in the following format: ********************************* timestep 455 No_Specs 3 H2 49 H2O2 1 O2 49 ********************************* timestep 460 No_Specs 3 H2O 49 H2O2 1 O2 49 ********************************* timestep 465 No_Specs 2 H2 50 O2 50 *********************************...

RichTextbox write in place to current line

c#,text,visual-studio-2013,richtextbox
Clarification: I want to output line of text to the same "position" in a RichTextBox, replacing the previous line. In C# Windows Forms Application trying to use RichTextBox for displaying messages. Most of the messages are appended, so that is fine but at one point in the program it has...

Batch - Comparing two txt files

windows,batch-file,text,comparison
I have some difficulties comparing two txt files with batch. I used the "findstr" function with many option matchings but none works (for example FINDSTR /I /V /B /G:file1.txt file2.txt). I have a first txt file as following: File1.txt Object 1 Argument 50 Object 2 Argument 10 Object 3 Argument...

Corona sdk random text

text,random,sdk,corona
I`m have a problem because when i touch my button sometimes not appear my text... (Sorry for my English!) 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 = display.newText(tostring(com), display.contentWidth*0.57, display.contentHeight*0.7, display.contentWidth*0.9, display.contentHeight*0.8, "Impact",...

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:...

Parsing text file lines into numbers using std::iter::Iterator map

file,text,io,rust
I'm trying to read and parse a text file in Rust. Each line is a signed integer. I'm able to do it using for line in lines iteration but I'm unable to do it with a iter().map(|l| ...) one-liner. I'm getting a expected `&core::result::Result<collections::string::String, std::io::error::Error>`, found `core::result::Result<_, _>` when I...

Python multiple pairs replace in txt file

python,text,substitution
I've got 2 .txt files, the first one is organized like this: 1:NAME1 2:NAME2 3:NAME3 ... and the second one like this: 1 1 1 2 2 2 3 What I want to do is to substitute every line in .txt 2 according to pairs in .txt 1, like this:...

x axis text overlapping in matlab

matlab,text,overlap
My x axis text are overlapping. I am using this code-- clear all A=[1 2 3 4 5 6 7]'; b=1:length(A); figure(1) bar(A) title('Loss Diagram') xlabel('Loss factor') ylabel('kWh/year','fontsiz`enter code here`e',20) grid on set(gca,'Xtick',b,'XtickLabel',{'Horizntl Global Irr. ' 'Effective irr. on coll. ' 'Array nominal energy ' 'PV module loss ' 'charge...

how to change text direction to the right slide of switch in android?

android,text,switch-statement
In default mode , text of a Switch sit on the left side of ON/OFF states. i want to change direction of this text to the right slide. how can i do this? I already try this xml code but not working: <Switch android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/switch1" android:layout_gravity:"right" android:layout_margin="@dimen/abc_dropdownitem_text_padding_right" /> ...

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 =...

Text showing on two lines with span

html,css,text
Please see below HTML and CSS code. HTML: <a class="navbar-brand" href="/index.php"> <img src="/img/logo.png" alt="logo"></a> <span class="navbar-brand" style="font-family:'Arial';font-size:24pt">WEBSITE NAME</span> CSS: .navbar-brand { width: 88px; height: 88px; } .navbar-brand img { width: 100%; height: auto; } The problem I'm having is that the text in the span (WEBSITE NAME) is showing on...

How to read data separated by a ',' in a text file in C [duplicate]

c,file,csv,text,input
This question already has an answer here: Reading CSV from text file in C 4 answers I was wondering how to read data from a text file that has its data separated by a comma; for example line 1 of the text file says: (Name,Integer,Integer). So I tried using...

Unable to modify variables from separate thread

c#,multithreading,winforms,text,file-io
So I'm making a C# app which has to continuously read and display the contents of a text file, while allowing the user to enter something into a text box and append it to the end of that very file. I'm doing this by running my read method on a...

Unexpected Symbol in As Formula, Can't Find

r,string,text,syntax-error,formula
I've been using as.formula for setting up a glm, and I can't figure out where the unexpected symbol is. Part of the problem is that the character vector I'm converting is so long. It's about 700 words with + inserted in between in order to turn it into a formula....

resize/scale text dynamically in andengine

android,text,andengine
I created a simple game where move the objects from one place to another and each moves increment count of moves in score table. After all objects are moved correct I want set opacity to screen and slowly resizing score from initial size(e.g. 15px) to whole screen(e.g. 50px). I load...

Php style show function

php,text,show
Hi guys I want that on click of the button "show" the following inputs became visible, can someone help me? <input id="show"type="submit" value="change" > <input id="oldpass"TYPE="text"value="" style="display: none"> <input id="newpass"TYPE="text"value="" style="display: none"> <input id="cambia"TYPE="submit"value="" style="display: none"> ...

How to get specific rows in a txt file in PHP?

php,sql,text
Here is my problem, I am trying to make a script that create a new table in a database for each new txt file I get. This part is ok but then I want to get some specific rows or words in the txt file to update the table. Here...

Reading text file and dealing with numbers

matlab,for-loop,text,binary
I'm attempting to count the number of letters in a text file, but unfortunately I keep getting stuck if numbers are involved. So far I have been able to deal with letters and symbols, but unfortunately the ischar function doesn't help me when it comes to numbers. function ok =...

Python outputs a .txt file, which's format differs depending on the text editor I use to open it

python,text,output
So I have some python code taht outputs some data to a .txt file like this: f3 = codecs.open(r'C:\Users\dimrizo\Desktop\PythonData\GTFS\routes.txt','w+',"UTF-8") f3.write('route_id,agency_id,route_short_name,route_long_name,route_desc,route_type,route_url,route_color,route_text_color\n') f3.write('blah,blah,blah,blah,blah,blah,blah,blah,blah\n') Problem is that if I open the produced file with the simple windows text editor the text is not properly formatted. The "\n" don't even count. If I open...

How to provide default font height or content when

or has no characters?

javascript,html,css,text,height
This started with one question similar to this one in here: HTML <p> and <span> questions . And ended with 3... I want to understand why the following happen. Starting with this example: A <p> element without any special CSS rule on it has no text when the page is...

Change ID in File

java,file,text,path,rename
Let's say I have this notepad file name: Company_XXX_768_JGH.txt Contents: Random Text Blah Blah Blah Network ID: 80801568 I need to change the ID last 4 numbers (1568) to (0003). So far I am able to read the whole, find the line with the number AND print a statement for...

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...

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...

Apple Script : Cleaning textedit text

text,applescript,textedit
I want to clear some text from a textedit text but its only half working for me tell application "TextEdit" set documentText to text of document 1 set {oldTID, my text item delimiters} to {my text item delimiters, "Administration"} set textBits to text items of documentText set my text item...

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...

text show and hide with button php/js

php,jquery,text,hide,show
How can I apply the multiple texts? With a text it works: <dl> <dt> <img class="empfehlung-bild" style="max-width: 300px; height: auto; float: left; margin-right: 15px; margin-bottom: 15px;" src="<?php echo $bild; ?>" /> <h1><?php echo $title; ?></h1> <p> <?php echo $text; ?> </p><br/> <button id="<?php echo $i; ?>" style="float:right;">Details</button><br/><br/> </dt> <dd style="float:left;">...

Rails. Why does my submit button say Create vs. Update depending on

ruby-on-rails,button,text,submit
Be gentle to the newbie...... Ruby version 2.2.2p95, Rails version 4.2.1. I completed the sample blog application. Works great, and I've been expanding on it. But I'm a noob, and clearly missing something fundamental. From the main index, you are presented with a listing of articles, and you have some...

Characters arbitrarily being changed

html,text,character,rendering
I've came across this issue where the browser (Chrome) is sometimes rendering characters as completely different ones, however in inspect element they're written how they should be. You'll see in the images that on the right inspect element shows what it's supposed to be, and on the left shows what...

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...

Why is this basic python program not working?

python,email,text,organization
Well the program is supposed to check if the it sees an "ok" next to the email and if it does spit out the email in another txt file. Input txt file: [email protected],ok [email protected],fail [email protected],fail [email protected],fail [email protected],ok [email protected],fail [email protected],fail [email protected],ok python code is: readEmails = open("C:\\Users\\Greg\\Desktop\\rewriteEmails.txt","r") writeEmails = open("C:\\Users\\Greg\\Desktop\\OutputEmails.txt","w") for...

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():...

HTML make your own