Search Results

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

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

  • jquery to construct a string and pass it as a post argument for file

    - by user253530
    I have this js code: $("#startSearch").live("click", function(event){ $("input:checkbox[name='searchId']:checked").each(function(){ var searchId = $(this).val(); var host = ''; $.post("php/autosearch-get-host.php",{sId: searchId},function(data){ host = 'http://' + data + '/index.php'; }); //alert(host); $.getJSON(host,{searchId: $(this).val()},function(){ pagination("php/pagination.php", $('#currentPage').val(), $('#sortBy').val(), $("#sortMode").val(), "autosearch"); }); }); }); The php file php/autosearch-get-host.php returns a string with the host name. What i want is to get the host from the database, create the URL using string concatenation and pass it as an argument to another $.post. $.post should use that URL like this: $.getJSON(host,{searchId: $(this).val()},function() { pagination("php/pagination.php", $('#currentPage').val(), $('#sortBy').val(), $("#sortMode").val(), "autosearch"); });

    Read the article

  • get last 5 character vb.net

    - by Chocho
    i want to get the last 5 digits/strings from a strings of words. eg: "I will be going to school in 2011!" i am using visual studio.net 2008 and using vb.net. i will like to get "2011!" note, my strings changes, and the last 5 characters can be anything! any ideas. i know visual basic have Right(string, 5); this didn't work for me gave me an error. thanks

    Read the article

  • How to parse an XML string in TDI

    - by ongle
    I am new to TDI. I have a TDI assembly line that calls a web service (ibmdi.InvokeSoapWS) which returns the result as a string in the work attribute 'xmlString'. I then have an AttributeMap that attempts to parse the xml and extract a value (the node it seeks is a few nodes deep). var parser = system.getParser('ibmdi.SOAP'); var xmlString = work.getString('xmlString'); var entity = parser.parseRequest(xmlString); task.dump(entity); The trouble is, the parsed object does not contain an accurate representation of the XML. It contains only two attributes, the first is correctly the first node following the soap body (e.g., ns0:SomeNodeReply), the second being a node inside the first (e.g., ns0:DetailCount). And as far as I can determine, both attributes are just strings so I cannot recurse into the object graph. Below is a sample soap reply: <?xml version="1.0" encoding="utf-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <ns0:SomeNodeReply xmlns:ns0="http://xmlns.example.com/unique/default/namespace/1136581686664"> <ns0:Status> <ns0:StatusCD>000</ns0:StatusCD> <ns0:StatusDesc /> </ns0:Status> <ns0:DetailCount>1</ns0:DetailCount> <ns0:SomeDetail> <ns0:CodeA>Foo</ns0:CodeA> <ns0:CodeB>Bar</ns0:CodeB> </ns0:SomeDetail> </ns0:SomeNodeReply> </SOAP-ENV:Body> </SOAP-ENV:Envelope> And below is a sample dump of the parsed string: 19:03:23 CTGDIS003I *** Start dumping Entry 19:03:23 Operation: generic 19:03:23 Entry attributes: 19:03:23 SOAP_CALL (replace): 'ns0:SomeNodeReply' 19:03:23 ns0:DetailCount(replace): '1' 19:03:23 CTGDIS004I *** Finished dumping Entry All I really need to do is be able to parse out a value that may or may not be there, depending on the value of another node (e.g., DetailCount == 1, get CodeA otherwise return empty string). I am open to changing anything about how this works if I can extract the data into the work Entry.

    Read the article

  • Using jQuery to find keywords in string

    - by Nic Hubbard
    In php, I have used preg_match_all() to find keywords (using the format %keyword%) in a string, which works wonderfully and returns an array of all found keywords. What I would like to do, is do the same thing using jQuery or javascript. I have tried using the filter() function, and it kind of works. But I think I am missing something. How can I find ALL instances of the keyword in a string, using a regex? Here is what I have worked out so far: $("[id^='editableContent-']").filter(function() { alert($(this).html().match(/\%(.*?)\%/)); }); Any suggestions are welcome!

    Read the article

  • Get the entire string of a jquery DOM object

    - by Scozzard
    Hi, I have had a bit of a look around and am having some difficulty solving a wee issue I am having. I basically have a string of HTML, I convert that to a JQuery DOM object so that I can easily remove all elements that have a certain class using JQuery's .remove(). I.e., var radHtml = editor.get_html(); var jqDom = $(radHtml); $(".thickbox", jqDom).remove(); editor.set_html(jqDom.html()); The only problem is that .html() only gets the first element, not the entire DOM. In reference to my code I am basically wanting radHhtml - elements with class "thickbox" (returned as string). I was wondering if there was an easy way to do this - have some html and remove all elements (in this case divs) that have a certain class (but leaving their contents). JQuery doesnt have to used, but I would like to. Any help would be much appreicated. Thanks.

    Read the article

  • replace set of integers with respective string values

    - by Tripz
    I have a query which return the output like -- 5,4,6 Where 1 = apple, 2 = mango, 3 = banana, 4 = plum, 5 = cherry, 6 = kiwi etc. I would like to update my output as cherry,plum,kiwi instead of 5,4,6 How can I achieve that in the same select statment. I am okay to hard code the values. Please confirm May be I did explain clearly Here is the sample SELECT fruits FROM t_fruitid where id = 7 is returning me '5,6,4' as a single row Now I want to update this single row output as 'cherry,plum,kiwi' How do I do this Thanku

    Read the article

  • How can I use IndexOf to pick a specific Character when there are more than one of them?

    - by JimDel
    How can I use IndexOf with SubString to pick a specific Character when there are more than one of them? Here's my issue. I want to take the path "C:\Users\Jim\AppData\Local\Temp\" and remove the "Temp\" part. Leaving just "C:\Users\Jim\AppData\Local\" I have solved my problem with the code below but this assumes that the "Temp" folder is actually called "Temp". Is there a better way? Thanks if (Path.GetTempPath() != null) // Is it there?{ tempDir = Path.GetTempPath(); //Make a string out of it. int iLastPos = tempDir.LastIndexOf(@"\"); if (Directory.Exists(tempDir) && iLastPos > tempDir.IndexOf(@"\")) { // Take the position of the last "/" and subtract 4. // 4 is the lenghth of the word "temp". tempDir = tempDir.Substring(0, iLastPos - 4); }}

    Read the article

  • Prevent strings stored in memory from being read by other programs

    - by Roy
    Some programs like ProcessExplorer are able to read strings in memory (for example, my error message written in the code could be displayed easily, even though it is compiled already). Imagine if I have a password string "123456" allocated sequentially in memory. What if hackers are able to get hold of the password typed by the user? Is there anyway to prevent strings from being seen so clearly? Oh yes, also, if I hash the password and sent it from client to server to compare the stored database hash value, won't the hacker be able to store the same hash and replay it to gain access to the user account? Is there anyway to prevent replaying? Thank You!

    Read the article

  • Remove a certain value from string which keeps on changing

    - by user2971375
    I m trying to make a utility to generate a Insert script of sql tables along with relational table. I got all the values in c#. Now I want to remove the one column name and its value from the script.most probably the identity column. Eg. The string I have (which keeps on changing with table name and varies) INSERT Core.Customers ([customerId],[customername],[customeradress],[ordernumber]) Values(123,N'Rahul',N'244 LIZ MORN',2334) NOW I know I have to remove CustomerId. (sometimes need to be replaces with @somevariable) Please give me an efficient way how to retrieve customerId value and Deleting column name and value . Conditions: insert script length and columns names keep changing. Method should return the deleted value. At some point of time customer id can be same as order id. In that case my string.remove method fails.

    Read the article

  • nginx rule to capture header and append value as query string

    - by John Schulze
    I have an interesting problem I need to solve in nginx: one of the sites I'm building receives inbound traffic on port 80 (and only port 80) which may have a certain header set in the request. If this header is present I need to capture the value of it and append that as a querystring parameter before doing a temporary redirect (rewrite) to a different (secure) server, while passing the paramater and any other querystring params along. This should be very doable, but how!? Many thanks, JS

    Read the article

  • jquery , selector, contains one of the text

    - by Alexander Corotchi
    Hi , I need a help for one thing : this is my jQuery idea: var text = "Some Text1, Some Text2, Some Text3"; $("h3:contains('"+even one of this string+"')").each(function() { $(this).append("<span>Some Text</span>"); }); This is My HTML <h3 class="test1">Some Text2</h3> <h3 class="test1">Some Text1</h3> <h3 class="test3">Another Text</h3> What I want in OUTPUT: <h3 class="test1"> Some Text2 <span>Some Text</span> </h3> <h3 class="test1"> Some Text1 <span>Some Text</span> </h3> <h3 class="test3">Another Text</h3> Thanks!

    Read the article

  • xquery expression to return a link text only if it contains within it a specific string

    - by Arvind
    I want to extract some links from a XML document (links are in same format as on html pages). Now for eg a link is "http://xyz.com/start/tyu/a.html" and another is "http://ert.com/tyu/b.html" while a third link is "http://asdf.com/ghjk/c.html" From the above 3 links (which I have with me using a for clause in a FLWOR expression)...I want only the links which contain within them a string "tyu" to be selected-- I thought of using substring for this, but substring requires start and end positions to be specified- whereas in my scenario, I dont know at which position the desired string will be. How do I do substring matching in such a scenario, i.e. where exact position for occurrence of substring, is not known? I can use XQuery 1.0 for this purpose. Finally, I want to extract the link URL, as well as link text...

    Read the article

  • convert String "11-10-10 12:00:00" into Date Object

    - by Mahendra Athneria
    Hi, I want to convert String "11-10-10 12:00:00" into Date object but i am not able to do so. can you please help me out? below is the code snippet. i have the Date obj which has the value = Mon Oct 11 00:00:00 IST 2010 DateFormat newDateFormat = new SimpleDateFormat("dd-MM-yy hh:mm:ss"); String strDate = newDateFormat.format(tempDate); //**i got strDate as strDate is : 11-10-10 12:00:00** DateFormat newDateFormat1 = new SimpleDateFormat("dd-MM-yy hh:mm:ss"); try { tempDate = newDateFormat1.parse(strDate); // **getting tempDate as - Mon Oct 11 00:00:00 IST 2010** } catch (ParseException e) { // TODO Auto-generated catch block e.printStackTrace(); } Can someone help me to solve this issue? Regards, Mahendra Athneria Mumbai, India

    Read the article

  • linq to sql string property from non-null column with default

    - by Barry Fandango
    I have a LINQ to SQL class "VoucherRecord" based on a simple table. One property "Note" is a string that represents an nvarchar(255) column, which is non-nullable and has a default value of empty string (''). If I instantiate a VoucherRecord the initial value of the Note property is null. If I add it using a DataContext's InsertOnSubmit method, I get a SQL error message: Cannot insert the value NULL into column 'Note', table 'foo.bar.tblVoucher'; column does not allow nulls. INSERT fails. Why isn't the database default kicking in? What sort of query could bypass the default anyway? How do I view the generated sql for this action? Thanks for your help!

    Read the article

  • How to format a string as a telephone number in C#

    - by Brian G
    I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a new variable. I was thinking: String.Format("{0:###-###-####}", i["MyPhone"].ToString() ); but that does not seem to do the trick. ** UPDATE ** Ok. I went with this solution Convert.ToInt64(i["Customer Phone"]).ToString("###-###-#### ####") Now its gets messed up when the extension is less than 4 digits. It will fill in the numbers from the right. so 1112224444 333 becomes 11-221-244 3334 Any ideas?

    Read the article

  • OracleDataAdapter returns no rows, but the query string works in SQLDeveloper

    - by belzebu
    visual studion 2008 oracle db 11.1.0.7 oracle client for .NET I have a relatively simple query, that selects the rows from across multiple tables (up to 4) using joins. OracleDataAdapter returns no rows for the only dataset's table, but if I copy and paste that query in SQLDeveloper then I get the desired results. I can get the data from other tables using the adapter with no problem, but it seems like it struggles with the bit longer selection query (string length is ~ 300 (not that much at all)) Connection string for the connection is 100% correct. Any ideas? thank you...

    Read the article

  • How return a std::string from C's "getcwd" function

    - by rubenvb
    Sorry to keep hammering on this, but I'm trying to learn :). Is this any good? And yes, I care about memory leaks. I can't find a decent way of preallocating the char*, because there simply seems to be no cross-platform way. const string getcwd() { char* a_cwd = getcwd(NULL,0); string s_cwd(a_cwd); free(a_cwd); return s_cwd; } UPDATE2: without Boost or Qt, the most common stuff can get long-winded (see accepted answer)

    Read the article

  • Efficient most common suffix algorithm?

    - by taw
    I have a few GBs worth of strings, and for every prefix I want to find 10 most common suffixes. Is there an efficient algorithm for that? An obvious solution would be: Store sorted list of <string, count> pairs. Identify by binary search extent for prefix we're searching. Find 10 highest counts in this extent. Possibly precompute it for all short prefixes, so it doesn't ever need to look at large portion of data. I'm not sure if that would actually be efficient at all. Is there a better way I overlooked? Answers must be real time, but it can take as much preprocessing as necessary.

    Read the article

  • Deleting entire lines in a text file based on a partial string match with Windows PowerShell

    - by Charles
    So I have several large text files I need to sort through, and remove all occurrences of lines which contain a given keyword. So basically, if I have these lines: This is not a test This is a test Maybe a test Definitely not a test And I run the script with 'not', I need to entirely delete lines 1 and 4. I've been trying with: PS C:\Users\Admin> (Get-Content "D:\Logs\co2.txt") | Foreach-Object {$_ -replace "3*Program*", ""} | Set-Content "D:\Logs\co2.txt" but it only replaces the 'Program' and not the entire line.

    Read the article

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