$a = "sad day
Good day
May be Bad Day
";
$a=~s/\w+ \w+/_/gm;
print $a;
I am trying to subsitue with _ all spaces between words .
But its not working . What is wrong with that.
I have a bunch of types (eg. LargePlane, SmallPlane) that could be in this collection i've made, how do i print like LargePlane? I've tried like typeOf() and stuff but it doesn't work. Within like a toString()? So when i output the collection it states what type it is.
What classes do you use to make string placeholders work?
String template = "You have %1 tickets for %d",
Brr object = new Brr(template, {new Integer(1), new Date()});
object.print();
I am completely new to this game, so please be gentle ;-)
I made an example program in Fortran 90, lets call it 'program.f90'.
I compile it:
g95 program.f90
It creates an executable called a.out
How do I run this? It is supposed to print something to the screen, and get input from me, but I cannot figure out how to!
Hi,
Being quite new with PHP, I cannot find any solution why this does not work. The query is OK and the resource is returned. But I dunno why fetch_assoc does not print values. Thanks
$query=sprintf("SELECT ID,NAME FROM USERS WHERE PASS='%s' AND NAME='%s'",mysql_real_escape_string($p),mysql_real_escape_string($n));
$result=mysql_query($query);
if ($result)
{
while ($row = mysql_fetch_assoc($result)) {
echo $row['ID'];
echo $row['NAME'];
}
}
}
I'm new to python and kind of been chucked in the deep end at work.
If i had a script which has creates a list such as below:
test = 'string'
l = []
for i in test:
l.append(i)
print l
How would i send that this to another python script?
I used strtol to convert a string to hex, now I need to print it to the screen. I'm not sure if I can use sprintf since I only have 20k of memory to use on this board. Alternatives welcome.
Hey,
In my asp.net application I create pdf file and save it in App_Data folder on server. Next I want to open this file that user can print it.
How to open this file in browser ? Send it in http header etc ? Someone have some examples?
Please help ;)
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! :)
may be this is a sizzle question but please help
void Temp1::caller()
{
char *cc=Called();
printf("sdfasfasfas");
printf("%s",cc);
}
char *Temp1::Called()
{
char a[6]="Hello";
return &a;
}
Here how to print Hello using printf("%s",cc);
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?
can somebody help me, how can I filter my file, inside the file I have rows with 3, 4, 5 elements, I want print using echo only these which have 5 elements, thanks in advance (I'm talkin about scripts)
I have simple template that's html mostly and then pulls some stuff out of SQL via PHP and I want to include this template in three different spots of another php file. What is the best way to do this? Can I include it and then print the contents?
Example of template:
Price: <?php echo $price ?>
and, for example, I have another php file that will show the template file only if the date is more than two days after a date in SQL.
hi everybody fisrt of all this is not homework and now question is like this suppose
i have array int a[]=new int[]{0xBCDA,0xABFE,0xBCAD,0xEFCA,0xFFCA} i know that there is always some hexadecimal number which occurs in all number or in this case A is repeat in array everywhere so my aim is print only repeat number and other numbers should be zero
so my new array should be like this
0x000A, 0xA000,0x00A0 0x000A,0x000A any idea please help me?
p.s please nobody say that this is homework
I'm sure I once found a unix command which could print the common lines from two or more files, does anyone know its name? It was much simpler than diff.
please see the following code
// redirect to success page
if ($success){
header( 'Location: ../Scripts/_lib/phpmailer-fe.php');
}
else{
print "<meta http-equiv="refresh" content="0;URL=error.html">";
}
its not working
class a(object):
c=b()# how to call the b method
d=4
def __init__(self):
print self.c
def b(self):
return self.d+1
a()
how to call the 'b' method not in the __init__
thanks
I'm trying to use the method for naming a lua package after the filename mentioned here, however _REQUIREDNAME is never defined. For example I have these two files
samplePackage.lua:
print("_REQUIREDNAME: ", _REQUIREDNAME)
return nil;
packageTest.lua:
require "samplePackage"
And when I run packageTest.lua it outputs > _REQUIREDNAME: nil
I also couldn't find any mention of _REQUIREDNAME in the Lua 5.1 Refrence manual, so was this removed from the language, or am I missing something?
I try two use sidewaysfigure from the rotating package in the twosided memoir class. The resulting figures look correct in the pdf that is generated, with the page rotated by 90 degrees.
However, when I print the document (on linux, using CUPS), some of the pages with a sidewaysfigure are upside down (rotated by 180 degreeS).
At some places in my code, I print debug messages like this:
int ret = getLinkSpeed(device.getSysName(), linkSpeed);
if (ret < 0)
{
logDebug("Failed to obtain port speed for this device. Error: " + std::string(strerror(errno)));
}
From the documentation it is not entirely clear if strerror will return 0 under certain conditions (which would cause my code to crash). Does anyone know if it's safe?
I have a large auditing stored procedure that prints values and runs some SELECT statements. When running within SQL Management Studio we have the use select to display "Results to Text" so all of the SQL results and print statement display in one place.
Now I need to have some C# code also call this auditing procedure at the end of the process and basically store all data that would be in the "Results to Text" window into a .txt file.
How can this be done?
I been hitting a wall thats been keeping me from tinkering on a game.
class Damage:
def shortsword():
shortsword=randint(1,6)+1
shortsword=int(shortsword)
return shortsword
I been wanting this number to pop up as part of a message on print and then use the same number as part of another function to help with subtracting of health on the target. Though each time I grab this it is always going to change.
How would I print the multiples of a list of given numbers in a merged, sorted list?
I.e.
take 10 (multiples [4,5])
gives
4,5,8,10,12,15,16,20,24,25
I've got it working for lists of size 2 or 1 but I need a more general solution :)
Python beginner here, I have a list of lists and want to refer to a specific part of that list.
For example
lol = [[1, 2, 4], [6, 7, 8], [9, 10, 14]]
If I just want to print the first item in one of the lists, eg the 1, 6 or 9, how would I do that?
I can only find ways to refer to each of the lists seperately eg lol[0] but not to then refer to an item within that list.
Thank you in advance for your help!
Cheers