unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Rails Validates_uniqueness of scope not working
===
My validations raise an "Email already taken" error on the create method.
I have this validation in my Customer model:
validates :email, :uniqueness => {:scope => :account_id, :case_sensitive => false}
and this is what I'm seeing in my logs:
Customer Load (0.4ms) SELECT `customers`.* FROM `customers` WHERE `customers`.`account_id` = 2 AND `customers`.`email` = 'xxxxx@gmail.com' LIMIT 1
(0.1ms) BEGIN
Customer Exists (0.8ms) SELECT 1 AS one FROM `customers` WHERE `customers`.`email` = BINARY 'xxxxx@gmail.com' LIMIT 1
Customer Exists (0.3ms) SELECT 1 AS one FROM `customers` WHERE (`customers`.`email` = 'xxxxx@gmail.com' AND `customers`.`account_id` = 2) LIMIT 1
(0.2ms) ROLLBACK
Thanks for the help. | 0 | [
2,
2240,
18,
7394,
7759,
1,
1020,
5312,
720,
16,
9914,
52,
638,
800,
3726,
3726,
51,
27999,
18,
3972,
40,
13,
7,
62,
8079,
614,
658,
7,
7019,
27,
14,
1600,
2109,
9,
31,
57,
48,
27999,
19,
51,
7705,
1061,
45,
7394,
7759,
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... |
I have a xml file uploaded to a Web site through the post, using excel vba
===
I msut uploaded xml text to Web site through the post.
My xml text to manually paste the URL operating normally.
like: "http://mysever/Recv.jsp?Strxml=" & xml.text
-
I want to use "Http.send" have problems. It Http.Status is OK! But it seems my xml.text is not uploaded, because the web page set by value return is wrong.
This is my test code
Dim objhttp As New xmlHttp
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
URL = "https://myserver/html/Ent.jsp"
objHttp.setRequestHeader "Content-Type", "text/xml"
objHttp.Open "POST", URL, False
objHttp.send (xml_document.xml)
I am looking for information, it seems to use the "adodb.stream" to convert the hex
then I test my code
Dim stream As New ADODB.stream
Dim objHttp As New xmlHttp
Set stream = CreateObject("ADODB.Stream")
'stream.type = 2
stream.Charset = "Big5"
stream.type = adTypeText
stream.Open
stream.Position = 0
stream.LoadFromFile "V:\98848.xml"
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
URL = "https://myserver/html/Ent.jsp"
objHttp.setRequestHeader "Content-Type", "text/xml"
objHttp.Open "POST", URL, False
objHttp.send (stream.ReadText)
And It Http.Status is OK!But the return value of the page is still the first paragraph of the program.
Would like to ask where to have a problem
-
And web site and manually upload is "https://myserver/html/Recv.jsp?Strxml=", but the settings on the server is"https://myserver/html/Ent.jsp" there will be impact
- | 0 | [
2,
31,
57,
21,
23504,
3893,
23782,
20,
21,
2741,
689,
120,
14,
678,
15,
568,
20700,
566,
969,
800,
3726,
3726,
31,
4235,
1982,
23782,
23504,
1854,
20,
2741,
689,
120,
14,
678,
9,
51,
23504,
1854,
20,
23671,
640,
62,
14,
287,
636... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to create a self-extracting archive which will run a specific file when unzipped?
===
For example, I want to put a deployment of an application which includes `setup.exe` into a self-extracting archive. When the user executes the self-extracting archive it'll unzip the contents to a temp folder and run setup.exe.
Is this possible? If so, any examples? | 0 | [
2,
25,
32,
938,
20,
1600,
21,
1119,
8,
1706,
19915,
68,
9250,
56,
129,
485,
21,
1903,
3893,
76,
367,
2553,
3421,
69,
60,
800,
3726,
3726,
26,
823,
15,
31,
259,
20,
442,
21,
10475,
16,
40,
3010,
56,
1103,
13,
1,
3554,
576,
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... |
chi-squared goodness of fit test in R
===
I have a vector of observed values:
actual<-c(1411,439,214,100,62,38,29,64)
and also a vector of values calculated with model model :
expected<- c(1425.3,399.5,201.6,116.9,72.2,46.3,30.4,64.8)
now using the chi-squared goodness of fit test I want to see how well my model performs.
I write chisq.test(expected,actual) but i doesn't work.
can you help me with this? | 0 | [
2,
1833,
8,
12300,
43,
18509,
16,
2742,
1289,
19,
761,
800,
3726,
3726,
31,
57,
21,
7497,
16,
3634,
4070,
45,
3463,
1,
8,
150,
5,
14919,
14924,
3412,
15,
19029,
15,
4031,
15,
3698,
15,
3665,
15,
2738,
15,
3470,
6,
17,
67,
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... |
RIA Service generated {WEB_PROJECT}.g.cs can't find System.ComponentModel namespace
===
I created a new Silverlight 5 project using WCF RIA Service (SP2) which linked to my existing web project. It generated the {WEB_PROJECT}.g.cs for me under the Generated_Code folder.
However, this generated class can't find some namespace as below:
<code>
using System.ComponentModel;<br>
using System.ComponentModel.DataAnnotations;<br>
using System.ServiceModel.DomainServices;<br>
using System.ServiceModel.DomainServices.Client;<br>
using System.ServiceModel.DomainServices.Client.ApplicationServices;<br>
</code>
But I can use those namespace in the other class, for example, MainPage.cs, without any problems.
If I create anyohter SL 5 project and a new WEB project. it works fine.
Can anyone help me with this? Thanks. | 0 | [
2,
13,
2548,
365,
6756,
13,
1,
14113,
1,
21011,
1,
9,
263,
9,
6824,
92,
22,
38,
477,
329,
9,
11103,
218,
2291,
13998,
204,
5582,
800,
3726,
3726,
31,
679,
21,
78,
1172,
3130,
331,
669,
568,
11801,
410,
13,
2548,
365,
13,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How does the C# compiler decide to emit retargatable assembly references?
===
Retargetable assembly references have been introduced for the .NET Compact Framework and are now used to support Portable Class Libraries.
Basically, the compiler emits the following MSIL:
.assembly extern retargetable mscorlib
{
.publickeytoken = (7C EC 85 D7 BE A7 79 8E )
.ver 2:0:5:0
}
How does the C# compiler understand it has to emit a retargetable reference, and how to force the C# compiler to emit such reference even outside of a portable class library? | 0 | [
2,
184,
630,
14,
272,
5910,
21486,
4073,
20,
8468,
38,
302,
3958,
8778,
579,
1475,
7231,
60,
800,
3726,
3726,
302,
3958,
3060,
579,
1475,
7231,
57,
74,
1277,
26,
14,
13,
9,
2328,
8285,
6596,
17,
50,
130,
147,
20,
555,
13469,
718... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 MPMoviewPlayerController to UIViewController for fullscreen playback rotation
===
I have the same question with :
http://stackoverflow.com/questions/5014176/mpmoviewplayercontroller-fullscreen-playback-rotation-with-underlying-uiviewcont?rq=1
and I think the answer of this question is very useful. Then I add a UIViewController for this purpose.
First: youtubePlayer is a MPMoviePlayerController, the under code send youTubeView's frame to youtubePlayer and show youtubePlayer on youTubeView:
[youtubePlayer.view setFrame:youTubeView.bounds];
[youTubeView addSubview:youtubePlayer.view];
After switch to FullScreen, I want to add youtubePlayer.view to a new UIViewController, then it can auto-rotation:
playerFullScreen = [[UIViewController alloc]init];
[playerFullScreen.view addSubview:youtubePlayer.view];
[nav pushViewController:playerFullScreen animated:NO];
but the screen turn white, video not show up, what should I do ? | 0 | [
2,
3547,
4628,
1293,
4725,
14049,
12898,
1252,
20,
13,
5661,
4725,
12898,
1252,
26,
503,
7187,
21306,
9431,
800,
3726,
3726,
31,
57,
14,
205,
1301,
29,
13,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
2290,
1419,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where and how does the CLR allocate memory for JITted code?
===
Where and how does the CLR allocate memory for JITted code.
Data/Code section, HeapAlloc/VirtualAlloc/something else? | 0 | [
2,
113,
17,
184,
630,
14,
10842,
139,
65,
111,
9530,
1912,
26,
13,
13803,
1427,
1797,
60,
800,
3726,
3726,
113,
17,
184,
630,
14,
10842,
139,
65,
111,
9530,
1912,
26,
13,
13803,
1427,
1797,
9,
1054,
118,
9375,
1050,
15,
15414,
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,
0,
0,
0,
0,
0,
0,
0... |
Editing the layout of a custom Soft keyboard
===
I'm building a custom Soft Keyboard in Android, so I created my Service, also I have a keyboard xml resource looking like this :
<Keyboard android:horizontalGap="0px" android:verticalGap="0px">
<Row android:keyWidth="25%" android:keyHeight="10%" >
<Key android:keyLabel="Q" />
<Key android:keyLabel="W" />
<Key android:keyLabel="E" />
<Key android:keyLabel="R" />
</Row>
<!-- ... lots of rows and keys ... -->
</Keyboard>
The keyboard works perfectly, and I also have a PreferenceActivity to configure the keyboard, which also works. My problem is that some of the options in the PreferenceActivity need to hide some of the keys. But there's no method in the Keyboard, Keyboard.Row or Keyboard.Key classes to hide a specific key.
Is this possible ? Or do I have to create a different xml for each visible combinations? | 0 | [
2,
9510,
14,
9106,
16,
21,
5816,
1856,
8896,
800,
3726,
3726,
31,
22,
79,
353,
21,
5816,
1856,
8896,
19,
13005,
15,
86,
31,
679,
51,
365,
15,
67,
31,
57,
21,
8896,
23504,
6577,
699,
101,
48,
13,
45,
13,
1,
4237,
2806,
13005,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Rails connect to a remote server to fetch data asynchronously?
===
How can a Controller section of a RoR app initiate and maintain a connection to a remote server that feeds it with XML snippets?
I'm new to RoR and Ruby, but whatever I've been reading about it seems to work the exact opposite direction: A browser request initiates events in the Controller.
I want to initiate a TCP connection, at application initialization and throughout the application lifetime, to a JavaEE server and receive XML snippets that update stuff in the Model. | 0 | [
2,
184,
92,
2240,
18,
6379,
20,
21,
5388,
8128,
20,
18312,
1054,
21,
16023,
13985,
60,
800,
3726,
3726,
184,
92,
21,
9919,
1050,
16,
21,
761,
248,
4865,
17014,
17,
4027,
21,
2760,
20,
21,
5388,
8128,
30,
17058,
32,
29,
23504,
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... |
Total number of Likes on an Open Graph Object?
===
Is there anyway to get the total number of times am object has been liked in the Open Graph?
I'm referring to the new Like action: http://developers.facebook.com/docs/opengraph/actions/builtin/likes/
Thanks! | 0 | [
2,
600,
234,
16,
101,
18,
27,
40,
368,
7210,
3095,
60,
800,
3726,
3726,
25,
80,
2774,
20,
164,
14,
600,
234,
16,
436,
589,
3095,
63,
74,
3345,
19,
14,
368,
7210,
60,
31,
22,
79,
7378,
20,
14,
78,
101,
1028,
45,
7775,
6903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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" CoreAudio headers on Mac OSX
===
I've been at this for a few days now and I can safely say I'm stumped and haven't made progress on my own. I'm attempting to compile a project included in the XCode documentation (SinSynth) but every time I attempt to build it, I get errors upon errors about missing header files. "Okay," I thought enthusiastically, "Take a deep breath and let's use this as an opportunity to better learn XCode."
I looked at the paths the compiler told me it was looking for the headers in, added them, and then got more warnings because files needed to reference one another in the same folder (This files were not the missing header files - they were other files included that had definitions and what looked like boiler plate code). At this point I was a bit confused as to why the headers weren't installed in the first place. I uninstalled and reinstalled XCode but still had the same errors.
My question is where do I need to put the header files and cpp files included in the Audio Tools for Mac download? This is my first time having to break open XCode and add content, and thus far I've found no newbie-friendly tutorials to help me with this. To say it bluntly, I'm confused! What should I do? | 0 | [
2,
13,
7,
108,
21300,
68,
7,
2884,
1346,
6921,
157,
445,
27,
1572,
13,
759,
396,
800,
3726,
3726,
31,
22,
195,
74,
35,
48,
26,
21,
310,
509,
130,
17,
31,
92,
9817,
395,
31,
22,
79,
15781,
69,
17,
2933,
22,
38,
117,
3455,
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... |
numberOfRowsInSection returning 0 in a threaded viewController
===
I have a viewController in an app that retrieves Data from JSON, parses it and populates in UITableView. I am using thread to load data so that app does not hang when it is retrieving data.
**Problem:**
numberOfRowsInSection returns 0 and UITableView does not get populated sometimes when app is started. While sometimes, everything works fine. It is all random :S
**Possible Explanation:**
The problem is, it seems like, sometimes numberOfRowsInSection is called before data is retrieved. numberOfRowsInSection returns the value of count of a NSMutableArray called 'subjects'. Objects in 'subjects' are added when loadData is called. So the numberOfRowsInSection should return the count of 'subjects' and it should not be called after 'subjects' is populated.
Sometimes when I start the app, numberOfRowsInSection is called after 'subjects' is populated and UITableView shows data but sometimes when I start the app, numberOfRowsInSection is called before 'subjects' is populated and UITableView shows no data.
**Code:**
Here is my code:
-(void)loadData:(id)sender
{
dispatch_queue_t getRemindersQueue=dispatch_queue_create("reminders JSON downloader with reload Button", NULL);
dispatch_async(getRemindersQueue, ^{
[self getReminders];
dispatch_async(dispatch_get_main_queue(), ^{
self.navigationItem.rightBarButtonItem=sender;
[self.tableView reloadData];
});
});
dispatch_release(getRemindersQueue);
}
-(void)getReminders
{
NSURL * aURL = [NSURL URLWithString: @"http://www.merrycode.com/apps/IELTS/RemindersJSON"];
NSURLRequest *request = [NSURLRequest requestWithURL:aURL cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:10.0];
NSError *responseError=nil;
// Perform request and get JSON back as a NSData object
NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:&responseError];
if(responseError)
{
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView *parsingError = [[UIAlertView alloc] initWithTitle:@"Network Error"
message:@"Can not reach the servers. Make sure you are connected to the internet."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[parsingError show];
});
return;
}
NSString *str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
NSLog(@" String of Reminders JSON: %@",str);
NSString *newStr= [self stringByRemovingControlCharacters:str];
response = [newStr dataUsingEncoding:NSUTF8StringEncoding];
NSError *jsonParsingError = nil;
NSArray *publicTimeline = [NSJSONSerialization JSONObjectWithData:response options:0 error:&jsonParsingError];
NSLog(@"%@", jsonParsingError);
NSLog(@" publicTimeline Array Count: %d", [publicTimeline count]);
if([publicTimeline count] == 0)
{
dispatch_async(dispatch_get_main_queue(), ^{
UIAlertView *parsingError = [[UIAlertView alloc] initWithTitle:@"Error Retriving Data"
message:@"There was an error reciving data from the server."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[parsingError show];
});
return;
}
NSDictionary *colleges;
for(int i=0; i<[publicTimeline count];i++)
{
colleges= [publicTimeline objectAtIndex:i];
NSLog(@"Reminders: %@", [colleges objectForKey:@"title"]);
[self.subjects addObject:[colleges objectForKey:@"title"]];
[self.dates addObject:[colleges objectForKey:@"date"]];
[self.description addObject:[colleges objectForKey:@"desc"]];
}
[self.subjectsInNSUserDefaults removeAllObjects];
[self.datesInNSUserDefaults removeAllObjects];
[self.descriptionInNSUserDefaults removeAllObjects];
[self.userDefaults setObject:self.subjects forKey:@"SUBJECTS"];
[self.userDefaults setObject:self.dates forKey:@"DATES"];
[self.userDefaults setObject:self.description forKey:@"DESCRIPTION"];
[self.userDefaults synchronize];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
NSLog(@"Array Count in numberOfRowsInSection: %d",[self.subjects count]);
return [self.subjects count];
} | 0 | [
2,
234,
1041,
5417,
18,
108,
10579,
2485,
713,
19,
21,
9322,
69,
1418,
12898,
1252,
800,
3726,
3726,
31,
57,
21,
1418,
12898,
1252,
19,
40,
4865,
30,
11917,
18,
1054,
37,
487,
528,
15,
2017,
7202,
32,
17,
1675,
12383,
18,
19,
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... |
GET Request for SVG by jQuery gives 500 Internal Service Error
===
I am using a jQuery/SVG map to create points on a world map. After linking jQuery and the javascript libraries I run:
<script type="text/javascript">
$(document).ready(function() {
$('#map').mapSvg({
source: 'maps/world_high.svg',
width: 600,
height: 350
});
});
</script>
It works perfectly on my localhost running the same apache version. But when I upload it to my website it does not render and firebug gives me this error:
 | 0 | [
2,
164,
3772,
26,
13,
18,
22955,
34,
487,
8190,
93,
2352,
3033,
3117,
365,
7019,
800,
3726,
3726,
31,
589,
568,
21,
487,
8190,
93,
118,
18,
22955,
2942,
20,
1600,
819,
27,
21,
126,
2942,
9,
75,
12585,
487,
8190,
93,
17,
14,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Event with confirm lost after postback raised for other control
===
I have this scenario
TextBox with AutoPostBack=true and server-side code to manage text changes.
<asp:TextBox ID="inputTextAnswer" runat="server" AutoPostBack="true" OnTextChanged="inputTextAnswer_TextChanged"></asp:TextBox>
Button with server-side set confirm and code to manage.
btnSend.Attributes.Add("onClick", "return confirm('Confirm message')");
....
<asp:Button ID="btnSend" runat="server" OnClick="btnSend_Click" Text="btnSend" />
Everything is inside an UpdatePanel
When the user is writing at the TextBox and, whithout leave the textbox focus, click the button, the confirm appears, and behind the inputTextAnswer_TextChanged is raised and executed. Then the page has processed the PostBack so if user click 'Ok' at the confirm nothing is executed. User need to click again to really execute the button code.
Is there a way to run the inputTextAnswer_TextChanged code (should be executed first) and then the button code. Important: Not always should be executed one after another, just when the user fill the textbox field and then click the button
| 0 | [
2,
807,
29,
10265,
529,
75,
678,
1958,
1127,
26,
89,
569,
800,
3726,
3726,
31,
57,
48,
12705,
1854,
5309,
29,
3108,
6962,
1958,
3726,
13398,
17,
8128,
8,
1416,
1797,
20,
4705,
1854,
1693,
9,
13,
1,
472,
306,
45,
11969,
5309,
492... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Channel API python can't understand one part
===
I am trying to build a chat application using channel api in google app engine.
When going through <http://developers.google.com/appengine/docs/python/channel/overview>
I could not understand the opening the socket part using the XMLHttpRequest();
Any help will be appreciated!!
Thanks
| 0 | [
2,
1318,
21,
2159,
20059,
92,
22,
38,
1369,
53,
141,
800,
3726,
3726,
31,
589,
749,
20,
1895,
21,
6615,
3010,
568,
1318,
21,
2159,
19,
8144,
4865,
1406,
9,
76,
228,
120,
13,
1,
21127,
6903,
26051,
445,
9,
16111,
4875,
9,
960,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Magento Configurable Product Attribute
===
I would like to add a parameter to each option of a configurable product
For example- I want to create pillows in 3 sizes - S, M, L
but each size of pillow uses some z yards of fabric which varies for each size.
The following image displays it better. Any ideas on how I should proceed? *I am fairly new to Magento development. Is this something that can be achieved out of the box or needs to be coded?
![So each size has a textbox for entering yards associated with each size][1]
[1]: http://i.stack.imgur.com/dJbcu.png | 0 | [
2,
4723,
17050,
1065,
13549,
579,
2374,
35,
14755,
800,
3726,
3726,
31,
83,
101,
20,
3547,
21,
18906,
20,
206,
4255,
16,
21,
1065,
13549,
579,
2374,
26,
823,
8,
31,
259,
20,
1600,
7633,
18,
19,
203,
13403,
13,
8,
13,
18,
15,
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... |
PyQt QMessageBox acting funny
===
I have somewhat strange issue with my QMessageBox answers. This function is used to remove a row from an SQLite database. Before deletion, a message box pops and asks for confirmation. Query executes fine, except it ALWAYS deletes, whether I answer with YES or NO.
here is the code:
def deleteFromDB(self):
name = (str(self.ui.searchName.text()).upper())
if name:
with con:
cur = con.cursor()
cur.execute('SELECT name FROM cases WHERE name =?',[name])
tempname = str(cur.fetchone())
if len(tempname) != 4 :
reply = QtGui.QMessageBox.question(self, 'Removal',
"Are you sure ", QtGui.QMessageBox.Yes |
QtGui.QMessageBox.No, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes:
cur.execute('DELETE FROM cases where name =?',[name]) | 0 | [
2,
7103,
1251,
38,
2593,
3845,
18,
1303,
5309,
2180,
5066,
800,
3726,
3726,
31,
57,
4131,
2578,
1513,
29,
51,
2593,
3845,
18,
1303,
5309,
6709,
9,
48,
1990,
25,
147,
20,
4681,
21,
3131,
37,
40,
4444,
10601,
6018,
9,
115,
28916,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
file_get_contents into a json variable- twitter module
===
I am extremely new to json and have been working on this issue for about a week.
I used php to retrieve tweets from a list of accounts and stored them into a .txt file
<?php
$cache = dirname(__FILE__) . '/../cache/twitter-json.txt';
$data = file_get_contents('http://api.twitter.com/1/lists/statuses.json? slug=widget&owner_screen_name=webcodepro&count=1&page=1&per_page=8&include_rts=true&include_entities=true');
$cachefile = fopen($cache, 'wb');
fwrite($cachefile,utf8_encode($data));
fclose($cachefile);
?>
The way the architect has the front-end page structured is that I need to store the json value (what I have in the .txt file) into a json variable in a .js file and render it.
Is it possible to store the contents of a .txt file into a json variable in a .js file? | 0 | [
2,
3893,
1,
3060,
1,
25424,
18,
77,
21,
487,
528,
7612,
8,
10623,
12613,
800,
3726,
3726,
31,
589,
3898,
78,
20,
487,
528,
17,
57,
74,
638,
27,
48,
1513,
26,
88,
21,
877,
9,
31,
147,
13,
26120,
20,
11917,
20224,
18,
37,
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... |
Simple logic prob to draw possible combination
===
I want to find all possible combination of letters and dot “.”
Condition is that suppose if we have 2 letter "ab" then using "." in between them we can make combination as “a.b”
Same for 3 letters "abc" we can make possible combination "a.bc", "ab.c" and "a.b.c"
Same for 4 letter "abcd" we can make "a.bcd", "ab.cd", "abc.d", "a.b.cd", "a.b.c.d", "ab.cd", "ab.c.d", "a.bc.d" and "abc.d".
For above problem I try to make a c++ program to find all possible combination for any number of letters but I dint able to find a right solution.
Please somebody help me on it. Thanks in advance...
| 1 | [
2,
1935,
7085,
895,
220,
20,
2003,
938,
3733,
800,
3726,
3726,
31,
259,
20,
477,
65,
938,
3733,
16,
2516,
17,
14123,
13,
1,
9,
1,
2874,
25,
30,
5787,
100,
95,
57,
172,
1748,
13,
7,
2297,
7,
94,
568,
13,
7,
9,
7,
19,
128,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Crashing on simulator, not on device
===
My app crashes (randomly by the way) when running on the device, the crash is not reproduce-able 100% of the time. But it only seems to occur on the device, not in the simulator.
When I run in the simulator with NSZombies I never see problems. Could someone shed some light into my points below.
- Device has limited memory, maybe it's crashing because of this.
- What would be considered a big memory allocation that would cause a crash?
- Would memory leaks/big allocation cause a memory corruption?
- All my crashes are always EXC_BAD_ACCESS but like I said, never happens on simulator so I can't run zombies. (or is there another way?)
Note I have also simulated low memory warnings on the simulator to see if that's causing issues.
This is driving me nuts. Any help would be appreciated. | 0 | [
2,
14604,
27,
24565,
15,
52,
27,
3646,
800,
3726,
3726,
51,
4865,
21563,
13,
5,
2195,
5555,
102,
34,
14,
161,
6,
76,
946,
27,
14,
3646,
15,
14,
4597,
25,
52,
21509,
8,
579,
12849,
16,
14,
85,
9,
47,
32,
104,
2206,
20,
3744,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
VS2010 SP1 Variable Inspection
===
I have a project in C#/.NET4 in which there are several nested loops within a method. Recently, I have noticed that I can't mouseover to inspect variable values within these loops. In fact, if I go to the immediate window and try to research the value manually, the compiler reports that the variable doesn't exist. When I mouseover nothing appears, but its only at certain parts of one method. If I look in other parts of the same code (I haven't been able to figure out what the difference between the parts is in terms of debugging) mouseover works fine. I have things as simple as :
code
code
for (int i = 0...)
{
XX Breakpoint is hit here XX
}
and I can't get the value of i! Is there some limitation of the VS2010 debugger that is a known issue where it would affect only certain sections of code? I deleted all my PDB files, completely rebuilt the files from scratch, and still it doesn't seem to know the variable exists. Any advice is greatly appreciated on this one. | 0 | [
2,
4611,
2751,
3782,
165,
7612,
9762,
800,
3726,
3726,
31,
57,
21,
669,
19,
272,
5910,
118,
9,
2328,
300,
19,
56,
80,
50,
238,
5618,
69,
19661,
363,
21,
2109,
9,
1989,
15,
31,
57,
2711,
30,
31,
92,
22,
38,
7567,
2549,
20,
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... |
Mercurial new suprepository in nested subrepository
===
I'm not sure if this is possible, and if it's not any alternative solutions would be welcomed!
I have a number of solutions using Orchard - which mandates that any modules be in a certain directory inside it's folder structure. I have some modules, and based on the power of DVCS I'd like to be able to reproduce a new project using just suprepos. And also update Orchard with just Mercurial.
My folder structure looks like:
Project
- Orchard
- Modules
- Orchard module 1
- Orchard module 2
- My other code
I've just copied the orchard files to my repo, and then added my modules as subrepos.
What I'd like to be able to do is to also have the rest of the Orchard structure a subrepo. But I can't find a way to have a suprepo inside another subrepo. It won't be a nested subrepo, as the 'base' repo will be mine in both cases (orchard and the modules).
ie Project/.hgsub would look like:
Orchard = http://path/to/orchard
Orchard/Modules/Module1 = http://path/to/module1
Orchard/Modules/Module2 = http://path/to/module2
But this doesn't seem to work and I can't find documentation to say if/how I can do it.
Any help appreciated!
| 0 | [
2,
9046,
3594,
192,
78,
11128,
99,
14882,
14599,
19,
5618,
69,
972,
99,
14882,
14599,
800,
3726,
3726,
31,
22,
79,
52,
562,
100,
48,
25,
938,
15,
17,
100,
32,
22,
18,
52,
186,
2676,
6776,
83,
44,
11853,
187,
31,
57,
21,
234,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Check and save emails from GMAIL as PDF from command line?
===
Hi I'd like to build a script that can basically log into gmail, check for certain mail by a given criteria, save the conversation as a PDF (or something) on my local machine, and then log off. Has anyone done something like this before? | 0 | [
2,
2631,
17,
2079,
8517,
18,
37,
489,
8079,
28,
13,
11124,
37,
1202,
293,
60,
800,
3726,
3726,
4148,
31,
22,
43,
101,
20,
1895,
21,
3884,
30,
92,
11374,
6738,
77,
489,
8079,
15,
2631,
26,
1200,
4216,
34,
21,
504,
9157,
15,
207... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Posting File Input as FileReader Binary Data through AJAX Post
===
I am trying to post an attachment uploaded to an HTML file input to a web page through a rest API. The API documentation states that the post is a straight binary content as the body of the HTTP request, not a form file upload.
My code is as follows:
$('#_testButton').bind('click', function() {
var file = document.getElementById('_testFile').files[0]
var reader = new FileReader();
reader.onload = function () {
$.ajax({
url:'/attachmentURL',
type:'POST',
data: reader.result
})
}
reader.readAsBinaryString(file)
})
I need this to work for a number of different mimeTypes, so I didn't declare it in the code above. However, I have tried declaring contentType:'application/msword' for a .doc file and also tried processData:false and contentType:false.
The data is being posted where it should. However, when I open the file, I get a message that says mimeType:application/x-empty with an empty file OR a file with a bunch of binary characters. I've tried .doc files and a pdf files and the result is the same for both.
Does anyone have a clue what I can change to make this work? | 0 | [
2,
15669,
3893,
6367,
28,
3893,
10647,
106,
14171,
1054,
120,
20624,
678,
800,
3726,
3726,
31,
589,
749,
20,
678,
40,
14575,
23782,
20,
40,
13,
15895,
3893,
6367,
20,
21,
2741,
2478,
120,
21,
760,
21,
2159,
9,
14,
21,
2159,
13945,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: Reload page does not work when modal is hidden
===
I have a table where the last tag "td" got a call to a modal window. The problem is that only works for first modal window when it is hidden the page reloads, but for the other modal windows reload does not work.
<a class="icon-remove-sign" id="exclusao" href="#modalExclude{{janela.campanha.id}}" data-toggle="modal" title="Excluir"></a>
// this generate the following urls:
// http://localhost:8000/display/detail/15/#modalExclude11
// http://localhost:8000/display/detail/15/#modalExclude12
// http://localhost:8000/display/detail/15/#modalExclude13
The JQuery code:
$(function () {
$('#exclusao').click( function() {
var $modal = $(this).attr('href');
console.log($modal); // show the href only for the first row --> #modalExclude11
// show modal
$($modal).modal({
show: false,
});
// clean message info in modal
$('div#messageExclude').html('');
// reload page when modal is hidden
$($modal).on('hidden', function () {
window.location.reload(true) // work only for the first row --> #modalExclude11
});
});
});
All modals are shown correctly, but only makes the page reload to the first row of the table. Does anyone know what can be?
Thanks! | 0 | [
2,
10623,
5894,
16514,
45,
27339,
2478,
630,
52,
170,
76,
13,
20756,
25,
3689,
800,
3726,
3726,
31,
57,
21,
859,
113,
14,
236,
3383,
13,
7,
38,
43,
7,
330,
21,
645,
20,
21,
13,
20756,
1463,
9,
14,
1448,
25,
30,
104,
693,
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... |
Dynamically changing list view t in android
===
In my app I get few details in the realtime and I want to show them in LIstview with onclick listener. I know how to just put the list view but I dont know how to provide a Oncliklister for dynamically chagning view .
Can any one provide a some insight on the same ..
| 0 | [
2,
7782,
1326,
4226,
968,
1418,
13,
38,
19,
13005,
800,
3726,
3726,
19,
51,
4865,
31,
164,
310,
3289,
19,
14,
683,
891,
17,
31,
259,
20,
298,
105,
19,
968,
4725,
29,
27,
150,
10129,
21772,
9,
31,
143,
184,
20,
114,
442,
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... |
event handling in wxpython
===
In wxpython, is it better to handle events by creating a separate function for each event handler (say a separate function for every single button click) or to create one large button_handler, and then determine the button clicked from there?
Basically, I am wondering if it is more resource intensive to have many different events being watched for each separate thing, or just one big event that will figure out which one was clicked when it was fired. | 0 | [
2,
807,
7988,
19,
619,
396,
6448,
11570,
800,
3726,
3726,
19,
619,
396,
6448,
11570,
15,
25,
32,
574,
20,
3053,
963,
34,
2936,
21,
1725,
1990,
26,
206,
807,
24641,
13,
5,
6366,
21,
1725,
1990,
26,
352,
345,
5167,
10840,
6,
54,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java TimeZone offset
===
I need to save the phone's timezone in the format [+/-]hh:mm
I am using TimeZone class to deal with this, but the only format I can get is the following:
PST -05:00
GMT +02:00
I would rather not substring the result, is there any key or option flag I can set to only get the value and not the name of that timezone (GMT/CET/PST...)? | 0 | [
2,
8247,
85,
11661,
17493,
800,
3726,
3726,
31,
376,
20,
2079,
14,
1132,
22,
18,
85,
11661,
19,
14,
2595,
636,
2430,
118,
8,
500,
10681,
45,
3363,
31,
589,
568,
85,
11661,
718,
20,
1183,
29,
48,
15,
47,
14,
104,
2595,
31,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Microprocessor vs. web page communication?
===
I'm currently working on a project where I want to control a microprocessor (Arduino) from a web page.
The microprocessor will not be connected physically to the computer.
- What is the best protocol for communication? (My current choice is TCP).
- What is the best way to serialize the objects to be sent? (My current choice is JSON).
The server side is written in NodeJs.
Since I'm new to this kind of development I would very much appreciate any input on the topic! | 0 | [
2,
2899,
16835,
248,
4611,
9,
2741,
2478,
3291,
60,
800,
3726,
3726,
31,
22,
79,
871,
638,
27,
21,
669,
113,
31,
259,
20,
569,
21,
2899,
16835,
248,
13,
5,
1514,
291,
3252,
6,
37,
21,
2741,
2478,
9,
14,
2899,
16835,
248,
129,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to store unsigned short in java?
===
So generally I'm using Netty and it's BigEndianHeapChannelBuffer to receive unsinged short (from c++ software) in Java.
When I do it like this:
`buf.readUnsignedByte(); buf.readUnsignedByte();`
it returns:
`149 and 00`. Till now everything is fine. Because server sent 149 as unsigned short [4 bytes].
Instead of this I would like to receive unsigned short (ofc after restarting my application):
`buf.readUnsignedShort();`
and magic happens. It returns: `38144`.
Next step is to retrieve unsigned byte:
` short type = buf.readUnsignedByte();
System.out.println(type);`
and it returns: `1` which is correct output.
Could anyone help me with this?
I looked deeper and this is what netty does with it:
public short readShort() {
checkReadableBytes(2);
short v = getShort(readerIndex);
readerIndex += 2;
return v;
}
public int readUnsignedShort() {
return readShort() & 0xFFFF;
}
But still I can't figure what is wrong. I would like just be able to read that 149. | 0 | [
2,
184,
20,
1718,
28839,
502,
19,
8247,
60,
800,
3726,
3726,
86,
1469,
31,
22,
79,
568,
4275,
1084,
17,
32,
22,
18,
580,
2451,
806,
438,
2552,
10928,
2345,
6866,
20,
2588,
367,
18,
68,
69,
502,
13,
5,
2665,
272,
20512,
2306,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL: Get difference between two values in one table (multiple userids)?
===
I was trying to find a solution but did not succeed even if it seems simple. So this might be a newbie question...
I have a table **userscores** with 3 columns:
date userid points
2012-05-01 1 23
2012-06-01 1 34
2012-07-01 1 44
2012-05-01 2 78
2012-06-01 2 94
2012-07-01 2 99
2012-06-01 3 2
2012-07-01 3 9
Now I need to get the **difference** of the points between 2012-05-01 and 2012-06-01 **for each user**.
Users' points that are not existing (example userid 3) have to be calculated as 2 - 0... for this I guess I can use COALESCE(qa_points,0).
I read about combining [two subqueries](http://stackoverflow.com/questions/2326733/finding-the-difference-between-two-values-in-the-same-column-in-mysql) for the calculation but failed implementing it.
Any help appreciated. | 0 | [
2,
51,
18,
22402,
45,
164,
2841,
128,
81,
4070,
19,
53,
859,
13,
5,
21531,
5106,
4155,
9178,
6,
60,
800,
3726,
3726,
31,
23,
749,
20,
477,
21,
4295,
47,
144,
52,
7952,
166,
100,
32,
2206,
1935,
9,
86,
48,
530,
44,
21,
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... |
CSS - image overflow tricks
===
I'm stucking with some design techniques where I want to make image item box like this
![enter image description here][1]
[1]: http://i.stack.imgur.com/EylPh.png
Where the actual image can be upto maximum height of **300px** and width of **225px**. The width and height of the item box including the image and the text is **190px x 190px** I'm using this image http://farm8.staticflickr.com/7122/7424355198_72620895bd_m.jpg
I tried using `overflow: hidden` for the image item to hide it's height below to show the image text. But I'm getting only like this http://jsfiddle.net/Dkh4q/
Could anyone tell the mistake I've done?
Thanks!
**UPDATE**
For more information about the expected result, if you can login to zerply, then please check this http://zerply.com/christievdc/portfolio for example. | 0 | [
2,
272,
18,
18,
13,
8,
1961,
20285,
13747,
800,
3726,
3726,
31,
22,
79,
4549,
68,
29,
109,
704,
4212,
113,
31,
259,
20,
233,
1961,
9101,
1649,
101,
48,
13,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
165,
500,
636,
165,
500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RSA with large key size Encryption
===
I'm trying to encrypt an array of 256 bytes by using RSACryptoServiceProvider but I'm getting an exception of "Bad Length" each time.
byte[] seed = new byte[256];
byte[] cypherSeed = new byte[256];
RNGCryptoServiceProvider gen = new RNGCryptoServiceProvider();
gen.GetBytes(seed);
using (RSACryptoServiceProvider rsaCryptoServiceProvider = new RSACryptoServiceProvider(2560))
{
RSAParameters param = new RSAParameters();
param.Exponent = this.exponent;
param.Modulus = this.modulus;
// set public keys
rsaCryptoServiceProvider.ImportParameters(param);
cypherSeed = rsaCryptoServiceProvider.Encrypt(seed, false);
}
What am I doing wrong??!! | 0 | [
2,
13,
22038,
29,
370,
1246,
1072,
24420,
800,
3726,
3726,
31,
22,
79,
749,
20,
1957,
11435,
40,
7718,
16,
13,
16910,
34,
3231,
34,
568,
13,
22038,
11435,
111,
11449,
26735,
139,
47,
31,
22,
79,
1017,
40,
5391,
16,
13,
7,
5989,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google map in separate activity resulting in: java.lang.IllegalStateException: Could not execute method of the activity
===
Im having some trouble accessing Hello Mapview at the moment, http://developer.android.com/training/tutorials/views/hello-mapview.html, but i think ive done this correctly. I want to show a map in a separate activity.
**Map.xml:**
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="working key"
/>
</LinearLayout>
**Button onclick event that should show my map**
public void showMap(View v){
Intent intent = new Intent(getBaseContext(), GoogleMapsActivity.class);
startActivity(intent);
}
**GoogleMapsActivity.java**
public class GoogleMapsActivity extends MapActivity
{
MapView mapView;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
mapView = (MapView) findViewById(R.id.mapview);
mapView.setBuiltInZoomControls(true);
}
The activity is added to my manifest, Google apis is included etc. Its working if i put the map in my main activity, but not in my `GoogleMapsActivity`. Please tell me what ive missed here.
Thanks | 0 | [
2,
8144,
2942,
19,
1725,
2358,
2927,
19,
45,
8247,
9,
9949,
9,
5564,
4941,
3859,
10066,
872,
45,
110,
52,
15644,
2109,
16,
14,
2358,
800,
3726,
3726,
797,
452,
109,
2572,
1381,
68,
10975,
2942,
4725,
35,
14,
688,
15,
7775,
6903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why doesn't my simple if-statement render false in javascript?
===
I call a function like this:
call_facebook(103138046395999, "samåkning.se", "http://www.facebook.com/samakning", "page");
call_facebook(16089699074, "Jag ska köra bil, vem vill åka med", "http://www.facebook.com/groups/16089699074/", "grupp")
The function looks like this:
function call_facebook(id, name, link, type){
//snip
console.log(type)
if (type = "grupp"){
var postid=fbposts[fbpost].id.split("_");
return "https://www.facebook.com/groups/"+postid[0]+"/permalink/"+postid[1]+'/'
}
else {
return fbposts[fbpost].actions[0].link;
}
}
//snip
};
I have confirmed that they have different type-arguments, but still the first case if (type = "grupp") always ends up true. Why?
| 0 | [
2,
483,
1437,
22,
38,
51,
1935,
100,
8,
3859,
1130,
16535,
4997,
19,
8247,
8741,
60,
800,
3726,
3726,
31,
645,
21,
1990,
101,
48,
45,
645,
1,
6413,
5199,
5,
1036,
3513,
15666,
3516,
23884,
23170,
15,
13,
7,
6101,
1378,
2981,
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... |
UIAlertView validation before closing
===
Is there a way to add a validation check for textfield in a UIAlertView before closing the alert? E.g. check user credentials like username and password, and if its incorrect, update the text in the UIAlertView that credentials are incorrect. Only dismiss the UIAlertView when the validation check passes.
thanks! | 0 | [
2,
287,
2815,
6767,
4725,
27999,
115,
4239,
800,
3726,
3726,
25,
80,
21,
161,
20,
3547,
21,
27999,
2631,
26,
1854,
1109,
19,
21,
287,
2815,
6767,
4725,
115,
4239,
14,
7863,
60,
13,
62,
9,
263,
9,
2631,
4155,
5059,
43,
10107,
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... |
Admob requires marketplace url for not published app (need MY_AD_UNIT_ID)
===
I want to place ads on my new application.
I imported the Google Admob SDK but couldn't initiate a new AdView object since it requires "MY_AD_UNIT_ID".
To receive my MY_AD_UNIT_ID I have to add my app to admob.
Admob requires the maket://-link to my app. But I don't want to release the app without ads. Am I doing this wrong?
Sincerly,
Wolfen | 0 | [
2,
21,
43,
1293,
220,
4781,
19408,
287,
6362,
26,
52,
467,
4865,
13,
5,
556,
69,
51,
1,
1283,
1,
15464,
1,
1340,
6,
800,
3726,
3726,
31,
259,
20,
209,
16236,
27,
51,
78,
3010,
9,
31,
11808,
14,
8144,
21,
43,
1293,
220,
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... |
Canvas - i want to outsource my Level
===
So im trying to make a Game with the Canvaselement and Javascript. Basically you have to get a Ball with your Mouse through a Labyrinth. Till now all my Code is in 2 Javascriptfiles. But i want to outsource the Levelpart here:
window.onload = function(){
/*VARIABLES*/
//canvas
var events = new Events("myCanvas");
var canvas = events.getCanvas();
var context = events.getContext();
//ball
var rectX = 20;
var rectY = 200;
var draggingRect = false;
var draggingRectOffsetX = 0;
var draggingRectOffsetY = 0;
//message
var message = "";
//style
var lingrad = context.createLinearGradient(0,0,0,450);
lingrad.addColorStop(0.3, '#187694');
lingrad.addColorStop(0.6, '#1b8db2');
/*FUNCTIONS*/
function init()
{
canvas = document.getElementById("myCanvas");
canvas.width = width;
canvas.height = height;
context = canvas.getContext("2d");
};
events.setStage(function() {
this.clear();
var mousePos = this.getMousePos();
if (draggingRect) {
rectX = mousePos.x - draggingRectOffsetX;
rectY = mousePos.y - draggingRectOffsetY;
}
/*CANVAS ELEMENTS*/
/*Ball*/
this.clear();
this.beginRegion();
context.beginPath();
context.arc(rectX, rectY, 7, 0, 2 * Math.PI, true);
context.fillStyle = '#000';
context.fill();
context.closePath();
this.addRegionEventListener("mousedown", function() {
draggingRect = true;
var mousePos = events.getMousePos();
draggingRectOffsetX = mousePos.x - rectX;
draggingRectOffsetY = mousePos.y - rectY;
});
this.addRegionEventListener("mouseup", function() {
draggingRect = false;
});
this.addRegionEventListener("mouseover", function() {
draggingRect = false;
});
this.closeRegion();
/*WINAREA*/
this.beginRegion();
context.beginPath();
context.arc(800, 200, 100, 0, 2 * Math.PI, true);
context.fillStyle = '#005450';
context.fill();
context.closePath();
this.addRegionEventListener("mouseover", function() {
message = "You did it!";
});
this.closeRegion();
/*LANDSCAPE_DOWN*/
this.beginRegion();
context.beginPath();
context.fillStyle = lingrad;
context.moveTo(0, 400);
context.lineTo(170, 250);
context.lineTo(230, 240);
context.lineTo(380, 260);
context.lineTo(460, 220);
context.lineTo(500, 240);
context.lineTo(700, 260);
context.lineTo(800, 280);
context.lineTo(800, 400);
context.closePath();
context.fill();
this.addRegionEventListener("mousedown", function() {
message = "Klick (Ball)";
});
this.addRegionEventListener("mouseup", function() {
message = "";
});
this.addRegionEventListener("mouseover", function() {
message = "Mouseover (Ball)";
});
this.addRegionEventListener("mouseout", function() {
message = ""; /*"Mouseout (Ball)";*/
});
this.closeRegion();
/*LANDSCAPE UP*/
this.beginRegion();
context.beginPath();
context.fillStyle = lingrad;
context.moveTo(0, 50);
context.lineTo(80, 120);
context.lineTo(290, 170);
context.lineTo(490, 180);
context.lineTo(590, 170);
context.lineTo(690, 185);
context.lineTo(800, 170);
context.lineTo(800, 0);
context.lineTo(0, 0);
context.closePath();
context.fill();
this.addRegionEventListener("mouseover", function() {
message = "Mouseover (test)";
inthewall = true;
});
this.addRegionEventListener("mouseout", function() {
message = ""; /*"Mouseout (test)";*/
});
this.closeRegion();
/*Message*/
writeMessage(context, message);
});
// because of the setStage Function you dont need a listen Function
};
function writeMessage(context, message){
context.font = "12pt Open Sans";
context.fillStyle = "#fff";
context.fillText(message, 15, 25);
};
Im also using the Events.js from the HTML5 Canvas Cookbook http://www.html5canvastutorials.com/cookbook/
Can anyone help me? | 1 | [
2,
9696,
13,
8,
31,
259,
20,
70,
12097,
51,
662,
800,
3726,
3726,
86,
797,
749,
20,
233,
21,
250,
29,
14,
9696,
27567,
17,
8247,
8741,
9,
11374,
42,
57,
20,
164,
21,
1592,
29,
154,
7567,
120,
21,
23412,
9,
3924,
130,
65,
51,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JVM, Tomcat on 64 bit Linux
===
On 32 bit systems, JVM has a memory limit of 1.5 to 2 GB. What is a good value of JVM memory on 64 bit Linux ? How that can be mapped to maximum number of threads and maximum requests in tomcat ?
I am using JDK 6+ and tomcat 7. RAM available will be 12 GB on a quad core processor.
MRD
| 0 | [
2,
487,
20147,
15,
2067,
5782,
27,
4384,
1142,
13024,
800,
3726,
3726,
27,
2512,
1142,
1242,
15,
487,
20147,
63,
21,
1912,
4496,
16,
137,
9,
264,
20,
172,
14857,
9,
98,
25,
21,
254,
1923,
16,
487,
20147,
1912,
27,
4384,
1142,
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... |
RSpec test is written in 2 ways and one of them fails
===
I have this RSpec test - it passes correctly:
it "should have the right title" do
page.should { have_selector('title',
:text => "#{base_title}") }
end
I am trying to re-write the same piece of code like this:
it { should have_selector('title',
:text => "#{base_title}") }
**but the shorter code fails.**
Why? | 0 | [
2,
13,
1224,
12610,
1289,
25,
642,
19,
172,
2847,
17,
53,
16,
105,
13614,
800,
3726,
3726,
31,
57,
48,
13,
1224,
12610,
1289,
13,
8,
32,
3789,
12044,
45,
32,
13,
7,
14941,
57,
14,
193,
581,
7,
107,
2478,
9,
14941,
13,
1,
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... |
crate and insert data into Objects in Sales Force?
===
i want create and insert data into sales Force Object how can i do in sales Force free trial console
thanks in Advance.... | 0 | [
2,
19904,
17,
14692,
1054,
77,
3916,
19,
2598,
558,
60,
800,
3726,
3726,
31,
259,
1600,
17,
14692,
1054,
77,
2598,
558,
3095,
184,
92,
31,
107,
19,
2598,
558,
551,
2178,
8650,
3669,
19,
3612,
9,
9,
9,
9,
3,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Coding error or bug? When using Virutal Table
===
**Context:**<br>
* I use SQLite 3.7.13 with Red Hat 5.4/64 bits
* I'm testing Virtual Tables
* I took base code from this [article][1] to build play with a simple table
**The problem:**<br>
I'm experiencing a strange thing, the "pair" Table Name + Module Name introduces Segmentation fault during simple query processing.
It happens in: sqlite3.c:15440
This code **works**:
[...] In my main
int example_register(sqlite3* db)
{
return sqlite3_create_module(db, "example_module_", &example_module, NULL);
}
[...] In my module
rc = sqlite3_exec(db, "create virtual table t_person using example_module_", NULL, NULL, &msg);
And when I use a longer module name (example_module_foo)... "Segmentation fault"
[...] In my main
int example_register(sqlite3* db)
{
return sqlite3_create_module(db, "example_module_foo", &example_module, NULL);
}
[...] In my module
rc = sqlite3_exec(db, "create virtual table t_person using example_module_foo", NULL, NULL, &msg);
If I use a shorter Table Name <code>t_pe</code> instead, it works again..
Once again, a longer Module Name <code>example_module_foox</code> requires shoter Table Name <code>t_p</code>
**Conclusion:**<br>
I shaked a lot my code, but my only (and poor) conclusion is a correlation between table name and module: (table name length + module name length) must not exceed 20.
Mayday!
[1]: http://www.drdobbs.com/database/query-anything-with-sqlite/202802959 | 0 | [
2,
13,
15458,
7019,
54,
6256,
60,
76,
568,
8701,
1982,
192,
859,
800,
3726,
3726,
13,
1409,
1126,
11969,
45,
1409,
1,
5145,
1,
1637,
31,
275,
4444,
10601,
203,
9,
465,
9,
1543,
29,
402,
2970,
331,
9,
12918,
3470,
10181,
1637,
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... |
how use this php code in java desktop app
===
i have this simple php code and want to use this code in a java app
in this way that the user enter the id in java console and check the Status of that id then show that to user
should i change this code to java code??
and how? plz help me
<?php
// www.webmn.net
function yahoo($id){
$url = 'http://opi.yahoo.com/online?u=';
$data = file_get_contents($url . $id);
if (trim(strtolower(strip_tags($data))) != 'user not specified.') {
return (strlen($data) == 140) ? 'online' : 'offline';
} else {
return trim(strip_tags($data));
}
}
?>
| 0 | [
2,
184,
275,
48,
13,
26120,
1797,
19,
8247,
17404,
4865,
800,
3726,
3726,
31,
57,
48,
1935,
13,
26120,
1797,
17,
259,
20,
275,
48,
1797,
19,
21,
8247,
4865,
19,
48,
161,
30,
14,
4155,
2830,
14,
4924,
19,
8247,
8650,
17,
2631,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cant fingure out what this is called :(
===
Okay, so since i cant post a picture i am going to have to reference you to an app that does this. If you have the twitter app and you are going to retweet a tweet and that view comes up at the bottom, what is this called? And how would i be able to do this? | 0 | [
2,
2973,
398,
68,
4221,
70,
98,
48,
25,
227,
13,
45,
5,
800,
3726,
3726,
1705,
15,
86,
179,
31,
2973,
678,
21,
2151,
31,
589,
228,
20,
57,
20,
2801,
42,
20,
40,
4865,
30,
630,
48,
9,
100,
42,
57,
14,
10623,
4865,
17,
42,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to inject Microsoft.Office.Interop.Excel.Application instance with Ninject v3?
===
I'm looking to inject an instance of the Microsoft.Office.Interop.Excel.Application interface with Ninject 3.0.1.10 to an application I'm writing with .NET 4 in C#. Creating and disposing the Excel object manually <a href="http://stackoverflow.com/questions/158706/how-to-properly-clean-up-excel-interop-objects-in-c-sharp">seems like a hassle</a>, so I'm hoping that Ninject would be helpful in managing the lifetime of the Excel object.
If I attempt to configure Ninject like this:
public static void RegisterServices(IKernel kernel)
{
kernel.Bind<Microsoft.Office.Interop.Excel.Application>()
.To<Microsoft.Office.Interop.Excel.ApplicationClass>();
}
And have the following service:
using Microsoft.Office.Interop.Excel;
public class FooService {
private readonly Application _excelApplication;
public FooService(Application excelApplication)
{
_excelApplication = excelApplication;
}
}
I get the following build error:
Interop type 'Microsoft.Office.Interop.Excel.ApplicationClass' cannot be embedded. Use the applicable interface instead.
I can <a href="http://stackoverflow.com/a/2483688/1548950">resolve this build error</a>, but then running the code produces the following error:
Error activating Application
No matching bindings are available, and the type is not self-bindable.
Activation path:
2) Injection of dependency Application into parameter excelApplication of
constructor of type FooService
1) Request for FooService
Injection of the interfaces I've created and mapped to my implementation classes (e.g. kernel.Bind<IMyClass>().To<MyClass>(); ) is working fine. What is wrong with the setup above? Is injecting Microsoft.Office.Interop.Excel.Application a bad idea in any case? | 0 | [
2,
184,
20,
20316,
7099,
9,
17047,
9,
6280,
2594,
9,
1706,
11040,
9,
2552,
20669,
4851,
29,
13,
5703,
17759,
566,
240,
60,
800,
3726,
3726,
31,
22,
79,
699,
20,
20316,
40,
4851,
16,
14,
7099,
9,
17047,
9,
6280,
2594,
9,
1706,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 WindowBuilder in Eclipse to add SWT TableView window to existing program
===
I've installed WindowBuilder in Eclipse Juno and am able to create Details Page. The generated source code:
/**
* Initialize the details page.
* @param form
*/
public void initialize(IManagedForm form) {
managedForm = form;
}
/**
* Create contents of the details page.
* @param parent
*/
public void createContents(Composite parent) {
FormToolkit toolkit = managedForm.getToolkit();
parent.setLayout(new FillLayout());
//
requires a ManagedForm to be initialised. A a very Java newbie I've been completely stuck as to where to get this object. I've probably missed the obvious but help would be very much appreciated. | 0 | [
2,
568,
1463,
20904,
19,
11652,
20,
3547,
8783,
38,
859,
4725,
1463,
20,
3149,
625,
800,
3726,
3726,
31,
22,
195,
4066,
1463,
20904,
19,
11652,
21715,
17,
589,
777,
20,
1600,
3289,
2478,
9,
14,
6756,
1267,
1797,
45,
13,
118,
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... |
Highstock chart - Dates on same x axis and Crazy Tooltip
===
I am working with Highstock chart (from 'Point markers only' demo: http://www.highcharts.com/stock/demo/markers-only) and I noticed the below issues:
a) I noticed that the corresponding tooltips are crazy
b) I noticed that the dates were plotted right over the left edge, almost hiding the tooltip symbols...
You may want to take a look at the following jsfiddle: http://jsfiddle.net/xfJhq/1/
I thank you for any clue you might have.
Hamilton Jose | 0 | [
2,
183,
7576,
1795,
13,
8,
4076,
27,
205,
993,
8577,
17,
3328,
5607,
10169,
800,
3726,
3726,
31,
589,
638,
29,
183,
7576,
1795,
13,
5,
2665,
13,
22,
3132,
19482,
104,
22,
8376,
45,
7775,
6903,
6483,
9,
4542,
5433,
38,
18,
9,
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... |
CSS Selector <tag name>#<ID> Patterns -- Any Siginifance?
===
When working on a web project with a 'not so good' codebase, I often see in JS/CSS selectors written like
div#myID
This seems wrong....
http://jsfiddle.net/bobber205/yeJRQ/
Example above. This means, if for some reason, you change the tag the id belongs to, you have, possible, LOTS of css to change....
What's up with people doing that? Is it faster? Is the speed improvement worth it? So curious. :P | 0 | [
2,
272,
18,
18,
23946,
13,
1,
8628,
204,
1,
5910,
1,
1340,
1,
6282,
13,
8,
8,
186,
8858,
108,
821,
2416,
60,
800,
3726,
3726,
76,
638,
27,
21,
2741,
669,
29,
21,
13,
22,
1270,
86,
254,
22,
1797,
8436,
15,
31,
478,
196,
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... |
Grab file with chrome extension before upload
===
using my chrome extension i would like to grab a file(and maybe change it) before it gets uploaded to a website. Particularly from <form> file-inputs.
Put another way if i select a file with an input[type=file] i want my chrome extension to interrupt any submit and take the file. Then my extension applies its magic to the file and after that the file may be submitted/uploaded.
How can i approach this?
| 0 | [
2,
4931,
3893,
29,
13,
12985,
3896,
115,
71,
8294,
800,
3726,
3726,
568,
51,
13,
12985,
3896,
31,
83,
101,
20,
4931,
21,
3893,
5,
290,
913,
753,
32,
6,
115,
32,
3049,
23782,
20,
21,
2271,
9,
1653,
37,
13,
1,
4190,
1,
3893,
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 can i optimize this query which is taking much time?
===
I have this query which is taking around 40-50 seconds to load
SELECT
members.latitude,
members.longitude,
members.mem_id
FROM members
WHERE profile_type != "C"
AND (gender = 'm'
OR gender = 'f')
AND members.mem_id IN(SELECT DISTINCT
n2.mem_id
FROM network n1,
network n2
WHERE n1.frd_id = n2.mem_id
AND n1.mem_id = '48'
AND n2.frd_id = '48')
ORDER BY profilenam
there is network table which contains users friends
Please help.. | 0 | [
2,
184,
92,
31,
22864,
48,
25597,
56,
25,
741,
212,
85,
60,
800,
3726,
3726,
31,
57,
48,
25597,
56,
25,
741,
140,
1417,
8,
2290,
2582,
20,
6305,
5407,
443,
9,
8927,
16731,
15,
443,
9,
2701,
16731,
15,
443,
9,
790,
79,
1,
134... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Getting image using UIGraphicsGetImageFromCurrentImageContext
===
I am trying to understand, UIgraphicsGetImageContext() function, from my understanding, its a function, which gets the image from current bitmap context, so whenver I draw something on my canvas, and call this function, I get the image drawn, but suppose I dont draw anything then also it extracts an empty image. So I want to understand, how can we check when the canvas(CGContext) is nil.
Below is my code which I tried, but its not working
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO,0.0);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
if(UIGraphicsGetCurrentContext() == nil)
{
NSLog(@"NIL");
}
else
{
m_curImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSLog(@"%@",m_curImage);
}
So friends, please let me know how to get this it will be helpful to me
Regards
Ranjit
| 0 | [
2,
1017,
1961,
568,
13,
5661,
12084,
18,
3060,
22039,
2665,
17657,
22039,
1126,
11969,
800,
3726,
3726,
31,
589,
749,
20,
1369,
15,
13,
5661,
12084,
18,
3060,
22039,
1126,
11969,
5,
6,
1990,
15,
37,
51,
3260,
15,
82,
21,
1990,
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... |
AutoCompleteTextView adapter not displaying dropdown?
===
Here is my onCreate method:
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = getIntent();
if (intent.getData() == null)
intent.setData(Formulas.CONTENT_URI);
AutoCompleteTextView searchBar = (AutoCompleteTextView)findViewById(R.id.searchBar);
Cursor c = getContentResolver().query(getIntent().getData(),new String[] { Formulas.TITLE }, null, null, null);
SimpleCursorAdapter searchAdapter =
new SimpleCursorAdapter(this, android.R.layout.simple_dropdown_item_1line, c,
new String[] { Formulas.TITLE } , new int[] { android.R.id.text1} );
searchBar.setAdapter(searchAdapter);
}
I did input some sample data in my databaseopenhelper:
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE formula ( \n" +
"_id INTEGER PRIMARY KEY AUTOINCREMENT, \n" +
"title TEXT NOT NULL, \n" +
"formula TEXT NOT NULL \n" +
");");
db.execSQL("INSERT INTO formula VALUES ( \n" +
"null, \"Pythagorean theorium\", \"a^2+b^2=c^2\" \n" +
"); ");
db.execSQL("INSERT INTO formula VALUES ( \n" +
"null, \"Perimeter of a square\", \"l^2 * w^2\" \n" +
"); ");
db.execSQL("INSERT INTO formula VALUES ( \n" +
"null, \"Area of a square\", \"l^4\" \n" +
"); ");
}
I used debugging and found that none of the variables were null? What could be the problem? I already defined my own contentprovider. | 0 | [
2,
3108,
15990,
11969,
4725,
9924,
106,
52,
17418,
2804,
2968,
60,
800,
3726,
3726,
235,
25,
51,
27,
6037,
1373,
2109,
45,
13,
118,
1409,
227,
76,
14,
2358,
25,
64,
679,
9,
1637,
118,
13,
1,
2549,
11891,
317,
11364,
27,
6037,
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... |
Content providers: wrap with a static facade?
===
I am going through a bit of a design dilemma, I have been targeting Android 2.3.3 and have a custom implementation of a ContentProvider. I then have a class of static methods to abstract the Content provider - providing me with objects representing each entity (row) based upon my query. For a while I was very comfortable with working like this, until I started wanting to use the whole collection in a number of places, for performing "hit tests" and drawing to the screen. I then had the headache of keeping my object representations up to date, and at this point have decided I need to step back and reconsider where to take this.
As I say, I am presently using 2.3.3, and realise that in 3.0 CursorLoader overcomes a lot of the problems I have encountered. I still need to support smart phones though, so unless there will be a backport I cannot do this.
As an interim solution I started to register notifyChange listeners so that I can rebuild a collection with my original query, but this strikes me as very CPU intensive and potentially slow. I haven't yet decided whether I should roll back from using my static facade and instead use the now obsolete managedQuery call from Activity.
I therefore have two questions:
1) Is there a preferrable way to avoid the issues with working against a collection based around a contentProvider?
2) Have you any advice on working with raw cursors in an activity? Should I be making objects out of them or working with the cursor as-is? I certainly feel they should be in an AsynTask while performing the query, but after that can I use them anywhere? | 0 | [
2,
2331,
13488,
45,
8118,
29,
21,
12038,
7224,
60,
800,
3726,
3726,
31,
589,
228,
120,
21,
1142,
16,
21,
704,
23314,
15,
31,
57,
74,
15972,
13005,
172,
9,
240,
9,
240,
17,
57,
21,
5816,
6123,
16,
21,
2331,
26735,
139,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to scroll characters on a label in Cocos2D?
===
I have a sprite on which there is a label (CCLabelTTF). On that label i have A,B,C,D,E, etc printed when they are clicked. I want them to scroll left. I've googled some tuorials but i am unable to find the solution and stuck here for long. [Here](http://www.flickr.com/photos/69616692@N06/6328857450/in/photostream/) is the screenshot of my game. You can see the characters from A to J. When i click on more incoming characters, that portion should scroll.
Here is the code from which the characters are shown on label (lblSelectedAlpha) added on sprite:-
-(void)showSelectedAlphaBet
{
fSelectedAlphaY =26;
if (tempBackground) {
[tempBackground removeFromParentAndCleanup:YES];
}
tempBackground = [CCSprite spriteWithFile:@"stripe_2.png"];
tempBackground.position = ccp(160,30);
[self addChild:tempBackground z:30];
for (int i=0; i<[arryAddSelectedChar count]; i++) {
NSLog(@"[arryAddSelectedChar count] %@",[arryAddSelectedChar objectAtIndex:i]);
lblSelectedAlpha = [CCLabelTTF labelWithString:
[arryAddSelectedChar objectAtIndex:i]dimensions:CGSizeMake(30,30)
alignment:UITextAlignmentCenter fontName:@"Marker Felt" fontSize:30];
lblSelectedAlpha.position = ccp(fSelectedAlphaY,25);
lblSelectedAlpha.tag=i;
lblSelectedAlpha.color = ccc3(125,125,125);
[tempBackground addChild:lblSelectedAlpha z:5];
fSelectedAlphaY +=25;
}
} | 0 | [
2,
184,
20,
12159,
1766,
27,
21,
1899,
19,
22470,
18,
135,
43,
60,
800,
3726,
3726,
31,
57,
21,
27902,
27,
56,
80,
25,
21,
1899,
13,
5,
3384,
21018,
38,
11720,
6,
9,
27,
30,
1899,
31,
57,
21,
15,
220,
15,
150,
15,
43,
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... |
determine the height of a scrolling div thumb using javascript or jquery
===
How to get the height of the thumb of a scroll bar on a div.
| 0 | [
2,
3746,
14,
2947,
16,
21,
13,
28166,
13,
12916,
5078,
568,
8247,
8741,
54,
487,
8190,
93,
800,
3726,
3726,
184,
20,
164,
14,
2947,
16,
14,
5078,
16,
21,
12159,
748,
27,
21,
13,
12916,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Any nice images for the user management, user roles and adding users?
===
I am developing a web application and I want some images and icons that refer to the following:
1. User management
2. User Roles
3. Adding Users
4. Newsletter
I used Google Images Search and Icon Finder but I did not find anything good for this matter. | 4 | [
2,
186,
2210,
3502,
26,
14,
4155,
1097,
15,
4155,
2954,
17,
4721,
3878,
60,
800,
3726,
3726,
31,
589,
3561,
21,
2741,
3010,
17,
31,
259,
109,
3502,
17,
9801,
18,
30,
5017,
20,
14,
249,
45,
137,
9,
4155,
1097,
172,
9,
4155,
295... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
display downloaded file without saving it on android?
===
I would to download a .docx file from internet and display it with officesuite.Is it possible without saving downloaded file?(for example with content provider) | 0 | [
2,
3042,
23887,
3893,
366,
7599,
32,
27,
13005,
60,
800,
3726,
3726,
31,
83,
20,
7121,
21,
13,
9,
13799,
396,
3893,
37,
2620,
17,
3042,
32,
29,
488,
12352,
62,
9,
403,
32,
938,
366,
7599,
23887,
3893,
60,
5,
1106,
823,
29,
233... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How do I set an image on a polygon in Java?
===
Say I want to make a character for a game in Java. I know how to make the character a rectangle, an ellipse, etc., but how do I make the character from an image?
Also, I know this is somewhat off topic, but how do I set an image background for a JFrame in Java?
Thanks! | 1 | [
2,
184,
107,
31,
309,
40,
1961,
27,
21,
21309,
19,
8247,
60,
800,
3726,
3726,
395,
31,
259,
20,
233,
21,
925,
26,
21,
250,
19,
8247,
9,
31,
143,
184,
20,
233,
14,
925,
21,
27181,
15,
40,
13,
4223,
1919,
62,
15,
2722,
9,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I create a database record that can repeatedly be copied, but also edited?
===
This is my first post here, sorry if I can't be specific enough. I'm just starting out with ruby on rails and am trying to build myself a journal app to keep track of workouts. I want to be able to create a workout which contains an indefinite amount of lifts (bench, leg press, etc.) and each of those lifts needs a number of sets, and a number of repetitions. I want the user to be able to add create a workout consisting of say 8 lifts, and then be able to repeatedly copy that to log every day a workout with the sets and reps modified. I know I need a workout model, and then a lift model, I guess I just need help on getting the associations right. Again I can provide more clarity as to what I am trying to do, I don't have that much programming experience, but am figuring it out. | 0 | [
2,
184,
107,
31,
1600,
21,
6018,
571,
30,
92,
8081,
44,
18225,
15,
47,
67,
4802,
60,
800,
3726,
3726,
48,
25,
51,
64,
678,
235,
15,
1875,
100,
31,
92,
22,
38,
44,
1903,
511,
9,
31,
22,
79,
114,
1422,
70,
29,
10811,
27,
224... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
nHibernate count(*) on existing queryover
===
I'm using nHibernate 3.3. I'd like to execute SQL like this:
select COUNT(*) from (
SELECT YEAR(MeasureDateLocal) As [Year], MONTH(MeasureDateLocal) As [MONTH], DAY(MeasureDateLocal) As [DAY], sum(this_.RainCounterValue) as y3_
FROM DriverPeriphMeasure this_
WHERE this_.IdDriver = @p1
GROUP BY YEAR(MeasureDateLocal), MONTH(MeasureDateLocal), DAY(MeasureDateLocal) ) s
but using QueryOver or LINQ.
Currently I have this ugly piece code:
var countQuery = Context.Session.CreateSQLQuery(
@"select COUNT(*) from
(SELECT YEAR(MeasureDateLocal) As [Year], MONTH(MeasureDateLocal) As [MONTH], DAY(MeasureDateLocal) As [DAY], sum(this_.RainCounterValue) as y3_
FROM DriverPeriphMeasure this_
WHERE this_.IdDriver = :driverID
GROUP BY YEAR(MeasureDateLocal), MONTH(MeasureDateLocal), DAY(MeasureDateLocal) ) s" )
.SetParameter<Guid>( "driverID", driver );
int total = countQuery.UniqueResult<int>();
But I'd love to see how to do it using QueryOver.
I managed to compose following QueryOver:
var q3 = Context.Session.QueryOver<DriverPeriphMeasure>().Where( x => x.Driver.Id == driver )
.SelectList( list => list
.Select( Projections.SqlGroupProjection( "YEAR(MeasureDateLocal) As [Year]", "YEAR(MeasureDateLocal)", new[] { "YEAR" }, new IType[] { NHibernateUtil.Int32 } ) )
.Select( Projections.SqlGroupProjection( "MONTH(MeasureDateLocal) As [MONTH]", "MONTH(MeasureDateLocal)", new[] { "MONTH" }, new IType[] { NHibernateUtil.Int32 } ) )
.Select( Projections.SqlGroupProjection( "DAY(MeasureDateLocal) As [DAY]", "DAY(MeasureDateLocal)", new[] { "DAY" }, new IType[] { NHibernateUtil.Int32 } ) )
);
But I can't find a way to set it as subquery. | 0 | [
2,
12109,
15191,
8820,
2468,
5,
2483,
6,
27,
3149,
25597,
2549,
800,
3726,
3726,
31,
22,
79,
568,
12109,
15191,
8820,
203,
9,
240,
9,
31,
22,
43,
101,
20,
15644,
4444,
255,
101,
48,
45,
5407,
2468,
5,
2483,
6,
37,
13,
5,
5407,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
posting text & image to Facebook from my app
===
I need to make my app post an image with some text to facebook.
Here's my code
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.setType("image/jpg");
shareIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(file));
shareIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "text1");
shareIntent.putExtra(Intent.EXTRA_TEXT, "text2");
startActivity(Intent.createChooser(shareIntent, "Share via..."));
It does post the image fine, but I can't find a way how to attach text to it.
![enter image description here][1]
While, for example, in instagram it does post both text & photo fine. Also notice the posting window is different.
![enter image description here][2]
Any ideas? Thanks!
[1]: http://i.stack.imgur.com/PfCLB.png
[2]: http://i.stack.imgur.com/11mHk.png | 0 | [
2,
15669,
1854,
279,
1961,
20,
9090,
37,
51,
4865,
800,
3726,
3726,
31,
376,
20,
233,
51,
4865,
678,
40,
1961,
29,
109,
1854,
20,
9090,
9,
235,
22,
18,
51,
1797,
6936,
1891,
6391,
2291,
800,
78,
6936,
5,
6391,
2291,
9,
8645,
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... |
When I add <!doctype html> to my page the CSS doesn't seem to work and the page looks worse
===
My problem is that on firefox and chrome my website looks fine in quirks mode, but not in IE. I realise that I should add <!doctype html> to the start of my page and go from there - but when I do this the website looks the same in all browsers, but not as I want it to.
Here is [My website with DOCTYPE][1] and here is
[My website in quirks mode][2] which is how I want it to look (in chrome/firefox)
Is this a problem with my CSS? I have validated it and no errors were found!
Here is my CSS:http://www.biolonline.co.uk/mystyle.css
Thanks in advance, any help is appreciated! | 0 | [
2,
76,
31,
3547,
13,
1,
187,
13799,
4474,
13,
15895,
1,
20,
51,
2478,
14,
272,
18,
18,
1437,
22,
38,
2260,
20,
170,
17,
14,
2478,
1879,
3105,
800,
3726,
3726,
51,
1448,
25,
30,
27,
535,
18219,
17,
13,
12985,
51,
2271,
1879,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS - Image loading
===
I'm having a little problem, I have a header image that is quite large and takes time to load on bad internet connections. I've seen some websites load their bigger image files from "low quality" -> "normal quality (original)", rather than "no-image" -> "loaded image".. what I seem to be having with my header.
background-image:url("images/header");
Is there a way to make the image load from low quality to high quality rather than no image to image in CSS?
I'm really sorry if I expressed my problem badly. English is not my native language :) | 0 | [
2,
272,
18,
18,
13,
8,
1961,
12797,
800,
3726,
3726,
31,
22,
79,
452,
21,
265,
1448,
15,
31,
57,
21,
157,
106,
1961,
30,
25,
1450,
370,
17,
1384,
85,
20,
6305,
27,
896,
2620,
6760,
9,
31,
22,
195,
541,
109,
13931,
6305,
66,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 spesific content in iframe without jquery
===
i want to get spesific content in iframe without jQuery,<br>
How can i write it only javascript?
"<b>#canvas_frame</b>" is an iframe
spans = $("#canvas_frame").contents().find(".y6>span");
| 0 | [
2,
164,
9882,
18,
821,
596,
2331,
19,
31,
8361,
366,
487,
8190,
93,
800,
3726,
3726,
31,
259,
20,
164,
9882,
18,
821,
596,
2331,
19,
31,
8361,
366,
487,
8190,
93,
15,
1,
5145,
1,
184,
92,
31,
2757,
32,
104,
8247,
8741,
60,
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... |
When do Media Queries work in MediaWiki?
===
I'm trying to get a responsive skin working in MediaWiki with media queries, and I'm troubleshooting some weird behavior.
If I add a test div to a wiki page:
<div id="testing">TESTING</div>
And then add a media query:
@media screen {
#testing {background-color: green;}
}
...to various places, the style only applies in certain browsers. For example:
If I add it to the active skin's "screen.css" file, where all the other working styles live:
* iPad: NO
* iPhone4: NO
* Chrome 20.0 XP+Mac: NO
* Firefox 14.0.1 XP+Mac: YES
If I add it to the common skin's "shared.css" file, which applies to every skin:
* iPad: NO
* iPhone4: NO
* Chrome 20.0 XP+Mac: NO
* Firefox 14.0.1 XP+Mac: YES
If I add it to the wiki's "MediaWiki:Common.css" page:
* iPad: YES
* iPhone4: YES
* Chrome 20.0 XP+Mac: YES
* Firefox 14.0.1 XP+Mac: YES
**N.B.**: A regular style declaration *works as expected* in all of these locations. It's only when wrapped in a media query in an external file that the weirdness appears. It's apparently a browser issue, compounded with a MediaWiki style-handling issue. What is Firefox doing differently?
I've also noticed when examining the page with Chrome's Developer Console that the styles appear to be imported by "load.php" as one big conjoined line of style declarations, including my media query; but it seems it's just not being applied, even in browsers which support it.
Can anyone shed some light on this behavior? I'd prefer to work in standalone stylesheets rather than in the wiki editor. | 0 | [
2,
76,
107,
941,
9386,
2829,
170,
19,
941,
17375,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
21,
13,
22153,
1188,
638,
19,
941,
17375,
29,
941,
9386,
2829,
15,
17,
31,
22,
79,
2572,
12511,
68,
109,
5455,
3257,
9,
100,
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... |
check if page exist on multiple urls
===
im trying to check if index.html exist on multiple urls
$urls = file('urls.txt', FILE_IGNORE_NEW_LINES);
foreach ($urls as $url) {
if(@fopen(trim($url),'r') !== false){
echo '$url Page Exists';
ob_flush();
flush();
else {
echo '$url does not exist"
flush();
else {
}
}
heeeeeeeeeeeelp please thanks | 1 | [
2,
2631,
100,
2478,
3182,
27,
1886,
13,
911,
7532,
800,
3726,
3726,
797,
749,
20,
2631,
100,
4348,
9,
15895,
3182,
27,
1886,
13,
911,
7532,
5579,
911,
7532,
800,
3893,
5,
22,
911,
7532,
9,
38,
396,
38,
22,
15,
3893,
1,
23565,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
test shelllist if selected is file, folder or blank
===
Me again with another question.
I am using a shelllist from raize and want to add some code to the on click event to test if the selected item is valid (file, folder or blank) but I am unsure how to correctly do this.
Here is what I have.
Procedure ZipCheck;
Var
Path : string;
i : integer;
s : string;
DecompStream : TMemoryStream;
LExtention : string;
begin
Path := form2.FileList.SelectedItem.PathName;
form2.FNameEdit.Text := Path;
if form2.FileList.SelectedItem.IsValid = true then
Begin
LExtention := TPath.GetExtension(form2.filelist.SelectedItem.PathName);
if tpath.GetExtension(LExtention) = '.zip' then
Begin
Showmessage(LExtention);
end;
End;
end;
What happens is when I click on a blank area of the shelllist I get an exception error.
Thanks for any help you can give. | 0 | [
2,
1289,
3593,
5739,
100,
1704,
25,
3893,
15,
19294,
54,
6463,
800,
3726,
3726,
55,
188,
29,
226,
1301,
9,
31,
589,
568,
21,
3593,
5739,
37,
6623,
1734,
17,
259,
20,
3547,
109,
1797,
20,
14,
27,
10840,
807,
20,
1289,
100,
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... |
ISSUES IN CREATING FACEBOOK AD- IT SAYS "Ad Bid Too High -- The bid is too high for the ad"
===
I'm creating an ad for my page. Objective is to get people LIKE my page. So I've chosen CPM as the method of charging. I have set the budget as Rs. 10 per day. But when I place the order, it says "Ad Bid Too High -- The bid is too high for the ad". It hasn't asked me for any bid at all, and I have input no bid. How do I get this resolved? | 2 | [
2,
1549,
19,
2936,
9090,
21,
43,
8,
32,
898,
13,
7,
1283,
4458,
266,
183,
13,
8,
8,
14,
4458,
25,
266,
183,
26,
14,
21,
43,
7,
800,
3726,
3726,
31,
22,
79,
2936,
40,
21,
43,
26,
51,
2478,
9,
7038,
25,
20,
164,
148,
101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Access recycle bin in c++
===
i am new in c++, i want to access recycle bin and getting all data in it in c++. I search over the net but din't find any thing. There is a project in codeproject site but i cant understand it.Please help me..Thankx in advance | 1 | [
2,
1381,
302,
12467,
4511,
19,
272,
20512,
800,
3726,
3726,
31,
589,
78,
19,
272,
20512,
15,
31,
259,
20,
1381,
302,
12467,
4511,
17,
1017,
65,
1054,
19,
32,
19,
272,
20512,
9,
31,
2122,
84,
14,
4275,
47,
10266,
22,
38,
477,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I update a mysql database using a .sql file?
===
Situation: our production mysql database makes a daily dump into a .sql file. I'd like to keep a shadow database that is relatively up to date.
I know that to create a mysql database from a .sql file, one uses:
mysql -u USERNAME -p DATABASENAME < FILE.SQL
For our db, this took 4-5 hours. Needless to say, I'd like to cut that down, and I'm wondering if there's a way to just update the db with what's new/changed. On Day 2, is there a way to just *update* my shadow database with the new .sql file dumped from the production db?
Thanks in advance. | 0 | [
2,
184,
107,
31,
11100,
21,
51,
18,
22402,
6018,
568,
21,
13,
9,
18,
22402,
3893,
60,
800,
3726,
3726,
1858,
45,
318,
637,
51,
18,
22402,
6018,
1364,
21,
1954,
11424,
77,
21,
13,
9,
18,
22402,
3893,
9,
31,
22,
43,
101,
20,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WP-eCommerce Subcategory Display
===
I was wondering if someone could take a quick look at this for me:
Code: http://pastebin.com/gasPD3SK
URL: http://goo.gl/2Idbz
We're attempting to display subcategories of a parent category. We've successfully done that. We've also successfully pulled the first letter out of the subcats and listed that.
As we add new subcategories, they are creating their own <td>'s, as well as not falling into alphabetical order?
I'm running myself ragged on this one.
Thanks so much to whoever can help me!!!! | 0 | [
2,
13,
13790,
8,
62,
26470,
972,
14375,
93,
3042,
800,
3726,
3726,
31,
23,
5712,
100,
737,
110,
247,
21,
2231,
361,
35,
48,
26,
55,
45,
1797,
45,
7775,
6903,
19802,
62,
4772,
9,
960,
118,
6927,
9251,
240,
3656,
287,
6362,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
resources in META-INF/resources not found and return 404
===
I have a jar file in my WEB-INF/lib directory. Inside that jar is a META-INF/resources directory with one file (image.jpg). As I understand the servlet 3.0 API, when I deploy this as part of my web app under Tomcat 7, I should be able to go to
http://host/context/image.jpg
and see the image loaded from within the jar. but instead, I get a 404 error. It's as if the servlet_api isn't loading resources from within my jars even though the documentation says it should.
What am I doing wrong? Is there a field I need to put in my web.xml file to tell tomcat to load these resources and make them available to the web browser? | 0 | [
2,
2566,
19,
7618,
8,
108,
410,
118,
99,
12097,
18,
52,
216,
17,
788,
13,
23397,
800,
3726,
3726,
31,
57,
21,
5112,
3893,
19,
51,
2741,
8,
108,
410,
118,
8326,
16755,
9,
572,
30,
5112,
25,
21,
7618,
8,
108,
410,
118,
99,
120... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Block PicScout
===
I would like to block PicScout Robot from accessing my site. I have read that it does not behave like a good robot should so how should I go about doing this?
*Please Note:* I use a hosted CMS. I do not have access to server side scripts. I do not mind answers that include server side scripts but I am looking specifically for a non-server side way to do this. | 0 | [
2,
184,
20,
1921,
9327,
3862,
1320,
800,
3726,
3726,
31,
83,
101,
20,
1921,
9327,
3862,
1320,
8288,
37,
1381,
68,
51,
689,
9,
31,
57,
1302,
30,
32,
630,
52,
14149,
101,
21,
254,
8288,
378,
86,
184,
378,
31,
162,
88,
845,
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... |
Change the image that is taken in the facebook send box
===
when I create a send button, the facebook api find an image that i don´t want to be the icon of the shared page. In appereance facebook take a nearby image and use it in the box. It is possible to cheat facebook so it use the image I want?
Thanks for any help! | 0 | [
2,
753,
14,
1961,
30,
25,
658,
19,
14,
9090,
2660,
1649,
800,
3726,
3726,
76,
31,
1600,
21,
2660,
5167,
15,
14,
9090,
21,
2159,
477,
40,
1961,
30,
31,
221,
13,
38,
259,
20,
44,
14,
9801,
16,
14,
2592,
2478,
9,
19,
4865,
6345... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a linq query that queries 2 tables
===
Im really new at linq queries and im hoping you guys can help me with this query
I have a Product table and a ProductCategory table
The productCategory table is a mapping between the product table and the category table
So i need to get all the products from the Product Table, that has a mapping form a certain category ID in the productCategory Table.. for example all the product from category 5
Im really unsure how the Linq query should go | 0 | [
2,
2936,
21,
6294,
1251,
25597,
30,
9386,
2829,
172,
7484,
800,
3726,
3726,
797,
510,
78,
35,
6294,
1251,
9386,
2829,
17,
797,
3935,
42,
2776,
92,
448,
55,
29,
48,
25597,
31,
57,
21,
2374,
859,
17,
21,
2374,
14375,
93,
859,
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... |
Tutorial 'Tasky' does not work
===
I'm a new user and struggling to understand storyboard construction. To help, I went all though tutorial 5 ( 'working with tables & cells') but could not make the segue work (nothing happens when a cell on the master is clicked). Clearly I have done something wrong , so I searched for some completed source code to see what was missing (the tutorial only has snippets). But the code for the same 'app' on the samples page appears to be totally different, based on an earlier version of Xcode without Storyboards. How frustrating!
To get me on the correct path, has anyone got the complete (working!) code for this tutorial?
Thanks | 0 | [
2,
29724,
13,
22,
536,
2397,
22,
630,
52,
170,
800,
3726,
3726,
31,
22,
79,
21,
78,
4155,
17,
7587,
20,
1369,
609,
2806,
900,
9,
20,
448,
15,
31,
296,
65,
362,
29724,
331,
13,
5,
13,
22,
14120,
29,
7484,
279,
2934,
22,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 current window when disposing of subscription
===
I have the following code:
var observable = ... subscribe to event here ...
var windows = observable.Window(TimeSpan.FromSeconds(240));
aggregatedWindows = windows.SelectMany(
window => window.Aggregate(new Context(), AggregateContext));
subscription = aggregatedWindows.Subscribe(OnWindow);
... later
subscription.Dispose();
Imagine a scenario when I am in the middle of processing a window and someone has requested that my app should close. I'm going to dispose of this subscription, which will stop the events being processed, however I'm also going to lose the last window of information.
I'm not sure what the best way to deal with this is...
I could store local state with the last seen window as it is passed through the aggregation function (but this seems wrong)...
Any help would be greatly appreciated! | 0 | [
2,
1381,
68,
866,
1463,
76,
1460,
14717,
16,
14213,
800,
3726,
3726,
31,
57,
14,
249,
1797,
45,
4033,
5122,
10321,
579,
800,
13,
9,
9,
9,
13,
20330,
20,
807,
235,
13,
9,
9,
9,
4033,
1936,
800,
5122,
10321,
579,
9,
27508,
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... |
Disabling zoom when double click on polygon
===
I have some polygons on a map and when the user double clicks on them, I want no zoom to occur. However, I want double click zoom to be enabled on other parts of the map. Is there any way I can implement this?
Thanks a lot. | 0 | [
2,
1460,
58,
8599,
19469,
76,
1494,
10840,
27,
21309,
800,
3726,
3726,
31,
57,
109,
21309,
18,
27,
21,
2942,
17,
76,
14,
4155,
1494,
10840,
18,
27,
105,
15,
31,
259,
90,
19469,
20,
3744,
9,
207,
15,
31,
259,
1494,
10840,
19469,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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++: 'a' vs "a"
===
I am learning C++ and have got a question that I cannot find the answer to.
What is the difference between a char constant (using single quotes) and a string constant (with double quotes)?
All my search results related to char arrays vs std::string. I am after the difference between 'a' and "a".
Would there be a difference in doing the following:
cout << "a";
cout << 'a';
| 0 | [
2,
272,
20512,
45,
13,
22,
58,
22,
4611,
13,
7,
58,
7,
800,
3726,
3726,
31,
589,
2477,
272,
20512,
17,
57,
330,
21,
1301,
30,
31,
1967,
477,
14,
1623,
20,
9,
98,
25,
14,
2841,
128,
21,
4892,
3587,
13,
5,
12655,
345,
18901,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Doctrine2 Many to Many doesn't return array
===
If I have the following class defined,
class Category {
/**
*
* @var integer $id
* @Column(name="id", type="integer",nullable=false)
* @Id
* @GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
*
* @ManyToMany(targetEntity="Tag")
* @JoinColumn(onDelete="SET NULL")
*/
protected $tags;
}
Shouldn't I be able to get all the tags associated to this category by:
$categoryTags = $category->tags;
The object in $categoryTags after the above assignment is of the type Doctrine\ORM\PersistentCollection while I expect it to be an array.
I added the association values in category_tag table manually with sql commands, but I can see that they are valid.
My Tags class looks like this:
class Tag extends Tag{
/**
*
* @var integer $id
* @Column(name="id", type="integer",nullable=false)
* @Id
* @GeneratedValue(strategy="IDENTITY")
*/
protected $id;
/**
* @Column(type="string",length=60,nullable=false)
* @var string
*/
protected $tag;
} | 0 | [
2,
7521,
135,
151,
20,
151,
1437,
22,
38,
788,
7718,
800,
3726,
3726,
100,
31,
57,
14,
249,
718,
2811,
15,
718,
3230,
13,
1,
13,
118,
1409,
1637,
1637,
13,
1,
3311,
13820,
5579,
1340,
1637,
13,
1,
716,
4404,
103,
5,
7259,
3726... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fetch Logged in Location Using Google API
===
I am trying to write a small gadget for a company through which I can record the time in which my employees have signed in/out to Gmail(not mobile logins) from within their premises. Its pretty much to automate the clock in clock out application that they currently have. For this, I need to be able to grab either the ip address/latitude-longitude without using any other third party service. Any ideas? Thanks
| 0 | [
2,
18312,
13,
19287,
19,
1474,
568,
8144,
21,
2159,
800,
3726,
3726,
31,
589,
749,
20,
2757,
21,
284,
25661,
26,
21,
237,
120,
56,
31,
92,
571,
14,
85,
19,
56,
51,
3716,
57,
908,
19,
118,
1320,
20,
489,
8079,
5,
1270,
3241,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Minimum of a vector by a linear operation
===
Is there a way to compute the min/max of vector of integers using a linear operation? For example, if the vector is x, then what i'm looking for is an operation in the form of x.a + b, where (.) is the dot product, and a and b can be any other vectors of the same length | 0 | [
2,
5187,
16,
21,
7497,
34,
21,
6745,
1453,
800,
3726,
3726,
25,
80,
21,
161,
20,
23909,
14,
4232,
118,
8304,
16,
7497,
16,
13820,
18,
568,
21,
6745,
1453,
60,
26,
823,
15,
100,
14,
7497,
25,
993,
15,
94,
98,
31,
22,
79,
699,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use of 'Common Type System' as coding standard
===
One of our coding standard 'rules' is:
> * Use the common type system. For example, use `Int32` instead of `int`.
I have not seen a similar rule before, although our other guidelines are roughly based on Microsoft's [Design Guidelines Digest][1]. It doesn't seem like what the [Common Type System][2] is, either.
I find it inconvenient as I end up having to rewrite default Visual Studio and ReSharper refactorings to convert `string` to `String`, `float` to `Single`, `long` to `Int64` etc.
It's also applied fairly inconsistently (e.g. not for `object` to `Object`), possibly as a consequence of its inconvenience, and no StyleCop rule exists to check it is applied.
I am therefore wondering why this rule was ever set. Could there be a good reason? Are there any cases (perhaps historical) where `Int32` must be used instead of `int` for example?
[1]: http://blogs.msdn.com/b/kcwalina/archive/2004/09/28/235232.aspx
[2]: http://en.wikipedia.org/wiki/Common_Type_System | 0 | [
2,
275,
16,
13,
22,
17130,
1001,
329,
22,
28,
13,
15458,
1236,
800,
3726,
3726,
53,
16,
318,
13,
15458,
1236,
13,
22,
16154,
18,
22,
25,
45,
13,
1,
1637,
275,
14,
757,
1001,
329,
9,
26,
823,
15,
275,
13,
1,
6391,
3125,
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... |
Emacs: when byte-compile, it deletes any content inside foldings
===
Thank you very much in advance for the help.
I'm trying to byte-compile my init.le file.
The problem I have is that the resulting init.lec file is empty!
After some test I realised that any content inside foldings (that would be ;;{{{ ;;}}}) is deleted.
Anyone has any idea how to prevent this, apart from stop using foldings :-D (folding.el to be more precise).
I also tried to change the foldings syntax.
It wasn't easy, but when I got it work, Emacs deleted the content of the foldings with the new syntax! Crazy eh?
Cheers! | 0 | [
2,
13,
62,
6893,
18,
45,
76,
34,
591,
8,
11103,
3599,
15,
32,
27448,
18,
186,
2331,
572,
14516,
18,
800,
3726,
3726,
3531,
42,
253,
212,
19,
3612,
26,
14,
448,
9,
31,
22,
79,
749,
20,
34,
591,
8,
11103,
3599,
51,
19,
242,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 finish a payment transation - in app purchase
===
I am implementing in app purchase (non consumable type - songs ).when a user taps buy for every song purchase i call **startPurchase funtion**.my song content is delivered via my server.
In that when i purchased something and again try to re purchase the same, it is not treated as restore of purchase.it makes a new purchase.the delegate methods are called multiple times
Also, i am not sure how to remove the transaction from the payment Queue.
Please help me out
- (void)startPurchase:(NSString*)inProductId{
if ([SKPaymentQueue canMakePayments])
{
myProductId = inProductId
SKProductsRequest *productsRequest = [[SKProductsRequest alloc] initWithProductIdentifiers:[NSSet setWithObject:myProductId]];
productsRequest.delegate = self;
[productsRequest start];
}
else {
NSLog(@"Parental-controls are enabled");
}
}
- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:
(SKProductsResponse *)response {
NSLog(@"response received");
SKProduct *validProduct = nil;
int count = [response.products count];
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Message" message:
[NSString stringWithFormat:@"%d",response.products.count] delegate:
self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
if (count > 0) {
validProduct = [response.products objectAtIndex:0];
NSLog(@"products available");
SKPayment *payment = [SKPayment paymentWithProductIdentifier:myProductId];
[[SKPaymentQueue defaultQueue] addTransactionObserver:self];
[[SKPaymentQueue defaultQueue] addPayment:payment];
}
else if (!validProduct) {
NSLog(@"No products available");
}
}
- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray *)transactions
{
for (SKPaymentTransaction *transaction in transactions)
{
SKPayment *payment = [transaction payment];
if([payment.productIdentifier isEqualToString:myProductId])
{
NSLog(@"%@payement queue payment.productIdentifier",payment.productIdentifier);
switch (transaction.transactionState)
{
case SKPaymentTransactionStatePurchased:
NSLog(@"completeTransaction");
[self completeTransaction:transaction];
break;
case SKPaymentTransactionStateFailed:
NSLog(@"failedTransaction");
[self failedTransaction:transaction];
break;
case SKPaymentTransactionStateRestored:
NSLog(@"restoreTransaction");
[self restoreTransaction:transaction];
default:
break;
}
}
}
}
- (void)provideContent:(NSString *)productIdentifier
{
NSLog(@"Provide Content %@", productIdentifier);
}
- (void)recordTransaction:(SKPaymentTransaction *)transaction {
NSLog(@"inside the recordTransaction");
}
- (void) completeTransaction: (SKPaymentTransaction *)transaction
{
[self recordTransaction: transaction];
[self provideContent: transaction.payment.productIdentifier];
[[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}
- (void) restoreTransaction: (SKPaymentTransaction *)transaction
{
NSLog(@"restoreTransaction transaction inside");
}
- (void) failedTransaction: (SKPaymentTransaction *)transaction
{
if (transaction.error.code != SKErrorPaymentCancelled)
{
if(transaction.error.code == SKErrorUnknown) {
NSLog(@"Unknown Error (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}
if(transaction.error.code == SKErrorClientInvalid) {
NSLog(@"Client invalid (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}
if(transaction.error.code == SKErrorPaymentInvalid) {
NSLog(@"Payment invalid (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}
if(transaction.error.code == SKErrorPaymentNotAllowed) {
NSLog(@"Payment not allowed (%d), product: %@", (int)transaction.error.code, transaction.payment.productIdentifier);
UIAlertView *failureAlert = [[UIAlertView alloc] initWithTitle :@"In-App-Purchase Error:"
message: @"There was an error purchasing this item please try again."
delegate : self cancelButtonTitle:@"OK"otherButtonTitles:nil];
[failureAlert show];
[failureAlert release];
}
}
[[SKPaymentQueue defaultQueue] finishTransaction: transaction];
}
| 0 | [
2,
184,
20,
2106,
21,
7582,
2982,
857,
13,
8,
19,
4865,
3301,
800,
3726,
3726,
31,
589,
17333,
19,
4865,
3301,
13,
5,
3951,
11608,
723,
579,
1001,
13,
8,
916,
13,
6,
9,
3185,
21,
4155,
5526,
18,
3034,
26,
352,
338,
3301,
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... |
Prevent hash to work as anchor
===
I have a jQuery menu which is build up by like this:
<h3 id='300' rel='default.aspx?PageID=300#300'>Item0</h3>
<h3 id='301' rel='default.aspx?PageID=301#301'>Item1</h3>
<h3 id='302' rel='default.aspx?PageID=302#302'>Item2</h3>
The problem is that it triggers anchor functionallity and makes
the page jump/scroll down to the clicked menu point.
How can I prevent this?
Best regards. | 0 | [
2,
2501,
19170,
20,
170,
28,
6265,
800,
3726,
3726,
31,
57,
21,
487,
8190,
93,
11379,
56,
25,
1895,
71,
34,
101,
48,
45,
13,
1,
252,
240,
4924,
3726,
22,
6571,
22,
13,
7256,
3726,
22,
13862,
9708,
9,
472,
306,
396,
60,
6486,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
calling VBA function in Access from Java
===
I have a database designed using MS Access with a VBA function written in the database
When I try to call this function from a java program using JdbcOdbc Bridge I get SQLException with the message meaning "function is not found"
the function access modifier in the DB is "public" and I tried to use "ExtendedAnsiSQL=1" in the connection URL but I failed
Is there something missing or these functions cannot be called from external programs ? | 0 | [
2,
2555,
566,
969,
1990,
19,
1381,
37,
8247,
800,
3726,
3726,
31,
57,
21,
6018,
1006,
568,
4235,
1381,
29,
21,
566,
969,
1990,
642,
19,
14,
6018,
76,
31,
1131,
20,
645,
48,
1990,
37,
21,
8247,
625,
568,
487,
9007,
716,
43,
722... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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# Custom Button - Background Image Swapouts
===
Working with Winforms in Visual Studio 2010.
I've been creating a custom tool set for myself. One of the main things I do with buttons is I tend to create a custom button image in Photoshop and then import it in and use it as the background image of my button.
I swap out the Image for another I created (a slightly smaller, different coloured button image) when the user clicks or presses the button (on the mouse down event) and then swap it back to it's original image on Mouse Up.
My question is, is this taking up a lot of resource to swap out? and could it potentially stop something from working in the background, if say for example there is a lot going on when the button is pressed? Are there any better ways of doing it?
protected override void OnMouseDown(MouseEventArgs me)
{
base.OnMouseDown(me);
this.BackgroundImage = m_MouseDownImage;
}
This is the event that I override in my custom button. m_MouseDownImage is a bitmap that I turned in to a property by using a get and set statement.
| 0 | [
2,
272,
5910,
5816,
5167,
13,
8,
2395,
1961,
17150,
12638,
800,
3726,
3726,
638,
29,
628,
4190,
18,
19,
3458,
1120,
498,
9,
31,
22,
195,
74,
2936,
21,
5816,
5607,
309,
26,
992,
9,
53,
16,
14,
407,
564,
31,
107,
29,
12861,
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... |
make onItemLongClick work with webview in API_8
===
My webview implements `onItemLongClickListener` and its got its method
public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
displayMessage("Long Clicked!!");
this.openContextMenu(arg0);
return true;
}
Now, whenever I long click on a text-link, it works but on images or other items it doesn't.
I am Using API_8 for development and am still stuck on this error, then I read on a blog that you can't use LongClick in webview for APIs upto 8, is it true?? If yes, then as you can see I want to call a ContextMenu when long clicked, so is there another way around for doing it?
Any help with the code or link to detail tutorials on this subject will be appreciated. Thanks. | 0 | [
2,
233,
27,
2119,
79,
2701,
150,
10129,
170,
29,
2741,
4725,
19,
21,
2159,
1,
457,
800,
3726,
3726,
51,
2741,
4725,
8713,
18,
13,
1,
218,
2119,
79,
2701,
150,
10129,
13891,
106,
1,
17,
82,
330,
82,
2109,
317,
9827,
413,
210,
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... |
modx revo snippet variable in query
===
I noticed something weird when using a query in a snippet.
When I have a query like this:
$sql = 'SELECT * FROM table WHERE colomn = ' . $variable;
And I echo $sql, the query reads:
SELECT * FROM table WHERE colomn = <code class="php plain">2</code>
.. wich will result in an error because the sql is no longer valid.
So for now I use strip_tags to remove the code tag, but I find it not a very clean method.
I couldnt find anything about this, so maybe someone can shed some light on this for me?
| 0 | [
2,
7226,
396,
3867,
111,
13,
29061,
7612,
19,
25597,
800,
3726,
3726,
31,
2711,
301,
5455,
76,
568,
21,
25597,
19,
21,
13,
29061,
9,
76,
31,
57,
21,
25597,
101,
48,
45,
5579,
18,
22402,
800,
13,
22,
18,
16964,
1637,
37,
859,
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... |
in frame animation how to remove bitmapsizeexceeds vm budget error in android
===
here i need to do animation using more images.so here i am using frame by frame animation.but here i am facing outof memory bitmap size exceeds vm budget,i surfed in net but not getting any idea.any one having please help me....i tried using below code....
activity.java
scr1.setBackgroundResource(R.drawable.data9);
AnimationDrawable frameAnimation9 = (AnimationDrawable)scr1.getBackground();
frameAnimation9.start();
frameAnimation9.setOneShot(true);
data9.xml:
<?xml version="1.0" encoding="UTF-8"?>
<animation-list xmlns:android="http://schemas.android.com/apk/res/android"
android:oneshot="false">
<item android:drawable="@drawable/s1" android:duration="100" />
<item android:drawable="@drawable/s3" android:duration="100" />
<item android:drawable="@drawable/s5" android:duration="100" />
<item android:drawable="@drawable/s6" android:duration="100" />
</animation-list>
| 0 | [
2,
19,
3523,
6236,
184,
20,
4681,
1142,
15022,
10454,
1706,
1105,
69,
18,
13,
20147,
3391,
7019,
19,
13005,
800,
3726,
3726,
235,
31,
376,
20,
107,
6236,
568,
91,
3502,
9,
656,
235,
31,
589,
568,
3523,
34,
3523,
6236,
9,
811,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which pattern i should use for lookup table?
===
I have four lookup table (read-only in now) I need a pattern for using this table in my code.
I implemented Repository Pattern like this:
public interface ICellRepository
{
IEnumerable<CellLookup> GetCells();
}
public class CsvCellRepository
: ICellRepository
{
private readonly string _file;
public CsvCellRepository(string file)
{
_file = file;
}
#region Implementation of ICellRepository
public IEnumerable<CellLookup> GetCells()
{
if (string.IsNullOrEmpty(_file) || File.Exists(_file) == false)
{
throw new FileNotFoundException(string.Format("File not found:{0}", _file));
}
return File.ReadLines(_file)
.Skip(1) // skip header
.Select(s =>
{
var values = s.Split(',');
return new CellLookup
{
RncName = values[0],
RncId = int.Parse(values[1]),
NodeBId = string.IsNullOrEmpty(values[2]) == false ? int.Parse(values[2]) : 0,
CellName = values[3],
CellId = int.Parse(values[4]),
Psc = int.Parse(values[5])
};
});
}
#endregion
}
This implementation solved my problem but when I need to read lookup from Database,WCF or external source, which pattern i should use? When I change lookup source from IoC container, code couldn't need to any change.
| 0 | [
2,
56,
3732,
31,
378,
275,
26,
361,
576,
859,
60,
800,
3726,
3726,
31,
57,
222,
361,
576,
859,
13,
5,
10647,
8,
4965,
19,
130,
6,
31,
376,
21,
3732,
26,
568,
48,
859,
19,
51,
1797,
9,
31,
6807,
24869,
3732,
101,
48,
45,
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... |
how to write a twitter style word counter which is based on Encoding?
===
I have a field in my table with the type of `TINYTEXT`. the encoding of the field is `UTF8-UNICODE-ci`. If a chinese type something in the field the limit would be 88 characters, but if an iranian type something in persian there will about 135 characters and so on. So max text length is varied based on unicode. How to overcome this situation and have a word counter based on the specific language?
Is there a way for it? I couldn't find an approach for it ;( | 0 | [
2,
184,
20,
2757,
21,
10623,
1034,
833,
2105,
56,
25,
432,
27,
19608,
60,
800,
3726,
3726,
31,
57,
21,
575,
19,
51,
859,
29,
14,
1001,
16,
13,
1,
2864,
93,
11969,
1,
9,
14,
19608,
16,
14,
575,
25,
13,
1,
1982,
410,
457,
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... |
.net 2010: How to record in a database a user that is logged into the site?
===
Afternoon All,
I have a web site where i need to know who is inserting a record into my database table. I have a group of users which i have populated into an Active Directory (AD) group and in turn they are the only members able to access the site. (See web.config code and .vb code below)
'Config File
<appSettings>
<add key="dbConnection" value="Data Source=xxx;Initial Catalog=xxx;User ID=xxx;Password=xxx;"/>
<add key="Users" value="Users_General_Access"/>
</appSettings>
'Vb Code
If User.IsInRole(ConfigurationManager.AppSettings("Users")) Then
Else
Response.Redirect("NotAuthorised.aspx")
End If
I have a stored procedure that is used to insert data from my form fields into the database which work fine.
The problem that i have is that im not asking the user to log in as they are able to do so via the AD set up. However i need to caputre the username so i can populate this into my database table to state who has added that record.
Is there some VB code that i can use to obtain this information?
Many thanks in advance
Betty. | 0 | [
2,
13,
9,
2328,
15742,
184,
20,
571,
19,
21,
6018,
21,
4155,
30,
25,
13,
19287,
77,
14,
689,
60,
800,
3726,
3726,
3435,
65,
15,
31,
57,
21,
2741,
689,
113,
31,
376,
20,
143,
72,
25,
14692,
68,
21,
571,
77,
51,
6018,
859,
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... |
Deployment Issue When unpackWARs is false in tomcat7
===
I am trying to deploy my grails application in Tomcat 7.0.27
My application lib directory contains some properties file as well along with the Jars.
In tomcat server.xml, When I set unpackWARs false (compressed deployment), then apache-tomcat-7.0.27/work/Catalina/localhost/_/WEB-INF/lib directory contains only Jars not the properties files which I have in my application lib.
I also tried putting properties file in tomcat lib, But no lock.. . Is there any configuration in tomcat to troubleshoot this issue ?
Also when unpackWARs is false, there are only two folders lib and classes in apache-tomcat-7.0.27/work/Catalina/localhost/_/WEB-INF/. This is also creating a new problem as my application searches for some other folders also in WEB-INF. This works good with unpackWARs true.
Any help on the above two problems will really be appriceated
To overcome the above two problems, I can set unpackWARs true, but there is a problem in extracting the war. Suppose my war file name is ROOT.war and the ROOT folder is already existing in webapps, then the server starts do not extract the ROOT.war and my app goes up with the old ROOT folder.
What should be the best way to clean up existing extracted war folder ROOT ? For now, I am deleting the existing ROOT folder in the start up sctipt /etc/init.d/tomcat.
Should I set unpackWars true or false ?
Many many Thanks in advance..
The OS I am using is RHEL 5.2 .. Please let me know If you need more info
Regards,
Prashant Gupta | 0 | [
2,
10475,
1513,
76,
367,
8573,
1885,
18,
25,
4997,
19,
2067,
5782,
465,
800,
3726,
3726,
31,
589,
749,
20,
17617,
51,
489,
7301,
18,
3010,
19,
2067,
5782,
453,
9,
387,
9,
2567,
51,
3010,
13,
8326,
16755,
1588,
109,
3704,
3893,
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... |
Oracle Compound trigger - how to store and "use" deleted rows? INDEX BY table?
===
I am fighting a long struggle now for a DELETE trigger in Oracle, which, upon deleting a line, selects a new MAX value from the remaining rows and writes it to another table. After stumbling across the annoying ORA-04091 mutating table error (can't read table while in FOR EACH ROW).
How can I best store the deleted rows (multiple values per row, because the further check shall update only if the deleted score might have been the high score, not if it was a lower score)? I'm afraid a global temp table might end in a mess if multiple trigger events cross-fire and e.g. a highscore update runs for "DeletedMatches" which have not actually been deleted, but registered by the Before trigger event.
Can I create a table which
a) exists only locally in this trigger
b) can be used in SQL like normal DB tables or temporary tables
?
The following (pseudo-) code shall update the CurrentHighScores table whenever a match has been deleted (old high scores disappear and are replaced by the highest remaining score).
CREATE TABLE GameScores (
MatchId number not null --primary key
Player varchar(255) not null,
Game varchar(255) not null, -- PacMan, Pong, whatever...
Score number not null );
-- High score for each game:
CREATE TABLE CurrentHighScores (
HiScId number not null --primary key
Player varchar(255) not null,
Game varchar(255) not null,
HighScore number not null );
create or replace TRIGGER UpdHiScoreOnMatchDelete
FOR DELETE ON GameScores
COMPOUND TRIGGER
TYPE matchtable IS TABLE OF GameScores%ROWTYPE INDEX BY SIMPLE_INTEGER;
DeletedMatches matchtable;
MatchIndex SIMPLE_INTEGER := 0;
BEFORE EACH ROW IS -- collect deleted match scores
BEGIN
MatchIndex:= MatchIndex+ 1;
DeletedMatches(MatchIndex).Game := :old.Game;
DeletedMatches(MatchIndex).Score := :old.Score;
-- don't want to set every column value, want to
-- do like: INSERT :old INTO DeletedMatches;
-- don't want the Index either!
END BEFORE EACH ROW;
AFTER STATEMENT IS
BEGIN
UPDATE CurrentHighScores hsc
SET hsc.HighScore=(
select max(gsc.Score) from GameScores gsc
where hsc.Game=gsc.Game)
where hsc.Game IN (
select del.Game from DeletedMatches del where hsc.HighScore = del.Score)
-- won't work, how can I check within the SQL if a row
-- for this game has been deleted, or anyhow integrate
-- DeletedMatches into the SQL, without a cursor?
-- Optional further cond. in subselect, to update only
-- if deleted score equals highscore:
and exists(
select 1 from GameScores where Game=hsc.Game);
-- ignore games without remaining match scores.
-- Delete/set zero code for games without existing scores omitted here.
END AFTER STATEMENT;
| 0 | [
2,
15759,
6089,
7286,
13,
8,
184,
20,
1718,
17,
13,
7,
3699,
7,
19584,
11295,
60,
4348,
34,
859,
60,
800,
3726,
3726,
31,
589,
1849,
21,
175,
4697,
130,
26,
21,
27448,
7286,
19,
15759,
15,
56,
15,
685,
121,
1336,
68,
21,
293,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 show edittext, listview and positive and negative button in dialogbox?
===
How to show edittext and listview and positive and negative button in dialogbox? I tried to show them separatly but i want all of these in one dialogbox.
To show edit text i tried:
AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
builder.setView(modeList);
builder.setPositiveButton("Save", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
String myTextString = savedText.getText().toString().trim();
}
});
| 0 | [
2,
184,
20,
298,
9392,
11969,
15,
968,
4725,
17,
2221,
17,
3682,
5167,
19,
28223,
5309,
60,
800,
3726,
3726,
184,
20,
298,
9392,
11969,
17,
968,
4725,
17,
2221,
17,
3682,
5167,
19,
28223,
5309,
60,
31,
794,
20,
298,
105,
1353,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Obtaining the thread ID for Java threads in Linux
===
I have a Java application where some threads are created (via `new Thread()`). Using `ps` I can see they have different thread IDs (LWP column) and I would like to obtain those IDs from within the Java application.
In most of the posts related to this topic that I have found (e.g., [this one](http://stackoverflow.com/questions/35842/process-id-in-java)), the solution is to use `ManagementFactory.getRuntimeMXBean().getName()`.
Using that method, however, gives me the PID of the main thread (even if I call it from one of the threads), so it is not really solving my problem.
Is there any way to obtain the thread ID for every single `Thread` created by an application?
Would it be possible to use JNI to accomplish it? If somehow I could interface to a C function where I could call `syscall(__NR_gettid)`, that could solve my problem. I really do not care about portability, so I am totally okay with a solution that would only work for a Linux machine. | 0 | [
2,
12114,
14,
9322,
4924,
26,
8247,
20396,
19,
13024,
800,
3726,
3726,
31,
57,
21,
8247,
3010,
113,
109,
20396,
50,
679,
13,
5,
5034,
13,
1,
2681,
9322,
5,
6,
1,
6,
9,
568,
13,
1,
1919,
1,
31,
92,
196,
59,
57,
421,
9322,
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 correctly set Vim's makeprg (Windows)
===
In Linux, I've used this `au FileType c set makeprg=gcc\ -o\ %<` in my .vimrc to set my default compiler for .c files, and this: `nmap <F5> :<C-U>silent make %<CR>:redraw!<CR>:!./%<<CR>` to bind F5 key to make things faster.
How should I do this on Windows? I've tried with `au FileType c set makeprg="cmd /c C:\tcc\tcc.exe -o %<"` and some few other samples, but none have worked.
In brief: I want to hit `F5` to compile&run program in cmd or cmd with errors that compiler gave.
I'd appreciate any hints how to get this thing work on Windows. Thanks. | 0 | [
2,
184,
20,
12044,
309,
1790,
79,
22,
18,
233,
4899,
263,
13,
5,
27508,
18,
6,
800,
3726,
3726,
19,
13024,
15,
31,
22,
195,
147,
48,
13,
1,
1346,
3893,
4474,
272,
309,
233,
4899,
263,
3726,
263,
3384,
1,
13,
8,
111,
1,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.