I have this function:
void ToUpper(char * S)
{
while (*S!=0)
{
*S=(*S >= 'a' && *S <= 'z')?(*S-'a'+'A'):*S;
S++;
}
}
What does it mean for *S != 0, should it be null instead?
i want to have a background thread in my app that changes an image every 5 seconds for as long as the app is being run. Can someone point me in the direction of how this works? I am new to threads.
hello, can somebody please explain the order of private and public is important or no?
for example:
class Account{
public:
Account(string firstName, string lastName, int id);
void printAccount();
private:
string strLastName;
string strFirstName;
};
will be the same as:
class Account{
private:
string strLastName;
string strFirstName;
public:
Account(string firstName, string lastName, int id);
void printAccount();
};
I have this class:
class A {
private:
int player;
public:
A(int initPlayer = 0);
A(const A&);
A& operator=(const A&);
~A();
void foo() const;
};
and I have function which contains this row:
A *pa1 = new A(a2);
can somebody please explain what exactly is going on, when I call A(a2) compiler calls copy constructor or constructor, thanks in advance
I had inherited this SQL Server where we put data in a table (Call TableA) on a database (DB-A). I can see the tableA in another database on the same server ( DB-B) gets the same data right away.
Any ideas how this is implemented? I am trying to see the trace but so far no luck. Any one has an idea?
At this stage I am not sure if its replication. This is a guess
Hello All,
I have a following ArrayList,
[Title,Data1,Data2,Data3]
[A,2,3,4]
[B,3,5,7]
And I would like to convert this one like this,
[Title,A,B]
[Data1,2,3]
[Data2,3,5]
[Data3,4,7]
I'm bit confused with the approach. Any hint would be much appreciated.
Thanks.
Its been a long time since i've done C++ and I'm running into some trouble with classes referencing eachother.
right now I have something like:
a.h
class a
{
public:
a();
bool skeletonfunc(b temp);
}
====================
b.h
class b
{
public:
b();
bool skeletonfunc(a temp);
}
since each one needs a reference to the other i've found I cant do a #include of eachother at the top or i end up in a weird loop of sorts with the includes.
So how can I make it so that a can use b and vice versa with out making a cyclical #include problem.
thanks!
in c or c++
function comlen is defined such
int comlen(char *p,char *q){
int i=0;
while *p && (*p++==*q++)
i++;
return i;
is this code equivalent of this function
int comlen(String s,String m){
int i=0;
while (i<s.length() && s.charAt(i)==m.charAt(i)){
i++;
}
return i;
?
please help
I have been given a context schema for a database i need to make for my coursework but some of the attributes (column names) contain letters in brackets at the end of them such as:
*x_Number (Adm)
*x_Number (A)
*x_Number (P)
The problem is i have no idea what these letters mean!
Can anyone help?
Hi,
I have an NSMutableArray called playlist. This is in a method called getAllPlaylists. The code is something like this:
-(NSMutableArray *)getAllPlaylists
{
//playlist is an instance variable
playlist = [[NSMutableArray alloc] init]; //memory leak here
.
.
//some code here which populates the playlist array
[playlist addObject: object1];
.
.
return playlist;
}
The array allocation step of playlist is causing a memory leak. In such a scenario where can i release this array? Or can i avoid allocation n initialization of playlist here by doing something else?
Hello,
I would like to hear your suggestions on kind of design problem which I have in c#.
So, I am making a program where people can meet and draw in the same window over the internet or LAN. I am drawing into a bitmap and than I set it to a pictureBox component.
I have a hard time to decide how to send updates to each user, what is the best way to do it.
Should I send coordinates of mouse and than do the drawing on each users screen or stream the image to each. Maybe you know better solution to keep it synchronized and efficient.
Thank you.
Hi,
I am trying extract number, from line has 'copies : 5' string.
this look behind expression not working.
echo "copies : 5" |perl -ne 'print $1 if /(\d+)(?
Thanks
Hello,
In classic MVC the model notifies the view about changes made on it. In C# this means I have to subclass the View I'm interested in and in the subclassed class register to the model's event. For example,
if I were to implement MVC using C# and Winforms, I had to subclass TextBox class and then register inside the MyTextBox's constructor for the model events. Am I correct?
How was this issued in Smalltalk? Does one also need to subclass every View in order to register the model's events, or is there some way to dynamically add events to the views on the fly?
Thanks
If php and ruby are languages, and cake and rails are frameworks, how do CMS like drupal and joomla fit into the scheme... can you use them in any language and any framework?
Hi,
I test some simple F# code for "if" expression, but the result is unexpected for me:
> let test c a b = if c then a else b;;
val test : bool -> 'a -> 'a -> 'a
However
> test true (printfn "a") (printfn "b");;
a
b
val it : unit = ()
I'd expect only "a" is printed out but here I got both "a" and "b". I wonder why it comes out this way? Thanks!
Over the years, I've struggled with this. This year, there might be a solution.
I need a header, content and footer.
I would like the footer to be at the bottom of the page, the header at the top, and the content in between.
I would like the content to have a scroll bar.
Q: Is that too much to ask?
I've got 80,000 users on my site and i've recently turned away from the forum script i've been using and built something very simple myself that works just as well (the forum script was too bloated and resource intensive for my simple site)
The only thing i've lost is the ability to mass email all my members.
So i'm looking to come up with a script to do it myself. After looking around (including questions on here) I decided using Swift Mailer would be a good idea.
However i've been through all the documentation and can't see how to send say "100 at a time" and i'm not sure how to go about it.
To put it simply. I have an admin panel with a form with two inputs "subject" and "message". When I click submit what is the safest way for me to send 80,000 emails without crashing my server or being marked as spam?
I'm on quite a beefy dedicated server so don't have the problems associated with shared servers.
Thanks in advance for any advice!
Hi guys,
I have made a build file for the automated compilation of Oracle Forms files. An excerpt of the code is as follows:
<target name="build" description="compiles the source code">
...
<foreach item="File" property="filename" failonerror="false" >
<in>
<items basedir="${source.directory}\${project.type}\Forms">
<include name="*.fmb" />
</items>
</in>
<do>
<exec program="${forms.path}" workingdir="${source.directory}\${project.type}\Forms" commandline="module=${filename} userid=${username}/${password}@${database} batch=yes module_type=form compile_all=yes window_state=minimize" />
</do>
</foreach>
...
</target>
The build file navigates to the directory containing the forms that the user desires fo compile and attempts to compile each form. The failonerror attribute is set to false so that the build file does not exit if a compilation error occurs. Unfortunately, however, though this prevents the build file from exiting when a compilation error occurs, it also appears to make the build file exit the task. This is a problem because, unless the form that does not compile successfully is the last to be tested (based on the filename of the form in alphanumerical decsending order), there will be one or more forms that the build file does not attempt to compile. So, for example, if the folder containing the forms that are desired to be compiled contains 10 forms and the first form does not compile successfully, the build file will not attempt to compile the remaining 9 forms (ie exit the task). Is there a way to make the build file attempt to compile remaining forms after encountering after failing to compile a form? Thanks in advance!
In C or C++
if ( x )
statement1;
else
statement 2;
for what value of x both statements will be executed??
I know we can execute if-else together like this:
if(1){
goto ELSE;
}
else{
ELSE:
}
Is there any way, like a value?
(Which i think is not possible. Asking because someone is arguing!)