Search Results

Search found 465 results on 19 pages for 'quoted printable'.

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

  • Visual Studio Find and Replace Regular Expressions ~ find lines with quoted strings, not containing

    - by Darkoni
    Visual Studio Find and Replace Regular Expressions Find lines with quoted strings, not containing strings include or trace i am tryling to find out all lines in c++ project that contains some text as i have to use visual studio, i have to use its Find and Replace http://www.codinghorror.com/blog/2006/07/the-visual-studio-ide-and-regular-expressions.html so, for finding all lines like: print("abc"); it is enogh to write :q and it will find all quotted strings ok, but i also get lot of lines like #include "stdio.h" and trace("* step 1 *") i find out regex to get all lines containing include and trace <include|trace> so, mine question is, how to find all lines with "quotted strings" but NOT lines that contains strings include and trace. thanx

    Read the article

  • Antlr Lexer Quoted String Problem

    - by Loki
    I'm trying to build a lexer to tokenize lone words and quoted strings. I got the following: STRING: QUOTE (options {greedy=false;} : . )* QUOTE ; WS : SPACE+ { $channel = HIDDEN; } ; WORD : ~(QUOTE|SPACE)+ ; For the corner cases, it needs to parse: "string" word1" word2 As three tokens: "string" as STRING and word1" and word2 as WORD. Basically, if there is a last quote, it needs to be part of the WORD were it is. If the quote is surrounded by white spaces, it should be a WORD. I tried this rule for WORD, without success: WORD: ~(QUOTE|SPACE)+ | (~(QUOTE|SPACE)* QUOTE ~QUOTE*)=> ~(QUOTE|SPACE)* QUOTE ~(QUOTE|SPACE)* ;

    Read the article

  • C# double-quoted path name being escaped when read from file

    - by KrisTrip
    I am trying to read in a text input file that contains a list of filenames (one per line). However, I am running into an issue if the user double-quotes the path (because it has a space in it). For example, a normal input file might have: C:\test\test.tiff C:\test\anothertest.tiff C:\test\lasttest.tiff These get read in fine by my code ("C:\\test\\test.tiff" etc) However, if I have the following input file: "C:\test with spaces\test.tiff" "C:\test with spaces\anothertest.tiff" "C:\test with spaces\lasttest.tiff" These get read in double-quotes and all ("\"C:\\test with spaces\\test.tiff\"" etc). This becomes a problem when I try to open the files (I understandably get invalid character exceptions). My question is, how do I fix this? I want to allow users to input quoted strings and handle them correctly. My first impression was to just write a little method that strips off beginning or ending quotes, but I thought there might be a better way.

    Read the article

  • Antlr Lexer Quoted String Predicate

    - by Loki
    I'm trying to build a lexer to tokenize lone words and quoted strings. I got the following: STRING: QUOTE (options {greedy=false;} : . )* QUOTE ; WS : SPACE+ { $channel = HIDDEN; } ; WORD : ~(QUOTE|SPACE)+ ; For the corner cases, it needs to parse: "string" word1" word2 As three tokens: "string" as STRING and word1" and word2 as WORD. Basically, if there is a last quote, it needs to be part of the WORD were it is. If the quote is surrounded by white spaces, it should be a WORD. I tried this rule for WORD, without success: WORD: ~(QUOTE|SPACE)+ | (~(QUOTE|SPACE)* QUOTE ~QUOTE*)=> ~(QUOTE|SPACE)* QUOTE ~(QUOTE|SPACE)* ;

    Read the article

  • Replace whitespaces using PHP preg_replace function ignoring quoted strings

    - by Saiful
    Look at the following string: SELECT column1 , column2, column3 FROM table1 WHERE column1 = 'text, "FROM" \'from\\\' x' AND column2 = "sample text 'where' \"where\\\" " AND ( column3 = 5 ) I need to escape unnecessary white space characters from the string like: removing white space from beginning and ending position of , ( ) etc removing newline (\r\n) and tabs (\t) But one thing. The remove process could not remove white spaces from the quoted string like: 'text, "FROM" \'from\\' x' "sample text 'where' \"where\\" " etc. i need to use the PHP function: preg_replace($pattern, $replacement, $string); So what will be the value of $pattern and $replacement where the value of $string is the given SQL.

    Read the article

  • How to kill a quoted string at point in emacs?

    - by user1350992
    I would like to kill a quoted string in a source file without having to mark the beginning of the string and kill-region, but just by placing the point anywhere inside the quoted string and pressing a shortcut. I tried to write a function in elisp for this, but I figured out that the file would need to be parsed from the beginning up to point to determine whether the point is inside quoted string, and to find the bounds of the quoted string(also handle the \")... But the file is already parsed by font-lock. So now I can find out if I'm inside quoted string: (defun inside-quoted-string? () (interactive) (print (find 'font-lock-doc-face (text-properties-at (point))))) But how do I get the bounds of the string? font-lock knows it, since it nicely highlights it in blue, but how do I get it?

    Read the article

  • Administrator's shortcut to batch file with double quoted parameters

    - by XXB
    Take an excruciatingly simple batch file: echo hi pause Save that as test.bat. Now, make a shortcut to test.bat. The shortcut runs the batch file, which prints "hi" and then waits for a keypress as expected. Now, add some argument to the target of the shortcut. Now you have a shortcut to: %path%\test.bat some args The shortcut runs the batch file as before. Now, run the shortcut as administrator. (This is on Windows 7 by the way.) You can use either right-click - Run as Administrator, or go to the shortcut's properties and check the box in the advanced section. Tell UAC that it's okay and once again the shortcut runs the batch file as expected. Now, change the arguments in the target of the shortcut to add double quotes: %path%\test.bat "some args" Now try the shortcut as administrator. It doesn't work this time! A command window pops up and and disappears too fast to see any error. I tried adding test.log 2&1 to the shortcut, but no log is created in this case. Try running the same shortcut (with the double quotes) but not as Administrator. It runs the batch file fine. So, it seems the behavior is not because of the double quoted parameters, and it's not because it's run as Administrator. It's some weird combination of the two. I also tried running the same command from an administrator's command window. This ran the batch file as expected without error. Running the shortcut from the command window spawned a new command window which flashed and went away. So apparently the issue is caused by a combination of administrator, the shortcut, and the double quotes. I'm totally stumped, does anyone have any idea what's going on?

    Read the article

  • Is quoted-printable enough to make a mail compliant with the line-length-restriction posed in RFC 2822?

    - by Mnementh
    In RFC 2822 (defining E-Mail) is defined, that no line SHOULD be longer than 78 chars (excluding CRLF) and MUST not longer than 998 characters. With quoted-printable longer lines will be broken into more lines, ending each with a '=' until the real linebreak is reached. Conforms a mail to the standard, if it contains lines longer than 78 (or 998) characters but is encoded with quoted-printable? There are arguments, that this isn't compliant, because the receiving mail-client has longer lines after decoding the quoted-printable message.

    Read the article

  • Size Mismatch Between Swing Fonts and Printable Fonts in Java

    - by Caleb Rackliffe
    Hi All, I've got a panel displaying a JTextPane backed by a StyledDocument. When I print a string of text in, say Arial 16, the text it prints is of a different size than the Arial 16 Word prints. Is there some sort of flaw in the translation of Swing fonts to Windows system fonts or something of the sort that makes it difficult (or impossible) to print accurately? I can achieve an approximation by scaling down the size of my font before printing, but this never quite gets me the results I would like, as it's not possible in all cases to reproduce things like equivalent numbers of words on a line, etc. Has anybody run into this before?

    Read the article

  • Java Regex for matching quoted string with escaped quotes

    - by kayahr
    I know there are already many questions like mine but I found no answer which works in Java. So I write a new question. I have text files with content like this: key1 = "This is a \"test\" text with escapes using '\\' characters"; key2 = 'It must work with \'single\' quotes and "double" quotes'; I need a regular expression which matches the values in the double-quotes (or single-quotes). This regular expression must support the escaped quotes and escaped backslashes. The regular expression must work with Java standard Pattern/Matcher classes.

    Read the article

  • Escape apostrophes inside double quoted strings (Javascript)

    - by George Sheppard
    Say i have a string that i need to evaluate in javascript such as : window.some_class.update( 'Runner', 'update_runner', '{"runner":{"id":"1","name":"Nin's Lad" } }'); In order for eval() to evaluate it, i need to escape the apostrophe in runner_name (Nin's Lad). Is this possable with regex? I dont want to escape the single quotes around Runner and update_runner. I'd just like to escape any single quotes inside double quotes. Thanks,

    Read the article

  • Printable Version of Google Visualizations DataTable

    - by maleki
    I have a custom routing application that takes information for a route from google maps. It then creates a Google Visualizations DataTable to hold all the steps in the route. My current problem is that in order to reduce overflow for very large routes, I have enabled paging in the options of the DataTable. This leads to a not so printer friendly version because only the portion of the data that is shown in the table will be printed. The other portions of the table are loaded dynamically by the API when you click prev and next. Is there a not so hard way to get the DataTable to be printer friendly when it comes time without sacrificing the ability to have paging enabled?

    Read the article

  • start-stop-daemon quoted arguments misinterpreted

    - by Martin Westin
    Hi, I have been trying to make an init script using start-stop-daemon. I am stuck on the arguments to the daemon. I want to keep these in a variable at the top of the script but I can't get the quotations to filter down correctly. I'll use ls here so we don't have to look at binaries and arguments that most people wont know or care about. The end result I am looking for is for start-stop... to run ls -la "/folder with space/" DAEMON=/usr/bin/ls DAEMON_OPTS='-la "/folder with space/"' start-stop-daemon --start --make-pidfile --pidfile $PID --exec $DAEMON -- $DAEMON_OPTS Double escaping the options and trying innumerable variations of quotations do not help... Then they end up at the daemon they are always messed up. Enclosing $DAEMON_OPTS in quotes changes things... then they are seen as one since quote... never the right number though :) Echoing the command-line (start-stop...) prints exactly the right stuff to screen. But the daemon (the real one, not ls) complains about the wrong number of arguments. How do I specify a variable so that quotes inside it are brought along to the daemon correctly? Thanks, Martin

    Read the article

  • Regular expression for pipe delimited and double quoted string

    - by Hiren Amin
    I have a string something like this: "2014-01-23 09:13:45|\"10002112|TR0859657|25-DEC-2013>0000000000000001\"|10002112" I would like to split by pipe apart from anything wrapped in double quotes so I have something like (similar to how csv is done): [0] => 2014-01-23 09:13:45 [1] => 10002112|TR0859657|25-DEC-2013>0000000000000001 [2] => 10002112 I would like to know if there is a regular expression that can do this?

    Read the article

  • insert VBS variable within a single-quoted WMI query

    - by jiaoziren
    Hi all, I am really frustrated by the snippet below: Dim objFSO, varSrc, varDest, varExt Set objFSO = CreateObject("Scripting.FileSystemObject") varSrc = WScript.Arguments(0) varDest = WScript.Arguments(1) varExt = WScript.Arguments(2) If objFSO.FolderExists(varSrc) Then WScript.Echo varSrc strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colMonitoredEvents = objWMIService.ExecNotificationQuery _ ("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _ & "Targetinstance ISA 'CIM_DirectoryContainsFile' AND " _ & "TargetInstance.GroupComponent= " _ & "'Win32_Directory.Name=""c:\\\\kk ""'") Do Set objLatestEvent = colMonitoredEvents.NextEvent WScript.Echo objLatestEvent.TargetInstance.PartComponent Loop Else WScript.Echo "Bazinga" End If I tried to replace c:\\kk with varSrc however it seems impossible for WSH to recognize it in WMI query - not to mention it was within a single quote! I have tried chr(34) and it didn't work. Please help if possible. Much appreciated!

    Read the article

  • Bash Shell Scripting Errors: ./myDemo: 56: Syntax error: Unterminated quoted string [EDITED]

    - by ???
    Could someone take a look at this code and find out what's wrong with it? #!/bin/sh while : do echo " Select one of the following options:" echo " d or D) Display today's date and time" echo " l or L) List the contents of the present working directory" echo " w or W) See who is logged in" echo " p or P) Print the present working directory" echo " a or A) List the contents of a specified directory" echo " b or B) Create a backup copy of an ordinary file" echo " q or Q) Quit this program" echo " Enter your option and hit <Enter>: \c" read option case "$option" in d|D) date ;; l|L) ls $PWD ;; w|w) who ;; p|P) pwd ;; a|A) echo "Please specify the directory and hit <Enter>: \c" read directory if [ "$directory = "q" -o "Q" ] then exit 0 fi while [ ! -d "$directory" ] do echo "Usage: "$directory" must be a directory." echo "Re-enter the directory and hit <Enter>: \c" read directory if [ "$directory" = "q" -o "Q" ] then exit 0 fi done printf ls "$directory" ;; b|B) echo "Please specify the ordinary file for backup and hit <Enter>: \c" read file if [ "$file" = "q" -o "Q" ] then exit 0 fi while [ ! -f "$file" ] do echo "Usage: \"$file\" must be an ordinary file." echo "Re-enter the ordinary file for backup and hit <Enter>: \c" read file if [ "$file" = "q" -o "Q" ] then exit 0 fi done cp "$file" "$file.bkup" ;; q|Q) exit 0 ;; esac echo done exit 0 There are some syntax errors that I can't figure out. However I should note that on this unix system echo -e doesn't work (don't ask me why I don't know and I don't have any sort of permissions to change it and even if I wouldn't be allowed to) Bash Shell Scripting Error: "./myDemo ./myDemo: line 62: syntax error near unexpected token done' ./myDemo: line 62: " [Edited] EDIT: I fixed the while statement error, however now when I run the script some things still aren't working correctly. It seems that in the b|B) switch statement cp $file $file.bkup doesn't actually copy the file to file.bkup ? In the a|A) switch statement ls "$directory" doesn't print the directory listing for the user to see ? #!/bin/bash while $TRUE do echo " Select one of the following options:" echo " d or D) Display today's date and time" echo " l or L) List the contents of the present working directory" echo " w or W) See who is logged in" echo " p or P) Print the present working directory" echo " a or A) List the contents of a specified directory" echo " b or B) Create a backup copy of an ordinary file" echo " q or Q) Quit this program" echo " Enter your option and hit <Enter>: \c" read option case "$option" in d|D) date ;; l|L) ls pwd ;; w|w) who ;; p|P) pwd ;; a|A) echo "Please specify the directory and hit <Enter>: \c" read directory if [ ! -d "$directory" ] then while [ ! -d "$directory" ] do echo "Usage: "$directory" must be a directory." echo "Specify the directory and hit <Enter>: \c" read directory if [ "$directory" = "q" -o "Q" ] then exit 0 elif [ -d "$directory" ] then ls "$directory" else continue fi done fi ;; b|B) echo "Specify the ordinary file for backup and hit <Enter>: \c" read file if [ ! -f "$file" ] then while [ ! -f "$file" ] do echo "Usage: "$file" must be an ordinary file." echo "Specify the ordinary file for backup and hit <Enter>: \c" read file if [ "$file" = "q" -o "Q" ] then exit 0 elif [ -f "$file" ] then cp $file $file.bkup fi done fi ;; q|Q) exit 0 ;; esac echo done exit 0 Another thing... is there an editor that I can use to auto-parse code? I.e something similar to NetBeans?

    Read the article

  • [cli/linux] get plain text from raw emails (not attachments extraction)

    - by etuardu
    Hi, having a raw email as input (i.e. the text between "DATA" and "." sent by a smtp client) I need to extract the mail content (which I know is always text only) as plain text. This means decoding transfer encoding (if any: could be base64 or quoted-printable), merging mutiparts (if any), and stripping headers. I tried various tools that would do that: mewdecode, uudecode, uudeview... I only managed to get this last one to work, but it won't output anything if the mail is not MIME encoded and it stores its output in an unpredictable (nor forceable) filename, so it's hard to use it in a not-interactive shell script. Since this is a pretty common job (every mail client have to do that), it's weird it's so complicated. Do you have some hints? (Actually, forcing uudeview to output in a certain file would be good enough). Thank you!

    Read the article

  • SQL SERVER – QUOTED_IDENTIFIER ON/OFF Explanation and Example – Question on Real World Usage

    - by Pinal Dave
    This is a follow up blog post of SQL SERVER – QUOTED_IDENTIFIER ON/OFF and ANSI_NULL ON/OFF Explanation. I wrote that blog six years ago and I had plans that I will write a follow up blog post of the same. Today, when I was going over my to-do list and I was surprised that I had an item there which was six years old and I never got to do that. In the earlier blog post I wrote about exploitation of the Quoted Identifier and ANSI Null. In this blog post we will see a quick example of Quoted Identifier. However, before we continue this blog post, let us see a refresh what both of Quoted Identifider do. QUOTED IDENTIFIER ON/OFF This option specifies the setting for use of double quotes. When this is on, double quotation mark is used as part of the SQL Server identifier (object name). This can be useful in situations in which identifiers are also SQL Server reserved words. In simple words when we have QUOTED IDENTIFIER ON, anything which is wrapped in double quotes becomes an object. E.g. -- The following will work SET QUOTED_IDENTIFIER ON GO CREATE DATABASE "Test1" GO -- The following will throw an error about Incorrect syntax near 'Test2'. SET QUOTED_IDENTIFIER OFF GO CREATE DATABASE "Test2" GO This feature is particularly helpful when we are working with reserved keywords in SQL Server. For example if you have to create a database with the name VARCHAR or INT or DATABASE you may want to put double quotes around your database name and turn on quoted identifiers to create a database with the such name. Personally, I do not think so anybody will ever create a database with the reserve keywords intentionally, as it will just lead to confusion. Here is another example to give you further clarity about how Quoted Idenifier setting works with SELECT statement. -- The following will throw an error about Invalid column name 'Column'. SET QUOTED_IDENTIFIER ON GO SELECT "Column" GO -- The following will work SET QUOTED_IDENTIFIER OFF GO SELECT "Column" GO Personally, I always use the following method to create database as it works irrespective of what is the quoted identifier’s status. It always creates objects with my desire name whenever I would like to create. CREATE DATABASE [Test3] I believe the future of the quoted identifier on or off is useful in the real world when we have script generated from another database where this setting was ON and we have to now execute the same script again in our environment again. Question to you - I personally have never used this feature as I mentioned earlier. I believe this feature is there to support the scripts which are generated in another SQL Database or generate the script for other database. Do you have a real world scenario where we need to turn on or off Quoted Identifiers. Click to Download Scripts Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • JEditorPanes, Preferred Size, and printing HTML

    - by Ryan Elkins
    I'm trying to print some HTML directly, without displaying anything to the user. It works currently (somewhat) using a custom JEditorPane that implements Printable. The problem I'm having is that it always wants to use a preferred size of 582px x 560px. If I manually change the size using something like setSize(x,y) it will change the size of the pane, put the content renders at preferred size, not actual size (so it's still 582x560). I can scale it up to fit the page, but it's basically just an enlarged version where the images are all pixelated and the layout is wrong (based on the smaller window size). Inside the print method of my Printable JEditorPane I used this to try and get the size: javax.swing.JWindow wnd = new javax.swing.JWindow(); wnd.setContentPane(this); wnd.setSize(1024,1584); wnd.pack(); Dimension d = wnd.getPreferredSize(); With or without that setSize and/or pack methods on the JWindow the preferred size always comes back as 582x560. I do have control over the html that I'm trying to print but I'd rather not have to rewrite all of that to scale it down so it will print correctly at full size (when scaled up).

    Read the article

  • Why does my Doctrine DBAL query return no results when quoted?

    - by braveterry
    I'm using the Doctrine DataBase Abstraction Layer (DBAL) to perform some queries. For some reason, when I quote a parameter before passing it to the query, I get back no rows. When I pass it unquoted, it works fine. Here's the relevant snippet of code I'm using: public function get($game) { load::helper('doctrinehelper'); $conn = doctrinehelper::getconnection(); $statement = $conn->prepare('SELECT games.id as id, games.name as name, games.link_url, games.link_text, services.name as service_name, image_url FROM games, services WHERE games.name = ? AND services.key = games.service_key'); $quotedGame = $conn->quote($game); load::helper('loghelper'); $logger = loghelper::getLogger(); $logger->debug("Quoted Game: $quotedGame"); $logger->debug("Unquoted Game: $game"); $statement->execute(array($quotedGame)); $resultsArray = $statement->fetchAll(); $logger->debug("Number of rows returned: " . count($resultsArray)); return $resultsArray; } Here's what the log shows: 01/01/11 17:00:13,269 [2112] DEBUG root - Quoted Game: 'Diablo II Lord of Destruction' 01/01/11 17:00:13,269 [2112] DEBUG root - Unquoted Game: Diablo II Lord of Destruction 01/01/11 17:00:13,270 [2112] DEBUG root - Number of rows returned: 0 If I change this line: $statement->execute(array($quotedGame)); to this: $statement->execute(array($game)); I get this in the log: 01/01/11 16:51:42,934 [2112] DEBUG root - Quoted Game: 'Diablo II Lord of Destruction' 01/01/11 16:51:42,935 [2112] DEBUG root - Unquoted Game: Diablo II Lord of Destruction 01/01/11 16:51:42,936 [2112] DEBUG root - Number of rows returned: 1 Have I fat-fingered something?

    Read the article

  • How to Get the F# Name of a Module, Function, etc. From Quoted Expression Match

    - by Stephen Swensen
    I continue to work on a printer for F# quoted expressions, it doesn't have to be perfect, but I'd like to see what is possible. The active patterns in Microsoft.FSharp.Quotations.Patterns and Microsoft.FSharp.Quotations.DerivedPatterns used for decomposing quoted expressions will typically provide MemberInfo instances when appropriate, these can be used to obtain the name of a property, function, etc. and their "declaring" type, such as a module or static class. The problem is, I only know how to obtain the CompiledName from these instances but I'd like the F# name. For example, > <@ List.mapi (fun i j -> i+j) [1;2;3] @> |> (function Call(_,mi,_) -> mi.DeclaringType.Name, mi.Name);; val it : string * string = ("ListModule", "MapIndexed") How can this match be rewritten to return ("List", "mapi")? Is it possible?

    Read the article

  • How can I "pack()" a printable Java Swing component?

    - by Jonas
    I have implemented a Java Swing component that implements Printable. If I add the component to a JFrame, and do this.pack(); on the JFrame, it prints perfect. But if I don't add the component to a JFrame, just a blank page is printed. This code gives a great printout: final PrintablePanel p = new PrintablePanel(pageFormat); new JFrame() {{ getContentPane().add(p); this.pack(); }}; job.setPrintable(p, pageFormat); try { job.print(); } catch (PrinterException ex) { System.out.println("Fail"); } But this code gives a blank page: final PrintablePanel p = new PrintablePanel(pageFormat); // new JFrame() {{ getContentPane().add(p); this.pack(); }}; job.setPrintable(p, pageFormat); try { job.print(); } catch (PrinterException ex) { System.out.println("Fail"); } I think that this.pack(); is the big difference. How can I do pack() on my printable component so it prints fine, without adding it to a JFrame? The panel is using several LayoutManagers. I have tried with p.validate(); and p.revalidate(); but it's not working. Any suggestions? Or do I have to add it to a hidden JFrame before I print the component?

    Read the article

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