Search Results

Search found 23968 results on 959 pages for 'tail call'.

Page 87/959 | < Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >

  • How do I call a function name that is stored in a hash in Perl?

    - by Ether
    I'm sure this is covered in the documentation somewhere but I have been unable to find it... I'm looking for the syntactic sugar that will make it possible to call a method on a class whose name is stored in a hash (as opposed to a simple scalar): use strict; use warnings; package Foo; sub foo { print "in foo()\n" } package main; my %hash = (func => 'foo'); Foo->$hash{func}; If I copy $hash{func} into a scalar variable first, then I can call Foo->$func just fine... but what is missing to enable Foo->$hash{func} to work? (EDIT: I don't mean to do anything special by calling a method on class Foo -- this could just as easily be a blessed object (and in my actual code it is); it was just easier to write up a self-contained example using a class method.) EDIT 2: Just for completeness re the comments below, this is what I'm actually doing (this is in a library of Moose attribute sugar, created with Moose::Exporter): # adds an accessor to a sibling module sub foreignTable { my ($meta, $table, %args) = @_; my $class = 'MyApp::Dir1::Dir2::' . $table; my $dbAccessor = lcfirst $table; eval "require $class" or do { die "Can't load $class: $@" }; $meta->add_attribute( $table, is => 'ro', isa => $class, init_arg => undef, # don't allow in constructor lazy => 1, predicate => 'has_' . $table, default => sub { my $this = shift; $this->debug("in builder for $class"); ### here's the line that uses a hash value as the method name my @args = ($args{primaryKey} => $this->${\$args{primaryKey}}); push @args, ( _dbObject => $this->_dbObject->$dbAccessor ) if $args{fkRelationshipExists}; $this->debug("passing these values to $class -> new: @args"); $class->new(@args); }, ); } I've replaced the marked line above with this: my $pk_accessor = $this->meta->find_attribute_by_name($args{primaryKey})->get_read_method_ref; my @args = ($args{primaryKey} => $this->$pk_accessor); PS. I've just noticed that this same technique (using the Moose meta class to look up the coderef rather than assuming its naming convention) cannot also be used for predicates, as Class::MOP::Attribute does not have a similar get_predicate_method_ref accessor. :(

    Read the article

  • Make a final call to the Database when user leaves website (ASPX)?

    - by Jisaak
    I have a system set up to lock certain content in a database table so only one user can edit that content at a time. Easy enough and that part is working fine. But now I'm at a road block of how to send a request to "unlock" the content. I have the stored procedure to unlock the content, but how/where would I call it when the user just closes their browser?

    Read the article

  • Are there any programmable barcode scanners that can call a webservice?

    - by Mark Redman
    I am looking at integrating a C# application with a barcode scanner. The last time I did this was with Delphi 1 (win 3.11) using a scanner that plugged in-line into the keyboard cable. Looking around it appears most scanners are USB based these days and assume they emulate keyboard entry. Anybody know of more sophisticated/programmable scanner that can call a webservice or even just do a basic POST/GET this would eliminate the C# application and the computer to support it?

    Read the article

  • Do I have to call release on an objective-c retain class variable when setting it to a new object?

    - by Andrew Arrow
    Say I have: @property (nonatomic,retain) NSString *foo; in some class. And I call: myclass.foo = [NSString stringWithString:@"string1"]; myclass.foo = [NSString stringWithString:@"string2"]; Should I have called [myclass.foo release] before setting it to "string2" to avoid a memory leak? Or the fact that nothing is pointing to the first "string1" object anymore is good enough? And in the dealloc method [foo release] will be called.

    Read the article

  • Can XCode draw the call graph of a program?

    - by Werner
    Hi, I am new to Mac OSX, and I wonder if Xcode can generate , for a given C++ source code, the call graph of the program in a visual way. I also wonder if for each function, and after a run, whether it can also print the %time spent on the function If so, I would thank really some links with tutorials or info, after googling I did not find anything relevant Thanks

    Read the article

  • how to call a javascript fucntion from an included javacript file using GWT?

    - by subh
    I have a function Load() in a js file which I added to the GWT module. I am trying to call it using private static native void load() /*-{ $doc.Load(); }-*/; but it gives me error like Error(s) occurred! (TypeError): $doc.Load is not a function fileName: http://localhost:8888/myapp/888C05FB242806B071A932498F6B5AD9.cache.html lineNumber: 1224 I even tried with $wnd.Load() What the proper way of calling it?

    Read the article

  • Is there a jquery plugin for table paginnation and sorting support via ajax call?

    - by Ethan
    I am looking for a jquery plugin for table paginnation and sorting (and search/filtering hopefully). Datasource could be obtained locally or via ajax call. Hopefully comes with most of the features of this script: http://www.leigeber.com/2009/11/advanced-javascript-table-sorter/ Here is the demo of this script: http://sandbox.leigeber.com/tinytablev3/index.html The problem with this script is that it only support local datasource.

    Read the article

  • Can I Call a Child Page From a Master Page?

    - by MemphisDeveloper
    My problem is this I have a base page that creates content dynamically. There are buttons on my Master Page that fire events that my base page needs to know about. But the OnLoad function on my base page fires before my Button_Command function on my master page. So I either need to figure out a way to load my base page after the Button_Command function has had the chance to set a variable or I must call a function in my base page from the Button_Command function.

    Read the article

  • call a python function in another class from a class?

    - by user3527697
    hi i'am begginer in pYthon and openerp , i want to call a function exists in another class for example: i have 2 class : class a: def notif_personne_event(self, cr, uid,ids,context=None): and import a class b: notifier(self, cr, uid,ids,context=None): self.notifiernotif_personne_event() but when i do this an error is displayed telling me that class b have not an attribute notifiernotif_personne_event() someone help me please

    Read the article

  • javax.crypto AES encryption - Do I only need to call doFinal?

    - by Spines
    I want to do AES CBC encryption in Java. I'm using javax.crypto. After I have the Cipher initialized, do I only need to call doFinal on the clear bytes to properly encrypt it? Or do I need to do something with update? Documentation says update: Continues a multiple-part encryption or decryption operation and doFinal Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation what exactly do they mean by multiple-part encryption?

    Read the article

  • I can't get ExternalInterface.addCallback to work - trying to call an AS3 function from a js button

    - by Guillaume Riesen
    I'm trying to use ExternalInterface.addCallback to allow js to call an as3 method. My code is as follows: AS: ExternalInterface.addCallback("sendToActionscript", callFromJavaScript); function callFromJavaScript():void{ circle_mc.gotoAndStop("finish"); } JS: Switch to square function callToActionscript() { flashController = document.getElementById("jstoactest") flashController.sendToActionscript(); } It's not working. What am I doing wrong?

    Read the article

< Previous Page | 83 84 85 86 87 88 89 90 91 92 93 94  | Next Page >