Where can I find a code to parse URL queries in C++?
For example: "id=34&name=test&size=367"
And something like 'getvalue(parser_query, "name")' that returns 'test'.
Thanks.
I have a string which is like this:
this is "a test"
I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:
['this','is','a test']
PS. I know you are going to ask "what happens if there are quotes within the quotes, well, in my application, that will never happen.
I'm struggling how to develop a webapp for Android and iOS.
My first app was a simple todo app which was easy to test in my browser and it only used html, javascript and css.
However, I have to create an app which uses Google Maps Api to get the location.
I created a simple html5 page to test which places a marker on a map.
It works fine when testing it on my local server. But when I create an .apk file for Android, the app doesn't work.
So I'm wondering, isn't it possible to use it like this? Do I have the use the phonegap libraries to use their geolocation library?
And if so, how do you handle the development of a webapp in phonegap for multiple OS?
Do you have to install an Android environment and an iOS environment to each include the right phonegap library and to test them properly?
Update: I use the following code on my webserver and it works perfectly.
When I upload it in a zip-folder to the photogap cloud and install the APK file on my phone, it doesn't work.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple Geo test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>
</head>
<body>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script>
function success(position) {
var mapcanvas = document.createElement('div');
mapcanvas.id = 'mapcontainer';
mapcanvas.style.height = '200px';
mapcanvas.style.width = '200px';
document.querySelector('article').appendChild(mapcanvas);
var coords = new google.maps.LatLng(position.coords.latitude, position.coords.longitude);
var options = {
zoom: 15,
center: coords,
mapTypeControl: false,
navigationControlOptions: {
style: google.maps.NavigationControlStyle.SMALL
},
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("mapcontainer"), options);
var marker = new google.maps.Marker({
position: coords,
map: map,
title:"You are here!"
});
}
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(success);
} else {
error('Geo Location is not supported');
}
</script>
<article></article>
</body>
</html>
Let's say you had a string
test = 'wow, hello, how, are, you, doing'
and you wanted
full_list = ['wow','hello','how','are','you','doing']
i know you would start out with an empty list:
empty_list = []
and would create a for loop to append the items into a list
i'm just confused on how to go about this,
I was trying something along the lines of:
for i in test:
if i == ',':
then I get stuck . . .
hi, i want only the first word of a variable.. example input:
<?php $myvalue = Test me more; ?>
the output should only "Test", the first word of the input.. how can i do this?
I have table like below
id, employee_no, survey_no, name
1 test 1 test_name
2 test2 1 test_name2
3 test3 1 test_name3
4 test4 2 test_name4
how to query with Restriction.in by combining below AND into one IN statement?
IN[ (if(survey_no==1) && employee_no== 'test') ,
(if(survey_no==1) && employee_no== 'test2') ,
...
]
I am having trouble getting fancybox to display its corresponding images on a website that I'm building http://www.nomadicdrift.com/test/kaniwa#events . It's a custom one page portfolio theme that I set up on the WordPress platform.
If you follow the link to the events section you will see 1 figure item in a gallery like position. I have this image set up to work as a fancybox gallery, but when you click on it, it opens up the fancybox interface but does not place a image in the frame, even though it should. So this is the problem...the images do not show up in fancybox and instead I see just the frame.
Here is the html that I'm displaying:
<figure>
<a class="fancybox" data-fancybox-type="Fashion Show de Paris, France" href="http://www.nomadicdrift.com/test/kaniwa/wp-content/uploads/2012/07/NM2.jpg">
<img class="attachment-evento wp-post-image" width="231" height="191" title="NM" alt="NM" src="http://www.nomadicdrift.com/test/kaniwa/wp-content/uploads/2012/07/NM2-231x191.jpg">
</a>
<figcaption>
<a class="fancybox" data-fancybox-type="Fashion Show de Paris, France" href="http://www.nomadicdrift.com/test/kaniwa/wp-content/uploads/2012/07/CEDESAN.jpg"> </a>
<h4>Fashion Show de Paris, France</h4>
</figcaption>
</figure>
I'm not going to bore you with the PHP that I used to get that output because I think the problem lies elsewhere.
***I have tried to set up a simple standard fancybox gallery on the site also, but it gives me thes same problem, leading me to believe that the problem is deeper than the html markup. I have also successfully used this same markup for a one thumbnail fancybox gallery on another site.
I thought maybe it was due to some conflict in the .js files I'm using. I tried uninstalling all of my plugins/addons (which aren't too many) one by one and still had the same result. I have all of my personal javascript in the functions.js file, which is where I call the fancybox plugin using the standard $("a.fancybox").fancybox();.
I have installed this plugin before on other sites and have searched extensively for an answer, so any help is greatly appreciated.
Thanks,
Sean
We have splitted our grails application into several inplace-plugins.
Now we want to have the tests in the same plugin like the classes which they test.
Is it possible to configure our application (e.g. in BuildConfig.groovy) so that the tests in the plugins are executed too when we run "test-app"?
I am very inexperienced with PHP and I've having trouble calling a mootools function.
Here's my code:
echo '<script language="JavaScript">';
echo "Sexy.error('Test!');";
echo '</script>';
When I try it with a simple alert('test') it works just fine.. I'm confused?!?
I have a text file test.txt with the following content:
text1
text2
And I want to assign the content of the file to a UNIX variable but when I do this:
testvar=$(cat test.txt)
echo $testvar the reult is:
text1 text2
instead of
text1
text2
Can someone suggest me a solution for this?
I cant seem to send an email using PHP's mail(). I have also tried PHPMailer and Swiftmail with no success. However, the following command on the server delivers mail successfully.
cat test.txt | mail -s "test mail" [email protected]
Is there a way to trace where the problem is coming from? mail() just seems to return true or false.
Hey all,
I am trying to centre page numbers at the bottom of this test blog...
http://jocelynwarner.com/test/
in the centre between the previous and next buttons however I cannot think how to do it, I tried a few different tutorials but they didn't really seem to help with this.
Any hints on how to make them sit centrally in the left column (the width of the blog content - sidebar) would be greatly appreciated.
I want to know if you guys know how to make BDD tests with Robotium.
As I research Robotium works with a different Virtual Machine (Dalvik) so I cannot run as Junit Test (Only with Android Junit Test). So I found a possible solution to run Robotium with Junit with RoboRemote https://github.com/groupon/robo-remote. But when i tried to integrate with cucumber the tests became unstable.
So you guys know some way to make BDD tests using Robotium?
I have the following code:
$('#change').dialog({
autoOpen: false,
width: 380,
buttons: {
"Close": function() {
$(this).dialog("close");
},
"Accept": function() {
var test = $("#ChangePasswordForm").submit();
alert(test);
}
}
});
In my controller I want to return a string
[AcceptVerbs(HttpVerbs.Post)]
public string ChangePassword(string Name)
{
var msg = "Cool!";
if (name != null)
return msg;
}
How can I do that?
How can I dipslay
I am trying to find the difference in time (without days/years/months) of two different days.
Example:
#ruby >1.9
time1 = Time.now - 1.day
time2 = Time.now
#code to make changes
#test:
time1 == time2 # TRUE
My solution:
time1 = time1.strftime("%h:%m").to_time
time2 = time2.strftime("%h:%m").to_time
#test
time1 == time2 #True
#passes
I was wondering if there was a better way of doing this? Maybe we could keep the Date the same as time1/time2?
Hi all,
Not a VB6 expert... Trying to come up with a VB6 test app that calls InternetCheckConnection. In my test app, InternetCheckConnection always returns false regardless of the URL I use. I copied and pasted this code from a larger spaghetti-code app, but in the spaghetti-code, InternetCheckConnection seems to work fine, returns true.
Is there some other function I have to call first in order for InternetCheckConnection to work?
on the following url - http://www.filestube.to/26frq-Buffalo-Clover-Test-Your-Love-2014-9Jai9TJFukAS9fq9sWngAD.html I am trying to copy the;
Direct links:
turbobit.net/9mrb0eu9eksx/26frq.Buffalo.Clover..Test.Your.Love.2014.rar.html
via css path or xpath and unable to retrieve the information and store it to a variable.
firebug gives me
html body div.cnt div.rH.no-js.fd div.rl div.fgBx pre span#copy_paste_links
but when I apply
css=html.body.div.cnt.div.rH.no-js.fd.div.rl.div.fgBx.pre.span#copy_paste_links/text()
to the target, I get error not found http://i.imgur.com/KdBmDHE.png
The following code resets one selectOneMenu through particular id. How to make it dynamic for more selectOneMenus to reset at the top value.
var test= document.getElementById('form1:text3');
test.options.selectedIndex=0;
This resets to top value of menu, but how to make it dynamic.
ANy help is appreciated.
Hi,
dadasdf\sdasdasd\qazxbbjj\test.txt
Above is the string in cell A1 in excelsheet,I want to extract the last word from that cell.i.e,I want only test.txt,How can I acchive that using excel function.If it is acchived by declaring any variable then also help me out.
Why does my flex app open a blank page in firefox? Example http://localhost/flexApp/flex_bin/test.html. IE works fine--no blank pop up along with my test page. I'm not asking for one, yet ff feels the need to serve one up. Does anyone know why?
Hi all,
I wonder if we can capture that which button is clicked if there are more than one button.
On this example, can we reach //do something1 and //do something2 parts with joinPoints?
public class Test {
public Test() {
JButton j1 = new JButton("button1");
j1.addActionListener(this);
JButton j2 = new JButton("button2");
j2.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
//if the button1 clicked
//do something1
//if the button2 clicked
//do something2
}
}
Hi,
My string is
mystring = "<tr><td><span class='para'><b>Total Amount : </b>INR (Indian Rupees)
100.00</span></td></tr>"
My problem here is I have to search and get the total amount
test = re.search("(Indian Rupees)(\d{2})(?:\D|$)", mystring)
but my test give me None.
How can I get the values and values can be 10.00, 100.00, 1000.00
Thanks
Is there a way to test the html from the response of:
response = self.client.get('/user/login/')
I want a detailed check like input ids, and other attributes. Also, how about sessions that has been set? is it possible to check their values in the test?
array_key_exists is not working for large multidimensional array. For ex
$arr=array( '1'=>10,
'2'=>array('21'=>21,
'22'=>22,
'23'=>array('test'=>100,
'231'=>231),
),
'3'=>30,
'4'=>40
);
array_key_exists('test',$arr) returns 'false' but it works with some simple arrays.
In ruby, how do I test that one array not only has the elements of another array, but contain them in that particular order?
correct_combination = [1, 2, 3, 4, 5]
[1, 5, 8, 2, 3, 4, 5].function_name(correct_combination) # => false
[8, 10, 1, 2, 3, 4, 5, 9].function_name(correct_combination) # => true
I tried using include, but that is used to test whether [1,2,3].include?(2) is true or not.