Search Results

Search found 256 results on 11 pages for 'multiline'.

Page 3/11 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Adding Multiline html content using javascript

    - by pokrate
    Hi, I have created a usercontrol and I want to put its generated html using a javascript file in a webpage. But couldnt do so. Like <script src='file.aspx'></script> should add the html from the usercontrol to the container div. The file "file.aspx" has its content-type set to "text/javascript". And using LoadControl() method I am loading the usercontrol, and then using its RenderControl method, I am able to get its generated html. But I couldnt show it up in the webpage. But I am able to add single line html content , but multiline consumed my whole day :( .

    Read the article

  • python: multiline regular expression

    - by facha
    Hi, everyone I have a piece of text and I've got to parse usernames and hashes out of it. Right now I'm doing it with two regular expressions. Could I do it with just one multiline regular expression? #!/usr/bin/env python import re test_str = """ Hello, UserName. Please read this looooooooooooooooong text. hash Now, write down this hash: fdaf9399jef9qw0j. Then keep reading this loooooooooong text. Hello, UserName2. Please read this looooooooooooooooong text. hash Now, write down this hash: gtwnhton340gjr2g. Then keep reading this loooooooooong text. """ logins = re.findall('Hello, (?P<login>.+).',test_str) hashes = re.findall('hash: (?P<hash>.+).',test_str)

    Read the article

  • multiline column in data grid view. using c#

    - by syedsaleemss
    Im using c# .net windows form application. i have a datagrid view. It has two columns.I need to make all the cells on the second column as to have multiple line. i.e a multiline column. I will edit something in a cell and press enter key. the cursor should reach the next line in the same cell. It should not go to the next cell. What should i do?

    Read the article

  • java regex: capture multiline sequence between tokens

    - by Guillaume
    I'm struggling with regex for splitting logs files into log sequence in order to match pattern inside these sequences. log format is: timestamp fieldA fieldB fieldn log message1 timestamp fieldA fieldB fieldn log message2 log message2bis timestamp fieldA fieldB fieldn log message3 The timestamp regex is known. I want to extract every log sequence (potentialy multiline) between timestamps. And I want to keep the timestamp. I want in the same time to keep the exact count of lines. What I need is how to decorate timestamp pattern to make it split my log file in log sequence. I can not split the whole file as a String, since the file content is provided in a CharBuffer Here is sample method that will be using this log sequence matcher: private void matches(File f, CharBuffer cb) { Matcher sequenceBreak = sequencePattern.matcher(cb); // sequence matcher int lines = 1; int sequences = 0; while (sequenceBreak.find()) { sequences++; String sequence = sequenceBreak.group(); if (filter.accept(sequence)) { System.out.println(f + ":" + lines + ":" + sequence); } //count lines Matcher lineBreak = LINE_PATTERN.matcher(sequence); while (lineBreak.find()) { lines++; } if (sequenceBreak.end() == cb.limit()) { break; } } }

    Read the article

  • Word wrap in multiline textbox after 35 characters

    - by Kanavi
    <asp:TextBox CssClass="txt" ID="TextBox1" runat="server" onkeyup="CountChars(this);" Rows="20" Columns="35" TextMode="MultiLine" Wrap="true"> </asp:TextBox> I need to implement word-wrapping in a multi-line textbox. I cannot allow users to write more then 35 chars a line. I am using the following code, which breaks at precisely the specified character on every line, cutting words in half. Can we fix this so that if there's not enough space left for a word on the current line, we move the whole word to the next line? function CountChars(ID) { var IntermediateText = ''; var FinalText = ''; var SubText = ''; var text = document.getElementById(ID.id).value; var lines = text.split("\n"); for (var i = 0; i < lines.length; i++) { IntermediateText = lines[i]; if (IntermediateText.length <= 50) { if (lines.length - 1 == i) FinalText += IntermediateText; else FinalText += IntermediateText + "\n"; } else { while (IntermediateText.length > 50) { SubText = IntermediateText.substring(0, 50); FinalText += SubText + "\n"; IntermediateText = IntermediateText.replace(SubText, ''); } if (IntermediateText != '') { if (lines.length - 1 == i) FinalText += IntermediateText; else FinalText += IntermediateText + "\n"; } } } document.getElementById(ID.id).value = FinalText; $('#' + ID.id).scrollTop($('#' + ID.id)[0].scrollHeight); } Edit - 1 I have to show total max 35 characters in line without specific word break and need to keep margin of two characters from the right. Again, the restriction should be for 35 characters but need space for total 37 (Just for the Visibility issue.)

    Read the article

  • ExtJs textarea multiline issue

    - by PR
    How can I assign text containing \r\n to an ExtJs textarea and get to see line breaks instead of the actual \r\n characters? When I manually press the Enter key and check Firebug, I can see \r\n getting inserted. But if I assign a string containing \r\n to the textarea, it renders as-is. Any hints would be helpful.

    Read the article

  • C#: Multiline TextBox with TextBox.WordWrap Displaying Long Base64 String

    - by Peter Lee
    Hi, Happy New Year! I have a textbox to display a very long Base64 string. The TextBox.Multline = true and TextBox.WordWrap = true. The issue is caused by the auto-word-boundary detection of the TextBox itself. The Base64 string has '+' as one of the 64 characters for Base64 encoding. Therefore, the TextBox will wrap it up at the '+' character, which is not what I want (because the use might think there is a newline character around the '+' character). I just want my Base64 string displayed in Mulitline-mode in TextBox, but no word boundary detection, that is, if the TextBox.Width can only contain 80 characters, then each line should have exact 80 characters except the last line. I'm not sure if I made myself clear. Thanks. Peter

    Read the article

  • android: tablerow mixed with columns and multiline text

    - by Yang
    I am trying to have a tablelayout contains several tablerows. One of the rows contains 4 buttons, while the second row contains a very long text. However, the width of the button stretches with the text in the second row. Is there anyway to prevent this? http://img684.imageshack.us/i/tableview1.jpg/ http://img521.imageshack.us/i/tableview2.jpg/ Here is my xml file: (somehow this website is not friendly to xml file) AbsoluteLayout android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android" TableLayout android:id="@+id/widget28" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_x="0px" android:layout_y="10px" TableRow android:id="@+id/widget29" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" Button android:id="@+id/widget30" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget31" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget32" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" Button android:id="@+id/widget33" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Button" TableRow android:id="@+id/widget35" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" TextView android:id="@+id/widget40" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="TextViewTextViewTextViewTextViewTextViewTextView"

    Read the article

  • propertyregex removes return characters in multiline

    - by javydreamercsw
    I'm using ants propertyregex method to change a property and it works fine up to a point. I'm lossing return characters. Here's what I'm trying to change: cluster.path=\ ${nbplatform.active.dir}/harness:\ ${nbplatform.active.dir}/platform:\ ${nbplatform.active.dir}/nb This is in a .properties file. So I'm trying to change it like this: <propertyregex property="cluster.path" input="${cluster.path}" regexp="nbplatform.active.dir" replace="xplatform.base" global="true" override="true"/> The stuff is replaced but I get: cluster.path= ${xplatform.base}/harness\: ${xplatform.base}/platform\: ${xplatform.base}/nb This brakes logic down the line not controlled by me (Netbeans) that uses the ':' as delimiter. Any idea?

    Read the article

  • GNU Flex, multiline rule

    - by Simone Margaritelli
    Hi there i have a flex rule inside my lexer definition : operators "[]"|"[]="|"[]<"|".."|"."|".="|"+"|"+="|"-"|"-="|"/"|"/="|"*"|"*="|"%"|"%="|"++"|"--"|"^"|"^="|"~"|"&"|"&="|"|"|"|="|"<<"|"<<="|">>"|"!"|"<"|">"|">="|"<="|"=="|"!="|"&&"|"||"|"~=" Is there any way to split this ruole on more lines to keep it clearer? I tried with \ just like macros but it does not seem to be accepted by flex :( PS: I don't want to split the rule in more sub-rules, but only split its regex in more lines to keep the code clearer.

    Read the article

  • Python read multiline JSON

    - by Paul W
    I have been trying to use JSON to store settings for a program. I can't seem to get Python 2.6 's JSON Decoder to decode multi-line JSON strings... Here is example input: .settings file: """ {\ 'user':'username',\ 'password':'passwd',\ }\ """ I have tried a couple other syntaxes for this file, which I will specify below (with the traceback they cause). My python code for reading the file in is import json settings_text = open(".settings", "r").read() settings = json.loads(settings_text) The Traceback for this is: Traceback (most recent call last): File "json_test.py", line 4, in <module> print json.loads(text) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads return _default_decoder.decode(s) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 322, in decode raise ValueError(errmsg("Extra data", s, end, len(s))) ValueError: Extra data: line 1 column 2 - line 7 column 1 (char 2 - 41) I assume the "Extra data" is the triple-quote. Here are the other syntaxes I have tried for the .settings file, with their respective Tracebacks: "{\ 'user':'username',\ 'pass':'passwd'\ }" Traceback (most recent call last): File "json_test.py", line 4, in <module> print json.loads(text) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads return _default_decoder.decode(s) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 336, in raw_decode obj, end = self._scanner.iterscan(s, **kw).next() File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/scanner.py", line 55, in iterscan rval, next_pos = action(m, context) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 155, in JSONString return scanstring(match.string, match.end(), encoding, strict) ValueError: Invalid \escape: line 1 column 2 (char 2) '{\ "user":"username",\ "pass":"passwd",\ }' Traceback (most recent call last): File "json_test.py", line 4, in <module> print json.loads(text) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/__init__.py", line 307, in loads return _default_decoder.decode(s) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 319, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/json/decoder.py", line 338, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded If I put the settings all on one line, it decodes fine.

    Read the article

  • multiline perl search and replace (one-liner)

    - by yaya3
    I want to perform the following vim substitution as a one-liner in the terminal with perl. I would prefer to allow for any occurences of white space and/or new lines, rather than explicitly catering for them as I am below. %s/blockDontForget">\n*\s*<p><span><a\(.*\)<\/span>/blockDontForget"><p><a\1/g I've tried this: perl -pi -e 's/blockDontForget"><p><span><a(.*)<\/span>/blockDontForget"><p><a$1/msg' I presume I am misinterpreting the flags. Where am I going wrong? Thanks. EDIT: The above example is to strip the spans out of the following html: <div class="block blockDontForget"> <p><span><a href="../../../foo/bar/x/x.html">Lorem Ipsum</a></span></p> </div>

    Read the article

  • Regex to strip phpdoc multiline comment

    - by Reveller
    I have this: /** * @file * API for loading and interacting with modules. * More explaination here. * * @author Reveller <me@localhost> * @version 19:05 28-12-2008 */ I'm looking for a regex to strip all but the @token data, so the result would be: @file API for loading and interacting with modules. More explaination here. @author Reveller <me@localhost> @version 19:05 28-12-2008 I now have this: $text = preg_replace('/\r?\n *\* */', ' ', $text); It does the job partially: it only removes the * in front of each line. Who could help me so it also strips /** and the final slash /? Any help would be greatly appreciated! P.S: If, for instance, the commentlbock would contain something like /** * @foo Here's some slashes for ya: / and \ */ Then obviously the slashes after @foo may not be stripped. The reult would have to be: @foo Here's some slashes for ya: / and \ I hope there's a regex guru out there :-)

    Read the article

  • multiline gtk.Label ignores xalign=0.5

    - by thomas
    A gtk.Label can't be aligned in center when line-wrap is turned on. Example code: import pygtk pygtk.require('2.0') import gtk class testwin(gtk.Window): def __init__(self): gtk.Window.__init__(self) width,height = 300,300 self.set_size_request(width,height) self.set_position(gtk.WIN_POS_CENTER) self.set_title("test window") label = gtk.Label("test text") label.set_line_wrap(True) label.set_justify(gtk.JUSTIFY_CENTER) label.set_alignment(0.5,0.5) label.connect("size-allocate",lambda l,s: l.set_size_request(s.width-1, -1)) self.add(label) self.connect("destroy", gtk.main_quit) self.show_all() testwin() gtk.main() It looks like this, that means, it's aligned left: http://m45.img-up.net/?up=pic122x97.png If you comment out line 14 (set_line_wrap) everything is perfectly fine: http://o54.img-up.net/?up=pic2y00p9.png Please note that yalign works fine. So it seems like the first argument in the gtk.Misc.set_alignment-function has no effect when line wrap is turned on. Using Fedora 16, 64bit, gtk 3.2.4, pygtk 2.24.0, python 2.7.2 Question: Is this intended or a bug? How is it supposed to be made or is a workaround available?

    Read the article

  • Multiline code in Word 2007

    - by WaelJ
    I am using word 2007 and am inserting code into the document. I have a style with a fixed-width font and light grey background and all, and I use Notepad++ for syntax highlighting. My problem is with a "line" of code that is too long to display, so is there a way to auto-insert an arrow symbol at the beginning of a such lines to indicate that it is the same line (kind of like hyphenating, except on long lines instead of long words) So for e.g. something like this: public static void foo(String abcdefg, Boolean 123, ?String xyz)

    Read the article

  • C# Application Becomes Slow and Unresponsive as String in Multiline Textbox Grows

    - by Jim Fell
    Hello. I have a C# application in which a LOT of information is being added to a Textbox for display to the user. Upon processing of the data, almost immediately, the application becomes very slow and unresponsive. This is how I am currently attempting to handle this: var saLines = textBox1.Lines; var saNewLines = saLines.Skip(50); textBox1.Lines = saNewLines.ToArray(); This code is run from a timer every 100mS. Is there a better way to handle this? I am using Microsoft Visual C# 2008 Express Edition. Thanks.

    Read the article

  • WPF Multiline TextBlock LineBreak issues

    - by KMC
    I have the following code txtBlock1.Inlines.Add("This is first paragraph \n This is second paragraph"); then TextBlock would display: This is first paragraph This is second paragraph But, if I have the following (which I though is equivalent); txtBlock1.Inlines.Add("This is first paragraph"); txtBlock1.Inlines.Add("\n"); txtBlock1.Inlines.Add("This is second paragraph"); TextBlock display: This is first paragraph // but second paragraph missing If I separate out the linebreak then the rest of text after the linebreak doesn't show. Why? I have to use run: Run run1 = new Run(); run1.Text = "First Paragraph"; run1.Text += "\n"; run1.Text += "Second Paragraph"; txtBlock1.Inlines.Add(run1); Then it produce the result correctly. Why I cannot add inline text to Textblock and require me to use Run?

    Read the article

  • Multiline Find & Replace in Visual Studio

    - by hawbsl
    Can it be done? We're using either VS2005 or VS2008. I don't mean regular expressions - which have their place - but plain old text find & replace. I know we can do it (at a pinch) with regular expressions using the \n tag but prefer not to get tangled up in regex escapes characters, plus there's a readability issue. If it can't be done what plain and simple (free) alternative are people using? That doesn't involve knocking up our own macro.

    Read the article

  • RegEx (php) - unite lines in multiline replacement

    - by Qiao
    I need change background of all text that have two spaces from the start of the line. text shold be converted to "<div class='special'>text</div>" That is easy: $text = preg_replace("|^ (.+)|um", "<div class='special'>$1</div>", $text); But line1 line2 Is converted to <div class='special'>line1</div> <div class='special'>line2</div> Though <div class='special'>line1 line2</div> is needed. How that can be achieved?

    Read the article

  • jQuery ajax multiline "script" response

    - by Rendrik
    I'm designing a template creation tool, which uses a jQuery Ajax request that posts parameters to a PHP file. The PHP does the actual generation of the template's HTML. // Send for processing. Expect JS back to execute. function generate() { $.ajax({ type: "POST", url: "generate.php", data: $('#genform :input').serialize(), dataType: "script", beforeSend: function() { $("#loading").html("<img src='images/loadbar.gif' />"); $("#loading") .dialog({ height: 80, width: 256, autoOpen: true, modal: true }); }, success: function(data) { $("#loading").dialog('close'); } }); } My trouble is that I have the ajax dataType: set to "script". Using this, the PHP file generates some jQuery dialogs for any errors which works nicely. However, after I generate the HTML, i'm having trouble passing it back. So I have probably 100 lines of generated HTML and javascript which i'd like to work with. In the PHP file, i've tried: echo('$("#result").html("'.$html.'");'); This does actually work if there are NO line breaks in $html. As soon as there are any line breaks, the Chrome debugger reports "gen.html:1 Uncaught SyntaxError: Unexpected token ILLEGAL". It's obvious that it's trying to eval the returned response headers, but is stopping at any line break. So, to be clear, when I pass $html back, if the contents are this: $html = "<div>hi there</div>"; It works fine (all of my error message dialogs are one line). But if it's: $html = "<div> hi there </div>"; It blows up. I'm really not sure how to get around this, or if there's a better way to go about it. It's important to me to keep the formatting so people can copy the HTML template. I may just break down and display the template file on the PHP page if I can't solve this, but I was really hoping to keep everything within the confines of the HTML page.

    Read the article

  • [sed] Multiline trimming

    - by wwrob
    I have a html file that I want to trim. I want to remove a section from the beginning all the way to a given string, and from another string to the end. How do I do that, preferably using sed?

    Read the article

  • Alligning a multiline li in an ul

    - by user146780
    I have two li (points) on this page http://animactions.ca/Animactions/le_developpement_des_equipes_de_travail.php that take up two lines. I'm not sure how to properly align them so that they line up with the first line. I'm referring to this point: Renforcir la cohésion et l’esprit d’équipe pour un travail proactif et durable qui génère des rendements supérieurs. Thanks

    Read the article

  • Multiline Regular Expression search and replace!

    - by Scott
    I've hit a wall. Does anybody know a good text editor that has search and replace like Notepad++ but can also do multi-line regex search and replace? Basically, I am trying to find something that can match a regex like: search oldlog\(.*\n\s+([\r\n.]*)\);replace newlog\(\1\) Any ideas?

    Read the article

  • Are multiline queries sql-injection safe?

    - by acmatos
    This might be a stupid question. Or maybe my hacking skills are limited (I don't practice them at all). I have a query that looks like this: <?php $query =<<<eot SELECT table_x.field1, table_x.field2, table_y.*, table_z.field4 FROM ( SELECT ... ) as table_y LEFT JOIN table_x ON table_x.field1 = table_y.field_x LEFT JOIN table_z ON table_z.field1 = table_y.field_z WHERE table_x.field3 = '$something' AND table_z.field4 = '1' AND table_z.field5 = '2' eot; ?> I have a lot of other tests on $something before it gets used, like $something = explode(' ',$something); (which later result in a string) none of them intend to prevent injection but they make it hard for the given injection to get as is to the actual query. However, there are ways. We all know how easy it is to replace a space for something else which is still valid.. So, it's not really a problem to make a potentially harmful piece of SQL reach that $something... But is there any way to comment the rest of the original query string if it is multi-line? I can comment AND table_z.field4 = '1' using ;-- but can't comment the following AND table_z.field5 = '2' Is it possible to open a multi-line comment /* without closing it or something looked like and therefore allow the injection to ignore the multi-line query?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11  | Next Page >