unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
AJAX/JS: Echoing value of a div without page refresh or button click
===
I am currently working with an wmd editor that i will later implement to my website. I have been able to get the value of the `#wmd-preview` div by changing the settings to `markdown` and adding a hidden input field. The issue is with the JS/AJAX function. When I type something in the text area I get the result echoed but when i go back and apply bold to the word it doesnt echo the change until i actually type something again.
How can i get the div value echoed when a font style change has been applied to a word without having to type again? Here is my [EXAMPLE][1]
<script>
$(document).ready(function() {
var timer = null;
var dataString;
function submitForm(){
$.ajax({ type: "POST",
url: "test1.php",
data: dataString,
success: function(result){
$('#wmd_result').html( $('#resultval', result).html());
}
});
return false;
}
$('#wmd-input').on('keyup click', function() {
clearTimeout(timer);
timer = setTimeout(submitForm, 1000);
var wmdVal = $("#wmd-preview").html();
dataString = 'wmdVal='+ wmdVal;
});
});
</script>
[1]: http://webprolearner.ueuo.com/dropdown-menu/test1.php
| 0 | [
2,
20624,
118,
728,
18,
45,
19810,
1923,
16,
21,
13,
12916,
366,
2478,
24905,
54,
5167,
10840,
800,
3726,
3726,
31,
589,
871,
638,
29,
40,
19312,
43,
1835,
30,
31,
129,
138,
8713,
20,
51,
2271,
9,
31,
57,
74,
777,
20,
164,
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... |
How to trace the domain controller interaction in a WCF call with integrated windows authentication
===
I have a self hosted NetTcp based WCF service with integrated Windows authentication.
I would like to trace the time that this service is spending interacting with the domain controller for authentication.
Is this possible via the standard WCF tracing (and if so can someone walk me through how to interpret the results in the trace viewer)
If the standard trace doesn't provide this, is there some mechanism to customize my binding to allow this tracing?
| 0 | [
2,
184,
20,
5565,
14,
4603,
9919,
7754,
19,
21,
11801,
410,
645,
29,
5547,
1936,
27963,
800,
3726,
3726,
31,
57,
21,
1119,
2812,
13,
11874,
7439,
432,
11801,
410,
365,
29,
5547,
1936,
27963,
9,
31,
83,
101,
20,
5565,
14,
85,
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... |
Get URL parameter in java
===
I have a url and i need to get the value of v.
Here is my url. http://www.youtube.com/watch?v=_RCIP6OrQrE Guys send me some feed back.Any help highly appreciated.. | 0 | [
2,
164,
287,
6362,
18906,
19,
8247,
800,
3726,
3726,
31,
57,
21,
287,
6362,
17,
31,
376,
20,
164,
14,
1923,
16,
566,
9,
235,
25,
51,
287,
6362,
9,
7775,
6903,
6483,
9,
245,
19302,
9,
960,
118,
9054,
60,
710,
3726,
1,
139,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 choose what is going to include element
===
I have two elements, the first one is the default to print on screen
<input id=post-category >
and the other is this
<select id=cat-sel >
which will only show if some onclick was made and of course the first element must show off
| 0 | [
2,
8247,
8741,
3538,
98,
25,
228,
20,
468,
4520,
800,
3726,
3726,
31,
57,
81,
2065,
15,
14,
64,
53,
25,
14,
12838,
20,
4793,
27,
2324,
13,
1,
108,
4881,
4924,
3726,
6962,
8,
14375,
93,
13,
1,
17,
14,
89,
25,
48,
13,
1,
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... |
dev c++ compiler error
===
i am getting this error at compile (actually this is a very simple project and the syntax is absolutely ok)
E:\proj1\Makefile.win [Build Error] [main.o] Error 1
this is my compiler log (dev c++ v 4.9.9.2)
Compiler: Default compiler
Building Makefile: "E:\proj1\Makefile.win"
Executing make...
make.exe -f "E:\proj1\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include"
'C:\Users\r' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
make.exe: *** [main.o] Error 1
Execution terminated
my user path is 'c:\Users\r&d', i think the '&' is makeing trouble in compile process , does anybody has any idea ?, i can not reinstall windows because i have got many softwares installed on my current windows and it is very time consuming to me, how can i fix this /
| 0 | [
2,
9664,
272,
20512,
21486,
7019,
800,
3726,
3726,
31,
589,
1017,
48,
7019,
35,
26561,
13,
5,
15661,
48,
25,
21,
253,
1935,
669,
17,
14,
22649,
25,
6916,
5854,
6,
13,
62,
45,
1,
2740,
728,
165,
1,
11115,
16877,
9,
4181,
636,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to auto install missing module in python automatically?
===
I want to release my simple python script which use some extended module such as `argparse` and `watchdog`. I don't think it reasonable to make the assumption that user of my script already has these modules installed. So I think I should include a configure script to test user environment (if I can automatically install these missing modules, that couldn't be better:P) in the release.
My question is: is there any utilities like `configure` for c program. If no such things, is it possible to adapt `configure` to python environment? Otherwise I have to compose some from scratch:(.
Thanks and best regards. | 0 | [
2,
184,
20,
3108,
16146,
2863,
12613,
19,
20059,
7499,
60,
800,
3726,
3726,
31,
259,
20,
830,
51,
1935,
20059,
3884,
56,
275,
109,
1984,
12613,
145,
28,
13,
1,
10663,
3574,
870,
1,
17,
13,
1,
9054,
8462,
1,
9,
31,
221,
22,
38,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript replace expression
===
I'm having trouble replacing some url variables in javascript. I'm trying to replace the value of "&s=" and "&so=". Below is my code:
url = url.replace(/(s=).*?(&)/, '$1' + $("#sort_by").val() + '$2');
url = url.replace(/(so=).*?(&)/, '$1' + $("#sort_ord").val() + '$2');
The first replace works no problem, the "s" value is always replaced, but the "so" variable never seems to get replaced.
Any ideas?
Cheers! | 0 | [
2,
8247,
8741,
3934,
1803,
800,
3726,
3726,
31,
22,
79,
452,
2572,
5496,
109,
287,
6362,
12157,
19,
8247,
8741,
9,
31,
22,
79,
749,
20,
3934,
14,
1923,
16,
13,
7,
1569,
18,
3726,
7,
17,
13,
7,
1569,
656,
3726,
7,
9,
1021,
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... |
How to create a iPhone WebClips from my own website?
===
How to create a iPhone WebClips from my own website without tittle-bar, task-bar look like the WebClip from this site http://m.freemyapps.com/share/url/09e7dcfc
Thanks | 0 | [
2,
184,
20,
1600,
21,
21024,
2741,
150,
6013,
18,
37,
51,
258,
2271,
60,
800,
3726,
3726,
184,
20,
1600,
21,
21024,
2741,
150,
6013,
18,
37,
51,
258,
2271,
366,
10054,
5866,
8,
1850,
15,
3005,
8,
1850,
361,
101,
14,
2741,
150,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
JMeter - Requests not getting grouped within controllers in graph output
===
In my test plan I have a series of steps like Login, HomePage, DoSearch, DoTask, Logout and each has a number of HTTP requests. I have tried using Simple Controllers, Transaction Controllers, keeping transaction controllers within simple controllers, and vice versa but am unable to see the timings at a step level in any graph. It at the most shows me the timings for Login, but other requests are not grouped on either controllers. Tried checking "Generate Parent Sample" and "Include duration..." but no luck.
Can someone let me know what needs to be done here?
| 0 | [
2,
487,
7307,
13,
8,
12279,
52,
1017,
19511,
363,
9919,
18,
19,
7210,
5196,
800,
3726,
3726,
19,
51,
1289,
944,
31,
57,
21,
231,
16,
2382,
101,
6738,
108,
15,
213,
6486,
15,
107,
25136,
15,
14123,
20310,
15,
6738,
1320,
17,
206,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Text wrap or tooltip for <option> in ie6
===
How can I place a tooltip or wrap the text on <option>'s tag in IE6? I've tried the following:
<option value="Yes" title="Yes">Yes</option>
but it doesn't work for ie6. | 0 | [
2,
1854,
8118,
54,
5607,
10169,
26,
13,
1,
2594,
3309,
1,
19,
13,
660,
379,
800,
3726,
3726,
184,
92,
31,
209,
21,
5607,
10169,
54,
8118,
14,
1854,
27,
13,
1,
2594,
3309,
1,
22,
18,
3383,
19,
13,
660,
379,
60,
31,
22,
195,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
NSURL preloadURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"SewerProfile" ofType:@"sqlite"]]; getting
===
if (![[NSFileManager defaultManager] fileExistsAtPath:[storeURL path]]) {
NSURL *preloadURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"SewerProfile" ofType:@"sqlite"]];
NSError* err = nil;
if (![[NSFileManager defaultManager] copyItemAtURL:preloadURL toURL:storeURL error:&err]) {
NSLog(@"Oops, could copy preloaded data");
}
}
getting error at line
NSURL *preloadURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"SewerProfile" ofType:@"sqlite"]];
NSError* err = nil;
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
| 0 | [
2,
13,
103,
4082,
255,
782,
8294,
911,
255,
800,
636,
103,
4082,
255,
3893,
911,
255,
1410,
8353,
45,
2558,
2558,
2172,
9930,
413,
407,
9930,
413,
500,
2013,
1106,
99,
12097,
45,
1,
7,
870,
4662,
14503,
7,
16,
4474,
45,
1,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android. ldp, mdpi, hdpi clarification
===
So, in regards to this stackoverflow accepted answer: http://stackoverflow.com/questions/6930031/how-do-i-convert-ppi-into-dpi-for-android-images
So, ok, i make each background image the dimensions that that guy specifies in the answer.
BUT, if i define the other ImageViews (smaller ones), that are placed on the screen, in relation to the sizes defined above (e.g. let's say an ImageView has dimensions 20x20 for the hdpi devices, if i calculate this dimensions for the ldpi devices, the image would have to be 7x7 pixels, which is terribly small) then the ldpi devices won't be able to see anything on the screen :) Or will they? Am i doing it right, or not?
I'm terribly confused. Can someone clarify this for me please? :) | 0 | [
2,
13005,
9,
644,
7431,
15,
8138,
2159,
15,
8590,
2159,
13,
12078,
4634,
800,
3726,
3726,
86,
15,
19,
14179,
20,
48,
7566,
2549,
9990,
2217,
1623,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
3680,
6571,
3513,
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... |
Advatages of using JTA
===
I am developing a java web application using struts and hibernate. Currently, I am using Hibernate's Transaction for transaction management in hibernate. What is the advantage of using JTA transaction demarcation over Hibernate transaction ? To be more specific, when is it recommended to use JTA ? | 0 | [
2,
21,
43,
8112,
14465,
16,
568,
487,
536,
800,
3726,
3726,
31,
589,
3561,
21,
8247,
2741,
3010,
568,
18316,
18,
17,
4148,
2102,
8820,
9,
871,
15,
31,
589,
568,
4148,
2102,
8820,
22,
18,
12799,
26,
12799,
1097,
19,
4148,
2102,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IBM WAS createEJBStubs
===
I want to use the createEJBStubs command, which is described here: http://pic.dhe.ibm.com/infocenter/wasinfo/v7r0/index.jsp?topic=%2Fcom.ibm.websphere.express.doc%2Finfo%2Fexp%2Fae%2Frejb_3stubscmd.html
But when I apply it to me .ear file deployed on the server I get the following exception:
CNTR9258E: Error: Unexpected exception "error in opening zip file" occurred.
Has anyone come across this problem? What can be done to create the stubs successfully? | 0 | [
2,
10233,
23,
1600,
10022,
220,
384,
4502,
18,
800,
3726,
3726,
31,
259,
20,
275,
14,
1600,
10022,
220,
384,
4502,
18,
1202,
15,
56,
25,
745,
235,
45,
7775,
6903,
7763,
9,
43,
438,
9,
4598,
79,
9,
960,
118,
108,
4120,
12641,
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... |
Data exchange exchange between Google Apps & another site
===
G'day folks
In short I'm wanting to know whether it is possible for Google Apps to exchange data with another site using the other site's REST APIs?
In my specific case I have a mobile backend running on StackMob & am exploring Google Apps as a possible solution for data management. For that to work it's vital that I can communicate between Google Apps & StackMob using StackMob's API.
Cheers & TIA,
Pedro :) | 0 | [
2,
1054,
1950,
1950,
128,
8144,
4865,
18,
279,
226,
689,
800,
3726,
3726,
489,
22,
1185,
14563,
19,
502,
31,
22,
79,
4638,
20,
143,
1472,
32,
25,
938,
26,
8144,
4865,
18,
20,
1950,
1054,
29,
226,
689,
568,
14,
89,
689,
22,
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... |
JMeter with remote servers
===
I'm trying to setup JMeter in a distributed mode.
I have a server running on an ec2 intance, and I want the master to run on my local computer.
I had to jump through some hopes to get RMI working correctly on the server but was solved with setting the "java.rmi.server.hostname" to the IP of the ec2 instance.
The next (and hopefully last) problem is the server communicating back to the master.
The problem is that because I am doing this from an internal network, the master is sending its local/internal ip address (192.168.1.XXX) when it should be sending back the IP of my external connection (92.XXX.XXX.XXX).
I can see this in the jmeter-server.log
ERROR - jmeter.samplers.RemoteListenerWrapper: testStarted(host) java.rmi.ConnectException: Connection refused to host: 192.168.1.50; nested exception is:
That host IP is wrong. It should be the 92.XXX.XXX.XX address. I assume this is because in the master logs I see the following:
2012/07/29 20:45:25 INFO - jmeter.JMeter: IP: 192.168.1.50 Name: XXXXXX.local FullName: 192.168.1.50
And this IP is sent to the server during RMI setup.
So I think I have two options:
1. Tell the master to send the external IP
2. Tell the server to connect on the external IP of the master.
But I can't see where to set these commands.
Any help would be useful.
| 0 | [
2,
487,
7307,
29,
5388,
17595,
800,
3726,
3726,
31,
22,
79,
749,
20,
18161,
487,
7307,
19,
21,
4387,
3740,
9,
31,
57,
21,
8128,
946,
27,
40,
6695,
135,
19,
38,
2416,
15,
17,
31,
259,
14,
1129,
20,
485,
27,
51,
375,
1428,
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... |
After pcntl_signal, how can I stop the parent thread execution?
===
I have a signal handler registered like so:
pcntl_signal(SIGTERM, "signal_handler");
When signal_handler() is called a new thread of execution starts. My question is, when signal_handler() is called how do I stop the parent's thread of execution? Can I get at parent's PID and kill it? | 0 | [
2,
75,
5168,
2877,
255,
1,
11255,
192,
15,
184,
92,
31,
747,
14,
4766,
9322,
5769,
60,
800,
3726,
3726,
31,
57,
21,
2800,
24641,
3801,
101,
86,
45,
5168,
2877,
255,
1,
11255,
192,
5,
18,
2816,
3964,
15,
13,
7,
11255,
192,
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 can I download ListView HTML images asynchronously?
===
As a prototype, I'm trying to modify the [android-imagedownloader demo][1] from the [Android Developers Blog][2] to work with HTML image tags rather than hard-coded `ImageViews`. I've modified it by replacing `ImageAdapter.getView()` with the following:
public View getView(final int position, View view, final ViewGroup parent) {
TextView textView = (TextView) view;
if (textView == null) {
textView = new TextView(parent.getContext());
textView.setPadding(6, 6, 6, 6);
}
textView.setText(Html.fromHtml("<img src=\"" + URLS[position] + "\"/>",
new ImageGetter() {
@Override public Drawable getDrawable(final String source) {
ImageView view = new ImageView(parent.getContext());
imageDownloader.download(source, view);
return view.getDrawable();
}
},null));
return textView;
}
None of the images are appearing in the ListView though and no errors are reported in Logcat. Do `TextViews` unlike `ImageViews` need to be refreshed somehow once the images are downloaded?
The original `getView()` was:
public View getView(int position, View view, ViewGroup parent) {
if (view == null) {
view = new ImageView(parent.getContext());
view.setPadding(6, 6, 6, 6);
}
imageDownloader.download(URLS[position], (ImageView) view);
return view;
}
[1]: http://code.google.com/p/android-imagedownloader/
[2]: http://android-developers.blogspot.com/2010/07/multithreading-for-performance.html | 0 | [
2,
184,
92,
31,
7121,
968,
4725,
13,
15895,
3502,
21,
16023,
13985,
60,
800,
3726,
3726,
28,
21,
7063,
15,
31,
22,
79,
749,
20,
17579,
14,
636,
290,
18524,
8,
22039,
2968,
8294,
106,
8376,
500,
2558,
165,
500,
37,
14,
636,
290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Backbone and Django, finding a better client-side architecture
===
I have been working with Django as backend and using jQuery for the front end. Now with web pages been so dynamic javascript has started to get more and more complicated and I feel the need of a better, more organized structure there.
I started reading about Backone and it just feels like a backend approach to frontend (since it's an MVC framework). This would make my code more structured but some functionality seems to be overlapping (i.e. models, urls, ...)
I have also read about using backbone with tastypie and django to implement a RESTful environment [here](http://joshbohde.com/blog/backbonejs-and-django). This is very cool since the app would be ready for phone development too.
now my question is how good or bad this architecture is? what pros and cons it has and if there is a simpler way of achieving a [DRY](http://en.wikipedia.org/wiki/Don't_repeat_yourself) client-side code (maybe following some set of rules/good practices would do)
Any personal experience is more than welcome :) | 0 | [
2,
24036,
17,
3857,
14541,
15,
3007,
21,
574,
6819,
8,
1416,
2607,
800,
3726,
3726,
31,
57,
74,
638,
29,
3857,
14541,
28,
97,
2451,
17,
568,
487,
8190,
93,
26,
14,
431,
241,
9,
130,
29,
2741,
4434,
74,
86,
7782,
8247,
8741,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Open URL without Webbrowser or Inet control vb6
===
Is there a way to open a URL in VB6 application without using Webbrowser or MSInet components?
thanks | 0 | [
2,
368,
287,
6362,
366,
10192,
5417,
4104,
54,
19,
1198,
569,
13,
20468,
379,
800,
3726,
3726,
25,
80,
21,
161,
20,
368,
21,
287,
6362,
19,
13,
20468,
379,
3010,
366,
568,
10192,
5417,
4104,
54,
4235,
1149,
38,
5090,
60,
3669,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Prinint ararbic strign appease ???? in java?
===
When I print a `Arabic string` in java it displayed as `??????` and what is the possible solution ? | 0 | [
2,
4566,
5703,
38,
21,
15011,
15896,
20899,
9776,
27290,
13,
60,
60,
60,
60,
19,
8247,
60,
800,
3726,
3726,
76,
31,
4793,
21,
13,
1,
9812,
3724,
1,
19,
8247,
32,
6115,
28,
13,
1,
60,
60,
60,
60,
60,
60,
1,
17,
98,
25,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
turn around sparse matrix
===
I got some sparse matrix like this
>>>import numpy as np
>>>from scipy.sparse import *
>>>A = csr_matrix((np.identity(3)))
>>>print A
(0, 0) 1.0
(1, 1) 1.0
(2, 2) 1.0
For better understanding `A` is something like this:
>>>print A.todense()
[[ 1. 0. 0.]
[ 0. 1. 0.]
[ 0. 0. 1.]]
And I would like to have an operator (let us call it `op1(n)` ) doing this:
>>>A.op1(1)
[[ 0. 1. 0.]
[ 0. 0. 1.]
[ 1. 0. 0.]]
=> makes the last `n` columns the first `n` ones,
so
>>>A == A.op1(3)
true
. Is there some build-in solution?
| 0 | [
2,
805,
140,
23162,
8187,
800,
3726,
3726,
31,
330,
109,
23162,
8187,
101,
48,
13,
1,
1660,
1993,
13,
6336,
6448,
28,
13,
8157,
13,
1,
2665,
9569,
6448,
9,
18,
3574,
870,
9010,
1637,
13,
1,
58,
800,
272,
18,
139,
1,
540,
17224... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 retuen resultset from second select statement in mysql procedure
===
How to return resultset from second select statement
i have sample
-- --------------------------------------------------------------------------------
-- Routine DDL
-- Note: comments before and after the routine body will not be stored by the server
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `getGender20`(in id INT)
BEGIN
DECLARE str VARCHAR(50);
select @str :=gender from memeber_info where id=id;
if (str = 'Male') then
select '12345' ;
end if;
select '123' ;
END
it is retuning male while i want that is should retuen `'123'` how this can be possible plz help | 0 | [
2,
184,
20,
13,
6239,
19315,
1736,
1198,
37,
153,
5407,
3331,
19,
51,
18,
22402,
7004,
800,
3726,
3726,
184,
20,
788,
1736,
1198,
37,
153,
5407,
3331,
31,
57,
5717,
13,
8,
8,
13,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I setup a C environment on Windows (and maybe Linux compatible, too)
===
Short version of question: *How do I get started with C programming?* Note that I am not asking for a tutorial on learning C language (I can learn that easy enough). I need to setup the environment (I hope I'm asking this question clearly). Here's what I mean:
For my math thesis, I need to write a program in C on Gentoo Linux, using a library called [CVODE/SUNDIALS][1]. There is nobody (it seems) in my department who can help me set this up - my professor has left the computer work 100% to me because I have some programming background and he's a math geek. But my experience is with scripting languages (think VBA) and not full, powerful programming languages where you have to link the compiler and libraries, etc. like C.
There is no development environment on the Linux cluster - or at least not that's friendly, and has a debugger, that I've found. So, what I need to figure out how to setup a C programming environment with CVODE library on my PC (Win 7 x64, at little to no cost.
I have found plenty of tutorials on programming in C. I looked up Eclipse, which I have a little bit of experience with, as a development environment, but it's instructions say you need to install a compiler, too.
What I would like is *someone to tell me*, in simple language that I can understand (which might be the most difficult part of this question) *the big picture of what I need and what to do (and maybe even links to where I can find what I need) to set up a C environment with [CVODE][1]*. If the information is Windows/Gentoo Linux cross platform, even better.
Thank you.
P.S. I did search the site and set lots of "How do I setup" quesitons, but no C one. Because I know someone will yell at me for that. Also, I don't want to have a convo about whether to use C#, C++, Java, etc. That just complicates the issue - and I need to get this done.
[1]: https://computation.llnl.gov/casc/sundials/description/description.html#descr_cvode | 0 | [
2,
184,
107,
31,
18161,
21,
272,
2307,
27,
1936,
13,
5,
290,
913,
13024,
14961,
15,
266,
6,
800,
3726,
3726,
502,
615,
16,
1301,
45,
1637,
1544,
107,
31,
164,
373,
29,
272,
3143,
60,
2483,
1945,
30,
31,
589,
52,
3379,
26,
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... |
How to load self-written ruby function into Ruby interactive consoles(irb)?
===
I wrote a simple ruby function and I want to test if the function works in irb.
For example,if I defined my function in XXX.rb, I want to test that function in irb
irb(main):001:0> Some ways to load XXX.rb
irb(main):002:0> I could use functions in XXX.rb
Can I do that? Thanks in advance. | 0 | [
2,
184,
20,
6305,
1119,
8,
6390,
10811,
1990,
77,
10811,
9194,
8650,
18,
5,
49,
7549,
6,
60,
800,
3726,
3726,
31,
738,
21,
1935,
10811,
1990,
17,
31,
259,
20,
1289,
100,
14,
1990,
693,
19,
31,
7549,
9,
26,
823,
15,
821,
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... |
Installing mongrel for Rails
===
I'm trying to install mongrel et al. based on the tutorial here http://blog.codahale.com/2006/06/19/time-for-a-grown-up-server-rails-mongrel-apache-capistrano-and-you/
However, when I try to run
sudo gem install daemons gem_plugin mongrel mongrel_cluster --include-dependencies
I get:
/usr/local/rvm/gems/ruby-1.9.3-p194@global/gems/rubygems-bundler-1.0.3/lib/rubygems-bundler/regenerate_binstubs_command.rb:48: warning: parenthesize argument(s) for future version
Expected Ruby Version >= 1.8.7, is 1.8.5
I find this slightly odd, as I have previously installed Ruby 1.9.3 (as shown above) with RVM and set it to default with
rvm use 1.9.3 --default
I'm using CentOS 5.8.
Can anyone point me in the right direction?
Thanks | 0 | [
2,
25429,
21028,
7256,
26,
2240,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
16146,
21028,
7256,
2133,
493,
9,
432,
27,
14,
29724,
235,
7775,
6903,
220,
5567,
9,
716,
10791,
4482,
9,
960,
118,
2821,
118,
3370,
11698,
12766,
891,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Auto insert default record when deploying Spring MVC App with Spring Security
===
I am looking for a way to auto insert a default admin account, using JPA, when my spring mvc application is deployed.
My database is generated based on the Entities.
I want to kick off something that will insert a default admin user, assign roles, every time the application is deployed. | 0 | [
2,
3108,
14692,
12838,
571,
76,
17617,
68,
1573,
307,
8990,
4865,
29,
1573,
1221,
800,
3726,
3726,
31,
589,
699,
26,
21,
161,
20,
3108,
14692,
21,
12838,
21,
43,
2160,
2176,
15,
568,
487,
1060,
15,
76,
51,
1573,
307,
8990,
3010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
twitter-bootstrap buttons javascript doesnt work
===
I have a control-group with a button group as checkboxes like this :
<div class="control-group" id="cyb3r" >
<label class="control-label" for="c">C</label>
<div class="btn-group navs controls" data-toggle="buttons-checkbox">
<button class="btn" type="button">1</button>
<button class="btn" type="button">2</button>
<button class="btn" type="button">3</button>
</div>
</div>
and I include these :
<link rel="stylesheet"
href="<?php echo base_url('assets/style/style.css');?>">
<link rel="stylesheet"
href="<?php echo base_url('assets/style/bootstrap.min.css');?>">
<script
type="text/javascript"
src="<?php echo base_url('assets/script/jquery.js')?>"></script>
<script
type="text/javascript"
src="<?php echo base_url('assets/script/bootstrap.min.js')?>"></script>
<script
type="text/javascript"
src="<?php echo base_url('assets/script/bootstrap-button.js')?>">
</script>
<script
type="text/javascript"
src="<?php echo base_url('assets/script/js.js')?>"></script>
and js.js :
$(function(){
$('#cyb3r').button();
});
I tried these also :
$(function(){
$('.navs').button();
});
$(function(){
$('.control-group').button();
});
but none of them work for that checkbox group.
but why? | 0 | [
2,
10623,
8,
10858,
38,
18,
16514,
12861,
8247,
8741,
5886,
170,
800,
3726,
3726,
31,
57,
21,
569,
8,
8024,
29,
21,
5167,
214,
28,
2631,
5309,
160,
101,
48,
13,
45,
13,
1,
12916,
718,
3726,
7,
12898,
8,
8024,
7,
4924,
3726,
7,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
function to_char(unknown, unknown) is not unique
===
When running the following the query.`select * from surgicals where to_char(dt_surgery ,'DD-MM-YYYY' ) = to_char('12-02-2012','DD-MM-YYYY');`
the error coming as 'SQL state 42725: ERROR: function to_char(unknown, unknown) is not unique'
How to run above select query? | 0 | [
2,
1990,
20,
1,
5433,
5,
1020,
2929,
15,
2562,
6,
25,
52,
2619,
800,
3726,
3726,
76,
946,
14,
249,
14,
25597,
9,
1,
18,
16964,
1637,
37,
12569,
18,
113,
20,
1,
5433,
5,
43,
38,
1,
18,
16461,
622,
13,
15,
22,
8096,
8,
3363,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Sinatra route regex constraints?
===
i rebuild a small rails (too overkill) app in sinatra. i have a route like this:
match 'verify/:name/:bundle/:license' => 'verify#index', :constraints => { :bundle => /.*/ }
how can i rebould it in sinatra in terms of the constraints attribute?
thanks! | 0 | [
2,
21491,
858,
7953,
1706,
16747,
60,
800,
3726,
3726,
31,
16128,
21,
284,
2240,
18,
13,
5,
8175,
84,
7577,
6,
4865,
19,
21491,
9,
31,
57,
21,
858,
101,
48,
45,
730,
13,
22,
2304,
8612,
118,
45,
7259,
118,
45,
9930,
413,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Encryption decryption in java(for android)
===
Tell me an encryption-decryption technique rather than hex or base 64? | 1 | [
2,
24420,
121,
11435,
872,
19,
8247,
5,
1106,
13005,
6,
800,
3726,
3726,
494,
55,
40,
24420,
8,
546,
11435,
872,
4873,
864,
119,
24,
396,
54,
1000,
4384,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to solve this"Hybriauth configuration error."?
===
i am using hybridauth to get userinformation from social web sites like facebook,twitter, etc.[PHP lib to connect][1]
[1]: http://hybridauth.sourceforge.net/
i configured using install.php which is available in the hybridauth folder itself.
when i tried to use some examples available in my own application i get the following error
Hybriauth configuration error.
Original error message: Hybriauth config does not exist on the given path.
here is my full code:(index.php)
<?php
// start a new session (required for Hybridauth)
session_start();
// change the following paths if necessary
//require_once( str_replace('//','/',dirname(__FILE__).'/') .'folder/sub.php');
$config = dirname(__FILE__).'hybridauth/config.php';
require_once( "hybridauth/Hybrid/Auth.php" );
try{
// create an instance for Hybridauth with the configuration file path as parameter
$hybridauth = new Hybrid_Auth( $config );
// try to authenticate the user with twitter,
// user will be redirected to Twitter for authentication,
// if he already did, then Hybridauth will ignore this step and return an instance of the adapter
$twitter = $hybridauth->authenticate( "Twitter" );
// get the user profile
$twitter_user_profile = $twitter->getUserProfile();
echo "Ohai there! U are connected with: <b>{$twitter->id}</b><br />";
echo "As: <b>{$twitter_user_profile->displayName}</b><br />";
echo "And your provider user identifier is: <b>{$twitter_user_profile->identifier}</b><br />";
// debug the user profile
print_r( $twitter_user_profile );
// exp of using the twitter social api: return users count of friends, followers, updates etc.
$account_totals = $twitter->api()->get( 'account/totals.json' );
// print recived stats
echo "Here some of yours stats on twitter: " . print_r( $account_totals, true );
// disconnect the user ONLY form twitter
// this will not disconnect the user from others providers if any used nor from your application
echo "Logging out..";
$twitter->logout();
}
catch( Exception $e ){
// Display the recived error,
// to know more please refer to Exceptions handling section on the userguide
switch( $e->getCode() ){
case 0 : echo "Unspecified error."; break;
case 1 : echo "Hybriauth configuration error."; break;
case 2 : echo "Provider not properly configured."; break;
case 3 : echo "Unknown or disabled provider."; break;
case 4 : echo "Missing provider application credentials."; break;
case 5 : echo "Authentification failed. "
. "The user has canceled the authentication or the provider refused the connection.";
break;
case 6 : echo "User profile request failed. Most likely the user is not connected "
. "to the provider and he should authenticate again.";
$twitter->logout();
break;
case 7 : echo "User not connected to the provider.";
$twitter->logout();
break;
case 8 : echo "Provider does not support this feature."; break;
}
// well, basically your should not display this to the end user, just give him a hint and move on..
echo "<br /><br /><b>Original error message:</b> " . $e->getMessage();
}
my folder structure is as follows :
project folder :
slingshare
--hybridauth
-- Hybrid
--Auth.php
--config.php
index.php
since i am very new guy to this `PHP` i am unable to find it out please do help me to find this.
Regards
Tony | 0 | [
2,
184,
20,
8402,
48,
7,
5608,
5358,
1346,
96,
8091,
7019,
9,
7,
60,
800,
3726,
3726,
31,
589,
568,
6957,
1346,
96,
20,
164,
4155,
22793,
37,
668,
2741,
3259,
101,
9090,
15,
38,
13098,
106,
15,
2722,
9,
2558,
26120,
13,
8326,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Ebean Play framework 2 many-to-many association loading
===
a bit of troubles from Play Framework 2 here.
There are two classes:
@Entity
public class User extends Domain {
@Id
public Long id;
public String name;
public String surname;
public String phoneNumber;
@Lob
public String comment;
@ManyToMany
public Set<Band> groups = new HashSet();
}
@Entity
public class Band extends Domain {
@Id
public Long id;
public String name;
@Lob
public String comment;
@ManyToMany(mappedBy="groups")
public Set<User> users = new HashSet();
}
And the problem with accessing User.groups. Doing
System.out.println(user.groups);
return the following:
> BeanSet deferred
exactly like in [this](http://stackoverflow.com/questions/11176013/avaje-ebean-manytomany-deferred-beanset) question. So the question is should I do something to make it loaded?
But running this code makes everything as expected.
Band.find.all();
System.out.println(user.groups);
What the reason of such behaviour? | 0 | [
2,
11817,
5609,
418,
6596,
172,
151,
8,
262,
8,
14842,
607,
12797,
800,
3726,
3726,
21,
1142,
16,
16615,
37,
418,
6596,
172,
235,
9,
80,
50,
81,
2684,
45,
13,
1,
2291,
856,
317,
718,
4155,
9073,
4603,
13,
1,
13,
1,
1340,
317,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Passing a variable to a dialog
===
I need to pass a message to an error dialog, to display it to the user.
First attempt
-------------
*PreferencesDialog.py*
dlgError = ErrorDialog ('Have you been messing with the configuration files?')
dlgError.run ()
*ErrorDialog.py*
global message = None
def __new__(cls, msg):
builder = get_builder('ErrorDialog')
new_object = builder.get_object('error_dialog')
new_object.finish_initializing(builder)
global message
message = msg
return new_object
def finish_initializing(self, builder):
# Get a reference to the builder and set up the signals.
self.builder = builder
self.ui = builder.get_ui(self)
global message
self.builder.get_object ('lblMessage').set_text (message)
Second attempt
--------------
*PreferencesDialog.py*
dlgError = ErrorDialog ()
dlgError.message = 'Have you been messing with the configuration files?'
dlgError.run ()
*ErrorDialog.py*
global message = None
def __new__(cls):
builder = get_builder('ErrorDialog')
new_object = builder.get_object('error_dialog')
new_object.finish_initializing(builder)
return new_object
def finish_initializing(self, builder):
# Get a reference to the builder and set up the signals.
self.builder = builder
self.ui = builder.get_ui(self)
global message
self.builder.get_object ('lblMessage').set_text (message)
Both throw the same exception;
self.builder.get_object ('lblMessage').set_text (message)
NameError: global name 'message' is not defined
Please assist. I'm using Quickly, GTK 3 and Python 2.7. | 0 | [
2,
2848,
21,
7612,
20,
21,
28223,
800,
3726,
3726,
31,
376,
20,
1477,
21,
2802,
20,
40,
7019,
28223,
15,
20,
3042,
32,
20,
14,
4155,
9,
64,
1735,
13,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
1637,
306,
28018,
18,
4286,
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... |
MessageInterpolator in Spring
===
I use Spring 3.1.1 and Hibernate-validator 4.3.0.Final and have a problem with changing default MessageInterpolator, which takes validation messages from ValidationMessages (in classpath).
I wanna use ResourceBundleMessageInterpolator which will take messages from my spring messageSource
I did something like this in my application-context.xml:
<bean id="resourceBundleMessageInterpolator"
class="org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator">
<constructor-arg index="0">
<bean class="org.springframework.validation.beanvalidation.MessageSourceResourceBundleLocator">
<constructor-arg index="0" ref="messageSource"/>
</bean>
</constructor-arg>
</bean>
<bean id="validator"
class="org.springframework.validation.beanvalidation.LocalValidatorFactoryBean">
<property name="messageInterpolator" ref="resourceBundleMessageInterpolator"/>
</bean>
And when I start my web application in logs I see:
11:04:07,402 DEBUG [org.hibernate.validator.internal.engine.ConfigurationImpl] -
Setting custom MessageInterpolator of type
org.springframework.validation.beanvalidation.LocaleContextMessageInterpolator
11:04:07,402 DEBUG [org.hibernate.validator.internal.engine.ConfigurationImpl] -
Setting custom ConstraintValidatorFactory of type org.springframework .validation.beanvalidation.SpringConstraintValidatorFactory
So as you can see, it's not ResourceBundleMessageInterpolator which i want. It's LocaleContextMessageInterpolator
Later when I try to validate something I just get the messages from ValidationMessages.properties, not from spring message source:
11:08:09,397 DEBUG [org.hibernate.validator.resourceloading.PlatformResourceBundleLocator] -
ValidationMessages not found.
11:08:09,413 DEBUG [org.hibernate.validator.resourceloading.PlatformResourceBundleLocator] -
org.hibernate.validator.ValidationMessages found.
As you can see from application-context.xml I wanna use MessageSourceResourceBundleLocator, but it's used, I don't know why PlatformResourceBundleLocator
Any ideas? | 0 | [
2,
2802,
6280,
7332,
3457,
19,
1573,
800,
3726,
3726,
31,
275,
1573,
203,
9,
165,
9,
165,
17,
4148,
2102,
8820,
8,
18506,
43,
3457,
268,
9,
240,
9,
387,
9,
4932,
17,
57,
21,
1448,
29,
4226,
12838,
2802,
6280,
7332,
3457,
15,
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... |
How to add datepicker in asp.net , by using input control?
===
I am using datapicker jquery but it is not working can anyone help me for that ,i am new to Dnn.How to add datepicker in asp.net , by using input control? Any answer would be appricited
thank you | 0 | [
2,
184,
20,
3547,
1231,
16855,
106,
19,
28,
306,
9,
2328,
13,
15,
34,
568,
6367,
569,
60,
800,
3726,
3726,
31,
589,
568,
1054,
16855,
106,
487,
8190,
93,
47,
32,
25,
52,
638,
92,
1276,
448,
55,
26,
30,
13,
15,
49,
589,
78,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 a singleton DOM Window reference for a Google Chrome Extension?
===
I am porting a firefox extension to google chrome built using GWT.
In the ***linker***, I need to specify **$wnd** and **$doc** variables.
The counterpart in firefox is as follows:
var $wnd = Cc["@mozilla.org/appshell/appShellService;1"].getService(Ci.nsIAppShellService).hiddenDOMWindow;
var $doc = $wnd.document;
The attribute hiddenDOMWindow as explained [here](https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIAppShellService) returns the (singleton) application hidden window, automatically created and maintained by this AppShellService and is Read only. | 0 | [
2,
184,
20,
164,
21,
345,
444,
11859,
1463,
2801,
26,
21,
8144,
13,
12985,
3896,
60,
800,
3726,
3726,
31,
589,
1295,
68,
21,
535,
18219,
3896,
20,
8144,
13,
12985,
392,
568,
14094,
38,
9,
19,
14,
8980,
6258,
106,
2483,
1409,
15,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to fetch content from other webpage and store in database
===
Hell Friends
I need to fetch the race result from here
"http://www.drf.com/race-results/BHP/USA/2012-06-23/D"
and want to store in my database
I need to fetch all record for race 1,race 2,race3 etc
Please suggest me
I am using this code but its showing me full page I want only specific info
<?php
$ch = curl_init();
//Fetch the timeline
curl_setopt($ch, CURLOPT_URL, 'http://www.drf.com/race-results/BHP/USA/2012-06-24/D');
//send data via $_GET
//curl_setopt($ch, CURLOPT_GET, 0);
//do not return the header information
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
//If SSL verification is needed. Delete if not needed
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);
//Give me the data back as a string... Don't echo it.
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Warp 9, Engage!
$content = curl_exec($ch);
//Close CURL connection & free the used memory.
curl_close($ch);
?> | 0 | [
2,
184,
20,
18312,
2331,
37,
89,
2741,
6486,
17,
1718,
19,
6018,
800,
3726,
3726,
1094,
954,
31,
376,
20,
18312,
14,
764,
829,
37,
235,
13,
7,
21127,
6903,
6483,
9,
43,
8291,
9,
960,
118,
7367,
8,
29955,
18,
118,
6216,
306,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Updating Entities in symfony-2
===
I created entities from my database using the following command
#1 php app/console doctrine:mapping:convert xml ./src/Acme/DemoBundle/Resources/config/ doctrine/metadata/orm --from-database --force
#2 php app/console doctrine:mapping:import AcmeDemoBundle yml
#3 php app/console doctrine:generate:entities AcmeDemoBundle
After that I may alter some tables in the database.
What steps should I follow to reflect the changes in the symfony-framework? | 0 | [
2,
71,
43,
1880,
12549,
19,
13,
7261,
10229,
93,
8,
135,
800,
3726,
3726,
31,
679,
12549,
37,
51,
6018,
568,
14,
249,
1202,
4253,
13,
26120,
4865,
118,
12124,
6069,
7521,
45,
540,
5574,
45,
1126,
8122,
23504,
13,
9,
118,
18,
545... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Add action to terminate application event
===
Could you tell me if there is any possibility to add own function to terminate application event. I want to send some information to logs always when user click button on his phone. | 0 | [
2,
3547,
1028,
20,
17952,
3010,
807,
800,
3726,
3726,
110,
42,
494,
55,
100,
80,
25,
186,
4813,
20,
3547,
258,
1990,
20,
17952,
3010,
807,
9,
31,
259,
20,
2660,
109,
676,
20,
18893,
550,
76,
4155,
10840,
5167,
27,
33,
1132,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Print issue with JQplot on IE
===
I am trying to print my graph and it prints properly through Firefox and Chrome.
But if i try to print it with IE, it shows me the graph canvas HTML tags behind the graph. as u seen in the image. and also it placed the graph axis text all over the graph.. :(
i tried the below solution which says it resolves the issue but it dint for me :(
http://blog.muonlab.com/2010/06/02/getting-position-absolute-canvas-elements-to-print-correctly-in-ie/
below screenshot of the issue.
![IE issue when jqplot is printed][1]
[1]: http://i.stack.imgur.com/pWVv3.png | 0 | [
2,
4793,
1513,
29,
487,
1251,
13221,
38,
27,
13,
660,
800,
3726,
3726,
31,
589,
749,
20,
4793,
51,
7210,
17,
32,
12202,
7428,
120,
535,
18219,
17,
13,
12985,
9,
47,
100,
31,
1131,
20,
4793,
32,
29,
13,
660,
15,
32,
1285,
55,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I check whether the numpy array is empty or not?
===
How can I check whether the numpy array is empty or not?
I used the following code, but this is fail if the array contains a zero.
if not self.Definition.all():
is this the solution?
if self.Definition == array( [] ): | 0 | [
2,
184,
92,
31,
2631,
1472,
14,
13,
6336,
6448,
7718,
25,
2424,
54,
52,
60,
800,
3726,
3726,
184,
92,
31,
2631,
1472,
14,
13,
6336,
6448,
7718,
25,
2424,
54,
52,
60,
31,
147,
14,
249,
1797,
15,
47,
48,
25,
7476,
100,
14,
771... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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: Difference between "try" and "if"
===
Is there any functional difference in Python between a "try" statement and an "if" statement?
| 1 | [
2,
20059,
45,
2841,
128,
13,
7,
5840,
7,
17,
13,
7,
821,
7,
800,
3726,
3726,
25,
80,
186,
7652,
2841,
19,
20059,
128,
21,
13,
7,
5840,
7,
3331,
17,
40,
13,
7,
821,
7,
3331,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
mysql join 2 tables and count all rows from each table
===
I have table contracts c (id, exp_date) and table members m (id, cid).
I need to count all contracts and all members together joining the 2 tables on m.cid = c.id.
I tried this but obviously isn't not right as it returns a same count result from both tables
SELECT count(m.id) as totmembers , count(c.id) as totcontracts
from members m
join contracts c on m.cid = c.id
where DATEDIFF(c.im_exp, CURDATE()) > 0
Results should be something like 5000 contracts, 12.000 members but i'm getting 12.000 for both totmembers and totcontracts. | 0 | [
2,
51,
18,
22402,
1865,
172,
7484,
17,
2468,
65,
11295,
37,
206,
859,
800,
3726,
3726,
31,
57,
859,
8712,
272,
13,
5,
1340,
15,
13,
6899,
1,
8209,
6,
17,
859,
443,
307,
13,
5,
1340,
15,
13,
10220,
6,
9,
31,
376,
20,
2468,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Web browser won't stop asking for location on website
===
I have a website that gets lat+long information using the following snippet of javascript:
if(navigator.geolocation) {
navigator.geolocation.getCurrentPosition(findLocationByGeo);
}
function findLocationByGeo(pos) {
alert('You are at '+pos.coords.latitude+','+pos.coords.longitude);
}
Of course the code above works wonderfully but a "problem" I notice is that when I run it on my iPhone or some browser like Firefox, I continuously get a popup asking to share my location even after having said to share my location.
I notice that on browsers like Chrome the popup doesn't occur as frequently and only asks once.
So what gives? Why does some browser ask it so many times while others don't? Is there a way to prevent it from popping up so much without the users having to modify settings?
| 0 | [
2,
2741,
16495,
230,
22,
38,
747,
3379,
26,
1474,
27,
2271,
800,
3726,
3726,
31,
57,
21,
2271,
30,
3049,
14303,
2430,
2701,
676,
568,
14,
249,
13,
29061,
16,
8247,
8741,
45,
100,
5,
16424,
15807,
9,
834,
111,
19032,
6,
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... |
Can't get Applet and Javascript interaction to work
===
I've been trying to run the DataSummaryApplet file (http://docs.oracle.com/javase/tutorial/deployment/applet/examplesIndex.html#InvokingJavaScriptFromApplet) from Oracal's site which demonstrates Applet and Javascript interaction.
java.lang.NoClassDefFoundError: com/sun/deploy/appcontext/AppContext
at DataSummaryApplet.start(DataSummaryApplet.java:40)
at sun.applet.AppletPanel.run(AppletPanel.java:464)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: com.sun.deploy.appcontext.AppContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I haven't been able to find anything on how to fix this. | 0 | [
2,
92,
22,
38,
164,
4037,
38,
17,
8247,
8741,
7754,
20,
170,
800,
3726,
3726,
31,
22,
195,
74,
749,
20,
485,
14,
1054,
18,
723,
17396,
24212,
38,
3893,
13,
5,
21127,
6903,
13799,
18,
9,
6055,
5615,
9,
960,
118,
1004,
8471,
62,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Homework - Receive a string, convert to calculate and display response, but.. Can't split
===
This is question: Create a script to receive the birth date and return the user's age
I tried this:
ano_atual = 2012
data_nascimento = input('Digite sua data de nascimento (dd/mm/aaaa): ')
dia, mes, ano = map(int, data_nascimento.split('/'))
idade = ano_atual - ano
print idade
But I stayed stuck in this error:
AttributeError: 'int' object has no attribute 'split'
For now, thanks all
*Sorry for bad english* | 0 | [
2,
22334,
13,
8,
2588,
21,
3724,
15,
8406,
20,
18469,
17,
3042,
1627,
15,
47,
9,
9,
92,
22,
38,
2132,
800,
3726,
3726,
48,
25,
1301,
45,
1600,
21,
3884,
20,
2588,
14,
2208,
1231,
17,
788,
14,
4155,
22,
18,
348,
31,
794,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 String (Text) before next upper letter
===
I have the following:
string test = "CustomerNumber";
or
string test2 = "CustomerNumberHello";
the result should be:
string result = "Customer";
The first word from the string is the result, the first word goes until the first uppercase letter, here 'N'
I already tried some things like, b.e:
`var result = string.Concat(s.Select(c => char.IsUpper(c) ? " " + c.ToString() : c.ToString()))
.TrimStart();`
But without success, hope someone could offer me a small and clean solution (without Regex)..
thx in advance | 0 | [
2,
164,
3724,
13,
5,
11969,
6,
115,
328,
1508,
1748,
800,
3726,
3726,
31,
57,
14,
249,
45,
3724,
1289,
800,
13,
7,
4636,
262,
1263,
16299,
7,
73,
54,
3724,
1289,
135,
800,
13,
7,
4636,
262,
1263,
16299,
11515,
7,
73,
14,
829,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Download google app engine entities as CSV
===
In our GAE app, users often need to download entities of a particular type as CSV. New entities are frequently being added/updated which makes it infeasible to write all entities to a blob in advance or at fixed intervals.
For around 50000 entities (each entity < 2 KB) fetched in batches of 500 it takes over 2 minutes to write to a CSV file blob and costs nearly $1. Also users have to wait for a long time to receive a file which is usually only a few (< 5) MBs.
I have 2 questions:
A) Can the time to write the blob possibly be reduced by configuring a map-reduce pipeline for the export?
B) Is there a way to reduce the cost of fetching large number of entities from the datastore and writing to blobs? | 0 | [
2,
7121,
8144,
4865,
1406,
12549,
28,
272,
18,
710,
800,
3726,
3726,
19,
318,
13,
17721,
4865,
15,
3878,
478,
376,
20,
7121,
12549,
16,
21,
1498,
1001,
28,
272,
18,
710,
9,
78,
12549,
50,
3086,
142,
905,
118,
576,
43,
1669,
56,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
argument is of length zero
===
I am very new to R and am trying to learn scraping.
I am trying to use the following syntax to get the occupation information from George Clooney's wikipedia page. Eventually I would like there to be a loop to get data on various personalitys' occupations.
However, I get the following problem running the below code:
Error in if (symbol != "role") symbol = NULL : argument is of length zero
I am not sure why this keeps on coming up. Any assistance will be appreciated.
library(XML)
library(plyr)
url = 'http://en.wikipedia.org/wiki/George_Clooney'
# don't forget to parse the HTML, doh!
doc = htmlParse(url)
# get every link in a table cell:
links = getNodeSet(doc, '//table/tr/td')
# make a data.frame for each node with non-blank text, link, and 'title' attribute:
df = ldply(links, function(x) {
text = xmlValue(x)
if (text=='') text=NULL
symbol = xmlGetAttr(x, 'class')
if (symbol!='role') symbol=NULL
if(!is.null(text) & !is.null(symbol))
data.frame(symbol, text) } )
Thank you
Amar | 0 | [
2,
5476,
25,
16,
1476,
4606,
800,
3726,
3726,
31,
589,
253,
78,
20,
761,
17,
589,
749,
20,
2484,
25611,
9,
31,
589,
749,
20,
275,
14,
249,
22649,
20,
164,
14,
4517,
676,
37,
665,
7383,
849,
93,
22,
18,
20169,
2478,
9,
878,
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... |
create a JPA1 abstract class findAll method from entity class
===
Using an `EntityManager` in an abstract class, I am trying to create a function that returns a list of all the results in a table from the entity class. Each table has its own persistence class that inherits from the abstract class. So far I have:
public abstract class AbstractFacade<T> {
private Class<T> entityClass;
...
public List<T> findAll() {
javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
cq.select(cq.from(entityClass));
return getEntityManager().createQuery(cq).getResultList();
}
}
That works for JPA 2.0 but I just discovered that my server is restricted to JPA 1.0 which doesn't support `getCriteriaBuilder()` or `createQuery(CriteriaQuery cq)`
Is there a way I can re-factor my code to do relatively the same thing with a mechanism that exists in JPA 1.0? | 0 | [
2,
1600,
21,
487,
1060,
165,
8502,
718,
477,
1233,
2109,
37,
9252,
718,
800,
3726,
3726,
568,
40,
13,
1,
2291,
856,
22256,
1,
19,
40,
8502,
718,
15,
31,
589,
749,
20,
1600,
21,
1990,
30,
4815,
21,
968,
16,
65,
14,
1736,
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... |
Rails. Can't get images to be displayed from a CSS file
===
I already tried many different approaches and none work, am I missing something here?
This is what I have tried...
th a.asc {
background-image: url(up_arrow.gif);
}
th a.desc {
background-image: url(down_arrow.gif);
}
and
th a.asc {
background-image: url("assets/up_arrow.gif");
}
th a.desc {
background-image: url("assets/down_arrow.gif");
}
and
th a.asc {
background-image: url(assets/up_arrow.gif);
}
th a.desc {
background-image: url(assets/down_arrow.gif);
}
and
th a.asc {
background-image: url(<%= asset_path "up_arrow.gif" %>);
}
th a.desc {
background-image: url(<%= asset_path "down_arrow.gif" %>);
}
and...
th a.asc {
background-image: asset-url("up_arrow.gif", image);
}
th a.desc {
background-image: asset-url("down_arrow.gif", image);
}
and many more.
I have renamed the file application.css, application.css.scss, application.css.erb, application.scc.scss.erb, index.css, index.css.scss, index.css.erb
I have read this... http://edgeguides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets and http://stackoverflow.com/questions/10093077/404-when-displaying-background-image-in-css-with-rails-3-2 and http://stackoverflow.com/questions/6562140/rails-3-1-serving-images-from-vendor-assets-images and http://stackoverflow.com/questions/6213218/rails-3-1-and-image-assets and other pages from stackoverflow.
But my images don't appear. They are in the `app/assets/images` directory. I have double checked and triple checked and yes, they are in that location. I go to Inspect Element in Google Chrome and when I click in the images link, it shows me the broken link image. | 0 | [
2,
2240,
18,
9,
92,
22,
38,
164,
3502,
20,
44,
6115,
37,
21,
272,
18,
18,
3893,
800,
3726,
3726,
31,
614,
794,
151,
421,
7501,
17,
2369,
170,
15,
589,
31,
2863,
301,
235,
60,
48,
25,
98,
31,
57,
794,
9,
9,
9,
13,
96,
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... |
How to place buttons in an image
===
I have an image of a city. Now i would like to add mutilple markers at multiple position i click and also add links to each markers.
I am to use that particular image only not good map as google map is not allowed in the project.
So how to make that using javascript, mysql, php. | 1 | [
2,
184,
20,
209,
12861,
19,
40,
1961,
800,
3726,
3726,
31,
57,
40,
1961,
16,
21,
136,
9,
130,
31,
83,
101,
20,
3547,
307,
14255,
5106,
19482,
35,
1886,
649,
31,
10840,
17,
67,
3547,
6271,
20,
206,
19482,
9,
31,
589,
20,
275,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Fit image to width using fixed positioned button
===
I have a page with the following functionality: there is a large image that generates scoll (both horizontally and vertically) and a button in a fixed position (it remains in the top left corner, even with scroll) that, when clicked, fits the image to the client width.
Since `position: fixed` is not supported in Internet Explorer 8, I used a workaround - this is the function:
function setFixedPosition(jqueryWrapper, pixelsFromTop, pixelsFromLeft) {
jqueryWrapper.css('position', 'absolute');
var setOffsets = function() {
jqueryWrapper.css("top", (($(window).scrollTop() + pixelsFromTop) + "px"));
jqueryWrapper.css("left", (($(window).scrollLeft() + pixelsFromLeft) + "px"));
};
setOffsets();
$(window).scroll(function() {
setOffsets();
});
}
setFixedPosition($('#zoomFitButton'), 15, 15);
This is the button's action:
$('#zoomFitButton').click(function() {
$('img.preview').css('width', '100%');
});
The button remains fixed both in Firefox 13 and IE8.
But, under IE8, if I am scrolling somewhere, then I click the button, the button moves to a "strange" position:
- If I scroll vertically, then click, it puts the button in the lower-left corner;
- If I scroll horizontally, then click, it puts the button in the upper-right corner;
- If I scroll both ways, then click, it puts the button somewhere in the center.
In Firefox, the button always remains in the upper-left corner (the place where I expect it to be), even after I click the fit to width button.
Here is [a test page][1].
Is my code OK for this functionality (in principle), or I need to add something to the fit to width action (to fix my button positioning); or there is something wrong with IE (and I need a workaround - if so, any suggestions?)?
Thanks.
[1]: http://jsfiddle.net/zMW9k/2/ | 0 | [
2,
2742,
1961,
20,
9456,
568,
3535,
12125,
5167,
800,
3726,
3726,
31,
57,
21,
2478,
29,
14,
249,
18548,
45,
80,
25,
21,
370,
1961,
30,
7920,
18,
13,
18,
20410,
13,
5,
8110,
25658,
17,
23300,
6,
17,
21,
5167,
19,
21,
3535,
649,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Accessing page methods from command in Sitecore
===
Im building Sitecore sheer UI application, and the main layout is aspx page NOT XAML, which contains a grid, and i added a dropdown list as a ribbon button, and when dropdown list is changed, i must filter grid source based on the selected value in dropdown.
When dropdown list is changed, my custom command will be triggered, but in the command i can't access my grid control so that i can do a filter, so my question is, How can i call a method inside my aspx page from command class.
Regards,
Ahmed | 0 | [
2,
1381,
68,
2478,
3195,
37,
1202,
19,
689,
10375,
800,
3726,
3726,
797,
353,
689,
10375,
14694,
13,
5661,
3010,
15,
17,
14,
407,
9106,
25,
28,
306,
396,
2478,
52,
13,
6791,
8184,
15,
56,
1588,
21,
7354,
15,
17,
31,
905,
21,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do i monitor independed applications with god?
===
I'm currently looking into options for process monitoring of Rails/Ruby Projects and quite like god.
But i cant really find anything on how to monitor multiple applications (for example 2 rails projects running on one machine) with god.
As far as i see it i just set up god (system ruby) and have each project add its own configuration (maybe somehow in a deploy-hook).
This should also work with the projects running different ruby versions (rbenv, rvm) or bundler, since the god ruby does not have to access any project code.
Does anyone already use it like this? Or is there a better approach? | 0 | [
2,
184,
107,
31,
7626,
19,
19038,
69,
3767,
29,
701,
60,
800,
3726,
3726,
31,
22,
79,
871,
699,
77,
6368,
26,
953,
8984,
16,
2240,
18,
118,
1820,
779,
2314,
17,
1450,
101,
701,
9,
47,
31,
2973,
510,
477,
602,
27,
184,
20,
76... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Configuration Management and SlowCheetah
===
I need to apply <b>xdt transformations</b> to other files than <b>*.config</b> ones.
I found the SlowCeetah extension which seems to provide this kind of feature as authors and extension page says, but, even if I setup the trasformation for xml files, and note that the
<b>preview tool</b> works well.., according to solution configuration manager configuratoins, no
transformation is applied.
For example I setup the trasformation for log4net.xml file, by using the tooling command "Add Transformation" which added log4net.<i>{configname}</i>.xml files but nothing happen when I deploy the solution or simply build with the specific build configuration.
Anyone has seen this issue?
Googlin' around I found that trasnformations to xml files should be applied to files setup as Content and Copy Always, anyone has suggestion about that?
I 'm very sad becaues I made all my configurations with transformations, and if I cannot solve that issue I lost 2 days of boring config job and I just can do that manually
Thanks in advance
Cheers | 0 | [
2,
8091,
1097,
17,
2276,
11638,
12515,
800,
3726,
3726,
31,
376,
20,
5645,
13,
1,
220,
1,
396,
43,
38,
6978,
18,
1,
118,
220,
1,
20,
89,
6488,
119,
13,
1,
220,
1,
2483,
9,
14093,
2816,
1,
118,
220,
1,
53,
18,
9,
31,
216,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 stack initialised strings
===
just been inspecting the following in gdb:
char *a[] = {"one","two","three","four"};
char *b[] = {"one","two","three","four"};
char *c[] = {"two","three","four","five"};
char *d[] = {"one","three","four","six"};
and i get the following:
(gdb) p a
$17 = {0x80961a4 "one", 0x80961a8 "two", 0x80961ac "three", 0x80961b2 "four"}
(gdb) p b
$18 = {0x80961a4 "one", 0x80961a8 "two", 0x80961ac "three", 0x80961b2 "four"}
(gdb) p c
$19 = {0x80961a8 "two", 0x80961ac "three", 0x80961b2 "four", 0x80961b7 "five"}
(gdb) p d
$20 = {0x80961a4 "one", 0x80961ac "three", 0x80961b2 "four", 0x80961bc "six"}
I'm really surprised that the string pointers are the same for equivalent words. I would have thought each string would have been allocated its own memory on the stack regardless of whether it was the same as a string in another array.
Is this an example of some sort of compiler optimisation or is it standard behaviour for string declaration of this kind?
| 0 | [
2,
272,
7566,
2104,
2541,
7887,
800,
3726,
3726,
114,
74,
19,
7350,
68,
14,
249,
19,
489,
9007,
45,
4892,
1637,
58,
2558,
500,
800,
13,
1,
7,
849,
7,
15,
7,
3734,
7,
15,
7,
5642,
7,
15,
7,
4882,
7,
1,
73,
4892,
1637,
220,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Error in extending class from Spinner
===
I have downloaded the default source code of browser from following link
https://github.com/android/platform_packages_apps_browser and i am running it for 4.0.3
and i am facing error in following class
public class FolderSpinner extends Spinner
implements AdapterView.OnItemSelectedListener {
private OnSetSelectionListener mOnSetSelectionListener;
private boolean mFireSetSelection;
public interface OnSetSelectionListener {
public void onSetSelection(long id);
}
public FolderSpinner(Context context, AttributeSet attrs) {
super(context, attrs);
super.setOnItemSelectedListener(this);
}
@Override
public void setOnItemSelectedListener(AdapterView.OnItemSelectedListener l) {
throw new RuntimeException("Cannot set an OnItemSelectedListener on a FolderSpinner");
}
public void setOnSetSelectionListener(OnSetSelectionListener l) {
mOnSetSelectionListener = l;
}
public void setSelectionIgnoringSelectionChange(int position) {
super.setSelection(position);
}
@Override
public void setSelection(int position) {
mFireSetSelection = true;
int oldPosition = getSelectedItemPosition();
super.setSelection(position);
if (mOnSetSelectionListener != null) {
if (oldPosition == position) {
long id = getAdapter().getItemId(position);
onItemSelected(this, null, position, id);
}
}
}
@Override
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
if (mFireSetSelection) {
mOnSetSelectionListener.onSetSelection(id);
mFireSetSelection = false;
}
}
@Override
public void onNothingSelected(AdapterView<?> parent) {}
}
I am getting the eror at 1st line
public class FolderSpinner extends Spinner
implements AdapterView.OnItemSelectedListener
and the error is
This class must implement the inherited abstract method AbsSpinner.layout(int, boolean), but cannot override it since it is not visible from FolderSpinner. Either make the type abstract or make the inherited method visible
Please give me solution for that.
Thanks. | 0 | [
2,
7019,
19,
8176,
718,
37,
3310,
1031,
800,
3726,
3726,
31,
57,
23887,
14,
12838,
1267,
1797,
16,
16495,
37,
249,
3508,
7775,
18,
6903,
10404,
20926,
9,
960,
118,
290,
18524,
118,
27035,
1,
8573,
14465,
1,
7753,
18,
1,
25699,
410... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Login into wikipedia using apache's httpclient in android
===
I am trying to login into wikipedia using their API. I couldn't login successfully even with the cookies set correctly.
protected class Upload extends AsyncTask<Void, Void, Void> {
protected void onPreExecute() {
ProgressDialog dialog = new ProgressDialog(context);
dialog.setMessage("Uploading..");
dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
dialog.setCancelable(true);
dialog.setProgress(0);
dialog.show();
}
@Override
protected Void doInBackground(Void ...voids) {
HttpClient httpClient = new DefaultHttpClient();
HttpPost request = new HttpPost("http://en.wikipedia.org/w/api.php");
CookieStore cookieStore = new BasicCookieStore();
HttpContext localContext = new BasicHttpContext();
localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
httpClient.getParams().setParameter(
ClientPNames.COOKIE_POLICY, CookiePolicy.BROWSER_COMPATIBILITY);
List<NameValuePair> postParameters;
JSONObject jsonObject = null;
try {
postParameters = getPostParameters(new BasicNameValuePair("action", "login"), new BasicNameValuePair("lgname", URLEncoder.encode(lgname, "UTF-8"))
, new BasicNameValuePair("lgpassword", URLEncoder.encode(lgpassword, "UTF-8")), new BasicNameValuePair("format", "json"));
} catch (UnsupportedEncodingException e1) {
System.err.print("Cannot encode url");
e1.printStackTrace();
postParameters = null;
}
try {
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(postParameters, HTTP.UTF_8);
request.setEntity(entity);
HttpResponse response = httpClient.execute(request, localContext);
jsonObject = getJSON(response);
System.out.println(jsonObject.toString() + " I am here 0");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
try {
if(jsonObject.getJSONObject("login").getString("result").equals("NeedToken")) {
try {
System.out.println(jsonObject.getJSONObject("login").getString("token") + " I am here 1");
postParameters = getPostParameters(new BasicNameValuePair("action", "login"), new BasicNameValuePair("lgname", URLEncoder.encode(lgname, "UTF-8"))
, new BasicNameValuePair("lgpassword", URLEncoder.encode(lgpassword, "UTF-8")), new BasicNameValuePair("lgtoken", jsonObject.getJSONObject("login").getString("token"))
, new BasicNameValuePair("format", "json"));
UrlEncodedFormEntity entity = new UrlEncodedFormEntity(postParameters, HTTP.UTF_8);
request.setEntity(entity);
HttpResponse response = httpClient.execute(request, localContext);
jsonObject = getJSON(response);
System.out.println(jsonObject.getJSONObject("login").toString() + " I am here 2");
System.out.println(cookieStore.toString() + " I am here 3");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
}
public void upload(View view) {
Upload upload_ = new Upload();
upload_.execute();
}
public JSONObject getJSON(HttpResponse response) {
StringBuffer stringBuffer = new StringBuffer("");
try {
BufferedReader bufferedReader = new BufferedReader( new InputStreamReader(response.getEntity().getContent()));
String line = "";
String lineSeparator = System.getProperty("line.separator");
while ((line = bufferedReader.readLine()) != null) {
stringBuffer.append(line + lineSeparator);
}
bufferedReader.close();
} catch (ClientProtocolException e) {
e.printStackTrace();
Toast.makeText(PronunciationActivity.this, e.toString(), Toast.LENGTH_LONG).show();
} catch (IOException ie) {
ie.printStackTrace();
Toast.makeText(PronunciationActivity.this, ie.toString(), Toast.LENGTH_LONG).show();
}
JSONObject jsonObject;
try {
jsonObject = new JSONObject(stringBuffer.toString());
} catch (JSONException e) {
e.printStackTrace();
System.out.println("it crashed, i guess");
return null;
}
return jsonObject;
}
public List<NameValuePair> getPostParameters(BasicNameValuePair ...basicNameValuePairs) {
List<NameValuePair> postParameters = new ArrayList<NameValuePair>();
for(BasicNameValuePair basicNameValuePair : basicNameValuePairs) {
postParameters.add(basicNameValuePair);
}
return postParameters;
}
I cannot find a problem with the above code theoretically, but I always get the result as wrong password from wikipedia. Is there a way to login into wikipedia in any other way? Am I in the right direction? | 0 | [
2,
6738,
108,
77,
20169,
568,
17140,
22,
18,
7775,
150,
18513,
38,
19,
13005,
800,
3726,
3726,
31,
589,
749,
20,
6738,
108,
77,
20169,
568,
66,
21,
2159,
9,
31,
711,
22,
38,
6738,
108,
3673,
166,
29,
14,
19396,
309,
12044,
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... |
Device Token - Apple push Notification Service
===
is device token changes each time when i opens my application?
Apple server uses the same device token every time or the new regenerated device token? | 0 | [
2,
3646,
20,
2853,
13,
8,
4037,
3250,
52,
4634,
365,
800,
3726,
3726,
25,
3646,
20,
2853,
1693,
206,
85,
76,
31,
8965,
51,
3010,
60,
4037,
8128,
2027,
14,
205,
3646,
20,
2853,
352,
85,
54,
14,
78,
29608,
43,
3646,
20,
2853,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Hide folder with photos on sd card
===
I save pictures to my application on sd card. When I go to gallery I can see that pictures. How I can save pictures which I use in application on sd card but they must be invisible in gallery from phone. | 0 | [
2,
3077,
19294,
29,
7064,
27,
13,
18,
43,
2056,
800,
3726,
3726,
31,
2079,
3104,
20,
51,
3010,
27,
13,
18,
43,
2056,
9,
76,
31,
162,
20,
2246,
31,
92,
196,
30,
3104,
9,
184,
31,
92,
2079,
3104,
56,
31,
275,
19,
3010,
27,
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,
0,
0... |
3 different XML parse using single SAX parser handler
===
How to parse 3 different xml file.XML files are as follow
`<?xml version="1.0" encoding="UTF-8"?>`
`<login>`
`<item>`
`<user_id>id</user_id>`
`<user_name>Piron</user_name>`
`<user_status>false</user_status>`
`</item>`
`</login>`
`<?xml version="1.0" encoding="UTF-8"?>`
`<logout>`
`<logout_item>`
`<user_id>id</user_id>`
`<user_name>kumar</user_name>`
`<user_status>true</user_status>`
`</logout_item>`
`</logout>`
` <?xml version="1.0" encoding="UTF-8"?>`
`<registration>`
`<registration_item>`
`<user_id>id</user_id>`
`<user_name>name</user_name>`
`<user_status>user already exist</user_status>`
`</registration_item>`
`</registration>`
How to parse them using a single SAX Handler(startElement() and endElement()) in android? | 0 | [
2,
203,
421,
23504,
2017,
870,
568,
345,
16070,
2017,
4104,
24641,
800,
3726,
3726,
184,
20,
2017,
870,
203,
421,
23504,
3893,
9,
396,
8184,
6488,
50,
28,
1740,
13,
1,
60,
396,
8184,
615,
3726,
7,
165,
9,
387,
7,
19608,
3726,
7,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I use Sass with a batch script in Windows
===
In web projects on my local machine, I'm using a fairly simple Sass setup.
In the same folder, I have /scss/style.scss and /css/style.css
So to run Sass while I work I just write this in a Ruby Terminal:
cd "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title"
sass --watch scss/style.scss:css/style.css
Works fine, but it's a little cumbersome, so I'm trying to figure out how to do the equivalent with a batch script.
I've tried the following, but it's a complete disaster, and my computer tries to open an infinite amount of Ruby consoles.
cd "C:\Ruby193\bin"
start ruby
cd "C:\Users\Puppybeard\Documents\Aptana Studio 3 Workspace\Project Title"
sass --watch scss/style.scss:css/style.css
exit
I think what I need to do is to start Ruby running in the background, rather than open the Ruby exe. Does anyone know how, or is that even how Ruby works? Obviously, I'm new to Sass, Ruby and batch scripts, so any insight you can give me would be a big help, thanks.
| 0 | [
2,
92,
31,
275,
9233,
18,
29,
21,
13064,
3884,
19,
1936,
800,
3726,
3726,
19,
2741,
2314,
27,
51,
375,
1940,
15,
31,
22,
79,
568,
21,
6647,
1935,
9233,
18,
18161,
9,
19,
14,
205,
19294,
15,
31,
57,
13,
118,
3862,
18,
18,
118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
writing to a file using php ftp
===
I'm exporting some data, making a file and writing the data to the file...
my file appears on the ftp server, but it's empty...
here is the code.
//Connect to the FTP server
$ftpstream = @ftp_connect('localhost');
//Login to the FTP server
$login = @ftp_login($ftpstream, 'some_login', 'some_password');
if($login) {
//We are now connected to FTP server.
//Create a temporary file
$temp = tmpfile();
//Upload the temporary file to server
@ftp_fput($ftpstream, '/httpdocs/itineraryschedule.txt', $temp, FTP_ASCII);
//Make the file writable by all
ftp_site($ftpstream,"CHMOD 0777 /httpdocs/itineraryschedule.txt");
//Write to file
$fp = fopen('var/www/vhosts/cruiseandmaritime.com/httpdocs/itineraryschedule.txt', 'w');
fputs($fp, 'some data');
fclose($fp);
//Make the file writable only to owner
ftp_site($ftpstream,"CHMOD 0644 /httpdocs/itineraryschedule.txt");
}
I'm puzzled !
Rich :)
| 0 | [
2,
1174,
20,
21,
3893,
568,
13,
26120,
1187,
306,
800,
3726,
3726,
31,
22,
79,
7487,
68,
109,
1054,
15,
544,
21,
3893,
17,
1174,
14,
1054,
20,
14,
3893,
9,
9,
9,
51,
3893,
1780,
27,
14,
1187,
306,
8128,
15,
47,
32,
22,
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... |
I want a Database related project Idea for my final year
===
I have some basic knowledge about database management system i have learned about rdbms, sql, transaction management, oop concepts, query optimization etc...
Can some one please advice me a database related project
It should be be some what big enough a I will have 5 months for it. | 4 | [
2,
31,
259,
21,
6018,
1597,
669,
882,
26,
51,
426,
159,
800,
3726,
3726,
31,
57,
109,
2125,
1918,
88,
6018,
1097,
329,
31,
57,
2691,
88,
13,
897,
13178,
18,
15,
4444,
255,
15,
12799,
1097,
15,
13,
21709,
8700,
15,
25597,
21597,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Implementing real time updating of graph using Async task
===
I am new to android and need help converting the hollowing code into a live updating graph, that shows a ecg trace.
Lets work with a sine curve for now. So i need to have a graph that displays a moving sine graph.
right now i just hae a simple code that displays a static graph using the aChartEngine plugin.
what is the easiest way to implement a moving( live updating) graph using a scalable patter(thread/asynctask)?
public class LiveView extends Activity {
Button startTimer;
TextView heartRate, battery;
LinearLayout lineGraphLayout;
View lineGraph;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.liveview);
startTimer = (Button) findViewById(R.id.bStartTimer);
heartRate = (TextView) findViewById(R.id.tvHeartRate);
battery = (TextView) findViewById(R.id.tvBatteryLevel);
lineGraphLayout = (LinearLayout) findViewById(R.id.lineGraph);
}
@Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
if (lineGraph == null) {
// sample Values
lineGraph = getLineGraphView();
lineGraphLayout.addView(lineGraph);
} else
((GraphicalView) lineGraph).repaint();
}
private View getLineGraphView() {
int[] x = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; // x values!
int[] y = { 30, 34, 45, 57, 77, -89, 100, 111, 123, 145 };
TimeSeries series = new TimeSeries("Lead 1");
for (int i = 0; i < x.length; i++)
series.add(x[i], y[i]);
XYMultipleSeriesDataset dataset = new XYMultipleSeriesDataset();
dataset.addSeries(series);
XYMultipleSeriesRenderer mRenderer = new XYMultipleSeriesRenderer();
XYSeriesRenderer renderer = new XYSeriesRenderer();
mRenderer.addSeriesRenderer(renderer);
View tempView = ChartFactory.getLineChartView(this, dataset, mRenderer);
tempView.setBackgroundColor(Color.WHITE);
return tempView;
}
} | 0 | [
2,
17333,
683,
85,
71,
43,
1880,
16,
7210,
568,
21,
9507,
150,
3005,
800,
3726,
3726,
31,
589,
78,
20,
13005,
17,
376,
448,
19583,
14,
7456,
68,
1797,
77,
21,
515,
71,
43,
1880,
7210,
15,
30,
1285,
21,
6695,
263,
5565,
9,
6884... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Mapquest schema URL for iphone
===
I try to build an iPhone app to launch Mapquest using schema URL. Does Mapquest expose schema URL for other apps?
If yes, can you provide document or example?
| 0 | [
2,
2942,
10351,
23874,
287,
6362,
26,
21024,
800,
3726,
3726,
31,
1131,
20,
1895,
40,
21024,
4865,
20,
3394,
2942,
10351,
568,
23874,
287,
6362,
9,
630,
2942,
10351,
13833,
23874,
287,
6362,
26,
89,
4865,
18,
60,
100,
1643,
15,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to cut inner div to its parent div size?
===
I have a square div (called "square") and trying to put another div ("caption") inside the "square". But the caption goes outside the square boundaries! How to cut its size to the exact boundaries of the parent div?
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
background-color: #000000;
}
a {
text-decoration: none;
color: #FFFFFF;
}
div.square {
background-color: #1BA1E2;
display: inline-block;
width: 44px;
height: 44px;
margin: 0 6px 0 9px;
}
div.caption {
display: inline-block;
margin: 15px 0 0 3px;
padding: 0;
color: #FFFFFF;
font-size: 24px;
}
span.description {
display: inline-block;
vertical-align: bottom;
font-size: 18px;
}
</style>
</head>
<body>
<p>
<a href="page">
<div class="square">
<div class="caption">
Caption
</div>
</div>
<span class="description">
Description
</span>
</a>
</p>
</body>
</html>
In this case, `Caption` should be cut to `Cap`+ 1/2`t` inside the blue box (something like WP7 style). And a description alongside. | 0 | [
2,
184,
20,
1077,
3754,
13,
12916,
20,
82,
4766,
13,
12916,
1072,
60,
800,
3726,
3726,
31,
57,
21,
735,
13,
12916,
13,
5,
4580,
13,
7,
12300,
7,
6,
17,
749,
20,
442,
226,
13,
12916,
13,
5,
7,
4666,
3309,
7,
6,
572,
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... |
How to run script upon opening folder?
===
I want to run an applescript when a specific folder of mine is open. Then, depending on the input, close the folder, or leave it open. All that without opening the folder. So, basically:
1) Try to open folder
2) Folder doesn't open, but window pops up
3-A) If user clicks ok folder opens
3-B) If user clicks cancel, it just exits out of script, leaving the folder unopened.
How can I do this? Remember: The folder CAN'T open in the background, it can ONLY open if the user presses OK. Help? | 0 | [
2,
184,
20,
485,
3884,
685,
1214,
19294,
60,
800,
3726,
3726,
31,
259,
20,
485,
40,
4037,
8741,
76,
21,
1903,
19294,
16,
1114,
25,
368,
9,
94,
15,
4758,
27,
14,
6367,
15,
543,
14,
19294,
15,
54,
767,
32,
368,
9,
65,
30,
366,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 On Rails - Access model from a different file
===
I have a model in my rails application which is
class Person < ActiveRecord::Base
..
end
I would like to access this model from a different ruby file for certain manipulations. This is to populate my db. Can somebody please tell me how to go about it?
I am new to ruby on rails and hence a trivial question. I tried including the model by using require or require relative but I get a LoadError | 0 | [
2,
10811,
27,
2240,
18,
13,
8,
1381,
1061,
37,
21,
421,
3893,
800,
3726,
3726,
31,
57,
21,
1061,
19,
51,
2240,
18,
3010,
56,
25,
718,
840,
13,
1,
1348,
14953,
45,
45,
8436,
13,
9,
9,
241,
31,
83,
101,
20,
1381,
48,
1061,
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... |
Sending 'MKOverlayView to parameter of incompatible type 'id<MKOverlay>'
===
I'm getting the following warning when adding overlays to my map view:
Sending 'MKOverlayView *const __strong' to parameter of incompatible type 'id<MKOverlay>'
The code works great, and the overlays are drawn as they should, but I would love to get rid of the warning.
The code that's causing it:
for(MKOverlayView *overlay in [mapView overlays]) {
[mapView removeOverlay:overlay];
}
(Obviously, the line inside the for loop is what's raising this error)
Google doesn't have a single result for that error. only similar with MKAnnotationView for example.
The solutions there (for example):
for(id<MKOverlay> *overlay in [mapView overlays]) {
[mapView removeOverlay:overlay];
}
raises an error.
Any ideas?
Thanks!
| 0 | [
2,
4907,
13,
22,
79,
4287,
106,
4414,
4725,
20,
18906,
16,
19,
20049,
1001,
13,
22,
1340,
1,
79,
4287,
106,
4414,
1,
22,
800,
3726,
3726,
31,
22,
79,
1017,
14,
249,
3590,
76,
4721,
84,
4414,
18,
20,
51,
2942,
1418,
45,
4907,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Azure blob storage and security
===
I'm in the process of deciding which technology to use for a project. The project will store large amounts of documents (Word, PDF etc) and I'm trying to figure out the best way of storing them. So far, I've come up with:
1. Standard hosting, and using the file system
2. Standard hosting, use Full Text Search and store documents in SQL Server
3. Use Azure Blobs.
Under no circumstances can the documents be visible to anyone. Only certain, authorised people should be able to view documents. Can anyone point me in the direction of how you can secure the documents so that you can't just point a browser to it and it will be visible? | 0 | [
2,
25715,
334,
10904,
4326,
17,
1221,
800,
3726,
3726,
31,
22,
79,
19,
14,
953,
16,
11211,
56,
1099,
20,
275,
26,
21,
669,
9,
14,
669,
129,
1718,
370,
8545,
16,
4374,
13,
5,
9587,
15,
13,
11124,
2722,
6,
17,
31,
22,
79,
749,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Are the bundles in android permanent in saving activity states ?
===
When I want to save some state behavior of the activity, The docs says that we should implement OnSaveInstanceState and OnReceiveInstanceState.
They say that this will save the activity state even after destroy or restarts. I care more about destroy (the activity is completely gone) , does that mean the bundles are considered persistent ?
when I open a pdf reader, clost it and open it again i see that it opens in the same page I was in. is this implemented using Bundles or oth
| 0 | [
2,
50,
14,
10194,
18,
19,
13005,
3032,
19,
7599,
2358,
202,
13,
60,
800,
3726,
3726,
76,
31,
259,
20,
2079,
109,
146,
3257,
16,
14,
2358,
15,
14,
9765,
18,
898,
30,
95,
378,
8713,
27,
19863,
108,
384,
2416,
3859,
17,
27,
99,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Unsharp mask for RGB images?
===
Is the Unsharp mask algorithm the same for RGB images as for grayscale?
Do I just apply it to all channels?
Or maybe I could convert RGB -> HSL and apply it, then go back to RGB?
Thanks | 0 | [
2,
367,
23646,
5983,
26,
761,
11400,
3502,
60,
800,
3726,
3726,
25,
14,
367,
23646,
5983,
9083,
14,
205,
26,
761,
11400,
3502,
28,
26,
2030,
5093,
60,
107,
31,
114,
5645,
32,
20,
65,
6328,
60,
54,
913,
31,
110,
8406,
761,
11400,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 we do Idp initiated SSO using WSO2?
===
I am a newbie to WSO2 and just demonstrated a test SAML SSO using the link http://wso2.org/library/articles/2010/07/saml2-web-browser-based-sso-wso2-identity-server.
Now I want to know If we can also perform Idp initiated SSO using the same.
Please correct me If I am wrong. | 0 | [
2,
92,
95,
107,
31,
7431,
6900,
13,
18,
656,
568,
619,
656,
135,
60,
800,
3726,
3726,
31,
589,
21,
78,
5893,
20,
619,
656,
135,
17,
114,
6861,
21,
1289,
1113,
255,
13,
18,
656,
568,
14,
3508,
7775,
6903,
499,
656,
135,
9,
55... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
tableView:commitEditingStyle:forRowAtIndexPath: not working
===
So, in my viewDidLoad method I called:
self.navigationItem.rightBarButtonItem = self.editButtonItem;
Then later on in my tableView:commitEditingStyle:forRowAtIndexPath: I do this:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[self.list removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
But when I delete a row in my tableView, while actually running the app, I get an exception thrown on the removeObjectAtIndex call to my list. I tried taking that out, but then I get another exception thrown on the tableView deleteRowsAtIndexPaths:withRowAnimation:
Please help!
Thanks in advance!
| 0 | [
2,
859,
4725,
45,
960,
15958,
1115,
1203,
4381,
45,
1106,
5417,
721,
25671,
8353,
45,
52,
638,
800,
3726,
3726,
86,
15,
19,
51,
1418,
3052,
8294,
2109,
31,
227,
45,
1119,
9,
325,
13227,
857,
2119,
79,
9,
4183,
1850,
811,
444,
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... |
Dynamic changing of sensor update rate
===
You can set the sensor update rate (frequency) when you register the sensor listener. But is it possible to change it dynamically?
Here's the problem: I want to get the readings from accelerometer on normal rate, but when the certain threshold is reached I want to have the readings as fast as possible. It can certainly be done with unregistering and then registering the listener again with new update parameter but if the threshold is reached very often, then it might become inefficient, I guess. Which is why I ask whether there is any way around. | 0 | [
2,
7782,
4226,
16,
14865,
11100,
1684,
800,
3726,
3726,
42,
92,
309,
14,
14865,
11100,
1684,
13,
5,
26389,
6,
76,
42,
2243,
14,
14865,
21772,
9,
47,
25,
32,
938,
20,
753,
32,
7782,
1326,
60,
235,
22,
18,
14,
1448,
45,
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... |
JSF 2.X Passing parameter between two xhtml pages
===
I am trying to pass parameter between two pages.my **User.xhtml** page has **ui:repeat** which displays user.I have access to the **user Id** as well. I want to click on the user and go to their details page. I have **userDetails.xhtml** which is blank at the moment.
I have a Bean as well.
Currently I am using **h:link** to navigate one page to another. And it works.
My mission is : Click on the user and get their details.
Please help, I am pretty new in JSF
Thanks | 0 | [
2,
487,
18,
410,
172,
9,
396,
2848,
18906,
128,
81,
993,
15895,
4434,
800,
3726,
3726,
31,
589,
749,
20,
1477,
18906,
128,
81,
4434,
9,
915,
13,
1409,
16704,
9,
396,
15895,
1409,
2478,
63,
13,
1409,
5661,
45,
99,
7081,
38,
1409,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
SQLite vs SQLite Management studio
===
Can anyone tell me what is the difference between SQLite and SQLite Management Studio? | 4 | [
2,
4444,
10601,
4611,
4444,
10601,
1097,
1120,
800,
3726,
3726,
92,
1276,
494,
55,
98,
25,
14,
2841,
128,
4444,
10601,
17,
4444,
10601,
1097,
1120,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Best program for making app for mobile (android, iphone and others)
===
i try for a few time now to make app for mobiles with appmobi XDK phoneGap XDK from appmobi, sencha and appcelerator but except iphone where the app works ok in android mobiles doesn't work well. Any other program except these or any tricks for make it work better in android and in others?
any help it will be very important
thanks | 0 | [
2,
246,
625,
26,
544,
4865,
26,
3241,
13,
5,
290,
18524,
15,
21024,
17,
654,
6,
800,
3726,
3726,
31,
1131,
26,
21,
310,
85,
130,
20,
233,
4865,
26,
3241,
18,
29,
4865,
79,
14398,
993,
43,
197,
1132,
1136,
306,
993,
43,
197,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 over come from Database Locked Exception?
===
I am implementing one app.
Related to my app i am calling data dase frequently.
I open the database by the fallowing code
public DataBaseHelper open() throws SQLException
{
mDbHelper = new DatabaseHelper(this.mCtx);
this.mDb = mDbHelper.getWritableDatabase();
return this;
}
but i got database locked exseption in the fallowing line
this.mDb = mDbHelper.getWritableDatabase();
If any one know how to overcome that please help me
Thanks in advance
| 0 | [
2,
184,
20,
84,
340,
37,
6018,
4011,
5391,
60,
800,
3726,
3726,
31,
589,
17333,
53,
4865,
9,
1597,
20,
51,
4865,
31,
589,
2555,
1054,
6804,
62,
3086,
9,
31,
368,
14,
6018,
34,
14,
1080,
3581,
68,
1797,
317,
6018,
14593,
106,
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... |
java audio frequency filter
===
I'm developing a simple audio player in java. The only advanced feature I need is a frequency filter. It's not necessarily a full-featured equalizer function, with different gains for specific frequency ranges: a low pass filter which cuts frequencies higher than a specified value would be enough.
I studied [jlGui][1] which has an equalizer, but it only works with MP3 data, while the files I will be playing are OGG.
Browsing through various answers I found that an ffmpeg wrapper like [Xuggler][2] or [Jave][3] could be a solution. But I didn't find any tutorial, not even a starting point on how to handle frequency filtering with ffmpeg.
Also JMF is described as a valid choice for implementing such a function, but I found nothing specific enough.
[1]: http://www.javazoom.net/jlgui/jlgui.html
[2]: http://www.xuggle.com/xuggler
[3]: http://www.sauronsoftware.it/projects/jave/index.php?lang=en | 0 | [
2,
8247,
4023,
5328,
11945,
800,
3726,
3726,
31,
22,
79,
3561,
21,
1935,
4023,
517,
19,
8247,
9,
14,
104,
2255,
1580,
31,
376,
25,
21,
5328,
11945,
9,
32,
22,
18,
52,
9324,
21,
503,
8,
26956,
43,
2747,
11907,
1990,
15,
29,
421... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Create a timer in asp.net Server side
===
i have a asp.net web application , in that application i will call a function once that function s called , it has to wait for some time interval then execution should take place how to do that.......
Thank you | 0 | [
2,
1600,
21,
85,
139,
19,
28,
306,
9,
2328,
8128,
270,
800,
3726,
3726,
31,
57,
21,
28,
306,
9,
2328,
2741,
3010,
13,
15,
19,
30,
3010,
31,
129,
645,
21,
1990,
382,
30,
1990,
13,
18,
227,
13,
15,
32,
63,
20,
1760,
26,
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... |
Strange incident of Controller#update not updating model at all
===
I have a strange case. Neither my co-worker nor me can figure out why it doesn't work. Perhaps someone had a similar case or can spot whatever it is we are overlooking. Here's what we have:
Rails 3.2.6
mysql Database
We have a `Comment` model. Like this:
# == Schema Information
#
# Table name: comments
#
# id :integer not null, primary key
# username :string(255)
# realname :string(255)
# email :string(255)
# title :string(255)
# content :text
# comment_date :datetime
# article_id :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# rating :float
#
class Comment < ActiveRecord::Base
attr_accessible :username, :realname, :email, :title, :content, :comment_date, :article_id, :rating
belongs_to :article, class_name: Goldencobra::Article, foreign_key: "article_id"
end
I tried it with `attr_accessible` and without to no effect.
I created a `CommentsController` like this:
class CommentsController < ApplicationController
skip_before_filter :verify_authenticity_token
protect_from_forgery only: [:index]
def index
@article = Goldencobra::Article.find(params[:id])
@comments = @article.comments
respond_to do |format|
format.rss
end
end
def create
@comment = Comment.new(params[:comment])
@comment.save!
flash[:notice] = 'Comment was successfully created.'
rescue ActiveRecord::RecordInvalid
render :action => :new
end
def update
@comment = Comment.find(params[:id])
if @comment && @comment.update_attributes(params[:comment])
render text: "Success", layout: false
else
render text: "No success", layout: false
end
end
end
What I want to to is use the update action to update the comment model. Like what we do every single time. Piece of cake…
Only, it doesn't update. Here is how I test for the update:
require 'spec_helper'
describe CommentsController do
def do_create
@article = Goldencobra::Article.create(title: "Testartikel", article_type: "Default Show")
post :create, :comment => {username: "johnny",
realname: "John Doe",
email: "johnny@gmail.com",
title: "Great title",
content: "What an awesome article.",
article_id: @article.id,
rating: 3.4}
end
it "should update a comment" do
do_create
put :update, id: Comment.first.id, comment: {title: "New great title"}
Comment.first.title.should eql("New great title")
end
end
I tried the same thing with updating via a REST-client (Rested.app on OS X)
![Restful try params][1]
![Restful try response][2]
[1]: http://i.stack.imgur.com/xpmbK.png
[2]: http://i.stack.imgur.com/uGx7F.png
I always get a "Success" response. `.update_attributes()` always succeeds. Thing is: It changes nothing. Here's the console log from the restful try:
Started PUT "/comments/10" for 127.0.0.1 at 2012-07-18 12:35:13 +0200
Processing by CommentsController#update as HTML
Parameters: {"comment"=>{"title"=>"neuer test"}, "id"=>"10"}
Comment Load (0.4ms) SELECT `comments`.* FROM `comments` WHERE `comments`.`id` = 10 LIMIT 1
(0.1ms) BEGIN
(0.1ms) COMMIT
Rendered text template (0.0ms)
Completed 200 OK in 4ms (Views: 0.4ms | ActiveRecord: 0.6ms | Solr: 0.0ms)
This is what it looks like, when I try the same thin in the rails console:
1.9.2p290 :017 > Comment.last.update_attributes(title: "test 2")
Comment Load (0.8ms) SELECT `comments`.* FROM `comments` ORDER BY `comments`.`id` DESC LIMIT 1
(0.2ms) BEGIN
(0.5ms) UPDATE `comments` SET `title` = 'test 2', `updated_at` = '2012-07-18 09:48:39' WHERE `comments`.`id` = 10
(3.4ms) COMMIT
=> true
What's missing is `UPDATE `comments` SET `title` = 'test 2', `updated_at` = '2012-07-18 09:48:39' WHERE `comments`.`id` = 10`. Can anybody tell me why my controller does not update the model?
Thank you.
| 0 | [
2,
2578,
3246,
16,
9919,
5910,
576,
8209,
52,
71,
43,
1880,
1061,
35,
65,
800,
3726,
3726,
31,
57,
21,
2578,
610,
9,
3028,
51,
326,
8,
22560,
2127,
55,
92,
1465,
70,
483,
32,
1437,
22,
38,
170,
9,
1774,
737,
41,
21,
835,
610... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
cout causing access violation in VC++ 10
===
apologies, I'm relatively new at C++, so I'm debugging this code, which is giving me an access violation the third time cout << is called (right after load_array returns):
#include <cstdlib>
#include <iostream>
#include <fstream>
#define FILENAME "H:\\test.preisach"
#define ROWS 32760
#define COLUMNS 4
using namespace std;
class cPreisach {
public:
float input;
float pdf[ROWS][COLUMNS];
void load_array (){
char c;
float value=0;
int getnum=0, rowno=0, columnno=0, power=0;
bool decimalpoint=false, exponential=false;
ifstream pdf_file (FILENAME);
if (pdf_file.is_open()) {
while (pdf_file.good()) {
c=pdf_file.get();
switch (c) {
case '0': if (exponential == false) {value = (value*10); if (decimalpoint=true) getnum++;} else power=power*10; break;
case '1': if (exponential == false) {value = (value*10)+1; if (decimalpoint=true) getnum++;} else power=(power*10)+1; break;
case '2': if (exponential == false) {value = (value*10)+2; if (decimalpoint=true) getnum++;} else power=(power*10)+2; break;
case '3': if (exponential == false) {value = (value*10)+3; if (decimalpoint=true) getnum++;} else power=(power*10)+3; break;
case '4': if (exponential == false) {value = (value*10)+4; if (decimalpoint=true) getnum++;} else power=(power*10)+4; break;
case '5': if (exponential == false) {value = (value*10)+5; if (decimalpoint=true) getnum++;} else power=(power*10)+5; break;
case '6': if (exponential == false) {value = (value*10)+6; if (decimalpoint=true) getnum++;} else power=(power*10)+6; break;
case '7': if (exponential == false) {value = (value*10)+7; if (decimalpoint=true) getnum++;} else power=(power*10)+7; break;
case '8': if (exponential == false) {value = (value*10)+8; if (decimalpoint=true) getnum++;} else power=(power*10)+8; break;
case '9': if (exponential == false) {value = (value*10)+9; if (decimalpoint=true) getnum++;} else power=(power*10)+9; break;
case '.': decimalpoint=true; break;
case 'E': exponential = true; break;
case ' ': if (value != 0){
value = value/(10^(getnum-power)); /*cout << rowno << columnno << "\n";*/ pdf[rowno][columnno] = value; value=0; power=0; getnum=0; decimalpoint=false;
exponential=false; columnno++;
} break;
case '\n': value = value/(10^(getnum-power)); /*cout << "newline" << rowno << columnno << "\n";*/ pdf[rowno][columnno] = value; value=0; power=0; getnum=0; decimalpoint=false;
exponential=false; rowno++; columnno=0; break;
}
}
pdf_file.close();
}
}
void do_calculation (float input) {}
};
int main () {
float input;
cout << "welcome to the preisach function \n";
cPreisach Preisach;
cout << "created object, loading array \n";
Preisach.load_array();
cout << "please input magnetic field strength \n";
cin >> input;
Preisach.do_calculation (input);
return 0;
}
I have no idea why cout could cause an access violation, but it must be something to do with the array, since if that function is commented out, cout is fine.
Thanks | 0 | [
2,
272,
1320,
3242,
1381,
12120,
19,
13,
8990,
20512,
332,
800,
3726,
3726,
27101,
15,
31,
22,
79,
3109,
78,
35,
272,
20512,
15,
86,
31,
22,
79,
121,
16254,
2762,
48,
1797,
15,
56,
25,
1438,
55,
40,
1381,
12120,
14,
422,
85,
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... |
Html decode to text view
===
I have a problem with header in text view. I use: `title.setText(Html.fromHtml(headerId));` to convert text to textview from html. Everything is ok but when I have <h1> or other header in html I get a html but with some space from margin. When I do some like this: `title.setText(Html.fromHtml(Html.fromHtml(headerId).toString));` and build version and after that I rturned to old version, my header is in correct place on right side without any space.
This is how it look:
![enter image description here][1]
and this is how it should looks:
![enter image description here][2]
as you can see Cola Bare is aligned to right but when I start first time that header is not aligned. How I can do that to work from first run?
[1]: http://i.stack.imgur.com/1JPZ5.png
[2]: http://i.stack.imgur.com/G2FMQ.png | 0 | [
2,
13,
15895,
121,
9375,
20,
1854,
1418,
800,
3726,
3726,
31,
57,
21,
1448,
29,
157,
106,
19,
1854,
1418,
9,
31,
275,
45,
13,
1,
22235,
9,
3554,
11969,
5,
15895,
9,
2665,
15895,
5,
1743,
106,
1340,
6,
6,
73,
1,
20,
8406,
185... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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... |
Play framework 2.0.2 - Java - check on template if image exists
===
I have a method in my controller that performs the download product images registered on the server, I use this method to display the images in a html page, the problem is that some products do not have the image, I wonder if there is any way to check in template if these images exists. | 0 | [
2,
418,
6596,
172,
9,
387,
9,
135,
13,
8,
8247,
13,
8,
2631,
27,
22894,
100,
1961,
5636,
800,
3726,
3726,
31,
57,
21,
2109,
19,
51,
9919,
30,
11563,
14,
7121,
2374,
3502,
3801,
27,
14,
8128,
15,
31,
275,
48,
2109,
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... |
Simple WSO2 ESB Soap interface
===
Myself: New to WSO2, Evaluating multiple ESB products
Here is what I am trying to do with wso2 ESB
1. Application "A" will send a zipcode (SOAP-WDSL) to WSO2-ESB
2. WSo2 will use that zip-code and query National WeatherService and obtain
the Lati-Long for zipcode
LatLonListZipCode method at
http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php?wsdl
3. Return the lat-Lon to Application "A"
Would someone please guide me , like where to start and the components needed so forth?
I am kind of confused by all the terminologies and over complicated product names and hierarchy (carbon, oxygen so forth)
| 0 | [
2,
1935,
619,
656,
135,
13,
160,
220,
6447,
6573,
800,
3726,
3726,
992,
45,
78,
20,
619,
656,
135,
15,
26764,
1886,
13,
160,
220,
1985,
235,
25,
98,
31,
589,
749,
20,
107,
29,
619,
656,
135,
13,
160,
220,
137,
9,
3010,
13,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Excel VBA Conditional Filter
===
simple VBA question. I need a VBA subroutine that will filter my data based on a condition (in this case, if what's in column C equals 11-Jun-12 [41071 in numeric form]) without looping through the whole data set. I've looked a bit at filtering on the Internet but nothing seems to be quite what I want (or I just don't really understand what's going on). To be clear, here's an example of what I want:
I want http://imgur.com/qebVv
to go to http://imgur.com/zDncq.
Thanks! | 0 | [
2,
20700,
566,
969,
21206,
11945,
800,
3726,
3726,
1935,
566,
969,
1301,
9,
31,
376,
21,
566,
969,
972,
8821,
7538,
30,
129,
11945,
51,
1054,
432,
27,
21,
2874,
13,
5,
108,
48,
610,
15,
100,
98,
22,
18,
19,
4698,
272,
2747,
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... |
Using GET parameters in JSF2
===
I'm trying to pass form field values as GET parameters between 2 views (called "A" and "B").
In "B", I handle the parameters with f:metadata and f:viewParam. This part works great if I use the URL directly.
However, now I would like to pass fields from another view "A", but currenly without success. The fields are defined as follows:
<h:form>
<p:inputText id="field1" value="#{A.field1}"/>
<p:inputText id="field2" value="#{A.field2}"/>
[...]
</h:form>
If I use f:param within a Primefaces p:button, the parameters are transmitted but not retrieved dynamically (in fact, if I check the web page html code, the initial values of the form are written "statically").
What is the best approach to handle this ?
Thanks in advance | 0 | [
2,
568,
164,
12905,
19,
487,
18,
410,
135,
800,
3726,
3726,
31,
22,
79,
749,
20,
1477,
505,
575,
4070,
28,
164,
12905,
128,
172,
4146,
13,
5,
4580,
13,
7,
58,
7,
17,
13,
7,
220,
7,
6,
9,
19,
13,
7,
220,
7,
15,
31,
3053,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 initialize X509_STORE object in OpenSSL?
===
I'm trying to implement OCSP functions of OpenSSL as described [here][1] and it requires X509_STORE object as a parameter. I have x.509 certificate that I want to check revocation status for, it's issuer certificate and the URL of the OCSP host.
How to properly initialize X509_STORE object having this information available? (I'm using C/C++ in XCode and OpenSSL v.1.0.0g)
[1]: http://etutorials.org/Programming/secure+programming/Chapter+10.+Public+Key+Infrastructure/10.12+Checking+Revocation+Status+via+OCSP+with+OpenSSL/ | 0 | [
2,
184,
20,
2104,
2952,
993,
264,
2545,
1,
16828,
3095,
19,
8965,
18,
255,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
8713,
13,
2499,
3401,
3719,
16,
8965,
18,
255,
28,
745,
636,
6836,
500,
2558,
165,
500,
17,
32,
4781,
993,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to use ajax to access code behind method with parameters
===
Currently I have this...
public void lnkTag_Click(object sender, EventArgs e){
...
}
Which is attached to the click() event of link buttons, but the problem is this requires a form resubmission when the user tries to back in the browser after clicking one.
I'd like to turn this into an ajax call that passes in the text value of the link. So to have a method like this in the code behind:
public void lnkTag_Click(string linkText){
...
}
Where this method is accessed via ajax on a
$('myLinkButton').click(function() {
$.ajax...
})
Any thoughts? Thanks. | 0 | [
2,
184,
20,
275,
20624,
20,
1381,
1797,
439,
2109,
29,
12905,
800,
3726,
3726,
871,
31,
57,
48,
9,
9,
9,
317,
11364,
644,
5719,
8628,
1,
150,
10129,
5,
23793,
2660,
106,
15,
807,
10663,
18,
13,
62,
6,
1,
13,
9,
9,
9,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to pick part of text file in directory and print section with STRIPOS in PHP?
===
I am trying to read text from files in a directory and have it be displayed as description text below an image. I have been able to use the STRIPOS function to separate out each part of the text, except am having trouble with the last section. The last section is titled "Description:" and actually runs into multiple lines. I don't know how to display more than just the line that reads "Description:". I want to print from "Description:" to the end of the file. I will post my code and the text file in this message.
$dirname = 'data';
$dirhandle = opendir($dirname);
$housestextarray = array();
if ($dirhandle)
{
while (false !==($file = readdir($dirhandle)))
{
if ($file !='.' && $file !='..')
{
array_push($housestextarray, $file);
}
}
closedir($dirhandle);
}
sort($housestextarray);
foreach ($housestextarray AS $housedescription)
{
$housetext = '';
$description = '';
$pos = stripos($housedescription, 'house_');
if ($pos === false)
{
//nothing
} else {
$lines_in_file = count(file($housedescription));
$fp=fopen($housedescription,"r");
for ($cntr = 1; $cntr <= $lines_in_file; $cntr++)
{
$cityline=fgets($fp);
$priceline=fgets($fp);
$bedroomsline=fgets($fp);
$bathsline=fgets($fp);
$footageline=fgets($fp);
$realtorline=fgets($fp);
$grabberline=fgets($fp);
$descriptionline=fgets($fp);
//print $cityline;
//print $descriptionline;
//$housetext .= $line;
print $description_clean;
$citypos = stripos($cityline, 'City:');
if ($citypos === false) //found the city line first time
{
//nothing
}
else
{
$city= $cityline."<br />\n";
//print $city;
}
$pricepos = stripos($priceline, 'Price:');
if ($pricepos === false) //found the city line first time
{
//nothing
}
else
{
$price = $priceline."<br />\n";
//print $price;
}
$bedroomspos = stripos($bedroomsline, 'Bedrooms:');
if ($bedroomspos === false) //found the city line first time
{
//nothing
}
else
{
$bedrooms = $bedroomsline."<br />\n";
//print $bedrooms;
}
$bathspos = stripos($bathsline, 'Baths:');
if ($bathspos === false) //found the city line first time
{
//nothing
}
else
{
$baths = $bathsline."<br />\n";
//print $baths;
}
$footagepos = stripos($footageline, 'Footage:');
if ($footagepos === false) //found the city line first time
{
//nothing
}
else
{
$footage = $footageline."<br />\n";
//print $footage;
}
$realtorpos = stripos($realtorline, 'Realtor:');
if ($realtorpos === false) //found the realtor line first time
{
//nothing
}
else
{
$realtor = $realtorline."<br />\n";
//print $realtor;
}
$grabberpos = stripos($grabberline, 'Grabber:');
if ($grabberpos === false) //found the grabber line first time
{
//nothing
}
else
{
$grabber_formatted = str_replace('Grabber:','', $grabberline);
$grabber = "<h3>".$grabber_formatted."</h3><br />\n";
//print $grabber;
}
$descriptionpos = stripos($descriptionline, 'Description: ');
if ($descriptionpos === false) //found the description line first time
{
//nothing
}
else
{
$description .= $descriptionline."<br />";
//print $description;
}
}
$output = $grabber."<br/>".$city.$bedrooms.$baths;
$output .= $price.$footage.$realtor."<br />";
$output .= "<br />".$description."<br />";
print $output;
}
And here is the text file contents example (one of six files):
City: OceanCove
Price: $950,000
Bedrooms: 5
Baths: 3
Footage: 3000 sq. ft.
Realtor: Shirley Urkiddeng
Grabber: Fantastic Home with a Fantastic View!
Description:
You will never get tired of watching the sunset
from your living room sofa or the sunrise
from your back porch with a view overlooking
the gorgeous coral canyon. Once in a lifetime
opportunity!
Thanks!!!
-Brad | 0 | [
2,
184,
20,
2036,
141,
16,
1854,
3893,
19,
16755,
17,
4793,
1050,
29,
4998,
759,
19,
13,
26120,
60,
800,
3726,
3726,
31,
589,
749,
20,
1302,
1854,
37,
6488,
19,
21,
16755,
17,
57,
32,
44,
6115,
28,
5318,
1854,
1021,
40,
1961,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Scrolling Toolbar
===
I am new to iOS development and I am working on a project but I can't figure out how to implement this scrolling toolbar. Just like you see in the Pandora App grabbing the toolbar and dragging up brings up volume control. Or in the lock screen dragging the camera up. If anyone can help me I would really appreciate it. | 0 | [
2,
13,
28166,
5607,
1850,
800,
3726,
3726,
31,
589,
78,
20,
13,
7760,
522,
17,
31,
589,
638,
27,
21,
669,
47,
31,
92,
22,
38,
1465,
70,
184,
20,
8713,
48,
13,
28166,
5607,
1850,
9,
114,
101,
42,
196,
19,
14,
21654,
4865,
991... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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 every row of duplicates within a table
===
I have code that grabs the duplicates in a SQL table and groups them by tracking number. I want to see EVERY row that duplicates, not just have them group. The code for getting the group of duplicates is below:
Select
CarrierID
, Mode
, TrackingNumber
, PickupID
, Reference1
, Reference2
, Quantity
, BilledWeight
, ActualWeight
, Zone
, ServiceLevel
, PickupDate
, SenderCompany
, SenderAddress
, SenderCity
, SenderState
, SenderZip
, ReceiverCompany
, ReceiverAddress
, ReceiverCity
, ReceiverState
, ReceiverZip
, FreightCharge
, Fuel
, Accessories
, TotalCharges
, WrongName
, WrongCompany
, WrongAddress
, WrongCity
, WrongState
, WrongZip
, WrongCountry
, CorrectedName
, CorrectedCompany
, CorrectedAddress
, CorrectedCity
, CorrectedState
, CorrectedZip
, CorrectedCountry
, Count(TrackingNumber) as TrackingNumberTotal
, Count(TotalCharges) as NumberofDuplicates
from Prasco_GencoShipments
group by
TrackingNumber
, TotalCharges
, CarrierID
, Mode
, TrackingNumber
, PickupID
, Reference1
, Reference2
, Quantity
, BilledWeight
, ActualWeight
, Zone
, ServiceLevel
, PickupDate
, SenderCompany
, SenderAddress
, SenderCity
, SenderState
, SenderZip
, ReceiverCompany
, ReceiverAddress
, ReceiverCity
, ReceiverState
, ReceiverZip
, FreightCharge
, Fuel
, Accessories
, TotalCharges
, WrongName
, WrongCompany
, WrongAddress
, WrongCity
, WrongState
, WrongZip
, WrongCountry
, CorrectedName
, CorrectedCompany
, CorrectedAddress
, CorrectedCity
, CorrectedState
, CorrectedZip
, CorrectedCountry
having (count(TrackingNumber) > 1 and (count(TotalCharges) > 1)) | 0 | [
2,
164,
352,
3131,
16,
19429,
18,
363,
21,
859,
800,
3726,
3726,
31,
57,
1797,
30,
15555,
14,
19429,
18,
19,
21,
4444,
255,
859,
17,
1170,
105,
34,
10353,
234,
9,
31,
259,
20,
196,
352,
3131,
30,
19429,
18,
15,
52,
114,
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... |
Windows Azure CDN with new management portal
===
How to find the Windows Azure CDN with new managment portal. To be noted i am using the Preview portal and in 90 days free trial | 0 | [
2,
1936,
25715,
1745,
103,
29,
78,
1097,
8281,
800,
3726,
3726,
184,
20,
477,
14,
1936,
25715,
1745,
103,
29,
78,
169,
3302,
1130,
8281,
9,
20,
44,
1525,
31,
589,
568,
14,
16121,
8281,
17,
19,
3151,
509,
551,
2178,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Netty App Design For Large Number of Small Transfers
===
I'm trying to decide how to design a Netty app with what I think are some unusual requirements. Basically there's a client that initiates a request. That request translates into English as "Go recursively get a bunch of little tiny files under directory /whatever/, and all I can tell you about those files is that their names are between AAAAAAA.bin and CCCCCCC.bin".
So, the server needs to take the request, and start scanning some directories on the server side, and start rapidly streaming all these little files back. Performance is critical, but so is making sure that I've received all files between AAAAAAA.bin and CCCCCCC.bin.
So would it be a good design to make the client and server basically asynchronus themselves? In other words, the client initiates the conversation, sends the request, and simply receives an acknowledgement UUID token or something, and then the server begins gathering up files (maybe one per thread), contacts the client, and hands it a single file along with the UUID? I'm thinking that the client could periodically ask the server "are you done streaming my request that matched UUID token /sometoken/?
I'm not quite sure how this would be configured, since the client and server both would be initiating conversations. Or, maybe someone else has a better design idea? Again, performance (total time from request initiation to completion of all file transfers) is critical.
Thanks! | 0 | [
2,
4275,
1084,
4865,
704,
26,
370,
234,
16,
284,
2617,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
4073,
184,
20,
704,
21,
4275,
1084,
4865,
29,
98,
31,
277,
50,
109,
4706,
4786,
9,
11374,
80,
22,
18,
21,
6819,
30,
17014,
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... |
What's the best way to parse a JSON object?
===
I've generated a json object (call it 'jItems') using $.getJSON. On the page, I've got a list of categories that the items in jItems fit into. My desire is to click a category and trigger a function to display only the items in that category. Would it be better to use getJson or jquery's each() or find() to pull the right items from jItems? | 0 | [
2,
98,
22,
18,
14,
246,
161,
20,
2017,
870,
21,
487,
528,
3095,
60,
800,
3726,
3726,
31,
22,
195,
6756,
21,
487,
528,
3095,
13,
5,
9200,
32,
13,
22,
13803,
1503,
18,
22,
6,
568,
5579,
9,
3060,
728,
528,
9,
27,
14,
2478,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
strftime: from where the locale (en, es...) is retrieved?
===
I have just found out the function `strftime()`. The manual says about it:
> Format a local time/date according to locale settings".
But...from where the locale (en, es...) is retrieved?
| 0 | [
2,
354,
8291,
891,
45,
37,
113,
14,
375,
62,
13,
5,
219,
15,
13,
160,
9,
9,
9,
6,
25,
3685,
60,
800,
3726,
3726,
31,
57,
114,
216,
70,
14,
1990,
13,
1,
384,
8291,
891,
5,
6,
1,
9,
14,
5132,
898,
88,
32,
45,
13,
1,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.