Daily Archives

Articles indexed Tuesday March 30 2010

Page 3/126 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Show one at a time?

    - by Nightmare_IntMain
    I have a script on my website that shows messsages from a mysql database. Now I want to make it so it only pops up one message at a time. Anyone wanna shed some light on this? Windows Vista PHP - Mysql - Ajax - JS

    Read the article

  • how to call the methos

    - by vicky
    for (i = 0; i < 4; i++) { DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'shohide()' })); document.body.appendChild(DeCheBX); DeImg = $('MyDiv').insert(new Element('img', { 'id': "Imgx" + obj[i].Nam, 'src': obj[i].IM })); document.body.appendChild(DeImg); } function shohide() { for (i = 0; i < 4; i++) { ($('Img' + obj[i].Nam).checked == true) { alert("press" + obj[i].Nam); } } }

    Read the article

  • VBA error handling and MZ-tools

    - by dmr
    Thanks to reading about error handling on StackOverflow, I discovered Mz-Tools. However, I am wondering if there is a way to simultaneously update all the error handlers added by MZ-Tools. If I add an error handler with MZ-Tools and then change the default error handler (via Options|Error Handler on the Mz-Tools toolbar), is there any way to have the changes automatically incorporated?

    Read the article

  • A detail question when applying genetic algorithm to traveling salesman

    - by burrough
    I read various stuff on this and understand the principle and concepts involved, however, none of paper mentions the details of how to calculate the fitness of a chromosome (which represents a route) involving adjacent cities (in the chromosome) that are not directly connected by an edge (in the graph). For example, given a chromosome 1|3|2|8|4|5|6|7, in which each gene represents the index of a city on the graph/map, how do we calculate its fitness (i.e. the total sum of distances traveled) if, say, there is no direct edge/link between city 2 and 8. Do we follow some sort of greedy algorithm to work out a route between 2 and 8, and add the distance of this route to the total? This problem seems pretty common when applying GA to TSP. Anyone who's done it before please share your experience. Thanks.

    Read the article

  • How do I get a list of child elements from XDocument object?

    - by Nick
    Hello.. I am trying to get all of the "video" elements and their attributes from an XML file that looks like this: <?xml version="1.0" encoding="utf-8" ?> <videos> <video title="video1" path="videos\video1.wma"/> <video title="video2" path="videos\video2.wma"/> <video title="video3" path="videos\video3.wma"/> </videos> The following will only select the root node and all of the children. I would like to get all of the 'video' elements into the IEnumerable. Can someone tell me what I'm doing wrong? IEnumerable<XElement> elements = from xml in _xdoc.Descendants("videos") select xml; The above returns a collection with a length == 1. It contains the root element and all the children.

    Read the article

  • Mindblowing jQuery Weirdness

    - by Jason
    ...at least to me. This code used to work fine. I'm pretty sure nothing has changed, but now all of the sudden it behaves oddly. Basically I'm trying to create inline editing functionality. When the user clicks on the link, it dynamically generates a textbox and a confirm and cancel link. I'm having problems with the cancel link not removing everything in the cell. HTML: ... <td class="bid"> <a href="javascript:" class="102093" title="Click to modify bid">$0.45</a> </td> ... Binding jQuery (in $(function())): $('.bid a').live('click', renderBidChange); .... $('.report_table .cancel').live('click', cancelUpdate); renderBidChange (this function creates the dynamic elements): function renderBidChange(){ var cpc = $(this); var value = cpc.text().replace('$', ''); var cell = cpc.parent('.bid'); cpc.hide(); var input = document.createElement('input'); $(input).attr({type:'text',class:'dynamic cpc-input'}).val(value); cell.append(input); var accept = document.createElement('a'); $(accept).addClass('accept').attr({'href':'javascript:', 'title':'Accept Changes'}).text('Accept Changes'); cell.append(accept); var cancel = document.createElement('a'); $(cancel).addClass('cancel').attr({'href':'javascript:', 'title':'Cancel Changes'}).text('Cancel Changes'); cell.append(cancel); $(input).focus(); input.select(); } cancelUpdate this function just removes everything visible (all the dynamic junk in this case) in the cell and shows what used to be there. function cancelUpdate(){ var cell = $(this).parent(); cell.find(':visible').remove(); cell.find(':hidden').show(); } However, for some reason, the cancel link remains after it is clicked! Everything else is removed except that. W T F Thanks for any insight you're able to provide! I'm sure it's just some stupid little detail I'm over[caffeinatedly]looking... UPDATE Immediately after posting this I epiphanied that it may be a CSS issue, but after double checking my code, it is not.

    Read the article

  • Python 3: receive user input including newline characters

    - by Beau Martínez
    I'm trying to read in the following text from the command-line in Python 3 (copied verbatim, newlines and all): lcbeika rraobmlo grmfina ontccep emrlin tseiboo edosrgd mkoeys eissaml knaiefr Using input, I can only read in the first word as once it reads the first newline it stops reading. Is there a way I could read in them all without iteratively calling input?

    Read the article

  • Books or resources for high-loaded sites.

    - by Alex
    Currently I'm developing high-loaded financial portal(we use LAMP to run our project). There are great number of incoming data to be processed and stored. So optimization tasks become very important for us. Could you suggest books, articles or resources, that discover optimization questions (especially bboks). NOTE: At the moment I'm reading great book High Performance MySQL, but besides I want to know other facilities of optimization.

    Read the article

  • a good book about software design

    - by Idan
    i'm looking for a book that talks about sofware decision like : when should i use thread pool and shouldn't. and in the first case, explains how. how should i acess my DB , how big my transactions should be how to read XML, to use DOM or SAX, what library to choose, and best ways to parse how to handle client-server app best efficient way and more stuff like that. is a book like that exist ? (preferably in c++ but not that important)

    Read the article

  • Javascript errors from Google Adsense

    - by Arjun
    Hey there, On several of my adsense running sites, I have been getting the following errors: Unable to post message to [http://]googleads.g.doubleclick.net. Recipient has origin http://www.anekdotz.com. Unsafe JavaScript attempt to access frame with URL [http://]www.anekdotz.com/ from frame with URL [http://]googleads.g.doubleclick.net/pagead/ads?client=ca-pub-9099580055602120&output=html&h=250&slotname=9210181593&w=300&flash=10.0.42&url=http%3A%2F%2Fwww.anekdotz.com%2F&dt=1269901036429&correlator=1269901036438&frm=0&ga_vid=711000587.1269901037&ga_sid=1269901037&ga_hid=654061172&ga_fc=0&u_tz=-240&u_his=2&u_java=1&u_h=900&u_w=1440&u_ah=878&u_aw=1436&u_cd=24&u_nplug=10&u_nmime=101&biw=1365&bih=806&eid=44901212&fu=0&ifi=1&dtd=153&xpc=Xkfk1oufPQ&p=http%3A//www.anekdotz.com. Domains, protocols and ports must match. (from the Chrome javascript console) The ads seem to show properly and it doesn't affect my native javascript code. However sometimes these errors seem to slow down page loading. How can I fix this problem? (I modified the URLs to let me post this as I'm a new user)

    Read the article

  • Access to content of Lotus Notes database without Lotus Notes software installed

    - by Fortilan
    I am looking for a programatic way to access content in a Lotus Notes database (.nsf file) without having Lotus Notes software installed. Python would be preferred but I'm also willing to look at other languages e.g. C/C++ or other means e.g. SQL From what I have read, all of the methods e.g. Python COM access, pyodbc rely on having Lotus Notes server software installed. The problem I am trying to solve is to read the content and look for references (URL's back to a web site that is undergoing maintenance and the addresses in the web site will change) As a start, I want to get a list of references and hope to be able to replace them with the new references to the modified web site. Any ideas on how best to do this welcome :)

    Read the article

  • LINQ: Single vs. SingleOrDefault

    - by Paulo Morgado
    Like all other LINQ API methods that extract a scalar value from a sequence, Single has a companion SingleOrDefault. The documentation of SingleOrDefault states that it returns a single, specific element of a sequence of values, or a default value if no such element is found, although, in my opinion, it should state that it returns a single, specific element of a sequence of values, or a default value if no such element is found. Nevertheless, what this method does is return the default value of the source type if the sequence is empty or, like Single, throws an exception if the sequence has more than one element. I received several comments to my last post saying that SingleOrDefault could be used to avoid an exception. Well, it only “solves” half of the “problem”. If the sequence has more than one element, an exception will be thrown anyway. In the end, it all comes down to semantics and intent. If it is expected that the sequence may have none or one element, than SingleOrDefault should be used. If it’s not expect that the sequence is empty and the sequence is empty, than it’s an exceptional situation and an exception should be thrown right there. And, in that case, why not use Single instead? In my opinion, when a failure occurs, it’s best to fail fast and early than slow and late. Other methods in the LINQ API that use the same companion pattern are: ElementAt/ElementAtOrDefault, First/FirstOrDefault and Last/LastOrDefault.

    Read the article

  • how does svn work with apache?

    - by ajsie
    i've got ubuntu installed with lamp. im using webdav to upload/download files to/from the ubuntu web server, after i have edited the php source files in netbeans. however, i wonder what is best practice for editing source files and committing these changes to the new website. cause if we are 2-3 developers, i guess we have to use svn. but i have never used it before so i wonder how it works. should i install it and then select the /var/www (apaches webroot) as the repository folder? then when i check in, all the changes will apply immediately? could someone please explain following steps: how to download, edit the source files, upload the files and see the new changes in the website. cause i have only worked with a local apache before, and it was only me. now there will be some more programmers so i have to set up a decent, central environment for this, and have to know how netbeans, svn, webdav and apache works all together. thanks!

    Read the article

  • Java book for programmer with intermediate experience

    - by Anthony Forloney
    I am well aware of this previous question here and have heard great things about those books. I actually bought two of them, Effective Java and Java in a Nutshell as an early Christmas present. I am looking for a good Java book, or books, to further continue my understanding of Java from a recent college graduate point of view. I have learned Java in college and would consider it to be the language I am most comfortable with. Can anyone recommend a good "intermediate" Java book for a situation like mine? This question should be community, I just don't know how to migrate it. I apologize for any inconvenience. Thank you in advance.

    Read the article

  • OpenGl glutIdleFunc(void (*func)(void))

    - by PHENOMERICAN
    I'm trying to design very simple animation in OpenGL such as rotating and translating objects. In the red book, I found that using GLUT's glutIdleFunc() is okay for a simple animation. How many times does glutIdleFunc(...) call the function in one second? Thank you.

    Read the article

  • How to refactor this Javascript anonymous function?

    - by HeavyWave
    We have this anonymous function in our code, which is part of the jQuery's Ajax object parameters and which uses some variables from the function it is called from. this.invoke = function(method, data, callback, error, bare) { $.ajax({ success: function(res) { if (!callback) return; var result = ""; if (res != null && res.length != 0) var result = JSON2.parse(res); if (bare) { callback(result); return; } for (var property in result) { callback(result[property]); break; } } }); } I have omitted the extra code, but you get the idea. The code works perfectly fine, but it leaks 4 Kbs on each call in IE, so I want to refactor it to turn the anonymous function into a named one, like this.onSuccess = function(res) { .. }. The problem is that this function uses variables from this.invoke(..), so I cannot just take it outside of its body. How do I correctly refactor this code, so that it does not use anonymous functions and parent function variables?

    Read the article

  • Publish Website

    - by coffeeaddict
    I've published my website many times. But didn't think about this though until I came across this issue. So I decided to publish my WAP project to a local folder on my C drive first. Then used FTP to upload it to my shared host on discountasp.net. I noticed during runtime that the stack trace was referencing that local folder still and erroring out. Anyone know what config settings are affected when publishing? Obviously something is still pointing to my local C drive and I've searched my entire solution and don't see why.

    Read the article

  • How to reshape matrices in Mathematica

    - by speciousfool
    When manipulating matrices it is often convenient to change their shape. For instance, to turn an N x M sized matrix into a vector of length N X M. In MATLAB a reshape function exists: RESHAPE(X,M,N) returns the M-by-N matrix whose elements are taken columnwise from X. An error results if X does not have M*N elements. In the case of converting between a matrix and vector I can use the Mathematica function Flatten which takes advantage of Mathematica's nested list representation for matrices. As a quick example, suppose I have a matrix X: With Flatten[X] I can get the vector {1,2,3,...,16}. But what would be far more useful is something akin to applying Matlab's reshape(X,2,8) which would result in the following Matrix: This would allow creation of arbitrary matrices as long as the dimensions equal N*M. As far as I can tell, there isn't anything built in which makes me wonder if someone hasn't coded up a Reshape function of their own.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >