Search Results

Search found 20065 results on 803 pages for 'practice problems'.

Page 72/803 | < Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >

  • Two strange efficiency problems in Mathematica

    - by Jess Riedel
    FIRST PROBLEM I have timed how long it takes to compute the following statements (where V[x] is a time-intensive function call): Alice = Table[V[i],{i,1,300},{1000}]; Bob = Table[Table[V[i],{i,1,300}],{1000}]^tr; Chris_pre = Table[V[i],{i,1,300}]; Chris = Table[Chris_pre,{1000}]^tr; Alice, Bob, and Chris are identical matricies computed 3 slightly different ways. I find that Chris is computed 1000 times faster than Alice and Bob. It is not surprising that Alice is computed 1000 times slower because, naively, the function V must be called 1000 more times than when Chris is computed. But it is very surprising that Bob is so slow, since he is computed identically to Chris except that Chris stores the intermediate step Chris_pre. Why does Bob evaluate so slowly? SECOND PROBLEM Suppose I want to compile a function in Mathematica of the form f(x)=x+y where "y" is a constant fixed at compile time (but which I prefer not to directly replace in the code with its numerical because I want to be able to easily change it). If y's actual value is y=7.3, and I define f1=Compile[{x},x+y] f2=Compile[{x},x+7.3] then f1 runs 50% slower than f2. How do I make Mathematica replace "y" with "7.3" when f1 is compiled, so that f1 runs as fast as f2? Many thanks!

    Read the article

  • Debugging problems in Visual Studio 2005 - No source code available for the current location

    - by espais
    Hi all I've searched up and down Google for others with a similar problem, and while I can find the error I don't think that other people have the same base problem that I do. Basically, I had to create a project for a unit-testing environment in order to run this test suite. First, I add my original C file, compile, and then a test file (C++) is generated. I then exclude my original source from the project, include this test script (which includes the original source at the top), and then run. I can debug the test file fine, but when it jumps to the original C file I get the dreaded 'no source code available for the current location' error. Both files are located within the same location, and I compiled the original file without any issue. Anybody have any thoughts about this? Its driving me crazy!

    Read the article

  • WebTest Visual Studio Test problems with amf call

    - by Lieven Cardoen
    If I browse to a flex application when recording with VS Test, I can see the calls to WebORB (amf calls). However, when stopping the recording this is what happens: First, Visual Studio detects dynamic parameters, but stays around 20%, and never gets through it. Second, if I cancel the detecting dynamic parameters, and run the web test, the calls to WebORB (amf calls) do not work. In fact, in VS2010, the call to WebORB stays on Submitting... Now, this web test, does it only record url's and query string variables, or does it record the whole request? If it records the whole request, the call to WebORB should work, but it doesn't.

    Read the article

  • Problems with mod_Rewrite

    - by Giorgi
    Hello, Originally I had following .htaccess file: php_value display_errors 1 php_value error_reporting 7 AddDefaultCharset utf-8 Options -Indexes <Files ~ ".*\.(info|tpl)$"> Order allow,deny Deny from all </Files> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L,QSA] Which triggered 500 internal server error, so I moved first two lines to the php.ini file. after that, error disappeared, but redirect is not working, it simply redirects to the empty page, error log shows: file not found also, another log shows: PHP Warning: Unknown: open_basedir restriction in effect. File() is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp/:/usr/local/:/usr/bin) in Unknown on line 0 I tried to write in RewriteLog which triggered 500 server error again A little help? Thank you in advance P.S. cPanel 11.24.5-STABLE (Build: 38506) Apache version 2.2.15 (Unix) MySQL version 5.0.85-community PHP version 5.2.9 Operating system Linux Apache/2.2.15 (Unix) mod_ssl/2.2.15 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.5

    Read the article

  • Problems with Merb on Snow Leopard

    - by hamhoagie
    I've recently started looking at Merb, for use with some small projects around the office. I'm trying to set up my first project following the docs, and am encountering an exception such as: foo:beta user$ merb Merb root at: /Users/user/code/merb/beta Loading init file from ./config/init.rb Loading ./config/environments/development.rb ~ Connecting to database... ~ Loaded slice 'MerbAuthSlicePassword' ... ~ Parent pid: 39794 ~ Compiling routes... ~ Activating slice 'MerbAuthSlicePassword' ... ~ ~ FATAL: Mongrel is not installed, but you are trying to use it. You need to either install mongrel or a different Ruby web server, like thin. I have installed Mongrel from gem as well as from MacPorts, and am confused by this exception. Significant stats: ruby 1.8.7 (2010-01-10 patchlevel 249) [i686-darwin10] From my installed gems: merb (1.1.0) merb-action-args (1.1.0) merb-assets (1.1.0) merb-auth (1.1.0) merb-auth-core (1.1.0) merb-auth-more (1.1.0) merb-auth-slice-password (1.1.0) merb-cache (1.1.0) merb-core (1.1.0) merb-exceptions (1.1.0) merb-gen (1.1.0) merb-haml (1.1.0) merb-helpers (1.1.0) merb-mailer (1.1.0) merb-param-protection (1.1.0) merb-slices (1.1.0) merb_datamapper (1.1.0) mongrel (1.1.5) Merb documentation is non-existent, so I find myself stuck. Thanks in advance.

    Read the article

  • Problems refreshing DataGridView after database update in VB.NET

    - by Gbolahan
    Dim myQuery = "UPDATE table1 SET data= CONCAT (data,'" & vbCrLf & "[ " & Date.Now() & " ]" & " " & "[" & getCN() & "]" & " " & txtTelenotes.Text & "[ item1 ]" & "') WHERE id='" & txtID.Text & "'" myCommand.Connection = conn myCommand.CommandText = myQuery myAdapter.SelectCommand = myCommand Dim myData As MySqlDataReader myData = myCommand.ExecuteReader() txtTelenotes.Text = "" dgvREcord.Refresh() I tried refreshing the DataGridView using: dgvREcord.Refresh() but it does not load the changes from the database.

    Read the article

  • Const operator overloading problems in C++

    - by steigers
    Hello everybody, I'm having trouble with overloading operator() with a const version: #include <iostream> #include <vector> using namespace std; class Matrix { public: Matrix(int m, int n) { vector<double> tmp(m, 0.0); data.resize(n, tmp); } ~Matrix() { } const double & operator()(int ii, int jj) const { cout << " - const-version was called - "; return data[ii][jj]; } double & operator()(int ii, int jj) { cout << " - NONconst-version was called - "; if (ii!=1) { throw "Error: you may only alter the first row of the matrix."; } return data[ii][jj]; } protected: vector< vector<double> > data; }; int main() { try { Matrix A(10,10); A(1,1) = 8.8; cout << "A(1,1)=" << A(1,1) << endl; cout << "A(2,2)=" << A(2,2) << endl; double tmp = A(3,3); } catch (const char* c) { cout << c << endl; } } This gives me the following output: NONconst-version was called - - NONconst-version was called - A(1,1)=8.8 NONconst-version was called - Error: you may only alter the first row of the matrix. How can I achieve that C++ call the const-version of operator()? I am using GCC 4.4.0. Thanks for your help! Sebastian

    Read the article

  • PHP/JQuery/AJAX, few teething problems...

    - by thebluefox
    Morning/Afternoon guys. Writing some JQuery AJAX shizz and getting a bit stuck. I've got the actual proccess of calling the php file done perfectly, its just trying to get the html on the page to change in a way I want it to. I want to get rid of the a with the id of the one used in the ajax call etc, and replace it with the html passed from the PHP file. Code is as follows... $(".save_places").click(function() { $.ajax({ url: "{/literal}{$sRootPath}{literal}system/ajax/fan_bus.php", type: "POST", data: ({id : this.getAttribute('id')}), dataType: "html", success: function(msg){ $(this).before(msg); $(this).empty(); alert(msg); } }); return false; }); And the HTML is pretty simple; <p class="links"> <a href="#" class="save_places" id="bus_{$businesses.results[bus].id}_{$sMemberDetails.id}"><img src="{$sThemePath}images/save_places.png" alt="Save to My Places" /></a> <a href="#"><img src="{$sThemePath}images/send_friend.png" alt="Send to a Friend" /></a> </p> All the stuff in the success function is experimental mashing of code, any help please? Thanks as always.

    Read the article

  • PriorityQueue update problems

    - by Bharat
    After going through a bunch of questions here on SO, I still have no idea what exactly is going wrong with my code and would appreciate some help. I'm trying to implement a priority queue based on f-costs for an A* algorithm, and while the algorithm works fine for short pathfinding distances, it seems to go wrong when there's an obstacle or when the distance between start and goal points is greater than about 30 squares (although sometimes it screws up for less too). while(!m_qOpenList.isEmpty()) { m_xCurrent=m_qOpenList.poll(); m_xCurrent.setBackground(Color.red); m_qClosedList.add(m_xCurrent); if(m_xCurrent.getStatus()==2) { System.out.println("Target Reached"); solved=true; break; } iX=m_xCurrent.getXCo(); iY=m_xCurrent.getYCo(); for(i=iX-1;i<=iX+1;i++) for(j=iY-1;j<=iY+1;j++) { if(i<0||j<0||i>m_iMazeX||j>m_iMazeX||(i==iX&&j==iY) || m_xNode[i][j].getStatus()==4|| m_qClosedList.contains(m_xNode[i][j])) continue; m_xNode[i][j].score(m_xCurrent,m_xGoal); m_qOpenList.add(m_xNode[i][j]); } } It's quite rudimentary as I'm just trying to get it to work for now. m_qOpenList is the PriorityQueue. The problem is that when I debug the program, at some point (near an obstacle), a Node with a fcost of say 84 has higher priority than a node with an fcost of 70. I am not attempting to modify the values once they're on the priority queue. You'll notice that I add at the end of the while loop (I read somewhere that the priorityqueue reorders itself when stuff is added to it), and poll right after that at the beginning. Status of 2 means the Node is the goal, and a status of 4 means that it is unwalkable. public int compareTo(Node o) { if(m_iF<o.m_iF) return -1; if(m_iF>o.m_iF) return 1; return 0; } And that's the compareTo function. Can you see a problem? =(

    Read the article

  • python c extension, problems with dlopen on mac os

    - by Jason Sundram
    I've taken a library that is distributed as a binary lib (.a) and header, written some c++ code against it, and want to wrap the results up in a python module. I've done this here. The problem is that when importing this module on Mac OSX (I've tried 10.5 and 10.6), I get the following error: dlopen(/Library/Python/2.5/site-packages/dirac.so, 2): Symbol not found: _DisposePtr Referenced from: /Library/Python/2.5/site-packages/dirac.so Expected in: dynamic lookup This looks like symbols defined in the Carbon framework aren't being properly resolved, but I'm not sure what to do about that. I am supplying -framework Carbon to distutil.core.Extension's extra_link_args parameter, so I'm not sure what else I should do. Any help would be much appreciated.

    Read the article

  • Problems with shutting down JBoss in Eclipse if I change JNDI port

    - by Balint Pato
    1st phase I have a problem shutting down my running JBoss instance under Eclipse since I changed the JNDI port of JBoss. Of course I can shut it down from the console view but not with the stop button (it still searches JNDI port at the default 1099 port). I'm looking forward to any solutions. Thank you! Used environment: JBoss 4.0.2 (using default) Eclipse 3.4.0. (using JBoss Tools 2.1.1.GA) Default ports: 1098, 1099 Changed ports: 11098, 11099 I changed the following part in jbosspath/server/default/conf/jboss-service.xml: <!-- ==================================================================== --> <!-- JNDI --> <!-- ==================================================================== --> <mbean code="org.jboss.naming.NamingService" name="jboss:service=Naming" xmbean-dd="resource:xmdesc/NamingService-xmbean.xml"> <!-- The call by value mode. true if all lookups are unmarshalled using the caller's TCL, false if in VM lookups return the value by reference. --> <attribute name="CallByValue">false</attribute> <!-- The listening port for the bootstrap JNP service. Set this to -1 to run the NamingService without the JNP invoker listening port. --> <attribute name="Port">11099</attribute> <!-- The bootstrap JNP server bind address. This also sets the default RMI service bind address. Empty == all addresses --> <attribute name="BindAddress">${jboss.bind.address}</attribute> <!-- The port of the RMI naming service, 0 == anonymous --> <attribute name="RmiPort">11098</attribute> <!-- The RMI service bind address. Empty == all addresses --> <attribute name="RmiBindAddress">${jboss.bind.address}</attribute> <!-- The thread pool service used to control the bootstrap lookups --> <depends optional-attribute-name="LookupPool" proxy-type="attribute">jboss.system:service=ThreadPool</depends> </mbean> <mbean code="org.jboss.naming.JNDIView" name="jboss:service=JNDIView" xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml"> </mbean> Eclipse setup: About my JBoss Tools preferences: I had a previous version, I got this problem, I read about some bugfix in JbossTools, so updated to 2.1.1.GA. Now the buttons changed, and I've got a new preferences view, but I cannot modify anything...seems to be abnormal as well: Error dialog: The stacktrace: javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572) at javax.naming.InitialContext.lookup(InitialContext.java:347) at org.jboss.Shutdown.main(Shutdown.java:202) Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370) ... 4 more Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228) ... 5 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:211) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62) at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224) ... 5 more Exception in thread "main" 2nd phase: After creating a new Server in File/new/other/server, it did appear in the preferences tab. Now the stop button is working (the server receives the shutdown messages without any additional modification of the jndi port -- there is no opportunity for it now) but it still throws an error message, though different, it's without exception stack trace: "Server JBoss 4.0 Server failed to stop."

    Read the article

  • SDK Setup Problems

    - by ramesh
    Hi, Im new to android and am just trying to install the SDK. I have everything else done. When i run the SDK Setup.exe (ive added the ./tools to the path already.) It gives me the famous cannot fetch URL error. Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: Permission denied: connect I tried the force http option and also manually adding a http:// version of the above url. It does not work at all. I am working on a windows 7 64 bit pc. Any help would be appreciated. Ramesh

    Read the article

  • Weird problems with ruby servers on Ubuntu 9.10

    - by brianthecoder
    So I'm using Ubuntu 9.10, trying to setup and deploy my app, but for some reason, whenever I try and boot up thin, it tells me it can't find rails, script/console, however, works fine. Heck, even script/server works fine as long as I don't try and daemonize it, then it just fails without any errors. Any ideas on what the hell is going on? I'm using rvm with the default ubuntu ruby as my system ruby. I have set REE as the default ruby though. This was still happening back when I had only REE installed via their installer script too.

    Read the article

  • Oracle performance problems with large batch of XSL operations

    - by FrustratedWithFormsDesigner
    I have a system that is performing many XSL transformations on XMLType objects. The problem is that the system gradually slows down over time, and sometimes crashes when it runs out of memory. It seems that the slow down (and possibly memory crash) is around the dbms_xslprocessor.processXSL function call, which gradually takes longer and longer to complete. The code looks like this: v_doc dbms_xmldom.DOMDocument; v_transformer dbms_xmldom.DOMDocument; v_XSLprocessor dbms_xslprocessor.Processor; v_stylesheet dbms_xslprocessor.Stylesheet; v_clob clob; ... transformer := PKG_STUFF.getXSL(); v_transformer := dbms_xmldom.newDOMDocument(transformer); v_XSLprocessor := Dbms_Xslprocessor.newProcessor; v_stylesheet := dbms_xslprocessor.newStylesheet(v_transformer, ''); ... for source_data in (select id in source_tbl) loop begin v_doc := PKG_CONVERT.convert(in_id => source_data.id); --start time of operation v_begin_op_time := dbms_utility.get_time; --reset the CLOB v_clob := ' '; --Apply XSL Transform dbms_xslprocessor.processXSL(p => v_XSLprocessor, ss => v_stylesheet, xmldoc => v_Doc, cl => v_clob); v_doc := dbms_xmldom.newDOMDocument(XMLType(v_clob)); --end time v_end_op_time := dbms_utility.get_time; --calculate duration v_time_taken := (((v_end_op_time - v_begin_op_time))); --log the duration PKG_LOG.log_message('Time taken to transform XML: '||v_time_taken); ... ... DBMS_XMLDOM.freeDocument(v_Doc); DBMS_LOB.freetemporary(lob_loc => v_clob); end loop; The time taken to transform the XML is slowly creeping up (I suppose it might also be the call to dbms_xmldom.newDOMDocument, but I had thought that to be fairly straightforward). I have no idea why.... :( (Oracle 10g)

    Read the article

  • Problems with umlauts in python appdata environvent variable

    - by Heike
    Hi, I can't find a correct way to get the environment variable for the appdata path in python. The problem is that my user name includes special characters (the german ae and ue). I made a workaround wit PyQt for Vista and Windows 7 but it doesn't work for XP Systems. Does anybody know the correct encoding of these environment variables or another solution for this problem? Greetz

    Read the article

  • Problems running rails server

    - by harristrader
    I just installed the rails env using the Rails installer on my Mac OSX 10.7.4. I create a project using the "rails new" command. When I try to run the "rails server" command I get this message: /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/rails_generator/options.rb:32:in `default_options': undefined method `write_inheritable_attribute' for Rails::Generator::Base:Class (NoMethodError) from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/rails_generator/base.rb:90:in `<class:Base>' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/rails_generator/base.rb:85:in `<module:Generator>' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/rails_generator/base.rb:48:in `<module:Rails>' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/rails_generator/base.rb:6:in `<top (required)>' from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/lib/rails_generator.rb:37:in `<top (required)>' from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require' from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rails-2.3.14/bin/rails:15:in `<top (required)>' from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/rails:23:in `load' from /usr/local/rvm/gems/ruby-1.9.3-p194/bin/rails:23:in `<main>' When I run the $ ruby -v and $ gem -v, I get "ruby 1.9.3p194" and "1.8.24" respectively. What am I missing here? How can I get this server to run?

    Read the article

  • Problems with Routing URLs using CGI and Bottle.py

    - by Risingson
    I've been having difficulty getting anything more than a simple index / to return correctly using bottle.py in a CGI environment. When I try to return /hello I get a 404 response. However, if I request /index.py/hello import bottle from bottle import route @route('/') def index(): return 'Index' @route('/hello') def hello(): return 'Hello' if __name__ == '__main__': from wsgiref.handlers import CGIHandler CGIHandler().run(bottle.default_app()) And here is my .htaccess file DirectoryIndex index.py <ifmodule mod_rewrite.c=""> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ /index.py/$1 [L] </ifmodule> I copied much of the code from here as I'm using DH and it seemed relevant: http://blog.coderonfire.com/2010/02/running-bottle-python-micro-framework.html Thanks for helping.

    Read the article

  • php xpath problems

    - by Phill Pafford
    I'm doing a cURL POST and get the error response back, parse it into an array but having issues with xpath now. // XML <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <errors xmlns="http://host/project"> <error code="30" description="[] is not a valid email address."/> <error code="12" description="id[] does not exist."/> <error code="3" description="account[] does not exist."/> <error code="400" description="phone[] does not exist."/> </errors> // Function / Class class parseXML { protected $xml; public function __construct($xml) { if(is_file($xml)) { $this->xml = simplexml_load_file($xml); } else { $this->xml = simplexml_load_string($xml); } } public function getErrorMessage() { $in_arr = false; $el = $this->xml->xpath("//@errors"); $returned_errors = count($el); if($returned_errors > 0) { foreach($el as $element) { if(is_object($element) || is_array($element)) { foreach($element as $item) { $in_arr[] = $item; } } } } else { return $returned_errors; } return $in_arr; } } // Calling function // $errorMessage is holding the XML value in an array index // something like: $arr[3] = $xml; $errMsg = new parseXML($arr[3]); $errMsgArr = $errMsg->getErrorMessage(); What I would like is all the error code and description attribute values

    Read the article

  • asp.net rangevalidator for calendar extender entries gives problems in safari

    - by Robin Baralla
    Hi there, I have the following scenario: arrival and departure dates have to be selected on a form, through 2 textboxes with a calendar extender each. I validate the entries to check that no date before today is selected and to check that the departure is after the arrival. I used a rangevalidator and a comparevalidator. In IE, Firefox and Opera it is working fine, in Safari (on windows) however both the validators go off even on entries that should be accepted. It makes me suspect that the date format dd/MM/yyyy causes trouble for Safari. (the dd/MMMM/yyyy also gave the same troubles in the other browsers, probably due to the dependency on UIculture) The code is:   The range validator gets its values in code behind on Page_load RangeValidator1.MinimumValue = DateTime.Now.AddDays(1).ToShortDateString(); RangeValidator1.MaximumValue = DateTime.Now.AddMonths(12).ToShortDateString(); Does anybody have any suggestions on how to solve this problem with safari? best regards, Robin

    Read the article

  • Problems doing asynch operations in C# using Mutex.

    - by firoso
    I've tried this MANY ways, here is the current iteration. I think I've just implemented this all wrong. What I'm trying to accomplish is to treat this Asynch result in such a way that until it returns AND I finish with my add-thumbnail call, I will not request another call to imageProvider.BeginGetImage. To Clarify, my question is two-fold. Why does what I'm doing never seem to halt at my Mutex.WaitOne() call, and what is the proper way to handle this scenario? /// <summary> /// re-creates a list of thumbnails from a list of TreeElementViewModels (directories) /// </summary> /// <param name="list">the list of TreeElementViewModels to process</param> public void BeginLayout(List<AiTreeElementViewModel> list) { // *removed code for canceling and cleanup from previous calls* // Starts the processing of all folders in parallel. Task.Factory.StartNew(() => { thumbnailRequests = Parallel.ForEach<AiTreeElementViewModel>(list, options, ProcessFolder); }); } /// <summary> /// Processes a folder for all of it's image paths and loads them from disk. /// </summary> /// <param name="element">the tree element to process</param> private void ProcessFolder(AiTreeElementViewModel element) { try { var images = ImageCrawler.GetImagePaths(element.Path); AsyncCallback callback = AddThumbnail; foreach (var image in images) { Console.WriteLine("Attempting Enter"); synchMutex.WaitOne(); Console.WriteLine("Entered"); var result = imageProvider.BeginGetImage(callback, image); } } catch (Exception exc) { Console.WriteLine(exc.ToString()); // TODO: Do Something here. } } /// <summary> /// Adds a thumbnail to the Browser /// </summary> /// <param name="result">an async result used for retrieving state data from the load task.</param> private void AddThumbnail(IAsyncResult result) { lock (Thumbnails) { try { Stream image = imageProvider.EndGetImage(result); string filename = imageProvider.GetImageName(result); string imagePath = imageProvider.GetImagePath(result); var imageviewmodel = new AiImageThumbnailViewModel(image, filename, imagePath); thumbnailHash[imagePath] = imageviewmodel; HostInvoke(() => Thumbnails.Add(imageviewmodel)); UpdateChildZoom(); //synchMutex.ReleaseMutex(); Console.WriteLine("Exited"); } catch (Exception exc) { Console.WriteLine(exc.ToString()); // TODO: Do Something here. } } }

    Read the article

  • Problems installing Moose on Mac (compile Sub::Name prereq)

    - by Leonard
    I'm trying to install Moose (a CPAN module) on my Macbook Pro. It finds a dependency on Sub-Name, and when it tries to install this, gets the following error messages. Any idea as to how I can cure this? XMATH/Sub-Name-0.04.tar.gz^M /usr/bin/make -- OK^M Running make test^M PERL_DL_NONLAZY=1 /opt/local/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t^M t/smoke....Can't load '/private/var/root/.cpan/build/Sub-Name-0.04-ziHbmm/blib/arch/auto/Sub/Name/Name.bundle' for module Sub::Name: dlopen(/private/var/root/.cpan/build/Sub-Name-0.04-ziHbmm/blib/arch/auto/Sub/Name/Name.bundle, 2): no suitable image found. Did find:^M /private/var/root/.cpan/build/Sub-Name-0.04-ziHbmm/blib/arch/auto/Sub/Name/Name.bundle: mach-o, but wrong architecture at /opt/local/lib/perl5/5.8.9/darwin-2level/DynaLoader.pm line 230.^M at t/smoke.t line 6^M Compilation failed in require at t/smoke.t line 6.^M

    Read the article

  • SVN problems after migration with CVS2SVN

    - by Bjorn C
    We´ve migrated from CVS on AIX to SVN on Linux via CVS2SVN. The migration seems to have went well but when working in SVN we get a lot of Tree Conflicts that doesn´t seem to be conflicts at all? Looking at the revision graphs, one can see that the graph for e.g. trunk and a branch isn´t the same, i.e. they contain different sets of revisions of the file. Either of the 3 ways to resolve this conflict when merging in TortoiseSVN leaves the revision graphs separate, they cannot be "melted" together. Could it be that CVS2SVN didn´t understand that a file in different branches is the same even if the file system path is the same? Anyone who has experienced this? Thanks, Bjorn

    Read the article

  • Django-pyodbc mssql/freetds server connection problems on linux

    - by wizard
    Error: ('IM002', '[IM002] [unixODBC][Driver Manager]Data source name not found, and no default driver specified (0) (SQLDriverConnectW)') I'm migrating from developing on a windows development machine to linux machine in production and I'm having issues with the freetds driver. As far as I can tell that error message means it can't find the driver. I can connect via the cli via sqsh and tsql. I've setup my settings.py as such. 'bc2db': { 'ENGINE': 'sql_server.pyodbc', 'NAME': 'DataTEST', 'USER': 'appuser', 'PASSWORD': 'PASS', 'HOST': 'bc2.domain.com', 'options': { 'driver': 'FreeTDS', } }, Does anyone have any mssql experience with djano? do I have to use a dns? (how would I format that?) Thanks

    Read the article

  • Android fragments problems different layouts

    - by juan
    I have two layouts: one for portait with one container and another for landscape with two containers. In the first layout I show a fragment and when the user select one element, I replace the fragment with another (with FragmentTransation.Replace). <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:id="@+id/container1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" /> </RelativeLayout> In the second layout I want to show the two fragments at one time, one in the first container and the second in the second container. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" > <LinearLayout android:id="@+id/container1" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="3" android:orientation="vertical" /> <LinearLayout android:id="@+id/container2" android:layout_width="0dp" android:layout_height="match_parent" android:layout_weight="7" android:orientation="vertical" /> </LinearLayout> But I can't make this works with configuration changes. I try use different names for containers, try add fragments when only bundle is null,... Someone have a working code of this case?

    Read the article

  • SSH Chown problems

    - by Michael
    I have a webserver with multiple domain and user accounts setup. Recently I renamed one of the domain names and changed it's username correspondingly. However, this new user cannot access the data from the domain because it does not have the required permissions. How can I solve this problem? I've tried chown and I still cannot get access to the files. I have SSH root access and this is the only way I can actually move/touch the files but the webserver displays the file through another username which does not have access to the files. Thanks

    Read the article

< Previous Page | 68 69 70 71 72 73 74 75 76 77 78 79  | Next Page >