function

set values to elements of an array in a function

Hi, In a bash script, I would like to put the following code that assigns values to each element of several arrays into a function for (( i=0 ; i < ${#themes[@]} ; i+=1 )); do c_bit_mins[i]=-5 c_bit_maxs[i]=15 gamma_bit_mins[i]=-15 gamma_bit_maxs[i]=3 done i.e. something like function set_values() { for (( i=0 ; i ...

Retrieving address of a function from ExE or Bin file

Which program can you recommend for me if I want to retrieve dissasembled code and absolute addresses of functions placed in exe file or binary file ?? ...

How do I write a RGB color value in JavaScript?

I am trying to change the color of the function swapFE() below and I can't figure out how to write it. I was told to change the color of the phrase node to the color value (155, 102, 102). I tried to do that as you can see at the end of the function see- parent.childNodes[1].style.color= (155, 102, 102); but it just comes out a dark navy...

c++ how to ? function_x ( new object1 )

Hi i want to do the next instead of MyClass object; function_x (object); i want to function_x ( new object ); so what will be the structure of the MyClass to be able to do that .. if i just compiled it , it gives me a compile time error answer function_x (MyClass() ) New Edit thanks for the quick answers.. i did ask the w...

jQuery troubles with each() and custom function

$(function(){ $(".test").each(function(){ test(); }); }); function test(){ $(this).css("border","1px solid red").append(" checked"); } why is this not working? what am I missing? this is my test html: <p>test</p> <p>test</p> <p class="test">test</p> <p>test</p> ...

Is there any difference between DATE_SUB() and using arithmetic operators for datetime calculation?

After I have seen a lot of questions here using the DATE_SUB() or DATE_ADD() functions instead of the arithmetic operators + or -, I was wondering if there was any difference: Quote from the MySQL-manual: Date arithmetic also can be performed using INTERVAL together with the + or - operator: date + INTERVAL expr unit date - INTER...

Return Structure from Function (C)

I need to create a structure inside a function (dynamically with malloc) Then i need to be able to send it to my main, and use it there. I have no problems creating it, I simply need help sending it to my main, and I'm also unsure of how to access it once I get it there. struct retValue * fn() { struct retValue { int number; }; ...

matrix as output of a function

Hello, Maybe a very easy question, but I am already looking for hours on the Internet for the answer but I cannot find it. I have created the function below. In another m-file I want to use the matrix 'actual_location'. However, it is not possible to use an individual cell of the matrix (i.e. actual_location(3,45) or actual_location(1,2...

Flex - How can I define a function in one component from another?

I'm a complete Flex/Flash noob, running Adobe Flash Builder 4 Beta 2. I have a main component that needs to be able to call several popups, each mostly the same except for one function and a few labels. Obviously, I'd prefer to be able to define this function and change those labels when calling the popup instead of having tons of .mxm...

Is it possible to call a C function, given its name as a string?

I saw this question in one of the C puzzles!! Is this really possible? How can I call a function, given its name as a string? is it possible to use string that is read with scanf be used directly to call a function? i already have thought of if(strcmp(str,"string"))then call the function. but is there any other approach? ...

How to pass data to another function from a class (in HTMLParser)?

I'm beginning to learn python. My python version is 3.1 I've never learnt OOP before, so I'm confused by the HTMLParser. from html.parser import HTMLParser class parser(HTMLParser): def handle_data(self, data): print(data) p = parser() page = """<html><h1>title</h1><p>I'm a paragraph!</p></html>""" p.feed(page) I'll get this: ...

Using values inside a function out side

is it possible to use values that are obtained within a loop/function out side the loop/function where it is used or called? below is my function function off($limit) { $string=file_get_contents("feed.xml"); $xml=simplexml_load_string($string); foreach ($xml->FOUND->CAT as $place) { $limits = $place->CORDS; ...

What is the Reference that we have to add to use the Format function in Visual Basic 6.0?

Hello, I'm using VB 6.0 and it gives me: "Compile Error: Can't Find Project or Library" in this sub: Private Sub MDITimer_Timer() Dim textStr As String textStr = Format(Now, "dd-mm-yyyy hh:mm:ss") StatusBar.Panels(1).Text = textStr End Sub I made it like this and the error still was in the Format function (so it is not a...

How can I estimate the logarithmic form of data points using R?

I have data points that represent a logarithmic function. Is there an approach where I can just estimate the function that describes this data using R? Thanks. ...

Plot multiple functions in R

I previously asked this question which was useful in plotting a function. I want to try and plot twenty functions on the same axes to illustrate how a function varies between two ranges. I have successfully done this using individually specified functions, but I wanted to do this using a loop. What I have attempted doing is: ## add gg...

Looping, counting, and the setInterval method.

1) Would this construct technique work? Or would it need to have this.start()? 2)Would the index reset at any point? var imageRotate = new tRotate(); window.tRotate = function(){ __construct(); this.images = new Array(); this.index = 0; this.__construct = function(){ tRotate.start(); // Do other things } this.start = function(...

how do I use a excel function inside the vba editor

I want to write a Excel function like this. It is an extension of the Dec2Bin function Public Function Dec2BinEx(x As Long) Dec2BinEx = dec2bin(x) + 10 End Function But I am getting an error when trying to use it. How do I call a excel function inside the visual basic editor ...

PHP: Split string into chunks of 8, how do I do this?

I have binary basically, say it's 300 in length. How would I split (much like using explode) it into 8 bit chunks? I look at chunk_split() but it only seems to have an 'end' parameter, not an option to put it into an array.. Or can it be socketed into an array? The end 8 digits can be below 8 (in case a miscopy from someone, and it's 4)...

What approach of functions shall I use

A very basic question it is but I wanted expert advice that is why posting it here. Here are two functions, what is the difference between the two ? Are both of them equivalently efficient and includes best practices or Which one of them is better to use in programming. function is_numeric($number) { if(!preg_match("/^[0-9]+$/",$...

Error with using a function as a non-type template parameter

I have this template : template <class SourceFormat, class DestFormat, void (*convert)(DestFormat, SourceFormat)> static void _draw(...); And these functions : template <class Class1, class Class2> inline static void convertNone(Class1& dest, Class2& source) { dest = source; }; inline static void c...