Search Results

Search found 3423 results on 137 pages for 'tom daniel'.

Page 116/137 | < Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >

  • Applying jQuery attr value to new DOM elements (result of AJAX query)

    - by Daniel
    Hello everyone, I have a div on a page whose contents is replaced by an AJAX request when the user selects an option from a select list. When the page loads, I issue a command to disable the autocomplete feature for all of the pages text input elements: //Stop that pesky browser autocomplete $('input[type=text]').attr("autocomplete", "off"); However, when new elements appear in the div after an AJAX call, this line of code does not reference them because they were not part of the original DOM (when the page was loaded). I have tried appending the autocomplete line to the end of the post function: //AJAX Post request that changes the fields in the address div for each different country $("div#address select#country").live("change", function() { $.post("<?php print($_SERVER['PHP_SELF']); ?>", { country: $(this).val() }, function(data) { $('div#address').html(data); }, "text"); $('div#address input[type=text]').attr("autocomplete", "off"); }); But for some reason it does not work and the autocomplete pops up when text is entered into any of the address fields. As far as I am aware I cannot use .live() to select the input elements because changing an attribute is not classed as an event. So can anyone advise me how to modify the attributes of a newly created DOM element?

    Read the article

  • MySQL: How to do a conditional update?

    - by Tom
    Hi, I'm trying to a create an update statement along the following lines: TABLE car: id | owner_id | type | status An owner can have multiple cars. UPDATE car c SET c.type = 1 WHERE c.owner_id IN ($ids) AND c.status = [1 IF IT EXISTS, ELSE 0] $ids is reasonably small (under 50 values). It seems simple but I can't seem to get my head around it because I can't use a SELECT subquery with an UPDATE to the same table. Anyone? Thanks

    Read the article

  • What Are Collections Implemented As In VB6?

    - by Tom Tresansky
    So a collection in VB6 keeps track of a key for each object, and you can look up the object by its key. Does that mean collections are implemented as some sort of hashtable under the hood? I realize you can have multiple items with the same key in a collection, hence the SOME SORT. Anybody know what type data structure a VB6 collection is supposed to represent?

    Read the article

  • Recursion: using values passed in parameters

    - by Tom Lilletveit
    I got this line of code that pops a int of the array saves it to int element then removes it from array. then in the return statement return CountCriticalVotes(rest, blockIndex + element); it ads it to the blockIndex variable and if it reaches 10 before the array is empty it returns 1. But my problem is this, I do not want it to add up all the values in the array in the parameter, but only add one then revert the parameter value back to it´s original state, then add a new, revert etc... How would i do this? int NumCriticalVotes :: CountCriticalVotes(Vector<int> & blocks, int blockIndex) { if (blockIndex >= 10) { return 1; } if (blocks.isEmpty()) { return 0; } else { int element = blocks.get(0); Vector<int> rest = blocks; rest.remove(0); return CountCriticalVotes(rest, blockIndex + element);

    Read the article

  • Rewriting URL's in ASP.net (Simple question)

    - by Tom Gullen
    On my master page I have: <link rel="stylesheet" href="css/default.css" /> I also have a page "blog.aspx" in the root directory. I have the rule: <rewrite url="~/blog/blog.aspx" to="~/blog.aspx" /> My questions are: Am I meant to make all my links in my site point to blog/blog.aspx now instead of just blog.aspx where it is physically located How is best to cope with the paths of the stylesheets etc now being messed up because they are one dir up?

    Read the article

  • MySQL UPDATE WHERE IN for each listed value separately?

    - by Tom
    Hi, I've got the following type of SQL: UPDATE photo AS f LEFT JOIN car AS c ON f.car_id=c.car_id SET f.photo_status=1 , c.photo_count=c.photo_count+1 WHERE f.photo_id IN ($ids) Basically, two tables (car & photo) are related. The list in $ids contains unique photo ids, such as (34, 87, 98, 12). With the query, I'm setting the status of each photo in that list to "1" in the photo table and simultaneously incrementing the photo count in the car table for the car at hand. It works but there's one snag: Because the list can contain multiple photo ids that relate to the same car, the photo count only ever gets incremented once. If the list had 10 photos associated with the same car, photo_count would become 1 .... whereas I'd like to increment it to 10. Is there a way to make the incrementation occur for each photo individually through the join, as opposed to MySQL overthinking it for me? I hope the above makes sense. Thanks.

    Read the article

  • C# How can i remove newline characters from binary?

    - by Tom
    Basically i have binary data, i dont mind if it's unreadable but im writing it to a file which is parsed and so it's importance newline characters are taken out. I thought i had done the right thing when i converted to string.... byte[] b = (byte[])SubKey.GetValue(v[i]); s = System.Text.ASCIIEncoding.ASCII.GetString(b); and then removed the newlines String t = s.replace("\n","") but its not working ?

    Read the article

  • What is the most widely used IDE for PHP?

    - by Tom
    Note I am not asking for which is the "best" IDE for PHP or anything subjective like that. I want to know which is the most widely used backed by some sort of statistic (something like the W3's stats for browser usage) but for IDE usage amongst PHP developers.

    Read the article

  • Eclipse - limiting a command's visibility to a specific perspective

    - by Tom
    How do I limit the visibility of an Eclipse command in menus and the toolbar to just one perspective? It is currently showing up in all perspectives, but it only makes sense to have it around when working in this particular perspective. It seems like this could be done with "contexts", but I was wondering if there was something simpler.

    Read the article

  • C# log base 10 and rounding up to nearest power of 10?

    - by Tom
    Hi, if i have a number between 100 and 1000 i want to get the value 3 because 10^3 = 1000. Likewise, if i had a number between 10 and 100 i would want to get the value 2, because 10^2 is 100. Incase you're wondering, its to do with calculating a probability and i always need to divide through by 10^value, to keep the probability between 0 and 1. For example if i calculate 9256, i need to divide through by 10^4, so that i get a probability of 0.92 I'm not sure how to do the rounding up and how to do the base 10, could someone please help?

    Read the article

  • What data (if any) persists across web-requests in Ruby on Rails?

    - by Daniel Beardsley
    I decided to use the singleton design pattern while creating a view helper class. This got me thinking; will the singleton instance survive across requests? This led to another question, Which variables (if any) survive across web requests and does that change depending on deployment? (Fastcgi, Mongrel, Passenger, ...) I know that Controller instance variables aren't persisted. I know Constants are persisted (or reloaded?). But I don't know about class variables, instance variables on a class, Eigenclasses, ...

    Read the article

  • Google Analytics - Goal Funnel Steps

    - by Daniel
    Is there a way to test the url you're entering in a step, to see if Google Analytics will recognize it? What I'd like to do is provide some web page or some web service with a URL, and get a pass or fail. It passes if Google Analytics recognizes a page hit to the url. Let me give some context. We've been having issues with our goal funnel steps in Google Analytics. The instructions on adding steps say not to use the domain. e.g. DO NOT use : http://www.mysite.com/step1.html INSTEAD use: /step1.html Our custom CRM uses friendly urls and as a result GA is having a hard time picking up on them. So we've experimented with changing around url we've placed in the step, however we've got to wait a day to see if the new url we've provided is going to work! Hence why we're looking for something quicker.

    Read the article

  • Pulling .live() functionality out of jQuery

    - by Daniel
    I am writing a Firefox Add-On that currently is depending on jQuery for the following things: Selectors Animations A special .live("focus") hail-mary event-catching maneuver that happens to work with jQuery 1.4.2 (but not 1.4.4) jQuery isn't well suited for functioning inside XUL, and it's a miracle we've gotten this far with it. We're trying to remove the jQuery requirements, the first two are easy (animations are simple, and we can use .querySelector() instead of jQuery), but the .live has proven impossible to do on our own. I've tried reading the source code, but I haven't been able to piece it apart. What is the jQuery .live function doing? There's clearly a lot more going on than document.addEventListener("focus"/"focusin",function_to_pick_apart_events). What else is going on here?

    Read the article

  • How do i use Form.ShowDialog?

    - by Daniel Lip
    private void button2_Click(object sender, EventArgs e) { ChangeLink cl = new ChangeLink(); // Show testDialog as a modal dialog and determine if DialogResult = OK. if (cl.ShowDialog() == DialogResult.OK) { // Read the contents of testDialog's TextBox. // cl.AcceptButton.DialogResult = DialogResult.OK; this.label4.Text = cl.textBox1Text; } else { this.label4.Text = "Cancelled"; } cl.Dispose(); } When i click the button i see the new Form and the textBox1 in the new Form and i can type in the textBox1 something but i dont see anywhere an OK or CANCEL buttons. Should i add them manualy in the new Form designer ? And how to use them then ? This is the code in my new Form what i wanted to do is to type something in the new Form textBox1 and pass the text in the textBox1 to Form1 label4. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace GatherLinks { public partial class ChangeLink : Form { public ChangeLink() { InitializeComponent(); } public string textBox1Text { get { return textBox1Text = textBox1.Text; } set { } } } } So where are the OK and CANCEL buttons of the Form.ShowDialog ?

    Read the article

  • Canvas draw calls are rendering out of sequence

    - by Tom Murray
    I have the following code for writing draw calls to a "back buffer" canvas, then placing those in a main canvas using drawImage. This is for optimization purposes and to ensure all images get placed in sequence. Before placing the buffer canvas on top of the main one, I'm using fillRect to create a dark-blue background on the main canvas. However, the blue background is rendering after the sprites. This is unexpected, as I am making its fillRect call first. Here is my code: render: function() { this.buffer.clearRect(0,0,this.w,this.h); this.context.fillStyle = "#000044"; this.context.fillRect(0,0,this.w,this.h); for (var i in this.renderQueue) { for (var ii = 0; ii < this.renderQueue[i].length; ii++) { sprite = this.renderQueue[i][ii]; // Draw it! this.buffer.fillStyle = "green"; this.buffer.fillRect(sprite.x, sprite.y, sprite.w, sprite.h); } } this.context.drawImage(this.bufferCanvas,0,0); } This also happens when I use fillRect on the buffer canvas, instead of the main one. Changing the globalCompositeOperation between 'source-over' and 'destination-over' (for both contexts) does nothing to change this. Paradoxically, if I instead place the blue fillRect inside the nested for loops with the other draw calls, it works as expected... Thanks in advance!

    Read the article

  • How to make a remove frame script in JavaScript?

    - by Daniel
    I am making websites I refer to from my site load up in a frame (similar to google images). But I also want to give users the ability to break out of that frame. Like with google image's "Remove Frame" link at the bottom right corner of their frame. How can I do this possiblyusing Javascript?

    Read the article

  • Initializing an object to all zeroes

    - by dash-tom-bang
    Oftentimes data structures' valid initialization is to set all members to zero. Even when programming in C++, one may need to interface with an external API for which this is the case. Is there any practical difference between: some_struct s; memset(s, 0, sizeof(s)); and simply some_struct s = { 0 }; Do folks find themselves using both, with a method for choosing which is more appropriate for a given application? For myself, as mostly a C++ programmer who doesn't use memset much, I'm never certain of the function signature so I find the second example is just easier to use in addition to being less typing, more compact, and maybe even more obvious since it says "this object is initialized to zero" right in the declaration rather than waiting for the next line of code and seeing, "oh, this object is zero initialized." When creating classes and structs in C++ I tend to use initialization lists; I'm curious about folks thoughts on the two "C style" initializations above rather than a comparison against what is available in C++ since I suspect many of us interface with C libraries even if we code mostly in C++ ourselves.

    Read the article

  • Prev and next button

    - by daniel
    My website has previous and next buttons. When the page loads id like the previous button to be invisible.(on the first panel) After the user clicks the next button (to go to 2nd panel), id like the previous button to appear. Is there some javascript that will do this?

    Read the article

  • How do (or can I) hack a gem temporarily while looking for a bug?

    - by Tom Andersen
    I have a gem installed in my home directory on a laptop (eg not THE server). I have installed ruby 1.9.1 and also some other gems, notably right_aws - which allows access to s3, etc with ruby. All works, except there is a bug when I do a query on SimpleDB, and the returned list of items includes an item with any two byte utf-8 character in its itemName(). So I look through the sources of the right_aws gem installed on my machine, and I can see some places where I would like to test a fix. If I edit the file, save changes, (needing a password), then restart the server (script/server), it ignores my changes. I am quite new at ruby - do you have to 'compile' or other similar move to get the source code changes made take effect? I can see the edited file is changed by viewing it in terminal, etc.

    Read the article

  • jquery elements by class

    - by tom
    Hi there im trying to get all dropdown lists by class and change their names, my code is not working, is there something i am missing? $(document).ready(function () { $('.mutuallyexclusive').live("click", function () { checkedState = $(this).attr('checked'); $('.mutuallyexclusive:checked').each(function () { $(this).attr('checked', false); $(this).attr('name', 'chk'); }); $(this).attr('checked', checkedState); if (checkedState) { var prev = $(this).prev('select').attr("name", 'cat.parent_id'); elements = $('select.selected'); elements.each(function () { $(this).attr("name", "bbb"); }); } else { var prev = $(this).prev('select').attr("name", 'dd'); } }); });

    Read the article

< Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >