Search Results

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

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

  • Opening PDF String in new window with javascript

    - by DaveC
    Hello, I have a formatted PDF string that looks like %PDF-1.73 0 obj<<< /Type /Group /S /Transparency /CS /DeviceRGB >> /Resources 2 0 R/Contents 4 0 R>> endobj4 0 obj<> streamx??R=o?0??+??=|vL?R???l?-???,???Ge?JK????{???Y5?????Z?k?vf?a??`G????Asf?z????`%??aI#?!;?t???GD?!???<?????B?b?? ... 00000 n 0000000703 00000 n 0000000820 00000 n 0000000926 00000 n 0000001206 00000 n 0000001649 00000 n trailer << /Size 11 /Root 10 0 R /Info 9 0 R >>startxref2015%%EOF I am trying to open up this string in a new window as a PDF file. Whenever I use window.open() and write the string to the new tab it thinks that the text should be the contents of an HTML document. I want it to recognize that this is a PDF file. Any help is much appreciated

    Read the article

  • Trouble converting string/character to byte in lisp

    - by WanderingPhd
    I've some data that I'm reading in using read-line and I want to convert it into a byte-array. babel:string-to-octet works for the most part except when the character\byte is larger (above 200) in which case it returns two numbers. As an example, if the character is ú using babel:string-to-octet returns (195 185) instead of 250 which is what I'm looking for. I tried a number of encodings in babel but none of them seem to work. If I use read-byte or read-sequence it does read in 250. But for reasons of backward compatibility, I'm left with using read-line and I would like to know if there is something I'm missing when using babel:string-to-octet to convert ú to 250. I'm using ccl 1.8 btw.

    Read the article

  • substitute string in php from another file

    - by Gjergj Sheldija
    i have some old php files which i'd like to convert to use gettext. those files have a content like this : $LD = 'Some String'; $Another = 'some other ~n~ string'; i have to substitute all the $LD, $Another in the files where they are declared with something like : _('Some string'); hacking a bit a created some sort of regexp to find the declarations, my aim was to use sed and awk to do the replaces..but i don't have any clue on how to do those substitutions ... any help ...

    Read the article

  • I just can't figure out strcat.

    - by Anonymous
    I know I shouldn't be using that function, and I don't care. Last time I checked the spec for strcat, it said something along the lines of updating the first value as well as returning the same. Now, this is a really stupid question, and I want you to explain it like you're talking to a really stupid person. Why won't this work? char* foo="foo"; printf(strcat(foo,"bar")); EDIT: I don't know the difference between char[] and char*. How would I allocate a string of 255 characters? EDIT 2: OK, OK, so char[number] allocates a string of that many bytes? Makes sense. Thanks.

    Read the article

  • android RegEx external GPS string

    - by user1271363
    I have a problem with seperating information in a string i get from the external GPS stream. Heres a example of a string: $GPGSV,3,3,12,22,09,276,31,25,24,247,24,27,54,131,,32,04,359,19*71 $GPGLL,5703.85365,N,00953.88360,E,075510.00,A,A*69 $GPPWR,028a,1,0,1,1 $GPRMC,075511.00,A,5703.85369,N,00953.88430,E,0.335,302.17,070912,,,A*6E $GPVTG,302.17,T,,M,0.335,N,0.621,K,A*3A Want i am trying to do is to get the " $GPGLL,5703.85365,N,00953.88360,E,075510.00,A,A*69 " out so i can grab the longtitude and latitude and then update my textview with it. But keep getting string out of bounch exeption and i start wondering if i am handling this in the wrong way. Anyone that can put me in the right direction in how to solve this?

    Read the article

  • How to inspect JSP request URL for String

    - by IAmYourFaja
    I have the following processor.jsp file: <% response.sendRedirect("http://buzz.example.com"); %> I want to change it so that it inspects the HTTP request URL for the presence of the word "fizz" and, if it exists, redirect the user to http://fizz.example.org instead. So something like: <% String reqUrl = request.getURL().toLowerCase(); String token = null; if(reqUrl.contains("fizz")) { token = "fizz"; } else { token = "buzz"; } String respUrl = "http://%%%TOKEN%%%.example.com".replace("%%%TOKEN%%%", token); response.sendRedirect(respUrl); %> However this doesn't work. Any ideas on what I should be using instead of request, or if I'm doing anything else wrong?

    Read the article

  • Regular expression to truncate a String

    - by user470184
    To truncate a String here is what I'm using : String test1 = "this is test truncation 1.pdf"; String p1 = test1.substring(0, 10) + "..."; System.out.println(p1); The output is 'this is te...' How can I access the file name extension so that output becomes : 'this is te... pdf' I could use substring method to access the last three characters but other file extensions could be 4 chars in length such as .aspx Is there a regular expression I can use so that "this is test truncation 1.pdf" becomes "this is te... pdf"

    Read the article

  • How can I declare constant strings for use in both an unmanaged C++ dll and in a C# application?

    - by Surfbutler
    Curently I'm passing my const string values up from my C++ into my C# at startup via a callback, but I'm wondering if there's a way of defining them in a C++ header file that I can then also refer to in C#. I already do this with enums as they are easy. I include a file in both my C++ library project (via a .h file with a pragma once at the top), and my C# application (as a link): #if _NET public #endif enum ETestData { First, Second }; I know it sounds messy, but it works :) But...how can I do the same with string constants - I'm initially thinking the syntax is too different between the platforms, but maybe there's a way? Using clever syntax involving #if _NET, #defines etc? Using resource files? Using a C++/CLI library? Any ideas?

    Read the article

  • A Tkinter StringVar() Question

    - by Graham
    I would like to create a StringVar() that looks something like this: someText = "The Spanish Inquisition" #Here's a normal variable whose value I will change eventually TkEquivalent = StringVar() #and here's the StringVar() TkEquivalent.set(string(someText)) #and here I set it equal to the normal variable. When someText changes, this variable will too... HOWEVER: TkEquivalent.set("Nobody Expects " + string(someText)) If I do this, the StringVar() will no longer automatically update! How can I include that static text and still have the StringVar() update to reflect changes made to someText? Thanks for your help.

    Read the article

  • Javascript Regex Replace string, special character need help

    - by Mohummad Abdullah
    I am trying to replace string on page in runtime example: find string "(800).123.4567" to "<span>(800)123.4567</span>" means i want to add span tag before and after of string. here is i m doing this is my code: var avidno = '(800)123 1234'; function validate () { var regex = /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/; if (regex.test(avidno)) { alert('bingo'); var altrstr = '<span>'+avidno+'</span>'; alert(altrstr); // Valid international phone number } else { alert('uupss'); // Invalid international phone number } } validate();

    Read the article

  • Replace String pattern in Java

    - by Hirantha
    I have the following string "value=\"\\d{4}((((0[1-9])|(1[0-2]))((0[1-9])|([12]\\d)|(3[01]))?)?|(\\-(((0[1-9])|(1[0-2]))(\\-((0[1-9])|([12]\\d)|(3[01])))?)?)?)d{4}" There I want to replace all the occurrences of "{" with NCHAR(0x7B) "}" with NCHAR(0x7D). An the content in-between "{ }" should remain unchanged: Ex: \\d{4} after replacing -> NCHAR(0x7B) 4 NCHAR(0x7D). Is there a way to do this using Regular Expressions in Java?. Anyway, this can be done processing the whole string using string operations.

    Read the article

  • Problem with passing folder path string to web service function via jQuery.ajax

    - by the_V
    Hello, I need to perform asp.net web-service function call via jQuery and pass asp.net application path to it. That's the way I'm trying to do it (code is located within asp.net page, e.g. aspx file): var d = "{'str':'<%=System.DateTime.Now.ToString() %>', 'applicationPath':'<%=GetApplicationPath() %>'}"; $.ajax({ type: "POST", url: "http://localhost/testwebsite/TestWebService.asmx/Test", data: d, contentType: "application/json; charset=utf-8", dataType: "json", error: function (xhr, status, error) { var err = eval("(" + xhr.responseText + ")"); alert(err.Message); }, success: function (msg) { } }); That's what GetApplicationPath method looks like: protected string GetApplicationPath() { return HttpUtility.HtmlEncode(Request.PhysicalApplicationPath); } And here is a header of web-service function which I'm trying to call: public void Test(string str, string applicationPath) Function call works well, but applicationPath parameter doesn't passed correctly. When I debug it I see that backslashes are removed, function gets "C:ProjectsSamplesmytestwebsite" instead of "'C:\Projects\Samples\mytestwebsite\'". How can I overcome this?

    Read the article

  • How to insert any string in sqlite3 in c

    - by ashishtripathi.hcu
    Hi I have to insert a string into a sqlite data base my command .. Err=sqlite_exec(DB, "create table tbl5(TEXT varchar(100));", xCallback, (void*)"First Test", &ErrMsg); Err=sqlite_exec(DB, "insert into tbl5 values ('some string');", xCallback, (void*)"First Test", &ErrMsg); works fine but when I want to put s="some string" ie Err=sqlite_exec(DB, "insert into tbl5 values (s);", xCallback, (void*)"First Test", &ErrMsg); then this is not working so how to add variable then It is not working so how to insert variable in sqlite database thank u

    Read the article

  • Object for storing strings in Python

    - 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 data obtained from prints. Is there a more convenient 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. May be it's better to just concatenate strings - self.dumps += text?

    Read the article

  • Javascript: How to escape Unicode Chars

    - by user293006
    JSON String: { "id":31896, "name":"Zickey attitude - McKinley, La Rosi\u00e8re, 21 ao\u00fbt 2006", ... } this causes an unterminated string in javascript. my focus on solution is: data.replace(/(\S)\1(\1)+/g, ''); or data.replace(/\u([0-9A-Z])/, ''); any ideas/solution? example: http://api.jamendo.com/get2/id+name+url+stream+album_name+album_url+album_id+artist_id+artist_name/track/jsonpretty/track_album+album_artist/?n=13&order=ratingmonth_desc&tag_idstr=jazz last node is the problem, fyi. (/\u([0-9A-Z])/, '\1');

    Read the article

  • C++ - Efficient container for large amounts of searchable data?

    - by Francisco P.
    Hello, everybody! I am implementing a text-based version of Scrabble for a College project. My dictionary is quite large, weighing in at around 400.000 words (std::string). Searching for a valid word will suck, big time, in terms of efficiency if I go for a vector<string> ( O(n) ). Are there any good alternatives? Keep in mind, I'm enrolled in freshman year. Nothing TOO complex! Thanks for your time! Francisco

    Read the article

  • Search a string for certain numbers

    - by Hassan Gulzar
    Hello! I'm trying to come up with a lightning fast solution to find portions in a string. Here is a Sample string: "PostLoad successful! You transferred amount of 17.00 Rs to 03334224222. Now use PostLoad by dialing 123. PostLoad on SMS will end on 01-03-2011." Objective: Need to retrieve the bold values: Amount and Cell Number. The string contents change slightly but the cell number will always be a 11 digit. The amount is always with two decimal precision. Any suggestions using C# and RegEx?

    Read the article

  • Search for string within text column in MySQL

    - by user94154
    I have mysql table that has a column that stores xml as a string. I need to find all tuples where the xml column contains a given string of 6 characters. Nothing else matters--all I need to know is if this 6 character string is there or not. So it probably doesn't matter that the text is formatted as xml. Question: how can I search within mysql? ie SELECT * FROM items WHERE items.xml [contains the text '123456'] Is there a way I can use the LIKE operator to do this? Thanks

    Read the article

  • Cannot convert to string [on hold]

    - by user3598883
    I am trying to transfer information from form1 to form2 and I am getting the error of "Cannot implicitly convert type form1.employee to 'string' Some coding i have used for this transfer process is as follows: (everything is set to public) I'll Also add that I ONLY have it set to FirstName.FirstName because it seems tog et it to work if I remove one one of the FirstName then It tells me it cannot convert to string public void Enter_Click(object sender, EventArgs e) Form2 frm2 = new Form2(); Employee FirstName = new Employee(); if (Directions.Text == "Please Enter Employee First Name") { FirstName.FirstName = Info.Text; Directions.Text = "Please Enter Employee Last Name"; } frm2.FN.Text = FirstName; public class Employee { public string FirstName; }

    Read the article

  • Returning a href within a string

    - by user701254
    How can I return a href within a string, I can access the start position but not sure how to get last position : Here is what I have so far : String str = "sadf ad fas dfa http:\\www.google.com sdfa sadf as dfas"; int index = str.indexOf("http"); String href = str.substring(index , ???); What should the end index be ? Note, this is targeted at j2me & I need to minimise download footprint so I cannot use regular expressions or third party regular expressions libraries.

    Read the article

  • Regular expression one or more times JAVA

    - by user1381564
    Hi i am trying to match a string against a pattern this is the possible string signal CS, NS, dl: stateType := writeOrRead0; signal CS, pS : stateType := writeOrRead0; signal dS : stateType := writeOrRead0; i am only concerned with the pattern as far as the first colon. but the number of signals define can be more than one it could be three or four even this is the regular expression i have ^signal\\s*(\\w+),*\\s*(\\w+)\\s*: it will pick up the second two signal but and for the second one it picks up CS and pS and but the d and S in the next signal when i use matcher.group() come up seperately Can anyone give me an expression that will pick up all signal names whether there is one two three or more?

    Read the article

  • Send a String[] ArrayList over Socket connection

    - by Duncan Palmer
    So i'm trying to send a String[] Array/List over an open socket connection. I currently have this code: Sending: public void sendData() { try { OutputStream socketStream = socket.getOutputStream(); ObjectOutputStream objectOutput = new ObjectOutputStream(socketStream); objectOutput.writeObject(new String[] {"Test", "Test2", "Test3"}); objectOutput.close(); socketStream.close(); } catch (Exception e) { System.out.println(e.toString()); } } Recieving: public Object readData() { try { InputStream socketStream = socket.getInputStream(); ObjectInputStream objectInput = new ObjectInputStream(new GZIPInputStream(socketStream)); Object a = objectInput.readObject(); return a; } catch(Exception e) { return null; } } After I have recieved the String array/list on the other end I want to be able to iterate through it like I would do normally so I can get the values. My current code doesn't seem to works as it returns null as the value. is this possible?

    Read the article

  • Strings - Filling In Leading Zeros Wtih A Zero

    - by headscratch
    I'm reading an array of hard-coded strings of numeric characters - all positions are filled with a character, even for the leading zeros. Thus, can confidently parse it using substring(start, end) to convert to numeric. Example: "0123 0456 0789" However, a string coming from a database does not fill in the leading zero with a 'zero character', it simply fetches the '123 456 789', which is correct for an arithmetic number but not for my needs and makes for parsing trouble. Before writing conditionals to check for leading zeros and adding them to the string if needed, is there a simple way of specifying they be filled with a character ? I'm not finding this in my Java book... I could have done the three conditionals in the time it took to post this but, this is more about 'education'... Thanks

    Read the article

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