function

How to send unmanaged function pointers from dll to another unmanaged function in other dll through managed code?

Hi! I have this problem, which I am dealing with for some time already. At start, I have two dlls with unmanaged code (let's say... dll_1, dll_2) and managed aplication in c#. What i'm supposed to do is to get pointers to unmanaged functions in dll_1 in managed code, pack it into structure, and send this structure as an argument to unman...

Javascript function to convert date yyyy/mm/dd to dd/mm/yy

Hi all, I am trying to create a function on javascript to bring the date from my database in format (yyyy-mm-dd) and display it on the page as (dd/mm/yy). I would appreciate any help. Thanks. PD: Let me know if you need more clarification. ...

How to find out whether a function defined for an instance of a class in Python?

I want to know if a function is defined for an instance of a class class c(object): def func(self): pass cc = c() >>> is_function_defined_for_instance(cc,'func') True >>> is_function_defined_for_instance(cc,'cnuf') False my cleanest attempts at the function is: def is_function_defined_for_instance(instance,function): return call...

Identifying a C# or C++ function start in a line count program

I have a program, written in C#, that when given a C++ or C# file, counts the lines in the file, counts how many are in comments and in designer-generated code blocks. I want to add the ability to count how many functions are in the file and how many lines are in those functions. I can't quite figure out how to determine whether a line (...

Using native code functions as JavaScript objects in WebKit

I'm unable to use native code functions as JavaScript objects in WebKit-based browsers. Is it impossible to alias these functions directly? This is easiest to explain by example, so here is what I am running in the Developer Tools console: console.warn; // Outputs: // function warn() { // [native code] // } console.warn("console....

Variables as a part of calling a method in python

Hi, I'm pretty new to programming and I'm creating a python game for my little sister. I'm having trouble, because I want the variable value to be a part of the method name Is there any way this is possible? def play_with_toy(self): toy = gui.buttonbox( msg = 'Choose a toy for your potato head to play with:', title...

Problem with expression language functions in Tomahawk tags

I'm using: Tomcat 6.0 Jsf 1.2 - Mojarra Implementation Tomahawk 1.1.9 I imported the taglib <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> when i call: <h:outputText value="#{fn:indexOf('ciao','i')}"></h:outputText> Output is 1 when i use <t:outputText value="#{fn:indexOf('ciao','i')}"></t:outputText> ...

Use arguments as variable names in objective-c

Hi, I'm new at objective-c and stuck with a problem. Is it possible to take an argument of a function to use as some variable names? For example, say I have a bunch of image: aPic1, aPic2, bPic1, bPic2, cPic1, cPic2, and I want to create an action so that every time when a button is clicked, the view controller will hide Pic1 and displ...

Are there any issues with using static keyword in a plain php function?

For example: <?php function get_current_user_id(){ static $id; if(!$id){ $id = 5; echo "Id set."; } return $id; } $id = get_current_user_id(); $id2 = get_current_user_id(); $id3 = get_current_user_id(); echo "IDs: ".$id." ".$id2." ".$id3; ?> //Output: Id set.ID...

Codeigniter: 3 Submit buttons, one function?

I have a page with three forms. I'd like to run different db calls corresponding to the button clicked. I have a 2 lib functions. One validates, and the passes it to the _submit function... How can I separate the _submit function based on which submit button is clicked? ...

How to spawn thread when defined function is set (sequentially dependent) and calling is spatially dependent

Hi. I apologize for my question being a bit confusing. So I have code written in python but also used H3D haptics platform. I'm trying to unload some of the processing of this one, very large thread so that I can log faster. I'm not sure how to write it since a function 'moveCursor' is already defined and later set to a specific number...

Pointers and Functions in C++

From the lectures notes of a course at university, on "call-by-value": void fun(int *ip) { *ip =100; } called by int n=2; int *np; np = fun(np); would change the value of n to 100. When we say "int *ip", what exactly do we mean? A pointer of type integer? If so, when we call fun() with np as its argument, shouldn...

how to pass a non static-member function as a callback?

io_iterator_t enumerator; kern_return_t result; result = IOServiceAddMatchingNotification( mNotifyPort, kIOMatchedNotification, IOServiceMatching( "IOFireWireLocalNode" ), serviceMatchingCallback, (void *)0x1234, & enumerator ); serviceMatchingCallback((...

Using a function to create a function in Python

Hi, I'm new to programming and I'm interested in if it's possible to use a function to create another function based in inputted information: def get_new_toy(self): new_toy = gui.multenterbox( msg = 'Enter the data for the new toy:', title = 'New Toy', fields = ('Toy Name', 'Fun for 0 to 5', 'Fun for 5 to 7'...

VBA - Popup message when user try to print

Hi guys I am needing to set-up a function in MS Word to run a message box when a user tries to print a particular file. Cheers Anthony Update - I haven't done any VBA before and am trying to help out someone who need this. What they need is a message box with some text to display when the user goes to print this particular document...

PostgreSQL insert that depends on data in another table, best practice?

I've recently started using PostgreSQL and I'm trying to do things "the right way" as I've understood it. Meaning putting as much work in the database server instead of on the client as possible. So I've created a function with PL/pgSQL that will add data to a table. Since I've a primary key constraint set on that table, and the referen...

Reading Recommendations To Learn Basics Of C

I'm now really diving into my OS project, called ForestOS, but now I'm needing to dive more into some simple and basic things of C. As now I'm having many problems with the correct variable to use and functions. I want resources that only talk about variables, functions and how to develop without headers(stdio.h, math.h and all the othe...

recv() functions flag for taking the while buffer in one string [windows C]

This code sends and recv s txt file perfectly but cannot do it to otehr formats like .exe or .img. Please help me with these as I need to use htonl or htons?? Take a look!! Here is the server side recv function :: if (socket_type != SOCK_DGRAM) { fi = fopen (final,"wb"); retval = recv(msgsock, ...

Deleting specific values from an array in ksh

I have a customized .profile that I use in ksh and below is a function that I created to skip back and forth from directories with overly complicated or long names. As you can see, the pathnames are stored in an array (BOOKMARKS[]) to keep track of them and reference them at a later time. I want to be able to delete certain values from ...

Declaring jQuery functions all over again to set different values on ie7. Any other way to do this?

Well i have a scrolling plugin that i'm using to move divs when i click nav anchors. There are two different settings, which i already didn't want to happen, but i had too since i didn't know a way around this: Look: var jump=function(e) { //the plugin code... scrollTop: $(target).offset().top - 110 } and another one with a differe...