I want to dynamically set the content of an iframe to that of an html document I have. It is in the form of a string in memory in javascript.
Then i want to print that iframe.
Ideas?
I am little new to C++, I have one doubt in variable argument passing. As I mentioned in a sample code below ( This code won't work at all, just for others understanding of my question I framed it like this), I have two functions func with 1 parameter and 2 parameters(parameter overloading). I am calling the func from main, before that I am checking whether I needs to call 2 parameter or 1 parameter. Here is the problem, as I know I can call two fuctions in respective if elseif statements, but I am curious to know whether I can manage with only one function. (In below code I am passing string not int, as I mentioned before this is just for others understanding purpose.
#include<iostream.h>
#include <string>
void func(int, int);
void func(int);
void main()
{
int a, b,in;
cout << "Enter the 2 for 2 arg, 1 for 1 arg\n";
cin << in;
if ( in == 2)
{
string pass = "a,b";
}
elseif ( in == 1)
{
string pass = "a";
}
else
{
return 0;
}
func(pass);
cout<<"In main\n"<<endl;
}
void func(int iNum1)
{
cout<<"In func1 "<<iNum1<<endl;
}
void func(int iNum1, int iNum2)
{
cout<<"In func2 "<<iNum1<<" "<<iNum2<<endl;
}
Hi all,
in C++, when you define a function which takes one argument, you have to define the data type of that variable:
void makeProccess(int request)
However, I want to implement a function which takes different data types rather taking statically defined integer type.
void makeProccess(anyType request)
How can I design a proccess like this, any idea?
Thanks.
I have a general question. I would like to have a window containing some buttons, radio buttons, text fields and so on. So, user can do something (write text, select options and press buttons). As the result of the user activity window should change it structure/appearance some element should disappear and some appear.
How do I program such "updates"? Should I close an old window and open a new one or I can modify content of window without closing it?
I have some old indexed pages like:
index.php?action=addon_googlemap_showmap&listingID=XXXXX&popup=1
index.php?action=addon_googlemap_showmap&listingID=XXXXX&popup=yes
and I want to redirect them to new urls:
index.php?action=listingview&listingID=XXXXX
XXXXX is a number.
What should I put in my htaccess file?
Thank you in advance.
Hi
I am trying to add a filter to a controller that is based on a certain role (using role_requirement) and then on the company_id that each user has.
So basically I need something like this:
require_role "company" ** This is working fine
before_filter :company_required
def company_required
unless current_user.company_id == Company.find(params[:id])
end
end
The error I am receiving
undefined method `company_id' for nil:NilClass
I would appreciate any guidance. Thanks
What I wanted to do was create a listbox from a delimited text file.
The listbox would populate X # of rows based on the rows of the text file. And the listbox would have 3 columns, each being populated from a specific delimiter. Is this possible in C#? Any starting point would be great!
I'm using asp.net and want to filter a search result everytime the user enter letters in a textbox. For exmaple this website do exactly what I want: http://www.prisjakt.nu/ (try searching in the right top corner). I have tried just putting my textbox and the gridview with the search result in an updatepanel, it's working but it's really slow, can I make it faster and how? Is there any articles or something about this?
I'm writing a program and I have the following problem:
char *tmp;
sprintf (tmp,"%ld",(long)time_stamp_for_file_name);
Could someone explain how much memory allocate for the string tmp.
How many chars are a long variable?
Thank you,
I would appreciate also a link to an exahustive resource on this kind of information.
Thank you
I am parsing data through the web service. I want the flipping horizontally rather than vertically. Here is a tutorial where ViewFlipper is used but it is for static data.
I have a label and I got some text from database.
text format like: Windows Server 2008 ...etc
But sometimes there are different fonts or something like style. How can I remove all of them quickly?
I know I can make it with replace command. But is there any quick way for it?
I have this class, with the atribute 'word'
class Node {
char *word;
Inside the Node constructor, I do this asignation:
word = new char[strlen(someword)];
In the destructor of the Node class, I try to delete the contents pointed by word:
delete []word;
I obtain the next message after executing the programs:
"Heap block at 003E4F48 modified at 003E4F51 past requested size of 1"
What am I not doing well?
Hello,
Let's say I have a class named Klass, and a class called Klass2. Depending on the user's input, I'd like to decide whether I'll call "hello_world" on Klass, or Klass2:
class Klass
def self.hello_world
"Hello World from Klass1!"
end
end
class Klass2
def self.hello_world
"Hello World from Klass2!"
end
end
input = gets.strip
class_to_use = input
puts class_to_use.send :hello_world
The user inputs "Klass2" and the script should say:
Hello World from Klass2!
Obviously this code doesn't work, since I'm calling #hello_world on String, but I'd like to call #hello_world on Klass2.
How do I "convert" the string into a referrence to Klass2 (or whatever the user might input), or how could I else would I achieve this behavior?
Hi, why did it fail to load the library at link at compilation time? i don't care about freeing the library yet it just won't work.
#include <windows.h>
int main()
{
LoadLibrary("winmm.lib");
timeGetTime();
}
I want to implement a code that loops inside an array that its size is set by the user that means that the size isn't constant.
for example:
A=[1,2,3,4,5]
then I want the output to be like this:
[1],[2],[3],[4],[5]
[1,2],[1,3],[1,4],[1,5]
[2,3],[2,4],[2,5]
[3,4],[3,5]
[4,5]
[1,2,3],[1,2,4],[1,2,5]
[1,3,4],[1,3,5]
and so on
[1,2,3,4],[1,2,3,5]
[2,3,4,5]
[1,2,3,4,5]
Can you help me implement this code?
I've got an app with two themes (dark and light) that can be selected at runtime. This works. I also have a ListView with rows that can have one of three different layouts, each of which has a style (say, different colors). This also works. But I can't get these two features to work together. I really need six different styles, three for one theme (dark) and three for the other (light), but I can't figure out how to choose a style for a list item based on the current theme, or get that effect any other way by using XML files. My three layouts each point to a custom theme that sets the color, but that overrides whatever theme I've got set. Themes can only contain items that are "styleable", so I can't put my own custom items in there. There may be a way to do this programmatically, but I was hoping to do it declaratively. Any ideas?
In SQL Server, I have two tables TableA and TableB, based on these I need to generate a report which is kind of very complex and after doing some research I come to a conclusion that I have to go with SQL Pivot table but I dont have any idea about the SQL Pivot feature so, can anyone please help me on this. Please see the details below:
Create table TableA
(
ProjectID INT NOT NULL,
ControlID INT NOT NULL,
ControlCode Varchar(2) NOT NULL,
ControlPoint Decimal NULL,
ControlScore Decimal NULL,
ControlValue Varchar(50)
)
Sample Data
-------------
ProjectID | ControlID | ControlCode | ControlPoint | ControlScore | ControlValue
P001 1 A 30.44 65 Invalid
P001 2 C 45.30 85 Valid
Create table TableB
(
ControlID INT NOT NULL,
ControlChildID INT NOT NULL,
ControlChildValue Varchar(200) NULL
)
Sample Data
------------
ControlID | ControlChildID | ControlChildValue
1 100 Yes
1 101 No
1 102 NA
1 103 Others
2 104 Yes
2 105 SomeValue
Output should be in a single row for a given ProjectID with all its Control values first & followed by child control values (based on the ControlCode (i.e.) ControlCode_Child (1, 2, 3...) and it should look like this
i wanna write a program that creates (allocating memory)
and manipulates (adding elements and increasing memory etc.) integer arrays dynamically according to given input sequences.
input sequence which starts with the maximum
number of arrays, includes integers to be put into arrays and some one letter
characters which are commands to carry out some tasks (activating next array,
deleting an array etc).
also, i wanna create *c_arrays which is the address of the array whose elements are
the actual capacities (How many integer slots are already allocated for an array?) of arrays
how should i organize(set up) the algorithm?
Consider this CSS Property:
background: url(http://images.something.com/background.png) left top repeat-x;
Is there a way to dynamically specify the URL being used in the external file (Meaning the URL is sort of automatically generated rather than hard-coded in the CSS file) ?
Thanks.
I started looking into the designer file of one of my Forms and noticed that a lot of the old controls I thought I had deleted are still being instantiated but are not actually used on the form.
Is there any easy way to clean up these controls from the designer file that are not being used? Right now I've printed out a list of all the private fields at the bottom of the designer file that reference the controls of the form. I'm going down the list one by one trying to determine if the control is actually used or not, and then deleting those that I find are not on the form. The document outline is useful for figuring out what controls are on the form, but this is still a rather tedious process. Does anyone have a better way?
I have a servlet with an API that delivers images from GET requests. The servlet creates a data file of CAD commands based on the parameters of the GET request. This data file is then delivered to an image parser, which creates an image on the file system. The servlet reads the image and returns the bytes on the response.
All of the IO and the calling of the image parser program can be very taxing and images of around 80kb are rendering in 3-4000ms on a local system.
There are roughly 20 parameters that make up the GET request. Each correlates to a different portion of the image. So, the combinations of possible images is extremely large.
To alleviate the loading time, I plan to store BLOBs of rendered images in a database. If a GET request matches one previously executed, I will pull from cache. Else, I will render a new one. This does not fix "first-time" run, but will help "n+1 runs".
Any other ideas on how I can improve performance?
I just wanted to know if something like this is possible.
Jquery should fire some action on certian custom event.
Like Whenever a new row is added to dom dynamically to table then i have certain action like change the background color to example red.
That should work across the whole site.
Somethings like Event listeners in Doctrine2 or Signals in Django
EDIT:
Basically i want some thing like where i can create custom event
$.AddnewEvent(newRowAdded);
Then i can customise that event with my own functions like
$.newRowAdded(function(){ blah blah });
Hi,
I want to annotate a class dynamically to make it the more generic as possible:
public class Test<T> {
@XmlAttribute(name = dynamicvalue)
T[] data;
public Test(String dynamicvalue) {
}
}
Is there any way to achieve something like this.
TA