methods

iPhone XCode debugger 'print' of method calls returns (IMP) pointers instead of printing return value

Whenever I try to print the return value of a method in my XCode gdb console (and in the value formatters), I keep getting (IMP) pointers instead of the return value. For example: print [alternateDepartures count] $9 = (IMP) 0x33725441 <-[NSCFArray count]+1> here, alternateDepartures is an NSArray of ints, as evidenced by: (gdb) po al...

[JQUERY/PHP] Sending and using POST variables using jQuery.ajax()

Is it possible to access $_POST variables without appending all the form elements into the data attribute? Ajax call: $.ajax({ type: "POST", url: "ajax/user.php", data: {**data**}, success: this.saveUserResponse }); Accessing variables: if(isset($_POST['saveUser']) && $_POST['saveUser']){ $user = $...

Is a emmulating a form submittal possible with PHP?

Using PHP can you create a pseudo form submit without ever generating a form? Just initialize and declare variables and them pass them to another page via the POST or GET methods? ...

Something similar to while(!kbhit)(in c++) in ruby??

I want to continue with a process unless a keyboard key has been pressed... One method is injecting the C++ code but thats ugly... Is there any other method to do the same? ...

General FRAMEWORK learning methodology

I just wanted to hear on the different general learning paths people embark on when learning a new language/framework. The one I currently use, which is how I learned Bash and am currently learning Python, is: instant hacking tutorial (very short tutorial introducing the basic syntax, variable declaration, loops, data types, etc. and ...

Using the masters method

On my midterm I had the problem: t(n) = 8T(n/2) +n^3 and I am supposed to find its big theta notation using either the masters or alternative method. So what i did was a = 8, b = 2 k = 3 log8 (base 2) = 3 = k therefore, T(n) is big theta n^3. I got 1/3 points so i must be wrong. What did I do wrong? ...

How to queue and call actual methods (rather than immediately eval) in java?

There are a list of tasks that are time sensitive (but "time" in this case is arbitrary to what another program tells me - it's more like "ticks" rather than time). However, I do NOT want said methods to evaluate immediately. I want one to execute after the other finished. I'm using a linked list for my queue, but I'm not really sure how...

Using an IBAction method when it is not called from an action?

Are there any issues when using IBAction when it is not actually called from a user's action? If you have an action like -(IBAction)sayHello:(id)sender; You can call it from within your class like: [self sayHello:@"x"] The @"x" doesn't do anything, it just fills in for the sender. You can actually create an IBAction method withou...

constructor function's object literal returns toString() method but no other method

I'm very confused with javascript methods defined in objects and the "this" keyword. In the below example, the toString() method is invoked when Mammal object instantiated: function Mammal(name){ this.name=name; this.toString = function(){ return '[Mammal "'+this.name+'"]'; } } var someAnimal = new Mammal('Mr. Biggles'); alert...

How to use a method with more than one parameters to create custom buttons

I am repeating my codes few times to create custom buttons, I am trying to create a method and create all my required buttons just by called that method and using two parameters, btnTitle and btnAction. My Codes for the method -(void) addnewButton:(NSString *) btnTitle withAction:UIAction btnAction; { // Add a custom edit navigati...

Magic Methods in Python

Howdy, I'm kind of new to Python and I wonder if there is a way to create something like the magic methods in PHP (http://www.php.net/manual/en/language.oop5.overloading.php#language.oop5.overloading.methods) My aim is to ease the access of child classes in my model. I basically have a parent class that has n child classes. These class...

VSC++, virtual method at bad adress, curious bug

Hello, This guy: virtual phTreeClass* GetTreeClass() const { return (phTreeClass*)m_entity_class; } When called, crashed the program with an access violation, even after a full recompile. All member functions and virtual member functions had correct memory adresses (I hovered mouse over the methods in debug mode), but this function h...

Is it possible to call on a Java-method from JavaScript in Java6 1.6 script-engine?

I would like to call on an own Java-method from a JavaScript-file via the ScriptEngineManager provided in Java 1.6. Is that possible? ...

Method in RootViewController not Storing Array

I have an array initialized in my RootViewController and a method that addsObjects to an array. I created a RootViewController object in my SecondViewController. The method runs (outputs a message) but it doesn't add anything to the array, and the array seems empty. Code is below, any suggestions? RootViewController.h #import "RootVi...

Logic: Best way to sample & count bytes of a 100MB+ file

Let's say I have this 170mb file (roughly 180 million bytes). What I need to do is to create a table that lists: all 4096 byte combinations found [column 'bytes'], and the number of times each byte combination appeared in it [column 'occurrences'] Assume two things: I can save data very fast, but I can update my saved data very slo...

Is it possible to restrict how a method can be called in PHP?

Given that my class looks like this: class Methods{ function a(){ return 'a'; } function b(){ $this->a(); } function c(){ $this->a(); } } Is it possible to ensure that function a can only be called from function b? In the above example function c should fail. I could just incl...

Passing Args to Clojure from Java

I would like to embed Clojure code into Java. This site was helpful in the basics of setting this up, but the only arg it ever passes is of type String. I have tried using ints as well, and those also work. My question is whether there is some formatted way to pass in structured data to Clojure. In particular, I have a list of points I ...

Are programming languages and methods inefficient? (assembler and C knowledge needed)

Hi, for a long time, I am thinking and studying output of C language compiler in assembler form, as well as CPU architecture. I know this may be silly to you, but it seems to me that something is very ineffective. Please, don´t be angry if I am wrong, and there is some reason I do not see for all these principles. I will be very glad if ...

bridge methods explaination

If I do an override of a clone method the compiler create a bridge method to guarantee a correct polymorphism (THIS IS THE CLASS DECOMPILED) class Point { Point() { } protected Point clone() throws CloneNotSupportedException { return this; // not good only for example!!! } protected volatil...

Objective-C: Cannot Change Value of Instance Variable Inside a Function

Hello everyone, I cannot change the value of an instance variable inside a function. I have defined a class: // info.h #import <Foundation/Foundation.h> @interface NSMyObject : NSObject { NSInteger i; } -(void) setI:(NSInteger)v; @end #import "info.h" @implementation NSMyObject -(void) setI:(NSInteger)v ; { i=v; ...