function

Calling a non-returning python function from a python script

Hi, I want to call a wrapped C++ function from a python script which is not returning immediately (in detail: it is a function which starts a QApplication window and the last line in that function is QApplication->exec()). So after that function call I want to move on to my next line in the python script but on executing this script and...

Can I rewrite a Javascript function using Excel VBA?

Hi, Don't know how to do this at all, but if the onclick of a button is similar to below: onclick="ConfirmAvailable();" function ConfirmAvailable() { if (document.getElementById("AvailableCB").checked) { return YesNoDialog("'Are you sure?'"); } else { return true; } } Is it possible, if I set ConfirmAvailable()="" using Exce...

jquery functions doesn´t work after external loading

hello everyone! I have a website.. with three div columns, colA colB and colC. on colA i have a menu that triggers some ajax functions to load text on colC and thumnails on colB. it works perfect.. here it is a piece of code. var loading = $(".loading"); var content = $("#colC"); var thumbs = $("#colB"); $("#menu li a").clic...

Return nullable type in SQL Server function

Is it possible to create a SQL Server function which returns a nullable string? I would like to create a function which returns DBNull if the value is 0 or an empty string: Create FUNCTION [dbo].[SetDBNullNvarChar] (@input nvarchar(1000)) RETURNS (needs to be nullable) AS BEGIN if (@input = '' OR @input = 0) BEGIN RETURN n...

Calling jQuery Function with Javascript Function

Having some trouble getting this to work, specifically with $.getJSON(). I want to wrap the getJSON function from jQuery in a Javascript function like so: function reload_data() { $.getJSON("data/source", function(data) { $.d = data; }); } But when I call reload_data() it doesn't execute the jQuery function inside. Any...

How to get MATLAB to recognise newly added static methods?

I am using classes and static methods to 'scope' functions in a namespace, similar to C#. However, every time I add a new method to a class, at first it is not found. I have to restart the MATLAB environment (2007a) for the new methods to be recognised. Surely there is an 'update' or 'refresh' type command that I can use so that I do no...

MS Access 03 - How do I call a VB Function into a Sub Procedure

I know this is a simple question for someone out there, but I have never really used function module at all because I did not understand what they were. So I have a whole bunch of things I can use this for (cut down on redundancy), but I want to know how I call call into into a sub (like a button click) procedure from a form. I tried t...

[jQuery] Modify the show/hide function to only scale width, not height?

As the title implies, I'm using jQuery's show and hide functions to hide and show elements. However, I don't want to scale in the height of the element, just the width. I was thinking about using the animate function but I wasn't sure if this was the best way to go about it. Also, I'd prefer not to have to set the height in the javascr...

Python Language Question: attributes of object() vs Function

In python, it is illegal to create new attribute for an object instance like this >>> a = object() >>> a.hhh = 1 throws Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'object' object has no attribute 'hhh' However, for a function object, it is OK. >>> def f(): ... return 1 ... >>> f.hhh...

Linker Error on having non Inline Function defined in header file?

Non inline function defined in header file with guards #if !defined(HEADER_RANDOM_H) #define HEADER_RANDOM_H void foo() { //something } #endif Results in linker error : Already defined in someother.obj file Making the function inline works fine but I am not able to understand why the function is already erroring out in first case. ...

javascript onclick remove single checkbox

Now I'm sure this is super easy, I have a function called "remove_deposit" which I want it to make the checkbox false if it's true. But I can't seem to get it to work.. function remove_deposit() { if(document.getElementById('deposit').checked == true) { document.getElementById('deposit').checked == false; }; }; Am I at le...

What is the Basic Structure of a Function in FORTRAN?

This is something that's I've wanted to know recently, mostly out of curiousity. I'm in the mood to learn some old coding styles, and FORTRAN seems like a good place to start. I guess I should help you guys out by providing a good starting point. So how would this C procedure be written in FORTRAN? int foo ( int x , int y ) { int...

Are free functions implicitly inlined if defined without a previous declaration in C++?

Is the following free function implicitly inlined in C++, similar to how member functions are implicitly inlined if defined in the class definition? void func() { ... } Do template functions behave the same way? ...

What do you say about the following Date Function ?

What do you say about the following Date Function ? The following code is from a shopping cart. function va_date( $mask = "", $date = "" ) { global $months; global $short_months; global $weekdays; global $short_weekdays; $formated_date = ""; if ( !is_array( $date ) ) { $date = is_numeric( $date ) ?...

Does creating separate functions instead of one big one slow processing time?

I'm working in the Google App Engine environment and programming in Python. I am creating a function that essentially generates a random number/letter string and then stores to the memcache. def generate_random_string(): # return a random 6-digit long string def check_and_store_to_memcache(): randomstring = generate_random_strin...

How do I execute a command contained within a variable in PHP?

Currently, I'm passing a command into a user-defined function in PHP. How do I have PHP execute this when I ask it to? ...

jQuery - Wait till end of SlideUp()

Hey, How can I wait till the end of the jQuery function slideUp() before continuing the script? <script type="text/javascript"> $(document).ready(function() { $("div[class=item]").click(function() { var id = $(this).attr("id"); $("#content").slideUp(); switch(id) { // Applications case "rampro": $("#content").css("text...

php - function return values dynamically

I want to return a set of values from function till the point they exist.... for example.... function abc($i="3"){ for($a=1;$a<=$i;$a++) { $name='t'.$i; $$name = "ae".$a; } //now i am returning values return array($t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10); //but i only want to return $t1,$t2,$t3 dep...

Why This ABAP Funtion Module Always Set the Importing Parameter with <Initial>?

We have a function module which contains an importing parameter IS_USER, which is of type S_USER, S_USER is a structure and contains the following fields: USER_ID USER_ID CHAR 60 IP_ADDR IP_ADDR CHAR 16 SESSION_ID SESSION_ID CHAR 20 LANGU SPRAS LANG 1 MACHINE_NAME MACHINE_NAME CHAR 128 SAP_PASSPORT SAP_PASSPORT STRIN...

Can I be warned when I used a generator function by accident

I was working with generator functions and private functions of a class. I am wondering Why when yielding (which in my one case was by accident) in __someFunc that this function just appears not to be called from within __someGenerator. Also what is the terminology I want to use when referring to these aspects of the language? Can the ...