Search Results

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

Page 104/1413 | < Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >

  • Replacing text with a link in jQuery

    - by Eli
    I'm trying to replace a small part of text in a large HTML document with my own element which I create on the fly. The text may be a huge bulk of text, html, images, what-ever, and what I want is to find the first (or all) the position of a certain string, and replace it with an element that I create using $('< span'). Using simple text.replace('the string', $('< span')); doesn't do the trick (I'm left with [object Object] and not the actual < span that I want. The reason I don't just inject direct HTML is because I want to retain all the binds that are related to the object I'm creating. and doing a replace with a custom ID, and then attaching binds to the ID after the HTML has been altered, seems a bit dirty. Thanks for the help! :)

    Read the article

  • String Storage and Retrieval in Android

    - by dweebsonduty
    I have a program that has items with 3 attributes. Name(String) : Count(String) : Amount(String) Currently I am writing the database when someone is trying to access a section then reading from the database. The writing is taking too long. So my question is how can I perhaps create a nested array where I can say if name = carrot then print carrot['count'] and carrot['amount']. I am very new to Java so some sample code would be great. Or any other suggestions that you may have as far as tackling this issue.

    Read the article

  • strsplit in R with metacharacter

    - by user1429852
    I have received a large amount of data where the delimiter is a backslash (obviously a bad choice). I'm processing it in R for computation, and having a hard time finding how to split the string since the backslash is a metacharacter. For example, a string would look like this: "1128\0019\XA5\E2R\366\00=15" and I want to split it along the "\" character, but when I run the strsplit command: strsplit(tempStr, "\") Error in strsplit(tempStr, "\") : invalid regular expression '\', reason 'Trailing backslash' When I try to used the "fixed" option, it does not run because it is expecting something after the backslash: strsplit(tempStr, "\", fixed = TRUE) Unfortunately, I can't preprocess the data with another program because the data is generated daily. Please help and thanks!

    Read the article

  • parse this directory path without losing slash

    - by PPTim
    hi, I have a wxPython application. I am taking in a directory path from a textbox using GetValue(). I notice that while trying to parse in the directory path "C:\Documents and Settings\UserName\Desktop\InputFile.xls", python sees the string as 'C:\\Documents and Settings\UserName\\Desktop\\InputFile.xls' (missing a slash between "Settings" and "UserName). Why is it that only that slash is not correctly escaped? Once the string has been changed to 'C:\Documents and Settings\UserName\Desktop\InputFile.xls', is there a type conversion or function that can does this properly? Thanks.

    Read the article

  • converting from int to hex

    - by Catherine
    I want to convert some ints to hex,but i'm getting something like this : "?|???plL4?h??N{" from 12345. Why? int t = 12345; System.Security.Cryptography.MD5CryptoServiceProvider ano = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] d_ano = System.Text.Encoding.ASCII.GetBytes(t.ToString()); byte[] d_d_ano = ano.ComputeHash(d_ano); string st_data1 = System.Text.Encoding.ASCII.GetString(d_d_ano); string st_data = st_data1.ToString(); I'm using it in window form,not in console.

    Read the article

  • C++ Interpreter: How to emit error messages?

    - by Rawr
    I want to emit dynamic error messages like all interpreters do nowadays, for example: Name error: Undefined variable would be constant, however what I want to reach is: Name error: Undefined variable 'X', in line 1 Okay. The line number was really no problem: Every error message must have a line number, so I added it to the error emitter function: Error( ErrType type, string msg, int line ); So where is my problem? How do I get the 'X' into Undefined variable *? I can't use sprintf as it doesn't support strings yet I use them everywhere I can't simply use cout and connect everything as I want error messages to be supressable I'd like to get everything into one function like above, Error() How do I put together dynamic error messages? For example: Error( Name, sprintf("Undefined variable %s", myVariableName ), lineNum ); (But myVariableName is a string and sprintf will mess things up)

    Read the article

  • Howto convert to string and read data from TCP packet

    - by salime
    I used sharppcap to capture TCP packets. Now i wanna reconstruct HTTP packet from TCP packets but i don't know how. I read somewhere i can find start of HTTP packet in TCP data... i tried to convert byte[] TCP data to string using this code: string s = System.Text.Encoding.UTF8.GetString(tcp_pack.Data); but the string isn't readable. like a binary file that is opened with notepad. is it because the data is encrypted or code is incorrect? how can i reconstruct HTTP packet from TCP packets?

    Read the article

  • Regular expressions in java

    - by rookie
    String s= "(See <a href=\"/wiki/Grass_fed_beef\" title=\"Grass fed beef\" " + "class=\"mw-redirect\">grass fed beef.) They have been used for " + "<a href=\"/wiki/Paper\" title=\"Paper\">paper-making since " + "2400 BC or before."; In the string above I have inter-mixed html with text. Well the requirement is that the output looks like:- They have been used for paper-making since 2400 BC or before. Could some one help me with a generic regular expression that would produce the desired output from the given input? Thanks in advance!

    Read the article

  • How to read comma separated values from text file in JAVA?

    - by user1425223
    I have got this text file with latitude and longitude values of different points on a map. I want to store these coordinates into a mySQL database using hibernate. I want to know how can I split my string into latitudes and longitudes? What is the general way to do these type of things that is with other delimiters like space, tab etc.? File: 28.515046280572285,77.38258838653564 28.51430151808072,77.38336086273193 28.513566177802456,77.38413333892822 28.512830832397192,77.38490581512451 28.51208605426073,77.3856782913208 28.511341270865113,77.38645076751709 28.510530488025346,77.38720178604126 28.509615992924807,77.38790988922119 28.50875805732363,77.38862872123718 28.507994394490268,77.38943338394165 28.50728729434496,77.39038825035095 28.506674470385246,77.39145040512085 28.506174780521828,77.39260911941528 28.505665660113582,77.39376783370972 28.505156537248446,77.39492654800415 28.50466626846366,77.39608526229858 28.504175997400655,77.39724397659302 28.503685724059455,77.39840269088745 28.503195448440064,77.39956140518188 28.50276174118543,77.4007523059845 28.502309175192945,77.40194320678711 28.50185660725938,77.40313410758972 28.50140403738471,77.40432500839233 28.500951465568985,77.40551590919495 28.500498891812207,77.40670680999756 28.5000463161144,77.40789771080017 28.49959373847559,77.40908861160278 Code I am using to read from file: try { BufferedReader in = new BufferedReader(new FileReader("G:\\RoutePPAdvant2.txt")); String str; str = in.readLine(); while ((str = in.readLine()) != null) { System.out.println(str); } in.close(); } catch (IOException e) { System.out.println("File Read Error"); }

    Read the article

  • trying to put an mysql result into a string

    - by user1583432
    I'm trying to put an mysql query result into an string I tried to find an answer but all the similar posts were getting subquery answers which is not what I'm trying to do. for example Fruits_tbl ID Fruit Color Number __________________________________ 2 Apple Red 5 $sql = "select Fruits,Color,Number from Fruits_tbl where ID = 2"; $result = $pdo->query($sql); $row = $result->fetch(); print_r($row); This will give me something like Array([0]="Apple", [1]="Red", [2]="5", [Fruit]="Apple", [Color]="Red", [Number]="5") implode will give me 2 of each I want just need a string = "Apple, Red, 5" what I currently have is $string = $row[Fruit].", ".$row[Color].", ".$row['Number'] As you can see that's rather tedious. Is there something like implode but only return the index array or something?

    Read the article

  • Read a String as XML in .NET 2.0

    - by Chin
    I have a string that is coming from DB. I would like to read this as XML. String looks like below <settings> <setting name="OfferIDs" value="47,48,49,50,51,52,53,76,77,78,79" /> <setting name="someothersetting" value="" /> <setting name="anothersetting" value="" /> </settings> I would like get the value of OfferIDs as a string using VB.NET. Many Thanks in advance.

    Read the article

  • is there a way to use cin.getline() without having to define a char array size before hand?

    - by zebraman
    Basically my task is having to sort a bunch of strings of variable length ignoring case. I understand there is a function strcasecmp() that compares cstrings, but doesn't work on strings. Right now I'm using getline() for strings so I can just read in the strings one line at a time. I add these to a vector of strings, then convert to cstrings for each call of strcasecmp(). Instead of having to convert each string to a cstring before comparing with strcasecmp(), I was wondering if there was a way I could use cin.getline() for cstrings without having a predefined char array size. Or, would the best solution be to just read in string, convert to cstring, store in vector, then sort?

    Read the article

  • Regular expression for a string containing one word but not another

    - by Chris Stahl
    I'm setting up some goals in Google Analytics and could use a little regex help. Lets say I have 4 URLs http://www.anydotcom.com/test/search.cfm?metric=blah&selector=size&value=1 http://www.anydotcom.com/test/search.cfm?metric=blah2&selector=style&value=1 http://www.anydotcom.com/test/search.cfm?metric=blah3&selector=size&value=1 http://www.anydotcom.com/test/details.cfm?metric=blah&selector=size&value=1 I want to create an expression that will identify any URL that contains the string selector=size but does NOT contain details.cfm I know that to find a string that does NOT contain another string I can use this expression: (^((?!details.cfm).)*$) But, I'm not sure how to add in the selector=size portion. Any help would be greatly appreciated!

    Read the article

  • how to add connection string for a windows form applicaton in asp.net

    - by manoj chalode
    i am working on windows form application and i want to add connection string of a database in. Right now, though i can access database i don't know the proper reasoning behind it. I have created a database and added it in a "Database" folder. The code for it is given below. i also want to know how can I make a connection string which can work on different PCs without changing it (I'm talking about relative path given in the "AttachDbFilename" attribute in the connection string). Reply... Conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename="+ Application.StartupPath + "\\Database\\Database.mdf;Integrated Security=True;User Instance=True");

    Read the article

  • Converting delimited string to multiple values in mysql

    - by epo
    I have a mysql legacy table which contains an client identifier and a list of items, the latter as a comma-delimited string. E.g. "xyz001", "foo,bar,baz". This is legacy stuff and the user insists on being able to edit a comma delimited string. They now have a requirement for a report table with the above broken into separate rows, e.g. "xyz001", "foo" "xyz001", "bar" "xyz001", "baz" Breaking the string into substrings is easily doable and I have written a procedure to do this by creating a separate table, but that requires triggers to deal with deletes, updates and inserts. This query is required rarely (say once a month) but has to be absolutely up to date when it is run, so e.g. the overhead of triggers is not warranted and scheduled tasks to create the table might not be timely enough. Is there any way to write a function to return a table or a set so that I can join the identifier with the individual items on demand?

    Read the article

  • parent pass text string to child swf, as3

    - by VideoDnd
    Parent loads Child, and wants to pass text string to Child. How can Parent pass a string to Child swf? PARENT.SWF //LOAD CHILD 'has a symbol on stage called LDR that CHILD loads into' var loadCHILD:Loader = new Loader(); LDR.addChild(loadCHILD); var bgURLTxt:URLRequest = new URLRequest("CHILD.swf"); loadCHILD.load(bgURLTxt); //ATTEMPT TO COMMUNICATE WITH CHILD TXT function handler(event:Event):void { LDR = (event.target.loader.content as MovieClip); var textBuddy:MovieClip = event.target.content.root.txtBuddy; //MY TEXT var txtTest:String; txtTest = "my bad"; trace(txtTest); } CHILD.SWF 'has DynamicTextfield called txt'

    Read the article

  • mysql date format with changing string value

    - by hacket
    I have a field called Timestamp, that stores its values as text as opposed to an actual Timestamp. The logging application is unchangeable, unfortunately. So table.Timestamp -> text field with format -> "Wed Mar 02 13:28:59 CDT 2011" I have been developing a query to purge all but the most recent row using this as my Timestamp selector, which is also converting the string into a date - MAX( STR_To_DATE( table.Timestamp , '%a %b %d %H:%i:%s CDT %Y' ) My query works perfectly... However, what I've found is that the string value - 'CDT' - changes between 'CDT' and 'CST' depending on whether the current time is daylight savings time or not. During daylight savings time, it logs as 'CDT', and vice versa. So all the rows that contain 'CST' get ignored when I run this - MAX( STR_To_DATE( table.Timestamp , '%a %b %d %H:%i:%s CDT %Y' ) and all the rows that contain 'CDT' get ignored when I run this - MAX( STR_To_DATE( table.Timestamp , '%a %b %d %H:%i:%s CST %Y' ) Is there a way to make it run against both string formats?

    Read the article

  • String.Format in javascript?

    - by chobo2
    Hi this is driving me nuts. I believe I asked this exact same question but I can't find it anymore(I used stackoverflow search, google search, manually searched my posts, searched my code). I wanted something that would be like the C# String.Format where you could do something like string format = String.Format("Hi {0}",name); just for javascript of course and one person gave me a simple answer it was not like a jquery plugin or anything but I think you made some json thing or something and it worked and was simple to use. I for the life of me can't find this post.

    Read the article

  • Manipulating both unicode and ASCII character set in C#

    - by Murlex
    I have this mapping in my C# application string [,] unicode2Ascii = { { "&#3001;", "\x86" } }; ஹ - is the unicode value for a tamil literal "ஹ". This is the raw hex literal for the unicode value saved by MS Word as a byte sequence. I am trying to map these unicode value "strings" to a hex value under 255 (so as to accommodate non-unicode supported systems). I trying to use string.replace like this: S = S.replace(unicode2Ascii[0,0], unicode2Ascii[0,1]); However the resultant ouput has a ? instead of the actual hex 0x86 stored. Any pointer on how I could set the encoding for the second element of that array to something like windows-1252? Or is there a better way to do this conversion? thanks in advance

    Read the article

  • Object for storing strings geted from prints

    - by evg
    class MyWriter: def __init__(self, stdout): self.stdout = stdout self.dumps = [] def write(self, text): self.stdout.write(smart_unicode(text).encode('cp1251')) self.dumps.append(text) def close(self): self.stdout.close() writer = MyWriter(sys.stdout) save = sys.stdout sys.stdout = writer I use self.dumps list to store geted data from prints. Is it exists more convinient object for storing string lines in memory? ideally i want dump it to one big string. I can get it like this "\n".join(self.dumps) from code above. Mb it's better to just concat strings - self.dumps += text ?

    Read the article

  • Undocumented overload of string.Split() ?

    - by Neil N
    According to both Intellisense and MSDN doc on string.Split, there are no parameterless overloads of string.Split. Yet if I type in string[] foo = bar.Split(); It compiles. And it works. I have verified this in both Visual Studio 2008 and 2010. In both cases intellisense does not show the parameterless overload. Is there a reason for this? Are there any other missing overloads from the MSDN/Intellisense docs? Usually browsing through overloads in intellisense is how I best determine which overload to use. I'd hate to think I am missing other available options throughout the .Net framework.

    Read the article

  • escaping query string with special characters with python

    - by that_guy
    I got some pretty messy urls that i got via scraping here, problem is that they contain spaces or other special characters in the path and query string, here is some example http://www.example.com/some path/to the/file.html http://www.example.com/some path/?file=path to/file name.png&name=name.me so, is there an easy and robust way to escape the urls so that i can pass them to urlopen? i tried urlib.quote, but it seems to escape the '?', '&', and '=' in the query string as well, and it seems to escape the protocol as well, currently, what i am trying to do is use regex to separate the protocol, path name, and query string and escape them separately, but there are cases where they arent separated properly any advice is appreciated

    Read the article

  • Parsing a string representing a float *with an exponent* in Python

    - by Lucas
    Hi, I have a large file with numbers in the form of 6,52353753563E-7. So there's an exponent in that string. float() dies on this. While I could write custom code to pre-process the string into something float() can eat, I'm looking for the pythonic way of converting these into a float (something like a format string passed somewhere). I must say I'm surprised float() can't handle strings with such an exponent, this is pretty common stuff. I'm using python 2.6, but 3.1 is an option if need be.

    Read the article

  • MySQLi String comparisons using keys

    - by asdasd
    I have a table with lets say 2 columns. id number, and value. Value is a string (var char). Lets say i have a number x, and a list of numbers a1, a2, a3, a4, a5..... where x is not in the list. All of these numbers correspond to a unique row in the table. I want to know if the string value for x in the table is contained in one of the string values for any table entry for a1, a2, a3, a4... Lets say i have these rows: x, aaa a1, bbb a2, ccc a3, ddd a4, aaabbbcc then i want somehow a confirmation that yes, the value for x is included in one of the values in my list of numbers (a4 contains x). I know i can do this in a couple queries and shove it down some PHP and get my answer. But can i do this with one query?

    Read the article

< Previous Page | 100 101 102 103 104 105 106 107 108 109 110 111  | Next Page >