unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Centering Placeholder Text in Subclass of UITextField
===
So first, I needed to set the placeholder text color, so I subclassed the UITextfield as shown in several stack overflow posts. This works fine. Here is an example post of this: http://stackoverflow.com/questions/6151474/how-do-i-subclass-uitextfield-and-override-drawplaceholderinrect-to-change-place.
But, when I try to use `searchNameField.textAlignment = UITextAlignmentCenter;` It is no longer centering the placeholder. The input text is still centered fine.
So then, assuming that the centering is not working because of the subclassing, what do I have to add to my UITextField subclass in order to have the placeholder text centered?
Thanks | 0 | [
2,
459,
68,
209,
12427,
1854,
19,
972,
1898,
16,
13,
5661,
11969,
1109,
800,
3726,
3726,
86,
64,
15,
31,
851,
20,
309,
14,
209,
12427,
1854,
1665,
15,
86,
31,
972,
1898,
69,
14,
13,
5661,
11969,
1109,
28,
1721,
19,
238,
7566,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What happen when Apache update at whm (cpanel)?
===
I use whm and I want to enable pdo class, as you can see at the following link:<br/> http://redz0ne202.wordpress.com/2011/06/09/how-to-enable-pdo-on-whm/
I see that it can be done only if I update the Apache. But I want to know if there is any possibility to loss my files if I make the update.
Thanks. | 2 | [
2,
98,
2384,
76,
17140,
11100,
35,
11153,
79,
13,
5,
150,
3206,
532,
6,
60,
800,
3726,
3726,
31,
275,
11153,
79,
17,
31,
259,
20,
9240,
351,
537,
718,
15,
28,
42,
92,
196,
35,
14,
249,
3508,
45,
1,
5145,
118,
1,
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... |
Apache mod_rewrite with '/' in url
===
We have this rule in the config:
RewriteRule (\w+)\/place_info\/(\d+)(\/.+|\/?)$ $1/place_info.php?id=$2 [QSA]
Which is used to take URL's of the form
http://www.ourdomain.com/section/place_info/12345/place-name-whatever
and internally pass it as
http://www.ourdomain.com/section/place_info.php?id=12345
This works just fine in all cases except when the `place-name-whatever` has a URL-encoded `/` character in it. For example, this works:
http://www.ourdomain.com/section/place_info/12345/place-name-whatever
and this works:
http://www.ourdomain.com/section/place_info/12345/place-name-whatever/with-slash
however this doesn't:
http://www.ourdomain.com/section/place_info/12345/place-name-whatever%2F/with-slash
For the hell of me I can't figure out what's happening here, and, more importantly, how to fix it. Any help is appreciated.
| 0 | [
2,
17140,
7226,
1,
99,
23716,
29,
13,
22,
118,
22,
19,
287,
6362,
800,
3726,
3726,
95,
57,
48,
1828,
19,
14,
13,
14093,
2816,
45,
27891,
16154,
13,
5,
1,
499,
2430,
6,
1,
118,
5119,
1,
108,
4120,
1,
118,
5,
1,
43,
2430,
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... |
Windows Azure - The current service model is out of sync
===
When I run a Windows Azure web role on my local developer fabric, I get the following error:
"The current service model is out of sync. Make sure both the service configuration and definition files are valid."
Any ideas what the problem could be?
| 0 | [
2,
1936,
25715,
13,
8,
14,
866,
365,
1061,
25,
70,
16,
6063,
150,
800,
3726,
3726,
76,
31,
485,
21,
1936,
25715,
2741,
597,
27,
51,
375,
10058,
6172,
15,
31,
164,
14,
249,
7019,
45,
13,
7,
124,
866,
365,
1061,
25,
70,
16,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How display data in 2 listview in diferent forms
===
I have a form (form1) with one listview and other controls.This ListView is filled with data. I wont to have same data in other form (form2) in ListView.
In this case I created a method RefreshForm with paramater listView.
Public Sub RefreshForm(ByVal listView As ListView)
On Error Resume Next
ListView2 = listView
ListView2.Refresh()
On Error GoTo 0
End Sub
In form1 in constructor I initialize form2 and show it.
form2 = new Form_CustInfo()
fCustInfo.Show()
After in method where I fill listView from form1 at end of method where listview is filled with data I call method RefreshForm from form2
form2.RefreshForm(Me.ListView2)
In method I entred with debug and I sow listview filled with data (ListView2 have 5 items) but and after refresh listview from form2 does't display this items.
Can anybody help me?
Thanks in advance!
| 0 | [
2,
184,
3042,
1054,
19,
172,
968,
4725,
19,
926,
2407,
2291,
1997,
800,
3726,
3726,
31,
57,
21,
505,
13,
5,
4190,
165,
6,
29,
53,
968,
4725,
17,
89,
8671,
9,
1565,
968,
4725,
25,
1943,
29,
1054,
9,
31,
7290,
20,
57,
205,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Docs Spreadsheet scripting: How to debug (aka where does Logger.log log to?)
===
In google docs spreadsheets, you can add some scripting functionality. I'm adding something for the `onEdit` event, but I can't tell if it's working. As far as I can tell, you can't debug a live event from google docs, so you have to do it from the debugger, which is pointless since the event argument passed to my `onEdit()` function will always be undefined if I run it from the `Script Editor`.
So, I was trying to use the `Logger.log` method to log some data whenever the `onEdit` function gets called, but this too seems like it only works when run from the `Script Editor`. When I run it from the `Script Editor`, I can view the logs by going to `View->Logs...`
I was hoping I'd be able to see the logs from when the event actually gets executed, but I can't figure it out.
How do I debug this stuff??! | 0 | [
2,
8144,
9765,
18,
1789,
17627,
3884,
68,
45,
184,
20,
121,
16254,
13,
5,
4176,
113,
630,
13,
29480,
9,
5567,
6738,
20,
60,
6,
800,
3726,
3726,
19,
8144,
9765,
18,
1789,
17627,
18,
15,
42,
92,
3547,
109,
3884,
68,
18548,
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... |
LinkButton as a Default Button
===
I'm using linkbuttons in my web applications, my 'composite controls' aren't using ASP Panels (therefore no 'DefaultButton' property, not that it would work). My link buttons currently have the href set as 'javascript:_doPostBack..' (asp default), but to enable my custom client side validation script, I ALSO have code in an 'onclick' attribute.
Typical Button :
<div class="button orange o_lime right Normal">
<a onclick="if (!validateFormmainContent_Login()) return false;"
id="mainContent_Login_ctl09_mainContent_Login_btnSubmit" defaultB="loginForm"
href="javascript:__doPostBack('ctl00$mainContent$Login$ctl09$mainContent_Login_btnSubmit','')">
Submit
</a>
</div>
Typical Form row requiring 'default button' action
<div class='row' ID='mainContent_Login_ctl03'>
<label ID='mainContent_Login_ctl04'>Email/Username</label>
<input name="ctl00$mainContent$Login$txtAccount" type="text" id="mainContent_Login_txtAccount" class="lime validate[required]" defaultB="loginForm" />
</div>
My current attempt at code to make this work :
<script type="javascript">
$('input[defaultB]').keypress(function (e) {
if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
$('a[defaultB=' + $(e.srcElement).attr('defaultB') + ']').click();
return false;
} else {
return true;
}
});
</script>
My current attempted solution assigns a value to 'defaultB' with something that matches the 'defaultB' value defined in a corresponding button, such that key press '13' (enter) should initiate the 'click' event. but nothing is happening :(
I've created a jsfiddle to help, but it isn't working with stupid 'cant find function' exception. :(
http://jsfiddle.net/Ninjanoel/yQvKC/
I'd really like to get this working without having to rework all my controls! Can anyone help?
| 0 | [
2,
3508,
811,
444,
28,
21,
12838,
5167,
800,
3726,
3726,
31,
22,
79,
568,
3508,
811,
444,
18,
19,
51,
2741,
3767,
15,
51,
13,
22,
960,
14882,
591,
8671,
22,
4847,
22,
38,
568,
28,
306,
9449,
13,
5,
1887,
16558,
90,
13,
22,
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... |
Facebook POST TO WALL . How to?
===
Hi guys I have big problem with " POST TO WALL ". Can someone show me how to do that ?
<?php
$app_id = "myappid";
$canvas_page = "mycanvaspage";
$auth_url = "https://www.facebook.com/dialog/oauth?client_id="
. $app_id . "&redirect_uri=" . urlencode($canvas_page);
$signed_request = $_REQUEST["signed_request"];
list($encoded_sig, $payload) = explode('.', $signed_request, 2);
$data = json_decode(base64_decode(strtr($payload, '-_', '+/')), true);
if (empty($data["user_id"])) {
echo("<script> top.location.href='" . $auth_url . "'</script>");
?>
I know how to make a POST TO WALL with dialog window but can someone show me how to make it wihout it ? | 0 | [
2,
9090,
678,
20,
769,
13,
9,
184,
20,
60,
800,
3726,
3726,
4148,
2776,
31,
57,
580,
1448,
29,
13,
7,
678,
20,
769,
13,
7,
9,
92,
737,
298,
55,
184,
20,
107,
30,
13,
60,
13,
1,
60,
26120,
5579,
7753,
1,
1340,
800,
13,
7,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Any known workarounds to the ASP.NET MVC 4 RC Mobile bug?
===
The bug [described here][1], essentially breaks the mobile feature of ASP.NET MVC 4 (where it can select *.mobile.cshtml views automatically). Are there any known workarounds to this bug?
[1]: http://aspnetwebstack.codeplex.com/workitem/280 | 0 | [
2,
186,
167,
170,
10037,
18,
20,
14,
28,
306,
9,
2328,
307,
8990,
268,
16462,
3241,
6256,
60,
800,
3726,
3726,
14,
6256,
636,
27701,
235,
500,
2558,
165,
500,
15,
7398,
7947,
14,
3241,
1580,
16,
28,
306,
9,
2328,
307,
8990,
268,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 get the last inserted value of primary kay field?
===
I am using MySQL.I have to get the last inserted record's primary key value.
How can i get this?
| 0 | [
2,
184,
92,
31,
164,
14,
236,
14215,
1923,
16,
1256,
7237,
575,
60,
800,
3726,
3726,
31,
589,
568,
51,
18,
22402,
9,
49,
57,
20,
164,
14,
236,
14215,
571,
22,
18,
1256,
1246,
1923,
9,
184,
92,
31,
164,
48,
60,
3,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Avoid losing focus in Android when Bluetooth PIN is asked
===
When my App connects for the first time with a particular device via Bluetooth, a dialog appears asking to type in the PIN. The problem is that if the user touches the screen outside the dialog, it loses focus and dissapears... an from then on, it's just trouble, the user must force the App to close, or go back to a previous state and restart the pairing process...
So, my questions are: Is there any way to avoid (programmatically) losing focus on that system-generated-dialog? Is that the normal behaviour of the system or should I check my code for bugs/conceptual errors?
| 0 | [
2,
2658,
2281,
1776,
19,
13005,
76,
705,
15808,
3459,
25,
411,
800,
3726,
3726,
76,
51,
4865,
8534,
26,
14,
64,
85,
29,
21,
1498,
3646,
1197,
705,
15808,
15,
21,
28223,
1780,
3379,
20,
1001,
19,
14,
3459,
9,
14,
1448,
25,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
taking Sreen-shot in nadroid
===
I want to take a screen shot of my Activity & components of Avtivity(View).
This Activity contains A SurfaceView & a layout on the top of each other.
When i take screen shot of Surface view it works well, but when i take screen shot of whole Activity i do not get the surface view in it.I am using following Code.
public class Screenshot {
private final View view;
/** Create snapshots based on the view and its children. */
public Screenshot(View root) {
this.view = root;
}
/** Create snapshot handler that captures the root of the whole activity. */
public Screenshot(Activity activity) {
final View contentView = activity.findViewById(android.R.id.content);
this.view = contentView.getRootView();
}
/** Take a snapshot of the view. */
public Bitmap snap() {
Bitmap bitmap = Bitmap.createBitmap(this.view.getWidth(), this.view.getHeight(), Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
return bitmap;
}
} | 0 | [
2,
741,
21487,
103,
8,
7868,
19,
7536,
18524,
800,
3726,
3726,
31,
259,
20,
247,
21,
2324,
999,
16,
51,
2358,
279,
5090,
16,
14026,
38,
9633,
5,
4725,
6,
9,
48,
2358,
1588,
21,
1490,
4725,
279,
21,
9106,
27,
14,
371,
16,
206,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to read a file's contents into an SQL variable
===
Could someone tell me how to read a file's contents into an MS SQL variable using T-SQL? | 0 | [
2,
184,
20,
1302,
21,
3893,
22,
18,
8478,
77,
40,
4444,
255,
7612,
800,
3726,
3726,
110,
737,
494,
55,
184,
20,
1302,
21,
3893,
22,
18,
8478,
77,
40,
4235,
4444,
255,
7612,
568,
13,
38,
8,
18,
22402,
60,
3,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Implementing Google Analytics on a Windows 8 Metro application
===
I'd like to implement Google Analytics tracking on a Windows 8 / Metro app.
There's no Windows SDK.
What would be the best way to do it in your opinion ?
Thanks, best regards
Geoffroy | 0 | [
2,
17333,
8144,
26320,
27,
21,
1936,
469,
3986,
3010,
800,
3726,
3726,
31,
22,
43,
101,
20,
8713,
8144,
26320,
10353,
27,
21,
1936,
469,
13,
118,
3986,
4865,
9,
80,
22,
18,
90,
1936,
13,
18,
43,
197,
9,
98,
83,
44,
14,
246,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Is it possible to use value transformers as a filter for a tree controller?
===
For example, I have an NSOutlineView bound to a Tree Controller which is bound to a list of root objects. Is it possible to filter which objects are displayed in the NSOutlineView by their type using a custom value transformer?
So far i've not been able to do it... | 0 | [
2,
25,
32,
938,
20,
275,
1923,
21970,
28,
21,
11945,
26,
21,
1541,
9919,
60,
800,
3726,
3726,
26,
823,
15,
31,
57,
40,
13,
2172,
1320,
1143,
4725,
4138,
20,
21,
1541,
9919,
56,
25,
4138,
20,
21,
968,
16,
5900,
3916,
9,
25,
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... |
Forget password send to email in android app
===
Hi i have developed a login form (username,password and submit button) using a MySQL connection through soap webservices in my android application.
here i forget my password means i can't access my account.then how is access my account.first registration page is completed all before go to login page.registration page have username,password and email.so when i forget my password means click the forget password textview.then it is go to forget password activity.here when i entered my registered email id means my password is send to my email id.how can i do.please guide me.
like below image:![enter image description here][1]
![enter image description here][2]
[1]: http://i.stack.imgur.com/sHKdG.png
[2]: http://i.stack.imgur.com/tNhKm.png
How can i create dis app.I done dis code in the XML resource for the activity.how do I create the ForgetPassword Java code? I can't seem to be able to do this.
stillnow my java code is :
Login.java :
package com.truebranches;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapPrimitive;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
public class Login extends Activity {
private final String NAMESPACE = "http://ws.userlogin.com";
private final String URL = "http://192.168.1.168:8085/Login/services/Login?wsdl";
private final String SOAP_ACTION = "http://ws.userlogin.com/authentication";
private final String METHOD_NAME = "authentication";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
Button register = (Button) findViewById(R.id.btn_reg);
register.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Switching to Register screen
Intent i = new Intent(getApplicationContext(), Register.class);
startActivity(i);
}
});
Button logout = (Button) findViewById(R.id.btn_logout);
logout.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Switching to Register screen
Intent i = new Intent(getApplicationContext(), Login.class);
startActivity(i);
}
});
TextView forgetpassword = (TextView) findViewById(R.id.TextView03);
forgetpassword.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// Switching to Register screen
Intent i = new Intent(getApplicationContext(), ForgetPassword.class);
startActivity(i);
}
});
Button login = (Button) findViewById(R.id.btn_login);
login.setOnClickListener(new View.OnClickListener() {
public void onClick(View arg0) {
loginAction();
}
});
}
private void loginAction(){
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
EditText userName = (EditText) findViewById(R.id.tf_userName);
String user_Name = userName.getText().toString();
EditText userPassword = (EditText) findViewById(R.id.tf_password);
String user_Password = userPassword.getText().toString();
//Pass value for userName variable of the web service
PropertyInfo unameProp =new PropertyInfo();
unameProp.setName("userName");//Define the variable name in the web service method
unameProp.setValue(user_Name);//set value for userName variable
unameProp.setType(String.class);//Define the type of the variable
request.addProperty(unameProp);//Pass properties to the variable
//Pass value for Password variable of the web service
PropertyInfo passwordProp =new PropertyInfo();
passwordProp.setName("password");
passwordProp.setValue(user_Password);
passwordProp.setType(String.class);
request.addProperty(passwordProp);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try{
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
String status = response.toString();
TextView result = (TextView) findViewById(R.id.tv_status);
result.setText(response.toString());
if(status.equals("Success!"))
{
Intent intent = new Intent(Login.this,HomePage.class);
intent.putExtra("username",userName.getText().toString());
startActivity(intent);
}
else
{
Intent i = new Intent(getApplicationContext(), Login.class);
startActivity(i);
}
}
catch(Exception e){
}
}
} | 0 | [
2,
3856,
20884,
2660,
20,
8517,
19,
13005,
4865,
800,
3726,
3726,
4148,
31,
57,
885,
21,
6738,
108,
505,
13,
5,
16704,
7259,
15,
6201,
9587,
17,
12298,
5167,
6,
568,
21,
51,
18,
22402,
2760,
120,
6447,
2741,
11449,
18,
19,
51,
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... |
R: Plot multiple box plots using columns from matrix
===
I would like to plot an INDIVIDUAL box plot for each column in a matrix. I thought I was on the right track with `boxplot.matrix` from the `sfsmsic` package, but it seems to do the same as `boxplot(as.matrix(plotdata)` which is to plot everything in a shared boxplot with a shared scale on the axis. I want (say) 5 individual plots.
I could do this by hand like:
par(mfrow=c(2,2))
boxplot(data$var1
boxplot(data$var2)
boxplot(data$var3)
boxplot(data$var4)
But there must be a way to use the matrix columns? | 0 | [
2,
761,
45,
3798,
1886,
1649,
18205,
568,
7498,
37,
8187,
800,
3726,
3726,
31,
83,
101,
20,
3798,
40,
1359,
1649,
3798,
26,
206,
4698,
19,
21,
8187,
9,
31,
289,
31,
23,
27,
14,
193,
792,
29,
13,
1,
5309,
13221,
38,
9,
540,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android multi-touch feature (up to 6 touches)
===
i want to know if it is possible to make a android application that features up to 6 touches simultaneously with the multi-touch option (not just two). Please can u help me to find some relevant literature. I've found some answers here on stackoverflow, but i am afraid that that's not enough.
I would appreciate every help. Thank you all in advance.
| 0 | [
2,
13005,
1889,
8,
15725,
1580,
13,
5,
576,
20,
400,
13935,
6,
800,
3726,
3726,
31,
259,
20,
143,
100,
32,
25,
938,
20,
233,
21,
13005,
3010,
30,
967,
71,
20,
400,
13935,
6888,
29,
14,
1889,
8,
15725,
4255,
13,
5,
1270,
114,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
php-fpm: include vs. require vs. in-one-file
===
I am using php-fpm: Did anyone experience differences in execution time when loading additional php scripts with require or include or writing the code directly in the source file instead of loading from other files?
Thanks for tips | 0 | [
2,
13,
26120,
8,
12087,
79,
45,
468,
4611,
9,
4077,
4611,
9,
19,
8,
849,
8,
16877,
800,
3726,
3726,
31,
589,
568,
13,
26120,
8,
12087,
79,
45,
144,
1276,
1496,
4921,
19,
5769,
85,
76,
12797,
1351,
13,
26120,
17505,
29,
4077,
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... |
C# How to make a circle shape label in Window Form?
===
As you all know, a label is usually in a square or rectangle shape. I really need to make circle label right now. Can anyone please tell me is this possible or at least point me in a right direction? Thanks in advance for taking your time to read this.
Some sample code would be much appreciated.
| 0 | [
2,
272,
5910,
184,
20,
233,
21,
2775,
2539,
1899,
19,
1463,
505,
60,
800,
3726,
3726,
28,
42,
65,
143,
15,
21,
1899,
25,
951,
19,
21,
735,
54,
27181,
2539,
9,
31,
510,
376,
20,
233,
2775,
1899,
193,
130,
9,
92,
1276,
2247,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery .get() seems to fail but cant get a message back
===
i have this .get() returning data that is fine from the URL but when it loops through and there isnt the required data at that URL it doesnt return an alert with .error(); or even .fail(); want an action to happen if it cant find what its looking for, what have i done wrong?
$.get('/jsp/landing.jsp?id=FiresContent', function(data){
var DataReturned = $(data).find('#' + topNavliID +' > div').each(function(index){
SkuDetail = "<li id='" + index + "'><article><ul><li class='sku-" + index + "'>" + $(this).find('.sku').text() + "</li>";
SkuDetail = SkuDetail + "<li class='prodName-" + index + "'><h2>" + $(this).find('.prodName').text() + "</h2></li>";
SkuDetail = SkuDetail + "<li class='prodDesc-" + index + "'>" + $(this).find('.prodDesc').text() + "</li>";
SkuDetail = SkuDetail + "<li class='action-" + index + "'><a href='" + $(this).find('.actionLink').text() + "' title='" + $(this).find('.action').text() + "'>" + $(this).find('.action').text() + "</a></li></ul></article></li>";
ThumbNail = "<li class='thumbImage-" + index + "'><img src='/images/CAT110/FireSurrounds/thumbnail_" + $(this).find('.sku').text() + ".jpg' alt='" + $(this).find('.prodNameShort').text() + "' title='" + $(this).find('.prodNameShort').text() + "'>";
ThumbNail = ThumbNail + "<span class='prodNameShort-" + index + "'>" + $(this).find('.prodNameShort').text() + "</span></li>";
$('#largeSlides').css('width','+=1000');
$('#largeSlides').append(SkuDetail);
$('#thumbSlides').append(ThumbNail);
// remove loading image once loaded.
$('.loadingmessage').fadeOut(800, function(){
$(this).remove();
});
});
}).fail(function(){ alert("$.get failed!"); });
//.error(function() { alert("error"); }); | 0 | [
2,
487,
8190,
93,
13,
9,
3060,
5,
6,
2206,
20,
7476,
47,
2973,
164,
21,
2802,
97,
800,
3726,
3726,
31,
57,
48,
13,
9,
3060,
5,
6,
2485,
1054,
30,
25,
1123,
37,
14,
287,
6362,
47,
76,
32,
19661,
120,
17,
80,
8441,
14,
1390,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 decltype with virtual member function pointers
===
Is it legal to use `decltype` with virtual member function pointers?
The following generates an internal error (C1001) with VS2012.
struct C
{
virtual void Foo() {}
typedef decltype(&C::Foo) type; //pointer
}
But this compiles fine:
struct C
{
virtual void Foo() {}
typedef decltype(C::Foo) type; //not pointer
}
Is it a bug? | 0 | [
2,
568,
121,
5316,
4474,
29,
6599,
322,
1990,
454,
445,
800,
3726,
3726,
25,
32,
1517,
20,
275,
13,
1,
546,
5316,
4474,
1,
29,
6599,
322,
1990,
454,
445,
60,
14,
249,
7920,
18,
40,
3117,
7019,
13,
5,
150,
4031,
165,
6,
29,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery mobile: Uncaught no such method 'open' for dialog widget instance
===
Here's my code in the `<head></head>`:
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<script type="text/javascript">
// <![CDATA[
$(function() {
});
$(document).ready(function () {
$('#dialog1')
.dialog({
position: 'center',
modal: true,
autoOpen: false
})
;
$('.panier')
.unbind('click')
.click(function(event) {
event.preventDefault();
$('#dialog1').dialog('open');
});
});
// ]]>
</script>
And the html code:
<div data-role="page">
<div data-role="header">
<h1>Choisissez vos pizzas !</h1>
</div>
<div data-role="content">
<div data-role="footer">
<div data-role="navbar">
<ul>
<li><a class="panier" href="/" data-role="button" data-icon="search">Voir panier</a></li>
</ul>
</div>
</div>
</div>
</div>
<div data-role="dialog" id="dialog1" class="app-dialog">
<div data-role="header">
<h3>A dialog</h3>
</div>
<div id="content" data-role="content">
<p>I am a dialog....!</p>
</div>
</div>
When I launch my page everything's fine until I click on the "panier" button: the error raised is:
Uncaught no such method 'open' for dialog widget instance
I really don't know why this doesn't work, because a dialog widget instance *should have* an `open()` method.
Any idea? | 0 | [
2,
487,
8190,
93,
3241,
45,
16061,
12647,
90,
145,
2109,
13,
22,
10157,
22,
26,
28223,
4807,
43,
3060,
4851,
800,
3726,
3726,
235,
22,
18,
51,
1797,
19,
14,
13,
1,
1743,
1,
118,
1743,
1,
45,
13,
1,
6258,
13,
7256,
3726,
7,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
installer c# windows form app/sdf database
===
I did a c# windows form app that use a local sdf database but I can't create a installer for that. I use the setup wizard from visual studio but the intalled programme give me a unhandled exception error. I don't know if the error is the connection string or other.
Someone can help me? | 0 | [
2,
16146,
106,
272,
5910,
1936,
505,
4865,
118,
18,
8736,
6018,
800,
3726,
3726,
31,
144,
21,
272,
5910,
1936,
505,
4865,
30,
275,
21,
375,
13,
18,
8736,
6018,
47,
31,
92,
22,
38,
1600,
21,
16146,
106,
26,
30,
9,
31,
275,
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... |
Why memory clean only if I press home button and back on Android device?
===
I have listView and custom ArrayAdapter for it. In my list View are many pictures and I use strong memory cleaning:
@Override
public void onDestroy() {
list.clear();
adapter.notifyDataSetChanged();
listView.setAdapter(null);
super.onDestroy();
}
And use LazyLoader for images loading.
But after some times using my application (when I updating list) I will still got "bitmap size exceeds vm budget" error. Although if I press home button and back to application memory is cleared. How can I clear memory without it?
| 0 | [
2,
483,
1912,
2745,
104,
100,
31,
901,
213,
5167,
17,
97,
27,
13005,
3646,
60,
800,
3726,
3726,
31,
57,
968,
4725,
17,
5816,
7718,
27576,
106,
26,
32,
9,
19,
51,
968,
1418,
50,
151,
3104,
17,
31,
275,
966,
1912,
9724,
45,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Automatically update database when new excel sheet is added in a folder
===
I need to write one java program which monitors a folder containing excel sheets (.xls format) . Once a new excel sheet is added I have to update the database in db2 and move the excel sheet to other place.
Please suggest | 0 | [
2,
7499,
11100,
6018,
76,
78,
20700,
6125,
25,
905,
19,
21,
19294,
800,
3726,
3726,
31,
376,
20,
2757,
53,
8247,
625,
56,
18521,
21,
19294,
3503,
20700,
8801,
13,
5,
9,
396,
7532,
2595,
6,
13,
9,
382,
21,
78,
20700,
6125,
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... |
Jquery Ajax Post Error Undefined in Codeigniter
===
I am implementing a jquery ajax form submission on selecting the checkbox. I am always getting error undefined in the response data. Please find my code as following.
**Jquery Post**
$.ajax({
type: "POST",
url: filelink+"playlist/add_cart_item",
data: "product_id=id&quantity=qty&ajax='1'",
success: function(msg){ alert( "Data Saved: " + msg );},
error: function(jqXHR, textStatus, errorThrown)
{ alert(textStatus + " " + errorThrown) }});
**Controller Function**
function add_cart_item(){
echo "true";
}
File link is giving me the exact path. Jquery library file is also properly included. Can anybody please help where could be the problem.
Thanks | 0 | [
2,
487,
8190,
93,
20624,
678,
7019,
367,
13439,
19,
1797,
9693,
242,
106,
800,
3726,
3726,
31,
589,
17333,
21,
487,
8190,
93,
20624,
505,
10923,
27,
20764,
14,
2631,
5309,
9,
31,
589,
550,
1017,
7019,
367,
13439,
19,
14,
1627,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Backbone.js, Unable to understand what is "app.wineList.create(this.model)" in the "saveWine" method
===
I am unable to understand what is "app.wineList.create(this.model)" in the "saveWine" method. How it will work ? I am new to backbone.js, plz help me to understand this. I am aware of this.model.save().
Actually I have removed some code here. Just I have posted the code where my problem was.
Thanks.
// Models
window.Wine = Backbone.Model.extend({
urlRoot:"../api/wines",
defaults:{
"id":null,
"name":"",
"grapes":"",
"country":"USA",
"region":"California",
"year":"",
"description":"",
"picture":""
}
});
window.WineCollection = Backbone.Collection.extend({
model:Wine,
url:"../api/wines"
});
// Views
window.WineView = Backbone.View.extend({
template:_.template($('#tpl-wine-details').html()),
initialize:function () {
this.model.bind("change", this.render, this); // (event, function, context)
},
render:function (eventName) {
$(this.el).html(this.template(this.model.toJSON()));
return this;
},
events:{
"click .save":"saveWine"
},
saveWine:function () {
this.model.set({
name:$('#name').val(),
grapes:$('#grapes').val(),
country:$('#country').val(),
region:$('#region').val(),
year:$('#year').val(),
description:$('#description').val()
});
if (this.model.isNew()) {
app.wineList.create(this.model);
} else {
this.model.save();
}
return false;
}
});
// Router
var AppRouter = Backbone.Router.extend({
routes:{
"":"list",
"wines/:id":"wineDetails"
},
initialize:function () {
$('#header').html(new HeaderView().render().el);
},
list:function () {
this.wineList = new WineCollection();
this.wineListView = new WineListView({model:this.wineList});
this.wineList.fetch();
$('#sidebar').html(this.wineListView.render().el);
},
wineDetails:function (id) {
this.wine = this.wineList.get(id);
if (app.wineView) app.wineView.close();
this.wineView = new WineView({model:this.wine});
$('#content').html(this.wineView.render().el);
}
});
var app = new AppRouter();
Backbone.history.start(); | 0 | [
2,
24036,
9,
728,
18,
15,
2343,
20,
1369,
98,
25,
13,
7,
7753,
9,
17275,
5739,
9,
6037,
1373,
5,
1565,
9,
13998,
6,
7,
19,
14,
13,
7,
19863,
17275,
7,
2109,
800,
3726,
3726,
31,
589,
2343,
20,
1369,
98,
25,
13,
7,
7753,
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... |
Jasmine dependency on browser
===
From Last few days I am reading and working on Jasmine.After reading it I am able to write specification (test cases) and also able to run it successfully.
I also debugged internals flow of jasmine.
As jasmine is embeded in a html file and this html file will run on browser.
I want to know any type of dependencies of jasmine on browser (any browser).
Is jasmine is using browser's script engine ? If yes how it is configured?
If any one has an idea or tutorials then please share.
Thanks in advance. | 0 | [
2,
15885,
26835,
27,
16495,
800,
3726,
3726,
37,
236,
310,
509,
31,
589,
1876,
17,
638,
27,
15885,
9,
5162,
1876,
32,
31,
589,
777,
20,
2757,
14177,
13,
5,
10543,
1871,
6,
17,
67,
777,
20,
485,
32,
3673,
9,
31,
67,
121,
2345,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Removing compilation metadata from Python
===
I use Python in one of my products.
I compiled the source code using:
./configure --prefix=/home/myname/python_install
make
make install.
I looked inside python_install directory and noticed that many files (config, pyc, pyo), disclose information about my environment (i.e. where i compiled it, directory, date, name, etc..)
I used 'grep -i -r "myname"'
How do I remove this metadata from all those files? I do not want to ship my product with this information.
| 0 | [
2,
9096,
4868,
28057,
37,
20059,
800,
3726,
3726,
31,
275,
20059,
19,
53,
16,
51,
1985,
9,
31,
9316,
14,
1267,
1797,
568,
45,
13,
9,
118,
1126,
15951,
13,
8,
8,
3515,
18594,
3726,
118,
8167,
118,
915,
7259,
118,
6448,
11570,
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... |
Localizing the Cut|Copy|Paste menu on iOS
===
Im having some issues localizing a danish app ive made. (The language, not the pastry)
I have set the CFBundleDevelopmentRegion to da_DK for danish in my info.plist, but the popup appearing for text input is still in english, even on phones running the danish OS.
![enter image description here][1]
How in Jobs name can i change this ?
[1]: http://i.stack.imgur.com/l89Gb.png | 0 | [
2,
375,
3335,
14,
1077,
1,
19625,
1,
19802,
62,
11379,
27,
13,
7760,
800,
3726,
3726,
797,
452,
109,
1549,
375,
3335,
21,
4708,
4865,
5568,
117,
9,
13,
5,
124,
816,
15,
52,
14,
640,
622,
6,
31,
57,
309,
14,
10084,
9930,
413,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Generate PDF from a big image using Apache FOP
===
I would like to generate a PDF from an image, using Apache FOP and XSLT. However, if image s bigger, then PDF document page, then it only gets as much space as it is available on the page (including right and bottom margin). So, part of the image is out of page bounds.
Is this possible to setup fop so that if image can't be fitted into the page it is automatically splitted into the multiple pages?
Here is my xslt template:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:java="http://xml.apache.org/xslt/java"
xmlns:dp="http://www.dpawson.co.uk"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:f="Functions"
xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes"
exclude-result-prefixes="java">
<xsl:output method="xml" version="1.0" omit-xml-declaration="no" indent="yes" />
<xsl:param name="image-print-path" />
<xsl:template match="/">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="simpleA4"
page-height="29.7cm" page-width="21cm" margin-top="2cm"
margin-bottom="2cm" margin-left="2cm" margin-right="2cm">
<fo:region-body margin-top="20pt" margin-bottom="35pt" />
<fo:region-before extent=".5in"/>
<fo:region-after extent=".5in"/>
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="simpleA4">
<fo:static-content flow-name="xsl-region-before" text-align="left">
<fo:block font-size="10pt">
Print
</fo:block>
</fo:static-content>
<fo:static-content flow-name="xsl-region-after">
<fo:block font-size="10pt" text-align="left">
something else
</fo:block>
<!-- TODO: add current date, page number -->
</fo:static-content>
<fo:flow flow-name="xsl-region-body">
<fo:block font-size="10pt" page-break-after="always">
<fo:external-graphic src="{$image-print-path}"/>
</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
</xsl:stylesheet> | 0 | [
2,
7920,
13,
11124,
37,
21,
580,
1961,
568,
17140,
398,
2594,
800,
3726,
3726,
31,
83,
101,
20,
7920,
21,
13,
11124,
37,
40,
1961,
15,
568,
17140,
398,
2594,
17,
993,
18,
255,
38,
9,
207,
15,
100,
1961,
13,
18,
6197,
15,
94,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
what is the best way to learn new Java features since java 1.4.2
===
I recently started to use Java for work, but I am mostly doing it using my early knowledge about java 1.4. I am aware that there are a great number of new Java features (which I know some, but not thorough enough).
What is the most effective way to learn those new features, instead of reading those fundamental books with a lot of content I already know.
| 0 | [
2,
98,
25,
14,
246,
161,
20,
2484,
78,
8247,
967,
179,
8247,
137,
9,
300,
9,
135,
800,
3726,
3726,
31,
1989,
373,
20,
275,
8247,
26,
170,
15,
47,
31,
589,
1555,
845,
32,
568,
51,
274,
1918,
88,
8247,
137,
9,
300,
9,
31,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Insert into my database with jQuery (ajax) and PHP
===
i'm trying to insert some data in my table golde-book. All is good , i dont have any error , the answer are good but there isn't no data insert in my table.
i don't know what is wrong with this code , maybe you can help me ?
my ajax request in golden-book.js
function insert_messages(auteur_message,message){
$.ajax({
type : "POST",
cache: false,
url : "insert-messages.php",
data:{
auteur_message:auteur_message,
message:message
},
success: function() {
},
error : function() {//en cas de problème de requete AJAX
alert("Sorry, The requested property could not be found.");//affichage d'un mesage d'erreur
}
});
}
insert-messages.php
<?php
$auteur_message = $_POST['auteur_message'];
$message = $_POST['message'];
try {
// On se connecte à MySQL
$bdd = new PDO('mysql:host=localhost;dbname=photo', 'root', '');
} catch (Exception $e) {
// En cas d'erreur, on affiche un message et on arrête tout
die('Erreur : ' . $e->getMessage());
}
$req = $bdd->prepare('INSERT INTO photo.golden_book (auteur-message , message) VALUES (:auteur , :message)');
$req->execute(array(
'auteur' => $auteur_message,
'message' => $message));
?>
Thank you all in advance for taking your time to help me. | 0 | [
2,
14692,
77,
51,
6018,
29,
487,
8190,
93,
13,
5,
6881,
7522,
6,
17,
13,
26120,
800,
3726,
3726,
31,
22,
79,
749,
20,
14692,
109,
1054,
19,
51,
859,
766,
62,
8,
5199,
9,
65,
25,
254,
13,
15,
31,
1049,
57,
186,
7019,
13,
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... |
Can't start debugger in VS2012 RC
===
Configuration:
- Windows 7, 64 bit
- Microsoft Visual Studio Professional 2012 RC Version 11.0.50522.1
RCREL
- Running VS in administrator mode
- The VS solution contains a web
application, with target: .NET Framework 4.
When I press F5, the solution builds... and nothing else happens.
- Happens with both IIS or the VS Dev Server.
- Happens with Platform Target of "Any CPU" or "x86"
If instead, I use the Debug / Attach to Process... menu, after a few seconds, I get:
- "Debugger is Busy" - Debugger is performing a remote operation that is taking longer than expected. This dialog stay until I click "Terminate" and confirm it.
- Then this dialog appears:
"Microsoft Visual Studio"
"Unable to connect to the Microsoft Visual Studio Remote Debugging Monitor named [COMPUTER NAME]. The network connection to the Visual Studio Remote Debugger has been closed."
- After clicking OK, the 'normal' "Attach to Process" window finally shows up. In it, the list of "Available Processes" is empty.
Any suggestions or clues?
The main points that I wonder about:
- Why is the list of processes empty? It is not surprising that the debugger does not work if it cannot see any processes.
- Why is it trying to do "remote" debugging, when it is just accessing the local computer?
(Cross posted on [social.msdn](http://social.msdn.microsoft.com/Forums/en-US/vsdebug/thread/c8218a0c-6cca-4fb4-afcb-0ae97710a0a6)) | 0 | [
2,
92,
22,
38,
799,
121,
2345,
11356,
19,
4611,
3212,
16462,
800,
3726,
3726,
8091,
45,
13,
8,
1936,
453,
15,
4384,
1142,
13,
8,
7099,
3458,
1120,
736,
563,
16462,
615,
547,
9,
387,
9,
26373,
2287,
9,
165,
16462,
7256,
13,
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... |
Request-response using Netty or other lightweight NIO library
===
I'm developing a system that requires fast communication between two multithreaded applications through the network. Semantically, one application is a client that continuously does RMI calls to another application (server). I suspect that a lightweight library like Netty is more suitable for this task than a heavyweight approach like Tomcat/HTTPClient because of performance reasons. However, Netty is inherently asynchronous and it seems that it's quite difficult to properly implement RMI or request-response invocations on top of it.
Is there way to do request-response calls and, at the same time, leverage high Netty performance without development of error-prone customizations? Are there alternatives to Netty that are more suitable for this task? | 0 | [
2,
3772,
8,
99,
18,
8782,
870,
568,
4275,
1084,
54,
89,
13613,
13,
15042,
1248,
800,
3726,
3726,
31,
22,
79,
3561,
21,
329,
30,
4781,
1512,
3291,
128,
81,
1889,
96,
10647,
69,
3767,
120,
14,
982,
9,
17220,
1326,
15,
53,
3010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WIX Harvest directory for new release while maintaing same GUID as previous versions
===
I'm trying to harvest a directory using heat and all is working fine, and I get my fragment wks with all the info including the registration of .net assembly and native com.
My problem is with my product next release. According to the documentation, I need to keep the same GUID for files even if I have a new version of these files. As the .net assmebly registration contains version number of the files installed, I shall need to re-harvest the directory next time I shall release a version, but then all the GUID for the files will be new and this (per my understanding) is not something I should do.
I hope I understood correctly the component GUID "*" thing. This seems very trivial but I still can't get it even after reading in stackoverflow and the documentation.
Regards,
Tzach | 0 | [
2,
4807,
396,
10602,
16755,
26,
78,
830,
133,
4027,
263,
205,
9457,
43,
28,
1158,
3281,
800,
3726,
3726,
31,
22,
79,
749,
20,
10602,
21,
16755,
568,
1737,
17,
65,
25,
638,
1123,
15,
17,
31,
164,
51,
14847,
619,
4020,
29,
65,
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... |
Is this possible in jQuery date picker?
===
Is this possible in jQuery date picker:
An inline date picker where I can use the next and previous buttons to cycle through months but choosing a particular day is disabled.
If so, please suggest a solution. Thanks! | 0 | [
2,
25,
48,
938,
19,
487,
8190,
93,
1231,
2036,
106,
60,
800,
3726,
3726,
25,
48,
938,
19,
487,
8190,
93,
1231,
2036,
106,
45,
40,
19,
1143,
1231,
2036,
106,
113,
31,
92,
275,
14,
328,
17,
1158,
12861,
20,
4150,
120,
818,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Possible causes of a deadlock in socket select
===
I have a jabber server application an another jabber client application in C++.
When the client receive and send a lot of messages (more than 20 per second), this comes that the select just freeze and never return.
With netstat, the socket is still connected on linux and with tcpdump, the message is still send to the client but the select just never return.
Here is the code that select :
bool ConnectionTCPBase::dataAvailable( int timeout )
{
if( m_socket < 0 )
return true; // let recv() catch the closed fd
fd_set fds;
struct timeval tv;
FD_ZERO( &fds );
// the following causes a C4127 warning in VC++ Express 2008 and possibly other versions.
// however, the reason for the warning can't be fixed in gloox.
FD_SET( m_socket, &fds );
tv.tv_sec = timeout / 1000000;
tv.tv_usec = timeout % 1000000;
return ( ( select( m_socket + 1, &fds, 0, 0, timeout == -1 ? 0 : &tv ) > 0 )
&& FD_ISSET( m_socket, &fds ) != 0 );
}
And the deadlock is with gdb:
Thread 2 (Thread 0x7fe226ac2700 (LWP 10774)):
#0 0x00007fe224711ff3 in select () at ../sysdeps/unix/syscall-template.S:82
#1 0x00000000004706a9 in gloox::ConnectionTCPBase::dataAvailable (this=0xcaeb60, timeout=<value optimized out>) at connectiontcpbase.cpp:103
#2 0x000000000046c4cb in gloox::ConnectionTCPClient::recv (this=0xcaeb60, timeout=10) at connectiontcpclient.cpp:131
#3 0x0000000000471476 in gloox::ConnectionTLS::recv (this=0xd1a950, timeout=648813712) at connectiontls.cpp:89
#4 0x00000000004324cc in glooxd::C2S::recv (this=0xc5d120, timeout=10) at c2s.cpp:124
#5 0x0000000000435ced in glooxd::C2S::run (this=0xc5d120) at c2s.cpp:75
#6 0x000000000042d789 in CNetwork::run (this=0xc56df0) at src/Network.cpp:343
#7 0x000000000043115f in threading::ThreadManager::threadWorker (data=0xc56e10) at src/ThreadManager.cpp:15
#8 0x00007fe2249bc9ca in start_thread (arg=<value optimized out>) at pthread_create.c:300
#9 0x00007fe22471970d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:112
#10 0x0000000000000000 in ?? ()
Do you know what can cause a select to stop receiving messages even if we are still sending to him.
Is there any buffer limit in linux when receiving and sending a lot of messages through the socket ?
Thanks
| 0 | [
2,
938,
4047,
16,
21,
828,
3966,
19,
18482,
5407,
800,
3726,
3726,
31,
57,
21,
11284,
2102,
8128,
3010,
40,
226,
11284,
2102,
6819,
3010,
19,
272,
20512,
9,
76,
14,
6819,
2588,
17,
2660,
21,
865,
16,
7561,
13,
5,
1995,
119,
434,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get an about screen in your settings bundle in ios?
===
I have an easy question, though I'm not sure if it's doable or not:
How can I add an "about" page to my settings.bundle in iOS?
I have seen it done before. Just have a look at the facebook application settings. When you tap "about", you get an entire page full of text.
How is this done?
Are they relying on internal API perhaps? | 0 | [
2,
184,
20,
164,
40,
88,
2324,
19,
154,
12410,
10194,
19,
13,
7760,
60,
800,
3726,
3726,
31,
57,
40,
2010,
1301,
15,
362,
31,
22,
79,
52,
562,
100,
32,
22,
18,
107,
579,
54,
52,
45,
184,
92,
31,
3547,
40,
13,
7,
6901,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
update div value - JQuery Toastmessage-plugin
===
i have a php page that redirects (if successful) to another php page like this:
header('Location: completed.php?message=Successful operation. Data inserted for user: ' . $login->get_username() . ' . See home page for infos.');
Now in completed.php i have a div that echoes the received message:
<div id="msg">
<?php echo $_GET['message']; ?>
</div>
I'm using the 'Toastmessage-plugin' : [here..][1] , but i'm unable to display the $_GET in to the text of Toastmessage ..
I'm using this code :
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script src="js/jquery.toastmessage.js" type="text/javascript"></script>
<link href="styles/jquery.toastmessage.css" rel="stylesheet" type="text/css" />
...
<script type="text/javascript">
function showStickyNoticeToast() {
$().toastmessage('showToast', {
text: $('#msg').val(),
sticky: true,
position: 'bottom-left',
type: 'notice',
closeText: '',
close: function () { console.log("toast is closed ..."); }
});
}
</script>
I've searched a lot , also for DOM Events and other events but i don't know what step take... maybe when the JQ function is loaded the div 'msg' has not yet received GET data ...? so how i update his value ?
The page i've read :
[this][2] and [this][3].
I also tried with ajax but i'm less experienced in that language..
please help... :) Thanks
[1]: http://akquinet.github.com/jquery-toastmessage-plugin/
[2]: http://stackoverflow.com/questions/4950199/jquery-how-can-i-detect-if-the-html-has-changed-within-a-given-element
[3]: http://stackoverflow.com/questions/628508/how-to-update-div-when-on-select-change-in-jquery | 0 | [
2,
11100,
13,
12916,
1923,
13,
8,
487,
8190,
93,
13865,
3845,
18,
1303,
8,
18527,
5831,
800,
3726,
3726,
31,
57,
21,
13,
26120,
2478,
30,
302,
14706,
18,
13,
5,
821,
1300,
6,
20,
226,
13,
26120,
2478,
101,
48,
45,
157,
106,
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... |
django - superuser password hash in dumpdata json file
===
Hi can someone tell me what hash is used by django store superuser data ?
I'm asking because I'd like to pre-generate password hash, stick it into prepared json fixture and load the user automatically via script. I just need to know how to prepare particular password hash.
Thanks | 0 | [
2,
3857,
14541,
13,
8,
1026,
16704,
20884,
19170,
19,
11424,
18768,
487,
528,
3893,
800,
3726,
3726,
4148,
92,
737,
494,
55,
98,
19170,
25,
147,
34,
3857,
14541,
1718,
1026,
16704,
1054,
13,
60,
31,
22,
79,
3379,
185,
31,
22,
43,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CALayer positioning after a detected flick
===
I am trying to program a simple game in which a user flicks his finger which, in turn, "shoots" a rectangle. So far I have this code...
-(IBAction) drag : (UIPanGestureRecognizer *)recognizer{
if(recognizer.state==UIGestureRecognizerStateBegan){
if (recognizer.numberOfTouches > 0){
CGPoint location= [recognizer locationOfTouch:0 inView:self.view];
NSLog(@"%@",NSStringFromCGPoint(location));
CALayer *sublayer = [CALayer layer];
sublayer.backgroundColor = [UIColor greenColor].CGColor;
sublayer.shadowColor = [UIColor blackColor].CGColor;
sublayer.shadowOpacity = 0.8;
sublayer.frame = CGRectMake(location.x-3, location.y-3, location.x, location.y);
sublayer.borderColor = [UIColor blackColor].CGColor;
[self.view.layer addSublayer:sublayer];
}
}
As of right now I am just trying to create a CALayer where the user flicks but the problem is the CALayer that is created is huge and takes up a quarter of the screen. I cannot understand why this is happening based on the fact that the frame should be 3 pixels diagonal bas
| 0 | [
2,
1658,
15187,
649,
68,
75,
21,
11968,
12407,
800,
3726,
3726,
31,
589,
749,
20,
625,
21,
1935,
250,
19,
56,
21,
4155,
12407,
18,
33,
2363,
56,
15,
19,
805,
15,
13,
7,
12511,
18,
7,
21,
27181,
9,
86,
463,
31,
57,
48,
1797,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cannot import csv to database mysql
===
I make a admin page to upload the csv file into mysql. The file csv has size 59,9mb. But my script didn't upload the file into mysql. Would you mind to help me to fix this problem? Here is my code :
<HTML>
<HEAD>
<TITLE> Admin Update </TITLE>
</HEAD>
<BODY>
<form enctype='multipart/form-data' action="<?php echo $PHP_SELF ?>" method='post'>
<font face=arial size=2>Type file name to import:</font><br>
<input type='file' name='filename' size='20'><br>
<input type='submit' name='submit' value='submit'></form>
<?php
include("phpsqlajax_dbinfo.php");
$connection = mysql_connect ('127.0.0.1', $username, $password);
if (!$connection) { die('Not connected : ' . mysql_error());}
$db_selected = mysql_select_db("ipcoba", $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
if(isset($_POST['submit']))
{
// address to copy csv file
$target_path = "C:/xampp/htdocs/bikinwebtracert";
$target_path = $target_path . basename( $_FILES['filename']['name']);
if(move_uploaded_file($_FILES['filename']['tmp_name'], $target_path)) {
echo "<font face=arial size=2>The file ". basename( $_FILES['filename']['name']). " Upload Success</font><br>";
} else{
echo "<font face=arial size=2>Failed to Upload, Please try again</font><br>";
}
$filename=$target_path;
$load=mysql_query("LOAD DATA LOCAL INFILE $filename INTO TABLE CityBlocks FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 2 LINES (startIpNum, endIpNum, locId)'\n' ") or die(mysql_error());
if ($load){
echo("Failed");
} else {
echo("Success");
}
}
?>
</BODY>
</HTML>
I need to fix this problem as soon as possible. Please Help. Thank You. | 0 | [
2,
1967,
9010,
272,
18,
710,
20,
6018,
51,
18,
22402,
800,
3726,
3726,
31,
233,
21,
21,
43,
2160,
2478,
20,
71,
8294,
14,
272,
18,
710,
3893,
77,
51,
18,
22402,
9,
14,
3893,
272,
18,
710,
63,
1072,
7374,
15,
518,
5024,
9,
47... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Open stream_url of a Soundcloud Track via XHR request?
===
Since you can call the the Soundcloud API via XHR
(because of the CORS headers it sents http://backstage.soundcloud.com/2010/08/of-cors-we-do/, right?)
I was wondering if this was possible with the audio data itself,
like a tracks' stream_url for example.
When trying to open the stream_url with a XHR using the Web Audio API, i get a "Origin <HOST> is not allowed by Access-Control-Allow-Origin." error.
Is there a way to load Audio resources via XHR2, or is it impossible ( http://stackoverflow.com/questions/10871882/audio-data-api-and-streaming-a-no-go) ?
Would be great as this allow some really cool things with the Web Audio API.
Thanks!
| 0 | [
2,
368,
3766,
1,
911,
255,
16,
21,
646,
19174,
792,
1197,
993,
3112,
3772,
60,
800,
3726,
3726,
179,
42,
92,
645,
14,
14,
646,
19174,
21,
2159,
1197,
993,
3112,
13,
5,
4451,
16,
14,
2827,
18,
157,
445,
32,
795,
18,
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... |
Hobo cannot find Rails
===
I am trying to create a web site using Hobo.
I've installed Ruby, Rails and Hobo, in that order. However, when I run hobo to create a new site, it says it can't find rails even though I just installed it.
Note that it says, "Could not find rails **amongst** [some list of things]", where [some list of things] actually contains a version of rails!
/Library/Ruby/Site/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find rails (~> 3.0.0) amongst
[abstract-1.0.0, actionmailer-3.2.6, actionmailer-3.0.15, actionpack-3.2.6, actionpack-3.0.15, activemodel-3.2.6, activemodel-3.0.15, activerecord-3.2.6, activerecord-3.0.15, activeresource-3.2.6, activeresource-3.0.15, activesupport-3.2.6, activesupport-3.0.15, arel-3.0.2, arel-2.0.10, builder-3.0.0, builder-2.1.2, bundler-1.1.4, coffee-rails-3.2.2, coffee-script-2.2.0, coffee-script-source-1.3.3, dryml-1.3.0, erubis-2.7.0, erubis-2.6.6, execjs-1.4.0, hike-1.2.1, hobo-1.3.0, hobo_fields-1.3.0, hobo_support-1.3.0, i18n-0.6.0, i18n-0.5.0, journey-1.0.4, jquery-rails-2.0.2, json-1.7.3, mail-2.4.4, mail-2.2.19, mime-types-1.19, multi_json-1.3.6, polyglot-0.3.3, rack-1.4.1, rack-1.2.5, rack-cache-1.2, rack-mount-0.6.14, rack-ssl-1.3.2, rack-test-0.6.1, rack-test-0.5.7, rails-3.2.6, railties-3.2.6, railties-3.0.15, rake-0.9.2.2, rdoc-3.12, rubygems-update-1.8.24, sass-3.1.19, sass-rails-3.2.5, sprockets-2.4.3, sprockets-2.1.3, sqlite3-1.3.6, thor-0.15.3, thor-0.14.6, tilt-1.3.3, treetop-1.4.10, tzinfo-0.3.33, uglifier-1.2.5, will_paginate-3.0.3] (Gem::LoadError)
from /Library/Ruby/Site/1.8/rubygems/specification.rb:777:in `activate_dependencies'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:766:in `each'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:766:in `activate_dependencies'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:750:in `activate'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:780:in `activate_dependencies'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:766:in `each'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:766:in `activate_dependencies'
from /Library/Ruby/Site/1.8/rubygems/specification.rb:750:in `activate'
from /Library/Ruby/Site/1.8/rubygems.rb:1232:in `gem'
from /usr/bin/hobo:22
Here are some more details about my environment:
I'm on Mac OS X 10.7.4, with the following versions of Ruby, Rails, and RubyGems:
> **$ rails --version**
>
> Rails 3.2.6
> **$ ruby -v**
>
> ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.4.0]
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.24
- RUBY VERSION: 1.8.7 (2011-12-28 patchlevel 357) [universal-darwin11.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-11
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/blake/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/ | 0 | [
2,
13,
27698,
1967,
477,
2240,
18,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
2741,
689,
568,
13,
27698,
9,
31,
22,
195,
4066,
10811,
15,
2240,
18,
17,
13,
27698,
15,
19,
30,
389,
9,
207,
15,
76,
31,
485,
13,
27698,
20,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Convert American datetime to EU Datime in computer located in EU?
===
I get some datetime (ExactDate ) from a db. These time are in US timezone, I need to convert them in EU TimeZone.
However if I use :
ExactDate = (DateTime)dr["CREATE_DATE"];
// change exact date to european time
TimeZoneInfo info;
info = TimeZoneInfo.FindSystemTimeZoneById("US Mountain Standard Time");
ExactDate = TimeZoneInfo.ConvertTime(ExactDate,info);
The dates are not converted properky because my compute is see the ExactDate as a european date.
Do you know how I can solve this ? | 0 | [
2,
8406,
189,
1231,
891,
20,
2898,
1331,
891,
19,
1428,
335,
19,
2898,
60,
800,
3726,
3726,
31,
164,
109,
1231,
891,
13,
5,
1706,
5183,
8209,
13,
6,
37,
21,
13,
9007,
9,
158,
85,
50,
19,
182,
85,
11661,
15,
31,
376,
20,
8406... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get the selected row of a tree table?
===
I have a tree table with two columns on a page.
The first one is the parent and the second one is the child.
The child table are displayed as command link, as I click on these links , it should take the Id of the child and display the data on the next page based on the ID .
The problem is , as I select any of the child,it navigates to the next page and only displays the data relating to the first child, which means it takes on the Id of the first child in all the cases.
| 0 | [
2,
184,
20,
164,
14,
1704,
3131,
16,
21,
1541,
859,
60,
800,
3726,
3726,
31,
57,
21,
1541,
859,
29,
81,
7498,
27,
21,
2478,
9,
14,
64,
53,
25,
14,
4766,
17,
14,
153,
53,
25,
14,
850,
9,
14,
850,
859,
50,
6115,
28,
1202,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Overwritting observable/observableArray set method
===
I am in the situation where I want to overwrite the `set` method that knockout has on observables; and to give you an example why I want that, take the following example code:
this.magic = ko.observableArray();
// ... inside an Ajax request
var formatted = reduceAndFormat(respone);
this.magic(formatted);
This is repeated a couple of times, so instead I would like to move the entire body of the `reduceAndFormat` function in the `set` method of a possibly customized observable.
Is there a way to do this? because outside of subscribing to observable updates didn't see much else in the documentation. | 0 | [
2,
84,
499,
21039,
68,
5122,
10321,
579,
118,
4995,
10321,
579,
8576,
93,
309,
2109,
800,
3726,
3726,
31,
589,
19,
14,
1858,
113,
31,
259,
20,
84,
23716,
14,
13,
1,
3554,
1,
2109,
30,
11676,
63,
27,
5122,
10321,
579,
18,
73,
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... |
focus on two items in the same screen
===
Hi I have three items in the screen: Button 1, list2 and Button3 I want when I click on button 1 and then to the list, the button 1 still focused and I obtain focus in the items of the list and the button 3 not focus. Is that possible get fosus for two fields in the same screen?
If is possible how to do it ? | 0 | [
2,
1776,
27,
81,
3755,
19,
14,
205,
2324,
800,
3726,
3726,
4148,
31,
57,
132,
3755,
19,
14,
2324,
45,
5167,
137,
15,
968,
135,
17,
5167,
240,
31,
259,
76,
31,
10840,
27,
5167,
137,
17,
94,
20,
14,
968,
15,
14,
5167,
137,
174... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Internal methods in inherits class and Unity IoC
===
In most examples to use IoC we extract interface and register it in ioc container.
But in real code I have something like this:
public sealed class ModelDbBook : ModelListBase
{
public ModelDbBook(DbConnectionHelper helper)
{...}
public List<> GetSomeData()
{...}
internal void CreateBook(Book book)
{...}
}
I need to 1) use IoC and 2) create fake model class for unit tests.
As there is internal method in class I can't use interface. One of my decision is to use abstract class and register it in ioc container. Then I may declare ModelFakeBook for test. In this case also you must make internal method to internal override.
public abstract class ModelBookBase
{
internal abstract void CreateBook(Book book);
}
public sealed class ModelFakeBook : ModelBookBase
{
internal override void CreateBook(Book book) {...}
}
But we can't inherit ModelDbBook from ModelBookBase so as ModelDbBook already inherit from ModelListBase. And we can't extract all methods from ModelListBase to ModelBookBase so as it (methods) was very specific!
A unique solution, that I see at first is not to inherit ModelDbBook from ModelListBase and pass ModelListBase in constructor and use it like this:
public sealed class ModelDbBook : ModelBookBase
{
private readonly ModelListBase _modelBase;
public ModelDbBook(DbConnectionHelper helper, ModelListBase modelBase)
{
_modelBase = modelBase;
...
}
public List<> GetSomeData()
{...}
internal override void CreateBook(Book book)
{
_modelBase.SomeMethod();
}
}
But if you have _many_ classes that inherits ModelListBase you must rewrite all of this.
That other solutions or ideas you may propose? I used stackoverflow search and can't found question like this. Sorry for my english :).
| 0 | [
2,
3117,
3195,
19,
17569,
18,
718,
17,
8385,
31,
2499,
800,
3726,
3726,
19,
127,
3770,
20,
275,
31,
2499,
95,
10962,
6573,
17,
2243,
32,
19,
31,
2499,
12147,
9,
47,
19,
683,
1797,
31,
57,
301,
101,
48,
45,
317,
10854,
718,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Having issue with Intent Activities and Alert Dialogs
===
I was wondering if someone could help me. It may be good to have a fresh pair of eyes to tell me what I am doing wrong because I just can't find it. It's probably something trivial, but I cannot see it. I basically have a button that when clicked brings up a custom dialog and asks the user to make a choice between an SD Card or Device memory. I feel I have everything right for the most part it's just giving me an error similar to: onClick error on line71..
Can anyone else see a problem..
public class MediaActivity extends Activity
{
/** Called when the activity is first created. */
AlertDialog.Builder builder;
AlertDialog alertDialog;
ImageButton sdImage;
ImageButton deviceImage;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button startApp = (Button) findViewById(R.id.startButton);
startApp.setOnClickListener(new View.OnClickListener() {
public void onClick(View view)
{
Context mContext = MediaActivity.this;
LayoutInflater inflater = (LayoutInflater) mContext.getSystemService(LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.custlayout, (ViewGroup) findViewById(R.id.layout_root));
TextView text = (TextView) layout.findViewById(R.id.text);
//text.setText("Upload an Image or Video");
builder = new AlertDialog.Builder(mContext);
builder.setView(layout);
alertDialog = builder.create();
sdImage= (ImageButton) findViewById(R.id.sdImageButton);
deviceImage = (ImageButton) findViewById(R.id.deviceImageButton);
sdImage.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0)
{
// Write your code here to invoke YES event
Intent goToSD = new Intent(arg0.getContext(),
Sdcard.class);
startActivity(goToSD);
}
});
deviceImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v)
{
// TODO Auto-generated method stub
}
});
// Showing Alert Message
alertDialog.show();
}
});
}
}
Thanks a bunch I really appreciate this since I've been having trouble with this for awhile. It's probably some kind of a dumb mistake that I'm overlooking.
Thank you again! | 0 | [
2,
452,
1513,
29,
6936,
1648,
17,
7863,
28223,
18,
800,
3726,
3726,
31,
23,
5712,
100,
737,
110,
448,
55,
9,
32,
123,
44,
254,
20,
57,
21,
3180,
2146,
16,
194,
20,
494,
55,
98,
31,
589,
845,
1389,
185,
31,
114,
92,
22,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What would be the equivalent of this Python hash writting/accessing code on some lisp languages?
===
What would be the equivalent of this Python code:
player = {"hp":10, "pos":[0,0,0], "items":[]}
player.pos[0] += 5
player.items.append("banana")
print player.items # << "banana"
print player.pos # << [5,0,0]
In Clojure (or other Lisps)? | 1 | [
2,
98,
83,
44,
14,
4602,
16,
48,
20059,
19170,
20127,
1203,
118,
20604,
68,
1797,
27,
109,
2093,
3401,
2556,
60,
800,
3726,
3726,
98,
83,
44,
14,
4602,
16,
48,
20059,
1797,
45,
517,
800,
13,
1,
7,
12491,
7,
6608,
15,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
passing arguments succinctly when the number of arguments is unknown
===
Many R functions take a variable number of arguments. `sum()` is an example: `sum(1, 2)`, `sum(1, 2, 3)`, and `sum(1, 2, 3, 4)` are all valid commands.
I need to write scripts that run in batch mode. In these scripts, I need to pass multiple variables to a function. The variables will be of the same class, and their names will start with the same characters, but I won't know the names or the number of arguments. Is there a succinct way to do this?
Here is an example: I want code the yields the sum of all variables that have the pattern `^int\\d$`. I know that there is at least one such variable, but I don't know how many there are. This code works:
# Set up toy data
int1 <- 3
int2 <- 5
# Get the sum
argNames <- ls(pat='^int\\d$')
argNames.list <- as.list(argNames)
argNames.list <- lapply(argNames.list, function (x) get(x))
do.call(sum, argNames.list)
My objection is that this code is a little cumbersome. Spreading the operation out over four lines reduces clarity. Is there an R-idiomatic way to get the same result with fewer lines of code? | 0 | [
2,
2848,
10553,
13,
29437,
4812,
102,
76,
14,
234,
16,
10553,
25,
2562,
800,
3726,
3726,
151,
761,
3719,
247,
21,
7612,
234,
16,
10553,
9,
13,
1,
18,
723,
5,
6,
1,
25,
40,
823,
45,
13,
1,
18,
723,
5,
165,
15,
172,
6,
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... |
Datejs getting the difference between dates
===
So here is my goal, I want to get how long ago a certain date was as a pretty readable string. Something like: '4 day and 3 hours ago'. I am using datejs and have both my dates currently as epochs.
I know I could subtract one epoch from the other, take the difference and then manually calculate the string to output. But this feels like something datejs would handle. However I see no documentation (of any js lib for that matter) expressing a means of converting a date object, or an epoch to a quantity of time.
any ideas, on how this best should be handled? | 0 | [
2,
1231,
728,
18,
1017,
14,
2841,
128,
4076,
800,
3726,
3726,
86,
235,
25,
51,
1195,
15,
31,
259,
20,
164,
184,
175,
1464,
21,
1200,
1231,
23,
28,
21,
1772,
1302,
579,
3724,
9,
301,
101,
45,
13,
22,
300,
208,
17,
203,
974,
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... |
Insert new line between each regexp match?
===
I have a text like this:
characters value ∆delta
ABCDEABCDE -3.663 [analyze]
EFGHEFGHEF -1.937 [analyze]
IJKLIJKLIJ 2.137 [analyze]
and I want to extract the numeric values
I googled about regexp and came up with this perl one-liner
perl -p -i -e 's/[^0-9-.]//g' file.txt
which for you must look extremely bad, but it seems to work for me in this case.
Only problem is, the text file now looks like
-3.663-1.9372.137
but I want it to look like
-3.663
-1.937
2.137
How do I insert a new line between each match in this regexp?
Thanks! | 0 | [
2,
14692,
78,
293,
128,
206,
7953,
6899,
730,
60,
800,
3726,
3726,
31,
57,
21,
1854,
101,
48,
45,
1766,
1923,
13,
1,
3436,
536,
5079,
546,
21880,
546,
13,
8,
240,
9,
3526,
240,
636,
1629,
102,
1734,
500,
11599,
13203,
410,
13203... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a Qt Dialog or Widget to interatviely sort a string list
===
I need to provide a reordering Dialog to let a user interactively order a list of strings. Does Qt already provide something fitting for this purpose ?
I have searched the usual forums and examples but found nothing appropriate.
To clarify what I need:
Raw List:
1. FileBaz
2. FileFoo
3. FileBar
User sorted list
1. FileBar
2. FileFoo
3. FileBaz
So an arbitrary order as for example needed for merging formerly selected pdf files | 0 | [
2,
25,
80,
21,
2593,
38,
28223,
54,
4807,
43,
3060,
20,
1480,
721,
7337,
102,
2058,
21,
3724,
968,
800,
3726,
3726,
31,
376,
20,
1181,
21,
302,
7861,
68,
28223,
20,
408,
21,
4155,
9194,
102,
389,
21,
968,
16,
7887,
9,
630,
259... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to correctly define activities and intents to behave as desired?
===
I have a 'list' activity which starts an 'article' activity when clicked.
I also have push notifications which opens the 'article' activity directly.
I changed the back button behavior in the 'article' activity to start the 'list' activity, when coming from a notification so that the user will go back to the article list.
The problem is when the app is already opened in the background and I open a notification - it just brings it back to front.
What I want to achieve is open the right article when clicking a notification and going back to the 'list' activity, without having the possibility the the list activity will be open twice.
I tried to separate the 'article' task and create new task in the notification intent but then it would open separate 'list' activities when opening multiple notifications and clicking back.
What is the correct way to define the activities' tasks and intent flags to achieve my goal?
Thanks!! | 0 | [
2,
184,
20,
12044,
9267,
1648,
17,
6936,
18,
20,
14149,
28,
9264,
60,
800,
3726,
3726,
31,
57,
21,
13,
22,
5739,
22,
2358,
56,
3244,
40,
13,
22,
20360,
22,
2358,
76,
15802,
9,
31,
67,
57,
3250,
52,
4634,
18,
56,
8965,
14,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pass Connection Pool Object to Method
===
I need to pass the connection pool object into a ScheduledExecutorService thread but I am having difficulties doing so. I attempted to add final in front of the declaration but that throws the following error... The final local variable connection cannot be assigned. It must be blank and not using a compound assignment
How can properly pass this connection object?
ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
exec.scheduleAtFixedRate(new Runnable(){
@Override
public void run(){
System.out.println("Working ... ");
String sql = "SELECT * FROM table;";
Statement st;
try {
st = connection.createStatement();
ResultSet rs = st.executeQuery(sql);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}, 2000, 1000, TimeUnit.MILLISECONDS); | 0 | [
2,
1477,
2760,
3067,
3095,
20,
2109,
800,
3726,
3726,
31,
376,
20,
1477,
14,
2760,
3067,
3095,
77,
21,
3758,
1706,
17194,
2153,
11449,
9322,
47,
31,
589,
452,
8075,
845,
86,
9,
31,
3066,
20,
3547,
426,
19,
431,
16,
14,
7098,
47,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Could not set tabbar image in xocde 4.2 Programmatically
===
I created new tab bar project in xcode 4.2 and there is no app delegate xib file. Project has two navigation controller. I can set name of tab bar but couldn't set image. I am completely fed up with many tries. ` FirstViewController *firstView = [[FirstViewController alloc] initWithNibName:@"FirstViewController_iPhone" bundle:nil]
`
firstView.title=@"Birthdays";
firstView.tabBarItem.image=[UIImage imageNamed:@"bottomleft2x.png"];
SecondViewController *secondView = [[SecondViewController alloc] initWithNibName:@"SecondViewController_iPhone" bundle:nil];
secondView.title=@"Settings";
secondView.tabBarItem.image=[UIImage imageNamed:@"bottomright2x.png"];
UINavigationController *navController2 = [[UINavigationController alloc] initWithRootViewController:secondView];
navController2.navigationBarHidden=YES;
[viewControllers addObject:navController2];
Please help on that. Thanks in advance. Happy Day. | 0 | [
2,
110,
52,
309,
6523,
1850,
1961,
19,
993,
2499,
546,
268,
9,
135,
625,
6732,
1326,
800,
3726,
3726,
31,
679,
78,
6523,
748,
669,
19,
993,
9375,
268,
9,
135,
17,
80,
25,
90,
4865,
11300,
5641,
220,
3893,
9,
669,
63,
81,
8368,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to Get a Process CurrentThreadId in C#?
===
i want to get one process CurrentThreadId.
i can get my application Current Thread ID with AppDomain.GetCurrentThreadId();
for example i want to get Task Manager CurrentThreadId.
var proces = System.Diagnostics.Process.GetProcessesByName("taskmgr");
proces[0].Threads//write code for get currentThreadID? | 1 | [
2,
184,
20,
164,
21,
953,
866,
96,
10647,
1340,
19,
272,
5910,
60,
800,
3726,
3726,
31,
259,
20,
164,
53,
953,
866,
96,
10647,
1340,
9,
31,
92,
164,
51,
3010,
866,
9322,
4924,
29,
4865,
537,
6232,
9,
3060,
17657,
96,
10647,
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... |
string index out of range Python, Django
===
i'm using Django to develop a web application. When i try and run it on my web form i am receiving 'string index out of range' error. However, when i hardcode a dictionary in to a python test file it works fine with the same values.
Here is my Django View:
def submitworkout(request):
#workoutinfo = workout(request.GET)
return render_to_response('home.html',{'infoprompt': workout(request.GET)},context_instance=RequestContext(request))
Here is the object:
class workout():
def __init__(self,addworkout):
self.workout = collections.OrderedDict();
getallreps = 0
for i in range(len(addworkout['exercisename'])):
numsetcounter = 0;
self.workout[string.capwords(addworkout['exercisename'][i])] = []
while numsetcounter < int(addworkout['numsets'][i]):
# print self.workout[addworkout['exercisename'][i]]
self.workout[string.capwords(addworkout['exercisename'][i])].append([addworkout['weightinputboxes'][getallreps],addworkout['repinputboxes'][getallreps]])
#[
getallreps +=1
numsetcounter +=1
def getexercise(self,name):
try:
return self.workout[string.capwords(name)];
except:
return 'This exercise does not exist!'
Now this is the dictionary i'm trying to run through the class:
addworkout =
{u'repinputboxes': [u'5', u'3'], u'weightinputboxes': [u'195', u'170'], u'numsets': [u'1', u'1'], u'exercisename': [u'Squat', u'Power Clean']}
and here are the local vars that Django is displaying on the error:
i=1
numsetcounter =0
getallreps = 1
Hopefull you guys help me resolve my problem. Thanks in advance!
| 0 | [
2,
3724,
4348,
70,
16,
978,
20059,
15,
3857,
14541,
800,
3726,
3726,
31,
22,
79,
568,
3857,
14541,
20,
2803,
21,
2741,
3010,
9,
76,
31,
1131,
17,
485,
32,
27,
51,
2741,
505,
31,
589,
3396,
13,
22,
11130,
4348,
70,
16,
978,
22,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python: I use .decode() - 'ascii' codec can't encode
===
xml_ = load() # here comes the unicode string with Cyrillic letters
print xml_ # prints everything fine
print type(xml_) # 'lxml.etree._ElementUnicodeResult' = unicode
xml = xml_.decode('utf-8') # here is an error
doc = lxml.etree.parse(xml) # if I do not decode it - the same error appears here
File "testLog.py", line 48, in <module>
xml = xml_.decode('utf-8')
File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 89-96: ordinal not in range(128)
If I understand it right: I must decode non-ascii string into internal representation, then work with this representation and encode it back before sending to output? It seems that I do exactly this.
Input data must be in unt-8 due to the `'Accept-Charset': 'utf-8;q=0.7,*;q=0.3'` header. | 0 | [
2,
20059,
45,
31,
275,
13,
9,
546,
9375,
5,
6,
13,
8,
13,
22,
472,
1892,
49,
22,
1797,
150,
92,
22,
38,
20523,
800,
3726,
3726,
23504,
1,
800,
6305,
5,
6,
6926,
235,
1624,
14,
28010,
3724,
29,
18671,
2516,
4793,
23504,
1,
69... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 display image on ListView like samsung contact list
===
I have created a **ListView** with **side index and alphabetical headers**. I am fetching the friend's list from facebook, and displaying it on the listView. I have used **SimpleCursorAdpater**. I am able to display the name of the friends on the list, but cannot display the picture of the friends on the list, because the image is stored in the database as String, now i need to convert that String back to image, but i am setting the adapter in the single line,
`lv.setAdapter(new MyAlphabetizedAdapter(this,R.layout.list_entry, cursor, new `String[]`{DbHelper.COUNTRIES_NAME}, new int[]{R.id.name_entry}));`
Now how can i set my image on this list, by taking the String out of the database, and then converting it into Image.
I am also pasting my Source code for the listView below.
import java.util.*;
import android.app.Activity;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.AlphabetIndexer;
import android.widget.ListView;
import android.widget.SectionIndexer;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;
public class DemoActivity extends Activity implements OnItemClickListener, OnClickListener{
private SQLiteDatabase db;
private ListView lv;
private TextView mA;
private TextView mB;
private TextView mC;
private TextView mD;
private TextView mE;
private TextView mF;
private TextView mG;
private TextView mH;
private TextView mI;
private TextView mJ;
private TextView mK;
private TextView mL;
private TextView mM;
private TextView mN;
private TextView mO;
private TextView mP;
private TextView mQ;
private TextView mR;
private TextView mS;
private TextView mT;
private TextView mU;
private TextView mV;
private TextView mW;
private TextView mX;
private TextView mY;
private TextView mZ;
public ArrayList<Integer> arr = new ArrayList<Integer>();
public ArrayList<String> treeFrnd = new ArrayList<String>();;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.list_main);
mA = (TextView)findViewById(R.id.A);
mB = (TextView)findViewById(R.id.B);
mC = (TextView)findViewById(R.id.C);
mD = (TextView)findViewById(R.id.D);
mE = (TextView)findViewById(R.id.E);
mF = (TextView)findViewById(R.id.F);
mG = (TextView)findViewById(R.id.G);
mH = (TextView)findViewById(R.id.H);
mI = (TextView)findViewById(R.id.I);
mJ = (TextView)findViewById(R.id.J);
mK = (TextView)findViewById(R.id.K);
mL = (TextView)findViewById(R.id.L);
mM = (TextView)findViewById(R.id.M);
mN = (TextView)findViewById(R.id.N);
mO = (TextView)findViewById(R.id.O);
mP = (TextView)findViewById(R.id.P);
mQ = (TextView)findViewById(R.id.Q);
mR = (TextView)findViewById(R.id.R);
mS = (TextView)findViewById(R.id.S);
mT = (TextView)findViewById(R.id.T);
mU = (TextView)findViewById(R.id.U);
mV = (TextView)findViewById(R.id.V);
mW = (TextView)findViewById(R.id.W);
mX = (TextView)findViewById(R.id.X);
mY = (TextView)findViewById(R.id.Y);
mZ = (TextView)findViewById(R.id.Z);
mA.setOnClickListener(this);
mB.setOnClickListener(this);
mC.setOnClickListener(this);
mD.setOnClickListener(this);
mE.setOnClickListener(this);
mF.setOnClickListener(this);
mG.setOnClickListener(this);
mH.setOnClickListener(this);
mI.setOnClickListener(this);
mJ.setOnClickListener(this);
mK.setOnClickListener(this);
mL.setOnClickListener(this);
mM.setOnClickListener(this);
mN.setOnClickListener(this);
mO.setOnClickListener(this);
mP.setOnClickListener(this);
mQ.setOnClickListener(this);
mR.setOnClickListener(this);
mS.setOnClickListener(this);
mT.setOnClickListener(this);
mU.setOnClickListener(this);
mV.setOnClickListener(this);
mW.setOnClickListener(this);
mX.setOnClickListener(this);
mY.setOnClickListener(this);
mZ.setOnClickListener(this);
lv = (ListView)findViewById(R.id.list1);
//NOTE: you should never actually start database operations from the context of the UI thread
final DbHelper helper = new DbHelper(this);
db = helper.getWritableDatabase();
lv.setOnItemClickListener(this);
//populate the db with our dummy data, might take a while, so in real scenarios spawn a
//new thread to do this
final int result = helper.insertDummyData(db);
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Cursor cur = db.query(DbHelper.TABLE_COUNTRIES, null, null, null, null, null,DbHelper.COUNTRIES_NAME + " ASC");
for (cur.moveToFirst() ; !cur.isAfterLast() ; cur.moveToNext()){
String pic = cur.getString(cur.getColumnIndex("photo"));
//String na = cur.getString(cur.getColumnIndex("name"));
treeFrnd.add(pic);
//System.out.println(na+"............... "+pic);
}
class MyCmp implements Comparator<String>{
@Override
public int compare(String arg0, String arg1) {
return arg0.compareTo(arg1);
}
}
db.close();
Collections.sort(treeFrnd);
for (String s : treeFrnd){
System.out.println("Output of arr"+s);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (result > 0){
//query the db to obtain our cursor and set the list adapter, only if the rows were
//successfully inserted
db = helper.getWritableDatabase();
final Cursor cursor = db.query(DbHelper.TABLE_COUNTRIES, null, null, null, null, null,DbHelper.COUNTRIES_NAME + " ASC");
startManagingCursor(cursor);
//db.close();
Toast.makeText(this, "Finished populating.", Toast.LENGTH_SHORT).show();
//helper.onOpen(db);
//lv.setAdapter(new MyAlphabetizedAdapter(this, android.R.layout.simple_list_item_1, cursor, new String[]{DbHelper.COUNTRIES_NAME}, new int[]{android.R.id.text1}));
lv.setAdapter(new MyAlphabetizedAdapter(this,R.layout.list_entry, cursor, new String[]{DbHelper.COUNTRIES_NAME}, new int[]{R.id.name_entry}));
/*for (cur.moveToFirst() ; cur.isAfterLast() ; cur.moveToNext()){
String pic = cur.getString(cur.getColumnIndex("photo"));
String na = cur.getString(cur.getColumnIndex("name"));
System.out.println(na+" "+pic);
}*/
//lv.setSelectionFromTop(50, 0);
//don't ever forget to do this, either here or in your ListView layout
//lv.setFastScrollEnabled(true);
} else {
Toast.makeText(this, "Database could not be populated. Restart the activity.", Toast.LENGTH_LONG).show();
}
}
@Override
protected void onDestroy() {
db.close();
super.onDestroy();
}
/**
* CursorAdapter that uses an AlphabetIndexer widget to keep track of the section indicies.
* These are the positions where we want to show a section header showing the respective alphabet letter.
* @author Eric
*
*/
public class MyAlphabetizedAdapter extends SimpleCursorAdapter implements SectionIndexer{
private static final int TYPE_HEADER = 1;
private static final int TYPE_NORMAL = 0;
private static final int TYPE_COUNT = 2;
private AlphabetIndexer indexer;
private int[] usedSectionNumbers;
private Map<Integer, Integer> sectionToOffset;
private Map<Integer, Integer> sectionToPosition;
public MyAlphabetizedAdapter(Context context, int layout, Cursor c, String[] from, int[] to) {
super(context, layout, c, from, to);
indexer = new AlphabetIndexer(c, c.getColumnIndexOrThrow(DbHelper.COUNTRIES_NAME), "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
sectionToPosition = new TreeMap<Integer, Integer>(); //use a TreeMap because we are going to iterate over its keys in sorted order
sectionToOffset = new HashMap<Integer, Integer>();
final int count = super.getCount();
int i;
//temporarily have a map alphabet section to first index it appears
//(this map is going to be doing somethine else later)
for (i = count - 1 ; i >= 0; i--){
sectionToPosition.put(indexer.getSectionForPosition(i), i);
}
i = 0;
usedSectionNumbers = new int[sectionToPosition.keySet().size()];
//////////////////////////////////////////////////////////////////////
ArrayList<Integer> ar = new ArrayList<Integer>();
/////////////////////////////////////////////////////////////////////
//note that for each section that appears before a position, we must offset our
//indices by 1, to make room for an alphabetical header in our list
for (Integer section : sectionToPosition.keySet()){
sectionToOffset.put(section, i);
usedSectionNumbers[i] = section;
i++;
}
//use offset to map the alphabet sections to their actual indicies in the list
for(Integer section: sectionToPosition.keySet()){
sectionToPosition.put(section, sectionToPosition.get(section) + sectionToOffset.get(section));
////////////////////////////////////////////////////////////////////////////////////////////
int temp = sectionToPosition.get(section) + sectionToOffset.get(section)-section;
ar.add(temp);
for(int k : ar){
System.out.println(k);
}
//Log.v("Section",sectionToPosition.get(section) + sectionToOffset.get(section)+" "+section);
///////////////////////////////////////////////////////////////////////////////////////////
}
for(int j : ar){
arr.add(j);
}
System.out.println(arr);
}
@Override
public int getCount() {
if (super.getCount() != 0){
//sometimes your data set gets invalidated. In this case getCount()
//should return 0 and not our adjusted count for the headers.
//The only way to know if data is invalidated is to check if
//super.getCount() is 0.
return super.getCount() + usedSectionNumbers.length;
}
return 0;
}
@Override
public Object getItem(int position) {
if (getItemViewType(position) == TYPE_NORMAL){//we define this function in the full code later
//if the list item is not a header, then we fetch the data set item with the same position
//off-setted by the number of headers that appear before the item in the list
return super.getItem(position - sectionToOffset.get(getSectionForPosition(position)) - 1);
}
return null;
}
@Override
public int getPositionForSection(int section) {
if (! sectionToOffset.containsKey(section)){
//This is only the case when the FastScroller is scrolling,
//and so this section doesn't appear in our data set. The implementation
//of Fastscroller requires that missing sections have the same index as the
//beginning of the next non-missing section (or the end of the the list if
//if the rest of the sections are missing).
//So, in pictorial example, the sections D and E would appear at position 9
//and G to Z appear in position 11.
int i = 0;
int maxLength = usedSectionNumbers.length;
//linear scan over the sections (constant number of these) that appear in the
//data set to find the first used section that is greater than the given section, so in the
//example D and E correspond to F
while (i < maxLength && section > usedSectionNumbers[i]){
i++;
}
if (i == maxLength) return getCount(); //the given section is past all our data
return indexer.getPositionForSection(usedSectionNumbers[i]) + sectionToOffset.get(usedSectionNumbers[i]);
}
return indexer.getPositionForSection(section) + sectionToOffset.get(section);
}
@Override
public int getSectionForPosition(int position) {
int i = 0;
int maxLength = usedSectionNumbers.length;
//linear scan over the used alphabetical sections' positions
//to find where the given section fits in
while (i < maxLength && position >= sectionToPosition.get(usedSectionNumbers[i])){
i++;
}
return usedSectionNumbers[i-1];
}
@Override
public Object[] getSections() {
return indexer.getSections();
}
//nothing much to this: headers have positions that the sectionIndexer manages.
@Override
public int getItemViewType(int position) {
if (position == getPositionForSection(getSectionForPosition(position))){
return TYPE_HEADER;
} return TYPE_NORMAL;
}
@Override
public int getViewTypeCount() {
return TYPE_COUNT;
}
//return the header view, if it's in a section header position
@Override
public View getView(int position, View convertView, ViewGroup parent) {
final int type = getItemViewType(position);
if (type == TYPE_HEADER){
if (convertView == null){
convertView = getLayoutInflater().inflate(R.layout.header, parent, false);
}
((TextView)convertView.findViewById(R.id.header)).setText((String)getSections()[getSectionForPosition(position)]);
convertView.setTag(position);
Log.v("Tag",convertView.getTag()+"");
return convertView;
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
tx.setText("Vivek");
return super.getView(position - sectionToOffset.get(getSectionForPosition(position)) - 1, convertView, parent);
}
//these two methods just disable the headers
@Override
public boolean areAllItemsEnabled() {
return false;
}
@Override
public boolean isEnabled(int position) {
if (getItemViewType(position) == TYPE_HEADER){
return false;
}
return true;
}
}
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
Toast.makeText(getApplicationContext(), ""+arg2,Toast.LENGTH_SHORT).show();
}
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(), "is Clicked", Toast.LENGTH_SHORT).show();
//String alphabet = (String)v.getTag();
if (Integer.parseInt(v.getTag()+"")<arr.size()){
lv.setSelectionFromTop(arr.get(Integer.parseInt(v.getTag()+"")), 0);
}
else{
//lv.setSelectionFromTop(arr.get(Integer.parseInt(v.getTag()+"")-1), 0);
}
}
} | 0 | [
2,
2973,
3042,
1961,
27,
968,
4725,
101,
22981,
2203,
968,
800,
3726,
3726,
31,
57,
679,
21,
13,
1409,
5739,
4725,
1409,
29,
13,
1409,
1416,
4348,
17,
27169,
157,
445,
1409,
9,
31,
589,
18312,
68,
14,
860,
22,
18,
968,
37,
9090,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 write the below htaccess rewrite rule for different urls
===
I am working on a website created using PHP.
Development environment is Windows (using xampp)
The pages of website are displayed according to the value of the "page" variable that we pass to the index.php file as a url variable.
i.e. **`http://example.com/index.php?page=xyz`**
The url above points to the `xyz.php` file
There are around 50 pages (can be increased in future).
I want my urls to be like this
**`http://example.com/xyz`**
for this to work I wrote the following `.htaccess rule` in the .htaccess file (in the root folder of project)
RewriteRule ^([^/]*)$ /index.php?page=$1 [L]
But it is not working at all.
Another url is
**`http://example.com/index.php?page=abc&name=gaurav&id=10&page_no=2`**
I want this url to be shown like this
**`http://example.com/abc/gaurav/10/2`**
There are many different forms of the url that I took example of but the page variable will always be there in the URL.
If I provide the rule for both the above urls then nothing works (500 internal server error is shown)
Please help me write this rule.
| 0 | [
2,
184,
92,
31,
2757,
14,
1021,
13,
9020,
20604,
27891,
1828,
26,
421,
13,
911,
7532,
800,
3726,
3726,
31,
589,
638,
27,
21,
2271,
679,
568,
13,
26120,
9,
522,
2307,
25,
1936,
13,
5,
12655,
993,
765,
3421,
6,
14,
4434,
16,
227... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 to calendar button similar to "AddThis"
===
I can't seem to find anything about this but I apologise if the question has been asked already. Basically I am looking for a ready made plugin for websites to add an event to calendars. It would have the ability to add to outlook and Google and possibly others. Something similar to AddThis but rather that just sharing a page puts something in the calendar. Anyone know of such a thing? Tempted to create one myself and publish it if not :) | 0 | [
2,
3547,
20,
7036,
5167,
835,
20,
13,
7,
14854,
1565,
7,
800,
3726,
3726,
31,
92,
22,
38,
2260,
20,
477,
602,
88,
48,
47,
31,
26645,
100,
14,
1301,
63,
74,
411,
614,
9,
11374,
31,
589,
699,
26,
21,
1451,
117,
10922,
108,
26,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to use the JNI to change the fields of a java class
===
I am using a c native function to change the integer fields of a java class. Basically i want to see how the call by reference can be implemented using JNI. But i am getting the error "No Implementaion found for native". Can anybody help me to solve this problem. I am new to android and java. Below are the codes that i have written. If anybody can change this to satisfy what i want i will definitely appreciate him for help.
**java code :**
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
class myclass {
int a = 1;
int b = 2;
public native void callTochangeJNI();
static {
System.loadLibrary("sum_jni");
}
}
public class sum extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sum);
myclass myobject = new myclass();
System.out.println("calling the jni native method");
myobject.callTochangeJNI();
System.out.println("returned from jni native method one");
myobject.callTochangeJNI();
System.out.format(" a = %d%n....", myobject.a);
System.out.format("b = %d%n...", myobject.b);
}
}
**c native method:**
void Java_com_kpit_myfirstndkapp_sum_callTochangeJNI(JNIEnv* env,
jobject obj )
{
jfieldID fid;
jmethodID mid;
jclass myclass;
printf(" Inside the JNI native method \n");
jclass localRefCls =
(*env)->FindClass(env, "java/lang/String");
myclass = (*env)->NewGlobalRef(env, localRefCls);
fid = (*env)->GetFieldID(env,myclass," a ","I");
(*env)->SetIntField(env, obj ,fid,3);
fid = (*env)->GetFieldID(env,myclass," b ","I");
(*env)->SetIntField(env, obj ,fid,4);
}
below is the log that i am getting :
07-25 09:33:07.723: D/dalvikvm(573): Trying to load lib /data/da/com.kpit.myfirstndkapp /lib/libsum_jni.so 0x4129d7b8
07-25 09:33:07.723: D/dalvikvm(573): Added shared lib /data/data/com.kpit.myfirstndkapp/lib/libsum_jni.so 0x4129d7b8
07-25 09:33:07.723: D/dalvikvm(573): No JNI_OnLoad found in /data/data/com.kpit.myfirstndkapp/lib/libsum_jni.so 0x4129d7b8, skipping init
07-25 09:33:07.723: I/System.out(573): calling the jni native method
07-25 09:33:07.723: W/dalvikvm(573): No implementation found for native Lcom/kpit/myfirstndkapp/myclass;.callTochangeJNI ()V
07-25 09:33:07.733: I/dalvikvm(573): Wrote stack traces to '/data/anr/traces.txt'
07-25 09:33:07.804: D/AndroidRuntime(573): Shutting down VM
07-25 09:33:07.804: W/dalvikvm(573): threadid=1: thread exiting with uncaught exception (group=0x409c01f8)
07-25 09:33:07.854: E/AndroidRuntime(573): FATAL EXCEPTION: main
07-25 09:33:07.854: E/AndroidRuntime(573): java.lang.UnsatisfiedLinkError: callTochangeJNI
07-25 09:33:07.854: E/AndroidRuntime(573): at com.kpit.myfirstndkapp.myclass.callTochangeJNI(Native Method)
07-25 09:33:07.854: E/AndroidRuntime(573): at com.kpit.myfirstndkapp.sum.onCreate(sum.java:27)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.Activity.performCreate(Activity.java:4465)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.ActivityThread.access$600(ActivityThread.java:123)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.os.Handler.dispatchMessage(Handler.java:99)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.os.Looper.loop(Looper.java:137)
07-25 09:33:07.854: E/AndroidRuntime(573): at android.app.ActivityThread.main(ActivityThread.java:4424)
07-25 09:33:07.854: E/AndroidRuntime(573): at java.lang.reflect.Method.invokeNative(Native Method)
07-25 09:33:07.854: E/AndroidRuntime(573): at java.lang.reflect.Method.invoke(Method.java:511)
07-25 09:33:07.854: E/AndroidRuntime(573): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
07-25 09:33:07.854: E/AndroidRuntime(573): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
07-25 09:33:07.854: E/AndroidRuntime(573): at dalvik.system.NativeStart.main(Native Method)
07-25 09:33:08.234: I/dalvikvm(573): threadid=3: reacting to signal 3
07-25 09:33:08.264: I/dalvikvm(573): Wrote stack traces to '/data/anr/traces.txt'
07-25 09:33:08.554: I/dalvikvm(573): threadid=3: reacting to signal 3
07-25 09:33:08.623: I/dalvikvm(573): Wrote stack traces to '/data/anr/traces.txt'
07-25 09:38:07.994: I/Process(573): Sending signal. PID: 573 SIG: 9
Please help me
| 0 | [
2,
184,
20,
275,
14,
487,
889,
20,
753,
14,
2861,
16,
21,
8247,
718,
800,
3726,
3726,
31,
589,
568,
21,
272,
1275,
1990,
20,
753,
14,
13820,
2861,
16,
21,
8247,
718,
9,
11374,
31,
259,
20,
196,
184,
14,
645,
34,
2801,
92,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 expose an enum defined in a COM library via interop as the return type of a c# function
===
Hopefully the question is clear but to pad it out for clarity:
I have a VB6 dll that defines an enum that I am referencing in my C# dll. The C# dll defines a CCW in the correct way with an idispatch interface that declares a function who's return type is the enum.
When running regasm I get a warning that the enum is not COM visible and so the function is not exported. Since it's defined in my VB6 library I would have thought it is already COM visible since it's defined in a COM dll.
I realise I can stop messing about and use an int to pass the enum and just do casting either end but it's proper frustrating and I would like to know if a way exists. | 0 | [
2,
184,
20,
13833,
40,
1957,
723,
2811,
19,
21,
13,
960,
1248,
1197,
1480,
2594,
28,
14,
788,
1001,
16,
21,
272,
5910,
1990,
800,
3726,
3726,
13416,
14,
1301,
25,
1207,
47,
20,
4432,
32,
70,
26,
18314,
45,
31,
57,
21,
13,
2046... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Text what i have written in Ckeditor(php)?
===
I am unable to get the content which i have written in CKeditor i just have copied a code of editor so it is only a box with no submit or any else button attached with it.Plz someone explain it to me.Thank you in Advance. | 1 | [
2,
164,
1854,
98,
31,
57,
642,
19,
13,
2601,
13401,
5,
26120,
6,
60,
800,
3726,
3726,
31,
589,
2343,
20,
164,
14,
2331,
56,
31,
57,
642,
19,
13,
2601,
13401,
31,
114,
57,
18225,
21,
1797,
16,
1835,
86,
32,
25,
104,
21,
1649,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Minimize Running Service Size
===
My app is about 3MB and its process takes about 5MB, but the running service takes about 10-20MB.
I tried to analysis memory using MAT, but it is about the process memory(shows total 5MB) not the service memory(total 10-20MB).
My service do one simple thing: register a SCREEN_OFF reciever.
please help me minimize service size ASAP, thx.
public void onCreate()
{
super.onCreate();
registerReceiver(broadcast, new IntentFilter("android.intent.action.SCREEN_OFF"));
}
public void onDestroy()
{
super.onDestroy();
unregisterReceiver(broadcast);
}
private BroadcastReceiver broadcast = new BroadcastReceiver() {
public void onReceive(final Context context, Intent intent)
{
String action = intent.getAction();
if (action.equals("android.intent.action.SCREEN_OFF")) {
SharedPreferences prefer = PreferenceManager.getDefaultSharedPreferences(context);
int state = prefer.getInt(MODE_SCREENOFF_OPTIMIZE, MODE_OFF);
if (state == MODE_ON) {
Intent broadcast = new Intent(COMMAND);
broadcast.putExtra(COMMAND_TYPE, TYPE_SCREENOFF);
sendBroadcast(broadcast);
}
}
}
}; | 0 | [
2,
16713,
946,
365,
1072,
800,
3726,
3726,
51,
4865,
25,
88,
203,
5024,
17,
82,
953,
1384,
88,
331,
5024,
15,
47,
14,
946,
365,
1384,
88,
332,
8,
1323,
5024,
9,
31,
794,
20,
2495,
1912,
568,
4277,
15,
47,
32,
25,
88,
14,
953... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript - Loading Scripts On EveryPage
===
I have the issue of loading the same scripts across all my pages without having to define them all over and over.
I've came up with a half complete solution which looks like...
<script type="text/javascript">
var scriptLocs = [];
function loadScripts() {
for (var i = 0; i < scriptLocs.length; i++) {
var crtElement = document.createElement('script');
crtElement.src = scriptLocs[i];
var hh = document.getElementsByTagName('head')[0];
// Getting head tag
hh.appendChild(crtElement);
//Adding it to head
}
}
</script>
The array can be very big e.g. around 120 scripts (2.5MB) these include such things as jQuery and Knockout etc...
The problem im having is this can be unreliable my function seems to miss out, or load in a different order than defined in my array. The order is very important as some things may rely on jQuery so it must be loaded before other scripts.
Is there away of define all the scripts in an element then appending the lot of them at once? would this work?
Any advice/help you loading this way is appreciated. | 0 | [
2,
8247,
8741,
13,
8,
12797,
17505,
27,
352,
6486,
800,
3726,
3726,
31,
57,
14,
1513,
16,
12797,
14,
205,
17505,
464,
65,
51,
4434,
366,
452,
20,
9267,
105,
65,
84,
17,
84,
9,
31,
22,
195,
281,
71,
29,
21,
519,
1279,
4295,
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... |
ASP.NET MVC 3- Multiple view single controller
===
I am working on a MVC site which are having two separate views for mobile and web. The background work is same. So I want to have same controller for both view.
Following is folder structure for that.
View -> Folder for view.
Customer -> This folder is for web
Index.cshtml -> Customer listing view for web
MobileCustomer-> This folder is for mobile
Index. cshtml -> Customer listing view for mobile.
Now the back ground things are same for both on the UI for both mobile and web are diffrerent. So I want to use same customer controller for that. So in Controller folder of asp.net mvc project. I have customer controller and I want to use that same.
But I want URL for each mobile are different.
localhost/customer/ -> This will load normal view for customer
localhost/mobile/customer -> This will load mobile view for customer
How I can achieve this with asp.net mvc 3 application?
| 0 | [
2,
28,
306,
9,
2328,
307,
8990,
203,
8,
1886,
1418,
345,
9919,
800,
3726,
3726,
31,
589,
638,
27,
21,
307,
8990,
689,
56,
50,
452,
81,
1725,
4146,
26,
3241,
17,
2741,
9,
14,
2395,
170,
25,
205,
9,
86,
31,
259,
20,
57,
205,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP MYSQL increment experience display
===
I have a field 'experience' in my database and it displays in webpage in format Y years M months.
how to compare the date in database with todays date and increase the increase the experience and display in above mentioned format. | 1 | [
2,
13,
26120,
51,
18,
22402,
13,
28461,
1496,
3042,
800,
3726,
3726,
31,
57,
21,
575,
13,
22,
28083,
22,
19,
51,
6018,
17,
32,
9412,
19,
2741,
6486,
19,
2595,
13,
93,
122,
307,
818,
9,
184,
20,
11590,
14,
1231,
19,
6018,
29,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Deleting DB entry with ADO.NET
===
I have the following code which connected to my database, and checks if an email address exists in a Table, if it does, it will delete it, if it doesn't, it will add it.
But neither options work. I get the same error for both actions:
> The object cannot be deleted because it was not found in the
> ObjectStateManager.
The code:
protected OEntities database = new OEntities();
public string NewsletterSubscriptionValidation(string emailAddress)
{
string validationMessage = "";
Newsletter newsletter = new Newsletter();
var identifier = database.Newsletters.Select(
id => id.EmailAddress);
if (identifier == null)
{
newsletter.EmailAddress = emailAddress;
newsletter.Subscribed = true;
database.Newsletters.AddObject(newsletter);
database.SaveChanges();
validationMessage = "You are now subscribed to our periodic Newsletter.";
}
else
{
newsletter.EmailAddress = emailAddress;
newsletter.Subscribed = false;
database.DeleteObject(newsletter);
database.SaveChanges();
validationMessage = "You have been unsubscribed from our periodic Newsletter.";
}
return validationMessage;
}
Am I even adding to/deleting from the Database the right way, here? | 0 | [
2,
121,
1336,
68,
13,
9007,
2792,
29,
21,
537,
9,
2328,
800,
3726,
3726,
31,
57,
14,
249,
1797,
56,
2587,
20,
51,
6018,
15,
17,
16602,
100,
40,
8517,
3218,
5636,
19,
21,
859,
15,
100,
32,
630,
15,
32,
129,
27448,
32,
15,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 central database service with spring
===
If i have a JAR file project with several database connections and several dozen service classes configured with Spring 3.1, how do i go about packaging it and deploying it to my Jboss 7.1 server in such a way that the other 35 projects in my system can have a client class as a dependency with the interfaces, and then autowire the services?
The goal here is to do something similar to EJB3's where i have a single service project that handles the database access, then my other 35 war files use that service instead of creating their own individual database connections.
im still reading the IoC container documentation but it seems to me that everything (at the moment) is geared towards everything being contained in one war/ear/whatever file. I don't have that environment.
How do i package this? | 0 | [
2,
2936,
21,
521,
6018,
365,
29,
1573,
800,
3726,
3726,
100,
31,
57,
21,
5112,
3893,
669,
29,
238,
6018,
6760,
17,
238,
5550,
365,
2684,
28895,
29,
1573,
203,
9,
165,
15,
184,
107,
31,
162,
88,
16850,
32,
17,
17617,
68,
32,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
misconception about pointers C++
===
it seems that i have a misconception about pointers,
here is an example:(code may not compile,is on different PC)
#include
struct Debris{
long big_data;
//code
};
struct Explosion{
Debris *db;
//code
};
void test(){
Debris *db = new Debris();
db->big_data = 10000;
Explosion *e1 = new Explosion();
e1->db = db;
std::cout << "db addr:" << db <<"db value:"<< ++db->big_data <<<="" "explosion's="" db="" addr:"="" e1-="">db << "explosion's db value:" << e1->db->big_data << std::endl;
//why db and e1->db have different addresses?
//but the e1->db->big_data is changed by ref.
}
can you please explain this? thanks in advance. | 0 | [
2,
2462,
27724,
872,
88,
454,
445,
272,
20512,
800,
3726,
3726,
32,
2206,
30,
31,
57,
21,
2462,
27724,
872,
88,
454,
445,
15,
235,
25,
40,
823,
45,
5,
9375,
123,
52,
26561,
15,
403,
27,
421,
5168,
6,
6926,
22640,
13,
10346,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Loading an image through a relative filepath
===
So I have this filepath "/DataEntry/Image/RenderOriginalImage/3237319%40Research" that will return a jpg and I need to load it into a stream so I can convert it to a byte[] using binary reader. Any ideas how I would go about loading that filepath into a stream? Filestream doesn't work. | 0 | [
2,
12797,
40,
1961,
120,
21,
4543,
3893,
8353,
800,
3726,
3726,
86,
31,
57,
48,
3893,
8353,
13,
7,
118,
18768,
18195,
118,
22039,
118,
99,
16706,
13989,
22039,
118,
3125,
26800,
25733,
2602,
26619,
7,
30,
129,
788,
21,
487,
9623,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WHMCS categorys
===
Is there any method to create a `DedicatedServer`->`Maincategory`->`Subcategory`->`ProductItem` in WHMCS admin panel or by editing its sourcecode ? (I guess defaultly they have only `DedicatedServer`->`Maincategory`->`ProductItem`). I want to extend that to a one more subcategory. And I want to know is there any module or a method to select a dedicated server by adding a ram, processor, data center etc from a **dropdown box per each product** (dedicated servers). Please suggest me a way to do this... | 0 | [
2,
11153,
4829,
18,
3230,
18,
800,
3726,
3726,
25,
80,
186,
2109,
20,
1600,
21,
13,
1,
29913,
10321,
106,
1,
8,
1,
6232,
14375,
93,
1,
8,
1,
7563,
14375,
93,
1,
8,
1,
14086,
2119,
79,
1,
19,
11153,
4829,
18,
21,
43,
2160,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can ILMerge be used on DLLs in InstallShield CustomActions?
===
I created a C# dll that is dependent on the DOTNETZIP "Ionic.Zip.dll". This custom assembly will be used as an InstallShield Custom Action and enter into the Binary table. When the Custom Action is executed, I get the following error information in the MSI log.
Action 11:59:25: LaunchCTSDBExtract2.
MSI (s) (20:50) [11:59:25:513]: Executing op: CustomActionSchedule(Action=LaunchCTSDBExtract2,ActionType=1089,Source=BinaryData,Target=m1,)
MSI (s) (20:08) [11:59:25:607]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI5F58.tmp, Entrypoint: m1
InstallShield: Attempting to load through CLR 4 APIs...
InstallShield: Getting meta host...
InstallShield: Enumerating available runtimes...
InstallShield: Highest available runtime: v4.0.30319
InstallShield: Trying to use highest runtime...
InstallShield: Using highest version runtime...
**InstallShield: Deferred action requested property MsiHiddenProperties not provided by CustomActionData
InstallShield: Loading assembly CTSDBExtract_Merged from resource 4097
InstallShield: Unable to load managed custom action assembly CTSDBExtract_Merged: Resource 4096.4097 was not found**
Has anyone ever seen this, and/or know what it means and how to fix it? If I left anything out that you're not sure about, please let me know and I will be happy to clarify.
Thanks | 0 | [
2,
92,
6317,
1263,
834,
44,
147,
27,
13,
43,
211,
18,
19,
16146,
29026,
5816,
8645,
18,
60,
800,
3726,
3726,
31,
679,
21,
272,
5910,
13,
43,
211,
30,
25,
9063,
27,
14,
14123,
2328,
2553,
306,
13,
7,
18680,
9,
2553,
306,
9,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Show screen on external display
===
I look at some examples at Github, but all of them were without storyboard usage.
I tried to use that code in my app, but all I see on external device in simulator is black screen.
Code I have now:
if([[UIScreen screens]count] > 1) {
CGSize maxSize;
UIScreenMode *maxScreenMode;
for(int i = 0; i < [[[[UIScreen screens] objectAtIndex:1] availableModes]count]; i++)
{
UIScreenMode *current = [[[[UIScreen screens]objectAtIndex:1]availableModes]objectAtIndex:i];
if(current.size.width > maxSize.width)
{
maxSize = current.size;
maxScreenMode = current;
}
}
UIScreen *externalScreen = [[UIScreen screens] objectAtIndex:1];
externalScreen.currentMode = maxScreenMode;
[self myScreenInit:externalScreen];
}
- (void) screenDidConnect:(NSNotification *)notification {
[self myScreenInit:[notification object]];
}
- (void) myScreenInit:(UIScreen *)connectedScreen {
CGRect frame = connectedScreen.bounds;
UIWindow *window = [[UIWindow alloc] initWithFrame:frame];
window.backgroundColor = [UIColor whiteColor];
[window setScreen:connectedScreen];
window.hidden = NO;
} | 0 | [
2,
298,
2324,
27,
4886,
3042,
800,
3726,
3726,
31,
361,
35,
109,
3770,
35,
13,
10404,
20926,
15,
47,
65,
16,
105,
46,
366,
609,
2806,
7514,
9,
31,
794,
20,
275,
30,
1797,
19,
51,
4865,
15,
47,
65,
31,
196,
27,
4886,
3646,
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... |
jquery form.submit() ........strange error message (in German)
===
I'd like to submit a form with jQuery but it doesn't work. I get this strange error message in Firebug (in German, sorry) and assume there is some fucked up character in the html (?!?!)
Some background info on this error message would be cool:
*Die Zeichenkodierung des Reintext-Dokuments wurde nicht deklariert. Das Dokument wird in manchen Browser-Konfigurationen mit verstümmeltem Text dargestellt, wenn das Dokument Zeichen außerhalb des US-ASCII-Bereichs enthält. Die Zeichenkodierung der Seite muss im Transferprotokoll deklariert werden oder die Datei muss eine Byte-Order-Markierung als Kodierungssignatur verwenden.* | 0 | [
2,
487,
8190,
93,
505,
9,
7563,
5130,
5,
6,
13,
9,
9,
9,
9,
9,
9,
9,
9,
21516,
7019,
2802,
13,
5,
108,
548,
6,
800,
3726,
3726,
31,
22,
43,
101,
20,
12298,
21,
505,
29,
487,
8190,
93,
47,
32,
1437,
22,
38,
170,
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... |
CSS webkit-scrollbar and safari
===
I tried to make something similar to the new scrollbar of Google using the CSS `::-webkit-scrollbar`. In chrome everything works fine, in safari not.
My CSS is
::-webkit-scrollbar{height:16px;overflow:visible;width:16px}
::-webkit-scrollbar-button{height:0;width:0}
::-webkit-scrollbar-track{background-clip:padding-box;box-shadow:inset 1px 0 0 #e6e6e6}
::-webkit-scrollbar-track:hover{background-color:#f3f3f3;box-shadow:inset 1px 0 0 #e6e6e6}
::-webkit-scrollbar-track:active{background-color:#f3f3f3;box-shadow:inset 1px 0 0 #dcdcdc,inset -1px 0 0 #eeeeee}
::-webkit-scrollbar-thumb{background-color:#cccccc;background-clip:padding-box;border:solid transparent;border-width:1px 1px 1px 0px;min-height:28px;padding:100px 0 0;box-shadow:inset 1px 1px 0 #e6e6e6,inset 0 -1px 0 #eeeeee}
::-webkit-scrollbar-thumb:hover{background-color:#999999;box-shadow:inset 1px 1px 1px #c0c0c0}
::-webkit-scrollbar-thumb:active{background-color:#808080;box-shadow:inset 1px 1px 3px #a6a6a6}
I made some screenshot of my problem:
This is chrome and it's ok: http://i.imgur.com/wQMP2.png
This is safari when you try to scroll with the mouse (without clicking on it): http://i.imgur.com/bFiWj.png
When you use the scrollbar by clicking on it with mouse the scrollbar works, the problem is only when you use the trackpad or the scroll wheel | 0 | [
2,
272,
18,
18,
2741,
13703,
8,
3862,
8694,
1850,
17,
25055,
800,
3726,
3726,
31,
794,
20,
233,
301,
835,
20,
14,
78,
12159,
1850,
16,
8144,
568,
14,
272,
18,
18,
13,
1,
45,
45,
8,
14113,
13703,
8,
3862,
8694,
1850,
1,
9,
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... |
Plurals in RDoc documentation
===
According to the [RDoc documentation][1], names of classes, source files, and any method names containing an underscore or preceded by a hash character are automatically hyperlinked. But [links to plurals of class names in RDoc][2] do not work. Therefore in a sentence like "A Post has many Comments", `Post` is linked, but `Comment` is not. There seems to be a workaround like this
A Post has many Comments[class_link:Comment.html].
but it is a bit lengthy. Is there any better way to link to plural names?
[1]: http://rdoc.sourceforge.net/doc/
[2]: https://github.com/rdoc/rdoc/issues/10 | 0 | [
2,
13981,
18,
19,
761,
13799,
13945,
800,
3726,
3726,
496,
20,
14,
636,
897,
2499,
13945,
500,
2558,
165,
500,
15,
1817,
16,
2684,
15,
1267,
6488,
15,
17,
186,
2109,
1817,
3503,
40,
131,
15077,
54,
12421,
34,
21,
19170,
925,
50,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make GWT widget from HTML and javascript?
===
I need to make a custom GWT widget from HTML and javascript code. The javascript code should be called on the widget, but the javascript should receive the widget DOM component as a parameter.
Also, the widget's HTML has to be directly dependent on the arguments, given to the widget's constructor.
What is the "idiomatic" way of doing this? | 0 | [
2,
184,
20,
233,
14094,
38,
4807,
43,
3060,
37,
13,
15895,
17,
8247,
8741,
60,
800,
3726,
3726,
31,
376,
20,
233,
21,
5816,
14094,
38,
4807,
43,
3060,
37,
13,
15895,
17,
8247,
8741,
1797,
9,
14,
8247,
8741,
1797,
378,
44,
227,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
representing mandatory field in uitableview
===
I have a tableview which has few textfield and popovers for data entry. I want to represent some of them as mandatory. I can could not figure out how to resent the asterisk. Any help would be appreciated. | 0 | [
2,
3793,
12605,
575,
19,
13,
11193,
579,
4725,
800,
3726,
3726,
31,
57,
21,
859,
4725,
56,
63,
310,
1854,
1109,
17,
1675,
2549,
18,
26,
1054,
2792,
9,
31,
259,
20,
3501,
109,
16,
105,
28,
12605,
9,
31,
92,
110,
52,
1465,
70,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
TCP after the handshake: syn ack homework
===
Ok so I've got this question for homework, I'm given that 'Host X' sends 'Host Z' a packet and the SEQ=46 and ACK=87 and the payload/data = 'Hello?'
From there I am given: a packet sent from Host Z to Host X with payload='Go away' and the last packet sent from Host X to Host Z with the data='No!'
The homework is to find out what the value of the SEQ and ACK of the last two packets would be. I know the handshake is over so it's not just as simple as adding 1 to the SEQ and putting it into the ACK of the next packet. I read somewhere that when a payload is received the recipient then issues an ACK equal to 1 + the length of the payload in bytes. If that is correct how would I go about turning those strings into bytes? And what happens with the SEQ? Is that still grabbed straight form the prior packets ACK?
Thank you all so much. | 0 | [
2,
13,
38,
7439,
75,
14,
224,
17248,
45,
6063,
13,
8735,
22334,
800,
3726,
3726,
5854,
86,
31,
22,
195,
330,
48,
1301,
26,
22334,
15,
31,
22,
79,
504,
30,
13,
22,
11694,
993,
22,
11350,
13,
22,
11694,
2052,
22,
21,
12795,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to disable Express BodyParser for file uploads (Node.js)
===
This seems like it should be a fairly simple question, but I'm having a really hard time figuring out how to approach it.
I'm using Node.js + Express to build a web application, and I find the connect BodyParser that express exposes to be very useful in most cases. However, I would like to have more granular access to multipart form-data POSTS as they come - I need to pipe the input stream to another server, and want to avoid downloading the whole file first.
Because I'm using the Express BodyParser, however, all file uploads are parsed automatically and uploaded and available using "request.files" before they ever get to any of my functions.
Is there a way for me to disable the BodyParser for multipart formdata posts without disabling it for everything else? | 0 | [
2,
184,
20,
1460,
579,
2999,
358,
3574,
4104,
26,
3893,
71,
8294,
18,
13,
5,
251,
546,
9,
728,
18,
6,
800,
3726,
3726,
48,
2206,
101,
32,
378,
44,
21,
6647,
1935,
1301,
15,
47,
31,
22,
79,
452,
21,
510,
552,
85,
25379,
70,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CFHTTP How to Ignore certificate name mismtach
===
I am trying to consume a HTTPS based SOAP WebService via ColdFusion, but it is returning "Connection Failure".
On dumping the result variable, it showed:
**Error Detail:** "I/O Exception: Name in certificate 'subdomain1.domain.com' does not match host name 'subdomain2.domain.com'"
I can ignore such warning if I browse the HTTPS wsdl in browser, But the Question is; How can I bypass this warning using <CFHTTP>?
Thanks | 0 | [
2,
10084,
21127,
184,
20,
7174,
6259,
204,
2462,
79,
38,
3211,
800,
3726,
3726,
31,
589,
749,
20,
16447,
21,
7775,
18,
432,
6447,
2741,
11449,
1197,
1191,
9818,
15,
47,
32,
25,
2485,
13,
7,
25996,
872,
2990,
7,
9,
27,
26523,
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... |
Add anothers class ListViewItemEventListener
===
I'm trying to add the ListViewItemEventListener I have in a class called Main to a class named Search so I can handle the events for the classes in the same listener.
But I don't know how I can achieve this goal, or if even is possible?
This of course works:
__pList->AddListViewItemEventListener(*this);
But then it will use the listener for the Search-class.
I want something like:
__pList->AddListViewItemEventListener(Main ListViewItemEventListener);
Hope someone knows how to do this.
Thanks for any help! | 0 | [
2,
3547,
226,
18,
718,
968,
4725,
2119,
790,
6645,
13891,
106,
800,
3726,
3726,
31,
22,
79,
749,
20,
3547,
14,
968,
4725,
2119,
790,
6645,
13891,
106,
31,
57,
19,
21,
718,
227,
407,
20,
21,
718,
377,
2122,
86,
31,
92,
3053,
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... |
Executing SQL Statement with Template Parameters in .Net code
===
Recently I happened to know about [SQL Template Parameters](http://haacked.com/archive/2005/07/01/sql_query_analyzer_parameters.aspx) - a way to make your SQL statement dynamic, in areas where your SQL parameter cannot be applied, such as `from` clause in `select` statement. An example of SQL Template Parameters would be:
SELECT * FROM <tableName, varchar(32), 'MyTable'>
Could anyone tell me if if there is a way to run this in my .Net code? I found one DLL without source code from [Phil Haack's blog](http://haacked.com/archive/2007/11/04/a-library-for-executing-sql-scripts-with-go-separators-and.aspx) but I would prefer to have open source code or more legitimate approach. | 0 | [
2,
25836,
4444,
255,
3331,
29,
22894,
12905,
19,
13,
9,
2328,
1797,
800,
3726,
3726,
1989,
31,
1190,
20,
143,
88,
636,
18,
22402,
22894,
12905,
500,
5,
21127,
6903,
994,
8735,
69,
9,
960,
118,
23941,
118,
2835,
118,
2984,
118,
302... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 property of other class
===
I've got a UIViewController which has three views: Category -> Sub-Category -> Detail View. The content of the Sub-Category and Detail View depends on which row is clicked in the Category view. This is done with a property called 'categoryClicked' and is declared in the sub-category.m file. It's value is given in the category.m file by the following lines of code.
Sub-category *sub = [[Sub-category alloc] initWithNibName:@"Sub-category" bundle:nil];
sub.categoryClicked = [_categoryArray objectAtIndex:indexPath.row];
This works perfectly fine until I want to use the value of categoryClicked in the Detail View. In both the category.m and the DetailView.m sub-category.m is imported. For testing purposes I putted a label on the Detail View and in the DetailView.m file I've got the following code:
Sub-category *sub = [[Sub-category alloc] initWithNibName:@"Sub-category" bundle:nil];
label.text = sub.categoryClicked;
I'm convinced this code should do the job but in fact I get an empty label. Is there anybody able to tell me what I'm doing wrong.
| 0 | [
2,
1381,
68,
1354,
16,
89,
718,
800,
3726,
3726,
31,
22,
195,
330,
21,
13,
5661,
4725,
12898,
1252,
56,
63,
132,
4146,
45,
3230,
13,
8,
1,
972,
8,
14375,
93,
13,
8,
1,
6110,
1418,
9,
14,
2331,
16,
14,
972,
8,
14375,
93,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: NavigationMode of ActionBarSherlock doesn't change
===
I have an app that uses ActionBarSherlock. In an activity I have two fragments (**Fragment1** and **Fragment2**). In **Fragment1** I use the following Navigation Mode:
getSupportActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
and in **Fragment2**:
getSupportActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
When I navigate from one fragment to another, everything works fine.
Well, in **Fragment2** I implement a menu option that uses a Collapse Action, that calls an AutoCompleteTextView. When I click at this menu option at **Fragment2** and go back to **Fragment1**, even changing Navigation Mode from standard to list, this change doesn't happen, and the NavigationModeList disappears.
Is this a bug? | 0 | [
2,
13005,
45,
8368,
15570,
16,
1028,
1850,
9161,
3966,
1437,
22,
38,
753,
800,
3726,
3726,
31,
57,
40,
4865,
30,
2027,
1028,
1850,
9161,
3966,
9,
19,
40,
2358,
31,
57,
81,
10837,
13,
5,
1409,
22133,
1130,
165,
1409,
17,
13,
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... |
data binding image link using deserialized json data in c# windows phone
===
i had some json data so i deserialized it and bind the data to the listbox to show the data in text blocks....now the problem is i am trying to add an image in the same list box and want to bind the image source using the data of deserialized object
i mean
the link for the image contains some text which is present in the deserialized data which will change with the change in data....
**can anyone tell me how can i use the data of the deserialized object and then make a new string to pass the image source to bind it to the image present in listbox??**
thanks in advance... | 0 | [
2,
1054,
8728,
1961,
3508,
568,
1746,
106,
2815,
1333,
487,
528,
1054,
19,
272,
5910,
1936,
1132,
800,
3726,
3726,
31,
41,
109,
487,
528,
1054,
86,
31,
1746,
106,
2815,
1333,
32,
17,
10193,
14,
1054,
20,
14,
968,
5309,
20,
298,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 we can change alpha value when drag image
===
**Goal :** I wants when I drag image it become fade so we can see background view.
How we increase or decrease the alpha value of image on dragging time?
**thanks**
| 0 | [
2,
184,
95,
92,
753,
5705,
1923,
76,
5501,
1961,
800,
3726,
3726,
13,
1409,
839,
192,
13,
45,
1409,
31,
2846,
76,
31,
5501,
1961,
32,
533,
11381,
86,
95,
92,
196,
2395,
1418,
9,
184,
95,
1839,
54,
9826,
14,
5705,
1923,
16,
196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Cannot connect to webdav server
===
I have a Glassfish 3.1.1 server.
On this server, deployed an EAR has been.
In this EAR, two modules are.
Module the first is simply a webDAV server (net.sf.webdav.WebdavServlet). I'm able to successfully browse files using Chrome.
Module the second attempts to write a file using the following code (the URL is hard-coded for now):
Sardine s = SardineFactory.begin();
s.setCredentials("login", "pass");
s.put("http://my-server:8080/webdav/filesystem/fun.txt", getBytesFromInput(getInputStream()));
...but fails every time with the error "The target server failed to respond".
I'm open to using something other than [Sardine][1] - all I really need to do, is write a file on my glassfish server. What's the problem here, or what other tricks could I use?
[1]: https://code.google.com/p/sardine/ | 0 | [
2,
1967,
6379,
20,
2741,
43,
5214,
8128,
800,
3726,
3726,
31,
57,
21,
1350,
4934,
203,
9,
165,
9,
165,
8128,
9,
27,
48,
8128,
15,
6698,
40,
2330,
63,
74,
9,
19,
48,
2330,
15,
81,
17113,
50,
9,
12613,
14,
64,
25,
1659,
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... |
Chrome for iOS user agent on iPad
===
I have a web page that when viewed from an iOS device displays slightly different content. To detect the device in question the site looks for `iPad;`, `iPod;`, or `iPhone;` in the user agent string.
This works perfectly on Safari on all iOS devices. Testing with Chrome for iOS it works on iPhone and iPad 1, but not iPad 3. The web site is getting the following (unexpected) user-agent string:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10
What I don't understand is that if I browse to ifconfig.me/all in the same browser it's reported as expected:
Mozilla/5.0 (iPad; U; CPU OS 5_1 like Mac OS X; en-us) AppleWebKit/534.46.0 (KHTML, like Gecko) CriOS/19.0.1084.60 Mobile/9B176 Safari/7534.48.3
This makes no sense at all.
For reference, the web site is implemented in ASP.NET MVC 2.0. The same thing happens running under Windows and Lighttpd/Mono. The test page I'm using reports the user agent string as follows:
<%: Request.UserAgent %>
My current theories are:
1. Under some unknown condition, Chrome for iOS reports a different user-agent string.
2. Somewhere between Chrome and my page rendering code, someone is replacing the user-agent string. (seems very unlikely)
3. I'm making a stupid mistake, but can't see what it could be.
If you'd like to test this yourself, there's a page here that simply reflects the user-agent string.
* <http://minicompapp.com/Home/UserAgent> | 0 | [
2,
13,
12985,
26,
13,
7760,
4155,
2267,
27,
31,
8240,
800,
3726,
3726,
31,
57,
21,
2741,
2478,
30,
76,
6084,
37,
40,
13,
7760,
3646,
9412,
1847,
421,
2331,
9,
20,
9092,
14,
3646,
19,
1301,
14,
689,
1879,
26,
13,
1,
49,
8240,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Open External Link with Phonegap Cordova in iOS without Child Browser Plugin
===
Can I Open External Link with Phonegap Cordova (1.8.1) in iOS without Child Browser Plugin?
Most of the tutorials that talk about this topic are outdated.
Any solution?
Thanks. | 0 | [
2,
368,
4886,
3508,
29,
1132,
1136,
306,
5429,
3496,
19,
13,
7760,
366,
850,
16495,
10922,
108,
800,
3726,
3726,
92,
31,
368,
4886,
3508,
29,
1132,
1136,
306,
5429,
3496,
13,
5,
165,
9,
457,
9,
165,
6,
19,
13,
7760,
366,
850,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Html Option Name Change At Different Select Item
===
I'm creating a website with Php and Mysql. There are a upload form bellow:
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post"
enctype="multipart/form-data" accept-charset="utf-8">
<table width="900" border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="150">Medium</td>
<td>
<select class="td" name="medium">
<option selected="selected" value="">Select..</option>
<?php
$sql = mysql_query("SELECT * FROM medium WHERE s_id = 0");
while($re = mysql_fetch_array($sql))
{
$re_medium =
mysql_real_escape_string(trim($re['name']));
$sel2 = '';
if($re_medium == $_POST['medium'])
{
$sel2 = 'selected = "selected"';
}
echo "<option value='$re_medium'".$sel2."> $re_medium
</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Class</td>
<td>
<select class="td" name="class">
<option selected="selected" value="">Select..</option>
<?php
$sql2 = mysql_query("SELECT * FROM class");
while($re2 = mysql_fetch_array($sql2))
{
$re_class =
mysql_real_escape_string(trim($re2['c_name']));
$sel = '';
if($re_class == $_POST['class'])
{
$sel = 'selected = "selected"';
}
echo "<option value='$re_class'".$sel."> $re_class
</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td>Subject</td>
<td>
<select class="td" name="subject">
<option selected="selected" value="">Select..</option>
<?php
$sql2 = mysql_query("SELECT * FROM subject");
while($re2 = mysql_fetch_array($sql2))
{
$re_class =
mysql_real_escape_string(trim($re2['subject_name']));
$sel = '';
if($re_class == $_POST['subject'])
{
$sel = 'selected = "selected"';
}
?>
<option value="<?php echo $re2['id'] . '|' . $re2['subject_name'] ?>" <?php
echo $sel; ?>><?php echo $re2['subject_name'] ?></option>
<?php
//echo "<option value='$re_class'".$sel."> $re_class
</option>";
}
?>
</select>
</td>
</tr>
</table>
</form>
Well, So my questions is, Is there any way to show different Option Name at Different Select Item.
For example: If i select **English** name from html Select tag, then all **class** name should be show under this category and after that If i select **O level** from **Class** name then all subject should be show under this category. Just Dynamically change!
Sorry my bad English.
Thank you.
| 0 | [
2,
13,
15895,
4255,
204,
753,
35,
421,
5407,
9101,
800,
3726,
3726,
31,
22,
79,
2936,
21,
2271,
29,
13,
26120,
17,
51,
18,
22402,
9,
80,
50,
21,
71,
8294,
505,
23040,
45,
13,
1,
4190,
1028,
3726,
7,
1,
60,
26120,
8117,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Html returned as a response to a jqeury ajax call
===
My jquery function is making a ajax call (GET request) and it has to return HTML that I will then inject in the page in the success event.
What do I have to escape in the HTML to ensure there aren't any issues? | 0 | [
2,
13,
15895,
587,
28,
21,
1627,
20,
21,
487,
1251,
5630,
93,
20624,
645,
800,
3726,
3726,
51,
487,
8190,
93,
1990,
25,
544,
21,
20624,
645,
13,
5,
3060,
3772,
6,
17,
32,
63,
20,
788,
13,
15895,
30,
31,
129,
94,
20316,
19,
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... |
Are their any hidden php wright permission using imagejpeg() or in apachy & php in general? Getting Unable to open Permission denied
===
I am getting Unable to open ... for writing: Permission denied when I try and resize an image. The code has work fine for years but after a resent upgrade (I think ) It has stopped working. I have tried changing the permission on the folder to 777 and disabled selunix. Is their any thing that may have gotten changed in my httpd.con file or php.ini file that will disabled a php script wright?
The error message from Apache logs:
[Mon Jun 25 08:59:17 2012] [error] [client 127.0.0.1] PHP Warning: imagejpeg(): Unable to open './cache/150_112.5_be636f82ef8e7e22727c81980df16cd5.jpg' for writing: Permission denied in /var/www/html/resize_function.php on line 62, referer: http://jasonrmoore.info/list.php?dir=./
| 0 | [
2,
50,
66,
186,
3689,
13,
26120,
5032,
5572,
568,
1961,
728,
20427,
5,
6,
54,
19,
21,
24630,
93,
279,
13,
26120,
19,
297,
60,
1017,
2343,
20,
368,
5572,
5265,
800,
3726,
3726,
31,
589,
1017,
2343,
20,
368,
13,
9,
9,
9,
26,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.