Search Results

Search found 483 results on 20 pages for 'appending'.

Page 11/20 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • asp.net regex to find anchor tags and replace their url

    - by ace
    Hi -i'm trying to find all the anchor tags and appending the href value with a variable. for example <a href="/page.aspx">link</a> will become <a href="/page.aspx?id=2"> <A hRef='http://www.google.com'><img src='pic.jpg'></a> will become <A hRef='http://www.google.com?id=2'><img src='pic.jpg'></a> I'm able to match all the anchor tags and href values using regex, then i manually replace the values using string.replace, however i dont think its the efficient way to do this. Is there a solution where i can use something like regex.replace(html,newurlvalue)

    Read the article

  • XML jQuery Problem

    - by Llamabomber
    This code for parsing my xml and appending via jquery seems to work great in every browser but Chrome (Mac only, the windows version of chrome works fine) and explorer. I'm not aware of any glaring issues in the code so I thought some fresh eyes might help. Anyone know what could be causing IE and Chrome on the mac to not append? <script type="text/javascript" charset="utf-8"> $(document).ready(function() { $.ajax({ type: "GET", url: "sitenav.xml", dataType: "xml", success: parseXml }); function parseXml(xml) { $(xml).find("GoogleAnalytics").each(function() { $("li#google_analytics").append('<ul><li>' + $(this).find("NavHeader").text() + '</li></ul>'); }); } }); </script>

    Read the article

  • Maven downloads have .lastUpdated as extension

    - by user303158
    I am a beginner to Eclipse and maven. I have an Eclipse setup with m2eclipse and subversive. I have imported a maven2 project from svn. But I get the error message that a whole bunch of artifacts are missing (for instance: Missing artifact org.springframework:spring-test:jar:3.0.1.RELEASE:test). If I look in my repository I see the jar files there but they have an extra extension .lastUpdated. Why is maven appending .lastUpdated to the jars? And more importantly: how can I fix this? Btw there is no mention of the type lastUpdated in my POMs.

    Read the article

  • Add entry to list and remove first one in Python

    - by wagglewax
    I have a list of about 40 entries. And I frequently want to append an item to the start of the list (with id 0) and want to delete the last entry (with id 40) of the list. how do i do this the best? like: (example with 5 entries) [0] = "herp" [1] = "derp" [2] = "blah" [3] = "what" [4] = "da..." after adding "wuggah" and deleting last it should be like: [0] = "wuggah" [1] = "herp" [2] = "derp" [3] = "blah" [4] = "what" or appending one and deleting first. And I don't want to end up manually moving them one after another all of the entries to the next id.

    Read the article

  • jquery iterating through newly created elements

    - by jaeyun
    Hi All, I am trying to add new rows in my table, and save them into DB. First, I use .append() to append rows on the table: $("#tablename").append("<tr id='newRow'><td>newly added row</td></tr>"); The appending function works fine. My page displays the correct result. However, I am unable to select them with $("#newRow").each(function () { alert "it never reaches here!"; }); I am guessing it is because the elements are added after the DOM is loaded. Can anyone please tell me how I can iterate through all my newly added elements? Thank you.

    Read the article

  • Can PHP Perform Magic Instantiation?

    - by Aiden Bell
    Despite PHP being a pretty poor language and ad-hoc set of libraries ... of which the mix of functions and objects, random argument orders and generally ill-thought out semantics mean constant WTF moments.... ... I will admit, it is quite fun to program in and is fairly ubiquitous. (waiting for Server-side JavaScript to flesh out though) question: Given a class class RandomName extends CommonAppBase {} is there any way to automatically create an instance of any class extending CommonAppBase without explicitly using new? As a rule there will only be one class definition per PHP file. And appending new RandomName() to the end of all files is something I would like to eliminate. The extending class has no constructor; only CommonAppBase's constructor is called. Strange question, but would be nice if anyone knows a solution. Thanks in advance, Aiden (btw, my PHP version is 5.3.2) Please state version restrictions with any answer.

    Read the article

  • Using recustion an append in prolog

    - by Adrian
    Lets say that I would like to construct a list (L2) by appending elements of another list (L) one by one. The result should be exactly the same as the input. This task is silly, but it'll help me understand how to recurse through a list and remove certain elements. I have put together the following code: create(L, L2) :- (\+ (L == []) -> L=[H|T], append([H], create(T, L2), L2);[]). calling it by create([1,2,3,4], L2) returns L2 = [1|create([2,3,4], **)\. which is not a desired result.

    Read the article

  • C++: concatenate ints in an array?

    - by Nate
    As part of a homework assignment I need to concatenate certain values in an array in C++. So, for example if I have: int v[] = {0,1,2,3,4} I may need at some point to concatenate v[1] - v[4] so that I get an int with the value 1234. I got it working using stringstream, by appending the values onto the stringstream and then converting back to an integer. However, throughout the program there will eventually be about 3 million different permutations of v[] passed to my toInt() function, and the stringstream seems rather expensive (at least when dealing with that many values). it's working, but very slow and I'm trying to do whatever I can to optimize it. Is there a more optimal way to concatenate ints in an array in C++? I've done some searching and nearly everywhere seems to just suggest using stringstream (which works, but seems to be slowing my program down a lot). EDIT: Just clarifying, I do need the result to be an int.

    Read the article

  • How to use backreferences in PHP

    - by Slinky
    I want to add a character to the end of each file extension found in a body of text using preg_replace(). Here is some sample text: $string='http://www.mysite.com/expert/images/imageone.jpghttp://www.mysite.com/expert/images/imagetwo.jpg'; This search & replace works fine in TextWrangler, appending a semi colon to file extensions: (\.(jpg|gif|html?|php|tiff?|pdf|png)) \1; Translated to PHP, however does not work, having no effect; no errors. preg_replace("/(\.(jpg|gif|html|php|tif|tiff|pdf|htm|png))/","\\1;",$string);

    Read the article

  • Embarrassingly parallel workflow creates too many output files

    - by Hooked
    On a Linux cluster I run many (N > 10^6) independent computations. Each computation takes only a few minutes and the output is a handful of lines. When N was small I was able to store each result in a separate file to be parsed later. With large N however, I find that I am wasting storage space (for the file creation) and simple commands like ls require extra care due to internal limits of bash: -bash: /bin/ls: Argument list too long. Each computation is required to run through a qsub scheduling algorithm so I am unable to create a master program which simply aggregates the output data to a single file. The simple solution of appending to a single fails when two programs finish at the same time and interleave their output. I have no admin access to the cluster, so installing a system-wide database is not an option. How can I collate the output data from embarrassingly parallel computation before it gets unmanageable?

    Read the article

  • jquery: how to append elements to emtpy object

    - by John
    I want to create a set of options, that will be appended to every select in grid column <option> option 1 </option> <option> option 2 </option> ... <option> option N </option> but I don't know how to create a set of elements without parent element. appending to an empty jquery object doesn't work var options = $(''); options.append('<option></option>')

    Read the article

  • oracle sql developer is truncating my results

    - by nont
    I'm calling a stored function like this: select XML_INVOICE.GENERATE_XML_DOC('84200006823') from dual; The query results then show up in a table underneath, which I can right click and select "Export Date" - XML <?xml version='1.0' encoding='UTF8' ?> <RESULTS> <ROW> <COLUMN NAME="XML_INVOICE.GENERATE_XML_DOC('84200006823')" <![CDATA[<xml>yada yada</xml><morexml>...]]></COLUMN> </ROW> </RESULTS> The problem is the "..." - SQL Developer (2.1.0.63 on Linux) is not showing all the data - its truncating the result and appending the ellipsis. This is of no use to me. How do I get it to export ALL of my data?

    Read the article

  • Ruby string encoding problem

    - by John Prideaux
    I've looked at the other ruby/encoding related posts but haven't been able to figure out why the following is not working. Likely just because I'm dense, but here's the situation. Using Ruby 1.9 on windows. I have a set of CSV files that need some data appended to the end of each line. Whenever I run my script, the appended characters are gibberish. The input text appears to be IBM437 encoding, whereas my string I'm appending starts as US-ASCII. Nothing I've tried with respect to forcing encoding on the input strings or the append string seems to change the resultant output. I'm stumped. The current encoding version is simply the last that I tried. def append_salesperson(txt, salesperson) if txt.length > 2 return txt.chomp.force_encoding('US-ASCII') + %(, "", "", "#{salesperson}") end end salespeople = Hash[ "fname", "Record Manager"] outfile = File.open("ActData.csv", "w:US-ASCII") salespeople.each do | filename, recordManager | infile = File.open("#{filename}.txt") infile.each do |line| outfile.puts append_salesperson(line, recordManager) end infile.close end outfile.close

    Read the article

  • How do I load content with ujs, jquery and rails?

    - by Joseph Silvashy
    I'm trying to figure out the best way to insert content into a light box using rails UJS. I have a link that looks like this: <%= link_to "login", login_path, :remote => true %> Which produces html as such: <a data-remote="true" href="/login">login</a> So this all works great, and I've created the view file: user_sessions/new.js.erb which also loads just fine, but my question what is the preferred method of inserting appending the html into the page? Like I already have the login form on the non-js page, so can't I just load that partial into the page? Any ideas would be very welcomed.

    Read the article

  • Deploy java (command line) app using Netbeans / ant

    - by Haes
    I've finally managed to create a Netbeans project out of an old standalone (not Web-) Java application which consisted only out of single .java sources. Now I have basically two questions regarding Netbeans Subversion interaction and application deployment: Do you check in all the Netbeans project files into the repository, normally? If I build the project using Netbeans (or ant) I get a .jar file and some additional jar libraries. In order for the app to run properly on the server, some additional config files and directories (log/ for example) are needed. The application itself is a J2SE application (no frameworks) which runs from the command line on a Linux platform. How would you deploy and install such an application? It would also be nice if I could see what version of app is currently installed (maybe by appending the version number to the installed app path). Thanks for any tips.

    Read the article

  • hyperlink in firefox to windows share

    - by Eds
    I am having trouble creating a hyperlink to a windows share, that works correctly in firefox and IE9. The original line was this: <a href="\\10.1.3.33\sharename\filename.txt" target="_new">Link</a> This works correctly in IE9, andopens the file as you would expect. However, this does not seem to work in firefox, as it just appends the above to the root directory, so it ends up looking in: /\10.1.3.33/sharename/filename I have tried as someone suggested and appending file:// to the pathname, but this does not seem to load anything in firefox, but does work in IE. Can anyone advise on what I should be using the get a link to a network share working in all browsers? Many thanks, Eds

    Read the article

  • Why does this VBS scheduled task (to call a URL) not work in Windows Server 2008?

    - by user303644
    This same script worked in older server OS environments, and even on my desktop; and allows me to kick off a nightly process on my website's URL. It simply will not execute the URL in my Windows Server 2008 environment. It does not generate any errors, claiming task completion I can pull the same URL up just fine in the server's web browser I have the script running with "highest privileges" I even tried to create a batch file which executes it, so I can explicitly "Run as Administrator" and it still will not execute the URL (but will not generate any errors either). I'm baffled as to why the task claims to have completed successfully, yet the script never reaches the URL. Call LogEntry() Sub LogEntry() 'Force the script to finish on an error. On Error Resume Next 'Declare variables Dim objRequest Dim URL Set objRequest = CreateObject("MSXML2.ServerXMLHTTP") 'Put together the URL link appending the Variables. URL = "http://myURL/AutorunNightlyTasks.aspx" 'Open the HTTP request and pass the URL to the objRequest object objRequest.open "GET", URL, False 'Send the HTML Request objRequest.send() 'Set the object to nothing Set objRequest = Nothing End Sub

    Read the article

  • MySQL: Efficient Blobbing?

    - by feklee
    I'm dealing with blobs of up to - I estimate - about 100 kilo bytes in size. The data is compressed already. Storage engine: InnoDB on MySQL 5.1 Frontend: PHP (Symfony with Propel ORM) Some questions: I've read somewhere that it's not good to update blobs, because it leads to reallocation, fragmentation, and thus bad performance. Is that true? Any reference on this? Initially the blobs get constructed by appending data chunks. Each chunk is up to 16 kilo bytes in size. Is it more efficient to use a separate chunk table instead, for example with fields as below? parent_id, position, chunk Then, to get the entire blob, one would do something like: SELECT GROUP_CONCAT(chunk ORDER BY position) FROM chunks WHERE parent_id = 187 The result would be used in a PHP script. Is there any difference between the types of blobs, aside from the size needed for meta data, which should be negligible.

    Read the article

  • How to bind the arguments in NSString in iphone?

    - by Prash.......
    Hi, i developing an application in which i want to bind my own parameter with an URL for http post request. But i findout the serious problem during the string binding, The code snippet as follows: NSString *mainURL1 = @"http://xxx.xxx.xx.xx/webservice/Service.asmx?op=UserDetailsNew?"; NSString *mainURL2 = [mainURL1 stringByAppendingString:@"MobileNo=%@",txtMobile.text]; NSString *mainURL3 = [mainURL2 stringByAppendingString:@"&Country=%@",txtCountry.text]; NSString *mainURL4 = [mainURL3 stringByAppendingString:@"&UserName=%@",txtName.text]; NSString *mainURL5 = [mainURL4 stringByAppendingString:@"&ScreenName=%@",txtScreenname.text]; NSString *mainURL6 = [mainURL5 stringByAppendingString:@"&EmailId=%@",txtemailid.text]; NSString *mainURL7 = [mainURL6 stringByAppendingString:@"&Password=%@",txtpassword.text]; NSString *mainURL8 = [mainURL7 stringByAppendingString:@"&RetypePassword=%@",txtretypepassword.text]; NSString *mainURL9 = [mainURL8 stringByAppendingString:@"%20HTTP/1.1"]; on binding the runtime arguments it ginev me too many parameter appending in NSString function. how i solve above problem?

    Read the article

  • How is fseek() implemented in the filesystem?

    - by pajton
    This is not a pure programming question, however it impacts the performance of programs using fseek(), hence it is important to know how it works. A little disclaimer so that it doesn't get closed. I am wondering how efficient it is to insert data in the middle of the file. Supposing I have a file with 1MB data and then I insert something at the 512KB offset. How efficient would that be compared to appending my data at the end of the file? Just to make the example complete lets say I want to insert 16KB of data. I understand the answer varies depending on the filesystem, however I assume that the techniques used in common filesystems are quite similar and I just want to get the right notion of it.

    Read the article

  • TextBox loses text when InvokeRequired == false

    - by Tom
    This is modified code I found on this site. When appending text to a TextBox and InvoveRequired is false the text will display in the box but the next time the function is called and InvokeRequired is true the text string placed by the first call is lost (""). Multiple calls when InvokeRequired is true work as expected. comBox is a type TextBox with multline = true. Any help would be appreciated. public void LogComText(string comText, bool newline) { if (comBox.InvokeRequired) { comBox.BeginInvoke(new Action(delegate { LogComText(comText, newline); })); return; } comBox.AppendText(comText); if (newline) comBox.AppendText(Environment.NewLine); }

    Read the article

  • XML Parsing Error: no element found

    - by Anilkumar
    XML Parsing Error: no element found Line Number 1, Column 1: I want to download a Excel file. I wrote the data in a html table format and appending to the response. The code is following : Response.Buffer = false; Response.Expires = 0; Response.Clear(); Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName); Response.Write(str); Response.End();

    Read the article

  • AJAX form sections - how to pass url of next stage of form

    - by dan727
    Hi, I've got a multi-part form (in a PHP MVC setup) which I have working correctly without javascript enhancement. I'm starting to add the AJAX form handling code which will handle each stage of a form submission, validating/saving data etc, before using AJAX to load the next stage of the form. I'm wondering how best to pass the URL of the next stage to the current form being processed, so that my jQuery form handling code can process the current form, then load the next part via AJAX. The form "action" is different from what the url of the next stage of the form is - what do you think would be good practice here? I was thinking about either appending the url of the next stage to the form action url, via a query string - then just use javascript to extract this url when the form is successfully processed. The other option is via a hidden form element. Not sure what other client side options I have here Any thoughts?

    Read the article

  • How do I automatically delete an Excel file after creating it on a server and returning it to the us

    - by David A Gibson
    Hello, I am creating an Excel file on a web server, using OleDb to connect the the physical (well as physical as it can be) file and appending records. I am then returning a FilePathResult to the user via MVC, and would like to delete the physical file afterwards due to data protection concerns over the appended records. I have tried using a File.Delete in a Finally clause but I get a File Not Found error which must mean the file has gone when MVC is trying to send the file to the user. I thought about creating the File as a MemoryStream but I think OleDb needs a physical file to connect to so this isn't an option. Any suggestions on how to delete the file after returning it in one operation? Thanks

    Read the article

  • Getting a random element in Django

    - by Sarah
    I just finished the Django tutorial and started work on my own project, however, I seem to have missed something completely. I wanted to get a random slogan from this model: from django.db import models class Slogan(models.Model): slogan = models.CharField(max_length=200) And return it in this view: from django.http import HttpResponse from swarm.sloganrotator.models import Slogan def index(request): return HttpResponse(Slogan.objects.order_by('?')[:1]) However, the view just returns 'Slogan object'. Then I thought, maybe I can access the slogan string itself by simply appending .slogan to the slice, but that gives me an error indicating that the object I have is actually a QuerySet and has no attribute slogan. I've obviously misunderstood something about Django here, but it just doesn't fall into place for me. Any help?

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >