Looking at the information under the heading "Precision can be omitted or be any of:".
The example: printf("%.*s", 3, "abcdef"); works, outputting:abc (truncating the rest of the string.)
Now, I would like to have a string with multiple parameters formatted (truncated):
printf("%.*s, %.*s", 3, 3, "abcdef", "xyz123");
but the program crashes.
What is the correct syntax?
Thank You.
Hello,
I am using a regular expression search to match up and replace some text. The text can span multiple lines (may or may not have line breaks).
Currently I have this:
$regex = "\<\?php eval.*?\>"
Get-ChildItem -exclude *.bak | Where-Object {$_.Attributes -ne "Directory"} |ForEach-Object {
$text = [string]::Join("`n", (Get-Content $_))
$text -replace $RegEx ,"REPLACED"}
I am using OleDB for executing my queries in C#,
Is there any way I can execute multiple queries in one command statement?
I tried to separate them with semi-colon (;) but it gives error "Characters found at the end"
I have to execute a few hundreds of queries at once.
Hi,
How can i copy multiple char* variables into one char* at single instance operation.
say i have
char* text1 = "Hello";
char* text2 = "World";
i want to copy text1, text2 and '2' and "12345" into char* text3 in single function call.
I have some of the basic coding down for the program but I do need assistance with something. My goal is to have an alarm go off on multiple PC's in a network indicating that a certain task needs done. Anyone who receives this alarm may stop it, complete the task and log that they did that. What would be the best way to accomplish this in a network? But not every computer in the network will be running this program, just a few.
Is it possible to use multiple @RequestMapping spring annotations in a method? Like:
@RequestMapping("/")
@RequestMapping("")
@RequestMapping("/welcome")
public String welcomeHandler(){
return("welcome");
}
If I have a string
"this is a string"
How can I shorten it so that I only have one space between the words rather than multiple? (The number of white spaces is random)
"this is a string"
I need to share a huge dictionary (around 1 gb in size) between multiple processs, however since all processes will always read from it. I dont need locking.
Is there any way to share a dictionary without locking?
The multiprocessing module in python provides an Array class which allows sharing without locking by setting
lock=false
however There is no such option for Dictionary provided by manager in multiprocessing module.
If I need to check multiple conditions, which is the preferred way with respect to performance
if( CND1 && CND2 && CND3 && CND4)
{
}
else
{
}
or
if(CND1)
{
if(CND2)
{
if(CND3)
{
if(CND4)
{
}
else
{
}
}
else
{
}
}
else
{
}
}
}
Hi,
In an if statement with multiple conditions is second executed if the outcome is clear after checking the first condition?
example:
if(i>0 && array[i]==0){
}
If I swap the conditions a seg fault may occur for negative values of i but this way the memory debugger doesn't find a problem. Can I be sure that this works always or do have have to use nested if statements?
I've banging my head for hours, it seems simple enough, but here goes:
I'd like to create a view using multiple select statements that outputs a Single record-set
Example:
CREATE VIEW dbo.TestDB
AS
SELECT X AS 'First'
FROM The_Table
WHERE The_Value = 'y'
SELECT X AS 'Second'
FROM The_Table
WHERE The_Value = 'z'
i wanted to output the following recordset:
Column_1 | Column_2
'First' 'Second'
any help would be greatly appreciated!
-Thanks.
I understand the idea of generating a form token and storing it in a session, and also putting it as a hidden input in my forms.
But how could I make this work if I have pages with multiple forms, is it still safe to use the same token for each form?
And I still feel weary about bots and stuff on my website, can these form tokens really safely replace CAPTCHAs?
I want to generate multiple pdf reports on click of single print button and zip all the pdf's and store it in a folder.
Any help please. I need this functionality in my project.
If I have a string
"this is a string"
How can I shorten it so that I only have one space between the words rather than multiple? (The number of white spaces is random)
"this is a string"
Say I have multiple EditTexts in an application. When I click a Button, I want to test what EditTexts are empty and what EditTexts have content. How would I do that? Could someone write the code for the Button click handler.
If one has a number of databases (due to separate application front-ends) that provide a complete picture - for example a CRM, accounting, and product database - what methods are available to centralize/abstract this data for easy reporting?
Essentially, I'm wondering if there is a way to automatically pull data from multiple databases into a central repository that is continuously updated from the three databases and which can be used for reporting?
I'm also open to alternative best practice suggestions?
I saw some comments on forums, and it seems that people want to be able to inherit from multiple classes in c#. Why would you ever need this? I can't think of any use for this, but since there's people that want it, there's got to be some.
For example, what Wordpad did when I press "Ctrl+C"?
It places many different format to clipboard. So Notepad can get the text without any color or font...etc, and you still can keep the original format when you paste in another Wordpad window.
The MSDN said I should call SetClipboardData multiple times. But it doesn't work at all.
I'm trying to write a store procedure that can take some input parameters (obviously), run multiple queries against those, taking the output from those and doing calculations, and from those calculations and the original queries, outputting a formatted text string like:
Number of Rows for max(Z) matching condition x and y of total rows matching x (x&y/x*100).
To explain the max(Z) bit, this will be the username field, it won't matter which actual entry is picked, because the where clause will filter the results by user id, is there a saner way to do this?
X.c >>
-------------------------
int i;
main ()
{
fun ();
}
-------------------------
Y.c >>
int i;
fun ()
{
}
why does these two files compile with no error ? (using GCC)
but if i use int i = 10;
throws multiple definition error
Is it possible to send an email to multiple recipients, but on the receiving end, the recipient will only see his/her email address? If so how do I do this and could you point me to some references?
Thanks
In the process of changing some code, I have spilt some functions into multiple files. I have the files controls.cpp and display.cpp and I would like to be able to have access to the same set of variables in both files. I don't mind where they are initialized or declared, as long as the functions in both files can use them.
This was not an issue when the functions were in the same file, but now it seems almost impossible after an hour of googling and trying various things.
hi any one know how to have multiple twitter account in one iphone application using objective c. Is there any session concept is there. Am currently using MGTwittEngine API. Any one please guide me, with possible sample code. Thanks in advance.