unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
preg_replace removing a text and tags
===
preg_replace('|[[\/\!]*?[^\[\]]*?]|si', '', $text);
This removes all the bb tags from the text. I am looking to remove the persons's signature as well. This has to be done before the tag replacement and I'd like to do it with one regex.
This should be removed completely:
[b][color=red]This is my signature[/color][/b]
Been playing around with it for a while and got nowhere. | 0 | [
2,
782,
263,
1,
99,
5119,
9096,
21,
1854,
17,
3383,
18,
800,
3726,
3726,
782,
263,
1,
99,
5119,
5,
22,
1,
2558,
2558,
1,
118,
1,
187,
500,
2483,
60,
2558,
1,
2558,
1,
500,
500,
2483,
60,
500,
1,
18,
49,
22,
15,
13,
7,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how do I search all memory of a process in gdb?
===
I'm trying to find a certain value (integer magic number (654321)) in a running process that I'm currently attached to using GDB.
I found a `find [/sn] start_addr, +len, val1 [, val2, ...]` command, but it requires start and end address, yet I don't know where my process memory starts and where it ends.
This seems to be very common problem, yet I remember googling for it a year ago, and I repeated that now with no success, so..
How do I know where process memory starts and where it ends? | 0 | [
2,
184,
107,
31,
2122,
65,
1912,
16,
21,
953,
19,
489,
9007,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
477,
21,
1200,
1923,
13,
5,
6391,
13699,
2154,
234,
13,
5,
3577,
4644,
1941,
6,
6,
19,
21,
946,
953,
30,
31,
22,
79,
87... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Couldn't click on td element
===
I am trying to download song from site http://www.radiojavan.com/mp3s/mp3/Aamin-Sarbaz with Ruby and Mechanize. There is a 'Download MP3' but when I inspect it it's not link but td.
agent = Mechanize.new
agent.pluggable_parser.default = Mechanize::FileSaver
download_page = agent.get('http://www.radiojavan.com/mp3s/mp3/Aamin-Sarbaz')
When I navigate this in browser I could click like it's link.
But in the code this is <td> element. How to click on this td element?
If I try:
download_page.search('div#download_mp3 table tr td')[1].click.save_as 'proba.mp3'
It raises error:
`<top (required)>': undefined method `click' for #<Nokogiri::XML::Element:0x000000029b84d8> (NoMethodError)
from -e:1:in `load'
from -e:1:in `<main>' | 0 | [
2,
711,
22,
38,
10840,
27,
15596,
4520,
800,
3726,
3726,
31,
589,
749,
20,
7121,
338,
37,
689,
7775,
6903,
6483,
9,
11129,
1004,
2686,
9,
960,
118,
2554,
240,
18,
118,
2554,
9280,
6887,
2160,
8,
4964,
969,
380,
29,
10811,
17,
55... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery syntax meaning - difference between $(x) and x
===
I know that when we have an element with id='someId', we can access it with Jquery like this:
$('#someId')
But sometimes when we have a variable:
var x;
We use just x or $(x).
When do we use $(x) instead of x? When do we use $($(x)) instead of x? | 0 | [
2,
487,
8190,
93,
22649,
1813,
13,
8,
2841,
128,
5579,
5,
396,
6,
17,
993,
800,
3726,
3726,
31,
143,
30,
76,
95,
57,
40,
4520,
29,
4924,
3726,
22,
3220,
1340,
22,
15,
95,
92,
1381,
32,
29,
487,
8190,
93,
101,
48,
45,
5579,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Netbeans plugin for Sass and Compass
===
Is there a plugin for Netbeans in Windows that supports both Sass and Compass? | 0 | [
2,
4275,
863,
5950,
10922,
108,
26,
9233,
18,
17,
18879,
800,
3726,
3726,
25,
80,
21,
10922,
108,
26,
4275,
863,
5950,
19,
1936,
30,
6747,
156,
9233,
18,
17,
18879,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Move Uploaded File Error: Didn't find directory
===
<?php if(isset($_POST["submit"])){
$name = mysql_real_escape_string($_POST["name"]);
$description = mysql_real_escape_string($_POST["description"]);
$content = mysql_real_escape_string($_POST["content"]);
$upload_image = $_POST["upload_image"];
$tmp_file = $_FILES["upload_image"]["tmp_name"];
$image_name = basename($_FILES["upload_image"]["name"]);
$directory = 'Uploads';
$location = $directory . "/" . $image_name;
move_uploaded_file($tmp_file, $location);
$query = mysql_query("INSERT INTO tables (placement, name, description, content, image) VALUES ('Browsing', '{$name}', '{$description}', '{$content}', '{$location}')");
} ?>
this is the code, every time I run it it says:
Notice: Undefined index: upload_image in C:\xampp\htdocs\PHP Web Applications\Work\Farris Website 3.0\Admin\main_menu.php on line 36
Warning: move_uploaded_file(Uploads/Profile Picture.png) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\PHP Web Applications\Work\Farris Website 3.0\Admin\main_menu.php on line 41
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php4901.tmp' to 'Uploads/Profile Picture.png' in C:\xampp\htdocs\PHP Web Applications\Work\Farris Website 3.0\Admin\main_menu.php on line 41
The directory does exist but I don't know why it says that ???
Please help | 0 | [
2,
780,
23782,
3893,
7019,
45,
223,
22,
38,
477,
16755,
800,
3726,
3726,
13,
1,
60,
26120,
100,
5,
11001,
38,
5,
4403,
1,
6962,
2558,
7,
7563,
5130,
7,
500,
6,
6,
1,
5579,
7259,
800,
51,
18,
22402,
1,
7467,
1,
62,
13109,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I start nodejs web-site under iisexpress/iisnode from a command line?
===
I am having a problem trying to figure out how to start a nodejs web-site under issexpress/issnode **without using Web-Matrix**. Basically I need to do the same thing that is done by clicking start/stop in Web-Matrix but outside of it. | 0 | [
2,
184,
107,
31,
799,
15421,
728,
18,
2741,
8,
9097,
131,
595,
18,
21230,
118,
49,
19591,
8355,
37,
21,
1202,
293,
60,
800,
3726,
3726,
31,
589,
452,
21,
1448,
749,
20,
1465,
70,
184,
20,
799,
21,
15421,
728,
18,
2741,
8,
9097... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What happens to memory after I call MPI_Init()?
===
Suppose I have some code that looks like this:
#include "mpi.h"
int main( int argc, char** argv )
{
int my_array[10];
//fill the array with some data
MPI_Init(&argc, &argv);
// Some code here
MPI_Finalize();
return 0;
}
Will each MPI instance get its own copy of my_array? Only rank 0? None of them? Is it bad practice to have any code before `MPI_Init` at all? | 0 | [
2,
98,
5531,
20,
1912,
75,
31,
645,
4628,
49,
1,
108,
242,
5,
6,
60,
800,
3726,
3726,
5787,
31,
57,
109,
1797,
30,
1879,
101,
48,
45,
6926,
22640,
13,
7,
2554,
49,
9,
252,
7,
19,
38,
407,
5,
19,
38,
13,
10663,
150,
15,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SOAP web service xml message format
===
Hi i have to create SOAP web service in Google App Engine Java .i successfully implemented
[Soap Service Tutorial][1] for GAE
article i also understand How to write functions in soap web service and generating wsdl. on client side i have to call the same function as on server side (using wsdl it creates some java classes so we call same functions) but in my web service ,client will send a message to web service in this format
this is in the technical documentation of the web service that i have to create.
GET /gevents HTTP/1.1
Host: [app-id].appspot.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn
<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:e="http://[app-id].appspot.com/gevents-service">
<env:Body>
<e:CreateEvent>
<e:EventName>Appointment</e:EventName>
<e:StartDate>04-17-2012T18:30:00Z</e:StartDate>
<e:EndDate>04-17-2012T19:15:00Z</e:EndDate>
<e:User>seymour@domain.com</e:User>
<e:Attendees>
<e:Attendee email=”some_email@domain.com” name=”Some Name” />
<e:Attendee email=”jane.doe@domain.com” name=”Jane Doe” />
</e:Attendees>
<e:Location>Conference Room #1</e:Location>
</e:CreateEvent>
</env:Body>
</env:Envelope>
on client side there is a servlet (in the demo project)
@SuppressWarnings("serial")
public class HelloSOAPClientServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
String name = req.getParameter("name");
boolean isArriving = Boolean.parseBoolean(req.getParameter("arriving"));
resp.setContentType("text/plain");
Greeter greeter = new GreeterService().getGreeterPort();
String message;
if (isArriving){
message = greeter.sayHello(name);
}
else {
message = greeter.sayGoodbye(name);
}
resp.getWriter().println(message);
}
}
on client side i didn't understand How i am sending xml data .i am a newbie to SOAP.please provide some good tutorial which explains How xml data is flowing and what is the format of xml which i am passing via function calls.
[1]: https://developers.google.com/appengine/articles/soap | 0 | [
2,
6447,
2741,
365,
23504,
2802,
2595,
800,
3726,
3726,
4148,
31,
57,
20,
1600,
6447,
2741,
365,
19,
8144,
4865,
1406,
8247,
13,
9,
49,
3673,
6807,
636,
656,
2552,
365,
29724,
500,
2558,
165,
500,
26,
13,
17721,
2002,
31,
67,
1369... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google Maps API V3 Infowindow content
===
1st post!!!
I'm trying to load this code into an info window, but struggling with what is allowed and the correct format... I'm a beginner at this! The code below works ok in a html page.
'<script src="Tours/swfobject/swfkrpano.js"></script>'+
'<div id="container">'+
'<div id="panoDIV" style="height:350px;">'+
'<script>'+
'embedpano({target:"panoDIV",swf:"1000.swf"});'+
'</script>'+
'<noscript>'+
'<div id="tour">'+
'<object width="350px" height="350px">'+
'<embed src="HomeTour/virtualtour.swf" width="350px" height="350px" allowFullScreen="true"></embed>'+
'</object>'+
'</div>'+
'</noscript>'+
'</div>'+
'</div>';
Thanks in advance for your help! | 0 | [
2,
8144,
6867,
21,
2159,
566,
240,
15404,
27508,
2331,
800,
3726,
3726,
137,
384,
678,
28116,
31,
22,
79,
749,
20,
6305,
48,
1797,
77,
40,
15404,
1463,
15,
47,
7587,
29,
98,
25,
1159,
17,
14,
4456,
2595,
9,
9,
9,
31,
22,
79,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regarding creation of dynamic array in java
===
Could you please advise how to create a dynamic array..!! A primitive array can be declared as
int[] myIntArray = new int[3];
But this time I know know the size of array is of 3 elements but what if I want to create a dynamic array how I will create that, Please advise.
| 0 | [
2,
3467,
2502,
16,
7782,
7718,
19,
8247,
800,
3726,
3726,
110,
42,
2247,
14640,
184,
20,
1600,
21,
7782,
7718,
9,
9,
19015,
21,
11473,
7718,
92,
44,
2482,
28,
19,
38,
2558,
500,
51,
108,
3958,
2787,
800,
78,
19,
38,
2558,
240,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Entity Framework - Caching Records
===
I am new to Entity Framework and LINQ and have a site using the ASP.Net memberhsip provider with entity framework. I have the aspnet_Users, aspnet_UsersInRoles and aspnet_Roles tables setup in the entity model (edmx).
And I have the following code to change the role for a user:
IEnumerable<aspnet_Roles> rolesToRemove = user.aspnet_Roles.ToList();
foreach (aspnet_Roles role in rolesToRemove)
user.aspnet_Roles.Remove(role);
user.aspnet_Roles.Add(_roleService.Get(roleId));
When I call ObjectContext.SaveChanges() the database is updated correctly, displaying just one role for the user, but when I try to reload the user using EF it returns 2 roles in the aspnet_Roles collection.
I have tried using user.aspnet_Roles.Load(System.Data.Objects.MergeOption.OverwriteChanges) to force EF to load just what is in the database but this still returns 2 roles.
Has anyone seen anything like this before? Any help here would be greatly appreciated.
| 0 | [
2,
9252,
6596,
13,
8,
1658,
7192,
742,
800,
3726,
3726,
31,
589,
78,
20,
9252,
6596,
17,
6294,
1251,
17,
57,
21,
689,
568,
14,
28,
306,
9,
2328,
322,
26344,
306,
11747,
29,
9252,
6596,
9,
31,
57,
14,
28,
306,
2328,
1,
16704,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Intergrate E-mail validation
===
Can someone help me Spam proof this php script? Also, when I use this script I get 2 emails. one empty and the other with the results. many thanks in advance
<?PHP
$to = "voodoocastde@gmail.com";
$subject = "Registrierung auf voodooCAST.de";
$headers = "From: Form Mailer";
$forward = 0;
$location = "";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "\n";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
header( 'Location: http://www.voodoocast.de/confirm.php' ) ;
}
?> | 0 | [
2,
1480,
15125,
62,
13,
62,
8,
8079,
27999,
800,
3726,
3726,
92,
737,
448,
55,
6954,
79,
6070,
48,
13,
26120,
3884,
60,
67,
15,
76,
31,
275,
48,
3884,
31,
164,
172,
8517,
18,
9,
53,
2424,
17,
14,
89,
29,
14,
1736,
9,
151,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript app as an AMD module with external dependencies
===
I am writing a Javascript application that is supposed to be hosted on various sites. The application itself uses jQuery and jQuery UI. I am aware of `jQuery.noConflict(true)` trick and using it currently so not to pollute the global space. My aim is to always keep jQuery and any of its plugins local to my application so as not to conflict with anything on the hosting site. It should be possible for the hosting site to load its own jQuery (maybe different version) and add some plugins.
Now, I would like to structure the app as an AMD module. It is OK with me to require from the hosting site to use an AMD loader (require.js, curl, etc.) but I wouldn't like to require any particular one - just anything conforming to AMD API (yep, I know it's not 100% ready yet).
Is it at all possible? Can I do it in an interoperable way, so that the hosting site can use e.g. either requirejs, curl or Dojo AMD loader?
For example, with this:
define(['jquery'], function($) {
var myLocaljQuery = $.noConflict(true);
... my app module implementation here ...
});
how can I specify the path for jQuery that my application wants to use? As far as I understand, I cannot do anything like this:
require.config({
paths: {
'jquery' : 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min'
}
});
define(['require'], function(require) {
require(['jquery'], function($) {
var myLocaljQuery = $.noConflict(true);
... my app module implementation here ...
});
});
because the first `require` is a global object and this is specific to requirejs. | 0 | [
2,
8247,
8741,
4865,
28,
40,
589,
43,
12613,
29,
4886,
29411,
800,
3726,
3726,
31,
589,
1174,
21,
8247,
8741,
3010,
30,
25,
2293,
20,
44,
2812,
27,
617,
3259,
9,
14,
3010,
1145,
2027,
487,
8190,
93,
17,
487,
8190,
93,
13,
5661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unexpected call to method or property access. in JQUERY
===
My code which is giving error in IE8
$(function(){
$.ajax({url:"http://localhost/css/register.txt",
cache : false,
success:function(ris){$("<style></style>").appendTo("head").html(ris);//culprit statement},
error:function(){}
});
}); | 0 | [
2,
9380,
645,
20,
2109,
54,
1354,
1381,
9,
19,
487,
8190,
93,
800,
3726,
3726,
51,
1797,
56,
25,
1438,
7019,
19,
13,
660,
457,
5579,
5,
22359,
5,
6,
1,
5579,
9,
6881,
7522,
5,
1,
911,
255,
45,
7,
21127,
6903,
15580,
11694,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Split word into syllables
===
How to split the syllables in a word using javascript.Is there any api for that?Any help will be appreciated.Thank you. | 0 | [
2,
2132,
833,
77,
23467,
800,
3726,
3726,
184,
20,
2132,
14,
23467,
19,
21,
833,
568,
8247,
8741,
9,
403,
80,
186,
21,
2159,
26,
30,
60,
6001,
448,
129,
44,
13746,
9,
5904,
42,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to write the Xmlnode to new Xml
===
i have an XML like
<Books>
<book>
<filename>QA Assurance </filename>
<author>john</author>
</book>
<book>
<filename>Dev CSharp</filename>
<author>pattersons</author>
</book>
</Books>
I need to read this XMl and i need to create a new with only filename="Dev CSharp" i want to copy the whole node book and create a new XML in C#
Regards
Dev
| 0 | [
2,
184,
20,
2757,
14,
23504,
251,
546,
20,
78,
23504,
800,
3726,
3726,
31,
57,
40,
23504,
101,
13,
1,
13828,
1,
13,
1,
5199,
1,
13,
1,
16877,
7259,
1,
8681,
16473,
13,
1,
118,
16877,
7259,
1,
13,
1,
10007,
1,
7373,
1,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Display image from camera within uiwebview
===
I have iPhone application that use web view, and i run iPhone camera from the application and get the image, my question is how to get this image back inside the web view ? | 0 | [
2,
3042,
1961,
37,
3336,
363,
13,
5661,
14113,
4725,
800,
3726,
3726,
31,
57,
21024,
3010,
30,
275,
2741,
1418,
15,
17,
31,
485,
21024,
3336,
37,
14,
3010,
17,
164,
14,
1961,
15,
51,
1301,
25,
184,
20,
164,
48,
1961,
97,
572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
jQuery message queuing + ajax not firing
===
I have created a php class which is pretty expensive and needs to process a lot of request on an admin page. For this reason I'm trying to using jquery queing + ajax calls to batch process the requests however the whole javascript is not firing and I don't understand why. I'm more of a PHP expert nog so much js or jQuery.
The code:
<script type="text/javascript">
$(document).ready(function () {
window.queue = $.jqmq({
// Queue items will be processed every 250 milliseconds.
delay: 500,
// Process queue items one-at-a-time.
batch: 10,
// For each queue item, execute this function.
callback: function( model, apit) {
$.ajax({
url: 'script.php',
type: "post",
cache: false,
data: "model="+model+"&api="+apit,
success: function (data) {
$(".error_msg p").append(data);
}
},
// When the queue completes naturally, execute this function.
complete: function(){
$.ajax({
url: 'script.php',
type: "post",
cache: false,
data: "cleanup=1",
success: function (data) {
$(".error_msg p").append(data);
}
$('.error_msg p').append( '<br /><span class="done">Queue done<\/span>' );
}
});
//the next line is repeated a couple hundred times with different values
queue.add( 'arg1', 'arg2' );queue.add( 'arg1', 'arg2' );
}); </script>
This code is located in the body.
Scripts included (in the head) are:
<script type="text/javascript" src="js/jquery-1.4.1.js"></script>
<script type="text/javascript" src="js/jquery.ba-jqmq.js"></script>
I've checked with TamperData FF plugin and the ajax posts to script.php are just not firing and I have no idea why..
| 0 | [
2,
487,
8190,
93,
2802,
9386,
291,
68,
2754,
20624,
52,
7139,
800,
3726,
3726,
31,
57,
679,
21,
13,
26120,
718,
56,
25,
1772,
5381,
17,
2274,
20,
953,
21,
865,
16,
3772,
27,
40,
21,
43,
2160,
2478,
9,
26,
48,
1215,
31,
22,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mix 2 Wav Files in iPhone Programmatically
===
I am facing an issue in getting 2 .wav files mixed together.
I'm using the code from this site: http://eigenclass.blogspot.in/2010/12/merging-wav-files-in-objective-c.html
Now the problem I'm facing is that, the code generally works for wav files lesser than 10 secs and anything more than 10 secs causes the app to crash.
For some strange reason, even if I'm properly releasing the objects at the end of the for loop (for loop consists of more than 10 lakh iterations and increases as size of recording increases), the objects dont seem to get released and keep hogging memory.
Here's my for loop:
short iValueWav1Sample;
short iValueWav2Sample;
short iValueWavSampleAverage;
for (int i=0; i<(outputWavDataSize/2); i++) {
//simulate little endian by flipping the bytes
wav1DataBuffer1 = [[NSData alloc]initWithData:[wav1Data subdataWithRange:NSMakeRange(44 + (i*2), 1)]];
wav2DataBuffer1 = [[NSData alloc]initWithData:[wav2Data subdataWithRange:NSMakeRange(44 + (i*2), 1)]];
wav1DataBuffer2 = [[NSData alloc]initWithData:[wav1Data subdataWithRange:NSMakeRange(44 + (i*2) + 1, 1)]];
wav2DataBuffer2 = [[NSData alloc]initWithData:[wav2Data subdataWithRange:NSMakeRange(44 + (i*2) + 1, 1)]];
littleEndianHexWav1Sample = [[NSMutableData alloc] initWithData:wav1DataBuffer1];
[littleEndianHexWav1Sample appendData:[NSMutableData dataWithData:wav1DataBuffer2]];
littleEndianHexWav2Sample = [[NSMutableData alloc]initWithData:wav2DataBuffer1];
[littleEndianHexWav2Sample appendData:wav2DataBuffer2];
NSString* wav1HexString = [[littleEndianHexWav1Sample description] substringWithRange:NSMakeRange(1, 4)];
NSString* wav2HexString = [[littleEndianHexWav2Sample description] substringWithRange:NSMakeRange(1, 4)];
unsigned wav1Hexint;
unsigned wav2Hexint;
[[NSScanner scannerWithString:wav1HexString] scanHexInt:&wav1Hexint];
[[NSScanner scannerWithString:wav2HexString] scanHexInt:&wav2Hexint];
unsigned wavAverage;
wavAverage = (wav1Hexint+wav2Hexint);
iValueWav1Sample = wav1Hexint;
iValueWav2Sample = wav2Hexint;
iValueWavSampleAverage = wavAverage;
bigEndian = [[NSData alloc ]initWithBytes:&iValueWavSampleAverage length:2];
littleEndian = [[NSMutableData alloc] initWithData:[bigEndian subdataWithRange:NSMakeRange(1, 1)]];
[littleEndian appendData:[bigEndian subdataWithRange:NSMakeRange(0, 1)]];
[headerBuffer appendData:littleEndian];
//Release stuff
[wav1HexString release];
[wav2HexString release];
[wav1DataBuffer1 release];
[wav2DataBuffer1 release];
[wav1DataBuffer2 release];
[wav2DataBuffer2 release];
[littleEndianHexWav1Sample release];
[littleEndianHexWav2Sample release];
[bigEndian release];
[littleEndian release];
wav1DataBuffer1 = nil;
wav2DataBuffer1= nil;
wav1DataBuffer2 = nil;
wav2DataBuffer2 = nil;
littleEndianHexWav1Sample= nil;
littleEndianHexWav2Sample= nil;
bigEndian= nil;
littleEndian= nil;
}
| 0 | [
2,
2917,
172,
3142,
710,
6488,
19,
21024,
625,
6732,
1326,
800,
3726,
3726,
31,
589,
4325,
40,
1513,
19,
1017,
172,
13,
9,
1608,
710,
6488,
2198,
429,
9,
31,
22,
79,
568,
14,
1797,
37,
48,
689,
45,
7775,
6903,
23556,
1898,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP Force Download Remote File without Going Through Our Server
===
I wrote a php script which retrieves flv URL from YouTube and force download it using header and readfile() function. It works properly but the flv file goes through my hosting server before going to the user that spend tons of bandwidth and cause the server down.
Does anyone have the better solutions to solve this problem? | 0 | [
2,
13,
26120,
558,
7121,
5388,
3893,
366,
228,
120,
318,
8128,
800,
3726,
3726,
31,
738,
21,
13,
26120,
3884,
56,
11917,
18,
398,
8916,
287,
6362,
37,
7330,
17,
558,
7121,
32,
568,
157,
106,
17,
1302,
16877,
5,
6,
1990,
9,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Collection library for Ruby
===
Is there something like collection classes from Guava for Ruby? So far I've only found implementation of red-black tree which is not in the same league as say Java TreeMap class. | 0 | [
2,
1206,
1248,
26,
10811,
800,
3726,
3726,
25,
80,
301,
101,
1206,
2684,
37,
10658,
1385,
26,
10811,
60,
86,
463,
31,
22,
195,
104,
216,
6123,
16,
402,
8,
5485,
1541,
56,
25,
52,
19,
14,
205,
278,
28,
395,
8247,
1541,
15022,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
zend query maximum field length
===
Im trying to insert a log record in my log table. But somehow when the field value lenght exceeds 199 chars, my apache restarts and my browsers says net::ERR_CONNECTION_RESET.
I'm using the Zend Framework, so I insert my record with the following lines of code:
$db = Global_Db_Connection::getInstance();
$sql = "INSERT INTO log_table (log) VALUES ('ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd')";
$db->query($sql);
If i dont use the framework, using:
mysql_query($sql);
Then i dont have any problems.
Anyone can tell me how to fix this limit in Zend? | 0 | [
2,
10526,
43,
25597,
2979,
575,
1476,
800,
3726,
3726,
797,
749,
20,
14692,
21,
6738,
571,
19,
51,
6738,
859,
9,
47,
3625,
76,
14,
575,
1923,
10655,
4780,
38,
11976,
18,
13,
22058,
4892,
18,
15,
51,
17140,
22767,
18,
17,
51,
164... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Identify the package name for specified application(.apk) in android
===
My application contains some list of *.apk files.
I know only the application(example.apk) name.
How to identify this application(example.apk) package name through programmatically.
Is it possible.
Thanks in advance. | 0 | [
2,
184,
20,
5808,
14,
6030,
204,
26,
9931,
3010,
5,
9,
2552,
197,
6,
19,
13005,
800,
3726,
3726,
51,
3010,
1588,
109,
968,
16,
1637,
9,
2552,
197,
6488,
9,
31,
143,
104,
14,
3010,
5,
29041,
9,
2552,
197,
6,
204,
9,
184,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Selecting of data between a time period and calculating the difference of another parameter(time)
===
I have a DB with many tables and one of the table has fields:
id----number-----start-----end
Start corresponds to date and time of process: 2012-06-08 01:16:07
End correspond to end of the process : 2012-06-08 01:39:47
I need to count all the processes that were in the previous 4 weeks, with a duration of above 10mins.....Just the no: processes is enough.
A php querying from the DB is required.Tried in a few ways but dint even get near. How do I do that? | 0 | [
2,
20764,
16,
1054,
128,
21,
85,
620,
17,
22937,
14,
2841,
16,
226,
18906,
5,
891,
6,
800,
3726,
3726,
31,
57,
21,
13,
9007,
29,
151,
7484,
17,
53,
16,
14,
859,
63,
2861,
45,
4924,
8,
8,
8,
8,
16299,
8,
8,
8,
8,
8,
13680... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to implement a type file in symfony2
===
The problem is to handle the file type fields.
By doing this I take the field as "Browse to upload the file" now to save time remains. I do not know how to handle it properly if anyone has an example. would be very useful. | 0 | [
2,
184,
20,
8713,
21,
1001,
3893,
19,
13,
7261,
10229,
93,
135,
800,
3726,
3726,
14,
1448,
25,
20,
3053,
14,
3893,
1001,
2861,
9,
34,
845,
48,
31,
247,
14,
575,
28,
13,
7,
25699,
870,
20,
71,
8294,
14,
3893,
7,
130,
20,
2079... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
A Few Links On My Webpage Do Not Work
===
On my newly created webpage I have a column of links that all work except for the top two. I have double checked the code and all of it seems to be uniform. I am not too sure why it is not allowing me to click on the two links at the top, but the rest seem to be working perfectly. If anyone could take a crack at what the problem may be I would really appreciate it! I have pasted the section of the code that I thought might contain the problem! Thanks!
<!DOCTYPEhtml>
<html>
<head>
<title> Rockwell Utilities </title>
<link href="rockwell.css" rel="stylesheet" type="text/css"/>
</head>
<div class="pos_top"><div id="bubbles"><img src="/rockwell/sepiawater.jpg" alt="Water Drop" height="250" width="1000"/></div></div>
<div id="header"><div id="logo"><img src="/rockwell/Rockwellnewnewedit.png" alt="Rockwell Utilities" height="400" width="500" /></div></div>
</body>
<div id="wrapper">
<h1> Rockwell Utilities Welcomes You! </h1>
<div id="intro">
<p>Rockwell Utilities is your number one choice in water and sewage.<br> We provide service to the Lakemoor, Illinois area,
<br>and have since 2007.
</p>
<img src="/rockwell/award.png" alt="Illinois Department of Health" height="200" width="500"/>
<a href="http://www.idph.state.il.us/public/press12/2011_Fluoridation_award_list.pdf"> <p>Rockwell
Utilities wins Illinois Department of Health Community Water Fluoridation Award four consecutive years!</p>
</a>
</div>
<div id="navigation_sidebar">
<div id="navigation_links">
<p>
<a href="email.html" title="Email Us"><img src="/rockwell/emailus.png" alt="Email Us"/></a>
<a href="payments.html" title="Pay My Bill"><img src="/rockwell/paymybill.png"alt="Pay My Bill"/></a>
<a href="calendar.html" title="Calendar"><img src="/rockwell/calendar.png"alt="Calendar"/></a>
<a href="notices.html" title="Notices"><img src="/rockwell/notices.png"alt="Notices"/></a>
<a href="paymentop.html" title="Payment Options"><img src="/rockwell/paymentop.png"alt="Payment Options"/></a>
<a href="rates.html" title="Our Rates"><img src="/rockwell/ourrates.png"alt="Our Rates"/></a>
</p> | 0 | [
2,
21,
310,
6271,
27,
51,
2741,
6486,
107,
52,
170,
800,
3726,
3726,
27,
51,
2771,
679,
2741,
6486,
31,
57,
21,
4698,
16,
6271,
30,
65,
170,
1613,
26,
14,
371,
81,
9,
31,
57,
1494,
6505,
14,
1797,
17,
65,
16,
32,
2206,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java web application on apache tomcat
===
Assalam-o-alaikum and Hello to all!
I am developing a web application in java using its frame work vaadin. I am running that application on apache tomcat. What i want to ask is that, if i run that application on apache tomcat and access the same applicaiton using two different browsers on two different computers, then whether the application than have two instances on tomcat or it has single instance?? I am searching it on internet also, but unable to find a satisfactory answer.
Thanks ! | 0 | [
2,
8247,
2741,
3010,
27,
17140,
2067,
5782,
800,
3726,
3726,
28,
18,
12777,
8,
111,
8,
4242,
49,
21876,
17,
10975,
20,
65,
187,
31,
589,
3561,
21,
2741,
3010,
19,
8247,
568,
82,
3523,
170,
3471,
1283,
108,
9,
31,
589,
946,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I replace 40% characters from file ? C#
===
Today is a new day, today is a new project.
I have a text file with characters like this(eg.):
**Hi man. how is going. cool. lool. love this thing.
fo real. yep.no way.it's real.haha.**
Here are 10 characters of "." I just want to replace 40% of them (randomly) with " " (space).
I haven't tried any things out yet.
I was thinking like this. Find number of "." from entire text, get the 40% out of it. If it's float, make it int, doesn't matter, the file has like 50 lines, with like 300 characters on each line.
After I count that, how can I make it randomly to replace 4 characters of "." (in this case) with space ?
| 4 | [
2,
184,
92,
31,
3934,
15824,
1766,
37,
3893,
13,
60,
272,
5910,
800,
3726,
3726,
786,
25,
21,
78,
208,
15,
786,
25,
21,
78,
669,
9,
31,
57,
21,
1854,
3893,
29,
1766,
101,
48,
5,
5431,
9,
6,
45,
13,
1409,
1822,
169,
9,
184,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
iOS video player metadata
===
My question is if there is any built-in interpretation of metadata by the video player in iOS. I know one can add meta-data to a video and interpret it within a custom application as shown [here](http://jmacmullin.wordpress.com/2010/11/03/adding-meta-data-to-video-in-ios/).
In iOS on ipod or iphone, an HTML video is opened within the native player. I would like to display a message above or below the video for a short duration at the beginning. Since I cannot control the native player I thought there might be some built in metadata interpretation that could be used to perform this. I have not been able to find any information on this.
Any help is appreciated. | 0 | [
2,
13,
7760,
763,
517,
28057,
800,
3726,
3726,
51,
1301,
25,
100,
80,
25,
186,
392,
8,
108,
6973,
16,
28057,
34,
14,
763,
517,
19,
13,
7760,
9,
31,
143,
53,
92,
3547,
7618,
8,
18768,
20,
21,
763,
17,
11584,
32,
363,
21,
5816... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to use MEF to allow plugins to override existing functionality?
===
I'm using MEF to allow users to extend my C# library. It's working great so far, but right now I'm trying to use it in a way I haven't seen it used before.
The primary use case for MEF I've seen so far is this:
- Application exposes primitive interface (`IPerson`)
- External library uses MEF and primitive interfaces to extend functionality of main library (e.g. `IPoliceman : IPerson`, adds functionality)
- Application then uses `ImportMany` to search for correct `IPerson` depending on what it must do
But I need something like this: Let's say I have a tax calculator that takes a bunch of parameters and returns estimated tax depending on those parameters. I want users to be able to create plugins with MEF that **modify** how those calculations are done. Only one plugin that does this should be able to be loaded at any one time. Otherwise, how do I decide which alternate implementation to use?
So basically, my question boils down to this: Usually MEF allows **adding** implementations of classes and methods. How do I use it to allow users to **replace** an implementation? | 0 | [
2,
184,
20,
275,
55,
410,
20,
1655,
10922,
108,
18,
20,
84,
11891,
3149,
18548,
60,
800,
3726,
3726,
31,
22,
79,
568,
55,
410,
20,
1655,
3878,
20,
7206,
51,
272,
5910,
1248,
9,
32,
22,
18,
638,
374,
86,
463,
15,
47,
193,
130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can't get a somewhat complicated query working
===
I'm trying to get a somewhat complicated query working and am not having any luck whatsoever.
Suppose I have the following tables:
**cart_items:**
+--------------------------------------------+
| item_id | cart_id | movie_name | quantity |
+--------------------------------------------+
| 0 | 0 | braveheart | 4 |
| 1 | 0 | braveheart | 9 |
| . | . | . | . |
| . | . | . | . |
| . | . | . | . |
| . | . | . | . |
+--------------------------------------------+
**movies:**
+------------------------------+
| movie_id | movie_name | ... |
+------------------------------+
| 0 | braveheart | . |
| . | . | . |
| . | . | . |
| . | . | . |
| . | . | . |
+------------------------------+
**pricing:**
+-----------------------------------------+
| id | movie_name | quantity | price_per |
+-----------------------------------------+
| 0 | braveheart | 1 | 1.99 |
| 1 | braveheart | 2 | 1.50 |
| 2 | braveheart | 4 | 1.25 |
| 3 | braveheart | 8 | 1.00 |
| . | . | . | . |
| . | . | . | . |
| . | . | . | . |
| . | . | . | . |
| . | . | . | . |
+-----------------------------------------+
<br>
I need to join the data from the tables, but with the added complexity that I need to get appropriate `price_per` from the `pricing` table. Only one price should be returned for each `cart_item`, and that should be the lowest price from the `pricing` table where the `quantity` for the cart item is at least the quantity in the `pricing` table.
So, the query should return for each item in `cart_items` the following:
+---------------------------------------------+
| item_id | movie_name | quantity | price_per |
+---------------------------------------------+
<br>
Example 1:
Variable passed to the query: cart_id = 0. Return:
+---------------------------------------------+
| item_id | movie_name | quantity | price_per |
+---------------------------------------------+
| 0 | braveheart | 4 | 1.25 |
| 1 | braveheart | 9 | 1.00 |
+---------------------------------------------+
<br>
Note that this is a minimalist example and that additional data will be pulled from the tables mentioned (particularly the movies table).
How could this query be composed? I have tried using left joins and subqueries, but the difficult part is getting the price and nothing I have tried has worked.
Thanks for your help.
| 0 | [
2,
92,
22,
38,
164,
21,
4131,
8343,
25597,
638,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
21,
4131,
8343,
25597,
638,
17,
589,
52,
452,
186,
5419,
22207,
9,
5787,
31,
57,
14,
249,
7484,
45,
13,
1409,
1367,
38,
1,
2119,
79,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the point of using `-L` when there is `LD_LIBRARY_PATH`?
===
After reading [this question][1], my first reaction was that the user is not seeing the error because he specifies the location of the library with `-L`.
However, apparently, the `-L` option only influences where the linker looks, and has no influence over where the loader looks when you try to run the compiled application.
My question then is what's the point of `-L`? Since you won't be able to run your binary unless you have the proper directories in `LD_LIBRARY_PATH` anyway, why not just put them there in the first place, and drop the `-L`, since the linker looks in `LD_LIBRARY_PATH` automatically?
[1]: http://stackoverflow.com/questions/11385331/c-program-linking-with-shared-library-without-setting-ld-library-path/11385376#comment15006786_11385376 | 0 | [
2,
98,
25,
14,
454,
16,
568,
13,
1,
8,
255,
1,
76,
80,
25,
13,
1,
6252,
1,
1210,
2559,
622,
1,
8353,
1,
60,
800,
3726,
3726,
75,
1876,
636,
1565,
1301,
500,
2558,
165,
500,
15,
51,
64,
3006,
23,
30,
14,
4155,
25,
52,
207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CakePHP self-join a HABTM table without breaking Cake's automation
===
I have a table of athletes. Athletes have coaches, who are also athletes. Athletes may have multiple coaches.
To handle this, I have created an athletes table, that uses a join table with an id field, and athlete_id field, and a coach_id field. Both the athlete_id and coach_id fields point back to the athletes table to the id field.
Normally, according to Cake conventions, I would have to name both of my fields athlete_id, but I have found the following link that shows how to handle that: http://book.cakephp.org/1.2/view/851/Multiple-relations-to-the-same-model
According to Cake conventions, I would name my join table athletes_athletes, but I'm not sure that will function correctly? It seems like it might make sense to call it athletes_coaches, but I bet that might break Cake's automatic functionality.
Will this work with the join table being called athletes_athletes? Is this the right way to do it? Is there a better way?
Thanks!
Adam
| 0 | [
2,
8390,
26120,
1119,
8,
1636,
108,
21,
13,
9075,
38,
79,
859,
366,
3892,
8390,
22,
18,
23217,
800,
3726,
3726,
31,
57,
21,
859,
16,
7198,
9,
7198,
57,
7527,
15,
72,
50,
67,
7198,
9,
7198,
123,
57,
1886,
7527,
9,
20,
3053,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Scrolling to a particular div
===
I have a html page with three divs having text content. I want to scroll to a particular div depending upon the link user clicks on the home page.
There are three links on home page so what i want is if the user clicks on link 1 he is scrolled to div 1 on the resultant page, clicks on link 2 on home page then scrolls to div 2 on resultant page and so on. | 0 | [
2,
13,
28166,
20,
21,
1498,
13,
12916,
800,
3726,
3726,
31,
57,
21,
13,
15895,
2478,
29,
132,
13,
12916,
18,
452,
1854,
2331,
9,
31,
259,
20,
12159,
20,
21,
1498,
13,
12916,
4758,
685,
14,
3508,
4155,
10840,
18,
27,
14,
213,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
lamda vs. where clause
===
I'm reading Beginning Rails 3. The book creates a project where Users can post Articles. Now inside the Article object they create 3 scopes like so:
scope :published, where("articles.published_at IS NOT NULL")
scope :draft, where("articles.published_at IS NULL")
scope :recent, lambda { published.where("articles.published_at > ?", 1.week.ago.to_date)}
Now the last lambda function I can replace it with this scope statement and I get the same results:
scope :recent, where("published_at > ?", 1.week.ago.to_date)
My question is what's the advantage of using a lambda?
thanks,
mike | 0 | [
2,
11108,
593,
4611,
9,
113,
9040,
800,
3726,
3726,
31,
22,
79,
1876,
997,
2240,
18,
203,
9,
14,
360,
9695,
21,
669,
113,
3878,
92,
678,
3376,
9,
130,
572,
14,
2002,
3095,
59,
1600,
203,
9914,
18,
101,
86,
45,
9914,
13,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
php curl download stops at 95%
===
this is very weird, php curl download stops at 95% all the time. its driving me crazy.
here is the code that i'm using nothing fancy
$fp = fopen($file, 'w');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.domain.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch,CURLOPT_HTTPHEADER,array("ETag: $rddash"));
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
fclose($fp);
Something i noticed, the remote website is using Etag, so i used it but still not working.
what could be the reason the download stops before it completes?? | 0 | [
2,
13,
26120,
14320,
7121,
6604,
35,
13,
20371,
800,
3726,
3726,
48,
25,
253,
5455,
15,
13,
26120,
14320,
7121,
6604,
35,
13,
20371,
65,
14,
85,
9,
82,
2891,
55,
3328,
9,
235,
25,
14,
1797,
30,
31,
22,
79,
568,
626,
12251,
557... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Flex: PopUpManager giving "...null object reference" error
===
I have a main application calling several ViewStack states, each with popup windows. If I don't open any popup windows, I can move between states fine. If I open a popup window then try to change the state using `currentState=...` I get the error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at spark.components::Scroller/focusInHandler()[E:\dev\4.y\frameworks\projects\spark\src\spark\components\Scroller.as:2139]
at flash.display::Stage/set focus()
at mx.core::UIComponent/setFocus() [E:\dev\4.y\frameworks\projects\framework\src\mx\core\UIComponent.as:9905]
...
I see others having the same problem, for example here:
http://forums.adobe.com/message/3448443
http://forums.adobe.com/thread/655749?tstart=-1
http://forums.adobe.com/thread/801149
But I haven't figured out how to implement the recommended solution. It sounds like I should just include:
import mx.managers.PopUpManager; PopUpManager;
inside my main application and it should work, but it doesn't work for me.
My application has each view state in a different file, each defined using `<views:View>`. Also, all of the popups are separate files defined as `<s:TitleWindow>`. Each file includes this line:
import mx.managers.PopUpManager;
I wonder if this means each file is using a different popup manager(?), when it's a singleton and only one should be used for the whole app (how to set that up?).
The code I use to call a popup is:
var _popupName:MyTitleWindowFileName = MyTitleWindowFileName(
PopUpManager.createPopUp(this, MyTitleWindowFileName, true));
_popupName.addEventListener(MyAppController.CLOSE_POPUP,onClosePopUp);
PopUpManager.centerPopUp(_popupName); // call popup
Any ideas much appreciated. | 0 | [
2,
14409,
45,
1675,
576,
22256,
1438,
13,
7,
9,
9,
9,
4215,
211,
3095,
2801,
7,
7019,
800,
3726,
3726,
31,
57,
21,
407,
3010,
2555,
238,
1418,
25325,
202,
15,
206,
29,
1675,
576,
1936,
9,
100,
31,
221,
22,
38,
368,
186,
1675,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding The Navigation Bar to current Program
===
I have an app with a Tabbar controller containing three tabs. I need to add a navigation controller to the first tab. My root View controller is the tabbar so how to I add the navigation bar? I have the navigation bar initialized but dont know where to set it. Thanks to anyone that can help and ask if you need more information. This is my app delegate.m:
#import "TACAppDelegate.h"
#import "FirstViewController.h"
#import "ThirdViewController.h"
#import "SecondViewController.h"
@implementation TACAppDelegate
@synthesize window = _window;
@synthesize tabBarController = _tabBarController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
/* Initialize window view */
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
/* Initialize tab bar controller, add tabs controllers */
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [self initializeTabBarItems];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
return (YES);
}
....
- (NSArray *)initializeTabBarItems
{
NSArray * retval;
/* Initialize view controllers */
FirstViewController *viewController1 = [[FirstViewController alloc] init];
SecondViewController *viewController2 = [[SecondViewController alloc] init];
ThirdViewController *viewController3 = [[ThirdViewController alloc] init];
/* Initialize navigation controllers */
UINavigationController *navigationController1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
/* Stuff Navigation Controllers into return value */
retval = [NSArray arrayWithObjects:viewController1,viewController2,viewController3,nil];
return (retval);
}
@end
| 0 | [
2,
4721,
14,
8368,
748,
20,
866,
625,
800,
3726,
3726,
31,
57,
40,
4865,
29,
21,
6523,
1850,
9919,
3503,
132,
6523,
18,
9,
31,
376,
20,
3547,
21,
8368,
9919,
20,
14,
64,
6523,
9,
51,
5900,
1418,
9919,
25,
14,
6523,
1850,
86,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
echo multiple lines into a file
===
I have a httpd.conf file of shared hosting server and I have a task to migrate every virtual host to a vps. using awk I extract a block of virtual host entry for a particular site. and store that entry in a variable. but when i echo the out put of the variable to append httpd.conf of vps server it gives a error like
bash: command substitution: line 1: syntax error near unexpected token `newline'
bash: command substitution: line 1: `echo <VirtualHost 10.XX.XXX.XX>'
Could anyone tell what is exact way to append simple text file by echo a variable having multiple lines.
| 0 | [
2,
8117,
1886,
1560,
77,
21,
3893,
800,
3726,
3726,
31,
57,
21,
7775,
43,
9,
14093,
3893,
16,
2592,
10637,
8128,
17,
31,
57,
21,
3005,
20,
22985,
352,
6599,
2015,
20,
21,
13,
10924,
18,
9,
568,
13,
3885,
197,
31,
10962,
21,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C# webbrowser control: click won't work
===
I used the DocumentComplete event to autocomplete a form. Everything is OK except the checkbox. The html code is the following:
<span class="myClass" style="padding-left: 12px; vertical-align: bottom; cursor: pointer;">
<input id="ich_liebe_dich" type="checkbox" name="ich$liebe$dich">
<label for="ich_liebe_dich"> MyLabel</label>
</span>
I tried using:
webbrowser.Document.GetElementById("ich_liebe_dich").InvokeMember("click");
and
webbrowser.Document.GetElementById("ich$liebe$dich").InvokeMember("click");
and also:
foreach (HtmlElement current in webbrowser.Document.GetElementsByTagName(tag))
{
if (current.GetAttribute(attr).Equals(attName))
current.InvokeMember(invoke);
}
where attr="id", tag="input", invoke="click" and attName= either "ich_liebe_dich" or "ich$liebe$dich".
The best I got was a transiently - just for a fraction of a second - checked checkbox. Why would this happen? Any solutions?
| 0 | [
2,
272,
5910,
10192,
5417,
4104,
569,
45,
10840,
230,
22,
38,
170,
800,
3726,
3726,
31,
147,
14,
4492,
15990,
807,
20,
3108,
15990,
21,
505,
9,
796,
25,
5854,
1613,
14,
2631,
5309,
9,
14,
13,
15895,
1797,
25,
14,
249,
45,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What's the better way to communicate users in my WP7 app?
===
In my app i am maintaining the users .I need to provide the communication between the users.
For that i want to implement chat in my app.What's the better way to implement the chat in wp7?
I saw socket programming it seems to be security problem.
And i saw XMPP Framework it is licensed may need to package when deploy.
Tell me other alternatives to implement chat in WP7..
Please tell me ...
Thanks,
| 0 | [
2,
98,
22,
18,
14,
574,
161,
20,
8709,
3878,
19,
51,
13,
13790,
465,
4865,
60,
800,
3726,
3726,
19,
51,
4865,
31,
589,
8215,
14,
3878,
13,
9,
49,
376,
20,
1181,
14,
3291,
128,
14,
3878,
9,
26,
30,
31,
259,
20,
8713,
6615,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
OracleParameter to Int32 issue
===
I have a SQL code as follows:
public void UpdateDatabase(String strParam1, int row)
{
System.Data.OracleClient.OracleConnection conn = new System.Data.OracleClient.OracleConnection();
conn.ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.5.144)(PORT = 1521))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = orcl)));UID=mwm;PWD=mwm";
conn.Open();
OracleCommand command = conn.CreateCommand();
command.CommandText = "Select id from Task";
OracleParameter taskId = new OracleParameter();
taskId.DbType = DbType.Int32;
taskId.Value = taskId;
taskId.ParameterName = "taskId";
command.Parameters.Add(taskId);
command.ExecuteNonQuery();
command.Dispose();
}
}
When ExecuteNonQuery is reached, I get an error "Failed to convert parameter value from a OracleParameter to a Int32" What is wrong here? I googled but couldn't come to a conclusion. | 0 | [
2,
15759,
6351,
7307,
20,
19,
38,
3125,
1513,
800,
3726,
3726,
31,
57,
21,
4444,
255,
1797,
28,
2415,
45,
317,
11364,
6372,
4375,
8436,
5,
11130,
354,
6952,
14309,
165,
15,
19,
38,
3131,
6,
13,
1,
329,
9,
18768,
9,
6055,
5615,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
simple XML Schema - XSD
===
I have the following xsd file which is throwing "invalid schema" error. I have done many complex schemas before but cannot seem to figure out what is wrong with this one, which should be very straight forward. I know I need something after
<xsd:element name="ebay">
but what?
XML:
<ebay><userID></userID></ebay>
Schema:
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="ebay">
<xs:element name="userID">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="255"/>
<xsd:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xsd:element>
</xsd:schema> | 0 | [
2,
1935,
23504,
23874,
13,
8,
993,
18,
43,
800,
3726,
3726,
31,
57,
14,
249,
993,
18,
43,
3893,
56,
25,
6033,
13,
7,
108,
18506,
43,
23874,
7,
7019,
9,
31,
57,
677,
151,
1502,
23874,
18,
115,
47,
1967,
2260,
20,
1465,
70,
98... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get the lookup field value for a list item in SharePoint 2010 using C#
===
I am relatively new to sharepoint and try to write a web service to return our sharepoint inventory data as xml it was ok up to now but one of those list includes a lookup field and in created xml instead of returning value it returns the class below.
<code>
Microsoft.SharePoint.Client.FieldLookupValue
</code>
Below also includes the code I used for creating xml
<code>
//id == "pcat:401824" && category == Altyapı.Kamera sistemleri
resultList = remoteWeb.Lists.GetByTitle("Cam Devices");
context.Load(resultList);
context.ExecuteQuery();
//Now its time to reach list's items
items = resultList.GetItems(new CamlQuery());
context.Load(items);
context.ExecuteQuery();
foreach (ListItem item in items)
{
rootNode.AppendChild(doc.CreateElement("ID")).InnerText = "pcat:401824";
rootNode.AppendChild(doc.CreateElement("Category")).InnerText = "Cam Devices";
rootNode.AppendChild(doc.CreateElement("Kimlik")).InnerText = Convert.ToString(item["ID"]);
rootNode.AppendChild(doc.CreateElement("Isim")).InnerText = Convert.ToString(item["Location0"]) + " >> " + Convert.ToString(item["Brand"]) + " >> " + Convert.ToString(item["ID"]);
}
</code>
The above code item["Location"] is a lookup field and being a problem, so just search internet and there are lots of article about situation but not able to figure them out there is a class called FieldLookupValue but how can I use it to get lookup value of field?
All helps will be appreciated and sorry for my pidgeon english | 0 | [
2,
164,
14,
361,
576,
575,
1923,
26,
21,
968,
9101,
19,
1891,
3132,
498,
568,
272,
5910,
800,
3726,
3726,
31,
589,
3109,
78,
20,
1891,
3132,
17,
1131,
20,
2757,
21,
2741,
365,
20,
788,
318,
1891,
3132,
13875,
1054,
28,
23504,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
git repository in local machine to access from laptop
===
I would like to have the following setup to work with git: for a given project I would like to have my "origin" repository in a directory of my desktop computer at work ($desktop). Then I would like to be able to access, pull and push from this repository from home or anywhere else ($laptop).
For what I have seen in other [questions](http://stackoverflow.com/questions/5412562/setting-up-git-repository-on-local-machine) the process would normally involve creating a bare git repository in my desktop using
$desktop > git init -bare
However my understanding is that this would produce a repository without a working directory. I don't want this. I want my repository to be project specific, to be located in a given directory in both my desktop and laptop and to keep track only of stuff that I keep in a given directory tree. This is apparently problematic with git and that one should "never" push into a normal repository.
Is there a way of sorting this out?
| 0 | [
2,
13,
10404,
24869,
19,
375,
1940,
20,
1381,
37,
12294,
800,
3726,
3726,
31,
83,
101,
20,
57,
14,
249,
18161,
20,
170,
29,
13,
10404,
45,
26,
21,
504,
669,
31,
83,
101,
20,
57,
51,
13,
7,
28486,
7,
24869,
19,
21,
16755,
16,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF 4 and JSONP
===
I am experimenting with JSONP and WCF. I am looking at examples on the web and they seem to need callbacks querystrings adding to the url and the javascript to consume the JSON is a different as well.
I've got it working by simply changing the web.config binding
<binding name="JSON" crossDomainScriptAccessEnabled="true"></binding>
and changing the datatype in the js to dataType: "jsonp"
This seems to work. I have the WCF on my localhost and the JS calling it on a remote domain. This seems a lot simpler than the examples. Am I missing something. Are newer versions of JQuery/WCF a bit cleverer? Or does localhost not have the same cross domain restrictions based on it?
| 0 | [
2,
11801,
410,
268,
17,
487,
528,
306,
800,
3726,
3726,
31,
589,
5737,
68,
29,
487,
528,
306,
17,
11801,
410,
9,
31,
589,
699,
35,
3770,
27,
14,
2741,
17,
59,
2260,
20,
376,
645,
1958,
18,
25597,
11130,
18,
4721,
20,
14,
287,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Brightness filter in firefox and opera without svg file
===
For my current project i used filter `-webkit-filter: brightness(-20%);-moz-filter: brightness(-20%);` But somewhy, this filter doesnt works in firefox and opera(i have opera prefix too). I found, the way how this can be used, but i need to turn brightness filter into svg code. Any ideas how can i do this?
What i have to do, is a small gallery, with darkened images, and with normal images on hover without using 2x images. | 0 | [
2,
21138,
11945,
19,
535,
18219,
17,
1877,
366,
13,
18,
22955,
3893,
800,
3726,
3726,
26,
51,
866,
669,
31,
147,
11945,
13,
1,
8,
14113,
13703,
8,
11924,
815,
45,
21138,
5,
8,
21447,
6,
73,
8,
18057,
8,
11924,
815,
45,
21138,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Facebook Authorization url, scoped authorization url and token url
===
I am trying to write a java code to get the access token of facebook in order to do operation in it using graph API.For that I need to know the Facebook Authorization url, scoped authorization url and token url?
Kindly, specify those urls. | 0 | [
2,
9090,
22677,
287,
6362,
15,
9914,
43,
22677,
287,
6362,
17,
20,
2853,
287,
6362,
800,
3726,
3726,
31,
589,
749,
20,
2757,
21,
8247,
1797,
20,
164,
14,
1381,
20,
2853,
16,
9090,
19,
389,
20,
107,
1453,
19,
32,
568,
7210,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
opening a Popup in mvc3
===
I have hyperlink column in grid and clicking the link i want to open a popup. Below is my code.
cols.Bound(o => o.PO_NO).ClientTemplate(Html.ActionLink("<#=PO_NO#>", "SurPODtls", new { controller = "Home", PO_NO = "<#=PO_NO#>" }, new {target= "_self"}).ToString()).Title("PO No").Width(30).Filterable(false);
In SurPODtls action method iam returning the partial view of SurPODtls, which contains the telrik window in which iam again calling the partial view to load the controls and data.
But this not works for me. Please provide solution, if anyone have idea | 0 | [
2,
1214,
21,
1675,
576,
19,
307,
8990,
240,
800,
3726,
3726,
31,
57,
5443,
6258,
4698,
19,
7354,
17,
25590,
14,
3508,
31,
259,
20,
368,
21,
1675,
576,
9,
1021,
25,
51,
1797,
9,
3313,
18,
9,
7410,
5,
111,
800,
1,
635,
9,
1638... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Timeline data- store solution
===
I'm facing a funny problema: I have to display an aggregated feed of Facebook, Foursquare and Twitter for my users and I don't know what solution use. A lot of batches are running in parallel, there are many updates in the activity streams.
I need to manipulate lists of activities, so I tried first Redis, but the replication doesn't work when you are using many sunionstore command. I've been thinking of :
- noSQL
-> HBase.
- newSQL
-> VoltDB and SQLFire.
- data-grid
-> Infinispan, GridGain and Gigaspace
What do you think I should use? Have you any other idea? | 0 | [
2,
18398,
1054,
8,
1718,
4295,
800,
3726,
3726,
31,
22,
79,
4325,
21,
5066,
1448,
58,
45,
31,
57,
20,
3042,
40,
8544,
43,
4063,
16,
9090,
15,
222,
12300,
17,
10623,
26,
51,
3878,
17,
31,
221,
22,
38,
143,
98,
4295,
275,
9,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a txt file fails with php
===
I am trying to create a file and write a message in a folder called debug:
function debug($report){
$file="/debug/debug.txt";
file_put_contents($file,$report,FILE_APPEND | LOCK_EX);
}
The debug folder is in my root directory. But file fails to be created.. why? | 0 | [
2,
2936,
21,
20225,
38,
3893,
13614,
29,
13,
26120,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
3893,
17,
2757,
21,
2802,
19,
21,
19294,
227,
121,
16254,
45,
1990,
121,
16254,
5,
4403,
17437,
6,
1,
5579,
16877,
3726,
7,
118,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extending PrimeFaces's column component
===
I'm trying to extend PrimeFaces's column component - primarily to create headers and to auto-insert the object's field based on a key value without having to manually insert column tags with their associated facets.
I have the following in my my custom component:
@Override
public void encodeEnd(FacesContext context, UIComponent component)
throws java.io.IOException {
Object columnOrder = component.getAttributes().get("columnOrder");
if (columnOrder != null) {
component.getChildren().clear();
Application application = context.getApplication();
ExpressionFactory expressionFactory = application.getExpressionFactory();
Column column = new Column();
Object var = component.getAttributes().get("var");
String varKey = columnOrder.toString();
UIOutput header = (UIOutput) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
header.setValue(varKey);
column.getFacets().put("header", header);
ValueExpression valExpr = expressionFactory.createValueExpression("#{" + var + "." + varKey + "}", String.class);
UIOutput cell = (UIOutput) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
cell.setValueExpression("value", valExpr);
column.setStyleClass(varKey);
column.getChildren().add(cell);
component.getChildren().add(column);
component.getAttributes().remove("columnOrder");
}
super.encodeEnd(context, component);
}
and am calling it so
<my:dataTable var="item" value="#{myBean.collection}" columnOrder="field" />
The header gets set correctly, but the cell outputs literally *#{item.field}* rather than evaluating the expression.
The setStyleClass on the column component fails to have the desired effect as well.
I'm guessing that I have got hold of the wrong end of the stick and am going the wrong way about this.
NB. in this reduced example, I'm assuming that columnOrder is a single string and the header simply uses the key value, rather than a list of keys which look up in a bundle.
| 0 | [
2,
8176,
1621,
6413,
18,
22,
18,
4698,
5912,
800,
3726,
3726,
31,
22,
79,
749,
20,
7206,
1621,
6413,
18,
22,
18,
4698,
5912,
13,
8,
2257,
20,
1600,
157,
445,
17,
20,
3108,
8,
108,
18,
6767,
14,
3095,
22,
18,
575,
432,
27,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to create a global semaphore for all processes?
===
I have a problem with a semaphore in my code :
This is a struct that I built :
struct PipeShm
{
// doesn't matter
sem_t *mutex;
int init;
// more fields
};
Here I initialize the struct :
struct PipeShm myPipe ;
myPipe.mutex = NULL;
myPipe.init = 0;
And I use an initialization method :
int initMethod()
{
if (!myPipe.init)
{
myPipe.mutex = mmap (NULL, sizeof *myPipe.mutex, PROT_READ | PROT_WRITE,MAP_SHARED | MAP_ANONYMOUS, -1, 0);
if (!sem_init (myPipe.mutex, 1, 0))
{
myPipe.init = TRUE;
}
else
perror ("initMethod");
}
return 1;
}
This is a simple main that uses the above :
int main()
{
int spd, pid, rb;
char buff[4096];
shm_pipe_init();
fork();
// more code goes here
return 0;
}
So , in the line `fork();` (please correct me if I'm wrong) the `2` processes would
have the two different semaphores , right ?
If so , I want to make the a global semaphore , is that possible ?
Due to problems of synchronization in my code , I suspect that the main reason is
a double semaphore for each created process .
Much appreciated
| 0 | [
2,
25,
32,
938,
20,
1600,
21,
2062,
13,
18,
5996,
11093,
62,
26,
65,
5102,
60,
800,
3726,
3726,
31,
57,
21,
1448,
29,
21,
13,
18,
5996,
11093,
62,
19,
51,
1797,
13,
45,
48,
25,
21,
13,
10346,
30,
31,
392,
13,
45,
13,
10346... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL delete from 2 tables with one query
===
I need to delete from two tables, based on a query in one query
Table: entities
guid: integer
subtype: integer
time_created: integer (Unix timestamp)
Table: objects_entity
guid: integer
title: text
guid in objects_entity is a foreign key to entities.guid
I need to delete related records in both tables based on subtype=17 and time_created is older than 14 days in entities (so also delete related objects_entity)
I'm very bad at SQL and by looking at examples I've created this:
DELETE entities, objects_entity FROM entities a INNER JOIN objects_entity b on b.guid = a.guid AND a.subtype =17 AND a.time_created < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 14 DAY))
but this gives the error:
#1109 - Unknown table 'entities' in MULTI DELETE
which is beyond me, as a select statement identical to above works correctly.... The table exists.
Any ideas what's wrong with my syntax? Many thanks. | 0 | [
2,
51,
18,
22402,
27448,
37,
172,
7484,
29,
53,
25597,
800,
3726,
3726,
31,
376,
20,
27448,
37,
81,
7484,
15,
432,
27,
21,
25597,
19,
53,
25597,
859,
45,
12549,
9457,
43,
45,
13820,
972,
4474,
45,
13820,
85,
1,
18475,
45,
13820,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to open up a VF page in a new tab?
===
Really new to VF, but here's my VF page. the desired effect is that i want it opened up in a new tab in the same window.
<apex:page standardController="myController__c" extensions="myExtension" action=" {!actionJackson}">
</apex:page> | 0 | [
2,
184,
20,
368,
71,
21,
13,
21441,
2478,
19,
21,
78,
6523,
60,
800,
3726,
3726,
510,
78,
20,
13,
21441,
15,
47,
235,
22,
18,
51,
13,
21441,
2478,
9,
14,
9264,
1590,
25,
30,
31,
259,
32,
520,
71,
19,
21,
78,
6523,
19,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
django CLI script and database router: cannot import name connections
===
I made a database ruter for `myapp` application
in file `/myproject/myapp/routers.py`
class ShardingRouter(object):
def db_for_read(self, model, **hints):
return 'default'
def db_for_write(self, model, **hints):
return 'default'
def allow_relation(self, obj1, obj2, **hints):
return None
def allow_syncdb(self, db, model):
return None
In `settings.py` I have:
from django.db import connections
DATABASE_ROUTERS = ['myproject.myapp.routers.ShardingRouter',]
This works well for normal application running through wsgi, but I have one CLI script `/myproject/parser_jobs.py` it is starting with cron or manually from CLI:
import os, sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
...
...
if __name__ == "__main__":
do_some_long_boring_work()
now, when i run this script, I'm getting import error:
Traceback (most recent call last):
File "/hosting/myproject/myproject/parser_jobs.py", line 20, in <module>
import settings
File "/hosting/myproject/myproject/settings.py", line 46, in <module>
from django.db import connections
File "/usr/local/lib/python2.7/dist-packages/django/db/__init__.py", line 11, in <module>
if DEFAULT_DB_ALIAS not in settings.DATABASES:
File "/usr/local/lib/python2.7/dist-packages/django/utils/functional.py", line 184, in inner
self._setup()
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 42, in _setup
self._wrapped = Settings(settings_module)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 95, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'myproject.myproject' (Is it on sys.path?): cannot import name connections
So, website works good, but cli script fails. Please, help! | 0 | [
2,
3857,
14541,
19391,
3884,
17,
6018,
858,
139,
45,
1967,
9010,
204,
6760,
800,
3726,
3726,
31,
117,
21,
6018,
16702,
106,
26,
13,
1,
915,
7753,
1,
3010,
19,
3893,
13,
1,
118,
915,
21011,
118,
915,
7753,
118,
20179,
1224,
9,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LibVLC: marquee and full screen issues
===
I am currently trying to use LibVLC to play videos and have some questions:
1. On a computer with multiple screens, how do I tell LibVLC to show full screen on a specific screen?
2. I try to use `libvlc_video_set_marquee_int`. After some trail and error I found out, that it works when I pause the main thread after starting the video for about 70ms before setting a marquee text. Why? How can I do this better?
3. I want to show a marquee text, but no video title (LibVLC displays the video title or file name in the beginning). I read that you could disable the video title by passing the `--no-video-title-show` option to `libvlc_new()`. However this has two problems: First the documentation says one should not pass options. Well, ok... But secondly using this option has a strange effect on marquee texts: You can set a text, but it just blinks once and disappears immediately, no matter what `libvlc_marquee_Timeout` is set to. | 0 | [
2,
13,
8326,
15143,
150,
45,
1423,
2005,
62,
17,
503,
2324,
1549,
800,
3726,
3726,
31,
589,
871,
749,
20,
275,
13,
8326,
15143,
150,
20,
418,
6610,
17,
57,
109,
2346,
45,
137,
9,
27,
21,
1428,
29,
1886,
14236,
15,
184,
107,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquerymobile dual slider, highlight range
===
It would be great if this dual slider http://jsfiddle.net/NkjQr/314/
could have its min/max range highlighted only (range between the 2 slider handles)
thx | 0 | [
2,
487,
8190,
93,
12571,
5747,
3295,
106,
15,
14373,
978,
800,
3726,
3726,
32,
83,
44,
374,
100,
48,
5747,
3295,
106,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
118,
5719,
728,
1251,
139,
118,
22660,
118,
110,
57,
82,
4232,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... |
Get asm-listing of a header file
===
I have an exception dump after my dll-file has crashed.
The place in code i'd like to see is written in the dump like
> MyDllFile.dll : SetLocale<wchar_t> + 111
The problem with this exception is that it rises only at a client's machine, i can't reproduce it at my PC, so i'd like to get as much information from the dump as it's possible.
In the case of cpp-file i just recompile the file generating assembler listing, but ``SetLocale`` is a template function defined and described in ``StdAfx.h``.
Also ``SetLocale`` function called from another template function which is defined in h-file too.
How could i get assembler listing of the function ? I thought to debug ``SetLocale`` in the `Disassembly` window, and suggested to just add 0x111 to the SetLocale address. Am i right?
I use VS 2008.
Thank you. | 0 | [
2,
164,
28,
79,
8,
5739,
68,
16,
21,
157,
106,
3893,
800,
3726,
3726,
31,
57,
40,
5391,
11424,
75,
51,
13,
43,
211,
8,
16877,
63,
7579,
9,
14,
209,
19,
1797,
31,
22,
43,
101,
20,
196,
25,
642,
19,
14,
11424,
101,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to simulate a shaky cam with opencv?
===
I'm trying to simulate a shaky cam in a static video. I could choose a couple of points randomly and then pan/zoom/warp using easing, but I was wondering if there's a better, more standard way. | 0 | [
2,
184,
20,
24969,
21,
16934,
5373,
29,
368,
12732,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
24969,
21,
16934,
5373,
19,
21,
12038,
763,
9,
31,
110,
3538,
21,
1335,
16,
819,
21324,
17,
94,
1809,
118,
2500,
2636,
118,
1885,
306,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Nant does not launch nunit2 task
===
I have a very simple class with Watin test which is built and run nicely from Visual Studio.
Now I want to build it and launch with Nant. I've written the following nant .build file:
<?xml version="1.0"?>
<project name="WatinTests" default="build">
<property name="build.dir" value="c:WatinTests\bin\" />
<property name="project.rootdirectory" value="." />
<property name="solution.dir" value="."/>
<property name="solution.file" value="${solution.dir}/WatinTests.csproj"/>
<property name="build.configuration" value="debug" />
<property name="nant.settings.currentframework" value="net-4.0" />
<mkdir dir="${build.dir}" />
<target name="build">
<exec program="${framework::get-framework-directory(framework::get-target-
framework())}\msbuild.exe" commandline="${solution.file} /t:Clean /p:Configuration=
${build.configuration} /v:q" workingdir="." output="${build.dir}/WatinTests.dll"/>
</target>
<target name="test" depends="build">
<nunit2>
<formatter type="Plain" />
<test assemblyname="${build.dir}WatinTests.dll" />
</nunit2>
</target>
</project>
First task is performed successfully - WatinTests.dll file goes to \bin directory.
But test is not launched. Here is the output:
> Buildfile: file:///c:/WatinTests/nant.build Target framework:
> Microsoft .NET Framework 4.0 Target(s) specified: build test
>
> build:
>
> test:
>
> BUILD FAILED
>
> c:\WatinTests\nant.build(14,6): Failure executing test(s). If you
> assembly is not built using NUnit version 2.6.0.12051, then ensure you
> have redirected ass embly bindings. Consult the documentation of the
> <nunit2> task for more information.
> Could not load file or assembly 'WatinTests.dll' or one of its dependencies. An attempt was made to load a program with an incorrect
> format.
> Could not load file or assembly 'WatinTests.dll' or one of its dependencies. An attempt was made to load a program with an incorrect
> format.
What is wrong here? | 0 | [
2,
13,
11028,
630,
52,
3394,
10210,
242,
135,
3005,
800,
3726,
3726,
31,
57,
21,
253,
1935,
718,
29,
15553,
108,
1289,
56,
25,
392,
17,
485,
24050,
37,
3458,
1120,
9,
130,
31,
259,
20,
1895,
32,
17,
3394,
29,
13,
11028,
9,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android ListFragmentIssue
===
I got a FragmentActivity with 2 ListFragments, Every time I swype beteen them, a layout progress begins and causes getView on the adapter for all visible items. How can I avoid this behavior?
I got 7 visible items in my list, and getView occuers too many times... (400 times when app starts)
Any suggestions? | 0 | [
2,
13005,
968,
22133,
1130,
12565,
800,
3726,
3726,
31,
330,
21,
14847,
19348,
29,
172,
968,
22133,
6601,
15,
352,
85,
31,
13,
18,
7913,
1664,
44,
11256,
105,
15,
21,
9106,
3455,
2661,
17,
4047,
164,
4725,
27,
14,
9924,
106,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a multiple upload reference widget for dexterity (quickupload widget for dexterity content type)
===
I'm working on a dexterity content type that should be able to support multiple upload of images. What I want is to be able to use something like one of the collective.plonefinder referencewidgets (http://svn.plone.org/svn/collective/collective.plonefinder/trunk/collective/plonefinder/widgets/referencewidget.py)
I've looked at the examples documented for collective.plonefinder but their widgets only seem to be archetypes compatible.
I also looked at collective quickupload (which provides the upload ability to collective.plonefinder), while I can create a behaviour which marks a dexterity content type as IQuickUploadCapable, I can't add a quickupload widget to a dexterity content type.
| 0 | [
2,
25,
80,
21,
1886,
71,
8294,
2801,
4807,
43,
3060,
26,
14749,
856,
13,
5,
25865,
576,
8294,
4807,
43,
3060,
26,
14749,
856,
2331,
1001,
6,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
14749,
856,
2331,
1001,
30,
378,
44,
777,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i give 100 ms for next function?
===
I have this function in my js file. I need to give time for doTimerA. I want to start doTimerA after 100ms. Right now in this function both is chosen same time.
function ReLoadBuy(){
if (myclick == "2")
{
ReLoadBuygo();
}
else
{
StartBuy();
doTimerA();
}
}
Anything i must add?
Thanks
| 0 | [
2,
184,
92,
31,
590,
808,
4235,
26,
328,
1990,
60,
800,
3726,
3726,
31,
57,
48,
1990,
19,
51,
487,
18,
3893,
9,
31,
376,
20,
590,
85,
26,
107,
891,
525,
9,
31,
259,
20,
799,
107,
891,
525,
75,
808,
79,
18,
9,
193,
130,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Compiling shared schema used by 2 WSDL using XMLBeans
===
I have this following directory structure
Root
CommonSchema
1.xsd
2.xsd
Service1
XSD
3.xsd ( importing 1 and 2 xsd)
WSDL
A.wsdl ( importing 3.xsd)
Service2
XSD
4.xsd ( importing 1 and 2 xsd)
WSDL
B.wsdl (importing 4.xsd )
I'm trying to generate the source and compiling them into a single jar using XMLBeans+CXF.
CommonSchema folder has schemas that shared by Service1 and 2.
When I try to generate the source source, it seems that the source of 1 and 2 xsd is too tight with the Service1.
Any idea on how should I compile this common schema?
| 0 | [
2,
24378,
2592,
23874,
147,
34,
172,
619,
18,
8643,
568,
23504,
863,
5950,
800,
3726,
3726,
31,
57,
48,
249,
16755,
1411,
5900,
757,
7526,
540,
137,
9,
396,
18,
43,
172,
9,
396,
18,
43,
365,
165,
993,
18,
43,
203,
9,
396,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jstree - override cookies dependent on current url
===
I'm using jstree with a html UL with each node a href for navigation, which is included via php on each html page.
Jastree code is:
$(function(){
$("#treeview").jstree({
"themes" : {
"theme" : "default",
"dots" : false,
"icons" : false
},
"ui" : {
"selected_parent_close" : "false",
"select_multiple_modifier" : "false",
},
"core": {
"animation": 500
},
"plugins" : [ "themes", "html_data", "ui", "cookies" ]
});
$("#treeview").bind("reselect.jstree", function () {
$("#treeview").bind("select_node.jstree", function (e, data) {
document.location = data.rslt.obj.children("a").attr("href");
});
});
});
Cookies work fine but the issue is in how to override the cookie selected node, when (and only when) the navigated url is one of the root nodes? If it is a root node, I want that to be open instead. This happens when navigating to the tree page from an external source or another page in the site with no tree, hence the cookie setting is not correct.
Am using jquery 1.7.2, jstree 1.0. All li id's are the same as the page name i.e. for href "page1" the relevant li id is "page1".
| 0 | [
2,
487,
18,
8101,
13,
8,
84,
11891,
19396,
9063,
27,
866,
287,
6362,
800,
3726,
3726,
31,
22,
79,
568,
487,
18,
8101,
29,
21,
13,
15895,
13,
1287,
29,
206,
15421,
21,
746,
14057,
26,
8368,
15,
56,
25,
506,
1197,
13,
26120,
27,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Finding a particular attribute's value from a model in Rails
===
I'm trying to find the value of a particular model's attribute in rails. Here's what my code in the User controller's 'create' method looks like:
@user = User.find(1, :select => :money)
existing_money = @user
puts "#{existing_money}"
In my Heroku logs I'll see a variant of the following output instead of the :money integer for that particular user (with :id 1)
#<User:0x00000004e7cbc0>
Any thoughts? Thanks!
| 0 | [
2,
3007,
21,
1498,
35,
14755,
22,
18,
1923,
37,
21,
1061,
19,
2240,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
477,
14,
1923,
16,
21,
1498,
1061,
22,
18,
35,
14755,
19,
2240,
18,
9,
235,
22,
18,
98,
51,
1797,
19,
14,
4155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery click event on predefined position inside a div
===
I want to play a youtube video using jquery click event with predefined position inside a div. My coding is
<div style="width: 560px; height: 316px;" id="special">
<iframe width="560" height="315" src="http://www.youtube.com/embed/iXWUm25ns-0" frameborder="0" allowfullscreen></iframe>
</div>
jQuery(document).ready(function(){
$("#special").ready(function(){
var event = $.Event('click');
event.pageX = 280;
event.pageY = 158;
$('#special').click(function() {(+ event.pageX + + event.pageY);
});
});
})
| 1 | [
2,
487,
8190,
93,
10840,
807,
27,
782,
13439,
649,
572,
21,
13,
12916,
800,
3726,
3726,
31,
259,
20,
418,
21,
7330,
763,
568,
487,
8190,
93,
10840,
807,
29,
782,
13439,
649,
572,
21,
13,
12916,
9,
51,
13,
15458,
25,
13,
1,
129... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Whats the best way to view video from an Internet webcam with Java?
===
I'm developing an application (not applet) that will display a live webcam feed. This feed absolutely **must** display in at least **640x480**, and have **less than 5 seconds** of latency. The feed would preferably be sent from a non-Java program, such as VLC (so that the video can be compressed according to connection speeds), across the Internet to my Java program. Is there any way to do this? I've found many methods of displaying webcam feeds, but none that provide good resolution and live video. I can use SkypeKit if necessary, but from what I've heard it can only provide audio calls if using it with Java.
If at all possible, I would also appreciate a link to a simple example.
Thanks for any help,
Cameron Lattz | 0 | [
2,
98,
18,
14,
246,
161,
20,
1418,
763,
37,
40,
2620,
2741,
8760,
29,
8247,
60,
800,
3726,
3726,
31,
22,
79,
3561,
40,
3010,
13,
5,
1270,
4037,
38,
6,
30,
129,
3042,
21,
515,
2741,
8760,
4063,
9,
48,
4063,
6916,
13,
1409,
36... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use of resolv.h
===
I'm trying to find out my DNS server address by reading it from resolv.h's _res struct. According to man 3 resolver the setup code should be.
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
extern struct state _res;
and then I just read out whatever I need. My problem is that trying to compile this I get
resolver.c:5:21: error: conflicting types for '__res_state'
extern struct state _res;
^
/usr/include/resolv.h:251:16: note: expanded from macro '_res'
#define _res (*__res_state())
^
/usr/include/resolv.h:249:28: note: previous declaration is here
extern struct __res_state *__res_state(void) __attribute__ ((__const__));
^
1 error generated.
by clang.
What am I doing wrong? | 0 | [
2,
275,
16,
302,
5594,
710,
9,
252,
800,
3726,
3726,
31,
22,
79,
749,
20,
477,
70,
51,
13,
43,
2172,
8128,
3218,
34,
1876,
32,
37,
302,
5594,
710,
9,
252,
22,
18,
13,
1,
99,
18,
13,
10346,
9,
496,
20,
169,
203,
9854,
139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
tinyMCE jQuery form validation
===
I'm trying to use tinymce's `getContent()` to make a custom validation rule, how can I do this with jquery validation? I need to apply the rule to a textarea formatted with tinymce.
Validation: http://bassistance.de/jquery-plugins/jquery-plugin-validation/
$("#element").click( function(e) {
console.log(tinyMCE.activeEditor.getContent());
$("#someForm").validate({
rules: {
title: {
required: true
}
}
});
}); | 0 | [
2,
3228,
79,
1105,
487,
8190,
93,
505,
27999,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
3228,
79,
1105,
22,
18,
13,
1,
3060,
25424,
5,
6,
1,
20,
233,
21,
5816,
27999,
1828,
15,
184,
92,
31,
107,
48,
29,
487,
8190,
93,
27999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regex to eliminate many lines of text with an known start and stop string
===
I am attempting to eliminate all of the text between two specific strings of text with a single regex command. The original text looks like this:
<html>
<!-- template name: text.tpl -->
<head>
<title>Cross-Collection Search</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script src="/t/text/textclass.js" language="JavaScript"></script>
<link rel="STYLESHEET" type="text/css" href="/t/text/textclass.css">
<link rel="stylesheet" href="/t/text/textclass-specific.css" type="text/css">
<script src="/t/text/bbagWindow.js" type="text/javascript" language="javascript"></script>
<script type="text/javascript" language="javascript">
<!--
window.name = "mainwindow";
//-->
</script>
</head>
<!-- -------------------------------------------------- -->
<body bgcolor="#FFFFFF" marginwidth="0" marginheight="0">
<!-- -------------------------------------------------- -->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="54" class="hdrcolor" background="/t/text/graphics/hdr-bg1.gif">
<a name="top"></a>
<a href="http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr;c=sampletc;cc=ecfr;xc=1;sid=75189253ab69c67a4a0484a5acb0c128;tpl=%2Fusr%2Flocal%2Fdlxs%2Fweb%2Ft%2Ftext%2Fhome.tpl" target="_top"><img src="/t/text/graphics/umdlt-smbanner.gif" border="0"></a></td>
<td height="54" class="hdrcolor" align="right" valign="top" background="/t/text/graphics/hdr-bg2.gif">
<table border="0" cellspacing="1" cellpadding="3">
<tr>
<td align="right" nowrap valign="top" bgcolor="#CCCCCC"> <font size="-1"><a class="globnav" href="">Authorized user login</a></font> </td>
<td align="right" bgcolor="#FFCC66" nowrap> <font size="-1"><a class="globnav" href="javascript:popupBBagWindow( 'http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr;c=sampletc;cc=ecfr;xc=1;sid=75189253ab69c67a4a0484a5acb0c128;page=bbaglist' , true )">View
bookbag</a></font> </td>
</tr>
</table>
<font class="navinfo" size="2"><br>your bookbag has <strong>0</strong> items</font>
</td>
</tr>
<!-- BEGIN rows outlining the navigation proper -->
<!-- this row contains a table controlling layout for the top border lines of the navbar -->
<tr>
<td class="navcolor" colspan="2" align="left" height="1" nowrap>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- home -->
<td width="70" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="1"><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<!-- search -->
<td width="90" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="1"><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<!-- browse -->
<td width="75" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<!-- blankspace -->
<td width="75" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<!-- help -->
<td width="75" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
</tr></table>
</td>
</tr>
<!-- this row contains a table controlling layout for the nav tabs themselves -->
<tr>
<td class="navcolor" colspan="2" align="left" bgcolor="#666699" height="23" nowrap>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<!-- home -->
<td width="70" height="23" align="center" nowrap><font class="navlinks" color="#ffffff"><a href="http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr;c=sampletc;cc=ecfr;xc=1;sid=75189253ab69c67a4a0484a5acb0c128;tpl=%2Fusr%2Flocal%2Fdlxs%2Fweb%2Ft%2Ftext%2Fhome.tpl" class="nav">Home</a></font></td>
<!-- search -->
<td width="90" height="23" align="center" nowrap><font class="navlinks" color="#000000"><a href="http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr;c=sampletc;cc=ecfr;xc=1;sid=75189253ab69c67a4a0484a5acb0c128;page=simpleext" class="nav">Search</a></font></td >
<!-- browse -->
<td width="90" height="23" align="center" nowrap><font class="navlinks" color="#ffffff"><a href="http://ecfr.gpoaccess.gov/cgi/t/text/text-idx?c=ecfr;cc=ecfr;xc=1;sid=75189253ab69c67a4a0484a5acb0c128;tpl=browse.tpl" class="nav">Browse</a></font></td >
<!-- blankspace -->
<td width="50" height="23" align="center" nowrap> </td >
<!-- help -->
<td width="70" height="23" align="center" nowrap><font class="navlinks" color="#ffffff"><a href="/t/text/help" target="helpwin" class="nav">Help</a></font></td >
</tr>
</table>
</td >
</tr>
<!-- this row contains the table that controls layout for the lower nav border lines -->
<tr>
<td class="navhrcolor" colspan="2" align="left" height="1" nowrap bgcolor="#999999">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="70" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="1"><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="90" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="1"><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="75" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
<td width="75" height="1" align="center" nowrap><img src="/t/text/graphics/plug.gif" width="1" height="1" border="0"></td>
</tr></table>
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="5" width="100%">
<tr>
<td valign="top" nowrap>
<hr size="1">
</td>
</tr>
</table>
<table cellspacing="0" cellpadding="15">
<tr>
<td>
<br>
<strong><span class=mainheader>
THE COMPLETED TEXT AFTER A REGEX SEARCH AND REPLACE NEEDS TO LOOK LIKE THIS:
<html>
<strong><span class="mainheader">
FOR SOME REASON, JUST USING THE FOLLOWING DOES NOT WORK. WHY????
<html>(.*)<strong><span class=mainheader> | 0 | [
2,
7953,
1706,
20,
10628,
151,
1560,
16,
1854,
29,
40,
167,
799,
17,
747,
3724,
800,
3726,
3726,
31,
589,
6314,
20,
10628,
65,
16,
14,
1854,
128,
81,
1903,
7887,
16,
1854,
29,
21,
345,
7953,
1706,
1202,
9,
14,
501,
1854,
1879,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using an accessor method in Java's switch statement
===
I have several `switch` statements in a Java program. My question is, if I construct the `switch` statement similar to this:
switch (getNum()) {
case 0: // do something
case 1: // do something
...
}
where the variable to be switched is getting returned from an accessor method (aka 'getter' method), will the switch statement call `getNum()` every time it checks a case? Or will it assign a temporary variable to the `int` being returned from `getNum()` to check each case? | 0 | [
2,
568,
40,
1381,
248,
2109,
19,
8247,
22,
18,
5521,
3331,
800,
3726,
3726,
31,
57,
238,
13,
1,
18,
15915,
1,
9015,
19,
21,
8247,
625,
9,
51,
1301,
25,
15,
100,
31,
6960,
14,
13,
1,
18,
15915,
1,
3331,
835,
20,
48,
45,
552... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL finding rows in one table with information from another
===
Currently, I have two MySQL tables.
First table stores relation between the friend and his picture.
TABLE 1
id | pic_id | friend_id
----------------------------
0 | 123 | 84589
1 | 290 | 11390
2 | 884 | 84589
TABLE 2
Second table stores more information about the pic...
id | pic_id | title | color | detail
----------------------------------------------
0 | 123 | hello | black | brush
1 | 124 | world | red | paint
2 | 884 | sample | green | star
I have my friend_id and need to grab all the pic_id from Table 1 and then use the pic_id to grab the columns from Table 2(title, color, detail)...
How would I do this in MySQL?
Thank you! | 0 | [
2,
51,
18,
22402,
3007,
11295,
19,
53,
859,
29,
676,
37,
226,
800,
3726,
3726,
871,
15,
31,
57,
81,
51,
18,
22402,
7484,
9,
64,
859,
4134,
5827,
128,
14,
860,
17,
33,
2151,
9,
859,
137,
4924,
13,
1,
9327,
1,
1340,
13,
1,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MPI several broadcast at the same time
===
I have a 2D processor grid (3\*3):
P00, P01, P02 are in R0, P10, P11, P12, are in R1, P20, P21, P22 are in R2.
P\*0 are in the same computer. So the same to P\*1 and P\*2.
Now I would like to let R0, R1, R2 call MPI\_Bcast at the same time to broadcast from P\*0 to p\*1 and P\*2.
I find that when I use MPI\_Bcast, it takes three times the time I need to broadcast in only one row.
For example, if I only call MPI\_Bcast in R0, it takes 1.00 s.
But if I call three MPI\_Bcast in all R[0, 1, 2], it takes 3.00 s in total.
It means the MPI\_Bcast cannot work parallel.
Is there any methods to make the MPI_Bcast broadcast at the same time?
(ONE node broadcast with three channels at the same time.)
Thanks. | 0 | [
2,
4628,
49,
238,
1992,
35,
14,
205,
85,
800,
3726,
3726,
31,
57,
21,
172,
43,
14762,
7354,
13,
5,
240,
1,
2483,
240,
6,
45,
351,
2032,
15,
351,
3026,
15,
351,
3564,
50,
19,
761,
387,
15,
351,
1036,
15,
351,
1306,
15,
351,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
low level APIs vs high level APIs
===
I am wondering to know what is the main difference between low level APIs (ex/ SAX) and High level APIs (ex/ JAXB) for XML data binding.
Thanks | 1 | [
2,
708,
662,
21,
8954,
4611,
183,
662,
21,
8954,
800,
3726,
3726,
31,
589,
5712,
20,
143,
98,
25,
14,
407,
2841,
128,
708,
662,
21,
8954,
13,
5,
1706,
118,
16070,
6,
17,
183,
662,
21,
8954,
13,
5,
1706,
118,
11712,
220,
6,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
jScrollpane is working but not creating the container
===
I have jScrollpane working on my mac at home, however I have just uploaded it to my CentOS web server and I am having issues. The scroll bar appears as it should, however I have set "showArrows: true" but I am not getting any arrows. Also, when I inspect the element in either firefox or chrome, both on windows and mac the class="jspContainer" and all of the other elements, jspPane, jspVerticalBar etc do not appear in the html. Giving this is the case it would make more sense if there were no scrollbar at all.
I am using this in drupal, so I am not sure if this is because there are other javascripts running. The major issue is, that without the containers etc being created by the javascript, I can't theme the scroll bar as the divs aren't created for the css to act upon.
I had the same issue initially on my mac, I commented out some other js I had running in jQuery(document).ready then it started to work. I put back all of the other stuff I have running in jQuery(document).ready after starting jScrollpane and it kept on working. I have restarted apache, cleared caches etc on the mac to make sure it isn't just working from cache and I've done the same on the server.
Any ideas? | 0 | [
2,
487,
3862,
8694,
16660,
25,
638,
47,
52,
2936,
14,
12147,
800,
3726,
3726,
31,
57,
487,
3862,
8694,
16660,
638,
27,
51,
1572,
35,
213,
15,
207,
31,
57,
114,
23782,
32,
20,
51,
5802,
759,
2741,
8128,
17,
31,
589,
452,
1549,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to switch off garbage collection in Xcode 4.5, and get rid of clang error 1 when switching on ARC?
===
I just reopened a project that was set to use Garbage Collection, and that I had last opened in Xcode 3. Now opening it again in Xcode 4.5, and looking to modernize it, I am trying to switch on ARC. However, when building, it resulted in clang error 1. Looking into more details in the Xcode logs, I saw the message:
clang: error: cannot specify both '-fobjc-arc' and '-fobjc-gc-only'
Ah, I need to switch off Garbage Collection, which I was using before. However, when searching the build setting for the word 'garbage' or 'collection', I can't find the setting in Xcode (using the search field in the Build Settings in the target info). | 0 | [
2,
184,
20,
5521,
168,
15024,
1206,
19,
993,
9375,
268,
9,
264,
15,
17,
164,
6681,
16,
4258,
263,
7019,
137,
76,
13027,
27,
4686,
60,
800,
3726,
3726,
31,
114,
12713,
21,
669,
30,
23,
309,
20,
275,
15024,
1206,
15,
17,
30,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MongoDB,Mongoose,Nodejs,Object id
===
I am trying to query based on time stamp in object id,Saw the posting below
http://stackoverflow.com/questions/8749971/can-i-query-mongodb-objectid-by-date
However this does not work for mongoose driver.Does anybody knows a way .It complains no reference to objectid | 0 | [
2,
3521,
5474,
220,
15,
2111,
839,
6641,
15,
251,
546,
728,
18,
15,
23793,
4924,
800,
3726,
3726,
31,
589,
749,
20,
25597,
432,
27,
85,
10151,
19,
3095,
4924,
15,
10561,
14,
15669,
1021,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
as3 app: what would cause the memory usage to cycle up and down when no code is being executed?
===
![the graph][1]
[1]: http://i.stack.imgur.com/2Y56S.jpg
Hi there,
As you can see by the graph from profiler over the space of 1 minute the memory rises about 2mb and then drops back down only to rise again to the same spot. This is on an almost blank screen and no code is running. No new objects are being created. I've also noticed on iOS the CPU usage is also rising and falling in a similar pattern-from 20% up to 70%.
Thanks for reading. | 0 | [
2,
28,
240,
4865,
45,
98,
83,
1679,
14,
1912,
7514,
20,
4150,
71,
17,
125,
76,
90,
1797,
25,
142,
5557,
60,
800,
3726,
3726,
13,
187,
2558,
124,
7210,
500,
2558,
165,
500,
636,
165,
500,
45,
7775,
6903,
49,
9,
25325,
9,
1660,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF Windows authentication with AspNetRoles
===
Is it possible to configure WCF to use Windows credentials to authenticate users and the SQL AspNet Roles provider to store roles and authorizations? | 0 | [
2,
11801,
410,
1936,
27963,
29,
28,
306,
2328,
661,
1355,
800,
3726,
3726,
25,
32,
938,
20,
1065,
15951,
11801,
410,
20,
275,
1936,
5059,
43,
10107,
18,
20,
14351,
1373,
3878,
17,
14,
4444,
255,
28,
306,
2328,
2954,
11747,
20,
171... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
now.js - Object has no method, but in jquery click event work
===
I have a simple nowjs code for client:
$j(document).ready(function() {
window.now = nowInitialize('http://xxx.yyy:6564');
now.recvMsg = function(message){
$j("body").append("<br>" + message);
}
$j("#send-button").click(function(){
now.sendMsg("well done"); //## this work
});
now.sendMsg("aaaah"); //## this dont work
});
and code for server-side:
var server = require('http').createServer(function(req, res){});
server.listen(6564);
var nowjs = require("now");
var everyone = nowjs.initialize(server);
everyone.now.sendMsg = function(message){
everyone.now.recvMsg(message);
};
And calling sendMsg (server side function) work when it is in click event function, but outside in ready event dont work. Why?
I have even tried things like:
setTimeout('now.sendMsg("aaaah")',1000);
still dont work. | 0 | [
2,
130,
9,
728,
18,
13,
8,
3095,
63,
90,
2109,
15,
47,
19,
487,
8190,
93,
10840,
807,
170,
800,
3726,
3726,
31,
57,
21,
1935,
130,
728,
18,
1797,
26,
6819,
45,
5579,
728,
5,
28132,
6,
9,
15193,
5,
22359,
5,
6,
13,
1,
1463,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to change background image on a button , iOS?
===
I created a button on my view controller which has a predefined background image. I created an action and an outlet for this button. I want when the user taps the button to change the background image of this button. How can i do that?
I tried to put into the action method of the button something like this:
snapshotCheckbox.image = [UIImage imageNamed:@"snapshot.png"];
but i guess this method is for UImageViews. How can i do the same thing for a button?
Thank you very much for reading my post :D | 0 | [
2,
184,
20,
753,
2395,
1961,
27,
21,
5167,
13,
15,
13,
7760,
60,
800,
3726,
3726,
31,
679,
21,
5167,
27,
51,
1418,
9919,
56,
63,
21,
782,
13439,
2395,
1961,
9,
31,
679,
40,
1028,
17,
40,
15399,
26,
48,
5167,
9,
31,
259,
76,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In WPF how do I access a WrapPanel from CodeBehind
===
I have a WrapPanel defined as follows in XAML...
<Page x:Class="SelectImages"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="320" d:DesignWidth="480"
Title="Select Images">
<Grid>
<WrapPanel Name="MyImagePanel" Width="Auto" Height="Auto" Margin="10,50,10,10" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto" Orientation="Horizontal">
</WrapPanel>
</Grid>
</Page>
When I try to use the WrapPanel as below in my Code Behind I get a runtime error "Object reference not set to instance of object".
Private Sub AddImageToPanel(Image As FileSystemInfo)
MyImagePanel.Children.Add(NewPicture(Image))
End Sub
Can anyone tell me what I've done wrong? | 0 | [
2,
19,
619,
7721,
184,
107,
31,
1381,
21,
8118,
3206,
532,
37,
1797,
24878,
800,
3726,
3726,
31,
57,
21,
8118,
3206,
532,
2811,
28,
2415,
19,
13,
6791,
8184,
9,
9,
9,
13,
1,
6486,
993,
45,
1898,
3726,
7,
18,
16964,
22039,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LINQ TO SQL TRANSACTIONSCOPE ERROR
===
I am getting an error on TransactionScope() and datacontext as below.
The type or namespace name 'TransactioScope' could not be found (are you missing a using directive or an assembly reference?)
The type or namespace name 'HRPaidTimeOffDataContext' could not be found (are you missing a using directive or an assembly reference?)
What must I do to fix this issue in the code below.
using ( TransactioScope ts = new TransactionScope())
{
// Create the data context
using (HRPaidTimeOffDataContext db = new HRPaidTimeOffDataContext())
{
//Now save the record
if (this.Save(db, ref validationErrors, userAccountId))
{
// Commit transaction if update was successful
ts.Complete();
return true;
}
else
{
return false;
}
}
} | 0 | [
2,
6294,
1251,
20,
4444,
255,
12799,
11555,
7019,
800,
3726,
3726,
31,
589,
1017,
40,
7019,
27,
12799,
11555,
5,
6,
17,
1054,
1126,
11969,
28,
1021,
9,
14,
1001,
54,
204,
5582,
204,
13,
22,
7028,
5183,
1963,
11555,
22,
110,
52,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jasmine (mocha) nested "it" tests
===
I was trying to test consequent create/delete of items (in mongoDB via mongoose).
The problem that creating is async and it returns ID of created item in callback function, I need this ID to deleted created item, so I tried the following code for mocha (in different ways) but it didn't work.
describe('Item Model', function(){
it('should be able to create item', function(done){
var item = new Item({name: {first: "Alex"});
item.save(function(err, data){
it('should be able to deleted created item', function(done){
Item.delete({_id: data.id}, function(err, data){
done(err);
});
});
})
});
});
Can such test be implemented in mocha or jasmine?
| 0 | [
2,
15885,
13,
5,
1293,
1651,
6,
5618,
69,
13,
7,
242,
7,
4894,
800,
3726,
3726,
31,
23,
749,
20,
1289,
26498,
1600,
118,
24249,
591,
16,
3755,
13,
5,
108,
3521,
5474,
220,
1197,
3521,
839,
6641,
6,
9,
14,
1448,
30,
2936,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Files enter without name in an input file
===
Im working on a MVC system, and I have an input file in a view. Yesterday it was working good, but today, when I upload any file, I recieve in $_FILES, the file without name, an empty string. Can anyone help me?
thanks | 1 | [
2,
6488,
2830,
366,
204,
19,
40,
6367,
3893,
800,
3726,
3726,
797,
638,
27,
21,
307,
8990,
329,
15,
17,
31,
57,
40,
6367,
3893,
19,
21,
1418,
9,
7124,
32,
23,
638,
254,
15,
47,
786,
15,
76,
31,
71,
8294,
186,
3893,
15,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Segmentation fault because of ifstream obj. sent as reference?
===
First of all, I'm extremely sorry but I can't provide the source code (it's in my native language, anyway).
So, what I'm doing is declaring an ifstream object in a (global) function, then send it to a member-function of a class (that gets it as a reference), then that function passes it to another member function of a class that's used within the before mentioned one (also gets it as a reference).
I have pinpointed the segmentation fault at the use for reading within the member function that's within the class that's within the other class (oh my god...), i have tried eof() just to check if it gets messed by some way, it returns 0 (as expected) without crashing, it only crashes when I try to get some data as input through the ifstream object.
Sorry for the recursive description / not providing the source code, if you want to help and have any questions, please ask and I will reply promptly. | 0 | [
2,
5631,
857,
4173,
185,
16,
100,
11260,
5122,
728,
9,
795,
28,
2801,
60,
800,
3726,
3726,
64,
16,
65,
15,
31,
22,
79,
3898,
1875,
47,
31,
92,
22,
38,
1181,
14,
1267,
1797,
13,
5,
242,
22,
18,
19,
51,
1275,
816,
15,
2774,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a different way to float one item to the top of a sorted list of names?
===
This is what I came up with to float 'default' to the top and sort the rest:
SELECT 'default' AS name, 'AAA' AS tag
UNION
SELECT name, name AS tag
FROM (SELECT DISTINCT TOP (100) PERCENT name
FROM AccountManager
WHERE (name <> 'default')
ORDER BY name) AS derivedtbl_1
ORDER BY tag
Is there a less complicated/better way?
| 0 | [
2,
25,
80,
21,
421,
161,
20,
11510,
53,
9101,
20,
14,
371,
16,
21,
22554,
968,
16,
1817,
60,
800,
3726,
3726,
48,
25,
98,
31,
281,
71,
29,
20,
11510,
13,
22,
13862,
9708,
22,
20,
14,
371,
17,
2058,
14,
760,
45,
5407,
13,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JPA : Is it possible to specify the JPA provider at run time?
===
We have a need to choose a JPA provider (Hibernate or EclipseLink) at run time based on a system property.
From what I have understood, the provider name must be given in the persistence.xml and can not be overridden in code. If no provider name is given, the first provider in the classpath is used by default. Another alternative could have been to use 2 different persistence.xml and load one of them based on the value of the system property. However, this doesn't seem to be possible either ([http://stackoverflow.com/questions/7227814/jpa-using-alternative-persistence-xml][1]).
Is there any other way to do this ?
[1]: http://stackoverflow.com/questions/7227814/jpa-using-alternative-persistence-xml | 0 | [
2,
487,
1060,
13,
45,
25,
32,
938,
20,
19077,
14,
487,
1060,
11747,
35,
485,
85,
60,
800,
3726,
3726,
95,
57,
21,
376,
20,
3538,
21,
487,
1060,
11747,
13,
5,
8630,
106,
8820,
54,
11652,
6258,
6,
35,
485,
85,
432,
27,
21,
329... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Basic Rails design for belongs_to same model
===
There are many questions like this but I can't find one that seems to answer the specific question - apologies if this is a repeat.
I have a model, let's call it a Shark, with a very simple definition (here, annotated:)
# == Schema Information
#
# Table name: sharks
#
# id :integer not null, primary key
# created_at :datetime not null
# updated_at :datetime not null
# origination_entry :integer
#
class Shark < ActiveRecord::Base
belongs_to :originator, class_name: "Shark", foreign_key:"id"
attr_accessible :origination_entry
end
Specifically, the "origination_entry" column in the database should be a **foreign key** back to *the same table*, Sharks. The idea is that every entry might have either `null` in that relation, or else it will point to another `Shark` object that was the 'originator' of this `Shark`. (By 'originator', I am referring to a prior instance of this `Shark` - trust me, this makes sense with more background.)
Unfortunately this doesn't seem to work.
irb(main):001:0> shark1 = Shark.new(idnumber:"foo")
=> #<Shark id: nil, idnumber: "foo", created_at: nil, updated_at: nil, origination_entry: nil>
irb(main):002:0> shark1.save()
=> true
irb(main):003:0>
irb(main):004:0* shark2 = Shark.new(idnumber:"foo", origination_entry:shark1.id)=> #<Shark id: nil, idnumber: "foo", created_at: nil, updated_at: nil, origination_entry: 3>
irb(main):005:0> shark2.save()
=> true
irb(main):006:0> shark2
=> #<Shark id: 4, idnumber: "foo", created_at: "2012-06-26 22:35:19", updated_at: "2012-06-26 22:35:19", origination_entry: 3>
irb(main):007:0> shark2.originator
=> nil
(I snipped out some SQL queries, let me know if they would be helpful.)
Why is it returning `nil`? How can I instead get it to return `shark1`'s object?
Thanks!
| 0 | [
2,
2125,
2240,
18,
704,
26,
7034,
1,
262,
205,
1061,
800,
3726,
3726,
80,
50,
151,
2346,
101,
48,
47,
31,
92,
22,
38,
477,
53,
30,
2206,
20,
1623,
14,
1903,
1301,
13,
8,
27101,
100,
48,
25,
21,
6830,
9,
31,
57,
21,
1061,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Algorithm for routing through space filled with polygons
===
I have a (geographic) map built up of polygons depicting land and a boat trying to get from A to B without hitting any of the land. Preferably, it should follow the shortest available path.
I have an algorithm that works most of the time, but it is rather clumsy and inefficient. Any hints or references to algorithms that I could use are greatly appreciated. | 0 | [
2,
9083,
26,
19880,
120,
726,
1943,
29,
21309,
18,
800,
3726,
3726,
31,
57,
21,
13,
5,
834,
11113,
6,
2942,
392,
71,
16,
21309,
18,
11235,
476,
17,
21,
2252,
749,
20,
164,
37,
21,
20,
334,
366,
6687,
186,
16,
14,
476,
9,
636... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a more complex data structure in Matlab?
===
I need some help with creating a data structure in Matlab. Until now I needed the following:
string1 value1
string2 value2
string3 value3
and so on. I used a structure for this:
mystruct = struct('mystrings', {}, 'myvalues', {});
Now additional to string and values I now need to assign several arrays (column vectors, containing only numbers) to my string-value pairs. It can be different, how many arrays are assigned to a string-value pair, e.g.
string1 value1 [1;2] [1;3]
string2 value2 [9;10]
string3 value3 [3;4] [2;9] [0;3]
I don't know how to create such a data structure. It's probably not a problem for me to get rid of a structure at all if it's the wrong data structure now. I need help on creating the new data structure, though. Thanks for any help :-)
| 0 | [
2,
2936,
21,
91,
1502,
1054,
1411,
19,
4277,
9086,
60,
800,
3726,
3726,
31,
376,
109,
448,
29,
2936,
21,
1054,
1411,
19,
4277,
9086,
9,
163,
130,
31,
851,
14,
249,
45,
3724,
165,
1923,
165,
3724,
135,
1923,
135,
3724,
240,
1923,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Debugging ASP.NET Cannot use a leading .. to exit above the top directory
===
I'm getting the dreaded `Cannot use a leading .. to exit above the top directory.`
Unfortunately for me it's being generated...somewhere?....out of my control. Are there tools that will help me find out where it's being generated? Or even the actual text of the hyperlink? Maybe intellitrace somehow?
Yes, there's a million google results for it. I know what I need to fix, I just have no idea where the problem is actually occurring.
I tried overriding the render event, and then calling ResolveClientURL on every single HtmlLink object I could find by walking the control tree from the base, but that never throws an exception or does anything wrong. Could it be dying only during `base.render` because I'm calling ResolveClientURL from a page in `/v5/plugins/dashboard` and the base page is in `/v5/`?
Here's the bit I wrote to debug manually. I would expect this code to throw an exception.
protected override void Render(HtmlTextWriter writer)
{
foreach (Control c in base.Controls)
{
Trace.Write("New base control");
var baseParent = c;// findBaseParent(c);
Trace.Write(baseParent.GetType().ToString());
renderChillunsRecursive(baseParent, 0);
}
base.Render(writer);
}
private int total;
private void renderChillunsRecursive(Control c,int depth)
{
var chilluns = c.Controls;
foreach (Control a in chilluns)
{
renderChillunsRecursive(a,depth +1);
total++;
}
string otherString = String.Empty;
if(c.GetType() == typeof(HtmlLink))
{
HtmlLink theLInk = ((HtmlLink) c);
otherString = theLInk.Href;
otherString += " - " + theLInk.ResolveClientUrl(theLInk.Href);
}
Trace.Write(String.Format("{0} - {1} - {2} - {3} - {4}",depth,total,c.GetType(),c.ToString(),otherString));
}
Stack Trace
[HttpException (0x80004005): Cannot use a leading .. to exit above the top directory.]
System.Web.Util.UrlPath.ReduceVirtualPath(String path) +8886247
System.Web.Util.UrlPath.Reduce(String path) +52
System.Web.Util.UrlPath.Combine(String appPath, String basepath, String relative) +214
System.Web.UI.Control.ResolveClientUrl(String relativeUrl) +180
System.Web.UI.HtmlControls.HtmlLink.RenderAttributes(HtmlTextWriter writer) +74
System.Web.UI.HtmlControls.HtmlLink.Render(HtmlTextWriter writer) +42
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8703574
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.HtmlControls.HtmlHead.RenderChildren(HtmlTextWriter writer) +17
System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8703574
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Control.Render(HtmlTextWriter writer) +10
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8703574
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
System.Web.UI.Page.Render(HtmlTextWriter writer) +29
FileBasePage.Render(HtmlTextWriter writer) +2331
FileDetails.Render(HtmlTextWriter writer) in c:\inetpub\V5 - Development\Plugins\Dashboard\FileDetails.aspx.cs:690
System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +8703574
System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266 | 0 | [
2,
121,
16254,
2762,
28,
306,
9,
2328,
1967,
275,
21,
1005,
13,
9,
9,
20,
4350,
784,
14,
371,
16755,
800,
3726,
3726,
31,
22,
79,
1017,
14,
10743,
69,
13,
1,
1245,
1270,
275,
21,
1005,
13,
9,
9,
20,
4350,
784,
14,
371,
16755... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple tables relationship structure
===
I have a users table, an asset table (contains for example a record with value equal to favorite_movie), and than a user_to_asset table (containing userid,assetid,and value, such as 'american history x').
I was thinking if there would be a point to have a type id also, along with a type table ofcourse, for example a type could be user preferences or user details.... so in the end, the user_to_asset table would then contain a userid,typeid,assetid, and value (ofcourse i would have to change the table name bc weve now included typeid within the user_to_asset table).. maybe it would optimize my code since for instance i can query all preferences for a user by just querying the user_to_assets table by typeid equal to user preference and user_id equal to the user.
What do you think? | 0 | [
2,
1886,
7484,
1429,
1411,
800,
3726,
3726,
31,
57,
21,
3878,
859,
15,
40,
12146,
859,
13,
5,
1126,
5851,
18,
26,
823,
21,
571,
29,
1923,
2747,
20,
3839,
1,
22607,
6,
15,
17,
119,
21,
4155,
1,
262,
1,
9790,
38,
859,
13,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
iOS: WebKit discarded an uncaught exception in the webView... <NSInvalidArgumentException> data parameter is nil
===
My app is coming together now. It's purpose is to search the internet and return JSON data. I realised the importance in catching exceptions such as when there's no internet connection. Now my app will show an alertview explaining that there's no internet connection available - this happens when the NSData returned is nil (because of the lack of internet) so how would I go about catching the exception itself?
| 0 | [
2,
13,
7760,
45,
2741,
13703,
17032,
40,
16061,
12647,
5391,
19,
14,
2741,
4725,
9,
9,
9,
13,
1,
2172,
108,
18506,
2542,
3073,
1130,
10066,
872,
1,
1054,
18906,
25,
1781,
255,
800,
3726,
3726,
51,
4865,
25,
880,
429,
130,
9,
32,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How parse xml file in groovy and put it in a pojo?
===
Someone told me that groovy xml parser is better and easy, my question how to use groovy inside java to parse an xml file and put it in a pojo object ?
thanks. | 0 | [
2,
184,
2017,
870,
23504,
3893,
19,
3452,
2026,
93,
17,
442,
32,
19,
21,
2353,
1636,
60,
800,
3726,
3726,
737,
470,
55,
30,
3452,
2026,
93,
23504,
2017,
4104,
25,
574,
17,
2010,
15,
51,
1301,
184,
20,
275,
3452,
2026,
93,
572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
R programming XML: extract specific node
===
I was wondering how to get to a specific node using R's XML package. Here is an example using R's built in data set, mtcars.
fileName <- system.file("exampleData", "mtcars.xml", package="XML")
doc <- xmlTreeParse(fileName)
doc$doc$children$dataset
Running the above code gives me the ff. results:
....
<record id="Fiat 128">32.4 4 78.7 66 4.08 2.200 19.47 1 1 4 1</record>
<record id="Honda Civic">30.4 4 75.7 52 4.93 1.615 18.52 1 1 4 2</record>
<record id="Toyota Corolla">33.9 4 71.1 65 4.22 1.835 19.90 1 1 4 1</record>
<record id="Toyota Corona">21.5 4 120.1 97 3.70 2.465 20.01 1 0 3 1</record>
<record id="Dodge Challenger">15.5 8 318.0 150 2.76 3.520 16.87 0 0 3 2</record>
<record id="AMC Javelin">15.2 8 304.0 150 3.15 3.435 17.30 0 0 3 2</record>
<record id="Camaro Z28">13.3 8 350.0 245 3.73 3.840 15.41 0 0 3 4</record>
<record id="Pontiac Firebird">19.2 8 400.0 175 3.08 3.845 17.05 0 0 3
....
I'm wondering how do I select specific nodes and get their values using xmlAttrs. For example, how would I select the node: `<record id="Fiat 128">` or the node `<record id="Honda Civic">` | 0 | [
2,
761,
3143,
23504,
45,
10962,
1903,
15421,
800,
3726,
3726,
31,
23,
5712,
184,
20,
164,
20,
21,
1903,
15421,
568,
761,
22,
18,
23504,
6030,
9,
235,
25,
40,
823,
568,
761,
22,
18,
392,
19,
1054,
309,
15,
8651,
1367,
18,
9,
38... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Paint.setAlpha() sums up, if called several times
===
I am writing a LiveWallpaper for Android and I want to have a Bitmap with a certain amount of opacity to show.
In the constructor of my LiveWallpaper Engine I set a Paint that I will use later on my Canvas:
MyEngine() {
...
mForeGroundPaint = new Paint();
mForeGroundPaint.setAlpha(5);
}
I draw the Bitmap in this function, using the `mForeGroundPaint` on the `drawBitmap()`:
void drawFrame() {
final SurfaceHolder holder = getSurfaceHolder();
Canvas c = null;
try {
c = holder.lockCanvas();
if (c != null) {
c.save();
/* allows the wallpaper to scroll through the homescreens */
c.drawBitmap(wpBitmap, screenWidth * -mOffset, 0,
mForeGroundPaint);
c.restore();
}
} finally {
if (c != null)
holder.unlockCanvasAndPost©;
}
}
What happens now is, that everything seems to work fine, what means that the Bitmap is painted with the opacity value of `5`, like I set it.
The **Problem** happens when I use that `drawFrame()` function several times, as it is called during `onOffsetsChanged()`: **The opacity sums up, making it 10, 15, 20, 25, ... with every call of `drawFrame()`.**
**How can I prevent that from happening, and thus keep the amount of opacity on a steady level?** | 0 | [
2,
5107,
9,
3554,
22480,
5,
6,
3907,
18,
71,
15,
100,
227,
238,
436,
800,
3726,
3726,
31,
589,
1174,
21,
515,
6051,
17945,
26,
13005,
17,
31,
259,
20,
57,
21,
1142,
15022,
29,
21,
1200,
2006,
16,
13,
11490,
5788,
20,
298,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.