Search Results

Search found 88 results on 4 pages for 'beck'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Removing DOM event handlers in long-running browser session

    - by Chris Beck
    I have a browser interface with a ul#contacts list on the left and div#contact property panel (email, phone) on the right. Click a contact in the list and my app makes an XHR request to get the contact property HTML fragment and update div#contact.innerHTML. Each contact fragment has an "Edit Contact" link. With JS, I progressively upgrade that link with an event listener that performs an XHR request to replace the static property panel with an in-place edit form. This can happen many times during a single browser session. How should I clean up my "Edit Contact" event listener? Do I need to remove it manually before the form overwrites the property panel? Or is the event listener cleaned up automatically when the contents of div#contact (and the node that I'm listening on) is overwritten? FWIW, I still consider IE6 to be part of my target market.

    Read the article

  • Can't compile grails Tomcat plugin

    - by Jeff Beck
    I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files. Below is the error I'm getting I'm thinking it is some issue with my classpath but I just don't know where to start any help would be much appreciated. java.lang.NoClassDefFoundError: org/apache/catalina/startup/Tomcat$ExistingStandardWrapper

    Read the article

  • How to pass array via ExternalInterface.call in Actionscript 2.0

    - by Beck
    ExternalInterface.call("create_platform",var1,var2,var3...); I need: ExternalInterface.call("create_platform",mycars); Tried like that: mycars = new Array(); mycars["fast"] = "peugoet 306"; mycars["sporty"] = "citreon saxo"; mycars["old"] = "ford fiesta"; ExternalInterface.call("create_platform",mycars); Javascript shows empty array; Thanks.

    Read the article

  • How to output image via php from another domain

    - by Beck
    Image tag inside email message: <img src="http://www.mydomain.com/image.php?lastest=1"> Part of image.php script: case 'image/gif': header('Content-type: image/gif');$img=@imagecreatefromgif($image['src']);if($img) {imagegif($img);imagedestroy($img);} break; But how i can do the same with this image? http://www.anotherdomain.com/image.gif Thanks.

    Read the article

  • Progressive enhancement of anchor tags to avoid onclick="return false;"

    - by Chris Beck
    Unobtrusive JS suggests that we don't have any onclick attributes in our HTML templates. <a href="/controller/foo/1">View Foo 1</a> A most basic progressive enhancement is to convert an that anchor tag to use XHR to retrieve a DOM fragment. So, I write JS to add an event listener for a."click" then make an XHR to a.href. Alas, the browser still wants to navigate to "/controller/foo". So, I write JS to dynamically inject a.onclick = "return false;". Still unobtrusive (I guess), but now I'm paying the the cost of an extra event handler. To avoid the cost of 2 event listeners, I could shove my function call into the onclick attribute <a href="/controller/foo/1" onclick="myXHRFcn(); return false;"> But that's grodo for all sorts of reasons. To make it more interesting, I might have 100 anchor tags that I want to enhance. A better pattern is a single listener on a parent node that relies on event bubbling. That's cool, but how do I short circuit the browser from navigating to the URL without this on every anchor node? onclick="return false;" Manipulating the href is not an option. It must stay intact so the context menu options to copy or open in new page work as expected.

    Read the article

  • Calculating percent of votes inside mysql statement.

    - by Beck
    UPDATE polls_options SET `votes`=`votes`+1, `percent`=ROUND((`votes`+1) / (SELECT voters FROM polls WHERE poll_id=? LIMIT 1) * 100,1) WHERE option_id=? AND poll_id=? Don't have table data yet, to test it properly. :) And by the way, in what type % integers should be stored in database? Thanks for the help!

    Read the article

  • How to move iframe along the DOM without losing it's content?

    - by Beck
    Is it possible? I have tried to move it, but iframe contents dissapear. Tried to get contents of iframe and place them in the new place but all handlers ofc dissapear. Tried to do the same, but with new jQuery 1.4.2 feature, that clones all events along with it. But it doesn't work :) So I have decided to ask here for help. How to move the damn iframe to another place in the document without losing it's contents? ^_^ Thanks Added: txtad_iframe = ad_container.find('iframe'); its_contents = txtad_iframe.contents(); its_body = its_contents.find("div:first").clone(true).insertAfter(cthis.find('#photos')); new_ad.append(its_body); Here i'm trying to copy contents to new ad container. But it doesn't work. Context banner doesn't react on click event. I have tried to move ad_container to container, but iframe body content dissapears.

    Read the article

  • C++ string array from ifstream

    - by David Beck
    I have a program that I need to read in an array of strings from a file. The array must be C type strings (char * or char[]). Using the following code, I get a bad access error: for (i = 0; i < MAX_WORDS && !inputFile.eof(); i++) { inputFile >> words[i]; } words is declared as: char *words[MAX_WORDS];

    Read the article

  • Javascript looping only through defined properties of array. How?

    - by Beck
    For example if i'm keeping array of references via id like that: if(typeof channel_boards[misc.channel_id] == 'undefined') { channel_boards[misc.channel_id] = $('<div class="channel" channel_id="'+misc.channel_id+'"></div>').appendTo('#board'); } And then i'm looping through array to find required reference. I'm looping through undefined properties as well. Is it possible to loop only through defined properties? for(i=0;i<channel_boards.length;i++) { if(channel_boards[i] != undefined) { if(channel_boards[i].attr('channel_id') != visible) {channel_boards[i].addClass('hidden_board');} else {channel_boards[i].removeClass('hidden_board');} } } Maybe i should change the way i'm storing references? Via object for example, but how i'll be able to find proper reference via id number.

    Read the article

  • Is this SQL is valid?

    - by Beck
    UPDATE polls_options SET `votes`=`votes`+1, `percent`=ROUND((`votes`+1) / (SELECT voters FROM polls WHERE poll_id=? LIMIT 1) * 100,1) WHERE option_id=? AND poll_id=? Don't have table data yet, to test it properly. :) And by the way, in what type % integers should be stored in database? Thanks for the help!

    Read the article

  • Mysql question about UPDATE

    - by Beck
    UPDATE counter_reports SET `counter`=`counter`+1,`date`=? WHERE report_id IN( (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `year`=1 ORDER BY report_id DESC LIMIT 1), (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `month`=1 ORDER BY report_id DESC LIMIT 1), (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `week`=1 ORDER BY report_id DESC LIMIT 1), (SELECT report_id FROM counter_reports WHERE report_name="emails_sent" AND `day`=1 ORDER BY report_id DESC LIMIT 1) ) Is there any alternative for such sql? I need to update(increment by 1) last counter reports for day,week,month and year. If I'm adding manually, sql works fine, but with subqueries it fails to launch. Thanks. :)

    Read the article

  • Grails views for subclasses

    - by Jeff Beck
    I have a domain object called page that only has a title, I then have subclasses what are StaticPage that also has a textblock and PicturePage that contains a url. I have a site object that has many pages, I am looking for a way in the view for the site to call the a different template for each subclass. I can easily iterate through the pages but I would like to call each subclasses own view.

    Read the article

  • Python read files in directory and concatenate

    - by JJ Beck
    I want to write a Python script that searches all folders in the current directory, looks for all .txt files, and creates a file that is a concatenation of all those files (in any order) in the current directory. If folders have subfolders, it should not search those subfolders. An example is main_folder folder_1 sub_folder file1.txt file2.txt folder_2 file3.txt The script is placed inside main_folder. It should create a file that is a concatenation of file2.txt and file3.txt (in any order) inside main_folder. My question is: How can I tell Python to traverse through the folders, look for .txt files, without going into the subfolders?

    Read the article

  • BDD IS Different to TDD

    - by Liam McLennan
    One of this morning’s sessions at Alt.NET 2010 discussed BDD. Charlie Pool expressed the opinion, which I have heard many times, that BDD is just a description of TDD done properly. For me, the core principles of BDD are: expressing behaviour in terms that show the value to the system actors Expressing behaviours / scenarios in a format that clearly separates the context, the action and the observations. If we go back to Kent Beck’s TDD book neither of these elements are mentioned as being core to TDD. BDD is an evolution of TDD. It is a specialisation of TDD, but it is not the same as TDD. Discussing BDD, and building specialised tools for BDD, is valuable even though the difference between BDD and TDD is subtle. Further, the existence of BDD does not mean that TDD is obsolete or invalidated.

    Read the article

  • Who are the thought leaders in software engineering/development? [closed]

    - by Mohsin Hijazee
    Possible Duplicate: What are the big contemporary names in the programming field? I am sorry if it is a duplicate questions or is useless. I want to compile a list of influential people in our industry who can be termed as "opinionated" and thought leaders. There are basically two characteristics that I'm referring to here: The person has introduced new concepts/terminology/trends or talked about existing ones in thought provoking way. Majority or part of the writings are available online. Some of the people who I think as thought leaders are as under: Martin Fowler Known for domain specific languages, Active Record, IoC. Joel Spolsky known for his 12 point Joel test, Law of Leaky abstractions. Kent Beck known for XP. Paul Graham. Any other names and links?

    Read the article

  • How do I unit test the methods in a method object?

    - by Sancho
    I've performed the "Replace Method with Method Object" refactoring described by Beck. Now, I have a class with a "run()" method and a bunch of member functions that decompose the computation into smaller units. How do I test those member functions? My first idea is that my unit tests be basically copies of the "run()" method (with different initializations), but with assertions between each call to the member functions to check the state of the computation. (I'm using Python and the unittest module.)

    Read the article

  • Listing common SQL Code Smells.

    - by Phil Factor
    Once you’ve done a number of SQL Code-reviews, you’ll know those signs in the code that all might not be well. These ’Code Smells’ are coding styles that don’t directly cause a bug, but are indicators that all is not well with the code. . Kent Beck and Massimo Arnoldi seem to have coined the phrase in the "OnceAndOnlyOnce" page of www.C2.com, where Kent also said that code "wants to be simple". Bad Smells in Code was an essay by Kent Beck and Martin Fowler, published as Chapter 3 of the book ‘Refactoring: Improving the Design of Existing Code’ (ISBN 978-0201485677) Although there are generic code-smells, SQL has its own particular coding habits that will alert the programmer to the need to re-factor what has been written. See Exploring Smelly Code   and Code Deodorants for Code Smells by Nick Harrison for a grounding in Code Smells in C# I’ve always been tempted by the idea of automating a preliminary code-review for SQL. It would be so useful to trawl through code and pick up the various problems, much like the classic ‘Lint’ did for C, and how the Code Metrics plug-in for .NET Reflector by Jonathan 'Peli' de Halleux is used for finding Code Smells in .NET code. The problem is that few of the standard procedural code smells are relevant to SQL, and we need an agreed list of code smells. Merrilll Aldrich made a grand start last year in his blog Top 10 T-SQL Code Smells.However, I'd like to make a start by discovering if there is a general opinion amongst Database developers what the most important SQL Smells are. One can be a bit defensive about code smells. I will cheerfully write very long stored procedures, even though they are frowned on. I’ll use dynamic SQL occasionally. You can only use them as an aid for your own judgment and it is fine to ‘sign them off’ as being appropriate in particular circumstances. Also, whole classes of ‘code smells’ may be irrelevant for a particular database. The use of proprietary SQL, for example, is only a ‘code smell’ if there is a chance that the database will have to be ported to another RDBMS. The use of dynamic SQL is a risk only with certain security models. As the saying goes,  a CodeSmell is a hint of possible bad practice to a pragmatist, but a sure sign of bad practice to a purist. Plamen Ratchev’s wonderful article Ten Common SQL Programming Mistakes lists some of these ‘code smells’ along with out-and-out mistakes, but there are more. The use of nested transactions, for example, isn’t entirely incorrect, even though the database engine ignores all but the outermost: but it does flag up the possibility that the programmer thinks that nested transactions are supported. If anything requires some sort of general agreement, the definition of code smells is one. I’m therefore going to make this Blog ‘dynamic, in that, if anyone twitters a suggestion with a #SQLCodeSmells tag (or sends me a twitter) I’ll update the list here. If you add a comment to the blog with a suggestion of what should be added or removed, I’ll do my best to oblige. In other words, I’ll try to keep this blog up to date. The name against each 'smell' is the name of the person who Twittered me, commented about or who has written about the 'smell'. it does not imply that they were the first ever to think of the smell! Use of deprecated syntax such as *= (Dave Howard) Denormalisation that requires the shredding of the contents of columns. (Merrill Aldrich) Contrived interfaces Use of deprecated datatypes such as TEXT/NTEXT (Dave Howard) Datatype mis-matches in predicates that rely on implicit conversion.(Plamen Ratchev) Using Correlated subqueries instead of a join   (Dave_Levy/ Plamen Ratchev) The use of Hints in queries, especially NOLOCK (Dave Howard /Mike Reigler) Few or No comments. Use of functions in a WHERE clause. (Anil Das) Overuse of scalar UDFs (Dave Howard, Plamen Ratchev) Excessive ‘overloading’ of routines. The use of Exec xp_cmdShell (Merrill Aldrich) Excessive use of brackets. (Dave Levy) Lack of the use of a semicolon to terminate statements Use of non-SARGable functions on indexed columns in predicates (Plamen Ratchev) Duplicated code, or strikingly similar code. Misuse of SELECT * (Plamen Ratchev) Overuse of Cursors (Everyone. Special mention to Dave Levy & Adrian Hills) Overuse of CLR routines when not necessary (Sam Stange) Same column name in different tables with different datatypes. (Ian Stirk) Use of ‘broken’ functions such as ‘ISNUMERIC’ without additional checks. Excessive use of the WHILE loop (Merrill Aldrich) INSERT ... EXEC (Merrill Aldrich) The use of stored procedures where a view is sufficient (Merrill Aldrich) Not using two-part object names (Merrill Aldrich) Using INSERT INTO without specifying the columns and their order (Merrill Aldrich) Full outer joins even when they are not needed. (Plamen Ratchev) Huge stored procedures (hundreds/thousands of lines). Stored procedures that can produce different columns, or order of columns in their results, depending on the inputs. Code that is never used. Complex and nested conditionals WHILE (not done) loops without an error exit. Variable name same as the Datatype Vague identifiers. Storing complex data  or list in a character map, bitmap or XML field User procedures with sp_ prefix (Aaron Bertrand)Views that reference views that reference views that reference views (Aaron Bertrand) Inappropriate use of sql_variant (Neil Hambly) Errors with identity scope using SCOPE_IDENTITY @@IDENTITY or IDENT_CURRENT (Neil Hambly, Aaron Bertrand) Schemas that involve multiple dated copies of the same table instead of partitions (Matt Whitfield-Atlantis UK) Scalar UDFs that do data lookups (poor man's join) (Matt Whitfield-Atlantis UK) Code that allows SQL Injection (Mladen Prajdic) Tables without clustered indexes (Matt Whitfield-Atlantis UK) Use of "SELECT DISTINCT" to mask a join problem (Nick Harrison) Multiple stored procedures with nearly identical implementation. (Nick Harrison) Excessive column aliasing may point to a problem or it could be a mapping implementation. (Nick Harrison) Joining "too many" tables in a query. (Nick Harrison) Stored procedure returning more than one record set. (Nick Harrison) A NOT LIKE condition (Nick Harrison) excessive "OR" conditions. (Nick Harrison) User procedures with sp_ prefix (Aaron Bertrand) Views that reference views that reference views that reference views (Aaron Bertrand) sp_OACreate or anything related to it (Bill Fellows) Prefixing names with tbl_, vw_, fn_, and usp_ ('tibbling') (Jeremiah Peschka) Aliases that go a,b,c,d,e... (Dave Levy/Diane McNurlan) Overweight Queries (e.g. 4 inner joins, 8 left joins, 4 derived tables, 10 subqueries, 8 clustered GUIDs, 2 UDFs, 6 case statements = 1 query) (Robert L Davis) Order by 3,2 (Dave Levy) MultiStatement Table functions which are then filtered 'Sel * from Udf() where Udf.Col = Something' (Dave Ballantyne) running a SQL 2008 system in SQL 2000 compatibility mode(John Stafford)

    Read the article

  • Recovering mail from hardrive (broken os).

    - by Maciek Sawicki
    Hi, Friend of mine broke his Windows (doesn't boot). I will probably have to reinstall OS. I want to mount his hard drive in my OS to beck up some important files. He sad he uses Outlook express, but he Use Vista so I'm not sure it's Vistas Mail Client or Outlook. What files I have to copy to backup mail and adders book from Outlook, Outlook Express and Windows Mail? Is it any good program for doing it automatically (for Linux or Windows)? If there are tools or special procedures for other mail clients (for example Thunderbird) you can also name them to make this question more generic.

    Read the article

  • TDD - beginner problems and stumbling blocks

    - by Noufal Ibrahim
    While I've written unit tests for most of the code I've done, I only recently got my hands on a copy of TDD by example by Kent Beck. I have always regretted certain design decisions I made since they prevented the application from being 'testable'. I read through the book and while some of it looks alien, I felt that I could manage it and decided to try it out on my current project which is basically a client/server system where the two pieces communicate via. USB. One on the gadget and the other on the host. The application is in Python. I started off and very soon got entangled in a mess of rewrites and tiny tests which I later figured didn't really test anything. I threw away most of them and and now have a working application for which the tests have all coagulated into just 2. Based on my experiences, I have a few questions which I'd like to ask. I gained some information from http://stackoverflow.com/questions/1146218/new-to-tdd-are-there-sample-applications-with-tests-to-show-how-to-do-tdd but have some specific questions which I'd like answers to/discussion on. Kent Beck uses a list which he adds to and strikes out from to guide the development process. How do you make such a list? I initially had a few items like "server should start up", "server should abort if channel is not available" etc. but they got mixed and finally now, it's just something like "client should be able to connect to server" (which subsumed server startup etc.). How do you handle rewrites? I initially selected a half duplex system based on named pipes so that I could develop the application logic on my own machine and then later add the USB communication part. It them moved to become a socket based thing and then moved from using raw sockets to using the Python SocketServer module. Each time things changed, I found that I had to rewrite considerable parts of the tests which was annoying. I'd figured that the tests would be a somewhat invariable guide during my development. They just felt like more code to handle. I needed a client and a server to communicate through the channel to test either side. I could mock one of the sides to test the other but then the whole channel wouldn't be tested and I worry that I'd miss that. This detracted from the whole red/green/refactor rhythm. Is this just lack of experience or am I doing something wrong? The "Fake it till you make it" left me with a lot of messy code that I later spent a lot of time to refactor and clean up. Is this the way things work? At the end of the session, I now have my client and server running with around 3 or 4 unit tests. It took me around a week to do it. I think I could have done it in a day if I were using the unit tests after code way. I fail to see the gain. I'm looking for comments and advice from people who have implemented large non trivial projects completely (or almost completely) using this methodology. It makes sense to me to follow the way after I have something already running and want to add a new feature but doing it from scratch seems to tiresome and not worth the effort. P.S. : Please let me know if this should be community wiki and I'll mark it like that. Update 0 : All the answers were equally helpful. I picked the one I did because it resonated with my experiences the most. Update 1: Practice Practice Practice!

    Read the article

  • Mac OS 10.7 DMG files don't pop up anymore?

    - by Sosukodo
    Has anybody noticed that double-clicking on a DMG file no longer raises the mounted image to the front of all windows? It used to be that when you double-clicked a dmg file, it would pop-up but now you have to click Finder and click on the mounted image. Is this a bug, by design or a setting that I can change? Update: As per Daniel Beck's suggestion, I created a new account and downloaded the most recent version of Firefox via Safari. It still exhibited the same behavior. However, I noticed that if I double-click thew DMG from within the Downloads folder in Finder, it does pop up. But when I double-click the DMG within Safari (and Firefox also) it does not pop up over all other windows.

    Read the article

< Previous Page | 1 2 3 4  | Next Page >