I want to assign a xml code into a string variable.
I can do this without escaping single or double-quotes by using triple-quote in python.
Is there a similar way to do this in F# or C#?
ok help me only in this question we have m length of pattern and k variable here for (i=0; i <= k; ++i) R[i] = ~1;
instead of k should be m yes? boolean[]R=new boolean[m+1];
look at this algorithm
http://en.wikipedia.org/wiki/Bitap_algorithm
Hi,
i have a stylesheet and a lot of styles with the same border color (#CCCCCC to be precise).
Is there a way to specify some kind of variable and reuse that, so in stead of typing #CCCCCC over and over, i can type
border: 1px solid $bordercolor;
ps i'm using asp.net mvc
Hello,
When i develop a project i create a folder in my project called libs. And in this folder i place all the library jars that i use. Is there a way to add just the libs folder to the class path so that i do not have to add each individual jar?
I was thinking something along the lines of a variable or creating a user library.
Many thanks.
I wonder if syntax as follows would be helpful in your opinion as a code readability improvent and self-commenting of code:
std::map<std::string name, std::vector<int> scores> myMap;
In this example it clearly says and no other comment is needed, what for we are using myMap variable.
Looking forward to your opinions.
I am wondering what this technique is called and what it does. It seems to be validating some regular expression on the variable url. I am customizing another persons code:
var url = document.getElementById("editorURL").value;
if(/(file|http).*/.test(url)) {
}
Maybe someone has a link to an article that explains this a bit more in-depth?
Given a PDF, how can one get the layout mode of a PDF (or relative width/height) using a PHP lib or linux command line tool?
Using http://www.tecnick.com/public/code/cp%5Fdpage.php?aiocp%5Fdp=tcpdf which can set this variable on new PDFs, but for existing pdfs from adobe.
Thought of converting pdfs to ps, or using gs in some other way - like converting it to an image first, and getting the width and height of that. Is this the best way?
I want to send the below data to default.ctp, I want to display menus in all the pages, I'm using Auth, The problem is if I'm logged in I get the Menus correctly, but if I logout, I'm getting error saying variable'$topMenu' not found.
The MenuController can be accessed only if logged in.
$this->loadModel('Menu');
$this->set('topMenu',$this->Menu->find('all'));
Any help on how to solve this?
Hi Stackoverflow,
I have been looking at the source code of raphael (http://raphaeljs.com/index.html) and I see a lot of stuff like !variable && function() (e.g.: !svg.bottom && (svg.bottom = this); )
What does that exactly do? Does it check first and execute only if not true?
Thanks.
Hello.
I have the function with following signature:
void box_sort(int**, int, int)
and variable of following type:
int boxes[MAX_BOXES][MAX_DIMENSIONALITY+1]
When I am calling the function
box_sort(boxes, a, b)
GCC gives me two warnings:
103.c:79: warning: passing argument 1 of ‘box_sort’ from incompatible pointer type (string where i am calling the function)
103.c:42: note: expected ‘int **’ but argument is of type ‘int (*)[11] (string where the function is defined)
The question is why? Whether int x[][] and int** x (and actually int* x[]) are not the same types in C?
In Workflow for reading and writing files the authors use these two lines of code:
var file = air.File.documentsDirectory;
file = file.resolvePath("AIR Test/testFile.txt");
But I think that it's using one variable for two different meanings, isn't it?
Wouldn't it be better to write them as:
var myDocumentsDirectory = air.File.documentsDirectory;
var myTestFile = myDocumentsDirectory.resolvePath("AIR Test/testFile.txt");
Say I have the following code:
public class ClassToTest
{
AnotherClass anotherClass;
public void methodToTest( int x, int y )
{
int z = x + y
anotherClass.receiveSomething( z );
}
}
public class AnotherClass
{
public void receiveSomething( int z ) {.. do something.. }
}
I want to make assertion on the value of the variable z. How do I do this? Variables x, y, and z could be some other Java class types, and I just used "int" for simplicity.
Hey
I'd like to know how to use XMLHttpRequest to load the content of a remote URL and have the HTML of the accessed site stored in a JS variable.
Say, if I wanted to load and alert() the HTML of http://foo.com/bar.php, how would I do that?
Thanks!
I have a form into which the visitor can enter data, and I want to store this data in a mysql database via the $_POST variable. What do I need to prevent sql injection?
Not sure if it's possible but how do I read a resource from a url using javascript without ajax?
for example, the following url is a static text file containing json encoded text
http://mysite.s3.amazonaws.com/jsonencodedcontent.txt
I'd like to use javascript to read the content from above link, read the json content into a javascript variable.
I can't use ajax because of cross site and I have no control over amazon S3 domain.
anyway to achieve this?
How do I parameterize a query containing an IN clause with a variable number of arguments, like this one?
select * from Tags
where Name in ('ruby','rails','scruffy','rubyonrails')
order by Count desc
In this query, the number of arguments could be anywhere from 1 to 5.
I would prefer not to use a dedicated stored procedure for this (or XML), but if there is some fancy SQL Server 2008 specific way of doing it elegantly, I am open to that.
hi,
how could i set a variable with a submit button in order to differenciate 2 behaviours, so first time the same submit button will insert in database and in second time it updates database values.
Thanks.
For example:
In Perl:
@array = (1,2,3);
system ("/tmp/a.sh @array" );
In my shell script, how do I handle this array in shell script? How do I handle the shell script to receive the arguments, and how do I use that array variable in shell script?
Hi so say I have this code:
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle: @"Yay"
message: msg
delegate: self
cancelButtonTitle: @"Proceed..."
otherButtonTitles: @"1", @"2", nil];
How do I control the other buttons "1" and "2"? (Suppose all other necessary code is in place, such as the undefined variable msg)
Thanks!
I know that in community server which means that you can't use Sessions, and few years ago i remember i was working on a website where we were not allowed to use sessions.
In my point of view sessions are a very helpful tool if we managed how to use the right way, but is using session variable in a website is something bad, when its bad and when its not?
I have HTML content stored in a variable. How do I extract data that is found between a set of common tags in the page? For example, I am interested in the data (represented by DATA kept between a set of tags which one line after the other:
...
<td class="jumlah">*DATA*</td>
<td class="ud"><a href="">*DATA*</a></td>
...
int NM_Generator = 1;
//Aray to store thread handles
HANDLE Array_Of_Thread_Handles[1];
//variable to hold handle of North pulse
HANDLE Handle_Of_NM_Generator = 0;
//Create NM_Generator Thread
Handle_Of_NM_Generator = CreateThread( NULL, 0, NMGenerator, &dDifference, 0, NULL);
if ( Handle_Of_NM_Generator == NULL) ExitProcess(NM_Generator);
i want to pass a parameter double value in it how can i do so?
For clarification: I know how evil globals are and when not to use them :)
Is there any performance penalty when accessing/setting a global variable vs. a local one in a compiled C++ program?
i have a properties file (under rsources folder) in which i'm stocking a variable (key=value),
i need to update it when a user insert a new value or update the older one , so can i do it ?
i have doubts because it's a web application so it' simply a war deployed in the server so how it is possible to access the .properties file and change it directly from the code .
if it's not possible is there another solution ?
Any Help will be apprecited
Many thanks