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 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 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;
}
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.
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 written a function:
function url_query(){
if (is_numeric($_GET['cmd'])) {
$get = $_GET['cmd'];
}
return $get;
}
but I want that this function be global. This function works only for eg.
index.php?cmd=...
Can I revise this function to use for index.php?page=... and index.php?catID=... etc?
Thanks
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.
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 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'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 had a regex that replaced all URLs from a given string:
my_string = "www.example.com test www.mysite.com"
my_string.gsub!(/[a-zA-Z0-9\-\.]+\.(com|net|de|org|uk|biz|info|co.uk|es|de)(\/\S*)?/i,'(site hidden)')
As a result of the above I get: "(site hidden) test (site hidden)"
How could I change the regex to not replace www.mysite.com ???
It means that the replace should output "(site hidden) test www.mysite.com"
Thanks !
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?
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 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'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
Hi,
My web page will get a set of results from the database and display it to the user. However I am not sure about "number" of results.
Each result will have a panel which contains several controls in itself, an image, several labels, etc.
What is the best way to do this dynamically, eg. create these controls dynamically?
Is it better to use an AJAX control? Should I use Gridview?
Thanks for the help,
Behrouz
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?
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 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?
I want to display a certain message on a certain page.
Suppose the name of the page I want to display something on is called "foo_page.html",
How can I do this using javascript?
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 });
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?
Hello all, I have a mod_perl module to intercept the http response fase but I just want to intercept it and satisfy that request... In other words, I want to get the request and return what the client requested... I have something like this:
use strict;
use Apache2::RequestRec (); # for $r->content_type
use Apache2::RequestIO (); # for $r->puts
use Apache2::Const -compile => qw(:common);
sub handler {
my $r = shift;
$r->content_type('text/html');
return Apache2::Const::OK;
}
1;
Apparently it doesn't work...