Should 'this' in the following code not still refer to the DOM object selected by the MooTools selector?
$$('div').addEvent('click', function()
{
var click1 = function(){$(this).setStyle('background', 'red');}
click1();
});
...
$3.6.1/3 states-
"The function main shall not be used
(3.2) within a program.".
The sample academically motivated program below uses the name 'main' in a couple of ways which I thought are legitimate. This is based on the assumption that 'usage of a function' is related to calling the function (directly/indirectly).
struct MyCla...
Is there an equivalent in Delphi? I've looked over the documentation and can't find anything that would give me the output I want.
...
Hello!
Is there a best practice / recommandation when I want to use a variable declared outside of a function when it comes to using:
global $myVar
$GLOBALS['myVar']
Thank you.
...
Consider this output from browser() that is located inside calcDistance:
Called from: calcDistance(object = rst, xy = xy[[i]][j, ], effect.distance = effect.distance)
Browse[1]> ls.str()
effect.distance : num 236
object : Formal class 'RasterLayer' [package "raster"] with 12 slots
xy : Named num [1:2] -101.8 35.5
Browse[1]>
debuggin...
In the below code how does passing bar as
function (n) { return n; }
to foo evaluate to true in the if block?
function foo(bar) {
if (bar) {
// true
} else {
// false
}
}
This has me puzzled so any help is much appreciated.
...
I know OpenCL supports inline functions, but can those functions accept and return OpenCL types?
Specifically, I am interested in something with this signature:
float4 func(float4 x, float4 y)
...
I am trying to build a template function. Inside templated classes are used and I would like to pass the template type of the function to those classes. So I have:
template <class T>
T find_bottleneck (ListGraph &g, CrossRefMap<ListGraph, Edge, T> &weight, Node &s, Node &t) {
// Check if theres a single edge left
if (countEdge...
I have a function that should return several values. Is this possible, perhaps with an array? If so, how would I reference that array? Do I have any alternatives to using an array?
...
How is the square root function implemented?
...
I would like the below function to be more flexible and accept multiple callbacks to other functions if they are defined in the arguments.
$(function() {
function icisDashBox(colorElem, thisWidth, thisHeight, completeCallBack) {
$(colorElem).colorbox({
transition: 'none',
...
I want to log the time that a user posted a message and display it in a Twitter like fashion.
I found a function that does this but it does not work with mysqls Timestamp type.
In the instructions it says that it uses the time()format to calculate it. How should I be writing the times to my Database in order for it to work???
This is...
I am using Jquery AJAX to post a form on my page. I want to hide a div whilst AJAX is being performed and show it again when AJAX is a success.
How can I do this?? Check my code here:
$(document).ready(function(){
$("form#microblogpost").submit(function() {
// we want to store the values from the form input box, then send via ajax belo...
What are the must-know MYSQL functions (like IF etc..,) which every web developer should know?
...
I'm new to AS3. Learning how to create classes. Is comp = new HouseObjects creating a new class? Is comp creating an instance of the HouseObjects? I realize that this is inside public class TreeHouse. I'm thinking that HouseObjects, how I set it up is not a class...not sure what the correct way to set up classes and properties.
Also I n...
I'm attempting to create a function with flags as its arguments but the output is always different with what's expected :
define("FLAG_A", 1);
define("FLAG_B", 4);
define("FLAG_C", 7);
function test_flags($flags) {
if($flags & FLAG_A) echo "A";
if($flags & FLAG_B) echo "B";
if($flags & FLAG_C) echo "C";
}
test_flags(...
Could you explain me what does this function do when invoked?
...
I'm having difficulty referencing "this" from within a javascript inline function, within an object method.
var testObject = {
oThis : this,
testVariable : "somestring",
init : function(){
console.log(this.testVariable); // outputs testVariable as expected
this.testObject.submit(function(){
var a...
Is there any way to unstringify strings provided as macro arguments? I need to be able to call functions who's names are in strings. Something like this:
void hello() {
printf("Hello, world!");
}
call_func("hello");
How would I implement call_func. It would be in a module that would be #included and would be used to call functio...
How can I store functions in an Array with named properties, so I can call like
FunctionArray["DoThis"]
or even
FunctionArray[integer]
Note: I do not wish to use eval.
...