unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Simple edit to app.yaml file to access html file
===
I want to be able to (statically) access the specific file google.html in my root directory.
I am having trouble editing the app.yaml file to make this work as I keep getting 404 errors.
Here's what I am currently doing
- url: /(google\.html)
static_files: /\1
upload: /(google\.html)
I've also tried
- url: /google.html
static_files: google.html
upload: /google.html
(This is added before all other handlers)
What should it be instead?
| 0 | [
2,
1935,
9392,
20,
4865,
9,
8580,
255,
3893,
20,
1381,
13,
15895,
3893,
800,
3726,
3726,
31,
259,
20,
44,
777,
20,
13,
5,
18077,
1326,
6,
1381,
14,
1903,
3893,
8144,
9,
15895,
19,
51,
5900,
16755,
9,
31,
589,
452,
2572,
9510,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Watir webdriver attaching windows and waiting
===
I am trying to detect when a Facebook pop-up is displayed to then fill out the Facebook login form. I have tried the attach method, also the wait method, and the sleep method but it seems that as soon as I launch the new page all connection is lost:
#this output is displayed
puts "lets the game begingsx"
$b.goto("javascript:gigya.services.socialize.plugins.login.providerClick('loginPluginDiv','facebook')")
#this output is never displayed
puts "lets start sleep"
$b.window(:title,/Log In | Facebook/i).use do
$b.text_field(:id => 'email').when_present.set("xyz@gmail.com")
end
| 0 | [
2,
15553,
1523,
2741,
21752,
19514,
68,
1936,
17,
1672,
800,
3726,
3726,
31,
589,
749,
20,
9092,
76,
21,
9090,
1675,
8,
576,
25,
6115,
20,
94,
3509,
70,
14,
9090,
6738,
108,
505,
9,
31,
57,
794,
14,
19514,
2109,
15,
67,
14,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
where i can download google earth api for asp.net web application
===
I want to create a web application with Google earth. But i can't download the asp.net Google Earth API. Is there is any way to create a Google earth application? Please give some idea to create this application.
Thanks in advance.. | 1 | [
2,
113,
31,
92,
7121,
8144,
1073,
21,
2159,
26,
28,
306,
9,
2328,
2741,
3010,
800,
3726,
3726,
31,
259,
20,
1600,
21,
2741,
3010,
29,
8144,
1073,
9,
47,
31,
92,
22,
38,
7121,
14,
28,
306,
9,
2328,
8144,
1073,
21,
2159,
9,
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... |
Drupal modules calling Oracle DB
===
working on an Drupal architecture where I'd like to have a stand alone Drupal/DrupalCommerce installation with product definition based on content coming from an apart Oracle DB.
Does anybody have experience in integration between Drupal and ORacle.
I'm not speaking about replacing MySQL by ORacle but by using ORacle content in specific modules.
What is the best connections options : XML-RPC, REST, WebServices/SOAP ...
| 0 | [
2,
15708,
6720,
17113,
2555,
15759,
13,
9007,
800,
3726,
3726,
638,
27,
40,
15708,
6720,
2607,
113,
31,
22,
43,
101,
20,
57,
21,
1261,
1056,
15708,
6720,
118,
43,
7964,
192,
26470,
7758,
29,
2374,
5465,
432,
27,
2331,
880,
37,
40,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 C++: extract substring
===
I would like to extract a substring between two others.
ex: `/home/toto/FILE_mysymbol_EVENT.DAT`
or just `FILE_othersymbol_EVENT.DAT`
And I would like to get : `mysymbol` and `othersymbol`
I don't want to use boost or other libs. Just standard stuffs from C++, except CERN's ROOT lib, with [TRegexp][1], but I don't know how to use it...
Thanks,
eo
[1]: http://root.cern.ch/root/html/TRegexp.html%20%22TRegexp | 0 | [
2,
7953,
1706,
272,
20512,
45,
10962,
972,
11130,
800,
3726,
3726,
31,
83,
101,
20,
10962,
21,
972,
11130,
128,
81,
654,
9,
1396,
45,
13,
1,
118,
8167,
118,
262,
262,
118,
16877,
1,
915,
7261,
6966,
1,
4943,
38,
9,
593,
38,
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... |
Get the computer's last wake time
===
I know I can get the time since the last boot using `Environment.TickCount`
But is it possible to get the last time a compute woke up from hibernation or sleep?
(Without using WMI please) | 0 | [
2,
164,
14,
1428,
22,
18,
236,
3290,
85,
800,
3726,
3726,
31,
143,
31,
92,
164,
14,
85,
179,
14,
236,
6801,
568,
13,
1,
28976,
9,
38,
7030,
16549,
1,
47,
25,
32,
938,
20,
164,
14,
236,
85,
21,
23909,
7934,
71,
37,
4148,
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,
0,
0,
0... |
Graduate PHP Web Developer Questions?
===
I'm wondering if someone can help me or give me a bit of advice. In a couple of days I am being interview for a PHP Web Developer role. The company are looking for a PHP, MySQL, HTML5, CSS3 and jQuery developer.
So here's the deal, I've recently graduated from university and I have about 4 years self taught PHP/MySQL experience. I've never been formally taught PHP (apart from 1 or 2 modules in university) however I'm certainly not a novice as I have written many applications using different PHP frameworks. I'm also no noivce at HTML, CSS and jQuery as I was taught it at university and self taught myself it many years before that.
My worry is that the interview will consist of technical programming questions that I will find difficult to answer because I have no formal PHP or programming education. The interview is also my first IT interview so I'm not really sure how they really work out. All I know is the interview will be conducted by two senior PHP Developers, probably with 10+ years industry experience, which is intimidating to say the least because even questions they think are easy could prove difficult for me.
I was just wondering if anyone here has any experience of interviewing web developers (any language) or been in my situation? What sort of web developed related questions should I expect?
I have spent the entire morning researching posible questions and trying to brush up on my knowledge. I am in two minds to ring up the company and cancel the interview because I don't want to make an ass of myself.
Thanks a million :)
| 2 | [
2,
3156,
13,
26120,
2741,
10058,
2346,
60,
800,
3726,
3726,
31,
22,
79,
5712,
100,
737,
92,
448,
55,
54,
590,
55,
21,
1142,
16,
4978,
9,
19,
21,
1335,
16,
509,
31,
589,
142,
2421,
26,
21,
13,
26120,
2741,
10058,
597,
9,
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... |
Issue in deleting calendar from iPhone
===
i have successfully created calendar by coding and create events in that calendar.I am able to delete the calendar by coding but when i select iPhone's calendar and delete newly created calendar this time delete not working.
please suggest.
EKEventStore *eventStore = [[EKEventStore alloc] init];
EKCalendar *calendar = [EKCalendar calendarWithEventStore:eventStore];
calendar.title = CALENDAR_TITLE;
// Iterate over all sources in the event store and look for the local source
EKSource *theSource = nil;
for (EKSource *source in eventStore.sources) {
if (source.sourceType == EKSourceTypeLocal) {
theSource = source;
break;
}
}
if (theSource) {
calendar.source = theSource;
} else {
NSLog(@"Error: Local source not available");
return;
}
NSError *error = nil;
BOOL result = [eventStore saveCalendar:calendar commit:YES error:&error];
if (result) {
NSLog(@"Saved calendar to event store.")
self.calendarIdentifier = calendar.calendarIdentifier;
} else {
NSLog(@"Error saving calendar: %@.", error);
}
// Delete Calendar
EKEventStore *eventStore = [[EKEventStore alloc] init];
EKCalendar *calendar = [eventStore calendarWithIdentifier:self.calendarIdentifier];
if (calendar) {
NSError *error = nil;
BOOL result = [self.eventStore removeCalendar:calendar commit:YES error:&error];
if (result) {
NSLog(@"Deleted calendar from event store.");
} else {
NSLog(@"Deleting calendar failed: %@.", error);
}
} | 0 | [
2,
1513,
19,
121,
1336,
68,
7036,
37,
21024,
800,
3726,
3726,
31,
57,
3673,
679,
7036,
34,
13,
15458,
17,
1600,
963,
19,
30,
7036,
9,
49,
589,
777,
20,
27448,
14,
7036,
34,
13,
15458,
47,
76,
31,
5407,
21024,
22,
18,
7036,
17,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
jfreechart - adding label of total to stacked bar
===
Is there a possibility to show the stcaked bar total amount in a label .
I am adding an example using a simple demo to display and added them with ms-paint
(labels in black )
![enter image description here][1]
[1]: http://i.stack.imgur.com/AEGNE.png
stackedxybarrenderer.setSeriesItemLabelGenerator(index, new MyItemLabelGenerator());
doesnt quite do it . it paints the label in the serie(inside the small squares).
any suggestions? | 0 | [
2,
487,
4639,
5433,
38,
13,
8,
4721,
1899,
16,
600,
20,
20054,
748,
800,
3726,
3726,
25,
80,
21,
4813,
20,
298,
14,
354,
17568,
43,
748,
600,
2006,
19,
21,
1899,
13,
9,
31,
589,
4721,
40,
823,
568,
21,
1935,
8376,
20,
3042,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
looking for a way to loose focus/close keyboard in android PGB app
===
In a PhoneGapBuild 1.9.0 application I am writing,
I am having 3 problems:
1) I have some UI that includes a textbox (input type text) and a div that acts as a button (via touchstart/touchend). when the "button" is released It should display a "dialog" above the area where the textbox is. The problem is that the focus remains within the textbox and the textbox shows "above" my dialog.
2) In some other scenario I have a dialog with a textbox below it. In this case I am .hide()ing the textbox before I show the dialog. The problem is that if the android keboard does not close when I .hide() the input. so my entire UI remains push towards the top of the phone and prat of the "dialog" is not showing".
3) On the last scenario - if I now click some element in the dialog that should .show() again the textboxs below the dialog and then terminate the dialog I am getting the fucus back into the now showing again textbox below the point in the dialog where I clicked.
any help on any of those issues would be nice. | 0 | [
2,
699,
26,
21,
161,
20,
4675,
1776,
118,
14330,
8896,
19,
13005,
351,
11400,
4865,
800,
3726,
3726,
19,
21,
1132,
1136,
306,
29361,
137,
9,
518,
9,
387,
3010,
31,
589,
1174,
15,
31,
589,
452,
203,
1716,
45,
137,
6,
31,
57,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
GCDAsyncSocket peer to peer connection
===
I'm trying to use GCDAsyncSocket to establish a peer to peer connection between my Mac and my iPhone. Currently both devices are connected under the same wifi. But using the method:
[asyncSocket connectToHost:@"my iPhone's IP address" onPort:80 error:&err]
does not work. Is it due to my false operation? Could you please explain how to set up a peer to peer connection under my circumstance? | 0 | [
2,
13,
10362,
593,
9507,
6824,
5668,
1198,
7617,
20,
7617,
2760,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
13,
10362,
593,
9507,
6824,
5668,
1198,
20,
4088,
21,
7617,
20,
7617,
2760,
128,
51,
1572,
17,
51,
21024,
9,
871,
156,
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... |
xml getElementsByTagName by variable
===
I wish fetch data in a XML file, where Tag is a variable..
My XML looks like this:
<b0>123</b0>
<b1>111</b1>
Code:
var y = Math.round(d / 11);
var zzz = xmlDoc.getElementsByTagName("y")[0].childNodes[0].nodeValue;
Using the code above it will search in the XML "y" tag, but i want to search the result of "y" variable and since the XML has "b" before, the search in Tag should be something like this "b(y)". I´ve confirm that the results from "y" variable is always round numbers.
How can i acomplishe this?
Thanks in advance. | 0 | [
2,
23504,
164,
27567,
18,
779,
8628,
7259,
34,
7612,
800,
3726,
3726,
31,
2536,
18312,
1054,
19,
21,
23504,
3893,
15,
113,
3383,
25,
21,
7612,
9,
9,
51,
23504,
1879,
101,
48,
45,
13,
1,
220,
387,
1,
918,
240,
1,
118,
220,
387,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 set labels in inline assembly?
===
how in c++ visual can i set labels for when i need to use inline assembly, so it would look like something like this for example...
__asm
{
PUSH EAX
PUSH VAR1
MOV ECX,DWORD PTR DS:[VAR2]
CALL DWORD PTR DS:[VAR3]
JMP VAR4
}
where the `VAR` varables link to a value or address?
i have tried the following
DWORD VAR2 = 0x991770; //0x9C1270 is the location of the function
__asm
{
..code
MOV ECX,DWORD PTR DS:[VAR2]
..code
}
but then the app crashes, how is this done? | 0 | [
2,
184,
20,
309,
13173,
19,
19,
1143,
1475,
60,
800,
3726,
3726,
184,
19,
272,
20512,
3458,
92,
31,
309,
13173,
26,
76,
31,
376,
20,
275,
19,
1143,
1475,
15,
86,
32,
83,
361,
101,
301,
101,
48,
26,
823,
9,
9,
9,
13,
1,
472... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Should I use XML for this situation?
===
I am building a program that has different inputs and ouputs depending on the "vehicle" that is loaded. I want people to be able to load different vehicles so I need some type of file that keeps track of all the information.
Is XML going to be the best way to do this? Is there another option I should consider?
Thank you! | 0 | [
2,
378,
31,
275,
23504,
26,
48,
1858,
60,
800,
3726,
3726,
31,
589,
353,
21,
625,
30,
63,
421,
6367,
18,
17,
9028,
4881,
18,
4758,
27,
14,
13,
7,
195,
252,
15653,
7,
30,
25,
8572,
9,
31,
259,
148,
20,
44,
777,
20,
6305,
42... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Quickflip 2 Plugin - only having the image flipped once?
===
I am using the Quickflip 2 plugin (<http://jonraasch.com/blog/quickflip-2-jquery-plugin/comment-page-3#comment-3562>) to have images flip to another image when they are clicked.
However, I am trying to make it possible for the user to do only one click on the image so that they can only flip the image over once and not be able to flip it back.
In my example (<http://jsfiddle.net/gJh29/>) you can see that you are able to flip the images infinitely many times. I am trying to just have them flip once.
| 0 | [
2,
2231,
410,
6013,
172,
10922,
108,
13,
8,
104,
452,
14,
1961,
9516,
382,
60,
800,
3726,
3726,
31,
589,
568,
14,
2231,
410,
6013,
172,
10922,
108,
13,
5,
1,
21127,
6903,
9782,
525,
58,
2992,
9,
960,
118,
220,
5567,
118,
25865,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 make css opacity property not to be inherited from parent div´s?
===
I want a black bar behind a png image, and i want the black bar behind the image to have opacity. When I apply opacity to the black bar, his child element (the png image) inherits this opacity. I dont want this to happen.
The site is www.tomasfleiderman.com.ar , where it says "work for money, design for love" I want a black bar behind with opacity.
The code is the following:
<style type="text/css">
p {
font-size:40px;
color: white;
}
#caja
{
}
#fondofrase
{
}
</style>
<!--
<p>Work for money design for love</p>
-->
<div id="fondofrase">
<div id="caja">
<div>
<img src="http://www.tomasfleiderman.com.ar/1.png" alt="Texto" height="60%" width="60%"/>
</div>
</div>
</div>
Thanks | 0 | [
2,
184,
20,
233,
272,
18,
18,
13,
11490,
5788,
1354,
52,
20,
44,
7179,
37,
4766,
13,
12916,
13,
18,
60,
800,
3726,
3726,
31,
259,
21,
319,
748,
439,
21,
351,
2723,
1961,
15,
17,
31,
259,
14,
319,
748,
439,
14,
1961,
20,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Calculation errors
===
Ok,
So I'm hoping this should be quite a simple problem for someone out there.
The program works just fine, no errors, no crashes so thats a good start!
The problem is I'm getting an incorrect answer.
About half way down you should be able to see the line
``CARV= CA*3; tv2.setText(Double.toString(CARV));``
``CA`` relates to ``num3``, which is a user input. so if the user inputs 100 in `editText2` it should print 300 to `tv2`. But instead it is giving me a random number, at the moment I'm assume it takes the additional calculations below the above line into account before printing the answer.
My question, is how do i print the answer to CA*3??
Many Thanks
private OnClickListener myClickListener = new OnClickListener()
{
public void onClick(View v) {
try{
NS=Double.parseDouble(num1.getText().toString());
CH=Double.parseDouble(num2.getText().toString());
CA=Double.parseDouble(num3.getText().toString());
Z=Double.parseDouble(num4.getText().toString());
EKW=Double.parseDouble(num5.getText().toString());
FAT=Double.parseDouble(num6.getText().toString());
CART=Double.parseDouble(num7.getText().toString());
GAT=Double.parseDouble(num8.getText().toString());}
catch(Exception e)
{
if(num1.getText().length()==0)
{
num1.setError("please input ");
}
if(num2.getText().length()==0)
{
num2.setError("please input ");
}
if(num3.getText().length()==0)
{
num3.setError("please ");
}
if(num4.getText().length()==0)
{
num4.setError("please ");
}
if(num5.getText().length()==0)
{
num5.setError("please input ");
}
if(num6.getText().length()==0)
{
num6.setError("please input ");
}
if(num7.getText().length()==0)
{
num7.setError("please input ");
}
if(num8.getText().length()==0)
{
num8.setError("please input ");
}
}
{SV=(((NS*CH)*4)/3600)/Z;SV=(double)(Math.round(SV*100))/100; tv1.setText(Double.toString(SV));
CARV= CA*3; tv2.setText(Double.toString(CARV));
FA= SV*0.1;
GA= SV - (CARV + FA);
RCARA= CARV/SV;
RGA= GA/SV;
RFA= FA/SV;
CAO=(CARV*RCARA) + (GA*RGA) + (FA*RFA);
DT= 26-CAO;
RKW= DT * 1.21 * SV;RKW=(double)(Math.round(RKW*100))/100; tv3.setText(Double.toString(RKW));
}
}
};
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.car1);
tv1 = (TextView)findViewById(R.id.textView7);
tv2 = (TextView)findViewById(R.id.textView8);
tv3 = (TextView)findViewById(R.id.textView8);
button01 = (Button)findViewById(R.id.button1);
button01.setText("Display result");
button01.setOnClickListener(myClickListener);
num1 = (EditText)findViewById(R.id.EditText01);
num1.setText("");
num2 = (EditText)findViewById(R.id.editText1);
num2.setText("");
num3 = (EditText)findViewById(R.id.editText2);
num3.setText("");
num4 = (EditText)findViewById(R.id.editText3);
num4.setText("");
num5 = (EditText)findViewById(R.id.editText4);
num5.setText("");
num6 = (EditText)findViewById(R.id.editText5);
num6.setText("-5");
num7 = (EditText)findViewById(R.id.editText6);
num7.setText("10");
num8 = (EditText)findViewById(R.id.editText7);
num8.setText("16");
}
} | 0 | [
2,
19644,
11908,
800,
3726,
3726,
5854,
15,
86,
31,
22,
79,
3935,
48,
378,
44,
1450,
21,
1935,
1448,
26,
737,
70,
80,
9,
14,
625,
693,
114,
1123,
15,
90,
11908,
15,
90,
21563,
86,
30,
18,
21,
254,
799,
187,
14,
1448,
25,
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... |
Pull random image from a google image search with jquery or php
===
Is there a way to display a random image from a google image search?
preferably using jquery or php? | 0 | [
2,
2201,
5477,
1961,
37,
21,
8144,
1961,
2122,
29,
487,
8190,
93,
54,
13,
26120,
800,
3726,
3726,
25,
80,
21,
161,
20,
3042,
21,
5477,
1961,
37,
21,
8144,
1961,
2122,
60,
6369,
4801,
568,
487,
8190,
93,
54,
13,
26120,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Dot Notation vs Method Notation
===
I'm diving into iOS programming and I'm having difficulty getting my head around the idea of Dot Notation and Method Notation.
As far as I understand it, Dot Notation can be used to invoke setters/getters on properties and is much more cleaner to write/read. Method Notation is used to send messages to objects to manipulate them etc.
Could someone give me a simple explanation as to why the following two statements are essentially different and perform different actions.
- (IBAction)digitPressed:(UIButton *)sender
{
NSString *digit = [sender currentTitle];
self.display.text = [self.display.text stringByAppendingFormat:digit];
self.display.text = self.display.text.stringByAppendingFormat:digit;
}
Thanks. | 0 | [
2,
14123,
15591,
4611,
2109,
15591,
800,
3726,
3726,
31,
22,
79,
9837,
77,
13,
7760,
3143,
17,
31,
22,
79,
452,
6967,
1017,
51,
157,
140,
14,
882,
16,
14123,
15591,
17,
2109,
15591,
9,
28,
463,
28,
31,
1369,
32,
15,
14123,
15591... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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-cms and SQLite performance
===
I have a corporate website with django-cms and with a SQLite database that has only a few updates per month. The majority are reads. It will be less than 5000k requests per day.
My deployment is in a Cpanel server with apache and wsgi. I need to know first if i should to be worried about the usage of SQLite and if Postgresql in this situation will be faster and less resources consumption (because already installed and running on server).
This site use a 11MB SQLite file. Is this file in memory?
Thank you. | 0 | [
2,
3857,
14541,
8,
9095,
18,
17,
4444,
10601,
956,
800,
3726,
3726,
31,
57,
21,
4871,
2271,
29,
3857,
14541,
8,
9095,
18,
17,
29,
21,
4444,
10601,
6018,
30,
63,
104,
21,
310,
16779,
416,
1617,
9,
14,
1698,
50,
11137,
9,
32,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Form Submission Goes To Javascript - And Stay On Same Page
===
Please consider the following non-working HTML document:
<html>
<body>
<form action="" method="GET" onsubmit="return f(this);">
<input type="text" name="bar" value="" />
<input type="button" name="foo" value="foo"/>
</form>
</body>
<script type="text/javascript">
function f(x)
{
alert(x.bar);
}
</script>
</html>
What I am trying to achieve is that when either (a) the foo button is pressed; or (b) enter is pressed while the text input has focus; then the function f is called with the content of the s text input - and the browser should otherwise stay on the same page after f returns.
How can I achieve this?
| 0 | [
2,
505,
10923,
1852,
20,
8247,
8741,
13,
8,
17,
1179,
27,
205,
2478,
800,
3726,
3726,
2247,
3563,
14,
249,
538,
8,
14120,
13,
15895,
4492,
45,
13,
1,
15895,
1,
13,
1,
9760,
1,
13,
1,
4190,
1028,
3726,
7,
7,
2109,
3726,
7,
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... |
what are the risks and ramifications of changing the document validation criteria in a running Couch database?
===
To take the simplest possible example:
1. Start with an empty database.
2. Add a document
3. Add a design document with validation function that rejects everything
4. Replicate that database.
To ask a concrete question to begin with, one with an answer that I hope can be given very quickly by pointing me to the right url: is the result of this replication defined by some rule, for example that the documents are always replicated in the order they were saved, or does the successful replication of the first document depend on whether the design document happened to arrive at the destination first? In the quick experiment I did, both documents did get successfully validated, but I'm trying to find out if that outcome is defined in a spec somewhere or it's implementation dependent.
To ask a followup question that's more handwavey and may not have a single answer, what else can happen and what sort of solutions have emerged to manage those problems? It's obviously possible for different servers to simultaneously (and I use that word hesitantly) have different versions of a validation function. I suppose the validators could be backwards compatible, where every new version adds a case to a switch statement that looks up a say a `schema_version` attribute of the document. Then if a version 2 document arrives at a server where the version 3 validator is the gatekeeper, it'll be allowed in. If a version 3 document arrives at a version 2 validator, it's a bit more tricky, it presumably depends on whether strictness or leniency is an appropriate default for the application. But can either of those things even happen, or do the replication rules ensure that even if servers are going up and down, updates and deletes are being done all over the place, and replication connections are intermittent and indirect, that a document will never arrive on a given server before its appropriate validation function, and that a validation function will never arrive too late to handle one of the documents it was supposed to check?
I could well be overcomplicating this or missing out on some Zen insight, but painful experience has taught me that I'm not clever enough to predict what sorts of states concurrent systems can get themselves into. | 0 | [
2,
98,
50,
14,
12176,
17,
2843,
4634,
18,
16,
4226,
14,
4492,
27999,
9157,
19,
21,
946,
4914,
6018,
60,
800,
3726,
3726,
20,
247,
14,
24384,
938,
823,
45,
137,
9,
799,
29,
40,
2424,
6018,
9,
172,
9,
3547,
21,
4492,
203,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Storyboard TabBarController (without class files) in Landscape?
===
I'm building a more or less complex App, but I'm quiet new to this. I've created an own ABCViewController, which worked fine with the MainWindow.xib (also in landscape mode), but now I want to create a TabBarController (without code) which should be shown up before the ABCViewController. I tried to use the storyboard. But now, when I run the App, the TabBarView is in Portrait. The attributes inspector in storyboard is set to landscape for all my ViewControllers. Is it possible to edit the "shouldAutorotateToInterfaceOrientation" method for the TabBarViewController, which exists only in storyboard?
(btw, sorry for my bad English)
| 0 | [
2,
609,
2806,
6523,
1850,
12898,
1252,
13,
5,
14506,
718,
6488,
6,
19,
4453,
60,
800,
3726,
3726,
31,
22,
79,
353,
21,
91,
54,
787,
1502,
4865,
15,
47,
31,
22,
79,
2401,
78,
20,
48,
9,
31,
22,
195,
679,
40,
258,
5079,
4725,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
VB ASP.NET. "the conversion overflowed an integer column."
===
I am working in VB ASP.NET. I am doing a SELECT. I have a variable in the WHERE clause that usually works, but when I enter 13 or more characters, I get the message "the conversionnvarchar value overflowed an integer column." Any help will be greatly appreciated!
Here is my statement:
SELECT VACD
FROM VENDOR
WHERE VACD = FORM.VACD | 0 | [
2,
13,
20468,
28,
306,
9,
2328,
9,
13,
7,
124,
6263,
20285,
69,
40,
13820,
4698,
9,
7,
800,
3726,
3726,
31,
589,
638,
19,
13,
20468,
28,
306,
9,
2328,
9,
31,
589,
845,
21,
5407,
9,
31,
57,
21,
7612,
19,
14,
113,
9040,
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... |
Recalling viewDidLoad after failed connection not working
===
this is my viewDidLoad function working well :
- (void)viewDidLoad
{
[super viewDidLoad];
//iAds code
adview = [[ADBannerView alloc] initWithFrame:CGRectZero];
adview.frame = CGRectOffset(adview.frame, 0, 0);
adview.requiredContentSizeIdentifiers = [NSSet setWithObject:ADBannerContentSizeIdentifierPortrait];
adview.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
[self.view addSubview:adview];
adview.delegate = self;
self.adbanerinvesiable = NO;
//php data code
NSError *er;
SBJsonParser *parser = [[SBJsonParser alloc] init];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8888/newjson.php?number=1"]];
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
if (response.length != 0){
NSString *json_string = [[NSString alloc]initWithData:response encoding:NSUTF8StringEncoding];
listt = [parser objectWithString:json_string error:&er];
}
else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"No Internet conniction" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:@"Refresh", nil];
[alert show];
//for ID contet post
SBJsonParser *parser2 = [[SBJsonParser alloc] init];
NSURLRequest *request2 = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://localhost:8888/newjson.php?number=2"]];
NSData *response2 = [NSURLConnection sendSynchronousRequest:request2 returningResponse:nil error:nil];
NSString *json_string2 = [[NSString alloc]initWithData:response2 encoding:NSUTF8StringEncoding];
IDNum = [parser2 objectWithString:json_string2 error:&er];
}}
As you can see if the connection failed it will show UIAlertView and two Buttons {ok , Refresh}.
I used this Method in case the refresh button been clicked to call viewDidLoad But not Working and giving me blank white view:
-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1){
[self viewDidLoad];
}
}
Any idea please ? | 0 | [
2,
24639,
1418,
3052,
8294,
75,
1702,
2760,
52,
638,
800,
3726,
3726,
48,
25,
51,
1418,
3052,
8294,
1990,
638,
134,
13,
45,
13,
8,
13,
5,
2625,
1340,
6,
4725,
3052,
8294,
13,
1,
636,
8542,
1418,
3052,
8294,
12660,
12894,
549,
43... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 easily maintain the RMI interfaces across multiple applications like server and client?
===
Any one dealing with the RMI would certainly have come across this dilemma of how to easily maintain the interfaces to objects providing remote method invocation service to other client applications. Whenever we decide to have a minor change in the method declaration or adding/deleting methods declared in the interface, we have to manually replicate the change in all the clients that would be using that interface for accessing RMI service from a remote server. | 0 | [
2,
184,
20,
2351,
4027,
14,
761,
1435,
6573,
18,
464,
1886,
3767,
101,
8128,
17,
6819,
60,
800,
3726,
3726,
186,
53,
5746,
29,
14,
761,
1435,
83,
3850,
57,
340,
464,
48,
23314,
16,
184,
20,
2351,
4027,
14,
6573,
18,
20,
3916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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++ linking boost library
===
1) First i built the boost libraries that require building by going to /usr/local/boost_1_49_0/ and running the bootstrap.sh. This went off alright.
2) Step (1) created all the .so and .a files in /usr/local/boost_1_49_0/stage/lib
3) i tested linking against a library, say lboost_regex and #include<boost/regex> in my source code. this also went off alright.
4) finally trying out the example on asio, i tried
g++ -I/usr/local/boost_1_49_0 MAIN.cpp -o MAIN -L/usr/local/boost_1_49_0/stage/lib -lboost_thread -lboost_system -lpthread
(4) compiled alright. But when i run the program with ./MAIN, i get the following error:
./MAIN: error while loading shared libraries: libboost_system.so.1.49.0: cannot open shared object file: No such file or directory
Thanks for responses, | 0 | [
2,
272,
20512,
12585,
10419,
1248,
800,
3726,
3726,
137,
6,
64,
31,
392,
14,
10419,
8649,
30,
4077,
353,
34,
228,
20,
13,
118,
267,
139,
118,
15580,
118,
10858,
384,
1,
165,
1,
3624,
1,
15928,
17,
946,
14,
5894,
16514,
9,
1635,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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: need to create several instances of a module with different values
===
This is probably a simple problem but I need to create the JavaScript equivalent to N instances of a 'class' whose state must be totally separate.
like:
var car = new Car('Ford');
var car = new Car('Toyota');
| 0 | [
2,
8247,
8741,
45,
376,
20,
1600,
238,
13946,
16,
21,
12613,
29,
421,
4070,
800,
3726,
3726,
48,
25,
910,
21,
1935,
1448,
47,
31,
376,
20,
1600,
14,
8247,
8741,
4602,
20,
13,
103,
13946,
16,
21,
13,
22,
1898,
22,
1196,
146,
49... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 pass controller function parameters in codeigniter from forms?
===
I have a search city in my website, my search bar is a <select> option where they can select which city they want to view. but when i search a city in my website, it directs to this url:
foobar.com/s/
now i want the url to become like this: foobar.com/s/california
my select options have this format:
<select name='city'>
<option value='california'>California</option>
</select>
how can i make the value of the option be seen in the url?
| 0 | [
2,
184,
20,
1477,
9919,
1990,
12905,
19,
1797,
9693,
242,
106,
37,
1997,
60,
800,
3726,
3726,
31,
57,
21,
2122,
136,
19,
51,
2271,
15,
51,
2122,
748,
25,
21,
13,
1,
18,
16964,
1,
4255,
113,
59,
92,
5407,
56,
136,
59,
259,
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... |
eclipse android res folder warning
===
im new to java (and android for that matter)and recently i got tons of errors on png,mp3 files in my res folder which i didnt have for weeks before . I aslo got random errors in my class files out of nowhere even though I did not update my SDK when that happened. | 0 | [
2,
11652,
13005,
10719,
19294,
3590,
800,
3726,
3726,
797,
78,
20,
8247,
13,
5,
290,
13005,
26,
30,
1161,
6,
290,
1989,
31,
330,
5278,
16,
11908,
27,
351,
2723,
15,
2554,
240,
6488,
19,
51,
10719,
19294,
56,
31,
1182,
57,
26,
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... |
Python. Filter for custom data source
===
SQLAlchemy is very good. But It's for databases.
I need something like SQLAlchemy's filter for custom data source.
Java have QueryDSL. You can create modules, e.g. for mongodb, or implementation for your data source, like webservice.
I need something like that in Python.
1. Filter
2. Custom data source
2.1. Some filter option implements for result collection
2.2. Some filter option is a argument for webservice request.
Thx | 0 | [
2,
20059,
9,
11945,
26,
5816,
1054,
1267,
800,
3726,
3726,
4444,
10834,
2569,
915,
25,
253,
254,
9,
47,
32,
22,
18,
26,
6018,
18,
9,
31,
376,
301,
101,
4444,
10834,
2569,
915,
22,
18,
11945,
26,
5816,
1054,
1267,
9,
8247,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Hiding input doesnt work
===
`<input type="checkbox" name="AvatarfileSelected" value="image" id="AvatarfileSelected" onclick="$('#extra').hide('slow')"/><span style="color:#538f05;">Change Image</span>
<div id="extra">
<input type="file" name="avatarfile" id="avatarfile"></input>
</div>`
The above code doesn't work. Could someone show me the mistakes? | 0 | [
2,
5314,
6367,
5886,
170,
800,
3726,
3726,
13,
1,
108,
4881,
1001,
3726,
7,
12542,
5309,
7,
204,
3726,
7,
4961,
3958,
16877,
18,
7138,
7,
1923,
3726,
7,
22039,
7,
4924,
3726,
7,
4961,
3958,
16877,
18,
7138,
7,
27,
150,
10129,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
MIME types missing in IIS 7 for ASP.NET
===
When getting a newly configured Windows 7 box, I noticed that ASP.NET was turned off by default. So was classical ASP. I was getting a 404.17 error for a web application. I think it's because I don't have an "aspx" MIME type. Although that's just a guess. When I turned them on under Control Panel > Programs and Features > Turn Windows Features on or off, and restarted my Windows 7 machine, the MIME types never showed up. Can someone check what MIME type they have for *.aspx pages, and tell me the configuration in edit mode? What other MIME types would I be missing for ASP.NET extensions (ie: ashx, asax, etc...)? What is the best way to configure them all?
Error Summary
HTTP Error 404.17 - Not Found
The requested content appears to be script and will not be served by the static file handler.
...
Module: StaticFileModule
Notification: ExecuteRequestHandler
Handler: StaticFile
Error Code: 0x80070032
Requested URL: ...
Physical Path: ...
Logon Method: NTLM
Logon User: {DOMAIN}\{WINDOWS LOGIN}
...
Most likely causes:
The request matched a wildcard mime map. The request is mapped to the static file handler. If there were different pre-conditions, the request will map to a different handler.
...
Things you can try:
If you want to serve this content as a static file, add an explicit MIME map. | 0 | [
2,
26193,
2551,
2863,
19,
595,
18,
453,
26,
28,
306,
9,
2328,
800,
3726,
3726,
76,
1017,
21,
2771,
28895,
1936,
453,
1649,
15,
31,
2711,
30,
28,
306,
9,
2328,
23,
412,
168,
34,
12838,
9,
86,
23,
3089,
28,
306,
9,
31,
23,
101... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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: If condition followed by several commands
===
I have a if-condition which is followed by several commands. However, there seems to be a syntax error and it is not working. I guess this is pretty easy. I searched around for correct docting but didnt find a solution. Thanks for your help!
#data
supply_by_gas <- rep(0,365)
supply_by_gas[] <- 32069547/365
overall_gas_prod <- 51224298
#here the condition which should be true
if (overall_gas_prod > sum(supply_by_gas))
#followed by two commands
{peak_use_gas <- (overall_gas_prod - sum(supply_by_gas))
overall_gas_prod <- sum(supply_by_gas)-1 }
# else statement
{peak_use_gas <- 0} | 0 | [
2,
761,
45,
100,
2874,
709,
34,
238,
14294,
800,
3726,
3726,
31,
57,
21,
100,
8,
22141,
56,
25,
709,
34,
238,
14294,
9,
207,
15,
80,
2206,
20,
44,
21,
22649,
7019,
17,
32,
25,
52,
638,
9,
31,
2321,
48,
25,
1772,
2010,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Moses - Online Integration
===
We're actually looking to integrate Moses into our localization workflow. Our application is in Java and we're looking at using Moses' functionalities using xml-rpc calls.
Specifically, we're looking at APIs for:
1. Incremental training (i.e. Avoid having to retrain the model
from scratch every time we wish to use some new training data)
2. Domain-specific training (i.e. It should maintain separate
phrase tables for each domain that the input data belongs),
3. Decoding
The tutorial says that these can be achieved via xml-rpc calls. But, I don't find any examples or clear ways to do them. Can someone please provide some examples?
Also, I would like to know if the training and decoding phases can be done in a
distributed manner.
Thanks! | 0 | [
2,
10373,
13,
8,
2087,
8078,
800,
3726,
3726,
95,
22,
99,
1121,
699,
20,
18399,
10373,
77,
318,
375,
1829,
170,
9990,
9,
318,
3010,
25,
19,
8247,
17,
95,
22,
99,
699,
35,
568,
10373,
22,
7652,
3808,
568,
23504,
8,
139,
5779,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Client Caching turned off because of HttpModule?
===
My application has a custom `HttpModule` that we use for some advanced logging. All it does is add a couple of custom headers to the HTTP response.
The problem I'm having is that when this module is enabled, .CSS files are being returned with an HTTP header of `Cache-Control: no-cache`. When I turn off the module, I get what I'm expecting which is `Cache-Control:max-age=2419200`.
I have my cache enabled with:
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="28.00:00:00"/>
</staticContent>
I tried to comment out the adding of the custom headers in our `HttpModule`, but that didn't work.
Also, this is only causing problems for the .CSS files. .JS, .PNG, and .GIF for example are all working as I would expect. I can't seem to figure out why .CSS is special.
Not sure why just having that module is causing the cache header to work like that. Any thoughts?
I tried this on IIS7 and IIS7.5. (Actually it is running in Windows Azure but I don't think that makes a difference). | 0 | [
2,
6819,
1658,
7192,
412,
168,
185,
16,
7775,
19673,
62,
60,
800,
3726,
3726,
51,
3010,
63,
21,
5816,
13,
1,
21127,
19673,
62,
1,
30,
95,
275,
26,
109,
2255,
13,
13919,
9,
65,
32,
630,
25,
3547,
21,
1335,
16,
5816,
157,
445,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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# Selenium webdriver mouseOver again
===
I don't know what to do with this mouseOver in selenium.
I'm working with FF13. And with the last version of webdriver.
I read this http://stackoverflow.com/questions/6232390/is-there-a-proved-mouseover-workaround-for-firefoxdriver-in-selenium2 and i did exactly like this:
Actions builder = new Actions(driver);
Actions hoverOverRegistrar = builder.moveToElement(menuRegistrar); hoverOverRegistrar.perform();
but when it points to the object an other object (dropdown menu) appears just for a moment and then hides, so selenium not always has time to click on appeared dropdown menu.
What am i doing wrong? | 0 | [
2,
272,
5910,
23027,
14311,
2741,
21752,
7567,
2549,
188,
800,
3726,
3726,
31,
221,
22,
38,
143,
98,
20,
107,
29,
48,
7567,
2549,
19,
23027,
14311,
9,
31,
22,
79,
638,
29,
13,
2460,
1543,
9,
17,
29,
14,
236,
615,
16,
2741,
217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
App Engine - using memcache when models have ReferenceProperties
===
In my App Engine app (in Python 2.7, threadsafe) I want to be able to display information on all entities of my ChildModel kind. I think I've got memcache working, but because the ChildModel has a property that connects to a ParentModel there are some things happening that I don't understand.
I currently have the following models:
class ParentModel(db.Model):
name = db.StringProperty()
# currently 109 of these
class ChildModel(db.Model):
name = db.StringProperty()
parent_program = db.ReferenceProperty(ParentModel)
# currently 758 of these
I'm implemented memcache using [the example from Nick Johnson's blog](http://blog.notdot.net/2009/9/Efficient-model-memcaching).
class AllEntities(webapp2.RequestHandler):
def get(self):
entitylist = deserialize_entities(memcache.get("entitylist"))
if not entitylist:
entitylist = ChildModel.all().fetch(None)
memcache.set("entitylist", serialize_entities(entitylist))
totalnum = ChildModel.all().count()
The very first time I run this I see the following in appstats:
datastore_v3.Get 758
datastore_v3.RunQuery 3
datastore_v3.Next 2
memcache.Get 1
memcache.Set 1
After that, I see the following in appstats:
datastore_v3.Get 758
datastore_v3.RunQuery 2
memcache.Get 1
It looks like memcache gets set correctly, based on the memcache size (1304599 byte(s)). But I can't figure out how to stop the 758 datastore_v3.Get's which are extraordinary slow and also killing me on my quota of Datastore Small Operations and Datastore Read Operations.
Can someone please help me figure out what I'm doing wrong? | 0 | [
2,
4865,
1406,
13,
8,
568,
55,
4829,
9616,
76,
2761,
57,
2801,
10890,
106,
3915,
800,
3726,
3726,
19,
51,
4865,
1406,
4865,
13,
5,
108,
20059,
172,
9,
465,
15,
9322,
18166,
6,
31,
259,
20,
44,
777,
20,
3042,
676,
27,
65,
12549... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Advice: custom shapefile or C# heatmap of matrix
===
I'm looking at creating a heatmap of numerical data spread over various locations within a building. I've spent a few hours researching data mapping, etc. and am looking for some advice. I am new to GIS. The majority of options available are mostly tile APIs that use lat/long, and are overkill for my requirements...
Ultimately, I just want to output a background image (a floor plan) with the heatmap overlay demonstrating areas of high intensity. The data is bound to specific locations (example, activity level: 14, location: reception entrance) and so is not randomly distributed over the map. Data has timestamps, and the final objective is to print PNGs of hourly activity for animation.
I feel like I have two options.
I like this tutorial (http://dylanvester.com/post/Creating-Heat-Maps-with-NET-20-%28C-Sharp%29.aspx) as it offers a huge amount of flexibility and the final imagery is very similar to what I would like - it's a great head start. That said, I'd need to assign locations such as "reception entrance" to an x,y co-ordinate, or even a number of x,y co-ordinates. I'd then need to process a matrix prior to every heatmap, taking data from my CSV files and placing activity values in the appropriate co-ordinates.
The other option I think I have is to create a custom shapefile (?) from the floor plan. That is, create a vector graphic with defined regions, where each is attributable to a taggable location. This seems the most flexible option, but I'm really, really struggling to find out how to create shapefiles?
My unfamiliarity with GIS terminology is making searches difficult. The latter seems the most sensible solution (use the shapefile with something like https://gist.github.com/1370472) to change the activity values over time.
Links found:
- guthcad.com/cad2shape.htm (but don't have CAD drawing, just raster floorplan)
- stackoverflow.com/questions/4014072/arcgis-flex-overlay-floor-plan-png (unhelpful, don't want tiled)
- oliverobrien.co.uk/2010/01/simple-choropleth-maps-in-quantum-gis/
- gis.stackexchange.com/questions/20901/using-gis-for-interactive-floor-plan (looks great)
To summarise: I'd like to map data bound to locations within a building. There's very good code in a C# tutorial I'd like to use, but the linking of activity data to co-ordinates is potentially messy (although could allow for describing transitions of activity between locations as vectors between co-ordinates could be used...). The other option is to create an image with regions that can be linked to CSV data by something like QGIS. Could people with more experience suggest the best direction, or even alternatives?
Thank you!
| 0 | [
2,
4978,
45,
5816,
2539,
16877,
54,
272,
5910,
1737,
15022,
16,
8187,
800,
3726,
3726,
31,
22,
79,
699,
35,
2936,
21,
1737,
15022,
16,
16010,
1054,
1789,
84,
617,
4095,
363,
21,
353,
9,
31,
22,
195,
1111,
21,
310,
974,
527,
68,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Aptana Studio 3 + App Engine Python + Can't resolve memcache's certain methods
===
I'm using Aptana Studio 3 and I've been having no problem in accessing any App Engine Api library such as urlfetch.
However, today I ran into a weird problem of Aptana or maybe I miss configured something:
from google.appengine.api import memcache
The aptana resolve the memcache import. But when I was trying to access the memcache method, the auto assist shows maximum of **ONLY 7 Methods** while memcache is supposed to have long list of methods.
I've verified the memcache is actually imported to Aptana by:
1. Uploading to GAE server, and the memcache worked despite of the error highlight.
2. I opened the memcache file, and the methods are all there.
But, Aptana Studio 3:
1. failed to resolve the important methods --> get, set, add etc.
![enter image description here][1]
2. but, the 7 methods are resolved --> create_rpc, setup_client, _add_name_space, _decode_value, _is_pair, _key_string, _validate_encode_value
3. Even the 7 methods which are resolved, only 2 are public while the other 5 are private methods.
4. I opened the outline view to see what are all the methods listed in memcache python file, and realized the same 7 methods only displayed despite the codes are all there (get, set etc)
Here's what I tried to solve it:
1. I removed all External Libraries import from project Python Path configuration and then readded back the App Engine folder.
2. Noticeable change is only 1, in which now the outline view shows me all the right methods from the Memcache python file.
3. However, despite the outline view is showing correctly, the methods are still not resolved. The same 7 methods are only resolved.
While it's working fine in GAE, but impossible to work on an IDE that keeps highlighting the memcache methods with error.
Can anyone advice on this ?
[1]: http://i.stack.imgur.com/0hlAW.gif | 0 | [
2,
8442,
9068,
1120,
203,
2754,
4865,
1406,
20059,
2754,
92,
22,
38,
9854,
55,
4829,
9616,
22,
18,
1200,
3195,
800,
3726,
3726,
31,
22,
79,
568,
8442,
9068,
1120,
203,
17,
31,
22,
195,
74,
452,
90,
1448,
19,
1381,
68,
186,
4865,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SSH port fowarding with SSHj
===
I am trying to create a tunnel to use a service behind a firewall, that supports SSH. I wanted a complete solution in java, but I cannot seem to get it to work. I found this [github snip][1] and based on that I created the following code to keep a background thread giving me the tunnel:
// property on surrounding class
// static final SSHClient sshclient = new SSHClient();
Thread thread = new Thread(new Runnable() {
@Override
public void run() {
try {
String host = "10.0.3.96";
sshclient.useCompression();
sshclient.addHostKeyVerifier("30:68:2a:20:21:9f:c8:e8:ac:b4:a7:fc:2d:a7:d0:26");
sshclient.connect(host);
sshclient.authPassword("messy", "messy");
if (!sshclient.isAuthenticated()) {
throw new RuntimeException(String.format("Unable to authenticate against '%s'", host));
}
Forward forward = new Forward(8111);
InetSocketAddress addr = new InetSocketAddress("google.com", 80);
SocketForwardingConnectListener listener = new SocketForwardingConnectListener(addr);
sshclient.getRemotePortForwarder().bind(forward, listener);
sshclient.getTransport().setHeartbeatInterval(30);
HttpURLConnection con = (HttpURLConnection) new URL("http://localhost:8111").openConnection();
con.setRequestMethod("GET");
BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream()));
String line = null;
while( (line = reader.readLine()) != null) {
System.out.println(line);
}
sshclient.getTransport().join();
} catch (IOException e) {
e.printStackTrace();
}
try {
if (sshclient != null && sshclient.isConnected()) {
sshclient.disconnect();
}
} catch (IOException e) {
e.printStackTrace();
}
}
});
thread.setDaemon(true);
thread.start();
The problem is that if I connect to a remote SSH server like '10.0.3.96' it does not work. I f I use the local SSH server on my localhost it will work. I have been going thru different configurations with any luck and tried debugging, but I cannot grasp what is going on inside the SSHj package.
Now it does not have to be a SSHj solution, but that would be preferred since other parts of the code are fully implemented and using SSHj and I do not want to mix two SSH packages one project.
Thanks for any help.
[1]: https://github.com/shikhar/sshj/blob/master/src/main/java/examples/RemotePF.java "github snip" | 0 | [
2,
13,
18,
1635,
1295,
4310,
2826,
68,
29,
13,
18,
1635,
728,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
3485,
20,
275,
21,
365,
439,
21,
535,
6051,
15,
30,
6747,
13,
18,
1635,
9,
31,
417,
21,
1279,
4295,
19,
8247,
15,
47,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 jQuery droppable and sortable
===
I'm trying to have a sortable list that manipulates a javascript list. This is done ( see http://jsfiddle.net/jdb1991/2Y3aK/3/ ) but I'm have trouble with being able to delete from the list. I've seen .sortable's out and remove but they don't seem to be what I want. I need to be able to read the list's ui.item.index when it's dragged over bin so I can remove it.
Hope this makes sense. | 0 | [
2,
2917,
487,
8190,
93,
2804,
306,
579,
17,
2058,
579,
800,
3726,
3726,
31,
22,
79,
749,
20,
57,
21,
2058,
579,
968,
30,
18468,
18,
21,
8247,
8741,
968,
9,
48,
25,
677,
13,
5,
196,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Could not load file or assembly or one of its dependencies - not all dlls are in the release folder
===
I have a problem that when I move the release folder of the application to the destination server and run the application it says "Could not load file or assembly or one of its dependencies".
I think I know where it comes from, but what I dont know is how to fix it.
In my program I use 4 external dlls AntiXSSLibrary, HtmlSanitizationLibrary, MySql.Data and MySql.Data.Entity. When I "add reference" in visual c# 2010 express and build the solution I can see in the bin/release folder only 2 dlls - AntiXSSLibrary and HtmlSanitizationLibrary(and their xml). The MySQL dlls dont appears there - one of them is the dll that shown on the exception error message - and I dont know why it doesnt copy them to there too. BTW if I copy them myself it doesnt help..
On my computer - where the program is been build - it runs ok.
Thanks for any help. | 0 | [
2,
110,
52,
6305,
3893,
54,
1475,
54,
53,
16,
82,
29411,
13,
8,
52,
65,
13,
43,
211,
18,
50,
19,
14,
830,
19294,
800,
3726,
3726,
31,
57,
21,
1448,
30,
76,
31,
780,
14,
830,
19294,
16,
14,
3010,
20,
14,
6970,
8128,
17,
485... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Check which user is inserting in to table?
===
Is there any way to check which user is inserting into a table ?? Both in Oracle 11g and Sql Server 2005 | 0 | [
2,
2631,
56,
4155,
25,
14692,
68,
19,
20,
859,
60,
800,
3726,
3726,
25,
80,
186,
161,
20,
2631,
56,
4155,
25,
14692,
68,
77,
21,
859,
13,
60,
60,
156,
19,
15759,
547,
263,
17,
4444,
255,
8128,
812,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
C++ (and maths) : fast approximation of a trigonometric function
===
I know this is a recurring question, but I haven't really found a useful answer yet. I'm basically looking for a fast approximation of the function `acos` in C++, I'd like to know if I can significantly beat the standard one.
But some of you might have insights on my specific problem: I'm writing a scientific program which I need to be very fast. The complexity of the main algorithm boils down to computing the following expression (many times with different parameters):
sin( acos(t_1) + acos(t_2) + ... + acos(t_n) )
where the `t_i` are known real (double) numbers, and `n` is very small (like smaller than 6). I need a precision of at least 1e-10. I'm currently using the standard `sin` and `acos` C++ functions.
Do you think I can significantly gain speed somehow? For those of you who know some maths, do you think it would be smart to expand that sine in order to get an algebraic expression in terms of the `t_i` (only involving square roots)?
Thank you your your answers. | 0 | [
2,
272,
20512,
13,
5,
290,
5057,
18,
6,
13,
45,
1512,
20289,
16,
21,
28045,
18944,
1990,
800,
3726,
3726,
31,
143,
48,
25,
21,
11344,
1301,
15,
47,
31,
2933,
22,
38,
510,
216,
21,
4811,
1623,
768,
9,
31,
22,
79,
11374,
699,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Scale down DatePicker
===
I'm new to Android development and I'm using `DatePicker` control.
It's default dimensions are too large and hence I tried to scale it down by using absolute values, but then whole `DatePicker` is not visible.
I searched a lot, some link states that it's not possible and I'm unable to implement some other suggestions.
I tried following links:
- http://stackoverflow.com/questions/3259720/resize-android-datepicker-control (Not able to locate the required library)
- http://stackoverflow.com/questions/4261527/resizing-scaling-down-android-widgets-datepicker-and-timepicker (Didn't understood how to integrate given class with my app)
| 0 | [
2,
3464,
125,
1231,
16855,
106,
800,
3726,
3726,
31,
22,
79,
78,
20,
13005,
522,
17,
31,
22,
79,
568,
13,
1,
8209,
16855,
106,
1,
569,
9,
32,
22,
18,
12838,
9913,
50,
266,
370,
17,
5796,
31,
794,
20,
3464,
32,
125,
34,
568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 backfill missing data where records have one common field
===
I want to find a way to fill in missing data from records that have data to ones that dont where an email matches.
I have a table where it has name, address, city, state,zip and email. like this
kim,,,55555,kim@domain.com
kim,Longmont,CO,55555,kim@domain.com
kim,,,,kim@domain.com
What I want to do is remove duplicates and not lose the relevant data. So I would like to back fill each record with the data that is there and then remove dupes. There isn't always a record that has all of the details like the 2nd one. Sometimes there may not be any record with all of the data.
Ideally I'd want to end up with the following so each record has as many of the fields that are available. If a field has 2 or more different records I am okay with just filling in from the first.
I hope that's a fair explaination of it
kim,Longmont,CO,55555,kim@domain.com
kim,Longmont,CO,55555,kim@domain.com
kim,Longmont,CO,55555,kim@domain.com
| 0 | [
2,
51,
18,
22402,
97,
19971,
2863,
1054,
113,
742,
57,
53,
757,
575,
800,
3726,
3726,
31,
259,
20,
477,
21,
161,
20,
3509,
19,
2863,
1054,
37,
742,
30,
57,
1054,
20,
53,
18,
30,
1049,
113,
40,
8517,
1717,
9,
31,
57,
21,
859,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Downloading oldest file from Linux FTP server and Windows FTP server
===
I want to download the oldest file from the directory on the FTP server.
I am connecting to the FTP server using `FtpWebrequest` to get the list of files in the directory. I use `WebRequestMethods.Ftp.ListDirectoryDetails` to do so. Once I know the file name, I'll create another FTP connection to download that file.
However, the details I get in the `FtpWebResponse` stream are in different format when FTP is on Linux and when it's on the Windows.
1. How to deal with this problem?
2. I can write different methods for Linux and Windows that parse the response stream. But for that, at least the way Linux Ftp and Windows FTP provides details should be definite. Do you know if the way details are sent may vary from one Linux FTP server to another?
3. I observed (at least on the Windows FTP) that the oldest file is listed at the end of the response stream every time. And the file name is at the end of every line. Can I take it for granted and write a code?
4. Can you suggest smarter way of getting the oldest file details?
| 0 | [
2,
7121,
68,
2976,
3893,
37,
13024,
1187,
306,
8128,
17,
1936,
1187,
306,
8128,
800,
3726,
3726,
31,
259,
20,
7121,
14,
2976,
3893,
37,
14,
16755,
27,
14,
1187,
306,
8128,
9,
31,
589,
6440,
20,
14,
1187,
306,
8128,
568,
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... |
ShakeListener implementation in seperate class
===
I'm trying to implement a ShakeListener. So I made a Class called ShakeListener.java :
import java.util.List;
import android.app.Activity;
import android.content.Context;
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.util.Log;
public class ShakeListener implements SensorEventListener {
private SensorManager sensorManager;
private List<Sensor> sensors;
private Sensor sensor;
private long lastUpdate = -1;
private long currentTime = -1;
private float last_x, last_y, last_z;
private float current_x, current_y, current_z, currenForce;
private static final int FORCE_THRESHOLD = 900;
private final int DATA_X = SensorManager.DATA_X;
private final int DATA_Y = SensorManager.DATA_Y;
private final int DATA_Z = SensorManager.DATA_Z;
public ShakeListener(Activity parent) {
SensorManager sensorService = (SensorManager) parent
.getSystemService(Context.SENSOR_SERVICE);
this.sensorManager = sensorManager;
this.sensors = sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
if (sensors.size() > 0) {
sensor = sensors.get(0);
}
}
public void start() {
if (sensor != null) {
sensorManager.registerListener(this, sensor,
SensorManager.SENSOR_DELAY_GAME);
}
}
public void stop() {
sensorManager.unregisterListener(this);
}
public void onAccuracyChanged(Sensor s, int valu) {
}
public void onSensorChanged(SensorEvent event) {
if (event.sensor.getType() != Sensor.TYPE_ACCELEROMETER
|| event.values.length < 3)
return;
currentTime = System.currentTimeMillis();
if ((currentTime - lastUpdate) > 100) {
long diffTime = (currentTime - lastUpdate);
lastUpdate = currentTime;
current_x = event.values[DATA_X];
current_y = event.values[DATA_Y];
current_z = event.values[DATA_Z];
currenForce = Math.abs(current_x + current_y + current_z - last_x
- last_y - last_z)
/ diffTime * 10000;
if (currenForce > FORCE_THRESHOLD) {
Log.d("ShakeListener", "SHAKE DETECTED");
}
last_x = current_x;
last_y = current_y;
last_z = current_z;
}
}
}
Now, I want to envoke it from my main activity (thinking about implementing a While-loop that waits for a shake boolean to change?). So in my main activity, I use :
private ShakeListener myShakeListener;
and then
myShakeListener = new ShakeListener(this);
myShakeListener.start();
But I get an NPE on the line :
this.sensors = sensorManager.getSensorList(Sensor.TYPE_ACCELEROMETER);
What am I doing wrong? How should I implement this?
Thnx
| 0 | [
2,
4657,
13891,
106,
6123,
19,
10332,
106,
1373,
718,
800,
3726,
3726,
31,
22,
79,
749,
20,
8713,
21,
4657,
13891,
106,
9,
86,
31,
117,
21,
718,
227,
4657,
13891,
106,
9,
1004,
1385,
13,
45,
9010,
8247,
9,
14255,
9,
5739,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Existential types and repeated parameters
===
Is it possible to have an existential type scope over the type of a repeated parameter in Scala?
Motivation
----------
For example, in [this answer][1], I'd like to be able to write the following:
case class Rect2D[A](rows: Sized[Seq[A], _ <: Nat]*)
And have it not compile, for example, here, since the inferred second type parameters of the two arguments are different:
Rect2D(Sized(1, 2, 3), Sized(1, 2))
Unfortunately this does compile, since the existential is apparently inside the scope of the `*`.
The following version has the semantics I want:
case class Rect2D[A](rows: Seq[Sized[Seq[A], N]] forSome { type N <: Nat })
But I'd prefer not to have to write the `Seq` in `Rect2D(Sized(1, 2, 3), Sized(3, 4, 5))`.
Simplified example
---------------
Consider the following:
case class X[A](a: A)
case class Y(xs: X[_]*)
I don't want `Y(X(1), X("1"))` to compile. It does. I know I can write the following:
case class X[A](a: A)
case class Y(xs: Seq[X[B]] forSome { type B })
But I'd like to use repeated parameters.
[1]: http://stackoverflow.com/a/11517724/334519 | 0 | [
2,
27147,
2551,
17,
4251,
12905,
800,
3726,
3726,
25,
32,
938,
20,
57,
40,
27147,
1001,
9914,
84,
14,
1001,
16,
21,
4251,
18906,
19,
25975,
60,
11933,
13,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
26,
823,
15,
19,
636,
1565,
1623,
500... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Recording audio output only from speaker of iphone excluding microphone
===
I am trying to record the sound from iPhone speaker. I am able to do that, but I am unable to avoid mic input in the recorded output. Tried with sample code available in different websites with no luck.
The sample which I used does the recording with audio units. I need to know if there is any property for audio unit to set the mic input volume to zero. Above that I came to from other posts that Audio Queue services can do the thing for me. Can any one redirect me with sample code for the audio queue services implementation. I need to know whether there is a way of writing the data to an separate audio file before sending it as input to speaker.
Thanks in advance | 0 | [
2,
1576,
4023,
5196,
104,
37,
4687,
16,
21024,
13,
14938,
15403,
800,
3726,
3726,
31,
589,
749,
20,
571,
14,
646,
37,
21024,
4687,
9,
31,
589,
777,
20,
107,
30,
15,
47,
31,
589,
2343,
20,
2658,
13,
5410,
6367,
19,
14,
801,
519... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Why are these XSL functions throwing an error?
===
<br /><br />
I am transforming some XML, renaming each element named `alt-title` to `Running_Head`, provided that the attribute `alt-title-type` is equal to "running-head".
<br /><br /><hr />
So, the below code is using the line `<xsl:when test="starts-with(@alt-title-type, 'running-head')">` which is working fine. However, when I change this to either of these:
- `<xsl:when test="ends-with(@alt-title-type, 'running-head')">`
- `<xsl:when test="matches(@alt-title-type, 'running-head')">`
...this error is thrown:
<br />
> Error:XSLTProcessor::transformToXml() [<a
> href='xsltprocessor.transformtoxml'>xsltprocessor.transformtoxml</a>]:
> xmlXPathCompiledEval: 2 objects left on the stack.
So, it seems that the function `starts-with` is working, where `ends-with` and `matches` are not.
<br /><br /><hr />
Here is my XSL, using `starts-with`, that seems to be working properly:
<br /><br />
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="UTF-8" indent="yes" method="xml" />
<!-- Running_Head -->
<xsl:template match="@*|node()">
<xsl:choose>
<xsl:when test="starts-with(@alt-title-type, 'running-head')">
<xsl:element name="Running_Head">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template> <!-- end of Running_Head -->
</xsl:stylesheet>
...and here is the XML being transformed:
<br />
<root-node>
<alt-title alt-title-type="running-head">
This is working
</alt-title>
<alt-title alt-title-type="asdfng-head">
asdfasdf
</alt-title>
<alt-title>
asdfasdf
</alt-title>
<alt-title alt-title-type="running-head">
This is also working
</alt-title>
</root-node>
<br />
I am testing this at http://xslt.online-toolz.com/tools/xslt-transformation.php, and http://www.xsltcake.com/. | 0 | [
2,
483,
50,
158,
993,
18,
255,
3719,
6033,
40,
7019,
60,
800,
3726,
3726,
13,
1,
5145,
13,
118,
1,
5145,
13,
118,
1,
31,
589,
22335,
109,
23504,
15,
25934,
206,
4520,
377,
13,
1,
192,
38,
8,
22235,
1,
20,
13,
1,
11325,
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 remove strange space in LaTeX-style maths in matplotlib plot
===
I am using the following as an axis label in matplotlib:
"Pixel Radiance ($W/m^2/\mu m$)"
But when I produce a graph with this as the y-axis label I get the image below, which has a strange space between the m^2 and the \mu which makes it look rather strange. How can I remove this strange space?
![example graph][1]
[1]: http://i.stack.imgur.com/y0pPm.png | 0 | [
2,
184,
20,
4681,
2578,
726,
19,
456,
396,
8,
4381,
5057,
18,
19,
4277,
13221,
38,
8326,
3798,
800,
3726,
3726,
31,
589,
568,
14,
249,
28,
40,
8577,
1899,
19,
4277,
13221,
38,
8326,
45,
13,
7,
18321,
532,
13,
9560,
2416,
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... |
HTML form that automatically adds and then POST
===
I'm trying to create an HTML form that will add up the prices of various options selected for a product, and then POST to PayPal's Buy Now function.
Here's an example of the PayPal buy now form. I'm trying to add the functionality to allow each variation to add up to a final amount before post. Why PayPal doesn't allow this to begin with is beyond me. No time for a rant though.
Here is paypals example of a Buy Now form with pricing. The issue is that you can only select final price. It doesn't allow for matrix style pricing.
eg:
Item Price: $50
Variation 1:
--- Option A: +$25
--- Option B: +$50
Variation 2:
--- Option A: +$10
--- Option B: +$15
So if you select 1A and 2B the form posts $50 + $25 + $15 = $90
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- Identify your business so that you can collect the payments. -->
<input type="hidden" name="business" value="herschelgomez@xyzzyu.com">
<!-- Specify a Buy Now button. -->
<input type="hidden" name="cmd" value="_xclick">
<!-- Specify details about the item that buyers will purchase. -->
<input type="hidden" name="item_name" value="Hot Sauce">
<input type="hidden" name="currency_code" value="USD">
<!-- Provide a dropdown menu option field. -->
<input type="hidden" name="on0" value="Type">Type of sauce <br />
<select name="os0">
<option value="Select a type">-- Select a type --</option>
<option value="Red">Red sauce</option>
<option value="Green">Green sauce</option>
</select> <br />
<!-- Provide a dropdown menu option field with prices. -->
<input type="hidden" name="on1" value="Size">Size <br />
<select name="os1">
<option value="06oz">6 oz. bottle - $5.95 USD</option>
<option value="12oz">12 oz. bottle - $9.95 USD</option>
<option value="36oz">3 12 oz. bottles - $19.95 USD</option>
</select> <br />
<!-- Specify the price that PayPal uses for each option. -->
<input type="hidden" name="option_index" value="1">
<input type="hidden" name="option_select0" value="06oz">
<input type="hidden" name="option_amount0" value="5.95">
<input type="hidden" name="option_select1" value="12oz">
<input type="hidden" name="option_amount1" value="9.95">
<input type="hidden" name="option_select2" value="36oz">
<input type="hidden" name="option_amount2" value="19.95">
<!-- Display the payment button. -->
<input type="image" name="submit" border="0"
src="https://www.paypal.com/en_US/i/btn/btn_buynow_LG.gif"
alt="PayPal - The safer, easier way to pay online">
<img alt="" border="0" width="1" height="1"
src="https://www.paypal.com/en_US/i/scr/pixel.gif" >
</form> | 0 | [
2,
13,
15895,
505,
30,
7499,
10621,
17,
94,
678,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
40,
13,
15895,
505,
30,
129,
3547,
71,
14,
7334,
16,
617,
6368,
1704,
26,
21,
2374,
15,
17,
94,
678,
20,
1372,
6720,
22,
18,
3034,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Ruby Rails Database
===
I'm totally new at Rails and I've started to work on my first app and I've having a problem I cannot solve. I'm sure its easy :)
Basically I'm tracking rental properties, so I have controllers and models for Homes, Tenants, Leases, Vendors, Repairs, etc. I've been able to setup all of them and create new records, update, edit, etc, from webforms EXCEPT for one called TENANTS.
Since I couldn't get the app the save records from the web form --- I went over to rails console and have the same problem. I cannot save to the database from the console.
Example of what I did in console to create a new "Tenant" record
tenant = Tenant.new
=> #<Tenant id: nil, first_name: nil, last_name: nil, home_id: nil, created_at: nil, updated_at: nil>
>> first_name = "Billy"
=> "Billy"
>> last_name = "Jones"
=> "Jones"
>> tenant.save
(0.1ms) BEGIN
SQL (0.2ms) INSERT INTO `tenants` (`created_at`, `first_name`, `home_id`, `last_name`, `updated_at`) VALUES ('2012-07-29 20:54:28', NULL, NULL, NULL, '2012-07-29 20:54:28')`
Mysql2::Error: Column 'first_name' cannot be null: INSERT INTO `tenants` (`created_at`, `first_name`, `home_id`, `last_name`, `updated_at`) VALUES ('2012-07-29 20:54:28', NULL, NULL, NULL, '2012-07-29 20:54:28')
(0.1ms) ROLLBACK
ActiveRecord::StatementInvalid: Mysql2::Error: Column 'first_name' cannot be null: INSERT INTO `tenants` (`created_at`, `first_name`, `home_id`, `last_name`, `updated_at`) VALUES ('2012-07-29 20:54:28', NULL, NULL, NULL, '2012-07-29 20:54:28')
SO, I cannot determine the problem. It says first_name cannot be null, obviously because I setup the database that way, but there is a value trying to go into database, even though I can return a value in Rails Console asking for first_name..... Any advise?
Below are controller/model
***** TENANT CONTROLLER
class TenantsController < ApplicationController
def index
render('list')
end
def list
@tenants = Tenant.order("tenants.last_name ASC")
end
def show
@tenant = Tenant.find(params[:id])
end
def new
@tenant = Tenant.new
end
def create
@tenant = Tenant.new(params[:tenant])
@tenant.save
if @tenant.save
flash[:notice] = "New Tenant was created successfully."
redirect_to(:action => 'list')
else
render('new')
end
end
def edit
@tenant = Tenant.find(params[:id])
end
def update
# find object using form parameters
@tenant = Tenant.find(params[:id])
#update the object
if @tenant.update_attributes(params[:tenant])
#if update succeeds redirect to
flash[:notice] = "Tenant was updated successfully."
redirect_to(:action => 'show', :id => @tenant.id)
else
render('edit')
end
end
def delete
@tenant = Tenant.find(params[:id])
end
def destroy
@tenant = Tenant.find(params[:id])
@tenant.destroy
flash[:notice] = "Tenant was destroyed successfully."
redirect_to(:action => 'list' )
end
end
***** TENANT MODEL
class Tenant < ActiveRecord::Base
attr_accessible :first_name, :last_name, :home_id
end
| 0 | [
2,
10811,
2240,
18,
6018,
800,
3726,
3726,
31,
22,
79,
5139,
78,
35,
2240,
18,
17,
31,
22,
195,
373,
20,
170,
27,
51,
64,
4865,
17,
31,
22,
195,
452,
21,
1448,
31,
1967,
8402,
9,
31,
22,
79,
562,
82,
2010,
13,
45,
6,
11374... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 make multiple partials use the same model
===
I am trying to make a page that separates users into different categories based on the sport they chose during signup. I am currently trying to do it with two different partials. The issue I am running into is that I can't have two separate partials use the same model. How would I do this? | 0 | [
2,
184,
20,
233,
1886,
7284,
18,
275,
14,
205,
1061,
800,
3726,
3726,
31,
589,
749,
20,
233,
21,
2478,
30,
1725,
18,
3878,
77,
421,
6422,
432,
27,
14,
2440,
59,
3305,
112,
1676,
576,
9,
31,
589,
871,
749,
20,
107,
32,
29,
81... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Infinate loop
===
I have been trying to figure out how I have been getting an infinite loop in my PHP script. The custom functions I know do not have any while loops, these are the only two with 0 or more loops. (I have thought about combining them, but I'll wait till I fix this)
The reason the $query and $result are passed are so that I can fetch the object, the actual query is
$query = $db->query("SELECT UNIX_TIMESTAMP(`Fitting Date`), `Retail Price`, `Patient ID`, `Marketing`, `Mono or Bi` FROM fitting WHERE YEAR(`Fitting Date`)= '". $_REQUEST['year'] ."' ORDER BY `Fitting Date` ");
function printcontent ($result,$query,$month) {
global $totalhearingaids, $totalincomeoverall;
$hearingaids = 0;
$totalincome = 0.00;
$monthdate = date(n,$result->{"Fitting Date"});
echo '<div id="innercontent"><table>'. "\n";
while ($monthdate = $month)
{
echo '<tr>' . "\n";
echo '<td>' . unixtodate($result->{"Fitting Date"}). '</td><td>' . printname($result->{"Patient Id"}) . "</td><td>" . $result->{"Mono or Bi"} . "</td><td>" . $result->{"Retail Price"} . "</td><td>" . printmarketing($result->{"Marketing"}) . "</td><br />" . "\n";
echo '</tr>' . "\n";
$hearingaids += $result->{"Mono or Bi"};
$totalincome += $result->{"Retail Price"};
$result = $query->fetch_object();
$monthdate = date(n,$result->{"Fitting Date"});
}
$totalhearingaids += $hearingaids;
$totalincomeoverall += $totalincome;
echo '<br />' . "\n" . '<b id="yeartitle">Sum</b>' . '<tr>' . "\n" . '<td></td><td></td><td>' . $hearingaids . '</td><td>$' . $totalincome . '</td><br />' . "\n" . '</table></div><br />' . "\n";
}
This one happens in the main "function" of the code.
$month = 1;
while ($month <= 12){
echo '<i>' . date(M,$month) . '</i><br />' . "\n";
printcontent($object,$query,$month);
$month += 1;
} | 0 | [
2,
13,
26120,
19,
5617,
1373,
5293,
800,
3726,
3726,
31,
57,
74,
749,
20,
1465,
70,
184,
31,
57,
74,
1017,
40,
9698,
5293,
19,
51,
13,
26120,
3884,
9,
14,
5816,
3719,
31,
143,
107,
52,
57,
186,
133,
19661,
15,
158,
50,
14,
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... |
PayPal integration (IPN) - Just how possible is it REALLY?
===
I've spent MONTHS trying to integrate PayPal into my site, followed countless tutorials, articles - read all the docs, downloaded countless samples and so-called "complete, working samples" and have yet to get it working.
I've also asked a few questions on separate occasions, right here on S/O (under an old, now cancelled account) which didn't lead to any correct answers.
I just came across the www.x.com website, and was reading through it. I'm going to give it one more attempt, but before I do so, I'd like to know if,
> How to get started
> 1.Check your account status. Login to PayPal. Go to your PayPal Profile and click My settings. Confirm that your “Account type” is
> either Premier or Business, or upgrade your account.
> 2.Check your API settings. Click My selling tools. Expand “Selling online” if needed and check “API access.” Click Update and Add or edit
> API permission or View API signature.
> 3.In your PayPal Profile, click My selling tools, click Instant Payment Notification. Follow the instructions to enable your IPN
> including entering your Notification URL.
> 4.To create a basic IPN listener script, use the PayPal IPN script generator. If necessary, modify the script to meet your needs.
> 5.Install the script on your website at the Notification URL you specified in your PayPal Profile.
> 6.Test your script using the PayPal Sandbox. (Registration is free.)
> 7.Once you’ve verified that your implementation works correctly in the Sandbox, you’re now ready to go live.
That above quoted text, (from https://www.x.com/developers/paypal/products/instant-payment-notification ) _really is_ all I need, as it says?
Are there _other_ things that are involved that the documentation does not cover, or are there _other_ things that one would need to know in order to integrate PayPal IPN into their website, which are not easily accessible via the PayPal or X.com websites? | 0 | [
2,
1372,
6720,
8078,
13,
5,
4307,
103,
6,
13,
8,
114,
184,
938,
25,
32,
510,
60,
800,
3726,
3726,
31,
22,
195,
1111,
818,
749,
20,
18399,
1372,
6720,
77,
51,
689,
15,
709,
16708,
29724,
18,
15,
3376,
13,
8,
1302,
65,
14,
976... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Parsing a reserved word in Parsing Expressive Grammar (PEG.js)
===
The [similar question][1] and the [author's website][2] give me solutions like this:
Identifier "identifier"
= !ReservedWord [A-Za-z_]+
ReservedWord
= "test"
/ "abc"
This solution can't parse an identifier like this "test_var".
In this example, the grammar !ReservedWord will exclusive all variables starting with "test" or "abc".
Thanks in advance.
[1]: http://stackoverflow.com/questions/4933788/excluding-certain-elements-from-a-specified-set-in-parsing-expressive-grammar-p
[2]: https://github.com/dmajda/pegjs/blob/master/examples/javascript.pegjs | 0 | [
2,
2017,
18,
68,
21,
9430,
833,
19,
2017,
18,
68,
25093,
7207,
13,
5,
20427,
9,
728,
18,
6,
800,
3726,
3726,
14,
636,
19107,
1301,
500,
2558,
165,
500,
17,
14,
636,
10007,
22,
18,
2271,
500,
2558,
135,
500,
590,
55,
6776,
101,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Firefox Addon with toolbar, access object from browser.xul
===
I am developing a Firefox addon which will be primarily a toolbar but will have some dialog/windows for things like preferences.
In `browser.xul` I declare my global variable which I will store all variables within:
var coolAddon = {};
Then in my toolbar I want to be able to call methods of `coolAddon`, for example on button clicks.
If I open a dialog from `browser.xul`, in the dialog I can access `coolAddon` using `window.opener.coolAddon`, which works well. The problem is this does not work on the toolbar - only on windows/dialogs. What happens in the toolbar is `window.opener` is `null/undefined`.
How can I access `coolAddon` that is declared in `browser.xul`, from within the toolbar? I don't want to redeclare it because I need to keep it's current property values (I realise my example does not currently have any properties or methods). | 0 | [
2,
535,
18219,
3547,
218,
29,
5607,
1850,
15,
1381,
3095,
37,
16495,
9,
396,
1287,
800,
3726,
3726,
31,
589,
3561,
21,
535,
18219,
3547,
218,
56,
129,
44,
2257,
21,
5607,
1850,
47,
129,
57,
109,
28223,
118,
27508,
18,
26,
564,
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... |
Android ScrollView troubles inside relative layout
===
In my android app I need a layout as shown below
![enter image description here][1]
A relative layout is used as the parent layout inside I use 4 relative layout to arrange the contents- header layout 1,header layout 2, content layout(objRLScrollView -scroll view is inside this layout) and a footer layout
I use the below code to create the above layout
public class Login1 extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
RelativeLayout objRLBody=new RelativeLayout(this);
objRLBody.setId(1001);
RelativeLayout.LayoutParams objLLBodyParams=new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT);
objRLBody.setBackgroundColor(Color.parseColor("#d8e4f3"));
objRLBody.setLayoutParams(objLLBodyParams);
/* header portion starts here*/
RelativeLayout objRLActionBar=new RelativeLayout(this);
objRLActionBar.setId(1002);
RelativeLayout.LayoutParams objRLActionBarParams=new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,50);
objRLActionBarParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
objRLActionBar.setLayoutParams(objRLActionBarParams);
objRLActionBar.setBackgroundColor(Color.parseColor("#2e4862"));
objRLBody.addView(objRLActionBar);
RelativeLayout objRLSelectedActionBar=new RelativeLayout(this);
objRLSelectedActionBar.setId(1003);
RelativeLayout.LayoutParams objRLSelectedActionBarParams=new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT);
objRLSelectedActionBarParams.addRule(RelativeLayout.BELOW,objRLActionBar.getId());
objRLSelectedActionBar.setLayoutParams(objRLSelectedActionBarParams);
objRLSelectedActionBar.setBackgroundColor(Color.WHITE);
objRLSelectedActionBar.setGravity(Gravity.CENTER|Gravity.LEFT);
TextView objTVSelectedAction = new TextView(this);
RelativeLayout.LayoutParams objTVSelectedActionParams=new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
objTVSelectedAction.setLayoutParams(objTVSelectedActionParams);
objTVSelectedAction.setGravity(Gravity.CENTER);
objTVSelectedAction.setTextColor(Color.BLACK);
objTVSelectedAction.setTextSize(TypedValue.COMPLEX_UNIT_DIP,18);
objTVSelectedAction.setText("Scroll Test");
objTVSelectedAction.setTypeface(null, Typeface.BOLD);
objTVSelectedAction.setPadding(4, 0, 4, 0);
objTVSelectedAction.setId(1004);
objRLSelectedActionBar.addView(objTVSelectedAction);
objRLBody.addView(objRLSelectedActionBar);
/* header portion ends here*/
/* Relative layout which hold scroll view*/
RelativeLayout objRLScrollView = new RelativeLayout(this);
objRLScrollView.setId(1005);
objRLScrollView.setBackgroundColor(Color.parseColor("#d8e4f3"));
objRLScrollView.setGravity(Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL);
RelativeLayout.LayoutParams objRLScrollViewParams = new RelativeLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
objRLScrollViewParams.addRule(RelativeLayout.BELOW ,objTVSelectedAction.getId());
ScrollView objScrollView=new ScrollView(this);
objScrollView.setLayoutParams(new ViewGroup.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
objScrollView.setFillViewport(true);
/* contents */
RelativeLayout objRLContent = new RelativeLayout(this);
objRLContent.setId(1006);
objRLContent.setBackgroundColor(Color.parseColor("#d8e4f3"));
objRLContent.setGravity(Gravity.CENTER_VERTICAL|Gravity.CENTER_HORIZONTAL);
RelativeLayout.LayoutParams objRLContentParams = new RelativeLayout.LayoutParams( LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT);
// objRLContentParams.addRule(RelativeLayout.BELOW ,objTVSelectedAction.getId());
objRLContent.setLayoutParams(objRLContentParams);
/* adding layouts containing Edittext (for testing scroll view) */
RelativeLayout rl2= addEditText(objRLContent,null,1);
RelativeLayout rl3= addEditText(objRLContent,rl2,2);
RelativeLayout rl4= addEditText(objRLContent,rl3,3);
RelativeLayout rl5= addEditText(objRLContent,rl4,4);
RelativeLayout rl6= addEditText(objRLContent,rl5,5);
RelativeLayout rl7= addEditText(objRLContent,rl6,6);
RelativeLayout rl8= addEditText(objRLContent,rl7,7);
RelativeLayout rl9= addEditText(objRLContent,rl8,8);
RelativeLayout rl10= addEditText(objRLContent,rl9,9);
RelativeLayout rl11= addEditText(objRLContent,rl10,10);
RelativeLayout rl12= addEditText(objRLContent,rl11,11);
RelativeLayout rl13= addEditText(objRLContent,rl12,12);
objScrollView.addView(objRLContent); // adding contents to scroll view
objRLScrollView.addView(objScrollView); // Adding scroll view to a relative layout
objRLBody.addView(objRLScrollView); // adding relative layout to body layout
// adding footer to body
RelativeLayout objRLFooter=new RelativeLayout(this);
RelativeLayout.LayoutParams objRLFooterParams=new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,25);
objRLFooterParams.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM,objRLBody.getId());
objRLFooter.setLayoutParams(objRLFooterParams);
objRLFooter.setBackgroundColor(Color.parseColor("#2e4862"));
objRLFooter.setGravity(Gravity.CENTER);
objRLBody.addView(objRLFooter);
this.setContentView(objRLBody);
}
private RelativeLayout addEditText(RelativeLayout objRLContent,RelativeLayout layoutAbove,int i ) {
RelativeLayout objRLEditText = new RelativeLayout(this);
objRLEditText.setId(1100+i);
RelativeLayout.LayoutParams objRLEditTextParams = new RelativeLayout.LayoutParams( LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
if(layoutAbove!=null)
objRLEditTextParams.addRule(RelativeLayout.BELOW,layoutAbove.getId());
objRLEditText.setLayoutParams(objRLEditTextParams);
objRLEditText.setPadding(8, 2, 8, 2);
EditText objETData = new EditText(this);
objETData.setId(1300+i);
RelativeLayout.LayoutParams objETDataParams=new RelativeLayout.LayoutParams(200,LayoutParams.WRAP_CONTENT);
objETData.setLayoutParams(objETDataParams);
objETData.setPadding(8, 0, 8, 0);
objETData.setTextSize(TypedValue.COMPLEX_UNIT_DIP,18);
objETData.setText(""+i);
objETData.setSingleLine(true);
objRLEditText.addView(objETData);
objRLContent.addView(objRLEditText);
return objRLEditText;
}
}
and the above code gives out put as shown below
![enter image description here][2]
[1]: http://i.stack.imgur.com/H5Zz4.png
[2]: http://i.stack.imgur.com/svmnm.png
The header layouts becomes invisible due to the presence of scrollView. What is wrong with my code? what should i do to get a layout with scrollable contents with fixed header and footer? plz help. | 0 | [
2,
13005,
12159,
4725,
16615,
572,
4543,
9106,
800,
3726,
3726,
19,
51,
13005,
4865,
31,
376,
21,
9106,
28,
1721,
1021,
13,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
165,
500,
21,
4543,
9106,
25,
147,
28,
14,
4766,
9106,
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... |
How to force lifecycle from onPause to onResume
===
I am trying to force my Android application to go from the onPause method directly to the onResume method by using a dialog.
I have the following code in the onClick method in my FirstActivity class which implements OnClickListener:
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.newlayout);
dialog.setTitle("This is my custom dialog box");
dialog.setCancelable(true);
dialog.show();
I've set up each lifecycle method to print out a log message when the Android app enters each method:
Log.i(ActivityName, " onCreate");
Log.i(ActivityName, " onPause");
Log.i(ActivityName, " onResume");
And so on..
When I click my button to show the dialog, the dialog shows up just fine, but I do not receive any log messages that the onPause is being called when showing the dialog and I'm not receiving any log messages that the onResume method is being called when pushing the "back" button on my phone to exit the dialog.
What am I doing wrong? | 0 | [
2,
184,
20,
558,
201,
12467,
37,
27,
1060,
3699,
20,
27,
99,
18,
9472,
800,
3726,
3726,
31,
589,
749,
20,
558,
51,
13005,
3010,
20,
162,
37,
14,
27,
1060,
3699,
2109,
1703,
20,
14,
27,
99,
18,
9472,
2109,
34,
568,
21,
28223,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 data from user control since Webpage
===
I have a simple question in asp.net.
I want to know if it is possible to get data from an user control directly since the page containing it. I want to do it without using Session variable,Viewstate ...
Thank you for your help,
Quentin | 0 | [
2,
164,
1054,
37,
4155,
569,
179,
2741,
6486,
800,
3726,
3726,
31,
57,
21,
1935,
1301,
19,
28,
306,
9,
2328,
9,
31,
259,
20,
143,
100,
32,
25,
938,
20,
164,
1054,
37,
40,
4155,
569,
1703,
179,
14,
2478,
3503,
32,
9,
31,
259,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
The content type text/plain of the response message does not match the content type of the binding (text/xml; charset=utf-8)
===
When I connect to a web service written in Apche Axis, I get the following error:
The content type text/plain of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were: '
The app.comfig endpoint configuration is :
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="XXXSoapBinding" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://www.XXX.net/services/XXXConnect"
binding="wsHttpBinding" bindingConfiguration="XXXSoapBinding"
contract="XXX.XXXConnect" name="XXXConnect" />
</client>
</system.serviceModel> | 0 | [
2,
14,
2331,
1001,
1854,
118,
9897,
108,
16,
14,
1627,
2802,
630,
52,
730,
14,
2331,
1001,
16,
14,
8728,
13,
5,
11969,
118,
396,
8184,
73,
4892,
3554,
3726,
1982,
410,
8,
457,
6,
800,
3726,
3726,
76,
31,
6379,
20,
21,
2741,
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... |
Ajax Autocomplete
===
Please help me on this.. i am facing problem with auto complete
Some problem with div class="ausu-suggest.. Or can you please code this in a simple format.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MWH Request</title>
<link href="css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="css/main.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.ausu-autosuggest.min.js"></script>
<script type="text/javascript" src="js/jquery.autocomplete.pack.js"></script>
<script type="text/javascript" src="js/script.js"></script>
<script>
$(document).ready(function() {
$.fn.autosugguest({
className: 'ausu-suggest',
methodType: 'POST',
minChars: 2,
rtnIDs: true,
dataFile: 'data.php'
});
});
</script>
</head>
<body>
<div class="container">
<p> <form name="form" method="post" action="insert_ac.php"> </p>
<p><label>Location:</label> <input id="location" name="location" type="text" autocomplete="off"></p>
<p><label>Date:</label> <input id="date" name="date" type="text" autocomplete="off"></p>
<p><label>Listner Name:</label> <input id="listner_name" name="listner_name" type="text" autocomplete="off"></p>
<p><label>RJ Name:</label> <input id="rj_name" name="rj_name" type="text" autocomplete="off"></p>
<p><label>Channel:</label> <input id="channel" name="channel" type="text" autocomplete="off"></p>
<p><label>Show Name:</label> <input id="show_name" name="show_name" type="text" autocomplete="off"></p>
<div class="ausu-suggest"><input type="text" name="countries" id="countries" autocomplete="off"/>
<input name="countriesID" type="text" id="countriesid" value="" readonly="readonly" autocomplete="off" /></div></label>
<td colspan"3" align="center"><input type="submit" name="submit" value="Submit"></td>
</form>
</div>
<footer>
<h1>/h1>
</footer>
</body>
</html>
| 0 | [
2,
20624,
3108,
15990,
800,
3726,
3726,
2247,
448,
55,
27,
48,
9,
9,
31,
589,
4325,
1448,
29,
3108,
1279,
109,
1448,
29,
13,
12916,
718,
3726,
7,
1346,
1666,
8,
18,
21606,
1430,
9,
9,
54,
92,
42,
2247,
1797,
48,
19,
21,
1935,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
pubnub test application crashes: NoClassDefFound
===
this is a copy of my question on Pubnub support page:
Hi all, I tried running the PubnubTestApp that is downloadable with the Pubnub API from your git repo.
but when I try and start the test app i firstly get a build path error because apparently you (pubnub guys) have configured the project to look for 2 jar files that don't exist. (bcprov-jdk16-145.jar and commons-codec-1.2.jar).
after I removed those 2 references the project showed no error. but when I tried running it, it crashed again with this error:
"07-04 12:29:11.782: E/AndroidRuntime(754): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.fbt/com.fbt.PubNubTestActivity}: java.lang.ClassNotFoundException: com.fbt.PubNubTestActivity in loader dalvik.system.PathClassLoader[/data/app/com.fbt-1.apk"
after looking over the internet for the reasons for this crash, I noticed that in the manifest.xml file in the project there is a mistake in the name of the activity name. (it's named ".PubNubTestActivity" instead of ".PubnubTestActivity").
after changing the manifest, everything works and the app will install and run but there a a few problems still.
when pressing the "publish" button or the "history" button the app crashes and dies automatically. also it crashed without any clicking of anything (just like that).
here are the crash reports I got from the emulator.
http://pastie.org/private/pojnpnxmznvn9azdg7uyg
apparently the project doesn't recognize the "pubnub.crypto" jar file even though I (and you) added it to the build path and made sure it's in the project.
please let me know how to fix this so I can use (at last) pubnub in my app. | 0 | [
2,
6329,
103,
4502,
1289,
3010,
21563,
45,
90,
1898,
13862,
12235,
800,
3726,
3726,
48,
25,
21,
4344,
16,
51,
1301,
27,
6329,
103,
4502,
555,
2478,
45,
4148,
65,
15,
31,
794,
946,
14,
6329,
103,
4502,
10543,
7753,
30,
25,
27795,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
to perform addition operation on forloop.counter in django template
===
I want to perform reduce the value of forloop.counter in django template for the given condition, is it possible in django.
Below is demonstrated the example
{% for i in item %}
{% if forloop.counter0|divisibleby:4 %}
Start
{% endif %}
{% if i %}
item{{ forloop.counter }}
{% else %}
######### Here I want to reduce value of forloop.counter by 1 ###########
{% endif %}
{% if forloop.counter|divisibleby:4 %}
End
{% endif %}
{% endfor %}
In above code for 8 perfect item output will be
Start
item1
item2
item3
item4
End
Start
item5
item6
item7
item8
End
but suppose item2 is None, then output is
Start
item1
item3
item4
End
Start
item5
item6
item7
item8
End
I want to print it in form of proper ascending order by reducing value of forloop each time if condition is not satisfied
| 0 | [
2,
20,
2985,
848,
1453,
27,
26,
18786,
9,
24416,
19,
3857,
14541,
22894,
800,
3726,
3726,
31,
259,
20,
2985,
4136,
14,
1923,
16,
26,
18786,
9,
24416,
19,
3857,
14541,
22894,
26,
14,
504,
2874,
15,
25,
32,
938,
19,
3857,
14541,
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... |
Interface in Mvc Project, Implementing in Data Project - circular reference?
===
i'm developing an mvc application just to practise some best practises (trying to do everything the 'correct' way). To be more precise, I thought of building an Mvc Application with some ajax endpoints for a chat service.
I wanted to have that one a little more flexible, so I thought of using `interfaces` to define the structure of used objects. Those interfaces should then be implemented by the DataLayer Project.
Now I wanted to define those interfaces in the Mvc-Project and put the datalayer stuff in a seperate project. This would lead to a circular reference though, which I thought of as bad practise.
What is the 'correct' way to solve this issue? Is my approach reasonable?
Some code to show what I want to achive:
Mvc Project:
public interface IChatUser
{
Guid UserID { get; }
string Name { get; }
}
Datalayer Project (part of class):
public class User : IChatUser
{
private Guid _userID;
public Guid UserID
{
get
{
return _userID;
}
}
public string Name
{
get
{
return this.LastName + " ," + this.FirstName;
}
}
} | 0 | [
2,
6573,
19,
307,
8990,
669,
15,
17333,
19,
1054,
669,
13,
8,
8155,
2801,
60,
800,
3726,
3726,
31,
22,
79,
3561,
40,
307,
8990,
3010,
114,
20,
27954,
109,
246,
27954,
18,
13,
5,
5840,
68,
20,
107,
796,
14,
13,
22,
25345,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Spring JDBC connection without dataSource
===
I had read several articles on obtaining Connection using Spring DataSource.
But in our Company Setup, connection object is obtained through already configured environment. Following the sample code:
String pool = PropertyFileReader.getPropertyValue("database.properties", "development.connectionPool");
Connection connection = RequestUtils.getConnection(pool);
Hence, After reading this [tutorial][1]
I am confused on using JDBCTemplate using connection object from above code.
[1]: http://www.youtube.com/watch?v=0LYqy0wvS20&feature=relmfu | 0 | [
2,
1573,
487,
43,
7229,
2760,
366,
1054,
12097,
800,
3726,
3726,
31,
41,
1302,
238,
3376,
27,
12114,
2760,
568,
1573,
1054,
12097,
9,
47,
19,
318,
237,
18161,
15,
2760,
3095,
25,
3048,
120,
614,
28895,
2307,
9,
249,
14,
5717,
1797... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Excel Formula with sumproduct & styear
===
I'm trying to figure out what this formula does, I've read what sumproduct does but what does styear, stmonth, etc do?
=SUMPRODUCT(--(styear=Data!AA$14),--(stmonth=Data!AA$12),--(starea='MTD Sales - Sales Teams'!C9),sthl)+SUMPRODUCT(--(stdyear2=Data!AA$14),--(stdmonth2=Data!AA$12),--(stdarea=C9),stdhl) | 0 | [
2,
20700,
3729,
29,
3907,
14086,
279,
354,
731,
800,
3726,
3726,
31,
22,
79,
749,
20,
1465,
70,
98,
48,
3729,
630,
15,
31,
22,
195,
1302,
98,
3907,
14086,
630,
47,
98,
630,
354,
731,
15,
354,
6444,
15,
2722,
107,
60,
800,
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... |
SSRS Create development environment from Live server
===
I've inherited a live SSRS server and have been asked to amend a lot of reports that are on there.
Is there a quick way I can "export" all of the reports/data sources to a local instance so I can develop against it using BIDS?
e.g. Can I copy the ReportServer database from Production?
What else would I need to do?
I'd like to be able to have a Development copy of everything, with DataSources pointing to copies of the production databases but with the same names. Therefore I could re-write the report and re-define any SP's required locally, and then just deploy the new RDL to the server along with the ALTER SP scripts.
Is that possible or even sensible!? | 0 | [
2,
22118,
18,
1600,
522,
2307,
37,
515,
8128,
800,
3726,
3726,
31,
22,
195,
7179,
21,
515,
22118,
18,
8128,
17,
57,
74,
411,
20,
19247,
21,
865,
16,
2813,
30,
50,
27,
80,
9,
25,
80,
21,
2231,
161,
31,
92,
13,
7,
1706,
1993,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Encode data into user-typed code, like an old game's password-save system
===
I tried searching for information on this, but must not know the right terms to use...
What would be the simplest way to store information in a human-readable and -writeable passcode, with enough padding to make randomly guessed codes unlikely to be valid? Not unlike 8-bit console games' password-save systems.
In my particular case, I'd like to be able to encode three unsigned integers (with a maximum length of probably about 20 bits each) into a passcode under Java 1.4.2, and decrypt them on a web server. I was thinking about also adding a random or date-based value in an attempt to make passcodes unique.
The code could use numbers, mixed-case letters and potentially some simple symbols, but should probably exclude easily-confused characters like 1lI and O0. Since the user needs to type it, obviously shorter is better.
Thanks! | 0 | [
2,
20523,
1054,
77,
4155,
8,
4474,
43,
1797,
15,
101,
40,
315,
250,
22,
18,
20884,
8,
19863,
329,
800,
3726,
3726,
31,
794,
5792,
26,
676,
27,
48,
15,
47,
491,
52,
143,
14,
193,
1663,
20,
275,
9,
9,
9,
98,
83,
44,
14,
2438... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Windows Azure cspack.exe open source?
===
I'm trying to pack my Java Azure project in Mac and I cannot find the source code for cspack.exe. So far, I've managed to run Azure Eclipse plugin and successfully created a project but when trying to deploy it cannot run cspack.exe.
I've downloaded Windows Azure Tools and seen CsPack.cs up to the following lines
// Run CsPack to generate the package
ProcessHelper.StartAndWaitForProcess(
new ProcessStartInfo(Path.Combine(AzureSdkBinDirectory, Resources.CsPackExe),
args), out standardOutput, out standardError);
And I don't really know if this component it's open source or not.
If cspack.exe is proprietary, is there any way to simulate cspack.exe. I know it compresses the project to a zip file but I could use any documentation. | 0 | [
2,
25,
1936,
25715,
272,
18,
8573,
9,
1706,
62,
368,
1267,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
3607,
51,
8247,
25715,
669,
19,
1572,
17,
31,
1967,
477,
14,
1267,
1797,
26,
272,
18,
8573,
9,
1706,
62,
9,
86,
463,
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... |
django - Filter foreign key against object
===
class Blog(models.Model):
name = models.CharField(max_length=100)
class Entry(models.Model):
blog = models.ForeignKey(Blog)
headline = models.CharField(max_length=255)
Is the following query correct?
a = Blog.objects.get(id__exact=14)
b = Entry.objects.filter(blog = a)
I comprehend that that any of the following methods are more elegant and even recommended.
Entry.objects.filter(blog__id__exact=3) # Explicit form
Entry.objects.filter(blog__id=3) # __exact is implied
Entry.objects.filter(blog__pk=3) # __pk implies __id__exact
In other words, can I pass an object (model instance) as an argument value?
Please also provide some guidance on where can find explicit documentation on this?
| 0 | [
2,
3857,
14541,
13,
8,
11945,
1228,
1246,
149,
3095,
800,
3726,
3726,
718,
8146,
5,
13998,
18,
9,
13998,
6,
45,
204,
800,
2761,
9,
5433,
1109,
5,
8304,
1,
6325,
3726,
4031,
6,
718,
2792,
5,
13998,
18,
9,
13998,
6,
45,
8146,
80... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Dynamically Add listbox Item to an ObservableCollection
===
I have a listbox that I have bound to an Observable collection. At runtime I would like the user to click a button and add thier own custom ID and Name to the listbox.
How do I do that when the listbox is already bound to an Observable collection?
THank you | 0 | [
2,
7782,
1326,
3547,
968,
5309,
9101,
20,
40,
5122,
10321,
579,
15015,
872,
800,
3726,
3726,
31,
57,
21,
968,
5309,
30,
31,
57,
4138,
20,
40,
5122,
10321,
579,
1206,
9,
35,
485,
891,
31,
83,
101,
14,
4155,
20,
10840,
21,
5167,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 Pagetab Request Dialogue Notification Shows and Goes
===
I am using request dialogue in facebook page tab. It shows the multifriend selector dialogue and once I sent the request, the user gets the notification and disappears after a while. and It never exists in the notification.
Here's the code:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:fb="https://www.facebook.com/2008/fbml">
<head>
<title>Request Example</title>
</head>
<body>
<div id="fb-root"></div>
<p>
<input type="button"
onclick="sendRequestToRecipients(); return false;"
value="Send Request to Users Directly" />
<input type="text" value="User ID" name="user_ids" />
</p>
<p>
<input type="button"
onclick="sendRequestViaMultiFriendSelector(); return false;"
value="Send Request to Many Users with MFS" />
</p>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : xxxx,
status : true,
cookie : true,
xfbml : true,
oauth : true,
});
};
(function(d){
var js, id = 'facebook-jssdk';
if (d.getElementById(id)) {
return;
}
js = d.createElement('script');
js.id = id;
js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
d.getElementsByTagName('head')[0].appendChild(js);
}(document));
</script>
<script>
function sendRequestToRecipients() {
var user_ids = document.getElementsByName("user_ids")[0].value;
FB.ui({method: 'apprequests',
message: 'My Great Request',
to: user_ids,
}, requestCallback);
}
function sendRequestViaMultiFriendSelector() {
FB.ui({method: 'apprequests',
message: 'My Great Request'
}, requestCallback);
}
function requestCallback(response) {
// Handle callback here
}
</script>
</body>
</html> | 0 | [
2,
9090,
2478,
15783,
3772,
6402,
52,
4634,
1285,
17,
1852,
800,
3726,
3726,
31,
589,
568,
3772,
6402,
19,
9090,
2478,
6523,
9,
32,
1285,
14,
1889,
12299,
23946,
6402,
17,
382,
31,
795,
14,
3772,
15,
14,
4155,
3049,
14,
52,
4634,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 make sure that strtol() have successfully?
===
[`according documentation:`][1]
> On success, the function returns the converted integral number as a
> long int value. If no valid conversion could be performed, a zero
> value is returned. If the correct value is out of the range of
> representable values, LONG_MAX or LONG_MIN is returned, and the global
> variable errno is set to ERANGE.
Consider `strtol(str, (char**)NULL, 10);` if `str` is `"0\0"` how to knox if the functions fails or only has converted the string with `"0"` number?
[1]: http://www.kernel.org/doc/man-pages/online/pages/man3/strtol.3.html | 0 | [
2,
184,
107,
31,
233,
562,
30,
13,
9729,
13741,
5,
6,
57,
3673,
60,
800,
3726,
3726,
636,
1,
18821,
13945,
45,
1,
500,
2558,
165,
500,
13,
1,
27,
1280,
15,
14,
1990,
4815,
14,
3494,
9315,
234,
28,
21,
13,
1,
175,
19,
38,
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... |
jQuery CSS styling stays the same even if the link is not the current one
===
I found this jQuery code on a forum: http://jsfiddle.net/nZLpk/8/
However, if I change the code to this http://jsfiddle.net/c5LTj/ (modifying ` $(this).css({'font-weight': 'bold', 'border-left': '5px solid #555554'});` the border will stay on the link even if that is not the selected one... Please help. Thanks! | 0 | [
2,
487,
8190,
93,
272,
18,
18,
23020,
16192,
14,
205,
166,
100,
14,
3508,
25,
52,
14,
866,
53,
800,
3726,
3726,
31,
216,
48,
487,
8190,
93,
1797,
27,
21,
5691,
45,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
118,
5652,
5478,
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... |
(Java) Code to display an image won't work with different java editors (Need help please!)
===
I need your help!
I am switching to netbeans and have been having some major problems.
After about 6 hours I finally figured out how to get the image to show in netbeans.
Is there a way to write the code where it will work in JGrasp and netbeans?
The working code for netbeans is
menuPic = new javax.swing.JButton();
menuPic.setIcon(new javax.swing.ImageIcon(getClass().getResource("image/w2.png")));
and the working code for JGrasp is
menuPic = new JButton();
ImageIcon bottompic = new ImageIcon("image/w2.png");
JButton menuPic = new JButton(bottompic);
I hate JGrasp but thats what my teacher uses to grade, so I want to be able to write it in netbeans and copy and paste the code to JGrasp and it be able to work.
Any help would be greatly appreciated!! | 0 | [
2,
13,
5,
1004,
1385,
6,
1797,
20,
3042,
40,
1961,
230,
22,
38,
170,
29,
421,
8247,
12149,
13,
5,
556,
69,
448,
2247,
187,
6,
800,
3726,
3726,
31,
376,
154,
448,
187,
31,
589,
13027,
20,
4275,
863,
5950,
17,
57,
74,
452,
109... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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# MVC: How extract values from XML and pass to view
===
I have a C# MVC application which I need to output the following data to a view:
<versions>
<product>true</product>
<type>city</type>
<factory name="Demme" url="http://test1.com" thumbnail="http://test3.com/img1" interval="10" />
<factory name="Vollick" url="http://test2.com" thumbnail="http://test3.com/img1" interval="10" />
<factory name="Tony" url="http://test3.com" thumbnail="http://test3.com/img1" interval="10" />
</versions>
The above data comes from a SQL table/column which stores the data as a XML data type.
Can somone give me a code example to extract the values of the elements(maybe assign each value to variable) so I can pass it to a view?
So I need to get the values "true" , "City", "Demme" , "http://test1.com", "http://test3.com/img1....and so on.
Whats the best way to present this data to a view? | 0 | [
2,
272,
5910,
307,
8990,
45,
184,
10962,
4070,
37,
23504,
17,
1477,
20,
1418,
800,
3726,
3726,
31,
57,
21,
272,
5910,
307,
8990,
3010,
56,
31,
376,
20,
5196,
14,
249,
1054,
20,
21,
1418,
45,
13,
1,
10898,
18,
1,
13,
1,
14086,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 omniauth-facebook gem to get long lived access token?
===
I'm using the omniauth-facebook gem in a rails app. I'm aware of how to receive a long lived access token via the details here: https://developers.facebook.com/roadmap/offline-access-removal/, but I'm wondering if there's a simple omniauth way of receiving that as supposed to getting the original token with omniauth, then passing it again to Facebook via httparty. | 0 | [
2,
568,
14677,
1346,
96,
8,
6413,
5199,
8551,
20,
164,
175,
1269,
1381,
20,
2853,
60,
800,
3726,
3726,
31,
22,
79,
568,
14,
14677,
1346,
96,
8,
6413,
5199,
8551,
19,
21,
2240,
18,
4865,
9,
31,
22,
79,
3854,
16,
184,
20,
2588,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 get POJOs from couchdb through lightcouch
===
ublicwith
List<User> users = client.view("user-fn/by-group").key(group).query(User.class);
where client is a couchdb client,
user-fn is the design document,
by-group is the view,
...
"by-group": {
"map": "function(doc) {\n if (doc.group) {\n emit(doc.group, doc);\n }\n}\n"
...
I get the correct number of user objects in the list, but all user fields are null.
Must the user pojo be in bean pattern (with getters and setters), or can it have just public fields? | 0 | [
2,
184,
20,
164,
2353,
1636,
18,
37,
4914,
9007,
120,
471,
716,
6396,
800,
3726,
3726,
13,
4502,
4663,
1410,
968,
1,
16704,
1,
3878,
800,
6819,
9,
4725,
5,
7,
16704,
8,
19035,
118,
779,
8,
8024,
7,
6,
9,
4237,
5,
8024,
6,
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... |
Use of <portlet:namespace> with Spring Form tag library
===
We are developing a portlet using the Spring Portlet MVC.
Within our JSPs, we are trying to use the <portlet:namespace> tag to ensure that IDs are unique to a specific instance of the portlet. However, if we try to use the <portlet:namespace> tag within a Spring Form tag, the <portlet:namespace> tag is not recognised and is treated as text. The <portlet:namespace> tag works fine with 'ordinary' html tags
e.g. for an ordinary html input field, the following JSP code will generate an input element with the id prefixed with the portlet namespace (such as "specificnamespacefield1")
<input id="<portlet:namespace/>field1">
For a Spring form input field, the following JSP code does not recognise that the portlet namespace and will generate an input element with an id of "<portlet:namespace/>field1"
<form:input id="<portlet:namespace/>field1">
Does anyone know how to prefix a Spring form tag id with a portlet namespace? | 0 | [
2,
275,
16,
13,
1,
1993,
1336,
45,
7259,
5582,
1,
29,
1573,
505,
3383,
1248,
800,
3726,
3726,
95,
50,
3561,
21,
1295,
1336,
568,
14,
1573,
1295,
1336,
307,
8990,
9,
363,
318,
487,
18,
1919,
15,
95,
50,
749,
20,
275,
14,
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... |
MySQL: How to index my table to optimize this query?
===
My table contains history of values relating to objects, it looks like:
create table History (
object_id bigint NOT NULL,
value int NOT NULL,
date bigint NOT NULL
);
How can I index it to optimize following query:
select * from History
where object_id = ? and date < ?
order by date desc
limit ?
| 0 | [
2,
51,
18,
22402,
45,
184,
20,
4348,
51,
859,
20,
22864,
48,
25597,
60,
800,
3726,
3726,
51,
859,
1588,
447,
16,
4070,
8456,
20,
3916,
15,
32,
1879,
101,
45,
1600,
859,
447,
13,
5,
3095,
1,
1340,
580,
6391,
52,
16203,
15,
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... |
Saving List<KeyValuePair<int,string> to a DB with EF 4.3
===
I have an information that is related to my logical entity class, that is stored as a `List<KeyValuePair<int,string>>`.
How do I reflect this in my EF code first entities classes to correctly save this data into a database? | 0 | [
2,
7599,
968,
1,
4237,
15165,
306,
2642,
1,
6391,
15,
11130,
1,
20,
21,
13,
9007,
29,
11599,
268,
9,
240,
800,
3726,
3726,
31,
57,
40,
676,
30,
25,
1597,
20,
51,
11545,
9252,
718,
15,
30,
25,
8214,
28,
21,
13,
1,
5739,
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... |
Linkedin API - xml - request
===
ok i have finally managed to get my linkedin api code working, however when i return my profile details, i get numbers appear with the results, almost as if they are identifiers etc. Also it is returned in one long list, is there a way i can break the list down and return just the results and no other info like the numbers i mentioned.
Code here:
$xml_response = $linkedin->getProfile("~:(id,first-name,last- name,headline,picture- url,industry,summary,skills,interests,positions,certifications,educations,three-past-positions,phone-numbers,primary-twitter-account,member-url-resources)");
Thanks | 0 | [
2,
4727,
108,
21,
2159,
13,
8,
23504,
13,
8,
3772,
800,
3726,
3726,
5854,
31,
57,
722,
1471,
20,
164,
51,
4727,
108,
21,
2159,
1797,
638,
15,
207,
76,
31,
788,
51,
5296,
3289,
15,
31,
164,
2116,
1893,
29,
14,
1736,
15,
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... |
OCaml Mascot can't find modules from .mli files
===
Given the following source files:
(* /tmp/src/A.mli *)
val f : B.t -> B.t
----
(* /tmp/src/A.ml *)
let f (x : B.t) = x
----
(* /tmp/src/B.mli *)
type t
----
(* /tmp/src/B.ml *)
type t = int
I tried running the [mascot](http://mascot.x9c.fr/examples.html) code checker but it can't bind modules referenced from `.mli` files despite the `-I` flag. It resolves bindings from `.ml` files just fine.
`$ mascot.native -config mascot.cfg -I /tmp/src /tmp/src/{A,B}.{ml,mli} -html /tmp/out`<br>
**`File "/tmp/src/A.mli", line 2, characters 8-11:`**<br>
**`Error: Unbound module B`**<br>
`loading configuration files...`<br>
`configuring checks...`<br>
`analyzing dependencies...`<br>
`running checks...`<br>
`reporting to "/tmp/out" with output "html"...`
It resolves bindings from `.ml` files just fine.
$ mascot.native -config mascot.cfg -I /tmp/src /tmp/src/{A,B}.ml -html /tmp/out
loading configuration files...
configuring checks...
analyzing dependencies...
running checks...
reporting to "/tmp/out" with output "html"...
I can't find anything in the [manual](http://mascot.x9c.fr/distrib/mascot.pdf) which explains *files-to-analyze* but I believe Mascot is supposed to be run on interface files because the [examples](http://mascot.x9c.fr/examples.html) page includes examples of documentation problems:
> (** Module descriptoion. *)
>
> type t
> (* This one is not actually documented
> (bare comment instead of ocamldoc one). *)
and interface checks don't seem to be run when I only supply source files. | 0 | [
2,
13,
14977,
8184,
13652,
92,
22,
38,
477,
17113,
37,
13,
9,
79,
1210,
6488,
800,
3726,
3726,
504,
14,
249,
1267,
6488,
45,
13,
5,
2483,
13,
118,
38,
2554,
118,
18,
5453,
118,
58,
9,
79,
1210,
1637,
6,
3347,
398,
13,
45,
33... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Parse characters in SQL Server 2008
===
I have a SQL column with name txt_Full_Path which has data as given below
E:/My_Users//kpa1/eOReport - VSD.mrk
E:/My_Users//krishr9/Report.mrk
E:/My_Users//kristc/AllPAS.mrk
E:/My_Users//kukerm/v1.mrk
E:/My_Users//ksnedike/abcdef.mrk
how do I get the value after first occurrence of '//' moving from left to right?
so that I get these values in a new column.
kpa1
krishr9
kristc
kukerm
ksnedike | 0 | [
2,
2017,
870,
1766,
19,
4444,
255,
8128,
570,
800,
3726,
3726,
31,
57,
21,
4444,
255,
4698,
29,
204,
20225,
38,
1,
13727,
1,
8353,
56,
63,
1054,
28,
504,
1021,
13,
62,
45,
118,
915,
1,
16704,
18,
118,
118,
197,
1060,
8197,
389... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Iterator over references to class members, simple and preferably reusable
===
Please consider the following boilerplate class fragment:
class ObjectA : public BaseObject
{
DerivedMemberA a, a2, a3;
DerivedMemberB b, b2;
DerivedMemberC c, c2;
// ...
};
The `DerivedMember*` types are derived from a common `BaseMember` class, and `ObjectA` (and similar `ObjectB`, `ObjectC`...) would be derived from `BaseObject`.
Now I'd like to implement an iterator which would be in public `BaseObject` interface, and which would iterate over references to members of the derived classes (as `BaseMember&`).
In other words, the use would be like:
BaseObject& b = someObject;
for (BaseObject::iterator it = b.begin(); it != b.end(); ++it)
{
BaseMember& m = *it;
// ...
}
which called on `ObjectA` would iterate over `a`, `a2`...
What is the best way to solve this? Preferably avoiding subclassing the iterator as well. Is there any ready iterator class or template which could be reused there?
I was thinking of implementing a virtual member function which would take numerical 'index' of a variable and using a `switch` to return the appropriate reference; then calling that member from index-keeping iterator. | 0 | [
2,
32,
106,
3457,
84,
7231,
20,
718,
443,
15,
1935,
17,
6369,
4801,
302,
267,
579,
800,
3726,
3726,
2247,
3563,
14,
249,
11755,
13095,
718,
14847,
45,
718,
3095,
58,
13,
45,
317,
1000,
23793,
13,
1,
3981,
6990,
58,
21,
15,
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... |
java - using elements from returned array
===
get1() method returns an array. I do get the output but the value from get1() is [D@addbf1
My question is there any way to directly use the returned array to get the values in inf1[0] and inf1[1] and show it in the output statement?
I am aware of other ways of showing the output. But I want to know whether I can directly retireve elements of the returned array.
class vehicle{
double [] inf1 = new double[2];
void set(double d, double s){
inf1[0]=d;
inf1[1]=s;
}
double[] get1(){
return inf1;
}
}
public class calc2{
public static void main(String args[]){
vehicle ob = new vehicle();
ob.set(56.24, 75);
System.out.println("The time taken to cover "+ob.get1());
}
} | 0 | [
2,
8247,
13,
8,
568,
2065,
37,
587,
7718,
800,
3726,
3726,
164,
165,
5,
6,
2109,
4815,
40,
7718,
9,
31,
107,
164,
14,
5196,
47,
14,
1923,
37,
164,
165,
5,
6,
25,
636,
43,
1,
14854,
12425,
165,
51,
1301,
25,
80,
186,
161,
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... |
Validate an XML file against an XSD schema using JDOM 2.0
===
I've been looking for an example on how to validate an XML file against an XSD schema using JDOM 2.0 before parsing it.
I've been searching for about an hour but wasn't able to find a solution which would work and **allow me to provide the path to the XSD file (located on the local file-system) from inside the application code, rather than as an attribute in the XML file**.
I am surprised that there is not an easily reachable sample snippet on the Internet already. I would be grateful if you could provide one here. | 0 | [
2,
7394,
1373,
40,
23504,
3893,
149,
40,
993,
18,
43,
23874,
568,
487,
5555,
172,
9,
387,
800,
3726,
3726,
31,
22,
195,
74,
699,
26,
40,
823,
27,
184,
20,
7394,
1373,
40,
23504,
3893,
149,
40,
993,
18,
43,
23874,
568,
487,
555... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Cant turn off sound player when new navigation controller is pushed
===
Im playing a audio that can be turned on and off with the following
IBAction //play audio
NSString* resourcePath = [[NSBundle mainBundle] resourcePath];
resourcePath = [resourcePath stringByAppendingString:@"/Apptrack.mp3"];
NSLog(@"Path to play: %@", resourcePath);
NSError* err;
//Initialize our player pointing to the path to our resource
player = [[AVAudioPlayer alloc] initWithContentsOfURL:
[NSURL fileURLWithPath:resourcePath] error:&err];
if( err ){
NSLog(@"Failed with reason: %@", [err localizedDescription]);
}
else{
//set our delegate and begin playback
player.delegate = self;
[player play];
player.numberOfLoops = -1; //(for continuous loop use -1, or any number for number of loops)
player.currentTime = 1;
player.volume = .5;
}
IBAction to turn off sound player: //stop audio
[player stop];
When I push to another view controler and come back again, the button no longer works to stop the audio and it constantly runs (the loop is about 3 mins long). So then I tried added this to the above code:
if ([self.player isPlaying] == YES) {
[self.player stop];
} else {
[self.player play];
}
Still nothing, maybe someone more experienced in programming could point my in the direction of what im doing wrong? | 0 | [
2,
2973,
805,
168,
646,
517,
76,
78,
8368,
9919,
25,
2007,
800,
3726,
3726,
797,
791,
21,
4023,
30,
92,
44,
412,
27,
17,
168,
29,
14,
249,
13,
4598,
8645,
12894,
5438,
4023,
13,
2172,
11130,
2483,
6577,
8353,
800,
636,
2558,
217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Need a complex sql query for a MySQL database
===
I have the following database. One user can write one or more posts. Votes is many-to-many.
A user writes a post. Anyone can vote for the post, and thus the vote is saved in the vote table.
I need to display all the posts on a page. On each post, the post's author, post_votes, and the votes of the author need to be displayed.
My tables are:
Table: user
id | user_name
1 | John
2 | Sam
3 | Susan
Table: post
id | post_title | user_id
1 | Hello | 1
2 | Sunday | 1
3 | Monday | 2
4 | Sun | 1
5 | Sun | 3
Table: votes
id | post_id
1 | 1
2 | 1
3 | 3
4 | 2
5 | 3
6 | 1
I need the query to return the following resultset:
post_id | post_votes | user_id | user_votes
1 | 3 | 1 | 4
2 | 1 | 1 | 4
3 | 2 | 2 | 2
4 | NULL | 1 | 4
5 | NULL | 3 | NULL
I tried all sorts of combinations, but my brain just won't work. Also, would be very thankful if there is a better way to design the database so that retrieving the above can be made easy. | 0 | [
2,
376,
21,
1502,
4444,
255,
25597,
26,
21,
51,
18,
22402,
6018,
800,
3726,
3726,
31,
57,
14,
249,
6018,
9,
53,
4155,
92,
2757,
53,
54,
91,
9868,
9,
2922,
25,
151,
8,
262,
8,
14842,
9,
21,
4155,
6215,
21,
678,
9,
1276,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 way to remove all local changesets to save space?
===
In other words, is there a way to revert an hg repository back to the state that existed when you first performed an hg clone against a foreign repository, and before you did a pull?
I am trying to save space when FTPing a server VM and the hg repositories exist elsewhere so there is no reason to transfer them. I would like to set the server up in such a way that all that has to be done on the other end is hg pull, hg update and it's ready to go again. | 0 | [
2,
25,
80,
21,
161,
20,
4681,
65,
375,
1693,
6095,
20,
2079,
726,
60,
800,
3726,
3726,
19,
89,
715,
15,
25,
80,
21,
161,
20,
24156,
40,
13,
18187,
24869,
97,
20,
14,
146,
30,
4589,
76,
42,
64,
986,
40,
13,
18187,
13871,
149,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 exact cause of the class cast exception in the next code?
===
public class Main {
public static void main(String[] args) {
List<Object[]> list = getIt();
// successful iteration
for (Object id : list) {
System.out.println(id);
}
// unsuccessful iteration, throws class cast exception
Iterator iterator = list.iterator();
while (iterator.hasNext()) {
System.out.println(iterator.next());
}
}
private static List<Object[]> getIt() {
List list = new ArrayList();
list.add(1L);
return list;
}
}
I understand at a rough estimate what happens(the iterator generated by the compiler contains an explicit cast), but would like some good answers, thanks. | 0 | [
2,
98,
22,
18,
14,
5340,
1679,
16,
14,
718,
1325,
5391,
19,
14,
328,
1797,
60,
800,
3726,
3726,
317,
718,
407,
13,
1,
317,
12038,
11364,
407,
5,
11130,
2558,
500,
13,
10663,
18,
6,
13,
1,
968,
1,
23793,
2558,
500,
1,
968,
80... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 disable user using multitouch on my web page?
===
I would like to disable multitouch on my mobile web site, so that they can't zoom it on Mobile Safari, how can I do so? Thank you. | 0 | [
2,
184,
20,
1460,
579,
4155,
568,
1889,
15725,
27,
51,
2741,
2478,
60,
800,
3726,
3726,
31,
83,
101,
20,
1460,
579,
1889,
15725,
27,
51,
3241,
2741,
689,
15,
86,
30,
59,
92,
22,
38,
19469,
32,
27,
3241,
25055,
15,
184,
92,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Is possible to insert a new item in the middle of a hash and have it reindex?
===
I have this as a hash :
>> params[:payments]
{"0"=>{":amount_paid"=>"100.00", ":date_paid"=>"2/20/2009"}}
{"1"=>{":amount_paid"=>"100.00", ":date_paid"=>"2/20/2009"}}
{"2"=>{":amount_paid"=>"100.00", ":date_paid"=>"2/20/2009"}}
Is it possible to make a new hash and insert it into a specific place ? For example, take this line :
{"2"=>{":amount_paid"=>"1.00", ":date_paid"=>"1/1/2006"}}
So that the hash will appear as this now :
{"0"=>{":amount_paid"=>"100.00", ":date_paid"=>"2/20/2009"}}
{"1"=>{":amount_paid"=>"1.00", ":date_paid"=>"1/1/2006"}} # <-- Newly inserted line
{"2"=>{":amount_paid"=>"100.00", ":date_paid"=>"2/20/2009"}}
{"3"=>{":amount_paid"=>"100.00", ":date_paid"=>"2/20/2009"}} | 0 | [
2,
25,
938,
20,
14692,
21,
78,
9101,
19,
14,
772,
16,
21,
19170,
17,
57,
32,
302,
25671,
60,
800,
3726,
3726,
31,
57,
48,
28,
21,
19170,
13,
45,
13,
1,
2258,
79,
18,
2558,
45,
12224,
6601,
500,
13,
1,
7,
387,
7,
3726,
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... |
Can I freely set members in php?
===
Can I freely assign something to non-existent or not-known-existent members in php? Is there any difference between member names and associative array index?
I there any difference beteween
$a = array();
$a['foo'] = 'something';
and
$a->foo = 'something';
If there is a difference, then how can I create "empty" object and add members dynamically to it?
| 0 | [
2,
92,
31,
11298,
309,
443,
19,
13,
26120,
60,
800,
3726,
3726,
92,
31,
11298,
13952,
301,
20,
538,
8,
20788,
54,
52,
8,
2929,
8,
20788,
443,
19,
13,
26120,
60,
25,
80,
186,
2841,
128,
322,
1817,
17,
28,
18,
16325,
3366,
7718,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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.java won't generate. Thoroughly searched for solution. Cleaning doesn't help, I have no errors in xml or res names
===
I am a new user to eclipse. Yesterday I walked away from my computer for lunch and when I got back my codes were filled with red lines. I discovered my R.java had been deleted after cleaning. I have spent several hours looking at solutions and nothing works. I tried cleaning, building, deleting gen folder, deleting debug file, starting a new project and putting my project files in that new project. I have no errors in xml and all of my res files are named correctly. When I start a new, blank project, the r.java is there until I usually try to reference something in the setContentView(R.layout.xxxx.); command. | 0 | [
2,
761,
9,
1004,
1385,
230,
22,
38,
7920,
9,
13632,
9036,
26,
4295,
9,
9724,
1437,
22,
38,
448,
15,
31,
57,
90,
11908,
19,
23504,
54,
10719,
1817,
800,
3726,
3726,
31,
589,
21,
78,
4155,
20,
11652,
9,
7124,
31,
1067,
229,
37,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 test if Android Live Wallpaper is doing what it's supposed to?
===
I'm trying to figure out a way to programmatically test if an Android live wallpaper is doing what it is supposed to.
We use Robotium on this project, but it doesn't work with services (and live wallpapers
are services), only with activities. I have tried creating an activity that launches a list with all live wallpapers, and tried to perform a click with Robotium in order to launch a preview, but that (surprisingly) does not work. I figured it would be useful if I could set a live wallpaper
programmatically, and then use the WallpaperManager to test the behaviour (this class can retrieve the current wallpaper), but this is apparently not possible (from what I've read elsewhere).
So far the only thing that I have managed to do is to write a test that starts the service and checks if it's running. When the live wallpaper service is started by this test I can only see it in the list of the services, but the wallpaper doesn't appear anywhere on the screen, and I don't seem to be able to retrieve any data about the service itself.
I'm really running out of ideas.
Is there any way, other than manually, that I can test if the live wallpaper is doing what
it's supposed to?
| 0 | [
2,
184,
20,
1289,
100,
13005,
515,
28129,
25,
845,
98,
32,
22,
18,
2293,
20,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1465,
70,
21,
161,
20,
625,
6732,
1326,
1289,
100,
40,
13005,
515,
28129,
25,
845,
98,
32,
25,
2293,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.