Search Results

Search found 35302 results on 1413 pages for 'string literals'.

Page 132/1413 | < Previous Page | 128 129 130 131 132 133 134 135 136 137 138 139  | Next Page >

  • Converting the DOM element in a String

    - by Hsm Sharique Hasan
    I am working on svg. I made some shapes in svg using my javascript code. Now what i have to do is to get that code of svg which has been made as i draw some thing. i want to get that code in a form of string so for the sake of reuse or if can put that code in a .svg file it outputs the same what i made by myself using my javascript code. Like My code made this <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="500" height="500" id="one"> <g id="container"> <rect id ="rect" x="0" y="0" width="0" height="0" fill="pink" stroke="blue" stroke-width="2" /> </g> Now what should i do to get all the code from to in a form of string and i can print that.

    Read the article

  • R storing a complex search as a string

    - by Tahnoon Pasha
    Hi I'm working with a large data frame that I frequently need to subset in different combinations of variables. I'd like to be able to store the search in a string so I can just refer to the string when I want to see a subset. x = read.table(textConnection(" cat1 cat2 value A Z 1 A Y 2 A X 3 B N 2"),header=T,strip.white=T) search_string="cat1== 'A' & cat2=='Z'" with(x,subset(x,search)) doesn't work. What I'd be looking for is the result of a search similar to the one below. with(x,subset(x,cat1=='A' & cat2=='Z')) I'd prefer not to just create multiple subsetted data frames at the start if another solution exists. Is there a simple way to do what I'm trying?

    Read the article

  • how to get get-item cmdlet's output to variable as string

    - by aeon
    i mean when i call get-item with directory it dump to console like this ---- ------------- ------ ---- d---- 2/16/2011 8:27 PM 2011-2-16 -a--- 2/13/2011 8:24 PM 3906877184 SWP-Full Database Backup_2011-02-13 0 -a--- 2/16/2011 8:23 PM 3919766476 SWP-Full Database Backup_2011-02-16.bak 8 -a--- 2/12/2011 8:18 PM 3906877747 SWP-Full Database Backup_2011-02-12 2 -a--- 2/14/2011 8:21 PM 3875484467 SWP-Full Database Backup_2011-02-14 2 but when i convert to string it changes as \\192.168.2.89\BwLive\2011-2-16 \\192.168.2.89\BwLive\SWP-Full Database Backup_2011-02-13 \\192.168.2.89\BwLive\SWP-Full Database Backup_2011-02-16.bak \\192.168.2.89\BwLive\SWP-Full Database Backup_2011-02-12 \\192.168.2.89\BwLive\SWP-Full Database Backup_2011-02-14 i mean length,size,time attributes is omitted how can i keep these attributes while converting to string? thanks.

    Read the article

  • jquery plugins for truncating long text string by container width/height

    - by ShiVik
    Hello all As the title says, I want to truncate user-input text string based on the width and height of a designated container. My specification is to truncate the string, display some message like Read More at the end and when user clicks on it, the text slides down. UPDATE: Ah! Forgot one thing. It should handle multi-byte characters as well. Can somebody throw some light on what options do I have? jQuery plugins or some nifty jquery snippet? Thanks and Regards

    Read the article

  • Splitting a string with variable number of spaces VBA

    - by GVBA
    I have a file with a bunch of number in columns. These numbers are separated by variable number of spaces. I want to skip the first line and get all the other lines and separte each number on the line. Finally, I want to write each number on Excel. I've been able to get the lines and write them on Excel but I can't separate each number (I'm getting the whole line as one string). Does any body know how to split a string that has a variable number of spaces? Here is my code. Sub Test() r = 0 With New Scripting.FileSystemObject With .OpenTextFile("C:\Users\User\Desktop\File.tab", ForReading) If Not .AtEndOfStream Then .SkipLine Do Until .AtEndOfStream ActiveCell.Offset(r, 0) = Split(.ReadLine, vbCrLf) r = r + 1 Loop End With End With End Sub

    Read the article

  • Objective-C stringWithFormat misses an argument?

    - by rocity
    When I run this code: - (NSString *)description{ return [NSString stringWithFormat:@"(FROG idle:%i animating:%i rect:%@ position:%@ tongue:%@)", self.idleTime, self.animating, NSStringFromCGRect(self.rect), NSStringFromCGPoint(self.position), tongue ]; } I get the following output: (FROG idle:0 animating:0 rect:(null) position:{{1,2}{3,4}} tongue:{5,6}) This is wrong because it seems to be skipping the rect format string and placing everything displaced by one. So idle and animating are what I expect, then rect is skipped, but the result from NSStringFromCGRect(self.rect) is placed into position, then the result for position is pushed to tongue, then tongue is not displayed at all. I'm at a loss.

    Read the article

  • Sql Server Management Studio 2008 - Insert string with more than two lines

    - by gsharp
    I want to paste a string with more than two lines into a nvarchar(max) cell (right click a Table in Sql Server Management Studio 2008 -- Edit Rows). Unfortunately only the the first line of the string is pasted into the cell. I know, I could write a Insert/Update script for that, but it's not what I'm looking for. I need a quick way to paste some text into some cell. Is there a way to achieve my goal? Thanks in advance.

    Read the article

  • VBScript: how to set values from recordset to string

    - by phill
    This is probably a beginner question, but how do you set a recordset to a string variable? Here is my code: Function getOffice (strname, uname) strEmail = uname WScript.Echo "email: " & strEmail Dim objRoot : Set objRoot = GetObject("LDAP://RootDSE") Dim objDomain : Set objDomain = GetObject("LDAP://" & objRoot.Get("defaultNamingContext")) Dim cn : Set cn = CreateObject("ADODB.Connection") Dim cmd : Set cmd = CreateObject("ADODB.Command") cn.Provider = "ADsDSOObject" cn.Open "Active Directory Provider" Set cmd.ActiveConnection = cn cmd.CommandText = "SELECT physicalDeliveryOfficeName FROM '" & objDomain.ADsPath & "' WHERE mail='" & strEmail & "'" cmd.Properties("Page Size") = 1 cmd.Properties("Timeout") = 300 cmd.Properties("Searchscope") = ADS_SCOPE_SUBTREE Dim objRS : Set objRS = cmd.Execute WScript.Echo objRS.Fields(0) Set cmd = Nothing Set cn = Nothing Set objDomain = Nothing Set objRoot = Nothing Dim arStore Set getOffice = objRS.Fields(0) Set objRS = Nothing End function When I try to run the function, it throws an error "vbscript runtime error: Type mismatch" I presume this means it can't set the string variable with a recordset value. How do I fix this problem?

    Read the article

  • How do you tell if a string contains another string in Unix shell scripting?

    - by Matt
    Hi all, I want to write a Unix shell script that will do various logic if there is a string inside of another string. For example, if I am in a certain folder, branch off. Could someone please tell me how to accomplish this? If possible I would like to make this not shell specific (i.e. not bash only) but if there's no other way I can make do with that. #!/bin/sh CURRENT_DIR=`pwd` if [ CURRENT_DIR contains "String1" ] then echo "String1 present" elif [ CURRENT_DIR contains "String1" ] then echo "String2 present" else echo "Else" fi

    Read the article

  • Search pattern in string using regex in obj-c

    - by manileo86
    I'm working on a string pattern match algorithm. I use NSRegularExpression for finding the matches. For ex: I've to find all words starting with '#' in a string.. Currently I use the following regex function: static NSRegularExpression *_searchTagRegularExpression; static inline NSRegularExpression * SearchTagRegularExpression() { if (!_searchTagRegularExpression) { _searchTagRegularExpression = [[NSRegularExpression alloc] initWithPattern:@"(?<!\\w)#([\\w\\._-]+)? options:NSRegularExpressionCaseInsensitive error:nil]; } return _searchTagRegularExpression; } and I use it as below: NSRegularExpression *regexp = SearchTagRegularExpression(); [regexp enumerateMatchesInString:searchString options:0 range:stringRange usingBlock:^(NSTextCheckingResult *result, NSMatchingFlags flags, BOOL *stop) { // comes here for every match with range }]; This works properly. But i just want to know if this is the best way. suggest if there's any better alternative...

    Read the article

  • Handling user input in C

    - by Stuart
    In C, I am writing a program which is taking in user input than comparing it to see which output it should use. I am finding it problomatic and was wondering if someone could give me a hand. So far I have: while(cmd[0] != EOF){ fgets(cmd, sizeof(cmd), stdin); /** Takes in user input and stores it in cmd **/ if(cmd[0] == '\n') printf("%s> ", cwd); else if(strcmp(cmd, "ls") == 0) printf("I will list everything"); } Any ideas? Basically it is just ignoring any user input when there is some. P.S. The variable cwd is just a string.

    Read the article

  • Input string was not in correct format.

    - by jawahar-sync
    Hi Experts, I had a Ribbon like custom control. I created an application using this control. These applications work fine until I change the system number format. They crashes if I change the system number format like below: Current Format = English (United State) Decimal symbol = ',' Digit group symbol = '.' When I run applications, they throw an exception "Input string not in Correct format". . Some other applications specify the Exception's message = "Input string '0,2,0,2' was not a correct format", so I think in Wpf ES's xaml files, we may declare some properties i.e Padding, Margin like "0,2,0,2" = that will cause errors with the system number format above. I have note that this error only occurs in Windows Vista, it does not occurs on Windows XP. I do not know why? I have also look at this link, But it not helps for Vista. http://support.microsoft.com/kb/968227/en-us

    Read the article

  • Python method to remove iterability

    - by Debilski
    Suppose I have a function which can either take an iterable/iterator or a non-iterable as an argument. Iterability is checked with try: iter(arg). Depending whether the input is an iterable or not, the outcome of the method will be different. Not when I want to pass a non-iterable as iterable input, it is easy to do: I’ll just wrap it with a tuple. What do I do when I want to pass an iterable (a string for example) but want the function to take it as if it’s non-iterable? E.g. make that iter(str) fails.

    Read the article

  • String Encoding doesn't ouput all characters

    - by AndroidXTr3meN
    My client uses InputStreamReader/BufferedReader to fetch text from the Internet. However when I save the Text to a *.txt the text shows extra weird special symbols like 'Â'. I've tried Convert the String to ASCII but that mess upp å,ä,ö,Ø which I use. I've tried food = food.replace("Â", ""); and IndexOf(); But string won't find it. But it's there in HEX Editor. So summary: When I use text.setText(Android), the output looks fine with NO weird symbols, but when I save the text to *.txt I get about 4 of 'Â'. I do not want ASCII because I use other Non-ASCII character. The 'Â' is displayed as a Whitespace on my Android and in notepad. Thanks! Have A great Weekend! EDIT* found:   in Wordpad

    Read the article

  • Setting up Matcher for String phrase match in file

    - by randomCoder
    Having trouble figuring out how to match a phrase string to a phrase in file stream. The file I'm dealing with contains random words such as: 3 little pigs built houses and 1 little pig went to the market etc. for many lines Using "little pig" as my pattern and matcher.find() I can locate 2 matches: "little pig" and "little pigs". However, I only want it to match "little pig". What can I do? I thought about using matcher.lookingAt() but I wouldn't know how to set a proper region when I can't rely on the file string phrases I'm matching being on separate lines.

    Read the article

  • How to show string inside string in different color?

    - by Kishore Kumar
    I have one TextBox and One listbox for searching a collection of data. While searching a text inside a Listbox if that matching string found in anywhere in the list it should show in Green color with Bold. eg. I have string collection like "Dependency Property, Custom Property, Normal Property" if i type in the Search Text box "prop" all the Three with "prop" (only the word Prop) should be in Bold and its color should be in green. any idea how it can be done?. Data inside listbox is represented using DataTemplate.

    Read the article

  • rendering a new line in a string (\n) with drawRect

    - by Mrwolfy
    I am trying to render a string with a new line (line break \n), using drawRect. The code below renders the my string as a single line, with no line break, even though I am using the \n character. See the second to last line. UIFont *font = [UIFont fontWithName:@"HelveticaNeue-CondensedBlack" size:fontSize]; CGPoint point = CGPointMake(0,0); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, 1.0); CGContextSetRGBStrokeColor(context, 0.0, 0.0, 0.0, 1.0); CGContextSetLineWidth(context, 4.0); CGContextSetTextDrawingMode(context, kCGTextFillStroke); CGContextSaveGState(context); [@"test \n test" drawAtPoint:point withFont:font]; CGContextRestoreGState(context);

    Read the article

  • Regex to test if an input string contains a certain number of characters

    - by Dan
    So, I basically would like to test to see if a string contains a range of alphanumeric characters. It's to be used as a client-side validation and I don't want to prevent users from entering whatever they want. Best to give examples of what should/should not pass validation: So to be specific, the expression I'm looking for is to test to make sure string contains anywhere from 3 to 10 alphanumeric characters. I'd like to plug into an ASP.NET client side validator. NOTE: quotes not part of input (but could be!) " f o o " should pass since there are 3 chars "f_0_0" should pass " fo " should not "F......o......o......b.....a......r" should pass thx

    Read the article

  • Break a string into parts, returning all characters

    - by Benjamin
    I want to break a string according to the following rules: all consecutive alpha-numeric chars, plus the dot (.) must be treated as one part all other consecutive chars must be treated as one part consecutive combinations of 1 and 2 must be treated as different parts no whitespace must be returned For example this string: Method(hierarchy.of.properties) = ? Should return this array: Array ( [0] => Method [1] => ( [2] => hierarchy.of.properties [3] => ) [4] => = [5] => ? ) I was unsuccessful with preg_split(), as AFAIK it cannot treat the pattern as an element to be returned. Any idea for a simple way to do this?

    Read the article

  • Java escape HTML - string replace slow?

    - by cpf
    Hi StackOverflow, I have a Java application that makes heavy use of a large file, to read, process and give through to SolrEmbeddedServer (http://lucene.apache.org/solr/). One of the functions does basic HTML escaping: private String htmlEscape(String input) { return input.replace("&", "&amp;").replace(">", "&gt;").replace("<", "&lt;") .replace("'", "&apos;").replaceAll("\"", "&quot;"); } While profiling the application, the program spends roughly 58% of the time in this function, a total of 47% in replace, and 11% in replaceAll. Now, is the Java replace that slow, or am I on the right path and should I consider the program efficient enough to have its bottleneck in Java and not in my code? (Or am I replacing wrong?) Thanks in advance!

    Read the article

  • Is it possible to cast the Elapsed Time function to Integer?

    - by nuvio
    I have the following function: (def elapsedtime (with-out-str (time (run-my-function)))) and I was wondering if is possible to store only the integer value of the time, as I can only store a String at the moment.... Any suggestion? Thanks a lot UPDATE So I did use this: (defmacro nsecs [expr] `(let [start# (. System (nanoTime))] ~expr (- (. System (nanoTime)) start#))) And then modified this: (def elapsedtime (nsecs (run-my-function argument1 argument2))) but doesn't work, what am I doing wrong? "Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Wrong number of args (1) passed to: main$fn--105$nsecs"

    Read the article

  • Correct syntax for matching a string inside a variable against an array

    - by Jamex
    Hi, I have a variable, $var, that contains a string of characters, this is a dynamic variable that contains the values from inputs. $var could be 'abc', or $var could be 'blu', I want to match the string inside variable against an array, and return all the matches. $array = array("blue", "red", "green"); What is the correct syntax for writing the code in php, my rough code is below $match = preg_grep($var, $array); (incorrect syntax of course) I tried to put quotes and escape slashes, but so far no luck. Any suggestion? TIA

    Read the article

< Previous Page | 128 129 130 131 132 133 134 135 136 137 138 139  | Next Page >