I need to write such a define in C++
#define scanf( fscanf(inf,
in order to replace each scanf( with fscanf(inf, literary
But I do not know how...
Thanks
I've looked around for an answer to this, no luck.
what i want to do is replace:
http://localhost/mysite/admin/something
with:
http://localhost/mysite/admin/?p=something
Here's the best formula I came up with since yesterday:
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^(superv/)([^\?/]+)$ $1\?p=$2 [NC]
Yet it's not working.
Note:
It think the "RewriteBase" thingy has nothing to do with the problem because this line is working like a charm:
RewriteRule ^(javascripts/main\.js)$ $1\.php [NC]
Any ideas? thanks in advance.
My C code contains many functions with pointers to different structs as parameters which shouldn't be NULL pointers. To make my code more readable, I decided to replace this code:
if(arg1==NULL || arg2==NULL || arg3==NULL...) {
return SOME_ERROR;
}
With that macro:
NULL_CHECK(arg1,arg2,...)
How should I write it, if the number of args is unknown and they can point to different structs?(I work in C99)
I have this code:
a=[['a','b','c'],['a','f','c'],['a','c','d']]
for x in a:
for y in x:
if 'a' in x:
x.replace('a','*')`
but the result is:
a=[['a','b','c'],['a','f','c'],['a','c','d']]
and bot a=[['b','c'],['f','c'],['c','d']]
What should I do so the changes will last?
I have set new division on postgress pg_operator table because i want tath when is division by zero return 0.
i have write this:
create operator / ( procedure = zero_division, leftarg = double precision, rightarg = double precision);
where zero_division is:
CREATE OR REPLACE FUNCTION zero_division(double precision, double precision)
RETURNS double precision AS
'select case when $2 = 0 then 0 else $1 / $2::real end;'
LANGUAGE sql IMMUTABLE
COST 100;
when i run value/ 0 i get error of division.
I just want an update trigger like this postgresql version... It seems to me there is no NEW. and OLD. in MSSQL?
CREATE OR REPLACE FUNCTION "public"."ts_create" () RETURNS trigger AS
DECLARE
BEGIN
NEW.ctime := now();
RETURN NEW;
END;
Googled already, but nothing to be found unfortunately... Ideas?
Hello
How to check a value IS NULL [or] = @param (where @param is null)
Ex:
Select column1 from Table1
where column2 IS NULL = works fine
If I want to replace comparing value (IS NULL) with @param. How can this be done
Select column1 from Table1
where column2 = @param = this works fine until @param got some value in it and if is null never finds a record.
How can this achieve?
Hello
i just wander where can i find a tool that takes in my case java script string that is
unescape and converting it to escaped string so i could use it as string value in c++
for example characters like " i need to convert it to \"
i need something smart and not just replace all function .
Dear Friends
I want to get a word document from data base by ASP.Net and show it on Internet Explorer, then I want to edit some text and replace this document with the original one, exactly same as Sharepoint. I couldn't find any tutorial or example for this situation. could you please help me?
Shahrooz
Hi,
i would like to replace the lines
function *{
by
function *{echo "The function starts here."
where * is what ever.
Any idea how to do that in Python?
Regards
Javi
I wanna write but \n seems not to be working. What should I replace \n with?
(I read in the books they said that to print @ and % we use %40 and %25, so I guess the should be a number for the new-line).
Any suggestions? Please help!
Hi ,
I want to display a dynamic error message ,i am having the code as
ActionMessages errors = new ActionMessages();
errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("error.plan.foundForUser"));
saveErrors(request, errors);
error.plan.foundForUser={1} Not Found
I want to replace 1 with a dynamic value,how to do so ?
I have a view that only has a button UIButton. First time clicking the button will draw a square above the button and the second time will replace the square with a circle.
I need some help on writing the controller code. Please guide me to the right path. Thanks
Below I have some jQuery that runs through each table with the classname = sizetable
I would like to execute this:
$("#frontshade :radio").click(function() {});
But I'm not sure how to replace the "#frontshade" with the id from the array
var table_ids = new Array();
$('.sizetable')
.each(function(e){
table_ids[] = $(this).attr('id');
// JQUERY TO EXECUTE ON EACH TABLE
$("#frontshade :radio").click(function() {};
//
});
Thanks in advance for any answers
I want to access a MovieClip in another scene than I'm currently in.
More specific I want to set a TextField to a certain value from a "preloader"-scene. This is for handling totally dynamic language phrases. Maybe this is the wrong way.
I'm loading a XML with language phrases that I want to replace the textfields with.
We could do this by altering all MovieClips, but I think this could be a smart solution, if it's possible! :)
I have current ApplicationContext and I want to replace it by newAppContext
ApplicationContext currentAppContext = getOldAppContext ();
ApplicationContext newAppContext = loadAppContext ();
If i do:
currentAppContext.stop();
currentAppContext.close();
currentAppContext= newAppContext;
And then try:
currentAppContext.getBean("SampleBean");
I have follow error:
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
How to substitute spring context?
example
i draw UIImageView inside UIView with a.png
then i rotate my device
is it possible to draw another picture to replace my current picture(a.png) ?
The following example is working when I manualy replace T wirh char *, but why is not working as it is:
template <typename T>
class A{
public:
A(const T _t) { }
};
int main(){
const char * c = "asdf";
A<char *> a(c);
}
When compiling with gcc, I get this error:
test.cpp: In function 'int main()':
test.cpp:10: error: invalid conversion from 'const char*' to 'char*'
test.cpp:10: error: initializing argument 1 of 'A<T>::A(T) [with T = char*]'
products purchased
--------------------------
bana
bana
bana
stra
kiwi
reward requirements table (related to a rewards table)
reward id, products
----------------------
1,bana
1,bana
1,bana
2,stra
2,bana
3,stra
4,cart
5,bana
5,bana
5,oliv
Can you help me with sql to get rewards
the products purchased qualifies for?
In the case above the reward ids would be:
1
2
3
If there is a better design that would make the solution easier I welcome those as well. I'm using product names for the sake of easier explaining, I hope. (I'll replace with product ids later)
CREATE OR REPLACE PROCEDURE p_createLocaltable
IS
table_already_exist EXCEPTION;
PRAGMA EXCEPTION_INIT (table_already_exist, -00955);
BEGIN
create table local_table as
select * from supplied_table
where rownum < 1;
EXCEPTION
when table_already_exist then
DBMS_OUTPUT.put_line('Table already exists , does not need to recreate it');
END;
can anyone see any problem of the above code?
I have a string that looks like "(3) New stuff" where 3 can be any number.
I would like to add or subtract to this number.
I figured out the following way:
var thenumber = string.match((/\d+/));
thenumber++;
string = string.replace(/\(\d+\)/ ,'('+ thenumber +')');
Is there a more elegant way to do it?
Hi,
i have two tables
Order(id, date, note)
and
Delivery(Id, Note, Date)
I want to create a trigger that updates the date in Delivery when the date is updated in Order.
I was thinking to do something like
CREATE OR REPLACE TRIGGER your_trigger_name
BEFORE UPDATE
ON Order
DECLARE
BEGIN
UPDATE Delivery set date = ??? where id = ???
END;
How do I get the date and row id?
thanks
Hi,
I thought what I was trying to do is quite simple, but apparently nothing related to IE is ever simple.
I'm using this with javascript and ajax - document.getElementById("calender").innerText=mypostrequest.responseText
it works fine in ff and IE7, but not IE8. I suspect it's because the text contains a table, since I have tested it with other text. I cant replace the table. Is there any way to get around this?
Using bash, I have a list of strings that I want to use to replace an int. Here's an example:
day1=Monday
day2=Tuesday
day3=Wednesday
day4=Thursday
day5=Friday
day6=Saturday
day7=Sunday
If I have an int, $dow, to represent the day of the week, how do I print the actual string? I tried this:
echo ${day`echo $dow`}
but get error of "bad substitution". How do I make this work? Note: I can change the $day variables to a list or something.