Search Results

Search found 2372 results on 95 pages for 'significant whitespace'.

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

  • html doctype adds whitespace ??

    - by pstanton
    can someone please explain to me why having a doctype of <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> and <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> render the following block differently under firefox? <table style="border-collapse:collapse; margin:0; padding:0;"> <tr> <td style="border:1px solid red; margin:0; padding:0;"><img src="http://images.smh.com.au/2010/06/01/1533814/th_park-90x60.jpg" style="border:none; padding:0; margin:0;" /></td> </tr> </table> using 'Transitional', there is no white space below the image, using 'Strict' there is! 2nd question, using strict, is it at all possible to remove this whitespace?

    Read the article

  • How significant are JPA lazy loading performance benefits?

    - by Robert
    I understand that this is highly specific to the concrete application, but I'm just wondering what's the general opinion, or at least some personal experiences on the issue. I have an aversion towards the 'open session in view' pattern, so to avoid it, I'm thinking about simply fetching everything small eagerly, and using queries in the service layer to fetch larger stuff. Has anyone used this and regretted it? And is there maybe some elegant solution to lazy loading in the view layer that I'm not aware of?

    Read the article

  • Tokenizing a string with variable whitespace

    - by Ron Holcomb
    I've read through a few threads detailing how to tokenize strings, but I'm apparently too thick to adapt their suggestions and solutions into my program. What I'm attempting to do is tokenize each line from a large (5k+) line file into two strings. Here's a sample of the lines: 0 -0.11639404 9.0702948e-05 0.00012207031 0.0001814059 0.051849365 0.00027210884 0.062103271 0.00036281179 0.034423828 0.00045351474 0.035125732 The difference I'm finding between my lines and the other sample input from other threads is that I have a variable amount of whitespace between the parts that I want to tokenize. Anyways, here's my attempt at tokenizing: #include <iostream> #include <iomanip> #include <fstream> #include <string> using namespace std; int main(int argc, char *argv[]) { ifstream input; ofstream output; string temp2; string temp3; input.open(argv[1]); output.open(argv[2]); if (input.is_open()) { while (!input.eof()) { getline(input, temp2, ' '); while (!isspace(temp2[0])) getline(input, temp2, ' '); getline (input, temp3, '\n'); } input.close(); cout << temp2 << endl; cout << temp3 << endl; return 0; } I've clipped it some, since the troublesome bits are here. The issue that I'm having is that temp2 never seems to catch a value. Ideally, it should get populated with the first column of numbers, but it doesn't. Instead, it is blank, and temp3 is populated with the entire line. Unfortunately, in my course we haven't learned about vectors, so I'm not quite sure how to implement them in the other solutions for this I've seen, and I'd like to not just copy-paste code for assignments to get things work without actually understanding it. So, what's the extremely obvious/already been answered/simple solution I'm missing? I'd like to stick to standard libraries that g++ uses if at all possible.

    Read the article

  • Are there any significant advantages to using a native language for mobile app development?

    - by Karl Daniel
    Forgive me if this question has already been answered but I couldn't quite find the answer I was looking for. What I wanted to know was, is there any significant advantage to using a native language when developing and deploying apps to a mobile environment? The reason I ask is for a long while now I've been using Objective-C, Apple's native language for iOS, to build my apps. However I've been wondering whether or not there is any real benefit to doing this, over using a non-native language like JavaScript and then deploying it through a service like 'Phone Gap'? I do stress 'significant' advantages as native languages are always more likely to have the upper hand when it comes to speed and access to the latest APIs. However in general I don't see using a non-native language or a service like 'Phone Gap' causing and major slow down to my apps or restricting my development. Additionally having the ability to deploy to multiple services is also very handy indeed. This is why I put the question, are there any significant advantages to using a native language for mobile app development?

    Read the article

  • Would someone mind giving suggestions for this new assembly language?

    - by Noctis Skytower
    Greetings! Last semester in college, my teacher in the Computer Languages class taught us the esoteric language named Whitespace. In the interest of learning the language better with a very busy schedule (midterms), I wrote an interpreter and assembler in Python. An assembly language was designed to facilitate writing programs easily, and a sample program was written with the given assembly mnemonics. Now that it is summer, a new project has begun with the objective being to rewrite the interpreter and assembler for Whitespace 0.3, with further developments coming afterwards. Since there is so much extra time than before to work on its design, you are presented here with an outline that provides a revised set of mnemonics for the assembly language. This post is marked as a wiki for their discussion. Have you ever had any experience with assembly languages in the past? Were there some instructions that you thought should have been renamed to something different? Did you find yourself thinking outside the box and with a different paradigm than in which the mnemonics were named? If you can answer yes to any of those questions, you are most welcome here. Subjective answers are appreciated! hold N Push the number onto the stack copy Duplicate the top item on the stack copy N Copy the nth item on the stack (given by the argument) onto the top of the stack swap Swap the top two items on the stack drop Discard the top item on the stack drop N Slide n items off the stack, keeping the top item add Addition sub Subtraction mul Multiplication div Integer Division mod Modulo save Store load Retrieve L: Mark a location in the program call L Call a subroutine goto L Jump unconditionally to a label if=0 L Jump to a label if the top of the stack is zero if<0 L Jump to a label if the top of the stack is negative return End a subroutine and transfer control back to the caller exit End the program print chr Output the character at the top of the stack print int Output the number at the top of the stack input chr Read a character and place it in the location given by the top of the stack input int Read a number and place it in the location given by the top of the stack Question: How would you redesign, rewrite, or rename the previous mnemonics and for what reasons?

    Read the article

  • Xml with spaces as InnerText

    - by David Rutten
    I'm parsing Xml data which has entries like this: <item name="UserText" type_name="gh_string" type_code="10"> </item> I'm supposed to read the 6 spaces as a String, but both the InnerText and InnerXml values of the System.Xml.XmlNode are zero length Strings. Is there any way I can get at this whitespace data in existing files and what do I need to do in the future to prevent this sort of screw up?

    Read the article

  • What significant lost advances on side tracks should be revived in the main stream of software?

    - by C.W.Holeman II
    In reading Alan Kay's question on Significant new inventions I was coming up with answers that were not new ideas but old ones that have been passed by in the main stream. So, what significant lost advances that happened on a side track should be revived in the main stream of software? These would be ideas that worked well in their context but a different context appeared and became dominant the context, even though it lacked the idea. It maybe that in the new dominant context one just cannot do something or it requires great effort to be exerted.

    Read the article

  • What significant advances lost on side tracks should be revived in the main stream of software?

    - by C.W.Holeman II
    In reading Alan Kay's question on Significant new inventions I was coming up with answers that were not new ideas but old ones that have been passed by in the main stream. So, what significant lost advances that happened on a side track should be revived in the main stream of software? These would be ideas that worked well in their context but a different context appeared and became dominant the context, even though it lacked the idea. It maybe that in the new dominant context one just cannot do something or it requires great effort to be exerted.

    Read the article

  • What significant lost steps forward in side tracks should be revived in the main stream of software?

    - by C.W.Holeman II
    In reading Alan Kay's question on Significant new inventions I was coming up with answers that were not new ideas but old ones that have been passed by in the main stream. So, what significant lost steps forward that happened in a side track should be revived in the main stream of software? These would be ideas that worked well in their context but a different context appeared and became dominant the context, even though it lacked the idea. It maybe that in the new dominant context one just cannot do something or it requires great effort to be exerted.

    Read the article

  • How to round a number to n decimal places in Java

    - by Alex Spurling
    What I'd like is a method to convert a double to a string which rounds using the half-up method. I.e. if the decimal to be rounded is a 5, it always rounds up the previous number. This is the standard method of rounding most people expect in most situations. I also would like only significant digits to be displayed. That is there should not be any trailing zeroes. I know one method of doing this is to use the String.format method: String.format("%.5g%n", 0.912385); returns: 0.91239 which is great, however it always displays numbers with 5 decimal places even if they are not significant: String.format("%.5g%n", 0.912300); returns: 0.91230 Another method is to use the DecimalFormatter: DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385); returns: 0.91238 However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this: 0.912385 -> 0.91239 0.912300 -> 0.9123 What is the best way to achieve this in Java?

    Read the article

  • javascript normalize whitespace and other plain-text formatting routines

    - by dreftymac
    Background: The language is JavaScript. The goal is to find a library or pre-existing code to do low-level plain-text formatting. I can write it myself, but why re-invent the wheel. The issue is: it is tough to determine if a "wheel" is out there, since any search for JavaScript libraries pulls up an ocean of HTML-centric stuff. I am not interested in HTML necessarily, just text. Example: I need a JavaScript function that changes this: BEFORE: nisi ut aliquip | ex ea commodo consequat duis |aute irure dolor in esse cillum dolore | eu fugiat nulla pariatur |excepteur sint occa in culpa qui | officia deserunt mollit anim id |est laborum ... into this ... AFTER: nisi ut aliquip | ex ea commodo consequat duis | aute irure dolor in esse cillum dolore | eu fugiat nulla pariatur | excepteur sint occa in culpa qui | officia deserunt mollit anim id | est laborum Question: Does it exist, a JavaScript library that is non-html-web-development-centric that has functions for normalizing spaces in delimited plain text, justifying and spacing plain text? Rationale: Investigating JavaScript for use in a programmer's text editor.

    Read the article

  • Normalize whitespace and other plain-text formatting routines

    - by dreftymac
    Background: The language is JavaScript. The goal is to find a library or pre-existing code to do low-level plain-text formatting. I can write it myself, but why re-invent the wheel. The issue is: it is tough to determine if a "wheel" is out there, since any search for JavaScript libraries pulls up an ocean of HTML-centric stuff. I am not interested in HTML necessarily, just text. Example: I need a JavaScript function that changes this: BEFORE: nisi ut aliquip | ex ea commodo consequat duis |aute irure dolor in esse cillum dolore | eu fugiat nulla pariatur |excepteur sint occa in culpa qui | officia deserunt mollit anim id |est laborum ... into this ... AFTER: nisi ut aliquip | ex ea commodo consequat duis | aute irure dolor in esse cillum dolore | eu fugiat nulla pariatur | excepteur sint occa in culpa qui | officia deserunt mollit anim id | est laborum Question: Does it exist, a JavaScript library that is non-html-web-development-centric that has functions for normalizing spaces in delimited plain text, justifying and spacing plain text? Rationale: Investigating JavaScript for use in a programmer's text editor.

    Read the article

  • ie7 preserve whitespace on dynamically injected text

    - by Rajat
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> function init(){ document.getElementById('test2').innerHTML = '1 2'; } </script> <style type="text/css"> #test{ white-space:pre; } #test2{ white-space:pre; } </style> <title></title> </head> <body onload="init();"> <div id="test"> 1 2 </div> <div id="test2"></div> </body> </html> Here is an example page showing my problem. I have two divs. Each has this text '1 2' with white-space. The only difference is that one is injected dynamically and one is in the html itself. If you open the above page in IE7, the text in div test2 doesn't respect white space. How can i get the same behavior for the text that is dynamically injected?? P.S. My doctype is triggering standards mode on IE7.

    Read the article

  • Preserve whitespace and formatting for text returned from $.get jquery call

    - by desigeek
    I have a jquery $.get() call in my app that requests an entire web page. In the callback function, I access a div in the returned page, get its data and show it on my page. The problem is that the text I get from the div does not preserve the source formatting. If the div in the requested page had say an ordered list, then when i get that text and display on my page, it shows up as a paragraph with items inline instead of being shown as a list. I do not know whether the problem is how $.get() is getting the data or in my displaying of the data. //get the page $.get($(this).attr('href'), function(data){ callbackFunc(data,myLink); }, "html"); function callbackFunc(responseText, customData){ //response has bg color of #DFDFDF var td = $("td[bgcolor='#DFDFDF']", responseText); //text to show is in div of that td var forumText = $('div', td).text(); //append new row with request data below the current row in my table var currentRow = $(customData).parent('td').parent('tr'); var toAppend = "<tr><td class='myTd' colspan='3'>" + forumText + "</td></tr>"; $(currentRow).after(toAppend); } The response data shows up like ABC in the new row I add to my div while the source page div had A B C I should add that this script is part of an extension for Google Chrome so that is my only browser that I have tested on

    Read the article

  • PHP - Check for whitespace at beginning of string

    - by ITg
    I need to use preg_match to check that only a-z0-9. is used (including full stop(.)). I don't want to replace anything. My problem is that it doesn't notice white space at beginning of a string. Also, if anyone knows how to check there is no two full stops in a row, I would be very grateful. What I have so far: ("/[^a-z0-9.]+$/",$request) Thanks !

    Read the article

  • How to avoid trailing spaces when you copy something from terminal?

    - by Michael Härtl
    I often copy a code snippet from a SSH terminal session where i'm logged in to some remote server and have a file opened in vim, for example to paste it here into an answer at SO. It frequently happens, that the code is padded with trailing spaces to match the terminal width. Whereas i've seen this on both, my Ubuntu and Windows machines (using putty) i think, it doesn't happen always. I was not able to figure out when it happens, though. So i wonder how i can avoid those trailing spaces which i have to remove manually all the time in the textarea, where i copy it to. Note, that the files do not have trailing spaces on the server! It only happens if i select and copy some text.

    Read the article

  • Regex whitespace and special characters

    - by Sam R.
    I have this regular expression: [^\\s\"']+|\"([^\"]*)\"|'([^']*)' which works for splitting a string by white spaces, and anything within a quotation is not delimited. However, I notice that if I put in a string that starts with "" no matches are found. How would I correct this? For example, if I enter " test 2". I want it to match to [, test, 2] Note: using java to compile the regex, here is some code Pattern pattern = Pattern.compile("[^\\s\"']+|\"([^\"]*)\"|'([^']*)'"); Matcher matcher = pattern.matcher(SomeString); while (matcher.find()){ String temp = matcher.group(); //... Do something ... } Thanks.

    Read the article

  • error in a c code while trying to remove whitespace

    - by mekasperasky
    this code is the base of lexer , and it does the basic operation of removing the whitespaces from a source file and rewrites it into another file with each word in separate lines . But i am not able to understand why the file lext.txt not getting updated? #include<stdio.h> /* this is a lexer which recognizes constants , variables ,symbols, identifiers , functions , comments and also header files . It stores the lexemes in 3 different files . One file contains all the headers and the comments . Another file will contain all the variables , another will contain all the symbols. */ int main() { int i; char a,b[20],c; FILE *fp1,*fp2; fp1=fopen("source.txt","r"); //the source file is opened in read only mode which will passed through the lexer fp2=fopen("lext.txt","w"); //now lets remove all the white spaces and store the rest of the words in a file if(fp1==NULL) { perror("failed to open source.txt"); //return EXIT_FAILURE; } i=0; while(!feof(fp1)) { a=fgetc(fp1); if(a!="") { b[i]=a; printf("hello"); } else { b[i]='\0'; fprintf(fp2, "%.20s\n", b); i=0; continue; } i=i+1; /*Switch(a) { case EOF :return eof; case '+':sym=sym+1; case '-':sym=sym+1; case '*':sym=sym+1; case '/':sym=sym+1; case '%':sym=sym+1; case ' */ } return 0; }

    Read the article

  • Are their any suggestions for this new assembly language?

    - by Noctis Skytower
    Greetings! Last semester in college, my teacher in the Computer Languages class taught us the esoteric language named Whitespace. In the interest of learning the language better with a very busy schedule (midterms), I wrote an interpreter and assembler in Python. An assembly language was designed to facilitate writing programs easily, and a sample program was written with the given assembly mnemonics. Now that it is summer, a new project has begun with the objective being to rewrite the interpreter and assembler for Whitespace 0.3, with further developments coming afterwards. Since there is so much extra time than before to work on its design, you are presented here with an outline that provides a revised set of mnemonics for the assembly language. This post is marked as a wiki for their discussion. Have you ever had any experience with assembly languages in the past? Were there some instructions that you thought should have been renamed to something different? Did you find yourself thinking outside the box and with a different paradigm than in which the mnemonics were named? If you can answer yes to any of those questions, you are most welcome here. Subjective answers are appreciated! Stack Manipulation (IMP: [Space]) Stack manipulation is one of the more common operations, hence the shortness of the IMP [Space]. There are four stack instructions. hold N Push the number onto the stack copy Duplicate the top item on the stack copy N Copy the nth item on the stack (given by the argument) onto the top of the stack swap Swap the top two items on the stack drop Discard the top item on the stack drop N Slide n items off the stack, keeping the top item Arithmetic (IMP: [Tab][Space]) Arithmetic commands operate on the top two items on the stack, and replace them with the result of the operation. The first item pushed is considered to be left of the operator. add Addition sub Subtraction mul Multiplication div Integer Division mod Modulo Heap Access (IMP: [Tab][Tab]) Heap access commands look at the stack to find the address of items to be stored or retrieved. To store an item, push the address then the value and run the store command. To retrieve an item, push the address and run the retrieve command, which will place the value stored in the location at the top of the stack. save Store load Retrieve Flow Control (IMP: [LF]) Flow control operations are also common. Subroutines are marked by labels, as well as the targets of conditional and unconditional jumps, by which loops can be implemented. Programs must be ended by means of [LF][LF][LF] so that the interpreter can exit cleanly. L: Mark a location in the program call L Call a subroutine goto L Jump unconditionally to a label if=0 L Jump to a label if the top of the stack is zero if<0 L Jump to a label if the top of the stack is negative return End a subroutine and transfer control back to the caller exit End the program I/O (IMP: [Tab][LF]) Finally, we need to be able to interact with the user. There are IO instructions for reading and writing numbers and individual characters. With these, string manipulation routines can be written. The read instructions take the heap address in which to store the result from the top of the stack. print chr Output the character at the top of the stack print int Output the number at the top of the stack input chr Read a character and place it in the location given by the top of the stack input int Read a number and place it in the location given by the top of the stack Question: How would you redesign, rewrite, or rename the previous mnemonics and for what reasons?

    Read the article

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