For Testing x509 certificate.I expanded the Default Website node in IIS 7.5.When i right click there is no properties option in popup menu.How to include it?
For some reason this code will not seem to run in the interpreter. When I hit F5 nothing happens, not even the debugger seems to recognize it. I assume it has something to do with the class, as when removed the interpreter seems to recognize the rest of the code. Please tell me what I am doing wrong.
Edit: I have restarted the interpreter multiple times, any other piece of code I try to load runs fine, just this one is having trouble.
print ('Why won't this work?')
class sorting_class:
def __init__(self):
self.order = ['a', 'b', 'c', 'd']
self.globali = 0
self.orderi = 0
self.sortedlist = []
def sort(self, array):
carry, leave = []
for arrayi in array:
print ('run', arrayi)
if self.order[self.orderi] == arrayi[self.globali]:
carry.append(arrayi)
else:
if self.globali != 0:
leave.append(arrayi)
return carry, leave
def srt(self, array):
globalii = 0
carry, leave = my.sort(array)
while len(self.sortedlist) != len(array):
if len(self.carry) == 1:
self.sortedlist.append(carry)
arrayt = leave
self.globali = 1
self.orderi = 0
carry, leave = my.sort(arrayt)
elif len(self.carry) == 0:
if len(self.leave) != 0:
arrayt = leave
self.globali = 1
self.orderi += 1
my.sort(arrayt)
else:
self.arrayt
globalii += 1
self.orderi = globalii
self.globali = 0
my.sort(arrayt)
self.orderi = 0
else:
arrayt = carry
carry = []
self.globali += 1
carry, leave += my.sort(arrayt)
my = sorting_class()
x = ['ac', 'bc' ,'ab', 'da']
my.srt(x)
Hi,
I need a tool which generates random JSON objects. I want to use this tool to do testing on my HTTP POST requests and use the random JSON object in it.
Any suggestions?
I have several web projects built with Symfony v1.0, but I am excited by the new features in Symfony version 1.4 (Improved security, native email support and improved performance).
How can I continue to develop my 1.0 projects but also create a testing environment for version 1.4?
I need it in FlexUnit to test private methods. Is there any possibility to do this via reflection by using describeType or maybe flexUnit has some build in facility? I dislike artificial limitation that i cannot test private functions, it greatly reduces flexibility. Yes it is good design for me to test private functions, so please do not advise me to refactor my code. I do not want to break the encapsulation for the sake of unit testing.
final Intent emailIntent = new Intent(Intent.ACTION_SEND);
emailIntent.setType("image/jpeg");
emailIntent.putExtra(Intent.EXTRA_EMAIL, new String[] { "[email protected]" });
emailIntent.putExtra(Intent.EXTRA_SUBJECT, "this is the test");
emailIntent.putExtra(Intent.EXTRA_TEXT, "testing time");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse(url));
I have something that looks like this:
<s:select ... onchange="javascript:alert('testing')"/>
But when I run it and look at using firebug, the onchange is not there and so the javascript is not executed. Any ideas? This is driving me nuts.
I'm new to java, i want to write an comparator to that will let me sort TreeMap by value instead of the default natural sorting. i tried something like this, but can't find out what went wrong:
import java.util.*;
class treeMap {
public static void main(String[] args) {
System.out.println("the main");
byValue cmp = new byValue();
Map<String, Integer> map = new TreeMap<String, Integer>(cmp);
map.put("de",10);
map.put("ab", 20);
map.put("a",5);
for (Map.Entry<String,Integer> pair: map.entrySet()) {
System.out.println(pair.getKey()+":"+pair.getValue());
}
}
}
class byValue implements Comparator<Map.Entry<String,Integer>> {
public int compare(Map.Entry<String,Integer> e1, Map.Entry<String,Integer> e2) {
if (e1.getValue() < e2.getValue()){
return 1;
} else if (e1.getValue() == e2.getValue()) {
return 0;
} else {
return -1;
}
}
}
I guess what am i asking is what controls what get pass to comparator function, can i get an Map.Entry pass to comparator?
Is there any tool or framework able to make it easier to "unit test" distributed software written in Java? My system under test is a peer-to-peer software, and I'd like to perform testing using something like PNUnit, but with Java instead of .Net.
Generally I use lxml for my HTML parsing needs, but that isn't available on Google App Engine. The obvious alternative is BeautifulSoup, but I find it chokes too easily on malformed HTML. Currently I am testing libxml2dom and have been getting better results.
Which pure Python HTML parser have you found performs best? My priority is the ability to handle bad HTML over speed.
I am working on a desktop application using the Qt framework and Qt Creator IDE. I am doing my development on mac, and would like to begin testing on Windows as well. I am having trouble finding documentation on how do this. What's is the best way to develop on mac and automate windows builds of a Qt Creator project?
Im testing something where im compiling some code and analysing output with a perl script.
So first i run make, manually copy&paste the output to errors.txt and then running my perl script (running: perl analysis.pl) in terminal.
Is there away I can do this just with one line in bash?
I'm trying to figure out if the C Standard (C90, though I'm working off Derek Jones' annotated C99 book) guarantees that I will not lose precision multiplying two unsigned 8-bit values and storing to a 16-bit result. An example statement is as follows:
unsigned char foo;
unsigned int foo_u16 = foo * 10;
Our Keil 8051 compiler (v7.50 at present) will generate a MUL AB instruction which stores the MSB in the B register and the LSB in the accumulator. If I cast foo to a unsigned int first:
unsigned int foo_u16 = (unsigned int)foo * 10;
then the compiler correctly decides I want a unsigned int there and generates an expensive call to a 16x16 bit integer multiply routine. I would like to argue beyond reasonable doubt that this defensive measure is not necessary. As I read the integer promotions described in 6.3.1.1, the effect of the first line shall be as if foo and 10 were promoted to unsigned int, the multiplication performed, and the result stored as unsigned int in foo_u16. If the compiler knows an instruction that does 8x8-16 bit multiplications without loss of precision, so much the better; but the precision is guaranteed. Am I reading this correctly?
Best regards,
Craig Blome
One way of thinking about this is: if we care about the Design of the code then Easymock is the better choice as it gives feedback to you by its concept of expectations
If we care about the maintainability of tests( easier to read,write and having less brittle tests which are not affected much by change), then Mockito seems a better choice.
My question is:
- If you have used Easymock in large scale projects, do you find that your tests are harder to maintain?
- What are the limitations of Mockito( other than endo testing)
If I'm returning ["foo"] from a RESTful web query, Which of these is more proper? Will pedantic REST parsing die on the newline?
["foo"]\n (with newline, Content-Length=8)
["foo"] (no newline, Content-Length=7)
For easy regression testing I like the form with the newline, but I want to make sure I won't be breaking any application frameworks that might have a more strict view of the REST format.
lam1=0.0:0.1:4.0
lam = 1.60*lam1 - 0.30*lam1^2 FOR 0<lam1<=1
lam = lam1 + 0.30 FOR 1<=lam1<=4
I have a bunch of those. What would be the 'matlab way' of writing that kinda stuff, short of simple looping by indexes and testing the values of lam1 ?
Does anyone have an example of using Apache Qpid within a standalone junit test.
Ideally I want to be able to create a queue on the fly which I can put/get msgs within my test.
So I'm not testing QPid within my test, I'll use integration tests for that, however be very useful to test methods handling msgs with having to mock out a load of services.
Hi,
I'm planning to test my Linux box and I want to start in memory testing. But my problem is what should I need to test the memory in my linux box? Should I need a tool? Or there are some APIs to use to build some scripts?
Thanks
How can I disable cache in IE8 ?
We are doing Javascript development and testing it in IE8, but we have to clear the cache every time we make changes to the Javascript files.
Hi.
Could you suggest a fast, deterministic method that is usable in practice, for testing if a large number is prime or not?
Also, I would like to know how to use non-deterministic primality tests correctly. For example, if I'm using such a method, I can be sure that a number is not prime if the output is "no", but what about the other case, when the output is "probably"? Do I have to test for primality manually in this case?
Thanks in advance.
Hi still stuck with the ugly scheme
the problem this time is to get the median of three values (easy)
I did all these :
(define (med x y z) (car(cdr(x y z)))
and it was accepted but when testing it
(med 3 4 5)
I will get this error
Error: attempt to call a non-procedure
(2 3 4)
and when entering letters inetead of number i got
(md x y z)
Error: undefined varia
y
(package user)
using somthin else than x y z i got
(md d l m)
Error: undefined variable
d
(package user)
so what is wronge ?!
If I have a url http://www.site.com/controllerA/actionB/idC
how can i extract the RouteValueDictionary where the item with the key controller would have the value of controllerA.
Note this isn't for testing so I don't want to use mocking and the solution here does not seem to be working.
Can anyone share his experience on workflow for R peject development under ESS? I tried several times to learn emacs but I have not get it yet. I can understand ESS as an editor, but is there a project view in ESS? what's the efficient ways to set up/view R project directory, coding, and testing? Thanks for any advices.
Hi Is there a way to mock request params, what is the best approach when testing to create fake request values in order to run a test
would some thing like this work?
_context = MockRepository.GenerateStub<HttpContext>();
request = MockRepository.GenerateStub<HttpRequest>();
var collection = new NameValueCollection();
collection.Add("", "");
SetupResult.For(request.Params).Return(collection);
SetupResult.For(_context.Request).Return(request);
I've been trying to figure out why C++ is making me crazy typing NULL. Suddenly it hits me the other day; I've been typing null (lower case) in Java for years. Now suddenly I'm programming in C++ and that little chunk of muscle memory is making me crazy.
Wikiperipatetic defines C++ NULL as part of the stddef:
A macro that expands to a null pointer
constant. It may be defined as
((void*)0), 0 or 0L depending on the
compiler and the language.
Sun's docs tells me this about Java's "null literal":
The null type has one value, the null
reference, represented by the literal
null, which is formed from ASCII
characters. A null literal is always
of the null type.
So this is all very nice. I know what a null pointer reference is, and thank you for the compiler notes. Now I'm a little fuzzy on the idea of a literal in Java so I read on...
A literal is the source code
representation of a fixed value;
literals are represented directly in
your code without requiring
computation.
There's also a special null literal
that can be used as a value for any
reference type. null may be assigned
to any variable, except variables of
primitive types. There's little you
can do with a null value beyond
testing for its presence. Therefore,
null is often used in programs as a
marker to indicate that some object is
unavailable.
Ok, so I think I get it now. In C++ NULL is a macro that, when compiled, defines the null pointer constant. In Java, null is a fixed value that any non-primitive can be assigned too; great for testing in a handy if statement.
Java does not have pointers, so I can see why they kept null a simple value rather than anything fancy. But why did java decide to change the all caps NULL to null?
Furthermore, am I missing anything here?