function

How to show result when table is my type in Oracle

I created a simple Oracle type: create or replace TYPE MY_TYPE AS OBJECT (ID NUMBER(30), NAME VARCHAR2(20)); Then, I created a second table type: create or replace TYPE MY_TYPE_TABLE AS TABLE OF MY_TYPE; Finally, I created a simply function: create or replace FUNCTION my_function(line_id IN NUMBER) RETURN MY_TYPE_TABLE AS retu...

A few question regarding JavaScript Constructor and Anonymous functions

I have the following JavaScript function: function Console() { this.Log = function(msg) { if (document.getElementById("console")) { var console = document.getElementById("console"); console.innerHTML += msg + "<br/>"; } } } Question 1: Why do I need to use new key word? new Console().Lo...

Calling unexported functions in Win32 C++

How would I go about calling an unexported function in Win32 C++? ...

MySQL Function to return table name to be used in a query

Can I use a MySQL function or procedure to return table names that can be used in a query? Something like SELECT * FROM get_db_table_name(2342352412); where get_db_table_name() is a user defined function which accepts a user_id as a parameter and returns the db.table where that user resides. I have not been able to do this this way be...

How can I get a list of all functions stored in the database of a particular schema in PostgreSQL?

I want to be able to connect to a PostgreSQL database and find all of the functions for a particular schema. My thought was that I could make some query to pg_catalog or information_schema and get a list of all functions, but I can't figure out where the names and parameters are stored. I'm looking for a query that will give me the func...

Why are nested functions not supported by the C standard?

It doesn't seem like it would be too hard to implement in assembly. gcc also has a flag (-fnested-functions) to enable their use. thanks ...

Linearly increasing color darkness algorithm

Hi, I want to write a function in ruby that given a number between 1 and 500 will output a 6 digit hex color code that gets linearly darker for higher numbers. This doesn't seem that hard but I'm not sure where to begin. How can I implement this? edit Hue seems like a more reliable way to go. I'd like to give a reference color, say a...

Python - Passing a function into another function

I am solving a puzzle using python and depending on which puzzle I am solving I will have to use a special set of rules. How can I pass a function into another function in Python? Example def Game(listA, listB, rules): if rules == True: do... else: do... def Rule1(v): if "variable_name1" in v: return False ...

Function pointer as a member of a C struct

I have a struct as follows, with a pointer to a function called "length" that will return the length of the chars member. typedef struct pstring_t { char * chars; int (* length)(); } PString; I have a function to return the length of the characters from a pointer to a PString: int length(PString * self) { return strlen(se...

Change button in jQuery dialog box

Hi there, I wonder, if there is a proper way to remove the default close button in the title bar and change it with other, to which I want to assign other function than Close. I manage to change the classes, but despite that, the close function seems to override to any in the titlebar. My current code for changing classes: var closeBu...

JavaScript prototyping tutorial

I have a JS script with tons of functions, on big on is this: function id(i) { if(document.getElementById) return document.getElementById(i); return; } It just saves me many bytes in typing out document.getElementById() each time. My problem is I frequently add and remove classes and other attributes from elements. I w...

Calling JavaScript with PHP

I want to call a PHP function when pressing on a button, sort of like: <?php function output(){ // do something } ?> <input type="button" value="Enter" onclick="output()"/> I tried to make something like: <input type="button" value="Enter" onclick="test.php?execute=1"/> where test.php is current page and then by php <? if(iss...

PHP: $_GET and $_POST in functions?

I am flabbergasted by the code, where the GET-values, such as $_GET['username'], are not included as parameters to functions. When do you you need to include POST and GET methods as parameters to functions? ...

gdb evaluation of a function

Hi, I wonder why evaluate function doesn't work in gdb? In my source file I include, when debugging in gdb, these examples are wrongly evaludations. (gdb) p pow(3,2) $10 = 1 (gdb) p pow(3,3) $11 = 1 (gdb) p sqrt(9) $12 = 0 Thanks and regards! ...

How to pass 2D map as a parameter to a function in c++?

Hi all, I have a map like std::map< int, int> random[50]; How can i pass this map as a parameter to a function say Perform()? Thanks in advance. ...

PHP No return from a function in another file...

I have one file with a form, that includes another to process that form. The file with the form calls a function in the included file to write data to the database, and then I return an $insert_id from that post so I can reference it in the output. For example, when you fill out the form on the page, the data is sent to the db from a s...

Javascript onclientclick help?

I have OnClientClick="return confirm('Make Payment?');" tied to an asp:Button. It works fine, however, prior to popping up this confirm tho, I need to check if a textbox contains a value... How can I do this? I need a function to return false if the textbox value is null or empty, otherwise i want to present the user with the c...

Codeigniter form validation callback function not working

Hi I've written a simple callback function which isn't working. My other callbacks (which are in the same library file) work fine so I guess the problem has to do with my code. The parameter passed in the callback function takes the form of a chunk of PHP which is eval()'ed to form part of an 'if()' statement in the function itself. H...

SQL Server EncryptByCert weirdness

On a SQL Server 2005 box, given that I have already created a key and a certificate for encryption usage... CREATE CERTIFICATE [cert_Employee] WITH SUBJECT = 'EmployeeTable_SSN protection' CREATE SYMMETRIC KEY [key_Employee] WITH ALGORITHM = TRIPLE_DES ENCRYPTION BY CERTIFICATE [cert_Employee] and the following definition...

boost::multi_index index by function call with parameter(s)

Hi Everyone I'm trying to make a boost::multi_index container that uses member functions w/ parameters as keys. class Data { public: std::string get(const std::string & _attr) { return _internals_fetch_data(_attr); } /* assume some implementation for storing data in some structure(s) */ }; Suppose I have a rectangular list of ...