Search Results

Search found 2773 results on 111 pages for 'michael simpson'.

Page 8/111 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • JQuery UI tabs: How do I navigate directly to a tab from another page?

    - by Chris Simpson
    JQuery UI tabs are implemented by named anchors in an unordered list. When you hover over one of the tabs you can see this in the link shown at the foot of the browser: http://mysite/product/3/#orders Above would be the "orders" tab for example. JQuery obviously intercepts the click to this anchor and opens the tab instead. However if I bookmark the link above or link to it from elsewhere in the site the page does not open on the specific tab. In the tab initialisation block I was considering putting in some code that looks for a named anchor in the URL and, if it finds one, does an index lookup of the tabs and calls the select on it. This would mean it will still work with JS switched off. But is there an easier/nicer/better way?

    Read the article

  • How to optimize this MySQL query

    - by James Simpson
    This query was working fine when the database was small, but now that there are millions of rows in the database, I am realizing I should have looked at optimizing this earlier. It is looking at over 600,000 rows and is Using where; Using temporary; Using filesort (which leads to an execution time of 5-10 seconds). It is using an index on the field 'battle_type.' SELECT username, SUM( outcome ) AS wins, COUNT( * ) - SUM( outcome ) AS losses FROM tblBattleHistory WHERE battle_type = '0' && outcome < '2' GROUP BY username ORDER BY wins DESC , losses ASC , username ASC LIMIT 0 , 50

    Read the article

  • python: subclass a metaclass

    - by Michael Konietzny
    Hello, for putting methods of various classes into a global registry I'm using a decorator with a metaclass. The decorator tags, the metaclass puts the function in the registry: class ExposedMethod (object): def __init__(self, decoratedFunction): self._decoratedFunction = decoratedFunction def __call__(__self,*__args,**__kw): return __self._decoratedFunction(*__args,**__kw) class ExposedMethodDecoratorMetaclass(type): def __new__(mcs, name, bases, dct): for obj_name, obj in dct.iteritems(): if isinstance(obj, ExposedMethod): WorkerFunctionRegistry.addWorkerToWorkerFunction(obj_name, name) return type.__new__(mcs, name, bases, dct) class MyClass (object): __metaclass__ = DiscoveryExposedMethodDecoratorMetaclass @ExposeDiscoveryMethod def myCoolExposedMethod (self): pass I've now came to the point where two function registries are needed. The first thought was to subclass the metaclass and put the other registry in. For that the new method has simply to be rewritten. Since rewriting means redundant code this is not what I really want. So, it would be nice if anyone could name a way how to put an attribute inside of the metaclass which is able to be read when new is executed. With that the right registry could be put in without having to rewrite new. Thanks and Greetings, Michael

    Read the article

  • Resources to learn sh scripting 'just like a normal programming language'

    - by Homer J. Simpson
    Hi, what is the best resource (book would be nice) to learn sh scripting (the "standard" shell on Unix systems) just like when i would learn a "normal" programming/scripting language ? There are lots of tutorials on certain aspects of shell scripting, they mostly deal with shells in general and unix commands and so on, but i would rather like to find a more general approach - meaning a quick syntactic overview and an outlook on how to do things you normally do when programming, like implementing small algorithms and so on. Doing actual scripting, not just a structured batch file. And rather 100-liners than 1-to-3-liners. Can you recommend a good standard book on the topic ?

    Read the article

  • Conditional Validation with Paperclip difficult

    - by Michael Schmitz
    Hi, I have an "item", which goes through a multi-page creation process. Images are uploaded at step five, and I keep track of the steps by using the attribute "complete". When validating whether an image is attached with paperclip, I get problems using the code below: validates_attachment_presence :pic1, :if => Proc.new { |u| u.complete == "step5"} It seems that I can't access the "complete" attribute, as the active-record object seems to be the paperclip image. Is there a way for me to check at which point in the process I am and validate conditionally? Thanks, Michael

    Read the article

  • 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

  • Resolve formatted table value in wix custom action

    - by Michael Stoll
    Hi, I've created certificate wix extension (extension of IisExtension). This includes a custom table, which is consumed by a custom action. A column is defined as follows: <columnDefinition name="Account" type="string" length="72" primaryKey="yes" modularize="property" category="formatted" description="..." /> This column contains values like "[Property]". When the custom action reads this column like this: hr = WcaGetRecordString(hRecCertificate, vcpqAccount, &pwzTemp); it get's the string "[Property]". But I need "PropertyValue". How can this string be resolved? Regards Michael

    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

  • Excel VBA: importing CSV with dates as dd/mm/yyyy

    - by Michael Smith
    ello I understand this is a fairly common problem, but I'm yet to find a reliable solution. I have data in a csv file with the first column formatted dd/mm/yyyy. When I open it with Workbooks.OpenText it defaults to mm/dd/yyyy until it figures out that what it thinks is the month exceeds 12, then reverts to dd/mm/yyyy. This is my test code, which tries to force it as xlDMYFormat, and I've also tried the text format. I understand this problem only applies to *.csv files, not *.txt, but that isn't an acceptable solution. Option Base 1 Sub TestImport() Filename = "test.csv" Dim ColumnArray(1 To 1, 1 To 2) ColumnsDesired = Array(1) DataTypeArray = Array(xlDMYFormat) ' populate the array for fieldinfo For x = LBound(ColumnsDesired) To UBound(ColumnsDesired) ColumnArray(x, 1) = ColumnsDesired(x) ColumnArray(x, 2) = DataTypeArray(x) Next x Workbooks.OpenText Filename:=Filename, DataType:=xlDelimited, Comma:=True, FieldInfo:=ColumnArray End Sub test.csv contains: Date 11/03/2010 12/03/2010 13/03/2010 14/03/2010 15/03/2010 16/03/2010 17/03/2010 Thanks Michael

    Read the article

  • Python: how to enclose strings in a list with < and >

    - by Michael Konietzny
    Hello, i would like to enclose strings inside of list into < (formatted like <%s). The current code does the following: def create_worker (general_logger, general_config): arguments = ["worker_name", "worker_module", "worker_class"] __check_arguments(arguments) def __check_arguments(arguments): if len(sys.argv) < 2 + len(arguments): print "Usage: %s delete-project %s" % (__file__," ".join(arguments)) sys.exit(10) The current output looks like this: Usage: ...\handler_scripts.py delete-project worker_name worker_module worker_class and should look like this: Usage: ...\handler_scripts.py delete-project <worker_name> <worker_module> <worker_class> Is there any short way to do this ? Greetings, Michael

    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

  • contentoffset during flick gesture

    - by Michael Xu
    Hi all, Does anyone else notice that the contentOffset of UIScrollView doesnt update during a flick gesture? It only updates after the flick gesture has totally completed, when the flick gesture is finished. After the finger has left the screen, the scrollview keeps moving, in the decelerating phase. but this isnt reflected in the contentOffset of the UIScrollView. Is there a way to track where the contentOffset is during the decelerating part of the flick gesture? I have an OpenGL layer on top, and i want it to move with the scrollView. Can't seem to get the right info out of the scrollview though... Thoughts? thanks, michael

    Read the article

  • NAVT WordPress Plugin - Just a quick question

    - by Michael
    Hi, I got this plugin and have created my list etc and it's appearing fine. However, I am wondering how I create a list under another list...like the second level part of the list? I'm trying to create a dropdown menu you see. In the admin, when I try and drag the item over, it will only let me put it in the first level, how do I get it to go under a sub-item? I would consult the NAVT blog etc but the documentation is so poor it's a kind of joke. But I guess it IS free :) Many thanks, Michael

    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

  • how do i add two delegates to a ui element at run time?

    - by Michael Xu
    Hi everyone, im trying to implement some behaviors when a mapview element scrolls... by coding a delegate for the scrollview inside of a mapview. so, right now, i got a pointer to the scroll view used by the map view in my code. however, i wish to set the delegate of this scroll view inside the map view, but the issue is that the mapview already sets up a default delegate for this scroll view inside the map view. can i make my delegate implement all of the messages of the protocol, explicitly sending them to the mapview's default delegate while also implementing my own behaviors? how else can i go about adding my own delegate behavior, to an already existing default delegate....? thanks everyone, michael

    Read the article

  • MEF part unable to import Autofac autogenerated factory

    - by Michael Wagner
    This is a (to me) pretty weird problem, because it was already running perfectly but went completely south after some unrelated changes. I've got a Repository which imports in its constructor a list of IExtensions via Autofacs MEF integration. One of these extensions contains a backreference to the Repository as Lazy(Of IRepository) (lazy because of the circular reference that would occur). But as soon as I try to use the repository, Autofac throws a ComponentNotRegisteredException with the message "The requested service 'ContractName=Assembly.IRepository()' has not been registered." That is, however, not really correct, because when I break right after the container-build and explore the list of services, it's there - Exported() and with the correct ContractName. I'd appreciate any help on this... Michael

    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

  • NAVT WordPress Plugin - Not working on index.php

    - by Michael
    Hi there, I need to move my wordpress home page onto the actual index.php file but for some bizarre reason the NAVT plugin doesn't work on there. It also doesn't work on index.php when I put it in the header.php file. It works on all other pages as normal. ALSO, it does work in the footer.php file when viewing the index.php file so this is what makes it all the more confusing. Any ideas what it could be? I've disabled every other plugin so I'm pretty sure there's nothing conflicting. It's rather basic setup and I'm using NAVT default settings. Thanks, Michael.

    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

  • 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

  • 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

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >