For my systems programming class we're doing a lot of programming in C and are required to error check most functions as we are currently learning to program with pthreads.
The reason I say this is not really homework, is that it is far above and beyond what is expected for this class. Simply checking each function individually is more ...
This currently works:
$(document).ready(function() {
$('body').addClass('red').delay(50).queue(function(next){
$(this).removeClass('red').delay(50).queue(function(next2){
$(this).addClass('blue');
next2();
});
next();
});
But I'd like something more efficient. And plus, the code above becomes ...
Hey,
I wrote a script with two functions executed by setInterval().
One function rotateTheSun() constantly rotates an object, the other moveSlide() handles moving a sliding div onclick.
Whenever the constant function is running, the div slide very slow.
Is it a JS issue, or did I just wrote a bad script (as usual)?
source:
window.o...
Hi,
I have general text in CDATA in my xml which is pulling in content into Flash. This is working well and I am able to add images this way too. What I need though is to wrap that image in an tag which, when clicked on will fire off a function in my Actionscript 2 to launch a video.
Could someone please tell me how I would go about t...
I need to have a variable that only one function can write (let's call that function a) and that only one other function can read (let's call that function b). Is that possible?
...
For instance:
// somefile.php
function doSomething() {
// do lots of code, whatever...
return $something;
}
// mainfile.php
include "somefile.php"
doSomething(); // ignored the return value, we don't need it here
What happens when a function in PHP returns a value but we don't care about it? Is something wrong with this behav...
Hi guys, I having problems with this function, seems like @idUsuario and @passCorrecto aren't getting any value, so, when I use this variables in the where clause I'm not getting any result data.
ALTER FUNCTION [dbo].[login](@usuario varchar(20), @password varchar(20))
RETURNS @info TABLE (nombre varchar(70) not null, tipo varchar(30) ...
i have this javascript code:
var step = 8; // How many pixels to move per step
var current = -1920; // The current pixel row
var imageWidth = 1920; // Background image width
var headerWidth = 960; // How wide the header is.
function slide_in(){
...
I've done this with a asp.net Gridview. but does anybody have any examples on how to pass row information from an asp.net button in SharePoint Dataview rows to an inline C# function?
the button Repeats as follows:
<asp:Button runat="server" Text="Delete" id="Delete{@ID}" OnClick="DeleteDoc()"/>
My function looks like this:
void De...
I want to make a simple function that I can call on to query my database. I pass the "where" part of the query to it and in the code below, my $q variable is correct. However, what should I then do to be able to use the data? I'm so confused at how to do something I'm sure is extremely easy. Any help is greatly appreciated!
function get...
std::thread f()
{
void some_function(); // <- here
return std::thread(some_function);
}
std::thread g()
{
void some_other_function(int); // <- here
std::thread t(some_other_function,42);
return t;
}
...
I need to make a decision in a BOOST_PP_IF statement based on the arity (parameter count) of a boost::function object. Is this possible?
boost::function_types::function_arity does what I'm looking for, but at runtime; I need it at compile time.
...
Hi
I have a text area that I would like to become blank when the enter button is pressed. I know this would normally be done with a setText method. However when I do this, the text is removed but the new line function created by the return key being pressed. My question is, is the anyway of stopping this default action from happening?
...
I'm trying to find a way to make this smaller by using functions/variables in my jquery.
$('.search-what-category').fadeOut('normal', function(){
$('.search-wrapper').animate({'height':40})
})
$('.search-what-category').fadeOut('normal', function(){
$('.search-wrapper').animate({'height':40}, function(){
$('.search-wra...
Hi folks,
In creating unique custom reference codes (i.e. JOB1293XYZ) for a while I have been generating custom reference/hashes in PHP then checking my database to see if it already exists and if so generating another.
I'm curious if in MySQL it is possible to to generate the contents of a field based on the other fields in that row, ...
I'm working on some Map / Reduce queries for MongoDB and am trying to do the following (in a nutshell).
m = function()
{
this.convert = function(val)
{
return val+1;
}
emit(convert(this.age), this.doesWearGlasses);
}
r = function(k, v)
{
count = 0;
for(var i = 0; i < v.length; i++)
{
count +...
In the following function which one is the best practice?
To send an autoreleased object, and make the caller retain it?
or send an allocated object, and make the caller release it?
- (NSString*) convertDataToString :(NSData*)myData
{
//just an example, method might not exist
NSString *str = [[NSString alloc] initWithDat...
Ok, I'm using virtual functions, overloaded functions, and multiple inheritance. Of course this doesn't turn out well.
The scenario: Class base1 has a virtual function that needs to be specified by its child.
Class derived derives from two parents base1 and base2, and should use base2's existing functionality to define base1's virtual ...
I have an approach to call delayed function for class:
//in MyClass declaration:
typedef void (MyClass::*IntFunc) (int value);
void DelayedFunction (IntFunc func, int value, float time);
class TFunctorInt
{
public:
TFunctorInt (MyClass* o, IntFunc f, int v) : obj (o), func (f), value (v) {}
virtual void operator()();
protected:
...
If I try to create a column whose value is a select returning more than one row, I get an error.
=> select (select 1 union select 2);
ERROR: more than one row returned by a subquery used as an expression
But if I create a function that does the same thing, I get the behavior I want.
=> create or replace function onetwo() returns set...