Search Results

Search found 1506 results on 61 pages for 'ben mezger'.

Page 41/61 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Does Android AsyncTaskQueue or similar exist?

    - by Ben L.
    I read somewhere (and have observed) that starting threads is slow. I always assumed that AsyncTask created and reused a single thread because it required being started inside the UI thread. The following (anonymized) code is called from a ListAdapter's getView method to load images asynchronously. It works well until the user moves the list quickly, and then it becomes "janky". final File imageFile = new File(getCacheDir().getPath() + "/img/" + p.image); image.setVisibility(View.GONE); view.findViewById(R.id.imageLoading).setVisibility(View.VISIBLE); (new AsyncTask<Void, Void, Bitmap>() { @Override protected Bitmap doInBackground(Void... params) { try { Bitmap image; if (!imageFile.exists() || imageFile.length() == 0) { image = BitmapFactory.decodeStream(new URL( "http://example.com/images/" + p.image).openStream()); image.compress(Bitmap.CompressFormat.JPEG, 85, new FileOutputStream(imageFile)); image.recycle(); } image = BitmapFactory.decodeFile(imageFile.getPath(), bitmapOptions); return image; } catch (MalformedURLException ex) { // TODO Auto-generated catch block ex.printStackTrace(); return null; } catch (IOException ex) { // TODO Auto-generated catch block ex.printStackTrace(); return null; } } @Override protected void onPostExecute(Bitmap image) { if (view.getTag() != p) // The view was recycled. return; view.findViewById(R.id.imageLoading).setVisibility( View.GONE); view.findViewById(R.id.image) .setVisibility(View.VISIBLE); ((ImageView) view.findViewById(R.id.image)) .setImageBitmap(image); } }).execute(); I'm thinking that a queue-based method would work better, but I'm wondering if there is one or if I should attempt to create my own implementation.

    Read the article

  • How do I work with constructs in PHPUnit?

    - by Ben Dauphinee
    I am new into PHPUnit, and just digging through the manual. I cannot find a decent example of how to build a complete test from end to end though, and so, am left with questions. One of these is how can I prep my environment to properly test my code? I am trying to figure out how to properly pass various configuration values needed for both the test setup/teardown methods, and the configs for the class itself. // How can I set these variables on testing start? protected $_db = null; protected $_config = null; // So that this function runs properly? public function setUp(){ $this->_acl = new acl( $this->_db, // The database connection for the class passed // from whatever test construct $this->_config // Config values passed in from construct ); } // Can I just drop in a construct like this, and have it work properly? // And if so, how can I set the construct call properly? public function __construct( Zend_Db_Adapter_Abstract $db, $config = array(), $baselinedatabase = NULL, $databaseteardown = NULL ){ $this->_db = $db; $this->_config = $config; $this->_baselinedatabase = $baselinedatabase; $this->_databaseteardown = $databaseteardown; } // Or is the wrong idea to be pursuing?

    Read the article

  • CSS image float div problem in IE6

    - by Ben Dauphinee
    In the bottom cap of this page (bottom with corners) I seem to be having a weird IE6 issue. I've tried Google with no luck, as really, how do you ask this question. In IE6, the corner images that are floated left and right seem to cause the whitespace to drop. http://www.duncanhadleytriathlon.ca/ Any suggestions for why this may be?

    Read the article

  • Symfony Rewrite rules on Zeus webserver

    - by Ben
    I would like to run a symfony project on a zeus webserver, however i cannot get the rewrite rules to work. Has anyone done this successfully The symfony .htaccess is as follows: Options +FollowSymLinks +ExecCGI <IfModule mod_rewrite.c> RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something #RewriteCond %{REQUEST_URI} \..+$ #RewriteCond %{REQUEST_URI} !\.html$ #RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L] </IfModule> From what I can tell the following should work on zeus: match URL into $ with (^(.*)$) if matched then set URL = index.php But it doesn't... I can only load the home page from / all other pages just 404. Thanks..

    Read the article

  • Use SQL to filter the results of a stored procedure

    - by Ben McCormack
    I've looked at other questions on Stack Overflow related to this question, but none of them seemed to answer this question clearly. We have a system Stored Procedure called sp_who2 which returns a result set of information for all running processes on the server. I want to filter the data returned by the stored procedure; conceptually, I might do it like so: SELECT * FROM sp_who2 WHERE login='bmccormack' That method, though, doesn't work. What are good practices for achieving the goal of querying the returned data of a stored procedure, preferably without having to look of the code of the original stored procedure and modify it.

    Read the article

  • Multiple remote_form_for on the same page causes duplicate ids

    - by Ben Scheirman
    I've got a rails app that displays a list of items called modules. I'm iterating over these, rendering a partial for each one that includes a remote_form_for call. This all works, but fails HTML validation because my form text fields all have the same id. Is there a :prefix option on the form (or something else) I can use to get around this? Update: (some code) //_module_form.html.erb <% remote_form_for app_module do |f| %> <%= f.label :name %> <%= f.text_field :name %> <%= submit_tag 'Save' %> <%end %> //parent page <% @thing.modules.each do |app_module| %> <%= render :partial => "module_form", :locals => { :app_module => app_module } %> <% end %> So if I have more than 1 item in the collection, I render the identical form on the same page, and the form id and textbox id are duplicated. I can customize the form id pretty easily, but what about the text_box, since the controller is looking for specific named controls?

    Read the article

  • jQuery Autocomplete fetch and parse data source with custom function, except not

    - by Ben Dauphinee
    So, I am working with the jQuery Autocomplete function, and am trying to write a custom data parser. Not sure what I am doing incorrectly, but it throws an error on trying to call the autocompleteSourceParse function, saying that req is not set. setURL("ajax/clients/ac"); function autocompleteSourceParse(req, add){ var suggestions = []; $.getJSON(getURL()+"/"+req, function(data){ $.each(data, function(i, val){ suggestions.push(val.name); }); add(suggestions); }); return(suggestions); } $("#company").autocomplete({ source: autocompleteSourceParse(req, add), minLength: 2 });

    Read the article

  • Common NSNotification mistakes?

    - by Ben Packard
    A simplification... A building has an array of apartment objects. Each apartment has a single currentTenant. These tenants are of type Person. Note that currentTenant doesn't have a reference to the apartment, so can't send information back up the chain. When a tenant has a plumbing issue he raises an NSNotification: [nc postNotificationName:@"PlumbingIssue" object:self]; Each Apartment observes notifications ONLY FROM it's own current tenant (this is set up when the apartment is built, before there is a current tenant): [nc addObserver:self selector:@selector(alertBuildingManager:) name:@"PlumbingIssue" object:[self currentTenant]; When the apartment receives a notification from it's own currentTenant, it sends it's own notification, "PlumberRequired", along with the apartment number and the currentTenant in an NSDictionary. Apartment observes these notifications, which it will take from any apartment (or other object): [nc addObserver:self selector:@selector(callPlumber) name:@"PlumberRequired" object:nil]; Is there something I could be getting fundamentally wrong here? What's happening is that the apartment is receiving notifications from any and all currentTenants, rather than jus it's own. Sorry that the actual code is a bit too unwieldy to post. Was just wondering if there's a gap in my understanding about observing notifications from a particular sender?

    Read the article

  • Making a textfile into a list in matlab?

    - by Ben Fossen
    I have a textfile and would like to import it onto Matlab and make it a list Person1 name = steven grade = 11 age= 17 Person2 name = mike grade = 9 age= 15 Person3 name = taylor grade = 11 age= 17 There are a few hundred entries like these above. Each are seperated by a blank line I was thinking I could scan the text and make the information between each blank line into an item in the list. I also would like to be able to look up each person by name once I have a list like the one below. I want something like x = [Person1 Person2 Person3 name = steven name = mike name = taylor grade = 11 grade = 9 grade = 11 age = 17 age = 15 age = 17] This seems very straight forward but I have been having trouble with this so far, I may be overlooking something. anyone have any ideas or advice?

    Read the article

  • Searching via Tags in SharePoint 2010

    - by Ben
    Is it possible to search on Tags within SharePoint 2010? I know you can refine your search based on Tag (Search for a keyword, then filter by Tags) and you can use the "Tag Cloud", but that doesnt let you search by more then one Tag. How would I for instance, search for some documents that I have tagged as "Technical" and "Internal", and return all items tagged with both of those tags?

    Read the article

  • How do I debug an ASP.NET web service in Visual Studio?

    - by Ben McCormack
    I have an ASP.NET .ASMX web service that I converted to .NET 4.0 with VS 2010 and is hosted in an IIS 7.5 (Windows 7) application pool. I have a simple html page that I use to make the AJAX request to the web service. How can I debug what's going on in the web service in Visual Studio? Because the HTML ajax request doesn't seem "tied in" to the web service, which is located on my local IIS service, I can't figure out how to debug it.

    Read the article

  • ValidateInputAttribute bug in VS 2010 RC / ASP.NET MVC 2.0?

    - by Ben
    Am I doing something wrong here? I have a text area on a view and am posting back the html contents. In VS 2008 and MVC 1.0 the following code successfully prevents input validation: [HttpPost] [ValidateInput(false)] public ActionResult Index(int? id) { return View(); } If I execute this code in VS 2010 / MVC 2.0 I always get this error: A potentially dangerous Request.Form value was detected from the client (body=""). Any ideas?

    Read the article

  • flex builder 3 compiler won't show errors or compile specific pages

    - by Ben
    In flexbuilder 3 for some mxml files I can purposely put in syntax errors and the compiler will seem to compile the specific page(but actually not compile it) or report any errors for that page. Is there any way that you know of to get the compiler to report the errors to me so I can get it to compile the page. I've tried rebuilding all and cleaning the project already.

    Read the article

  • Silly Objective-C inheritance problem when using property

    - by Ben Packard
    I've been scratching my head with this for a couple of hours - I haven't used inheritance much. Here I have set up a simple Test B class that inherits from Test A, where an ivar is declared. But I get the compilation error that the variable is undeclared. This only happens when I add the property and synthesize declarations - works fine without them. TestA Header: #import <Cocoa/Cocoa.h> @interface TestA : NSObject { NSString *testString; } @end TestA Implementation is empty: #import "TestA.h" @implementation TestA @end TestB Header: #import <Cocoa/Cocoa.h> #import "TestA.h" @interface TestB : TestA { } @property NSString *testProp; @end TestB Implementation (Error - 'testString' is undeclared) #import "TestB.h" @implementation TestB @synthesize testProp; - (void)testing{ NSLog(@"test ivar is %@", testString); } @end

    Read the article

  • jQuery oembed plugin z-index problem

    - by Ben
    I'm using the jQuery oembed plugin to display videos from a Vimeo feed. The only problem is they display over the top of my navigation menu. I have tried setting the z-index of the menu but this makes no difference. A common suggestion seems to be to set the wmode parameter to transparent or opaque. However, passing this as a parameter to the oembed function makes no difference. Thanks

    Read the article

  • Is this ruby code thread safe?

    - by Ben K.
    Is this code threadsafe? It seems like it should be, because @myvar will never be assigned from multiple threads (assuming block completes in < 1s). But do I need to be worried about a situation where the second block is trying to read @myvar as it's being written? require 'rubygems' require 'eventmachine' @myvar = Time.now.to_i EventMachine.run do EventMachine.add_periodic_timer(1) do EventMachine.defer do @myvar = Time.now.to_i # some calculation and reassign end end EventMachine.add_periodic_timer(0.5) do puts @myvar end end

    Read the article

  • I need to order a list that is dependant on another list. how to change both lists?

    - by Ben Fossen
    I have a Matlab program that generates a list x = 6.1692 8.1863 5.8092 8.2754 6.0891 the program also outputs another list aspl = 680 637 669 599 693. The two lists are on equal length and the first element in list x is related to the first element in list aspl. I need to graph the two lists but want list aspl to be in order from smallest to largest. How would I go about doing this? If I need to move the first element in aspl to position 4 in the list, then the first element of list x also needs to be moved to position 4 in list x. The numbers above are not important they are just examples, the actual program generates hundereds of numbers. for example x = 6.1692 8.1863 5.8092 8.2754 initially aspl = 680 637 669 599 693 after changing aspl to ascending order this is how x should look. x = 5.8092 8.1863 5.8092 6.1692 8.2754 aspl = 599 637 669 680 693

    Read the article

  • Ajax Auto Complete in ASP.Net MVC project - How to display a an object's name but actually save it's

    - by Ben
    I have implemented the Ajax Autocomplete feature in my application using a web service file that querys my database and it works great. One problem I am having is allowing the user to see the item's name, as that's what they are typing in the textbox, but when they select it, it saves the item's ID number instead of the actual name. I want it to behave much like a dropdown list, where I can specify what is seen and entered vs. what is actually saved in the database (in this case, the product ID instead of it's name.) I have this text box in my view, along with the script: <script type="text/javascript"> Sys.Application.add_init(function() { $create( AjaxControlToolkit.AutoCompleteBehavior, { serviceMethod: 'ProductSearch', servicePath: '/ProductService.asmx', minimumPrefixLength: 1, completionSetCount: 10 }, null, null, $get('ProductID')) }); </script> <p> <label for="ProductID">Product:</label> <%= Html.TextBox("ProductID", Model.Products)%> <%= Html.ValidationMessage("ProductID", "*")%> </p> Here's what is in my asmx file: public class ProductService : System.Web.Services.WebService { [WebMethod] public string[] ProductSearch(string prefixText, int count) { MyDataContext db = new MyDataContext(); string[] products = (from product in db.Products where product.ProductName.StartsWith(prefixText) select product.ProductName).Take(count).ToArray(); return products; } } Can anyone help me figure this out? I'm using this so they can just start typing instead of having a dropdown list that's a mile long...

    Read the article

  • custom php function creation and install

    - by Ben Olley
    I would like to know how to create a php function that can be installed in php just like the already built in functions like : rename copy The main point I would like to achieve is a simple php function that can be called from ANY php page on the whole host without needing to have a php function within the php page / needing an include. so simply I would like to create a function that will work like this : location(); That without a given input string will output the current location of the file via echo etc

    Read the article

  • charset problem?

    - by Ben Fransen
    Hi all, I have a bugging problem. For a website I made there are search engine friendly URL's generated. The only problem is there are ß-chars in the url too. Chars like ö, ï, ä, ü etc. are placed correct. But with the ß-char there is a diamond-icon with a questionmark in it. I thought it had to do with the charset which is used but i've tried both UTF-8 and iso-8859-1. Both without luck. I need to have the correct character in the url for the readability of deeplinks. Hope to hear from you!

    Read the article

  • Reorganizing MySQL table to multiple rows by timestamp.

    - by Ben Burleson
    OK MySQL Wizards: I have a table of position data from multiple probes defined as follows: +----------+----------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +----------+----------+------+-----+---------+-------+ | time | datetime | NO | | NULL | | | probe_id | char(3) | NO | | NULL | | | position | float | NO | | NULL | | +----------+----------+------+-----+---------+-------+ A simple select outputs something like this: +---------------------+----------+----------+ | time | probe_id | position | +---------------------+----------+----------+ | 2010-05-05 14:16:42 | 00A | 0.0045 | | 2010-05-05 14:16:42 | 00B | 0.0005 | | 2010-05-05 14:16:42 | 00C | 0.002 | | 2010-05-05 14:16:42 | 01A | 0 | | 2010-05-05 14:16:42 | 01B | 0.001 | | 2010-05-05 14:16:42 | 01C | 0.0025 | | 2010-05-05 14:16:43 | 00A | 0.0045 | | 2010-05-05 14:16:43 | 00B | 0.0005 | | 2010-05-05 14:16:43 | 00C | 0.002 | | 2010-05-05 14:16:43 | 01A | 0 | | . | . | . | | . | . | . | | . | . | . | +---------------------+----------+----------+ However, I'd like to output something like this: +---------------------+--------+--------+-------+-----+-------+--------+ | time | 00A | 00B | 00C | 01A | 01B | 01C | +---------------------+--------+--------+-------+-----+-------+--------+ | 2010-05-05 14:16:42 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:43 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:44 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:45 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:46 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | 2010-05-05 14:16:47 | 0.0045 | 0.0005 | 0.002 | 0 | 0.001 | 0.0025 | | . | . | . | . | . | . | . | | . | . | . | . | . | . | . | | . | . | . | . | . | . | . | +---------------------+--------+--------+-------+-----+-------+--------+ Ideally, the different probe position columns are dynamically generated based on data in the table. Is this possible, or am I pulling my hair out for nothing? I've tried GROUP BY time with GROUP_CONCAT that roughly gets the data out, but I can't separate that output into probe_id columns. mysql SELECT time, GROUP_CONCAT(probe_id), GROUP_CONCAT(position) FROM MG41 GROUP BY time LIMIT 10; +---------------------+-------------------------+------------------------------------+ | time | GROUP_CONCAT(probe_id) | GROUP_CONCAT(position) | +---------------------+-------------------------+------------------------------------+ | 2010-05-05 14:16:42 | 00A,00B,00C,01A,01B,01C | 0.0045,0.0005,0.002,0,0.001,0.0025 | | 2010-05-05 14:16:43 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:44 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:45 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:46 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:47 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:48 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:49 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:50 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | | 2010-05-05 14:16:51 | 01C,01B,01A,00C,00B,00A | 0.0025,0.001,0,0.002,0.0005,0.0045 | +---------------------+-------------------------+------------------------------------+

    Read the article

  • What's the VB.NET equivalent of this C# code for wiring up and declaring an event?

    - by Ben McCormack
    I'm working on a tutorial to build a media player in Silverlight and am trying to wire up an EventHandler to the timer.Tick event of a DispatchTimer object so that the time of the video is synced with a Slider object. The sample code is in C# and I can't for the life of me figure out the proper syntax in VB.NET with RaiseEvent and/or Handles to wire up the event. Below is the relevant C# code. I'll include comments on where I'm getting stuck. private DispatchTimer timer; public Page() { //... timer = new DispatchTimer(); timer.Interval = TimeSpan.FromMilliseconds(50); timer.Tick += new EventHandler(timer_Tick); // <== I get stuck here b/c // I can't do "timer.Tick += ..." in VB.NET } void timer_Tick(object sender, EventArgs e) { if (VideoElement.NaturalDuration.TimeSpan.TotalSeconds > 0) { sliderScrubber.Value = VideoElement.Position.TotalSeconds / VideoElement.NaturalDuration.TimeSpan.TotalSeconds; } }

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >