Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

Page 96/604 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • flash cs4 file reference. Event.COMPLETE not called on a MAC,

    - by jobbie jones
    Hi, I am working with a fileReference, however I'm having issues running on Safari on a MAC... EDIT The below example also doesnt work on Safari on a MAC... http://www.permadi.com/blog/2010/06/flash-as3-using-filereference-to-load-files-example-for-flash-cs4-and-above/ # The workflow on a PC runs as such: 1) Create file reference 2) attach addEventListener's for Event.SELECT and Event.COMPLETE 3) call the browse() method On a PC, Event.SELECT is fired when a file has been selected. Event.COMPLETE is fired when the file data is available to flash. If I select an 500meg file, it takes a few seconds before Event.COMPLETE is fired. If I attempt to access the file data properties (such as reading the data stream) before Event.COMPLETE is fired, I receive null reference errors... So far so good. However, on a MAC (speficially Safari, not tested other browsers), the Event.COMPLETE is not fired. I have checked the Adobe docs, which say Event.COMPLETE is fired when the upload is completed. So why does it get fired on windows when the fileReference has parsed the file, but the upload method has not yet been called... Can anyone help? Here's snippets of the code I am working on: public function browseFile(target:Object):void { var imagesFilter:FileFilter = new FileFilter("Allowed files", "*.jpg;*.bmp;*.flv;"); fileReference.browse([imagesFilter]); fileReference.addEventListener(Event.SELECT, fileSelect); fileReference.addEventListener(Event.COMPLETE, fileSelectComplete); } private function fileSelect(event:Event):void { // update label - IMPORTANT for large files as there's a delay while flash parses file, before control is handed back to this script... setStatusLabel("...loading file"); var fileReference:FileReference = event.target as FileReference; fileReference.addEventListener(Event.COMPLETE, fileSelectComplete); // load the file into the fileReference object fileReference.load(); } // Called when upload file has been processed by flash (a few secs for large files, or fileRef.data is null...) private function fileSelectComplete(event:Event):void { var fileReference:FileReference=event.target as FileReference; trace("ready to do things - but not fired on Safari on a MAC "); }

    Read the article

  • JNI cached jclass global reference variables being garbage collected?

    - by bubbadoughball
    I'm working in the JNI Invocation API, calling into Java from C. I have some upfront initialization to cache 30+ Java classes into global references. The results of FindClass are passed into NewGlobalRef to acquire a global reference to the class. I'm caching these class variables to reuse them later. I have 30+ global references to classes (and 30+ global methodIDs for the class constructors). In the following sample, I've removed exception handling as well as JNI invocation for the purpose of shortening the code snippet. My working code has exception checks after every JNI call and I'm running with -Xcheck:jni. Here's the snippet: jclass aClass; jclass bClass; jmethodID aCtor; jmethodID bCtor; void getGlobalRef(const char* clazz, jclass* globalClass) { jclass local = (*jenv)->FindClass(jenv,clazz); if (local) { *globalClass = (jclass) (*jenv)->NewGlobalRef(jenv,local); (*jenv)->DeleteLocalRef(jenv,local); } } methodID getMethodID(jclass clazz, const char* method, const char* sig) { return (*jenv)->GetMethodID(jenv,clazz,method,sig); } void initializeJNI() { getGlobalRef("MyProj/Testclass1", &aclass); getGlobalRef("MyProj/Testclass2", &bclass); . . aCtor = getMethodID(aclass,"<init>","()V"); bCtor = getMethodID(bclass,"<init>","(I)V"); } The initializeJNI() function sets the global references for jclasses and method IDs for constructors as well as some jfieldID's and some initialization of C data structures. After initialization, when I call into a JNI function using some of the cached jclasses and ctor jmethodIDs, I get a bad global or local reference calling reported from the -Xcheck:jni. In gdb, I break at the last line of initializeJNI(), and print all jclasses and jmethodIDs and the ones causing problems look to have been turned into garbage or garbage-collected (i.e. 0x00 or 0x06). Is it possible for global references to be gc'ed? Any suggestions?

    Read the article

  • When should I add a file reference to a Delphi project ?

    - by Roland Bengtsson
    Unit files for standard VCL files like Dialogs, StringUtils etc is never referenced in a projects DPR-file. But when should I add a reference to the DPR-file ? Now I have own sourcefiles and source of own components. What about source files for Ravereport, Devexpress, Indy, Gnostice etc ? I want as fast codeinsight as possible, but of course I do not want to add bloat to the DPR-file. I use Delphi 2007 Regards

    Read the article

  • Resetting a partial using RJS, and passing an instance variable?

    - by Elliot
    Hey guys here is my code (roughly): books.html.erb <% @books.each do |book| %> <% @bookid = book.id %> <div id="enter_stuff"> <%= render "input", :bookid => @bookid %> </div> <%end%> _input.html.erb <% @book = Book.find_by_id(@bookid) %> <strong>your book is: <%=h @book.name %></strong> create.rjs page.replace_html :enter_stuff, :partial => 'input2', :object => @bookid Only create.js doesn't seem to work though, if instead of passing the partial I passed "..." it does work, so I know its that there are instance variables in the partial that aren't being reset. Any ideas?

    Read the article

  • How do I get a slice from an array reference?

    - by Sachin
    Let us say that we have following array: my @arr=('Jan','Feb','Mar','Apr'); my @arr2=@arr[0..2]; How can we do the same thing if we have array reference like below: my $arr_ref=['Jan','Feb','Mar','Apr']; my $arr_ref2; # How can we do something similar to @arr[0..2]; using $arr_ref ?

    Read the article

  • Why are static classes considered “classes” and “reference types”?

    - by Timwi
    I’ve been pondering about the C# and CIL type system today and I’ve started to wonder why static classes are considered classes. There are many ways in which they are not really classes: A “normal” class can contain non-static members, a static class can’t. In this respect, a class is more similar to a struct than it is to a static class, and yet structs have a separate name. You can have a reference to an instance of a “normal” class, but not a static class (despite it being considered a “reference type”). In this respect, a class is more similar to an interface than it is to a static class, and yet interfaces have a separate name. The name of a static class can never be used in any place where a type name would normally fit: you can’t declare a variable of this type, you can’t use it as a base type, and you can’t use it as a generic type parameter. In this respect, static classes are somewhat more like namespaces. A “normal” class can implement interfaces. Once again, that makes classes more similar to structs than to static classes. A “normal” class can inherit from another class. It is also bizarre that static classes are considered to derive from System.Object. Although this allows them to “inherit” the static methods Equals and ReferenceEquals, the purpose of that inheritance is questionable as you would call those methods on object anyway. C# even allows you to specify that useless inheritance explicitly on static classes, but not on interfaces or structs, where the implicit derivation from object and System.ValueType, respectively, actually has a purpose. Regarding the subset-of-features argument: Static classes have a subset of the features of classes, but they also have a subset of the features of structs. All of the things that make a class distinct from the other kinds of type, do not seem to apply to static classes. Regarding the typeof argument: Making a static class into a new and different kind of type does not preclude it from being used in typeof. Given the sheer oddity of static classes, and the scarcity of similarities between them and “normal” classes, shouldn’t they have been made into a separate kind of type instead of a special kind of class?

    Read the article

  • What types of objects should the ViewModel reference in the MVVM pattern?

    - by Blanthor
    I've seen quite a few examples of MVVM. I can see that the View should reference the ViewModel. I've seen recently an example of a ViewModel referencing a View, which seems wrong to me, as it would result in tighter coupling. Given that ViewModel is often described as an intermediary between the View and the Model, is there more to the ViewModel than a facade to domain objects? I hope I used the term "facade" correctly here.

    Read the article

  • Is passing a Command object/Reader to a function a good idea?

    - by Cyril Gupta
    I've been getting some inexplicable errors (running out of connections from the connection pool) with MySql database with .Net 4 (C#). Till now all my attempts at finding a reason for this have been in vain. Now I also have a situation in which a lock on a table is not cleared for a long time even though all I have been doing is read operations from it. My code looks okay (I've put all readers and connections in using blocks). The only anomaly I have is that I've been passing MySqlCommand and MySqlDataReader objects as parameters to functions who work with them. That doesn't seem like a bad idea for me because it avoids some repetition (DRY!). But since I can't find any other explanation I have to suspect that this is causing the problem. What do you think?

    Read the article

  • Passing array to function with pointer loses array size information!

    - by Narek
    If I write int main() { int a[100] = {1,2,3,4,}; cout<<sizeof(a)/sizeof(a[0])<<endl; return 0; } I get 400! If I write void func(int *a); int main() { int a[100] = {1,2,3,4,}; func(a); return 0; } void func(int *a) { cout<<sizeof(a)/sizeof(a[0])<<endl; } Then I get 400! So why passing array to function with pointer loses array size information?

    Read the article

  • Any reason why I shouldn't use couchdb for message passing or realtime activity streams?

    - by Up
    While using ampq or xmpp (rabbitmq or ejabbered that could have couchdb as backends) seems like a good fit to deliver real time updates about friend state in a social gaming platform where updates are small but frequent, I can't help but think why wouldn't couchdb be a good platform to deliver such updates? The main advantage I could think of is its ability to filter updates based on friends and availability of changes api, which makes developing such an application and managing it (including replication) quite easy compared to ampq or xmpp where you have to think about how to manage the pubsub nodes and who is subscribed to them at any point in time. However, I can't help but think this is too good to be true, I can't find information on what couchdb's shortcomings are. Somehow, it feels like using MySQL for message passing which is why I am hesitant to using it. Anyone have any experience in using couchdb for such applications? would you recommend another platform to use?

    Read the article

  • Passing along variable inside link works only on first word in multiple-word-variables, why?

    - by Camran
    I have this code below. As you can see I am passing two variables along with the link. The second variabye (category) works whenever it consists of one word, but some categories are two words or more, and then on the receiving php page where I fetch the variable only the first word is fetched. Any ideas? Example: I pass along this: Rims & Tires Only this comes through: Rims $display_table .= "<a href='../ad.php?ad_id=$row[ad_id]&category=$row[category]' target='_parent'>"; Here is how I fetch it in the receiving php file (which the link is to): $cat = $_GET['category']; echo $cat; //displays only first word of multiple word categories. Thanks

    Read the article

  • Open source equivelants to VS / web reference proxy class autogen?

    - by seraphym
    As an ASP.NET developer, I'm used to working with how VS/C# transparently autogens proxy classes for web references (yes, I know, we're spoiled), but now that I'm creating documentation for more than one coding platform I'm trying to discover what the equivelant to that is in any other framework. So is there a similar way to work transparently with web reference proxy classes for say, RoR, PHP, and Python? And if there's nothing integrated, are there tools you recommend to autogen the proxy classes, or do you recommend to roll custom classes?

    Read the article

  • Open source equivelants to VS / web reference proxy classes?

    - by seraphym
    As an ASP.NET developer, I'm used to working with how VS/C# transparently autogens proxy classes for web references (yes, I know, we're spoiled), but now that I'm creating documentation for more than one coding platform I'm trying to discover what the equivelant to that is in any other framework. So is there a similar way to work transparently with web reference proxy classes for say, RoR, PHP, and Python? And if there's nothing integrated, are there tools you recommend to autogen the proxy classes, or do you recommend to roll custom classes?

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >