Search Results

Search found 300 results on 12 pages for 'ted simpson'.

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

  • jquery loop to create elements with retained values

    - by Andy Simpson
    Dear all, I recently asked a question about creating elements with jquery. Specifically I needed input boxes created/deleted depending on the value of a particular select box. This was answered quickly with a very nice solution as follows: $('select').change(function() { var num = parseInt($(this).val(), 10); var container = $('<div />'); for(var i = 1; i <= num; i++) { container.append('<input id="id'+i+'" name="name'+i+'" />'); } $('somewhere').html(container); }); This works very well. Is there a way to have the values remaining in the text boxes when the selection is changed? For example, lets say the select element value is set to '2' so that there are 2 input boxes showing. If there is input already entered in these boxes and the user changes the select element value to '3' is there a way to get the first 2 input boxes to retain their value? Thanks for the help in advance Andy

    Read the article

  • jquery loop to create elements

    - by Andy Simpson
    Dear all, I have had no luck with this task so far so grateful for any help. I have an html form, in which there is a small select menu (1-10) ie <select> <option value = '1'>1</option> <option value = '2'>2</option> ... <option value = '10'>10</option> </select> depending on what value is selected i would like jquery to create (or remove) that number of input text boxes (with different names and id's). eg if 2 was selected these inputs would be created: <input type = 'text' name = 'name1' id = 'id1' /> <input type = 'text' name = 'name2' id = 'id2' /> i look forward to your no doubt simple and elegant solutions! andy

    Read the article

  • ClickOnce Application Files dialog filename problem

    - by Ted N
    In the ClickOnce "Application Files" files dialog, most of the entries for files are listed with the name "C". I have seen this on a colleague's machine for a different project as well. Has anyone else seen this and is there a way to get the correct filename inserted? We are both using VS 2008.

    Read the article

  • Selectively intercepting methods using autofac and dynamicproxy2

    - by Mark Simpson
    I'm currently doing a bit of experimenting using Autofac-1.4.5.676, autofac contrib and castle DynamicProxy2. The goal is to create a coarse-grained profiler that can intercept calls to specific methods of a particular interface. The problem: I have everything working perfectly apart from the selective part. I gather that I need to marry up my interceptor with an IProxyGenerationHook implementation, but I can't figure out how to do this. My code looks something like this: The interface that is to be intercepted & profiled (note that I only care about profiling the Update() method) public interface ISomeSystemToMonitor { void Update(); // this is the one I want to profile void SomeOtherMethodWeDontCareAboutProfiling(); } Now, when I register my systems with the container, I do the following: // Register interceptor gubbins builder.RegisterModule(new FlexibleInterceptionModule()); builder.Register<PerformanceInterceptor>(); // Register systems (just one in this example) builder.Register<AudioSystem>() .As<ISomeSystemToMonitor>) .InterceptedBy(typeof(PerformanceInterceptor)); All ISomeSystemToMonitor instances pulled out of the container are intercepted and profiled as desired, other than the fact that it will intercept all of its methods, not just the Update method. Now, how can I extend this to exclude all methods other than Update()? As I said, I don't understand how I'm meant to say "for the ProfileInterceptor, use this implementation of IProxyHookGenerator". All help appreciated, cheers! Also, please note that I can't upgrade to autofac2.x right now; I'm stuck with 1.

    Read the article

  • C# to Javascript: Custom Event Delegation?

    - by James Simpson
    I'm working on a project in Unity3D with Javascript, and I'm trying to implement the SmartFoxServer API (http://smartfoxserver.com) in Javascript instead of their example C# code. I've gotten most of it converted correctly, but I am still getting an error at runtime with the following line involving delegation to a C# file that is in the API (SFSEvent.cs). C# original: SFSEvent.onConnection += HandleConnection; Javascript (or whatever I've turned it into): SFSEvent.onConnection = Delegate.Combine(HandleConnection); Error: InvalidCastException: Cannot cast from source type to destination type.

    Read the article

  • How can I get the unread/new messages from Gmail using POP3?

    - by Ashley Simpson
    Using the OpenPOP .net client for getting messages from Gmail. I'm wondering how I can get only the new messages? Currently, I get the atom feed and then get as many emails as the feed has with the OpenPOP client (starting from the first). GmailAtomFeed feed = new GmailAtomFeed("user", "pass"); feed.GetFeed(); int unread = feed.FeedEntries.Count; POPClient client = new POPClient("pop.gmail.com", 995, "user", "pass", AuthenticationMethod.USERPASS, true); for (int i = 0; i < unread; i++) { Message m = client.GetMessage(i, false); // ... } Is there a better way to do this? And how do I set the unread messages to be read?

    Read the article

  • How to declare more than one header on PHP

    - by Homer Simpson
    I want to send my users to different pages based on user action. So I made multiple functions at the top of the page like so: <?php function one() { header("location: pagea.php"); } function two() { header("location: pageb.php"); } function three() { header("location: pagec.php"); } ?> Of course I get an error because I am re declaring headers. At first I though it was going to be okay since I am containing them inside functions and am calling any one function at a time. But still I get the error. Is there any other way of doing this?

    Read the article

  • Block users using auto-clickers

    - by James Simpson
    I'm having some problems with users cheating my online game by using macros to automatically click certain spots on the screen in a certain order to automate various tasks without having to actually be playing the game. Are there any methods that can be used to block this kind of activity without having to plaster CAPTCHAs all over the site and ruin the experience for the honest users?

    Read the article

  • Idiots guide to app engine and memcache

    - by Gareth Simpson
    I am struggling to find a good tutorial or best practices document for the use of memcache in app engine. I'm pretty happy with it on the level presented in the docs. Get an object by ID, checking memcache first, but I'm unclear on things like: If you cache a query, is there an accepted method for ensuring that the cache is cleared/updated when an object stored in that query is updated. What are the effects of using ReferenceProperties ? If a cache a Foo object with a Bar reference. Is my foo.bar in memcache too and in need of clearing down if it gets updated from some other part of my application. I don't expect answers to this here (unless you are feeling particularly generous!), but pointers to things I could read would be very gratefully received.

    Read the article

  • Sizeof struct in GO

    - by Homer J. Simpson
    I'm having a look at Go, which looks quite promising. I am trying to figure out how to get the size of a go struct, for example something like type Coord3d struct { X, Y, Z int64 } Of course I know that it's 24 bytes, but I'd like to know it programmatically.. Do you have any ideas how to do this ?

    Read the article

  • Select random row from MySQL (with probability)

    - by James Simpson
    I have a MySQL table that has a row called cur_odds which is a percent number with the percent probability that that row will get selected. How do I make a query that will actually select the rows in approximately that frequency when you run through 100 queries for example? I tried the following, but a row that has a probability of 0.35 ends up getting selected around 60-70% of the time. SELECT * FROM table ORDER BY RAND()*cur_odds DESC

    Read the article

  • RSS feed created with PHP only shows the title in the feed reader

    - by James Simpson
    I am using the following PHP code to generate the XML for an RSS feed, but it doesn't seem to be working correctly. No short description is displayed in the feed reader, all I see is the title of the article. Also, all of the articles say they were published at the same time. This is the first time I have tried to setup an RSS feed, so I'm sure I've made several stupid mistakes. $result = mysql_query("SELECT * FROM blog ORDER BY id DESC LIMIT 10"); $date = date(DATE_RFC822); header('Content-type: text/xml'); echo ("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"); echo ("<rss version=\"2.0\">\n"); echo ("<channel>\n"); echo ("<lastBuildDate>$date</lastBuildDate>\n"); echo ("<pubDate>$date</pubDate>\n"); echo ("<title>my website name</title>\n"); echo ("<description><![CDATA[the description]]></description>\n"); echo ("<link>http://my-domain.com</link>\n"); echo ("<language>en</language>\n"); $ch=100; while ($a = mysql_fetch_array($result)) { $headline = htmlentities(stripslashes($a['subject'])); $posturl = $a[perm_link]; $content = $a['post']; $date = date(DATE_RFC822, $a['posted']); echo ("<item>\n"); echo ("<title>$headline</title>\n"); echo ("<link>$posturl</link>\n"); echo ("<description><![CDATA[$content]]></description>\n"); echo ("<guid isPermaLink=\"true\">$posturl</guid>\n"); echo ("<pubDate>$date2</pubDate>\n"); echo ("</item>\n"); } echo ("</channel>\n"); echo ("</rss>\n");

    Read the article

  • C# Delegate under the hood question.

    - by Ted
    Hi Guys I was doing some digging around into delegate variance after reading the following tquestion in SO. "delegate-createdelegate-and-generics-error-binding-to-target-method" (sorry not allowed to post more than one hyperlink as a newbie here!) I found a very nice bit of code from Barry kelly at https://www.blogger.com/comment.g?blogID=8184237816669520763&postID=2109708553230166434 Here it is (in a sugared-up form :-) using System; namespace ConsoleApplication4 { internal class Base { } internal class Derived : Base { } internal delegate void baseClassDelegate(Base b); internal delegate void derivedClassDelegate(Derived d); internal class App { private static void Foo1(Base b) { Console.WriteLine("Foo 1"); } private static void Foo2(Derived b) { Console.WriteLine("Foo 2"); } private static T CastDelegate<T>(Delegate src) where T : class { return (T) (object) Delegate.CreateDelegate( typeof (T), src.Target, src.Method, true); // throw on fail } private static void Main() { baseClassDelegate a = Foo1; // works fine derivedClassDelegate b = Foo2; // works fine b = a.Invoke; // the easy way to assign delegate using variance, adds layer of indirection though b(new Derived()); b = CastDelegate<derivedClassDelegate>(a); // the hard way, avoids indirection b(new Derived()); } } } I understand all of it except this one (what looks very simple) line. b = a.Invoke; // the easy way to assign delegate using variance, adds layer of indirection though Can anyone tell me: how it is possible to call invoke without passing the param required by the static function. When is going on under the hood when you assign the return value from calling invoke What does Barry mean by extra indirection (in his comment)

    Read the article

  • rubyCAS-client serviceValidation uri questions.

    - by ted-gehling
    php code works with this url but the rubyCAS-Client gem's `validate_service_ticket()' seems to call an SSL Validation on this url which returns an error message. 'OpenSSL::SSL::SSLError in CassersController#index' ||'SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed' ---enviroment.rb--- require 'casclient' require 'casclient/frameworks/rails/filter' CASClient::Frameworks::Rails::Filter.configure( :cas_base_url => "https://auth.foo.com", :validate_url => "https://auth.foo.com/serviceValidate" ) ---casser_controller.rb--- class CassersController < ApplicationController require 'casclient' require 'casclient/frameworks/rails/filter' before_filter CASClient::Frameworks::Rails::Filter def index @username = session[:cas_user] end end Possibly just another requirement I need to make or a config file that needs changed, but any help about this error would be appreciated.

    Read the article

  • What's a good pure-python, document-based and flat-file database engine?

    - by joe Simpson
    Hi, for development i'd love to have a flat file database with the requirements up in the title, but I don't seem to be able to find a database with these requirements. I can't seem to get MetaKit to work. I only need it to work on the development machine, but in the real world my product will have more data and needs more room and will need something better. Does anyone know of a database engine capable of this or do I need to just use python's pickle and load and save a file? Joe

    Read the article

  • How to get parameter values for dm_exec_sql_text

    - by Ted Elliott
    I'm running the following statement to see what queries are executing in sql server: select * from sys.dm_exec_requests r cross apply sys.dm_exec_sql_text(r.sql_handle) where r.database_id = DB_ID('<dbname>') The sql text that comes back is parameterized: (@Parm0 int) select * from foo where foo_id = @Parm0 Is there any way to get the values for the parameters that the statement is using? Say by joining to another table perhaps?

    Read the article

  • How to use Google's Closure to compile JavaScript

    - by Ted
    Google just released Closure, which is a compiler to minify JavaScript. On the product site, it says "The Closure Compiler has also been integrated with Page Speed". How do I use Page Speed to compile my web pages JavaScript with Closure? (Or, is there a web site that I can simply paste in my JavaScript to have closure minify it?

    Read the article

  • Overview of PHP shorthand

    - by James Simpson
    I've been programming in PHP for years now, but I've never learned how to use any shorthand. I come across it from time to time in code and have a hard time reading it, so I'd like to learn the different shorthand that exists for the language sot hat I can read it and start saving time/lines by using it, but I can't seem to find a comprehensive overview of all of the shorthand. A Google search pretty much exclusively shows the shorthand for if/else statements, but I know there must be more than just that. By shorthand, I am talking about stuff like: ($var) ? true : false;

    Read the article

  • collapse jquery treeview plugin when focusing on another element

    - by Andy Simpson
    Hello all, Is there a way to have the jquery treeview plugin automatically collapse when a user focuses on another element. More detail about what I am trying to do: I have a form where a user has to select an item from a large selection. To make this easier I have set up a small list of 5 commonly selected items each with associated radio select buttons. However if the item wanted is not in this common list the user has to use the treeview to search through different categories to find the item. Is there a way to collapse the treeview when the user clicks on one of the radio buttons from the common item list? Thanks for your help in advance, Andy

    Read the article

  • Quitting an application - is that frowned upon?

    - by Ted
    Moving on in my attempt to learn Android I just read the following: Question: Does the user have a choice to kill the application unless we put a menu option in to kill it? If no such option exists, how does the user terminate the application? Answert (Romain Guy): The user doesn't, the system handles this automatically. That's what the activity lifecycle (especially onPause/onStop/onDestroy) is for. No matter what you do, do not put a "quit" or "exit" application button. It is useless with Android's application model. This is also contrary to how core applications work. Hehe, for every step I take in the Android world I run into some sort of problem =( Apparently, you cannot quit an application in Android (but Android can very well totally destroy your app whenever it feels like it). Whats up with that? I am starting to think that its impossible to write an app that functions as a "normal app" - that the user can quit the app when he/she decides to do so. That is not something that should be relied upon the OS to do. The application I am trying to create is not an application for the Android Market. It is not an application for "wide use" by the general public, it is a business app that is going to be used in a very narrow business field. I was actually really looking forward to developing for the Android-platform, since it addresses a lot of issues that exist in Windows Mobile and .NET. However, the last week has been somewhat of a turnoff for me... I hope I dont have to abandon Android, but it doesnt look very good right now =( Is there a way for me to really quit the application?

    Read the article

  • How to dynamically load & unload a TinyMCE Plugin

    - by Matt Simpson
    Does anyone know if there is a way I can dynamically load and unload a TinyMCE plugin after TinyMCE has already been loaded? Specifically, I'm thinking about asking the user whether or not they wish to load the fullpage plugin using perhaps a radio button or something above TinyMCE: <input type="radio" name="fullpage" value="enabled" /> Enable Fullpage Plugin<br /> <input type="radio" name="fullpage" value="disabled" /> Disable Fullpage Plugin<br /> <textarea name="tinymce" id="tinymce">...</textarea> I suppose I could destroy the original instance and load a new config (one for enabled / one for disabled), but it seems as though there should be a more elegant way of loading and unloading plugins.

    Read the article

  • Get Auto Increment value with MySQL query

    - by James Simpson
    I currently have a database with over 6 million rows and growing. I currently do SELECT COUNT(id) FROM table; in order to display the number to my users, but the database is getting large and I have no need to store all of those rows except to be able to show the number. Is there a way to select the auto_increment value to display so that I can clear out most of the rows in the database? Using LAST_INSERT_ID() doesn't seem to work.

    Read the article

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