I need to perform a get request and send headers along with it. What can I use to do this?
The main header I need to set is the browser one. Is there an easy way to do this?
I writing a Struts 2 application. The main operation I'm trying now is to read from the action call a List and display it in the form of a table in the JSP.
I've searched the net and check out a lot of examples, but in vain.
Can someone point out to a good working example?
I need your help to extend my base class, here is the similar structure i have.
public class ShowRoomA
{
public audi AudiModelA { get; set; }
public benz benzModelA { get; set; }
}
public class audi
{
public string Name { get; set; }
public string AC { get; set; }
public string PowerStearing { get; set; }
}
public class benz
{
public string Name { get; set; }
public string AC { get; set; }
public string AirBag { get; set; }
public string MusicSystem { get; set; }
}
//My Implementation class like this
class Main()
{
private void UpdateDetails()
{
ShowRoomA ojbMahi = new ShowRoomA();
GetDetails( ojbMahi ); // this works fine
}
private void GetDetails(ShowRoomA objShowRoom)
{
objShowRoom = new objShowRoom();
objShowRoom.audi = new audi();
objShowRoom.audi.Name = "AUDIMODEL94CD698";
objShowRoom.audi.AC = "6 TON";
objShowRoom.audi.PowerStearing = "Electric";
objShowRoom.benz= new benz();
objShowRoom.audi.Name = "BENZMODEL34LCX";
objShowRoom.audi.AC = "8 TON";
objShowRoom.audi.AirBag = "Two (1+1)";
objShowRoom.audi.MusicSystem = "Poineer 3500W";
}
}
// Till this cool.
// Now I got requirement for ShowRoomB with replacement of old audi and benz with new models and new other brand cars also added.
// I don't want to modify GetDetails() method. by reusing this method additional logic i want to apply to my new extended model.
// Here I struck in designing my new model of ShowRoomB (base of ShowRoomA) ... I have tried some thing like... but not sure.
public class audiModelB:audi
{
public string JetEngine { get; set; }
}
public class benzModelB:benz
{
public string JetEngine { get; set; }
}
public class ShowRoomB
{
public audiModelB AudiModelB { get; set; }
public benzModelB benzModelB { get; set; }
}
// My new code to Implementation class like this
class Main()
{
private void UpdateDetails()
{
ShowRoomB ojbNahi = new ShowRoomB();
GetDetails( ojbNahi ); // this is NOT working! I know this object does not contain base class directly, still some what i want fill my new model with old properties. Kindly suggest here
}
}
Can any one please give me solutions how to achieve my extending requirement for base class "ShowroomA"
Really appreciated your time and suggestions.
Thanks in advance,
i'm using ffmpeg to convert videos to desired formats and to generate the thumbnails..
I want to find the total duration of the video to display in the main page along with the thumbnails..
Can i use ffmpeg to find the duration when its being uploaded and store them on the database.?
Is storing the duration in db is necessary or else is there any other method?
How to use performSelector:onThread:withObject:waitUntilDone:? here in onthread i have to use other thread not main thread. How to create other thread? give me some sample code.
If I get some value by using getline( cin, myStr ); a newline is printed after the information the user entered - logically as he pressed enter:
Please enter something: ABC <enter => \n>
This text is printed out by the program and should be in the same line as before
How to keep the newline after user input away?
I'm using MSVC 2010 and build a simple console app using iostream and string as main libraries.
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?
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;
}
?
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?
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! :)
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).
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
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
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?
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
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
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 ?