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.
Im just wondering how i use xmlencoder to serialize ArrayList where foo is my own made class.
Do i have to do anything in particular, ie define my own xml structure first and then call toString on each value in my list and write it out?
Can anyone point me to a good tutorial? http://java.sun.com/products/jfc/tsc/articles/persistence4/ Thats what i have been looking at but it doesnt seem to mention what to do with non library classes.
Thanks
What's a good way to keep counting up infinitely? I'm trying to write a condition that will keep going until there's no value in a database, so it's going to iterate from 0, up to theoretically infinity (inside a try block, of course).
How would I count upwards infinitely? Or should I use something else?
I am looking for something similar to i++ in other languages, where it keeps iterating until failure.
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.
I've been trying to jump on the TDD bandwagon for some time now, and it's been going well except for one crucial thing, normally what I end up doing is Test After Development.
I need a mental shift and am wondering how did you force yourself to write tests first?
I'm totally rookie as to PHP. I want to write a PHP script in which it can access a remote cgi via http to get some data. I know that PHP is able to fopen any remote URL and fetch file content, but I concern about the result returned by cgi script, not the script itself.
Hello all, I have been trying to post blogs to Blogger via the API provided for posting but the problem I have is how to write the ruby code for the http post that will be able to carry the texts and make the post. In the API, it is stated that one has to First, create an XML representation of the post to publish.
Please can someone help me with a suggestion. This is the API that was provided: "http://www.blogger.com/feeds/blogID/posts/default"
Hi all, I'm trying to write a bit of jquery which finds all h2 tags inside a div (.content), then appends each one into another div (.intro).
So far I have this:
var h2 = $(".content").find("h2");
$(h2).each(function() {
$(this).append(".intro");
});
But it's not working.. if someone could help me out, that'd be great :)
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
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
Why is it that this works:
$cacheMatchesNotPlayed = $cache->load('externalData');
$cacheMatchesNotPlayed = $cacheMatchesNotPlayed['matchesNotPlayed'];
But this doesn't work:
$cacheMatchesNotPlayed = $cache->load('externalData')['matchesNotPlayed'];
Is there some reason for it? The second bit is easier to write.
I frequently see python code similar to
for line in open(filename):
do_something(line)
When does filename get closed with this code?
Would it be better to write
with open(filename) as f:
for line in f.readlines():
do_something(line)
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.
Hello All
I am using this toolkit to write Excel.Every thing is fine with this, but i am not getting how can i inset image and also put style on some rows on my excel
http://excelpackage.codeplex.com/wikipage?title=Creating%20an%20Excel%20spreadsheet%20from%20scratch&referringTitle=Home
i am using c#
I'd like to be able to just write a class and get a table generated in my DB along with all the properties of that class. In EJB it's possible to let the container handle the data and "sync" with the DB. I'd like something like this in VS2008 with C# .NET and ASP.NET.
Is there anything remotely like this on the market?
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 need to divide a scene in to two layers. So that I can write same methods for two layers.
So I may get two functionalities. But can I make that ? Is there a possibility in cocos2d?
Thank You
I would really like to provide the user some scripting capabilities, while not giving it access to the more powerful features, like altering the DOM. That is, all input/output is tunneled thru a given interface. Like a kind of restricted javacsript.
Example:
If the interface is checkanswer(func)
this are allowed:
checkanswer( function (x,y)={
return x+y;
}
but these are not allowed:
alert(1)
document.write("hello world")
eval("alert()")
I am attempting to write a LaTeX package which leverages the minted package's \inputminted command. My \mycommand command takes two parameters, the first being a path to a file, and I want to pass the file's extension to the \inputminted command:
\newcommand\mycommand[2]{
\inputminted{#1}{...}
}
Note that the above won't work since the full path is passed to \inputminted.
Example:
\mycommand{/path/to/Test.java}{blah}
should invoke
\inputminted{java}{...}
I'm currently writing out xml and have done the following:
header ("content-type: text/xml");
header ("content-length: ".strlen($xml));
$xml being the xml to be written out. I'm near about 1.8 megs of text (which I found via firebug), it seems as the writing is taking more time than the script to run.. is there a way to increase this write speed?
Thank you in advance.
Hi
I want to write a simple client that downloads a file from a server using only bsd sockets.
I searched the web but couldn't find anything helpful. Can you give me a direction?
Thanks
Alex
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!
I've heard many things about performance in C; casting is slow compared to normal assignments, functional call is slow, binary operation are much faster than normal operations, et cetera...
I'm sure some of those things are specific to the architecture, and compiler optimization might make a huge difference, but I would like to see a chart to get a general idea what I should do and what I should avoid to write high-performance programs. Is there such a chart (or a website, a book, anything) ?
hello everyone
i have a series of PDF byte arrays in a arraylist files that i wish to concatenate into one file,
currently when the PDF application trys to open the file is it corrupted:
foreach (byte[] array in files)
{
using (Stream s = new MemoryStream(downloadbytes))
{
s.Write(array, 0, array.Length);
}
}
downloadbytes is the resultant concatenated array of bytes below is another implementation which also failed
foreach (byte[] array in files)
{
System.Buffer.BlockCopy(array, 0, downloadbytes, offset, array.Length);
offset += array.Length;
}
any pointers?