Search Results

Search found 34830 results on 1394 pages for 'text'.

Page 152/1394 | < Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >

  • Centering Text Horizontally and Vertically in LaTeX

    - by Paul
    I would like to produce the following: a b xxxxx xxxxx 1 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 2 xxxxx xxxxx xxxxx xxxxx Where the blocks of 'x's are images, and 'a', 'b', '1' and '2' are text. Here are my two attempts so far: \begin{figure} \begin{center} \begin{tabular}{ccc} & a & b \\ 1 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ 2 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ \end{tabular} \end{center} \end{figure} Which produces: a b xxxxx xxxxx xxxxx xxxxx 1 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 2 xxxxx xxxxx And \begin{figure} \begin{center} \begin{tabular}{m{1cm}m{6cm}m{6cm}} & a & b \\ 1 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ 2 & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} & \subfloat[]{\includegraphics[width=0.47\textwidth]{im.png}} \\ \end{tabular} \end{center} \end{figure} Which produces: a b xxxxx xxxxx 1 xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx 2 xxxxx xxxxx xxxxx xxxxx

    Read the article

  • Get Json and output to text file undecoded

    - by Gary
    Hi, I want to fetch json script and write it to a txt file undecoded, exactly how it was originally. I do have a script that I use that I am modifying but unsure what to commands to use. This script decodes, which is what I want to advoid. //Get Age list($bstat,$bage,$bdata) = explode("\t",check_file('./advise/roadsnow.txt',60*2+15)); //Test Age if ( $bage > $CacheMaxAge ) { //echo "The if statement evaluated to true so get new file and reset $bage"; $bage="0"; $file = file_get_contents('http://somesite.jsontxt'); $out = (json_decode($file)); $report = wordwrap($out->mainText, 100, "\n"); //$valid = $out->validTo; //write the data to a text file called roadsnow.txt $myFile = "./advise/roadsnow.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = $report; fwrite($fh, $stringData); } else { //echo the test evaluated to false; file is not stale so read local cache //print "we are at the read local cache"; $stringData = file_get_contents("./advise/roadsnow.txt"); } // if/else is done carry on with processing //Format file $data = $stringData

    Read the article

  • PHP form processing - how to capture text from field that has variable Name/ID

    - by user80151
    I have a form that has a field pulled from the database as a dropdown. I need to get the text selected in the dropdown but I don't know in advance what the field ID will be. This is basically just a form that has already been generated. I don't need to pull anything from the database, it's already on this page. All I need to do is get the form information and email it, no writing to the database. I know how to do the _Request for the other fields based on the ID but I'm not sure how to do this one. The ID changes. It can be ID=1, ID-2, etc. I need to do something like: _REQUEST form element where ID is LIKE "ID[*]" or something similar. Any suggestions or links to tutorials? Here are a couple samples of what the dropdown renders on the page: <div class="wrapperAttribsOptions"> <h4 class="optionName back"><label class="attribsSelect" for="attrib- 1">Model</label></h4> <div class="back"> <select name="id[1]" id="attrib-1"> <option value="45">VC3-4C</option> <option value="1">VC3-4PG</option> <option value="3">VC3-4SG</option> <div class="wrapperAttribsOptions"> <h4 class="optionName back"><label class="attribsSelect" for="attrib-14">SPK Model</label></h4> <div class="back"> <select name="id[14]" id="attrib-14"> <option value="43">SPK-4</option> <option value="44">SPK-8</option> </select> TIA

    Read the article

  • Cannot write the output to a text file in cpp program

    - by swapedoc
    I have this input file "https://code.google.com/codejam/contest/351101/dashboard/do/A-large-practice.in?cmd=GetInputFile&problem=374101&input_id=1&filename=A-large-practice.in&redownload_last=1&agent=website&csrfmiddlewaretoken=OWMxNTVmMTUyODBiYjhhN2Q2OTM3ZGJiMTNhNDkwMDF8fDEzNzIxNzI1NTE3ODAzMjA%3D" I tried to read this file :-using freopen("filename.txt",r,stdin); and then I wanted the output written to be written to another text file which I can upload in this codejam practice question for the judge. #include<iostream> #include<cstdio> using namespace std; int main() { int t,k=0,a[2000]; freopen("ab.txt","r",stdin); scanf("%d",&t); while(t--) { freopen("cb.txt","w",stdout); int c; scanf("%d",&c); int n; scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&a[i]); printf("Case #%d: ",++k); for(int i=0;i<n-1;i++) {for(int j=i+1;j<n;j++) if((a[i]+a[j])==c) {printf("%d %d\n",i+1,j+1); i=n;} } } return 0; } This is my code. Now the problem is the output file cb.txt contains only the last line of the input. I want the the whole of the output to be written to cb.txt,so what should I do.

    Read the article

  • Reverse geocode street name and city as text

    - by Taylor Satula
    Hello, I have been having some trouble finding a good way to output just the street name and city as text (Infinite Loop, Cupertino shown here) that can be displayed in my iPhone app. This needs to be able to dynamically change as you change streets and city. I don't have the slightest idea of how to do this, I hope someone can help. I have attached a very rough image of what I am trying to acheave. I have found this (http://code.google.com/apis/maps/documentation/javascript/services.html#Geocoding) for google maps about how to reverse geocode using javascript, but what I do not understand is how this would be done in a iPhone development setting. I work in web design and I see how it would be done in HTML but I am very new to iPhone development and don't have the slightest clue of how it would be done here. If someone could spell out how to do this I would be extremely grateful. I cannot seem to find what I am looking for by searching Google. Reference picture: http://www.threepixeldrift.com/images/deep-storage/reversegeocodeiphoneapp.jpg

    Read the article

  • looping problem while appending data to existing text file

    - by Manu
    try { stmt = conn.createStatement(); stmt1 = conn.createStatement(); stmt2 = conn.createStatement(); rs = stmt.executeQuery("select cust from trip1"); rs1 = stmt1.executeQuery("select cust from trip2"); rs2 = stmt2.executeQuery("select cust from trip3"); File f = new File(strFileGenLoc); OutputStream os = (OutputStream)new FileOutputStream(f,true); String encoding = "UTF8"; OutputStreamWriter osw = new OutputStreamWriter(os, encoding); BufferedWriter bw = new BufferedWriter(osw); } while ( rs.next() ) { while(rs1.next()){ while(rs2.next()){ bw.write(rs.getString(1)==null? "":rs.getString(1)); bw.write("\t"); bw.write(rs1.getString(1)==null? "":rs1.getString(1)); bw.write("\t"); bw.write(rs2.getString(1)==null? "":rs2.getString(1)); bw.write("\t"); bw.newLine(); } } } Above code working fine. My problem is 1. "rs" resultset contains one record in the table 2. "rs1" resultset contains 5 record in the table 3. "rs2" resultset contains 5 record in the table "rs" data is getting recursive. while writing to the same text file , the output i am getting like 1 2 3 1 12 21 1 23 25 1 10 5 1 8 54 but i need output like below 1 2 3 12 21 23 25 10 5 8 54 What things i need to change in my code.. Please advice

    Read the article

  • Learning Java, how to type text on canvas?

    - by Voley
    I'm reading a book by Eric Roberts - Art and science of java and it got an excersise that I can't figure out - You have to make calendar, with GRect's, 7 by 6, that goes ok, the code part is easy, but also you have to type the numbers of the date on those rectangles, and it's kinda hard for me, there is nothing about it in the book. I tried using GLabel thing, but here arises the problem that I need to work on those numbers, and it says "can't convert from int to string and vice versa". GLabel (string, posX, posY) - it is not accepting int as a parameter, only string, I even tried typecasting, still not working. For example I want to make a loop int currentDate = 1; while (currentDate < 31) { add(new Glabel(currentDate, 100, 100); currentDate++; This code is saying that no man, can't convert int to string. If i try changing currentDate to string, it works, but I got a problem with calculation, as I can't manipulate with number in string, it doesn't even allow to typecast it into int. How can I fix it? Maybe there is another class or method to type the text over those rectangles? I know about println but it doen't have any x or y coordinates, so I can't work with it. And I think it's only for console programs.

    Read the article

  • Intermittent bug - IE6 showing file as text in browser, rather than as file download

    - by Richard Ev
    In an ASP.NET WebForms 2.0 site we are encountering an intermittent bug in IE6 whereby a file download attempt results in the contents of the being shown directly in the browser as text, rather than the file save dialog being displayed. Our application allows the user to download both PDF and CSV files. The code we're using is: HttpResponse response = HttpContext.Current.Response; response.Clear(); response.AddHeader("Content-Disposition", "attachment;filename=\"theFilename.pdf\""); response.ContentType = "application/pdf"; response.BinaryWrite(MethodThatReturnsFileContents()); response.End(); This is called from the code-behind click event handler of a button server control. Where are we going wrong with this approach? Edit Following James' answer to this posting, the code I'm using now looks like this: HttpResponse response = HttpContext.Current.Response; response.ClearHeaders(); // Setting cache to NoCache was recommended, but doing so results in a security // warning in IE6 //response.Cache.SetCacheability(HttpCacheability.NoCache); response.AppendHeader("Content-Disposition", "attachment; filename=\"theFilename.pdf\""); response.ContentType = "application/pdf"; response.BinaryWrite(MethodThatReturnsFileContents()); response.Flush(); response.End(); However, I don't believe that any of the changes made will fix the issue.

    Read the article

  • Combobox having values but not showing text

    - by ras
    hi, I'm using GWT-EXT combobox. My problem is when I render the combobox, it's having as many rows as it has values but all the rows are empty means text is not shown. Here's my code. Combobox cb = new Combobox(); cb.setForceSelection(true); cb.setMinChars(1); cb.setWidth(200); cb.setStore(store); // Store is perfectly loaded in combobox cb.setDisplayField("ReportName"); cb.setMode(ComboBox.LOCAL); cb.setTriggerAction(ALL); cb.setEmptyText("--Select--"); cb.setLoadingText("Searching..."); cb.setTypeAhead(true); cb.setSelectOnFocus(true); All other code is working fine. I'm sure for one thing that this problem is related to one of the functions of Combobox. Thanks in advance.

    Read the article

  • C++ How to read a string of text and create object of their class

    - by user1777711
    After reading a text file... The following information is available Point2D, [3, 2] Line3D, [7, 12, 3], [-9, 13, 68] Point3D, [1, 3, 8] Line2D, [5, 7], [3, 8] Point2D, [3, 2] Line3D, [7, -12, 3], [9, 13, 68] Point3D, [6, 9, 5] Point2D, [3, 2] Line3D, [70, -120, -3], [-29, 1, 268] Line3D, [25, -69, -33], [-2, -41, 58] Point3D, [6, 9, -50] The first data separate by the delimiter comma is the class name. for each of the 4 class Point2D,Line3D,Point3D,Line2D How do i like store them into relevant object base on their class means.. when it read first line Point2D, [3, 2] It will store it as Point2D object with the Data [3, 2] But the issue is what dataset should i pick, Vector, Set , Map or List I was thinking to actually create a data set then but i can't use new Point2D(); since Point2D is parent of Point3D Line2D is parent of Line3D and theres no parent class of Point2D and Line2D. how can i like create a object of them in a data set like e.g Vector so Vector[0] is of Point2D class with data [3,2] , then Vector[1] is of Line3D class with data [7, 12, 3], [-9, 13, 68] Thanks for helping.!

    Read the article

  • Wrapping text and div as a unit

    - by mathee
    I have the following that I would like wrapped as units. <div class='tag-box'> <a href=#>Axe Committee</a> <div class='circle'><a href=#>x</a></div> </div> The CSS for these classes are: .tag-box { display:inline; } .circle { display:inline; padding-left:4px; padding-right:4px; background:rgb(196,15,24); /*dark red*/ -moz-border-radius:10px; -webkit-border-radius:10px; } .circle a { font-size:10px; text-decoration:none; color:#fff; position:relative; top:-2px; } I can have upwards of 20 or 30 of these tag-boxes displayed inline. The problem is that the wrapping will break the words from each other or even break the red circle from the link. This makes it hard to differentiate which circle belongs to which link. (In the future, each circle corresponds to a different action with respect to the link.) See below. How do I prevent this kind of wrapping from occurring?

    Read the article

  • Show/hide text based on optgroup selection using Jquery

    - by general exception
    I have the following HTML markup:- <select name="Fault" class="textbox" id="fault"> <option>Single Light Out</option> <option>Light Dim</option> <option>Light On In Daytime</option> <option>Erratic Operating Times</option> <option>Flashing/Flickering</option> <option>Causing Tv/Radio Interference</option> <option>Obscured By Hedge/Tree Branches</option> <option>Bracket Arm Needs Realigning</option> <option>Shade/Cover Missing</option> <option>Column In Poor Condition</option> <option>Several Lights Out (please state how many)</option> <option>Column Leaning</option> <option>Door Missing/Wires Exposed</option> <option>Column Knocked Down/Traffic Accident</option> <option>Lantern Or Bracket Broken Off/Hanging On Wires</option> <option>Shade/Cover Hanging Open</option> </select> <span id="faulttext" style="color:Red; display:none">Text in the span</span> This Jquery snippet adds the last 5 options into an option group. $('#fault option:nth-child(n+12)').wrapAll('<optgroup label="Urgent Reasons">'); What I want to do is, remove the display:none if any of the items within the <optgroup> are selected, effectively displaying the span message, possibly with a fade in transition, and also hide the message if any options outside of the <optgroup> are selected.

    Read the article

  • GWT: creating a text widget for highly customized data entry

    - by Caffeine Coma
    I'm trying to implement a kind of "guided typing" widget for data entry, in which the user's text entry is highly controlled and filtered. When the user types a particular character I need to intercept and filter it before displaying it in the widget. Imagine if you will, a Unix shell embedded as a webapp; that's the kind of thing I'm trying to implement. I've tried two approaches. In the first, I extend a TextArea, and add a KeyPressHandler to filter the characters. This works, but the browser-provided spelling correction is totally inappropriate, and I don't see how to turn it off. I've tried: DOM.setElementProperty(textArea.getElement(), "spellcheck", "false"); But that seems to have no effect- I still get the red underlines over "typos". In the second approach I use a FocusWidget to get KeyPress events, and a separate Label or HTML widget to present the filtered characters back to the user. This avoids the spelling correction issue, but since the FocusWidget is not a TextArea, the browser tends to intercept certain typed characters for internal use; e.g. FireFox will use the "/" character to begin a "Quick Find" on the page, and hitting Backspace will load the previous web page. Is there a better way to accomplish what I'm trying to do?

    Read the article

  • jQuery prevAll displaying text in backward ordering

    - by SoulieBaby
    hi all, I'm trying to use jQuery to get all the paragraphs before the first h2 tag in my content. Here's the code I'm using: $(".content").find("h2:first").prevAll().text() Which is grabbing the content, although it's displaying it in backwards order. Example content: <div class="content"> <p>paragraph 1</p> <p>paragraph 2</p> <p>paragraph 3</p> <h2>First h2 tag</h2> <p>paragraph 4</p> <p>paragraph 5</p> <p>paragraph 6</p> <h2>Second h2 tag</h2> </div> The above code is outputting: <p>paragraph 3</p> <p>paragraph 2</p> <p>paragraph 1</p> Is there any way of reversing this, so it's in the correct order? I have tried using nextAll using different codes, but it seems to grab all of my content, or not work at all lol

    Read the article

  • Export the datagrid data to text in asp.net+c#.net

    - by SRIRAM
    Problem:It will asks there is no assembly reference/namespace for Database Database db = DatabaseFactory.CreateDatabase(); DBCommandWrapper selectCommandWrapper = db.GetStoredProcCommandWrapper("sp_GetLatestArticles"); DataSet ds = db.ExecuteDataSet(selectCommandWrapper); StringBuilder str = new StringBuilder(); for(int i=0;i<=ds.Tables[0].Rows.Count - 1; i++) { for(int j=0;j<=ds.Tables[0].Columns.Count - 1; j++) { str.Append(ds.Tables[0].Rows[i][j].ToString()); } str.Append("<BR>"); } Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=FileName.txt"); Response.Charset = ""; Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.text"; System.IO.StringWriter stringWrite = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite); Response.Write(str.ToString()); Response.End();

    Read the article

  • Splitting 25mb .txt file into smaller files using text delimiter

    - by user574141
    Regards, SO I am new to python and Perl. I have been trying to solve a simple problem and getting tied in knots with syntax. I hope someone has the time and patience to help. I have a 25mb file in ".txt" format which contains news-wire articles going back to 1970. Each news story is concatenated to the next, with only the "Copyright" statement to delimit. Each news story starts with "Item XX of XXX DOCUMENTS". There are certain metadata that are repeated throughout, I will use these for tagging later on. I wish to split this 25mb file into separate .txt files, each containing one news story (i.e. the text between "DOCUMENTS" and "Copyright", saving each with a different name (obviously). I am trying to 1 ) open the file... 2) iterate over lines in the file checking for the eof delimiter, and if it is not present writing the line to a list 3)write that list to a seperate small file. I'm having big problems with changing filenames using the counter, and how do I make Python start from where I left off, is the "seek" function appropriate? so far I have been trying this approach, completely unsuccessfully: myfile = open ("myfile.txt", 'r') filenumber = 0 for line in myfile.readline(): filenumber += 1 w=0 while myfile.readline() != '\s+DOCUMENTS\s*\n' ### read my line into a list mysmallfile()['w'] = [myfile.readline()] w += 1 output = open('C:\\Users\\dunner7\\Documents\###how do I change the filename each iteration???', 'w') output.writelines(mysmallfile) ###go back to start. Thank you for your time and patience. RD

    Read the article

  • Replacing a word in a text file with a value using python

    - by Jamde Jam
    I have been trying to replace a word in a text file with a value (say 1), but my outfile is blank.I am new to python (its only been a month since I have been learning it). My file is relatively large, but I just want to replace a word with the value 1 for now. Here is a segment of what the file looks like: NAME SECOND_1 ATOM 1 6 0 0 0 # ORB 1 ATOM 2 2 0 12/24 0 # ORB 2 ATOM 3 2 12/24 0 0 # ORB 2 ATOM 4 2 0 0 4/24 # ORB 3 ATOM 5 2 0 0 20/24 # ORB 3 ATOM 6 2 0 0 8/24 # ORB 3 ATOM 7 2 0 0 16/24 # ORB 3 ATOM 8 6 0 0 12/24 # ORB 1 ATOM 9 2 12/24 0 12/24 # ORB 2 ATOM 10 2 0 12/24 12/24 # ORB 2 #1 #2 #3 I want to first replace the word ATOM with the value 1. Next I want to replace #ORB with a space. Here is what I am trying thus far. input = open('SECOND_orbitsJ22.txt','r') output=open('SECOND_orbitsJ22_out.txt','w') for line in input: word=line.split(',') if(word[0]=='ATOM'): word[0]='1' output.write(','.join(word)) Can anyone offer any suggestions or help? Thanks so much.

    Read the article

  • Find window with specific text for a Process

    - by Axarydax
    Hello, I'm trying to find if a window with specific has been open by a Process. That process spawns multiple windows, and I need to check them all. I have no trouble finding the process, with foreach (Process p in Process.GetProcesses()) { if (p.MainModule.FileName.ToLower().EndsWith("foo.exe")) FindChildWindowWithText(p); //do work the problem is what to do next. I cannot use Process' MainWindowText, because it changes with whichever window is activated. Then I've tried to use Windows function EnumChildWindows and GetWindowText, but I am not sure if I'm passing a correct handle to EnumChildWindows. The EnumChildWindows works as expected when passed MainWindowHandle, but of course the MainWindowHandle changes with active window. So I passed Process.Handle, but I get different handles and different results when switching the app's windows. (I understand that EnumChildWindows returns handles to not only windows, but controls in .net speak, that's no problem if I could get the caption of the window too) Maybe I am doing this the wrong way and I need a different approach - again, my problem is as simple as finding a window with text that matches specific regular expression. So I would probably need a function that enumerates all windows, that are visible in the taskbar or so. Thanks

    Read the article

  • PHP Form - Edit & Delete via Text File Db

    - by Jax
    hi, I pieced together the script below from various tutorials, examples, etc... Right now the script currently: Saves Id, Name, Url with a "|" delimiter to a text file Db like: 1|John|http://www.john.com| 2|Mark|http://www.mark.com| 3|Fred|http://www.fred.com| But I'm having a hard time trying to make the "UPDATE" and "DELETE" buttons work. Can someone please post code which will: let me update/save any changed data for that row (for UPDATE button) let me delete that row (for DELETE button) PLEASE copy n paste the code below and try for yourself. I would like to keep the output format of the script below too. thanks D- $file = "data.txt"; $name = $_POST['name']; $url = $_POST['url']; $data = file('data.txt'); $i = 1; foreach ($data as $line) { $line = explode('|', $line); $i++; } if (isset($_POST['submits'])) { $fp = fopen($file, "a+"); fwrite($fp, $i."|".$name."|".$url."|\n"); fclose($fp); } ? '); } ?

    Read the article

  • Spinner original text

    - by user1696863
    I'm trying my Spinner to display "Select City" before the Spinner has itself been clicked by the user. How can I do this? My current XML code is: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:custom="http://schemas.android.com/apk/res/com.olacabs.customer" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@drawable/page_background" android:orientation="vertical" > <TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@android:color/darker_gray" android:gravity="center" android:paddingBottom="4dp" android:paddingTop="4dp" android:text="@string/rate_card" android:textColor="@color/white" android:textSize="20dp" custom:customFont="litera_bold.ttf" /> <Spinner android:id="@+id/select_city" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="40dp" android:prompt="@string/selectCity" /> </LinearLayout> Also, what does android:spinnerMode exactly do. I tried changing its value to dropdown but nothing happened and the application still showed a popup dialogue. My activity that implements this XML file is: public class RateCardActivity extends OlaActivity { public void onCreate(Bundle bundle) { super.onCreate(bundle); setContentView(R.layout.rate_card); Spinner spinner = (Spinner) findViewById(R.id.select_city); ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.select_city, android.R.layout.simple_spinner_item); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); spinner.setAdapter(adapter); } }

    Read the article

  • Division of text follow the cursor via Javascript/Jquery

    - by webzide
    Dear experts, I wanted have a dynamic division of content follow you with the cursor in the web browser space. I am not a pro at JS so I spent 2 hours to finally debugged a very stupid way to accomplish this. $(document).ready(function () { function func(evt) { var evt = (evt) ? evt : event; var div = document.createElement('div'); div.style.position = "absolute"; div.style.left = evt.clientX + "px"; div.style.top = evt.clientY + "px"; $(div).attr("id", "current") div.innerHTML = "CURSOR FOLLOW TEXT"; $(this).append($(div)); $(this).unbind() $(this).bind('mousemove', function () { $('div').remove("#current"); }); $(this).bind('mousemove', func); } $("body").bind('mousemove', func) }); As you can see this is pretty much Brute force and it slows down the browser quite a bit. I often experience a lag on the browser as a drag my mouse from one place to another. Is there a way to accomplish this easier and faster and more intuitive. I know you can use the cursor image technique but thats something I'm looking to avoid. Thanks in advance.

    Read the article

  • getting text that will be displayed to user from html

    - by gordatron
    Bit of a random one, i am wanting to have a play with some NLP stuff and I would like to: Get all the text that will be displayed to the user in a browser from HTML. My ideal output would not have any tags in it and would only have fullstops (and any other punctuation used) and new line characters, though i can tolerate a fairly reasonable amount of failure in this (random other stuff ending up in output). If there was a way of inserting a newline or full stop in situations where the content was likely not to continue on then that would be considered an added bonus. e.g: items in an ul or option tag could be separated by full stops (or to be honest just ignored). I am working Java, but would be interested in seeing any code that does this. I can (and will if required) come up with something to do this, just wondered if there was anything out there like this already, as it would probably be better than what I come up with in an afternoon ;-). An example of the code I might write if I do end up doing this would be to use a SAX parser to find content in p tags, strip it of any span or strong etc tags, and add a full stop if I hit a div or another p without having had a fullstop. Any pointers or suggestions very welcome.

    Read the article

  • Unable to write to a text file

    - by chrissygormley
    Hello, I am running some tests and need to write to a file. When I run the test's the open = (file, 'r+') does not write to the file. The test script is below: class GetDetailsIP(TestGet): def runTest(self): self.category = ['PTZ'] try: # This run's and return's a value result = self.client.service.Get(self.category) mylogfile = open("test.txt", "r+") print >>mylogfile, result result = ("".join(mylogfile.readlines()[2])) result = str(result.split(':')[1].lstrip("//").split("/")[0]) mylogfile.close() except suds.WebFault, e: assert False except Exception, e: pass finally: if 'result' in locals(): self.assertEquals(result, self.camera_ip) else: assert False When this test run's, no value has been entered into the text file and a value is returned in the variable result. I havw also tried mylogfile.write(result). If the file does not exist is claim's the file does not exist and doesn't create one. Could this be a permission problem where python is not allowed to create a file? I have made sure that all other read's to this file are closed so I the file should not be locked. Can anyone offer any suggestion why this is happening? Thanks

    Read the article

  • jQuery toggle div and text

    - by Jack
    I would like some help with this code, I have read similar questions & answers here on stackoverflow but I still can't get it right. I have a link that populated by .html("") to read more… when clicked it opens the hidden div and at the end the .html("") reads less. When I click close the div slides closed but the text still reads less… I have read many articles on how to do this but am confused and can't get past this last hurdle, any help would be much appreciated. // this is the intro div Ligula suspendisse nulla pretium, rhoncus tempor placerat fermentum, enim integer ad vestibulum volutpat. Nisl rhoncus turpis est, vel elit, congue wisi enim nunc ultricies sit, magna tincidunt. Maecenas aliquam maecenas ligula nostra, accumsan taciti. // this next div is hidden Ligula suspendisse nulla pretium, rhoncus tempor placerat fermentum, enim integer ad vestibulum volutpat. Nisl rhoncus turpis est, vel elit, congue wisi enim nunc ultricies sit, magna tincidunt. Maecenas aliquam maecenas ligula nostra, accumsan taciti. $(document).ready(function() { $(".overview-continued").hide(); $(".show-overview").html("more..."); $(".show-overview").click(function() { $(".overview-continued").slideToggle("1000"); $(".show-overview").html("less..."); return false; }); });

    Read the article

  • Password value on click is not changing the text to 'Password'

    - by Sam
    window.onload=function() { var password = document.getElementById('apassword'); var real = document.getElementById('password'); var fake = document.createElement('input'); fake.setAttribute('type', 'text'); /*fake.setAttribute('id', 'password');*/ fake.setAttribute('class', 'contact-input contact-right'); password.appendChild(fake); fake.setAttribute('value', 'Password'); fake.onfocus = function() {this.style.display='none';real.style.display=''; real.focus();}; real.style.display = 'none'; real.setAttribute('value', ''); real.onblur = function() {if(this.value==''){this.style.display='none';fake.style.display=''}}; }; AND <label id="apassword"> <input type="password" title="Password" id="password" class="contact-input contact-right" name="password" /> </label> What is supposed to happen is that when you click on the input box, it changes from 'Password' to a blank type="password" input box, however it doesn't happen. This originally worked, but then I had to change some ID's and classes etc. I'm not sure how to debug scripts, so hopefully someone can help me with that, and also with my question :). Thankyou :).

    Read the article

< Previous Page | 148 149 150 151 152 153 154 155 156 157 158 159  | Next Page >