Search Results

Search found 1642 results on 66 pages for 'dan morgan'.

Page 46/66 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • HTML5 audio object doesn't play on iPad (when called from a setTimeout)

    - by Dan Halliday
    I have a page with a hidden <audio> object which is being started and stopped using a custom button via javascript. (The reason being I want to customise the button, and that drawing an audio player seems to destroy rendering performance on iPad anyway). A simplified example (in coffeescript): // Works fine on all browsers constructor: (@_button, @_audio) -> @_button.on 'click', @_play // Bind button's click event with jQuery _play: (e) => @_audio[0].play() // Call play() on audio element The audio plays fine when triggered from a function bound to a click event, but I actually want an animation to complete before the file plays so I put .play() inside a setTimeout. However I just can't get this to work: // Will not play on iPad constructor: (@_button, @_audio) -> @_button.on 'click', @_play // Bind button's click event with jQuery _play: (e) => setTimeout (=> // Declare a 300ms timeout @_audio[0].play() // Call play() on audio element ), 300 I've checked that @_audio (this._audio) is in scope and that its play() method exists. Why doesn't this work on iPad?

    Read the article

  • What are the fastest-performing options for a read-only, unordered collection of unique strings?

    - by Dan Tao
    Disclaimer: I realize the totally obvious answer to this question is HashSet<string>. It is absurdly fast, it is unordered, and its values are unique. But I'm just wondering, because HashSet<T> is a mutable class, so it has Add, Remove, etc.; and so I am not sure if the underlying data structure that makes these operations possible makes certain performance sacrifices when it comes to read operations -- in particular, I'm concerned with Contains. Basically, I'm wondering what are the absolute fastest-performing data structures in existence that can supply a Contains method for objects of type string. Within or outside of the .NET framework itself. I'm interested in all kinds of answers, regardless of their limitations. For example I can imagine that some structure might be restricted to strings of a certain length, or may be optimized depending on the problem domain (e.g., range of possible input values), etc. If it exists, I want to hear about it. One last thing: I'm not restricting this to read-only data structures. Obviously any read-write data structure could be embedded inside a read-only wrapper. The only reason I even mentioned the word "read-only" is that I don't have any requirement for a data structure to allow adding, removing, etc. If it has those functions, though, I won't complain.

    Read the article

  • Is there a way to allow a property of a user control to be modified only during design time?

    - by Dan
    I've looked into the DesignOnly attribute, but that doesn't seem to accomplish what I want*. Basically, I'm looking for some way to indicate that some property of a user control (let's say Text) can be modified during design time -- i.e., from the Windows Forms designer in VS (or presumably from any GUI designer that can be used to modify a Windows Forms GUI) -- but not during run time. Once the application is running, the property should effectively be readonly. Is this possible? * When I add the DesignOnly attribute to a property, the value I select for that property from design mode doesn't seem to stick; the property just ends up being whatever I have it set to by default in code.

    Read the article

  • jQuery animation if load() returns something different...

    - by Dan LaManna
    setInterval(function() { var prevTopArticle = $("#toparticles table:first").html(); $("#toparticles").load("myurloffeed.com/topfeed", function() { alternateBG(); var newTopArticle = $("#toparticles table:first").html(); if (prevTopArticle!=newTopArticle) { $("#toparticles table:first").effect("highlight", {color:"#faffc4"}, 2000); } }); }, 8000); So it sets the current first table item to a variable, loads the toparticles div with the tables off the url, and if they are different it will perform the highlight effect, however it does the highlight effect anyway, completely unsure why it isn't working.

    Read the article

  • How to use Comparator in Java to sort

    - by Dan
    I learned how to use the comparable but I'm having difficulty with the Comparator. I am having a error in my code: Exception in thread "main" java.lang.ClassCastException: New.People cannot be cast to java.lang.Comparable at java.util.Arrays.mergeSort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.Collections.sort(Unknown Source) at New.TestPeople.main(TestPeople.java:18) Here is my code: import java.util.Comparator; public class People implements Comparator{ private int id; private String info; private double price; public People(int newid, String newinfo, double newprice){ setid(newid); setinfo(newinfo); setprice(newprice); } public int getid() { return id; } public void setid(int id) { this.id = id; } public String getinfo() { return info; } public void setinfo(String info) { this.info = info; } public double getprice() { return price; } public void setprice(double price) { this.price = price; } public int compare(Object obj1, Object obj2) { Integer p1 = ((People)obj1).getid(); Integer p2 = ((People)obj2).getid(); if (p1 p2 ){ return 1; } else if (p1 < p2){ return -1; } else return 0; } } import java.util.ArrayList; import java.util.Collections; public class TestPeople { public static void main(String[] args) { ArrayList peps = new ArrayList(); peps.add(new People(123, "M", 14.25)); peps.add(new People(234, "M", 6.21)); peps.add(new People(362, "F", 9.23)); peps.add(new People(111, "M", 65.99)); peps.add(new People(535, "F", 9.23)); Collections.sort(peps); for(int i=0;i I believe it has to do something with the casting in the compare method but I was playing around with it and still could not find the solution

    Read the article

  • Making a view scrollable when keyboard active

    - by Dan Ray
    I have a view with half a dozen text fields and labels, and a button. I want it to be that when the keyboard pops up, the view becomes scrollable, so you can scroll the view up and see the bottom half of the fields without having to dismiss the keyboard to get to them. Just putting it inside a UIScrollView doesn't seem to do it.

    Read the article

  • Data Access example using Entity Framework

    - by Dan
    Does anyone know of or having any good examples of how to use Entity Framework version 2 in the Data Access layer and put an interface on it so the business layer uses the interface rather than knowing about EF? I have found some examples but they are all from 2009 and I'm not sure how they relate to Entity Framework version 2.

    Read the article

  • PHP: Join two separate mysql queries into the same json data object

    - by Dan
    I'm trying to mesh the below mysql query results into a single json object, but not quite sure how to do it properly. //return data $sql_result = mysql_query($sql,$connection) or die ("Fail."); $arr = array(); while($obj = mysql_fetch_object($sql_result)) { $arr[] = $obj; } echo json_encode($arr); //return json //plus the selected options $sql_result2 = mysql_query($sql2,$connection) or die ("Fail."); $arr2 = array(); while($obj2 = mysql_fetch_object($sql_result2)) { $arr2[] = $obj2; } echo json_encode($arr2); //return json Here's the current result: [{"po_number":"test","start_date":"1261116000","end_date":"1262239200","description":"test","taa_required":"0","account_overdue":"1","jobs_id":null,"job_number":null,"companies_id":"4","companies_name":"Primacore Inc."}][{"types_id":"37"},{"types_id":"4"}] Notice how the last section [{"types_id":"37"},{"types_id":"4"}] is placed into a separate chunk under root. I'm wanting it to be nested inside the first branch under a name like, "types". I think my question has more to do with Php array manipulation, but I'm not the best with that. Thank you for any guidance.

    Read the article

  • Firefox jquery flicker bug problem

    - by Dan
    This is possibly a really silly question but I've stared at this code way too long for it to make sense! I'm having problems with a flicker of the screen in firefox; It is related a filtering script... I have a website that is a one page vertical scroll; with different anchors to define sections and a smooth scroll script to make it pretty... See the example here: http://tiny.cc/7g5mn I've tried everything... Please help me, I'm begging you, my eyes hurt!

    Read the article

  • Linq qurery with multiple where's

    - by Dan
    I am trying the to query my Status Update repository using the following var result = (from s in _dataContext.StatusUpdates where s.Username == "friend1" && s.Username == "friend2" etc... select s).ToList(); Insead of using s.Username == "friendN" continously is there anyway I can pass a list or array or something like that rather that specifying each one, or can i use a foreach loop in the middle of the query. Thanks

    Read the article

  • How do you pipe output from a Ruby script to 'head' without getting a broken pipe error

    - by dan
    I have a simple Ruby script that looks like this require 'csv' while line = STDIN.gets array = CSV.parse_line(line) puts array[2] end But when I try using this script in a Unix pipeline like this, I get 10 lines of output, followed by an error: ruby lib/myscript.rb < data.csv | head 12080450 12080451 12080517 12081046 12081048 12081050 12081051 12081052 12081054 lib/myscript.rb:4:in `write': Broken pipe - <STDOUT> (Errno::EPIPE) Is there a way to write the Ruby script in a way that prevents the broken pipe exception from being raised?

    Read the article

  • Javascript permission denied. Not cross domain?

    - by Dan
    I'm working on a web app that very rarely returns a Javacript permission denied error when attempting to access document elements. I'm well aware of cross-domain issues and I am actively pursuing them as a possible cause. My question is: are there other possible causes for a permission denied exception? Just want to make sure I'm looking in to all possible avenues. Thanks!

    Read the article

  • Looping an animation made with script.aculo.us

    - by Dan T
    I've created an animation using script.aculo.us. However, when the animation is finished, I want to have it reset all the objects and perform the animation again. I plan to just reset the positions of the objects manually, but how can I make the animations loop? If I put the effect declarations inside a for or while loop, it just crashes the browser. Any ideas?

    Read the article

  • Using Flex Builder with source control

    - by Dan Monego
    When setting up a source control repository for a Flex Builder workspace, what do you consider to be worth checking in? Do you exclude the workspace .metadata folder but keep the .project and other project specific files? Keep both? Throw away both? Is there a guideline you use to decide which is worth holding onto or do you do it out of practical experience?

    Read the article

  • Cannot connect to SQL Server from ASP.NET MVC app

    - by Dan Fergus
    I have an ASP.NET MVC app that has on a hosted server for over a year, connecting to SQL Server. I've had to change hosting services, the new one supports MVC 1.0. I've also moved a non MVC ASP app to the same hosting service. Now, MY MVC based app retturnes this error when I try to validate a user login. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) Now, the non-MVC app can access the exact same database and authenticate users just fine. The MVC app, when run from my dev box connects fine. It also run/connects/authenticates without problem when I install and run the site from an internal SQL 2008 server running IIS 7. I, along with the hosting support techs, am at a loss how the exact same connect string works every where except on the hosted server, and only when run from inside an ASP.NET MVC web app. Any ideas would be greatly appreciated.

    Read the article

  • PHP - Get dates of next 5 weekdays?

    - by Dan
    I'm trying to create an array of the next 5 working week days (Monday - Friday, excluding today). I know the working week varies around the world but this is not important for what I am trying to do. So, for example, if today is a Wednesday, I want the dates for Thursday and Friday of the current week and Monday, Tuesday and Wednesday of the following week. I thought this would work: $dates = array(); for ($i = 1; $ < 6; $i ++) { $dates[] = date('Y-m-d', strtotime('+ '.$i.' weekday')); } But for today, it is giving me: Monday 1st Tuesday 2nd Wednesday 3rd Thursday 4th Sunday 7th! Any advice appreciated. Thanks

    Read the article

  • jquery child element as trigger

    - by Dan w
    When "forum-title" is clicked, I want "subtopic-frame" within the parent "forum-topics-head" to expand. There are multiple "forum-topics-head" (with all associated children) on this page. The way I have it now, the "forum-topics-head" is the trigger, but I want the "forum-title" to be the trigger. html: <div class="forum-topic-head"> <div class="forum-title">Forum Title</div> <div class="subtopic-frame"> subtopic 1 subtopic 2 </div> </div>

    Read the article

  • manage.py runserver not working

    - by Dan Appleyard
    I am new to django and python in general, so pardon me for any simple mistakes I may be doing. I am trying to setup my first django project on my local windows vista machine. I have created the project successfully with no problems. The issue I am coming across is when my settings.py has values for my database keys, the manage.py runserver command is failing. If I have values in settings before I run the command, as soon as I run it I get errors. If I have already run the command and the server is running, as soon as I edit the settings file with values, the errors show up in my still open command prompt. The inner most exception seems to "Error loading MySQLdb module: No module named MYSQLdb". If I leave the settings.py blank, the command executes with no problems. Any advice would be greatly appreciated! Thanks

    Read the article

  • Combine overlapping urls in C#

    - by Dan Revell
    I've got two Urls. A server and a relative url that I would like to combine. The problem is that part of the url's may well overlap. I've done this using some horrible string manipulation but would like to put this out there and see if there is a nice and clean way of doing it. string siteUrl = "http://seed-dev6/sites/irs"; string formUrl = "/sites/irs/Forms/testform.xsn";

    Read the article

  • Extract part of HTML in C/Objective-C

    - by Dan
    Hi, I need to extract the detail content of a website while preserve all formatting of the division. The section I wish to extract is: ... <div class="detailContent"><p> <P dir=ltr><STRONG>Hinweis</strong>: Auf ... </p> </div> ... My current solution is to use HTMLParser from libxml2 and xpath to find the nodes and walk through all the nodes to reconstruct this piece of HTML. This is a long an complicated code. I' just wondering if there is an easier solution to extract part of HTML? Thanks.

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >