I'm trying to have method void run( string method ) which would run method in that class. For example:
class Foo {
public:
void run( string method ) {
// this method calls method *method* from this class
}
void bar() {
printf( "Function bar\n" );
}
void foo2() {
printf( "Function foo2\n" );
}
}
Foo foo;
int main( void ) {
foo.run( "bar" );
foo.run( "foo2" );
}
this would print:
Function bar
Function foo2
Thanks! :)
I have the following code which loads and html file into a webview
- (void)awakeFromNib{
NSString *resourcesPath = [[NSBundle mainBundle] resourcePath];
NSString *htmlPath = [resourcesPath stringByAppendingString:@"/main.html"];
[[self mainFrame] loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:htmlPath]]];
}
How would i dynamically load a css file (in the most efficient manner) as it does not suit to have the css file link in the html file
Hello,
I have a strange problem which I can't fix:
A field:
private boolean[][][] gaps;
Constructor (1st line):
gaps = new boolean[NOBARRICADES][WIDTH][HEIGHT];
Constructor (2nd line):
for (int i = 0; i < NOBARRICADES; i++) {
JAVA throws an error for the 2nd line, saying:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException
Does it have anything to do with JAVA syntax (the mistake is in these lines of code) or I should look for the problem somewhere else?
When I load content with AJAX, is this content supposed to automatically use the preloaded main page css style ?
For example, if I load a <span class="smallText">hello</span> with AJAX.
Is this new HTML using the default.css file with
.smallText {
font-size:6px;
}
?
I have a grid with 2 columns, a listbox in column 0 and a number of other controls in the a secondary grid in the main grids column 1.
I want this controls only to be enabled (or perhaps visible) if an items is selected in the listbox through binding. I tried on a combo box:
IsEnabled="{Binding myList.SelectedIndex}"
But that does not seem to work.
Am I missing something? Should something like this work?
thanks
How would you find out the width of a element that is wrapped by 20 odd other elements, but the only fixed width I know is the main wrapper's which is 800px. All child elements are generally blocks, floating or not, with different paddings and margins.
I don't really need the answer to a specific case, I'm just wondering if there are tools or tricks to quickly calculate such things.
Thanks
here is url
http://mrhome.ru/Home/MenuPageContent/41?q=??&pid=39
if click search, it not work (quess it because of param q)
but on url http://mrhome.ru/Home/main search is work
what the problem?
In my app I've been using the now deprecated shouldAutoRotateToFace method. Now when using the iOS 6 simulator, all of my subviews are rotated to portrait orientation while the device is in landscape. Does anyone have any idea what could cause this? I've already tried replacing should autorotate in my main view controller with the supportedOrientations method (or whatever it is that you're now supposed to use instead).
Why this coder do not show error
#include <iostream>
int main()
{
using namespace std;
unsigned short int myInt = 99;
unsigned short int * pMark = 0;
cout << myInt << endl;
pMark = &myInt;
*pMark = 11;
cout << "*pMark:\t" << *pMark << "\nmyInt:\t" << myInt << endl;
return 0;
}
But this one shows :
#include<iostream>
using namespace std;
int addnumber(int *p, int *q){
cout << *p = 12 << endl;
cout << *q = 14 << endl;
}
#include<iostream>
using namespace std;
int addnumber(int *p, int *q){
cout << *p = 12 << endl;
cout << *q = 14 << endl;
}
int main()
{
int i , j;
cout << "enter the value of first number";
cin >> i;
cout << "enter the value of second number";
cin >> j;
addnumber(&i, &j);
cout << i << endl;
cout << j << endl;
}
In both the code snippets, I am assigning *pointer=somevalue. In first code it do not show any error but it shows error in the line
cout << *p = 12 << endl;
cout << *q = 14 << endl;
What mistake I am doing ?
hi friends,
I am working on linux enviournment and currently i am using svn's branch for developement purpose...but now i have to delete it and i have to work with main brach with today's date as a lebel like ..suppose my svn repostiory is "xyz" so now i want it to be like "xyz_production_lastproductionDate" than how to label it.Please share your opinion as i got stuck because of this...
Thanks in advance
I want to display a login view to my users if they are not logged in and the main view if they are.
In my header file I define a variable to hold the logged in status
#define loggedIn 0
I figure I should then reference this in the initWithNibName method and then decide which nib to load.
Is the right way of doing it?
If so can someone help me out with the exact code?
Thanks for any help
int main()
{
int a[]={1,2,3,4,5,6,7,8,9,0};
printf("a = %u , &a = %u\n",a,&a);
printf("a+1 = %u , &a+1 = %u\n",a+1,&a+1);
}
how a and &a are internally interpreted?
in java we can do this:
public class A{
public static void main(String...str){
B b = new B();
b.doSomething(this); //How I do this in c++ ? the this self reference
}
}
public class B{
public void doSomething(A a){
//Importat stuff happen here
}
}
How can I do the same but in c++, I mean the self reference of A to use the method in B ?
Class A
{
public A()
{
system.out.println("con call");
}
static
{
system.out.println("static call");
}
{
system.out.println("ins call");
}
public static void main(string[] args)
{
new A();
new A();
}
}
I have a simple perl script that via ftp uploads files to the server hosting our website. After I do that I have to login as a Wordpress admin and use the GUI to edit a page so that it reflects the new file I just uploaded. I want to programmatically edit that file to save a few steps, but I can't find the file. Are any Wordpress files sitting on the server? The file in question is basically a subpage of the main site.
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
The exe generated by the above will exit automatically,how to change the behavior?
What is the optimal way to write the code which interacts with DB using linq2SQL? I need to add some business logic to the entities. So I guess there are two ways:
Write some wrapper class. The
main minus is that many fields are
the same, so i don't feel it as DRY
style.
Add business logic methods
to linq2sql entities(these classes
are partial) directly
???
I'm having some difficulties with this problem.
The main idea is, I initialized a variable of class type B in class A, class A.h has the variable Z declared as public, like B *Z;
In class A.cpp, I initialized it as Z = new B();
Now, I want to access that variable from class C and I'm unable to do so. C.h includes A.h and B.h
Hi.
public sealed static class FolderHelper
{
public static string GetRandomFolder()
{
// do work
}
}
But.... How? Like start at c:\ (or whatever the main drive is) and then randomly take routes? Not even sure how to do that.
We recently created a branch out of the main branch of our code for the beta.
Now I want to check what all files have changed in the branch in the last one week. How to get that information out of CVS.
What is the command for this ?
Now that I've gotten relatively familiar with web2py, I'd like to give Django a go.
What are the main differences?
What would be the most efficient way to get started taking into account web2py knowledge?
(It must help to have some python application framework knowledge,no?)
EDIT
Also, if you've used both, can you offer an opinion on which you prefer and why?