I would like to know if my .Net code can write into Windows log--Application part of the Event Viewer on Windows 2008 server and Windows 7 if I am a Non-administrator user.
I need a nginx rewrite rule to rewrite from:
http://some-keyword.example.com to www. example.com/keyword.php?keyword=$some-keyword
while domain without www in front still rewrites to www.example.com and 'www' isn't taken as a keyword.
Please could you help me to solve this problem, how to write these two rules?
hi all,
is it possible to write database methods in properties file, like some database queries and can be accessed using servlets which may reduce the code?
please any body help
I know it's a simple question but I really can't find anything on Google. Sorry if I'm not searching right.
I created 2 pages and in the first one I have a button.
What should I write in the C# code to change to redirect me on the second page?
I usually know my way around C# but I'm totally new in ASP.
I am wondering how to write this query.
I know this actual syntax is bogus, but it will help you understand what I am wanting.
I need it in this format, because it is part of a much bigger query.
SELECT distributor_id,
COUNT(*) AS TOTAL,
COUNT(*) WHERE level = 'exec',
COUNT(*) WHERE level = 'personal'
I need this all returned in one query.
Also, it need to be in one row, so the following won't work:
'SELECT distributor_id, COUNT(*)
GROUP BY distributor_id'
I followed this tutorial:
http://stackoverflow.com/questions/2025449/how-to-install-ruby-on-rails-alongside-wampserver
After adding D:\wamp\ruby\bin (my wamp folder is in D:) to my Path and write gem install rails in the command line I get 2 error which says that the following files couldn't be found:
SSLEAY32.dll
zlib.dll
Here is the screenshot:
I want to write a map/reduce job to select a number of random samples from a large dataset based on a row level condition. I want to minimize the number of intermediate keys.
Pseudocode:
for each row
if row matches condition
put the row.id in the bucket if the bucket is not already large enough
Have you done something like this? Is there any well known algorithm?
A sample containing sequential rows is also good enough.
Thanks.
For expressions like 3+4 I would like to use the value 7 in an intermediate representation tree.
I cannot work out how to get the returns value into a rewrite rule.
expression returns [int v]:
etc.
How do I get expression.v into WR? At the moment I get (+ 3 4), I want (7)
|^( WRITE c=expression) - ^(WRINT ^(INTC ^($c))
the next step is to emit 7 in an assembler.
We do this using the 'Advanced' button on the checkin dialog now (with Merant, nee PVCS) but the 'Advanced' button is disabled when I set TFS as my SCC provider. Is there a switch we can flip on either side to enable this?
Or do we need to write some custom extension?
Or can I get the TFS changeset number to associate with the change in PB?
Or am I coming at doing selective builds entirely the wrong way?
I have a methor to return pagecontent of link
but when it run, alway return "Do not perrmisson ", plesea check it
here is code to return string pagecontent
public static String getPageContent(String targetURL) throws Exception {
Hashtable contentHash = new Hashtable();
URL url;
URLConnection conn;
// The data streams used to read from and write to the URL connection.
DataOutputStream out;
DataInputStream in;
// String returned as the result .
String returnString = "";
// Create the URL object and make a connection to it.
url = new URL(targetURL);
conn = url.openConnection();
// check out permission of acess URL
if (conn.getPermission() != null) {
returnString = "Do not Permission access URL ";
} else {
// Set connection parameters. We need to perform input and output,
// so set both as true.
conn.setDoInput(true);
conn.setDoOutput(true);
// Disable use of caches.
conn.setUseCaches(false);
// Set the content type we are POSTing. We impersonate it as
// encoded form data
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
// get the output stream .
out = new DataOutputStream(conn.getOutputStream());
String content = "";
// Create a single String value pairs for all the keys
// in the Hashtable passed to us.
Enumeration e = contentHash.keys();
boolean first = true;
while (e.hasMoreElements()) {
// For each key and value pair in the hashtable
Object key = e.nextElement();
Object value = contentHash.get(key);
// If this is not the first key-value pair in the hashtable,
// concantenate an "&" sign to the constructed String
if (!first)
content += "&";
// append to a single string. Encode the value portion
content += (String) key + "="
+ URLEncoder.encode((String) value);
first = false;
}
// Write out the bytes of the content string to the stream.
out.writeBytes(content);
out.flush();
out.close();
// check if can't read from URL
// Read input from the input stream.
in = new DataInputStream(conn.getInputStream());
String str;
while (null != ((str = in.readLine()))) {
returnString += str + "\n";
}
in.close();
}
// return the string that was read.
return returnString;
}
I am attempting to code some plugins to use with MIDI sequencers but have hit a stumbling block. I can't use global-scope variables to store information because multiple instances of the .dll can exist which share memory.
How do I create a class (for re-usability purposes in other plugins) containing 2 dimensional array and other variables the content of which is to be shared between functions? If that is possible, how would I read and write the data from the function in the framework where I do the processing?
In C#, can multiple threads read and write to a Dictionary provided each thread only accesses one element in the dictionary and never accesses another?
Hello!
I want to write an application that reads blogpost from the internet and then present in my own way.
The blogposts are stored in databases, so I figured that the only thing I had to do was to query an online database for the posts that I want to show.. But I can´t find a way to opoen a connecion to an online database...
anyone out there with a solution to my problem?
//Narancha
I want to write a macro that spits out code based on the boolean value of its parameter. So say DEF_CONST(true) should be expanded into "const", and DEF_CONST(false) should be expanded into nothing.
Clearly the following doesn't work because we can't use another preprocessor inside #defines:
#define DEF_CONST(b_const) \
#if (b_const) \
const \
#endif
Any idea about how to do it?
I am running SQL Server 2005 and I want to dump some dummy data into a large table with about 50 columns (I did not design it :P) - anyone know a tool to do this automatically? I want the rows to have all sorts of different data, and I would rather not write a script if there is already a tool out there - thanks.
I'm trying to write tests for some legacy code with PHPUnit 3.4.9, but it seems that all my global variables are invisible.
How can I access global variables inside PHPUnit 3.4.9?
I have a mysql database that stores quotation documents with some products that are clearly defining the price of each product in them, and a table for contracts storing contract details as well as customer code and quotation code to which it belongs. I have the following query to see how much is the total price of the quotation to write it in the invoice:
select
sum(sqproducts.price * sqproducts.quantity) as 'total-price',
squotations.currency as 'currency'
from
sqproducts,
ccontracts,
squotations
where
sqproducts.contracted=1
AND squotations.code=sqproducts.quotation_code
AND sqproducts.quotation_code=ccontracts.squotation_code
AND sqproducts.quotation_code='QUOT/2012/1'
group by
currency
This will sound naive (but then I am a junior programmer), but if I write a web service say in Python (standard WSDL web service), I then need to host it so it is reachable from an end point.
This will give a URI for the service and then from another language, say Java or VB.NET (any), I can add a web service (this one) and then call the web service's object model, correct?
Thanks
On Linux, normally I use ptrace function to trace all syscall, and kill the process if the it tries to do anything harmful to my machine, such as system("shutdown -s -t 00") or so.
Is there a way for me to do this on Windows?
EDIT: I want to write Sandbox program to limit time and memory usage of its child that can work on both Windows and Linux, and now it can only run on Linux via ptrace
Hi,
I have a Perl script running in mod_perl that needs to write a large amount of data to the client, possibly over a long period. The behavior that I observe is that once I print and flush something, the buffer memory is not reclaimed even though I rflush (I know this can't be reclaimed back by the OS).
Is that how mod_perl operates and is there a way that I can force it to periodically free the buffer memory, so that I can use that for new buffers instead of taking more from the OS?
I'm going to write a program that plots data from a sensor connected to the computer. The sensor value is going to be plotted as a function of the time (sensor value on the y-axis, time on the x-axis). I want to be able to add new values to the plot in real time. What would be best to do this with in C++?
Edit: And by the way, the program will be running on a Linux machine
I have 2 dimensional table in file, which look like this:
11, 12, 13, 14, 15
21, 22, 23, 24, 25
I want it to be imported in 2 dimensional array. I wrote this code:
INTEGER :: SMALL(10)
DO I = 1, 3
READ(UNIT=10, FMT='(5I4)') SMALL
WRITE(UNIT=*, FMT='(6X,5I4)') SMALL
ENDDO
But it imports everything in one dimensional array.
Hello,
I have a slow mySQL query in my application that I need to re-write. The problem is, it's only slow on my production server and only when it's not cached. The first time I run it, it will take 12 seconds, then anytime after that it'll be 500 milliseconds.
Is there an easy way to test this query without it hitting the query cache so I can see the results of my refactoring?
Thanks!