hi,
how can find position of a character in a string, and get the substring till that character.
say
char* test = "Hello world, I come back";
I want to find first occurrence 'l' character.
i need to find empty directories for given list of directories
some directories have directories inside it
if inside directories also empty
i can say main directory is empty otherwise it's not empty
how can i test this
for example
A>A1(file1),A2 this is not empty beacuse of file1
B>B1(no file) this is empty
C>C1,C2 this is empty
thanks
I can't figure out how to check from within C/C++ if a service is enabled via launchd. I know I can use launchctl from the command line and am currently executing ' launchctl list myServiceName ' from fork/exec.
I've found that boostrap_look_up() might be the way to check this but I can't find enough documentation to condense this down to a simple example.
Can you shed light on this? All I need is a small function to test if my service is actually registered and available.
Hi...
I want to convert the following .htaccess rules to lighttpd. Can anyone please help me ?
DirectoryIndex index.php
RewriteEngine On
#RewriteBase /your-sub-directory
RewriteRule ^index.php/rewrite-test index.php/rewrite-pass [L]
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]
Thanks!
hi ther - this is a "strange question"... :)
I WANT to get on a wiki spammers list for a test project i'm trying to do with some folks - how do i go about doing that?? :)
Is it possible to deceive SQL Server to return a different date on GetDate() without actually changing the machine date?
This would be great, since we have a database with old data and I'm trying to test some queries that use getdate().
I can change my machine date but that brings some other problems with other applications...
Any tips?
Thanks!
How do I get the amount of physical memory, consumed by the DataSource (specifically — ByteArrayDataSource)? I use ByteArrayDataSource (byte[] bytes, String type) constructor, where I get bytes like this:
String str = "test";
byte[] bytes = str.getBytes();
Would that be str.length() in bytes? Any other ideas?
The urlconf and view is as follows:
url(r'^register/$',
register,
{ 'backend': 'registration.backends.default.DefaultBackend' },
name='registration_register'),
def register(request, backend, success_url=None, form_class=None,
disallowed_url='registration_disallowed',
template_name='registration/registration_form.html',
extra_context=None):
What i want to do is redirect users to the register page and specify a success_url. I tried reverse('registration.views.register', kwargs={'success_url':'/test/' }) but that doesn't seem to work. I've been trying for hours and can't get my mind around getting it right. Thanks
if I have a class called Person.
var Person = function(fname, lname){
this.fname = fname;
this.lname = lname;
}
Person.prototype.mname = "Test";
var p = new Person('Alice','Bob');
Now, p.proto refers to prototype of Person but, when I try to do Person.proto , it points to function(), and Person.constructor points to Function().
can some1 explain what is the difference between function() and Function() and why prototype of a Function() class is a function()
Hi all,
I switch between my iMac and MacBook when working on my apps. I've always used my iMac to test the apps on the actual device, but I would like to be able to do this from both computers. I cannot seem to use the profile on my MacBook as it does not have the correct Certificate Signing Request in the KeyChain. Is there a way to copy these between machines and KeyChains?
:)
I am using Firefox's native JSON.parse() to parse some JSON strings that include regular expressions as values, for example:
var test = JSON.parse('{"regex":"/\\d+/"}');
The '\d' in the above throws an exception with JSON.parse(), but works fine when I use eval (which is what I'm trying to avoid).
What I want is to preserve the '\' in the regex - is there some other JSON-friendly way to escape it?
Let say I have written a small program that reads file_A and file_B as input data of test_case_A and test_case_B, passes the input to component_X which needs to be test, then verifies result against predefined expectation. That component_X could be in the same process, or different process on another machine.
I try to learn more about testing, but confused by various terms. Take above scenario as example, which of them is fixture/mock/harness/stub? Thanks.
Hi All,
I am implementing bluepay payment gateway in my PHP project, I couldn't find any integration document for bluepay, Plaese any one tell me the basic steps for posting data to bluepay, ie in which format i have to post data to "https://bluepay.onlinedatacorp.com/test/bluepaylitetest.asp" Please help me!!!
First I show some code.
library: axis.jar, dom4j.jar
jdk1.5, windowsXP
T.java
import java.io.StringWriter;
import org.apache.axis.utils.StringUtils;
import org.dom4j.DocumentHelper;
import org.dom4j.io.OutputFormat;
import org.dom4j.io.XMLWriter;
public class T {
public T() {
System.out.println("constructor");
}
public void test() {
System.out.println(StringUtils.unescapeNumericChar("1"));
}
public String getPrettyXML(String xml) throws Exception {
System.out.println("getPrettyXML");
StringWriter sw = new StringWriter();
XMLWriter writer = null;
try {
OutputFormat format = OutputFormat.createPrettyPrint();
org.dom4j.Document document = DocumentHelper.parseText(xml);
writer = new XMLWriter(sw, format);
writer.write(document);
} catch (Exception e) {
throw e;
} finally {
if (writer != null) {
try {
writer.close();
} catch (Exception e) {
}
}
}
return sw.toString();
}
public void a() {
System.out.println("a");
}
public static void main(String[] args) {
new T().test();
}
}
T2.java
public class T2 {
public static void main(String[] args) throws Exception {
System.out.println("T2");
T t = (T) Class.forName("T").newInstance();
}
}
Ok, here we go... run as (Of course, I'm run at the directory where T.class, T1.class is)
java T2
as you can see, not exist class path.
==console==
T2
constructor
OK...
Now delete
throw e
line at the catch block on the "getPrettyXML" method of T.
Ok, here we go.. run one more time without classpath
java T2
You can see below...
==console==
T2
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/io/OutputFormat
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at T2.main(T2.java:5)
I know that it's not very important for my life or your life.
But it's so mysterisou to me, and my all curiosity.
thanks.. ^^
I have this application developed for Blackberry 4.5.
I´m using Eclipse, and I want to test my application for blackberry 4.6.
What´s the easy way to generate the alx and cod file to install my app for this version?
I read somewhere that for a high traffic site (I guess that is a murky term as well), 30 - 60 seconds is a good value. Obviously I could do a load test and vary the values, but I couldn't find any kind of documentation on this. Most samples have a minute, a couple of minutes. There's no recommended range. Is there something on msdn or anywhere that talks about this?
I have two hyperlinks on a page. I'm happy with the css on 'link1' (white text / red rollover) however I want to have a different styling for 'link2'.
I've created a seperate css for this section and have managed to colour it green but I can't get rid of the red rollover effect?
Does anyone know how to override the red rollover effect just on 'link2'?
http://www.signport.co.uk/test/testsize3.html
Thanks!
How can I easily create a fractional y-value when using ggplot?
t <- as.factor(test=sample(seq(0,100,10),1000,rep=T))
d <- as.factor(sample(c(0,1),1000,rep=T)
p <- data.frame(t,d)
My best shot was:
ggplot(p,aes(x=t,y=prop.table(table(t,d),1)[,1])) + geom_point()
However this doesnt work and I guess there is an easier way around this...
Blind SQL Injection
Severity: High
Test Type: Application
Vulnerable URL:
Remediation Tasks: Filter out hazardous characters from user input
Variant 1 of 2 [ID=12654]
The following changes were applied to the original request:
• Set parameter 'nm's value to 'Demography'%20and%20'foobar'='foobar'
I have this code below and as a test i have that alert below.
When i open firebug and i put a break point on the "debugger" and it doesn't fire but the alert does get called as a i get a alert popup.
Any idea why i can't capture this breakpoint ?
<script type="text/javascript">
$(function() {
$("#tabs").tabs({
selected: 0,
load: function(event, ui) {
debugger;
alert(ui.panel.id);
}
});
I was taken aback earlier today when debugging some code to find that something like the following does not throw a compile-time exception:
public Test () {
HashMap map = (HashMap) getList();
}
private List getList(){
return new ArrayList();
}
As you can imagine, a ClassCastException is thrown at runtime, but can someone explain why the casting of a List to a HashMap is considered legal at compile time?
Which software is recommended?
I know of Adobe Browser Lab only, and it seems pretty new... Is there any better SW out there?
Thanks
PS: I have a classifieds website (PHP, MySql, Solr, js) developed on local computer using virtual server etc... Now I need to test it on different browsers. It is developed only with Firefox, so it works fine in FF.
Using Mint terminal my script connects using ssh2_connect and ssh2_auth-password.
When am logged in successfully I want to run a command which will give me the hardware cpu. Is there a way I can use to exec the command in my script then show the results. I have used system and exec for pinging. if i was in the terminal i do the login. then type "get hardware cpu"
in the terminal it would look like this:
Test~ $ get hardware cpu
I have to build an application using Maven for PHP that has multiple modules.
The scenario in which the maven seems to not work is this: I have a common module and a client module depending on the first one.
When doing "mvn site" on the client module which depends on the common module, the test fails to see the paths to the common module. Is there a flow in my build or this is just not possible?