unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
javascript library for tiles / grids positioning
===
I'm looking for a javascript library that helps handle tiles or grids. It should split an element into a chess-board like grid using squares or hexes, and you should be able to position elements on the grid using a coordinate system. Bonus points if there's an interface for drag to select multiple tiles, but that's not necessary.
Does anyone know of such a library? Thanks. | 0 | [
2,
8247,
8741,
1248,
26,
14836,
13,
118,
7354,
18,
649,
68,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
8247,
8741,
1248,
30,
7778,
3053,
14836,
54,
7354,
18,
9,
32,
378,
2132,
40,
4520,
77,
21,
6168,
8,
2806,
101,
7354,
568,
73... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Torunament managemet application - how to manage players and teams?
===
I'm writing archery tournament management application.
This application will be run on judge's laptop with no internet connection.
It is made to easily manage players, teams and their scores and points.
I'm writing in C# .NET.
My problem.
There will be around 100 players that are grouped into about 20 teams.
What is the best way of storing information about players and teams?
How to save that information to disc?
I can't install any other software on judge's PC (so no local MySQL).
Can you give me some ideas?
Maybe in future there will be more then one people entering scores at once (possible LAN connection). How to adapt to this? (This is less important, for now I need 1 pc functionality).
| 0 | [
2,
20,
3169,
58,
1130,
4705,
5909,
3010,
13,
8,
184,
20,
4705,
1007,
17,
952,
60,
800,
3726,
3726,
31,
22,
79,
1174,
24334,
1085,
1097,
3010,
9,
48,
3010,
129,
44,
485,
27,
1878,
22,
18,
12294,
29,
90,
2620,
2760,
9,
32,
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... |
What is equal method to getStructuringElement() in javacv?
===
I'm developing project which use image processing technique. In that I'm using javacv package which act as interface to call opencv methods. So there are lot of tutorials and materials for the opencv but there are less number of materials are available for the javacv. So I have found a method call getStructuringElement().
Please can some one explain the similar method in javacv and the purpose of this method ? | 0 | [
2,
98,
25,
2747,
2109,
20,
164,
10346,
10450,
27567,
5,
6,
19,
8247,
12732,
60,
800,
3726,
3726,
31,
22,
79,
3561,
669,
56,
275,
1961,
5511,
4873,
9,
19,
30,
31,
22,
79,
568,
8247,
12732,
6030,
56,
601,
28,
6573,
20,
645,
368,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fuse for linux not found in rpmforge repo
===
I am trying to install fuse via yum on our RHEL5 instance. Its not available in my yum list.
After checking, some sites suggests enabling rpmforge repo will provide the package in yum to install. I enabled rpmforge repo (latest for RHEL5), but there is no fuse in that as well.
I tried with EPEL repo as well, same result.
Can anyone help me to find the root cause of this?
Note: I can install fuse using src, but that is not working for the other software I am trying to install (s3fs), that's why I need the yum to get working so that I would have all the latest packages needed.
Thanks for the help.
-Noman A. | 0 | [
2,
13,
13072,
26,
13024,
52,
216,
19,
12936,
1106,
834,
302,
1638,
800,
3726,
3726,
31,
589,
749,
20,
16146,
13,
13072,
1197,
13,
18105,
27,
318,
9940,
255,
264,
4851,
9,
82,
52,
904,
19,
51,
13,
18105,
968,
9,
75,
9886,
15,
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... |
Mule choice using XPath Evaluator
===
In the following mule flow I'm using xpath to decide which queue the message needs to be sent to. However the xpath expression is returning false, even though the XML has tc="121". Can you tell what am I doing wrong?
Below is the mule flow and XML evaluated by XPath.
Mule Flow :
<flow name="ProcessXMLRequest">
<jms:inbound-endpoint exchange-pattern="one-way" queue="mq.xml.request" />
<logger message="XML payload is #[payload]" level="INFO" />
<choice>
<when expression="/TXLife/TXLifeRequest/TransType/@tc='121'"
evaluator="xpath">
<jms:outbound-endpoint queue="mq.121.request.apps" />
</when>
<when
expression="/TXLife/TXLifeRequest/TransType/@tc='1122'"
evaluator="xpath">
<jms:outbound-endpoint queue="mq.1122.request.apps" />
</when>
<otherwise>
<jms:outbound-endpoint queue="mq.error"/>
</otherwise>
</choice>
</flow>
XML:
<TXLife xmlns:ns2="http://abc.com/services/mvi" xmlns="http://ACORD.org/Standards/Life/2">
<TXLifeRequest PrimaryObjectID="Holding_1">
<TransType tc="121">121</TransType>
<TransMode tc="2">2</TransMode>
</TXLifeRequest>
</TXLife>
| 0 | [
2,
17857,
1837,
568,
993,
8353,
6805,
2377,
3457,
800,
3726,
3726,
19,
14,
249,
17857,
3312,
31,
22,
79,
568,
993,
8353,
20,
4073,
56,
22521,
14,
2802,
2274,
20,
44,
795,
20,
9,
207,
14,
993,
8353,
1803,
25,
2485,
4997,
15,
166,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
disable local infile on xampp?
===
I have a xampp 1.7.7 localhost I'm trying to disable local infile
I tried to edit my.cnf by starting mysqld with --local-infile=0
but when I add this line to my.cnf the mysql server don't start.
Any idea? | 0 | [
2,
1460,
579,
375,
19,
16877,
27,
993,
765,
3421,
60,
800,
3726,
3726,
31,
57,
21,
993,
765,
3421,
137,
9,
465,
9,
465,
375,
11694,
31,
22,
79,
749,
20,
1460,
579,
375,
19,
16877,
31,
794,
20,
9392,
51,
9,
150,
11408,
34,
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... |
Spring RestTemplate Client - connection refused exception
===
I am new to webservices and trying to write a RESTFul webservice's client using RestTemplate.
I am using org.springframework.http.converter.xml.MarshallingHttpMessageConverter as message converter and org.springframework.oxm.xstream.XStreamMarshaller as marshaller.
Is there any way to debug this further or find out the root cause of this issue?
My consumer class looks like this -
@SuppressWarnings("unchecked")
public List<Deal> getClientInformation() throws RestClientException {
return restTemplate.getForObject(webServiceURL, List.class);
}
Exception :
Exception in thread "main" org.springframework.web.client.ResourceAccessException: I/O error: Connection refused: connect; nested exception is java.net.ConnectException: Connection refused: connect
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:359)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:307)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:177)
at main.java.com.sample.consumer.DealConsumer.getClientInformation(Consumer.java:35)
at main.java.com.client.WebserviceConsumerTestClient.main(WebserviceConsumerTestClient.java:16)
Caused by: java.net.ConnectException: Connection refused: connect
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:359)
| 0 | [
2,
1573,
760,
9577,
6554,
6819,
13,
8,
2760,
2453,
5391,
800,
3726,
3726,
31,
589,
78,
20,
2741,
11449,
18,
17,
749,
20,
2757,
21,
760,
1566,
2741,
11449,
22,
18,
6819,
568,
760,
9577,
6554,
9,
31,
589,
568,
13,
5583,
9,
15827,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
When applying ListView's custom list item with a root ViewGroup implementing checkable, can't the selected item's color be changed?
===
I already successfully changed the color of a selected custom list item, whose root ViewGroup doesn't implement Checkable, from orange to system_blue by assigning its attr background with a selector.xml:
<selector>
<item android:state_pressed="true"
android:drawable="@color/system_blue"/>
<item android:state_checked="true"
android:drawable="@color/system_blue"/>
<item android:drawable="@android:color/transparent"/>
</selector>
* Even the state_checked case is defined, but the state of the selected list item will not be maintained after the finger left the selected item.
Now the custom list item's root ViewGroup implements Checkable, for I need to maintain the status of the selected list item. And Interface Checkable's the member function setChecked() is implemented as following:
public void setChecked(boolean checked) {
mChecked = checked;
setBackgroundDrawable(checked ? new ColorDrawable(
getResources().getColor(R.color.system_blue)) : null);
}
Now the selected item's color can be maintained to system_blue, after the finger left the select item. Nevertheless when pressing the item, the color is first changed to default orange instead of system_blue. My android device has a default orange color. Any ideas will be appreciated.
| 0 | [
2,
76,
11989,
968,
4725,
22,
18,
5816,
968,
9101,
29,
21,
5900,
1418,
8024,
17333,
2631,
579,
15,
92,
22,
38,
14,
1704,
9101,
22,
18,
1665,
44,
1015,
60,
800,
3726,
3726,
31,
614,
3673,
1015,
14,
1665,
16,
21,
1704,
5816,
968,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rails ActiveRecord methods in different places
===
I want to use activerecord methods in different places
for example
if ..something..
Post.where(..something..)
else
Post.where(..something..)
end
@posts = Post.all(:order => ..something..)
how is this possible?
thanks | 0 | [
2,
2240,
18,
1348,
14953,
3195,
19,
421,
1489,
800,
3726,
3726,
31,
259,
20,
275,
1348,
14953,
3195,
19,
421,
1489,
26,
823,
100,
13,
9,
9,
9099,
9,
9,
678,
9,
2798,
5,
9,
9,
9099,
9,
9,
6,
962,
678,
9,
2798,
5,
9,
9,
90... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Button on floating footer would not work
===
I am new to Android and WebDev. I am creating a web app in which i am using jquery mobile. I have a floating footer which has a button on it. But the button would not work until i browse all the way down on the web page which is included in the web-app. This is how i have done it
<div data-role="footer" data-position="fixed" data-iscroll="scroller">
<div class="center-wrapper">
<a href="camera.html" data-role="button" data-icon="gear">
Take Picture !
</a>
</div>
</div><!-- /footer -->
| 0 | [
2,
5167,
27,
8319,
1749,
106,
83,
52,
170,
800,
3726,
3726,
31,
589,
78,
20,
13005,
17,
2741,
14438,
9,
31,
589,
2936,
21,
2741,
4865,
19,
56,
31,
589,
568,
487,
8190,
93,
3241,
9,
31,
57,
21,
8319,
1749,
106,
56,
63,
21,
51... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
String manipulation issue in sql removing underscore and characters after that from comma delimited string
===
I am trying to change a string which is in the format say :
"12_7,34_22,28_4,6_22"
TO
"12,34,28,6"
Essentially I want to eliminate "_" (underscore and whatever is after that and before comma ) from the string. Haven't worked with sql so it is looking like an uphill task to me.
| 0 | [
2,
3724,
17561,
1513,
19,
4444,
255,
9096,
131,
15077,
17,
1766,
75,
30,
37,
11951,
58,
121,
23012,
3724,
800,
3726,
3726,
31,
589,
749,
20,
753,
21,
3724,
56,
25,
19,
14,
2595,
395,
13,
45,
13,
7,
918,
1,
465,
15,
3965,
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... |
Rails: how to pass params from one form to another
===
Here's my situation: I've got form that any visitor to the site can fill out. Of course, if s/he wants to submit it, they have to be a user. So when they click "submit", they're taken to the sign up/in page. That's because I need a "user_id" before the data from that original form is saved.
What I would like to do is to take the params form the original form (params[:site]) and, instead of submitting them in a create action, I'd like to wait until the user has created an account. This will allow me to avoid saving the site info to the database without a user id.
I could add some code to my site/create method, like this.
def create
@site = Site.new(params[:site])
unless current_user?
redirect_to new_user_session_path, sites_form_data: params[:site]
end
if @site.save
# ...
end
But I'm not sure how to grab params[:site] once I've had the user create the account?
I'm using Devise for this project, so that may throw a wrench into the works. I wonder if I'll have to overwrite the original devise controller, like this guy did: [http://rorguide.blogspot.com/2011/04/overwrite-devise-registrations.html][1]
I suppose I could also store the data in a cookie. But I don't know when I'd access that cookie, extract the data, and save to the database. After user creation, definitely. But should it be a callback on the user model? Where should it go?
I'd appreciate any suggestions or advice.
[1]: http://rorguide.blogspot.com/2011/04/overwrite-devise-registrations.html | 0 | [
2,
2240,
18,
45,
184,
20,
1477,
2258,
79,
18,
37,
53,
505,
20,
226,
800,
3726,
3726,
235,
22,
18,
51,
1858,
45,
31,
22,
195,
330,
505,
30,
186,
10875,
20,
14,
689,
92,
3509,
70,
9,
16,
674,
15,
100,
13,
18,
118,
438,
2846,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding error bars on a bar graph in gnuplot
===
I have the following file I want to plot using gnuplot bar graphs:
<code>
Function X X-ERROR Y Y-ERROR
A 1.311539 0.066268 1.000000 0.000000
(a1,b0) 1.325429 0.083437 1.010926 0.016710
(a.9,.b1) 1.134640 0.040017 1.276168 0.060281
(a.8,.b2) 1.078336 0.058529 1.346358 0.054645
(a.7,.b3) 1.035866 0.060660 1.318395 0.018087
(a.6,.b4) 0.982717 0.047363 1.196714 0.047427
(a.5,.b5) 0.962423 0.051994 1.127991 0.044731
(a.4,.b6) 0.953673 0.046014 1.139608 0.044726
(a.3,.b7) 0.948948 0.050462 1.169209 0.044333
(a.2,.b8) 0.941013 0.047166 1.198138 0.045844
(a.1,.b9) 0.929961 0.057801 1.328111 0.088813
(a0,b1) 0.966331 0.036079 3.289381 0.213192
B 1.000000 0.000000 3.321802 0.121290
</code>
I can manage to plot the graph perfectly using:
<code>
plot 'file.dat' using 4:xtic(1) title col, \\
'' using 2:xtic(1) title col;
</code>
However I would like to use columns 3 and 5 to represent the interval of confidence that I always calculated. Any help?
Thanks!
| 0 | [
2,
4721,
7019,
6062,
27,
21,
748,
7210,
19,
26092,
13221,
38,
800,
3726,
3726,
31,
57,
14,
249,
3893,
31,
259,
20,
3798,
568,
26092,
13221,
38,
748,
7210,
18,
45,
13,
1,
9375,
1,
1990,
993,
993,
8,
29992,
13,
93,
13,
93,
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... |
<DIV> adjust its relative position not based on its closest parent
===
I have the following structure in my page:
<div id="Content">
<div id="Wrapper">
<div id="NoSplitter">
<div id="FilterContainer">
</div>
</div>
</div>
</div>
And the CSS:
#content {
display: block;
}
#wrapper {
position: relative;
}
#NoSplitter {
position: relative;
}
#FilterContainer {
position: absolute;
}
I do not understand why the `#FilterContainer` adjust its position depending on `#wrapper` and ignores `#NoSplitter`. Anybody know why this might happen? Thanks
| 0 | [
2,
13,
1,
12916,
1,
14328,
82,
4543,
649,
52,
432,
27,
82,
6993,
4766,
800,
3726,
3726,
31,
57,
14,
249,
1411,
19,
51,
2478,
45,
13,
1,
12916,
4924,
3726,
7,
25424,
7,
1,
13,
1,
12916,
4924,
3726,
7,
499,
525,
8763,
7,
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... |
PHP Mail just suddenly stop working
===
It's been a while that i have used the php mail function in the contact form of my send to send out emails. Recently, I have found out that it just stop working. When i send an inquiry in my contact form, it says successfully sent but none of the test i did came into my inbox..
Does anyone facing the same issue here? How can i possibly fix this?
I checked the MX entry in cpanel and the data is correct. I want to try SMTP but i dont have access information.
ANy help on this matter? | 0 | [
2,
13,
26120,
4216,
114,
1605,
747,
638,
800,
3726,
3726,
32,
22,
18,
74,
21,
133,
30,
31,
57,
147,
14,
13,
26120,
4216,
1990,
19,
14,
2203,
505,
16,
51,
2660,
20,
2660,
70,
8517,
18,
9,
1989,
15,
31,
57,
216,
70,
30,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get outerWindowID from inner-window-destroyed
===
Part of the Firefox extension I'm building gets the ID of 'inner windows' being destroyed, like this -
observer.add('inner-window-destroyed', function (subject, data) {
var innerWindowID = subject.QueryInterface(Ci.nsISupportsPRUint64).data;
console.log('destroyed: '+innerWindowID);
})
This works OK, but I'd like to know if that observer can also get the ID of that inner window's outer window.
I can get an outerWindowID from another channel observer in my code, but I'm not sure how to get it from the above observer when an inner window is being destroyed.
Hope that makes sense...
I've referred to the details on these pages, but can't figure it out -
https://developer.mozilla.org/en/Observer_Notifications#Windows
https://developer.mozilla.org/en/Code_snippets/Windows#Uniquely_identifying_DOM_windows | 0 | [
2,
164,
4896,
27508,
1340,
37,
3754,
8,
27508,
8,
28764,
69,
800,
3726,
3726,
141,
16,
14,
535,
18219,
3896,
31,
22,
79,
353,
3049,
14,
4924,
16,
13,
22,
18005,
1936,
22,
142,
2183,
15,
101,
48,
13,
8,
9855,
9,
14854,
5,
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... |
How do i select two items from a listview with Robotium?
===
I would like two test the selection of two items in a listview using robotium.
i am using this solo.clickInList(0); which gets the first item from the list but how do i get the second one. (solo.clickInList(1); gets the first one again!)
Thanks in advance. | 0 | [
2,
184,
107,
31,
5407,
81,
3755,
37,
21,
968,
4725,
29,
8288,
2187,
60,
800,
3726,
3726,
31,
83,
101,
81,
1289,
14,
3155,
16,
81,
3755,
19,
21,
968,
4725,
568,
8288,
2187,
9,
31,
589,
568,
48,
2046,
9,
150,
10129,
108,
5739,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unsecured MySQL 'root'@'localhost' account accessed remotely?
===
A little background: We've just had our PBX system hacked. The server itself seems secure (no logged unauthorised access), but somehow the hackers have managed to inject a new admin user into the PBX software (FreePBX, backed by MySQL). Apache logs imply that the hackers managed to add the user without using the web interface (or any exploit in the web interface).
Now, I have since discovered that MySQL was running without a root password (!!) and openly bound to the external IP address (Obviously, I have locked this down now). However, the only root level user in MySQL was `'root'@'localhost'` and `'root'@'127.0.0.1'`, both of which should only have been accessible locally.
So, my question is this:
**Is there a way of spoofing a connection to MySQL so that it will allow connection to the 'root'@'localhost' user from a remote IP address, WITHOUT running any other exploit locally?**
For reference, the box is Centos 5 (Linux 2.6.10) running Mysql 5.0.95. | 2 | [
2,
367,
22917,
43,
51,
18,
22402,
13,
22,
14032,
22,
1,
22,
15580,
11694,
22,
2176,
12904,
23288,
60,
800,
3726,
3726,
21,
265,
2395,
45,
95,
22,
195,
114,
41,
318,
13,
13390,
396,
329,
11835,
69,
9,
14,
8128,
1145,
2206,
4315,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to remove ‘password cannot be empty’ msg on the registration form
===
In my app(Magento v1.7), I don’t want user to input their password when registration. So I comment out the following code on page app\design\frontend\base\default\template\persistent\customer\form\register.phtml
<ul class="form-list">
<li class="fields">
<div class="field">
<label for="password" class="required"><em>*</em><?php echo $this->__('Password') ?></label>
<div class="input-box">
<input type="password" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" />
</div>
</div>
<div class="field">
<label for="confirmation" class="required"><em>*</em><?php echo $this->__('Confirm Password') ?></label>
<div class="input-box">
<input type="password" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" />
</div>
</div>
</li>
<?php echo $this->getChildHtml('persistent.remember.me'); ?>
</ul>
But the warning message ‘The password cannot be empty.’ is still displayed when registration. How to remove this warning msg?
Many thanks | 0 | [
2,
184,
20,
4681,
13,
1,
6201,
9587,
1967,
44,
2424,
1,
4235,
263,
27,
14,
8587,
505,
800,
3726,
3726,
19,
51,
4865,
5,
9473,
17050,
566,
165,
9,
465,
6,
15,
31,
221,
1,
38,
259,
4155,
20,
6367,
66,
20884,
76,
8587,
9,
86,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
handling events when app goes into the background
===
What I want is that my app should stop playing sound when it enters the background (when home button is pressed). I did this in appDelegate.m but it says `use of undeclared identifier 'soundID'`
- (void)applicationDidEnterBackground:(UIApplication *)application
{
AudioServicesDisposeSystemSoundID(soundID)
}
I have imported my VC into the delegate and have also exposed the `soundID` as a property. Where am I going wrong? Please help. | 0 | [
2,
7988,
963,
76,
4865,
1852,
77,
14,
2395,
800,
3726,
3726,
98,
31,
259,
25,
30,
51,
4865,
378,
747,
791,
646,
76,
32,
8104,
14,
2395,
13,
5,
3185,
213,
5167,
25,
2931,
6,
9,
31,
144,
48,
19,
4865,
24249,
3322,
9,
79,
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... |
How to present cursor from two columns of the same table to SimpleCursorAdapter Android
===
I a developing an app whereby i retrieve data from an sqlite database and the data is displayed on a listview I am retrieving data from two columns of a specific table and it is added to a SimpleCursorAdapter which is then set to the listview i would like to display each record in the different columns to be displayed on its own row currently data from both columns is displayed in one row any help will be appreciated especially a link to a working example | 0 | [
2,
184,
20,
734,
29588,
37,
81,
7498,
16,
14,
205,
859,
20,
1935,
4734,
18,
248,
27576,
106,
13005,
800,
3726,
3726,
31,
21,
3561,
40,
4865,
15630,
31,
11917,
1054,
37,
40,
4444,
10601,
6018,
17,
14,
1054,
25,
6115,
27,
21,
968,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I do bit operations on a struct?
===
I have a bitfield struct on which I want to perform bitwise operations using masks.
I want to know the simplest and most efficient way to do this.
I have tried using my conversion operator (which seems an inefficient way of doing the & operation on two structs) but I get error C2440: 'type cast' : cannot convert from 'const test::dtType' to 'char'. No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
class test
{
public:
test() : startTime(0), endTime(5,23) {}
~test();
struct dtType {
// inline constructors with initialisation lists
dtType() {dtType(0);}
dtType(byte z) {dtType(z,z);}
dtType(byte n,byte h) : mins(n), hrs(h){}
// inline overloaded operator functions
operator char() {return mins + hrs<<3;}; // allow casting the struct as a char
// All I want to do is return (this & hrsMask == date & hrsMask)
// I know that in this trivial case I can do return (hrs == date.hrs) but I have simplified it for this example.
bool operator== (dtType date){return (char(this) & char(hrsMask)) == (char(date) & char(hrsMask));};
// data members
unsigned mins: 3; // 10's of mins
unsigned hrs: 5; // 8 bits
};
const static dtType hrsMask; // initialised outside the declaraion, since a static is not associated with an individual object.
dtType startTime; // initialised by test() in its initialisation list
dtType endTime; // initialised by test() in its initialisation list
};
// Typically in a source file, but can be in the header.
const test::dtType hrsMask(0,31); | 0 | [
2,
184,
107,
31,
107,
1142,
1311,
27,
21,
13,
10346,
60,
800,
3726,
3726,
31,
57,
21,
1142,
1109,
13,
10346,
27,
56,
31,
259,
20,
2985,
1142,
10474,
1311,
568,
18992,
9,
31,
259,
20,
143,
14,
24384,
17,
127,
8243,
161,
20,
107... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 use of google places?
===
what is the use of Google places and how we can retrieve Google Reviews from it.
| 1 | [
2,
98,
25,
14,
275,
16,
8144,
1489,
60,
800,
3726,
3726,
98,
25,
14,
275,
16,
8144,
1489,
17,
184,
95,
92,
11917,
8144,
2783,
37,
32,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
TransmitFile continue with page_load efter Response.End
===
I've been looking for an answer for a week now and I give up.
I'm creating an excelfile and then let the user download it to his client with TransmitFile.
The thing is, this works perfectly most of the time, but in some cases (can be repeated), after the Response.End, the page reloads and page_load is called. The flag IsPostBack is false.
This behaviour interrupt the download and the whole application stop working, displaying connecting to server.
foreach (string filename in Directory.GetFiles(WebConfigurationManager.AppSettings.Get("EXCEL_PATH")))
{
if (File.GetLastWriteTime(filename) < (DateTime.Now.AddDays(-1)))
{
File.Delete(filename);
}
}
ClsOrderFormData ofData = new ClsOrderFormData(ddOrderTypes.SelectedValue, OF.Customer.CustomerCategory);
ClsExportOF xls = new ClsExportOF(OF.SizeDims, ofData, OF.Customer, Request.PhysicalApplicationPath, ClsPrintOrder.getOrderData().TheOrder.Articles);
string sFileName = xls.CreateExcelFile();
FileInfo OutFile = new FileInfo(WebConfigurationManager.AppSettings.Get("EXCEL_PATH") + sFileName);
Response.Clear();
Response.AddHeader("content-disposition", "attachment; filename=Abacus_OF_" + ddOrderTypes.SelectedItem.Text + "_" + ddCustomer.SelectedItem.Text + "_" + DateTime.Now.ToShortDateString() + ".xls".Replace(',', '-'));
Response.ContentType = "application/vnd.ms-excel";
Response.TransmitFile(WebConfigurationManager.AppSettings.Get("EXCEL_PATH") + sFileName, 0, OutFile.Length);
Response.Flush();
Response.End();
In short. When it works no more code is executed after Response.End(), as expected. When it don't work it continue with page_load and so on, and the site hangs.
Any tips?
| 0 | [
2,
18745,
16877,
1816,
29,
2478,
1,
8294,
11599,
815,
1627,
9,
2451,
800,
3726,
3726,
31,
22,
195,
74,
699,
26,
40,
1623,
26,
21,
877,
130,
17,
31,
590,
71,
9,
31,
22,
79,
2936,
40,
20700,
16877,
17,
94,
408,
14,
4155,
7121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
create a spinner for my html page
===
I have a web form which the user needs to submit to the server. The server response may take seconds. So I want to show the user a spinner, such that all other fields are grayed and the user make any changes in the webform and in the center I have a spinner which keeps rotating.. Please help me in how should I proceed.. | 4 | [
2,
1600,
21,
3310,
1031,
26,
51,
13,
15895,
2478,
800,
3726,
3726,
31,
57,
21,
2741,
505,
56,
14,
4155,
2274,
20,
12298,
20,
14,
8128,
9,
14,
8128,
1627,
123,
247,
2582,
9,
86,
31,
259,
20,
298,
14,
4155,
21,
3310,
1031,
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... |
Which option to select to use sql in C++
===
I want to connect and use `sql` database within my `C++` application . My application need to store some data _(can be stored in form of tables)_ which will be growing continuously and need to be shared between different processes - so I need a database. I selected `sql` because it is recommendable for beginners and I need multiple writer so no `SQLite`.
On searching I found following options _(These options may include ORMS, APIs , and Drivers and may be some of these options shouldn't be even included - i.e I was totally wrong understanding that option; then please correct me)_:
1. [SQLAPI++][1] - [Source][2](ALSO OFFICIAL SITE)
2. [MySQL Connector/C++][3] (Some advantages are also given there.) - [Source][4]
3. [MySQL++][5]
4. [CppDB][6]
5. [SOCI][7]
6. [Libodbc++][8] (Runs on top of ODBC)
7. [Database Template Library][9] - [Source][10]
8. [Oracle Template Library][11]
9. Using sql.h with ODBC:
Choices for ODBC:
a. [MYSQL Connector/ODBC][12]
b. [EasySoft ODBC][13]
c. [Some Others][14]
Some SO's threads which help me to find these choices: [T1][15],[T2][16], [T3][17], [T4][18].
__My Questions__:
1. _Which_ option to use and _when_? _Advantages/Disadvantages_ of these options? _(May be based on `performance`, `learning curve`, `compatibility`, `present support`.)_ Is there any __benchmark__ or __suggestion__ for selecting among these options. _(I really don't know about these options, so may be some of these options required to group together to make them work i.e may be some of the options are __inter-dependent__.)_
2. What are the required set of tools for these options.
3. If using any `ODBC` dependent library, then which `ODBC` to use. _(There are many ODBCs mentioned in the link 'Some Others' above.)_
4. Any source for learning them. _(For some of the options I have already mentioned a source.)_
5. Is there anything else that I have missed, entirely?
6. What if my application is in __`C`__? _(This is because I also need to develop an application in C which uses `sql`)_
[1]: http://www.sqlapi.com/index.html
[2]: http://www.crazyengineers.com/community/threads/database-connectivity-using-c-c-tutorial.23155/
[3]: http://dev.mysql.com/doc/refman/5.6/en/connector-cpp.html
[4]: http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html
[5]: http://tangentsoft.net/mysql++/
[6]: http://cppcms.com/sql/cppdb/
[7]: http://soci.sourceforge.net/
[8]: http://libodbcxx.sourceforge.net/
[9]: http://dtemplatelib.sourceforge.net/
[10]: http://www.codeguru.com/cpp/data/data-misc/fileinformation/article.php/c10629/Accessing-Your-Database-with-C-Is-as-Easy-as-DTL.htm
[11]: http://otl.sourceforge.net/
[12]: http://dev.mysql.com/downloads/connector/odbc/
[13]: http://www.easysoft.com/products/data_access/odbc_oracle_driver/index.html
[14]: http://www.unixodbc.org/
[15]: http://stackoverflow.com/questions/205802/best-portable-way-to-connect-to-sql-server-using-c
[16]: http://stackoverflow.com/questions/296205/recommended-c-database-abstraction-layers
[17]: http://stackoverflow.com/questions/440069/database-access-libraries-for-c
[18]: http://stackoverflow.com/questions/813296/how-do-i-use-a-database-in-c | 4 | [
2,
56,
4255,
20,
5407,
20,
275,
4444,
255,
19,
272,
20512,
800,
3726,
3726,
31,
259,
20,
6379,
17,
275,
13,
1,
18,
22402,
1,
6018,
363,
51,
13,
1,
150,
20512,
1,
3010,
13,
9,
51,
3010,
376,
20,
1718,
109,
1054,
13,
1,
5,
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... |
User interaction on Button while animating in iOS
===
I am creating buttons programatically, and they are animated (fade & movement), I need the buttons to still have user interaction though. I have tried things like
options:(UIViewAnimationOptionAllowUserInteraction
which seems to do nothing :/ I have read several posts on here with different advice, including someone saying it isn't actually possible. Does anyone know if I can enable user interaction while a button is animating, and if it's not possible how do people get around this issue?
Thank you. | 0 | [
2,
4155,
7754,
27,
5167,
133,
14487,
1203,
19,
13,
7760,
800,
3726,
3726,
31,
589,
2936,
12861,
625,
721,
8438,
15,
17,
59,
50,
5784,
13,
5,
1473,
546,
279,
1018,
6,
15,
31,
376,
14,
12861,
20,
174,
57,
4155,
7754,
362,
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... |
Copy/Paste Controls
===
I recently got asked to add Copy/Paste functionality...sounded like a simple request; then after sitting down with the users requesting the change, I came to realize that they wanted to be able to Copy/Paste across a window indescriminately, eg. they want to be able to copy and paste actual labels, current contents of combo boxes, listviews, etcetera, and do so by dragging the mouse across (not selecting each text box and other controls individually). This natively I'm aware is not possible in WPF, but, I have looked around and found some interesting implementations where people came up with things that kinda sorta worked. I was wondering if anyone had seen anything similar that was working well and in this manner.
What I did to temporarily bandaid the problem was something like the following (I ommited a lot for sake of being brief:
XpsDocument xpsd = new XpsDocument("C:\\CopyPaste.xps", FileAccess.ReadWrite);
System.Windows.Xps.XpsDocumentWriter xw = XpsDocument.CreateXpsDocumentWriter(xpsd);
xw.Write(this.gr);
XpsViewer xps = new XpsViewer(xpsd);
xps.ShowDialog();
Basically I'm just taking an XPS document and writing my entire window into it...then I have another window with a document viewer that I'm displaying the XPS in. It actually works rather welll in terms of displaying the controls and making them all copy/paste-able but, when you try and copy/paste them into say a word document, the formatting goes to hell in a handbasket, and not in a usable way either - it ends up totally unordered, poorly spaced, etc.
So here's my question (sorry for the long lead-up) - is there a simple way to just get the text portions of each control and maintain their layout, ie. is there a library I just didn't see, or some other simple method of dealing with copying and pasting of controls. I want to avoid recreating every single one of my windows in a FixedDocument just to display it in a copy/paste-able format (I have a LOT of windows). If the answer is no, is there a way when copying/pasting out of an XPS that I can maintain the format?
Thank you!
Aj
| 0 | [
2,
4344,
118,
19802,
62,
8671,
800,
3726,
3726,
31,
1989,
330,
411,
20,
3547,
4344,
118,
19802,
62,
18548,
9,
9,
9,
8489,
69,
101,
21,
1935,
3772,
73,
94,
75,
1805,
125,
29,
14,
3878,
20033,
14,
753,
15,
31,
281,
20,
4007,
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... |
Examining the Android View Hierarchy at Runtime in Debug mode?
===
I'm in an activity and I can't find a particular view. ie findViewById(R.layout.someId) is returning null. So I would just like to see for the current activity what the actual view hierarchy is at runtime. How can I do this? | 0 | [
2,
14470,
14,
13005,
1418,
14417,
35,
485,
891,
19,
121,
16254,
3740,
60,
800,
3726,
3726,
31,
22,
79,
19,
40,
2358,
17,
31,
92,
22,
38,
477,
21,
1498,
1418,
9,
13,
660,
477,
4725,
779,
1340,
5,
139,
9,
4414,
1320,
9,
3220,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Objective-C calls from Javascript
===
I'm trying to write some bridge between Javascript, which is called from UIWebView, and Objective-C calls. I find a lot of quiestions like that, and all of them saying that I should catch Javascript calls in
-(BOOL) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
ok, it's easy (and only?) way to do this, so I'm looking to that direction.
All answers to these quiestions say "parse url from webView and then with help of if-else send a message to Objective-C class". I have more than 10 functions in Javascript, so I don't want to parse them manually (these functions will have arrays of js objects as parameters and so on).
So the question is: are there any light libraries or opensource projects to convert/unconvert obj-C selectors and parameters into/from strings? (I am not so familiar with Javascript, but I think that do the same thing in much easy than in obj-C, so the main question is about obj-C)
PS I've found QuickConnectOC library, but I'm not sure if I can use it
PPS I think it is not difficult to write my own parser... but I don't want to reinvent wheel | 0 | [
2,
7038,
8,
150,
3029,
37,
8247,
8741,
800,
3726,
3726,
31,
22,
79,
749,
20,
2757,
109,
955,
128,
8247,
8741,
15,
56,
25,
227,
37,
13,
5661,
14113,
4725,
15,
17,
7038,
8,
150,
3029,
9,
31,
477,
21,
865,
16,
9153,
1430,
5757,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 can cause a GPIB to be unresponsive
===
I have a GPIB device that I'm communicating with using a National Instruments USB to GPIB. the USB to GPIB works great.
I am wondering what can cause a GPIB device to be unresponsive? If I Turn off the device and turn it back on it will respond, but when I run my program it will respond at first. It then cuts off I can't even communicate with the GPIB device it just times out.
Did I fill up the buffer?
| 0 | [
2,
98,
92,
1679,
21,
10538,
4598,
20,
44,
367,
22153,
800,
3726,
3726,
31,
57,
21,
10538,
4598,
3646,
30,
31,
22,
79,
23284,
29,
568,
21,
152,
4507,
182,
220,
20,
10538,
4598,
9,
14,
182,
220,
20,
10538,
4598,
693,
374,
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... |
CMake - dependencies (headers) between apps/libraries in same project
===
I have the following project structure:
- CMakeLists.txt
- lib1/CMakeLists.txt and all cpp and header files of the lib
- lib2/CMakeLists.txt and all cpp and header files of the lib
- app/CMakeLists.txt and all cpp and header files of the app
The main CMakeLists.txt looks like:
PROJECT( ${PROJECT_NAME} )
add_subdirectory(lib1)
add_subdirectory(lib2)
add_subdirectory(app)
The lib1/CMakeLists.txt looks eg like (stripped):
SET(SOURCE
file.cpp
)
SET(HEADERS
some_lib_header.h
)
add_library( lib1 ${SOURCE} ${HEADERS} )
and the one for the app looks the same except of ADD_EXECUTABLE:
SET(SOURCE
main.cpp
)
SET(HEADERS
some_header.h
)
add_library( lib1 ${SOURCE} ${HEADERS} )
ADD_EXECUTABLE( app ${SOURCE} ${HEADERS} )
I found the setup working well this way because out of this, I can generate one Visual Studio solution file which contains all those three projects. But my problem is that my app includes header files of lib1 (and also of lib2, which depends on lib1). When I do
$mkdir build
$cd build
$cmake -C ..\myproject
it generates out-of-source VS .sln file as I want it, but the app doesn't compile because it can't find the header files of lib1 (obviously).
Now I read and tried many things, like `TARGET_LINK_LIBRARIES( app lib1 )` (which got the app to link with the lib1, but not solve the header include issue), and things like `add_subdirectory( ../lib1 )` in various variants in the CMakeLists.txt of app (which all throwed errors that I couldn't fix), and also find_package (which I guess is the wrong approach).
So how can I solve this (I guess simple...) problem? | 0 | [
2,
272,
11115,
13,
8,
29411,
13,
5,
1743,
445,
6,
128,
4865,
18,
118,
1210,
2559,
2829,
19,
205,
669,
800,
3726,
3726,
31,
57,
14,
249,
669,
1411,
45,
13,
8,
272,
11115,
5739,
18,
9,
38,
396,
38,
13,
8,
13,
8326,
8197,
150,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Caching Strategy for a Deep, Traversable Egocentric Graph
===
**Firstly, let me explain what I'm building:**
- I have a D3.js Force Layout graph which is rooted at the center, and has a bunch of nodes spread around it. The center node is an Entity of some sort, the nodes around it are other Entities which are somehow related to the root. The edges are the actual relations (i.e. how the two are related).
- The outer nodes can be clicked to center the target Entity and load its relations
- This graph is "Egocentric" in the sense that every time a node is clicked, it becomes the center, and only relations *directly* involved with itself are displayed.
**My Setup, in case any of it matters:**
- I'm serving an API through Node.js, which translates requests into queries to a CouchDB server with huge data sets.
- D3.js is used for layout, and aside from jQuery and Bootstrap, I'm not using any other client-side libraries. If any would help with this caching task, I'm open to suggestions :)
**My Ideas:**
- I could easily grab a few levels of the graph each time (recurse through the process of listing and expanding children a few times) but since clicking on any given node loads completely unrelated data, it is not guaranteed to yield a high percentage of the similar data as was loaded for the root. This seems like a complete waste, and actually a step in the *opposite* direction -- I'd end up doing *more* processing this way!
- I can easily maintain a hash table of Entities that have already been retrieved, and check the list before requesting data for that entity from the server. I'll probably end up doing this regardless of the cache strategy I implement, since it's a really simple way of reducing queries.
**Now, how do you suggest I cache this data?**
Is there any super-effective strategy you can think of for doing this kind of caching? Both server-and-client-side options are greatly welcomed. A *ton* of data is involved in this process, and any reduction of querying/processing puts me miles ahead of the game.
Thanks! | 0 | [
2,
1658,
7192,
4427,
26,
21,
855,
15,
19501,
579,
12784,
20829,
7210,
800,
3726,
3726,
13,
1409,
3552,
102,
15,
408,
55,
3271,
98,
31,
22,
79,
353,
45,
1409,
13,
8,
31,
57,
21,
13,
43,
240,
9,
728,
18,
558,
9106,
7210,
56,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
django-crm install
===
I am trying to install django-crm. I am using pip to install it:
pip install django-crm
I am getting:
Downloading/unpacking django-crm
Could not find any downloads that satisfy the requirements django-crm
No distributions at all found for django-crm
Storing complete log in C:\users\User\AppData\Roaming\pip\pip.log
Can anyone help me out? How do I install django-crm? Is there anywhere I can see a demo of it instead of installing it myself?
Thanks!! | 0 | [
2,
3857,
14541,
8,
6711,
79,
16146,
800,
3726,
3726,
31,
589,
749,
20,
16146,
3857,
14541,
8,
6711,
79,
9,
31,
589,
568,
11280,
20,
16146,
32,
45,
11280,
16146,
3857,
14541,
8,
6711,
79,
31,
589,
1017,
45,
7121,
68,
118,
1020,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I prevent keyboard events in a WPF dialog box from bleeding through to the MFC application which invoked it?
===
We have a legacy MFC application which we are extending with new WPF views and dialog boxes. I am trying to implement F1 help in a WPF dialog box that gets invoked from the MFC main window.
Initially I added a KeyBinding to the WPF dialog for F1, and had it fire a command that runs HtmlHelp; something like this:
<Window.Resources>
<command:CommandReference x:Key="ShowF1Help" Command="{Binding ShowHelpCommand}"/>
</Window.Resources>
<Window.InputBindings>
<KeyBinding x:Name="ShowHelp" Gesture="F1" Command="{StaticResource ShowF1Help}"/>
</Window.InputBindings>
This brought up Help, but unfortunately the keyboard event was *also* picked up by the MFC window; even thought the WPF dialog was modally displayed on top of it, the MFC window still received F1 and so it launched HtmlHelp a second time, showing its own topic.
I searched for a way to mark the event as handled within the XAML/KeyBinding element but had no luck. So I tried to brute-force it and replaced that with a KeyDown handler in the code-behind, marking the event as handled, like this:
private void WindowKeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.F1)
{
MyDialogVM.ShowContextSensitiveHelp();
e.Handled = true;
}
}
This didn't work; the event still winds up getting handled by the MFC window. I also tried PreviewKeyDown--same results.
I have a feeling that I'm overlooking something obvious, but it sure looks like marking a WPF event as handled only affects WPF code, and the MFC message pump has no knowledge that the managed code has seen or handled a given keyboard event.
Is there a way to prevent keyboard events that are handled in a WPF dialog box from also being seen by the MFC application that invoked the dialog?
Thanks in advance.
| 0 | [
2,
184,
107,
31,
2501,
8896,
963,
19,
21,
619,
7721,
28223,
1649,
37,
10065,
120,
20,
14,
307,
7061,
3010,
56,
26252,
32,
60,
800,
3726,
3726,
95,
57,
21,
7780,
307,
7061,
3010,
56,
95,
50,
8176,
29,
78,
619,
7721,
4146,
17,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How hard is to code against injection/xss? (java, php, .net)
===
Question is not how to do input validation or other preventing methods, but how hard do you think is to use them in java/php/.net to keep your application safe.
I do not have a metric to decide if its hard or not.
Language specific
.net has AntiXSS Library
java has prepared staments
php has htmlentities/htmlspecialcharacter
+ in all you could:
validate input (whitelisting)
escape characters
use least privilage rules
and ESAPI rules.
My idea from experience, is that is not hard in small applications but for bigger application it gets harder unless you sacrifies flexibility. | 4 | [
2,
184,
552,
25,
20,
1797,
149,
13646,
118,
396,
18,
18,
60,
13,
5,
1004,
1385,
15,
13,
26120,
15,
13,
9,
2328,
6,
800,
3726,
3726,
1301,
25,
52,
184,
20,
107,
6367,
27999,
54,
89,
11520,
3195,
15,
47,
184,
552,
107,
42,
277... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Check custom condition on every page with Zend Framework
===
I need to check for a condition on each page I visit on the website.
Basically, the user account's have a time limit, and if the user account has expired I need to redirect them to the renew page, this way they can log in to the system but can only access the renew page.
I could just make a function and call it on every action for every controller, but this doesn't make any sense, I could also do some hacking on bootstrap, but this doesn't seem the right solution also.
How can i do this the right way? Or maybe the bootstrap is the right way? | 0 | [
2,
2631,
5816,
2874,
27,
352,
2478,
29,
10526,
43,
6596,
800,
3726,
3726,
31,
376,
20,
2631,
26,
21,
2874,
27,
206,
2478,
31,
2139,
27,
14,
2271,
9,
11374,
15,
14,
4155,
2176,
22,
18,
57,
21,
85,
4496,
15,
17,
100,
14,
4155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regarding constructors in java
===
I was doing a research in which I have found out that lets suppose I have the below pojo(class) with the following constructors..
public class Triangle implements Shape
{
public String type;
public String height;
public Triangle(String type) {
super();
this.type = type;
}
public Triangle(String height) {
super();
this.height = height;
}
public Triangle(String type, String height) {
super();
this.type = type;
this.height = height;
}
It gives me the compile time error but if change height to int then all the things works fine , below is the change piece of code...
public class Triangle implements Shape
{
public String type;
public int height;
public Triangle(String type) {
super();
this.type = type;
}
public Triangle(int height) {
super();
this.height = height;
}
public Triangle(String type, int height) {
super();
this.type = type;
this.height = height;
}
Now the query is that Suppose I want String as Height which was my first case then why it was failing please explain.
| 0 | [
2,
3467,
6960,
248,
18,
19,
8247,
800,
3726,
3726,
31,
23,
845,
21,
527,
19,
56,
31,
57,
216,
70,
30,
6884,
5787,
31,
57,
14,
1021,
2353,
1636,
5,
1898,
6,
29,
14,
249,
6960,
248,
18,
9,
9,
317,
718,
8676,
8713,
18,
2539,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unknown Action exception : Routing Error in Rails 3.1
===
I have the following two lines in default routes
match '/:controller/:action'
match '/*path' , :to => 'map#catch_all'
So the issue is, when user hit the valid controller and invalid action name like **/user/aaaa** then got and exception of "Unknown action" because the route got catched by the first line of above mentioned routes.
I can't change the order of the above lines either.
Any help??
All comments are appreciated. Thanks in Advance. | 0 | [
2,
2562,
1028,
5391,
13,
45,
19880,
7019,
19,
2240,
18,
203,
9,
165,
800,
3726,
3726,
31,
57,
14,
249,
81,
1560,
19,
12838,
5050,
730,
13,
22,
118,
45,
12898,
1252,
118,
45,
8645,
22,
730,
13,
22,
118,
2483,
8353,
22,
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... |
Tutorial on Compass Docs
===
The Compass [docs][1] are really confusing to me. I need a tutorial on how to read them. Does anyone know of a good one out there? When Google help, I just get a bunch of slightly related stackoverflow.com and compass-lang.com results.
[1]: http://compass-style.org/reference/compass/ | 0 | [
2,
29724,
27,
18879,
9765,
18,
800,
3726,
3726,
14,
18879,
636,
13799,
18,
500,
2558,
165,
500,
50,
510,
18084,
20,
55,
9,
31,
376,
21,
29724,
27,
184,
20,
1302,
105,
9,
630,
1276,
143,
16,
21,
254,
53,
70,
80,
60,
76,
8144,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 facebook window height from iframe?
===
I want to get facebook window height using javascript from my iframe. However window.innerHeight gives me the height of the iframe. How can I solve this problem ? | 0 | [
2,
184,
92,
31,
164,
9090,
1463,
2947,
37,
31,
8361,
60,
800,
3726,
3726,
31,
259,
20,
164,
9090,
1463,
2947,
568,
8247,
8741,
37,
51,
31,
8361,
9,
207,
1463,
9,
18005,
252,
7748,
2352,
55,
14,
2947,
16,
14,
31,
8361,
9,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Table-like Dynamicly Created Data Structure
===
I want to read in the contents of a CSV file into some kind of table-like data structure. I need a data structure capable of adapting to any number of columns of fundamental data types (ie. string, int, float). I already have code that reads in values as strings from a file and I'm pretty sure I can design some logic to easily identify each datatype for conversion to strong types (for my purposes anyway). For instance:
Name, Age, Sex
"John",34,M
"Jill",27,F etc..
becomes:
string, uint, enum
Should I try to create a struct or class with these unique fields (perhaps using Reflection) and then try to store these in a List? How would this be done?
I'm expecting that there will be many thousands of rows of data. I will be accessing the data one row at a time normally in a sequential fashion in memory.
I know that [File Helpers](http://filehelpers.sourceforge.net/) can do this sort of thing but I'm wondering how I might do it in my own code. | 0 | [
2,
859,
8,
1403,
7782,
102,
679,
1054,
1411,
800,
3726,
3726,
31,
259,
20,
1302,
19,
14,
8478,
16,
21,
272,
18,
710,
3893,
77,
109,
825,
16,
859,
8,
1403,
1054,
1411,
9,
31,
376,
21,
1054,
1411,
3868,
16,
26741,
20,
186,
234,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to get ip address of systems connected to a network?
===
How can I get the IP address and Name of the Systems connected to same network that can be a wifi network or LAN ? Also Is there any way of retrieving the IP address of systems connected to a same network from command prompt using their name ? | 2 | [
2,
184,
20,
164,
15735,
3218,
16,
1242,
2587,
20,
21,
982,
60,
800,
3726,
3726,
184,
92,
31,
164,
14,
15735,
3218,
17,
204,
16,
14,
1242,
2587,
20,
205,
982,
30,
92,
44,
21,
4807,
1707,
982,
54,
6178,
13,
60,
67,
25,
80,
186... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ajax_page loader plugin wordpress
===
How do I use WP functions from AJAX calls.I have the same query as someone posted the question
[Wordpress ajax plugin][1]
Here its suggested to use ajax_page_loader plugin.
I downloaded the plugin ,installed it and activated..
Now i have no idea what to do next to dynamically load pages and subpages on click.
my wordpress site should some what look like
[This][2]
Can anyone help me regarding same?
Thanks in advance...:)
[1]: http://stackoverflow.com/questions/2618422/using-ajax-to-load-wordpress-pages
[2]: http://stackoverflow.com/questions/11430123/wordpress-subpages | 0 | [
2,
20624,
1,
6486,
6305,
106,
10922,
108,
833,
5890,
800,
3726,
3726,
184,
107,
31,
275,
13,
13790,
3719,
37,
20624,
3029,
9,
49,
57,
14,
205,
25597,
28,
737,
6054,
14,
1301,
636,
9587,
5890,
20624,
10922,
108,
500,
2558,
165,
500... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GNU Make to list modifed source files since last invoke of make?
===
Can make print out the list of source files only which has been changed since the last invoke of make? | 0 | [
2,
26092,
233,
20,
968,
7226,
821,
69,
1267,
6488,
179,
236,
28371,
16,
233,
60,
800,
3726,
3726,
92,
233,
4793,
70,
14,
968,
16,
1267,
6488,
104,
56,
63,
74,
1015,
179,
14,
236,
28371,
16,
233,
60,
3,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
for how long can a background service run on Android and iOS
===
Is the background serice limited to 10 minutes, or could it run for hours? And is there any way the user can shut down the background service while it is running? | 0 | [
2,
26,
184,
175,
92,
21,
2395,
365,
485,
27,
13005,
17,
13,
7760,
800,
3726,
3726,
25,
14,
2395,
4245,
3568,
1317,
20,
332,
902,
15,
54,
110,
32,
485,
26,
974,
60,
17,
25,
80,
186,
161,
14,
4155,
92,
2218,
125,
14,
2395,
365... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
UITableView duplicate row's
===
This is the code im using in the 'cellForRowAtIndexPath'
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString* cellIdentifier = @"OBBirthControlMethodsTableCell";
OBCustomDetailCell *cell = (OBCustomDetailCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
NSLog(@"cell id - %@",cell.subviews);
CGRect frame = [tableView rectForRowAtIndexPath:0];
if(nil == cell)
{
cell = [[[OBCustomDetailCell alloc]
initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
if (indexPath.row != 3)
{
//Setting the basic template
UIView *template = [[UIView alloc] init];
template.tag = indexPath.row+10;
NSLog(@"path index = %d",indexPath.row);
UIImageView *templateImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0,
200,
frame.size.height)];
UILabel *templateLabel = [[UILabel alloc] initWithFrame:CGRectMake(templateImage.frame.size.width+20,
0,
cell.frame.size.width - templateImage.frame.size.width+20,
frame.size.height)];
[template addSubview:templateImage];
[template addSubview:templateLabel];
[cell.contentView addSubview:template];
}
}
UIView *templateView = [cell.contentView viewWithTag:indexPath.row + 10];
if (templateView)
{
NSLog(@"Gotten a templateView object");
if (indexPath.row == 0)
{
templateView.frame = frame;
for (UIView *view in templateView.subviews)
{
if ([view isKindOfClass:[UIImageView class]])
{
[(UIImageView *)view setImage:[UIImage imageNamed:@"baby.jpeg"]];
}
else if ([view isKindOfClass:[UILabel class]])
{
[(UILabel *)view setText:@"This is not working"];
}
}
}
else
{
templateView.frame = CGRectMake(0, 50,
frame.size.width,
frame.size.height);
}
}
return cell;
}
But the issue is that the new cell is giving me the same values os the old cell the new cell that is dequeued once you scroll down .. | 0 | [
2,
13,
11193,
579,
4725,
19429,
3131,
22,
18,
800,
3726,
3726,
48,
25,
14,
1797,
797,
568,
19,
14,
13,
22,
9725,
1106,
5417,
721,
25671,
8353,
22,
13,
8,
13,
5,
11193,
579,
4725,
9725,
1637,
6,
5924,
4725,
45,
5,
11193,
579,
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... |
RESTful way implementing an connection control
===
I am implementing a software updating server by REST web service. It is designed to get an client upgrade "instructions" (not the file itself) by GET request to resource
/clients/{clientId}/upgrades?completed=false
Clients are designed to polls the resource in a 30 minutes interval. The resource returns status code 404 when no upgrades available and return the upgrade instructions if available. When a client upgrading is completed, client will report to server by a PUT request to
/clients/{clientId}/upgrades/{upgradeId}
with some status change.
Now, an upgrade connection control from server-side is needed, i.e., a maximum simultaneously upgrade connection limit.
I can add a field of "upgrading" status indicator to upgrade resources, change the indicator when /clients/{clientId}/upgrades is accessed, and calculating a "count of upgrades with upgrading==true" to find the connection number. Then return status code 404 to client if connection number limit is exceed. However, it do breaks the stateless principle of REST web service.
Any idea is welcomed. Thanks in advance.
| 0 | [
2,
760,
1566,
161,
17333,
40,
2760,
569,
800,
3726,
3726,
31,
589,
17333,
21,
2306,
71,
43,
1880,
8128,
34,
760,
2741,
365,
9,
32,
25,
1006,
20,
164,
40,
6819,
9483,
13,
7,
108,
10346,
5757,
7,
13,
5,
1270,
14,
3893,
1145,
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... |
Open new window, then in new window
===
Is there any way possible to make a button that would open a new resizable window on the same page, or a pop up?
I need the pop up or the new window to alternate through urls at seperate time intervals.
Example:
[BUTTON] < I click button
Boom, a new window pops up with "mywebsite.com/blog1.php".
It stays at blog1.php for let's say 5 seconds, then it alternates to another url and after 5 more seconds it alternates to a different url.
Can i also make it so even if the page had a page redirect on page load it would stay on the specified url?
Is there also any code i can use that would check if they visited a url of mine or add a variable so i can add a # to their score for every url they visit
| 1 | [
2,
368,
78,
1463,
15,
94,
19,
78,
1463,
800,
3726,
3726,
25,
80,
186,
161,
938,
20,
233,
21,
5167,
30,
83,
368,
21,
78,
10719,
3186,
579,
1463,
27,
14,
205,
2478,
15,
54,
21,
1675,
71,
60,
31,
376,
14,
1675,
71,
54,
14,
78... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
error while importing excel file into database
===
I am importing excel file to my database. While importing i get the error
***You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 999, , , 2009-02-03, 9, 133, 2, 0, 0, 0, 3, 1, 1, 1, 04/02/2009, 40816.0460995,' at line 1***
I did a echo for query and it is proper. But when i try to insert this into database, i get this error. Here is my database structure
CREATE TABLE `product` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`model` varchar(64) COLLATE utf8_bin NOT NULL,
`sku` varchar(64) COLLATE utf8_bin NOT NULL,
`upc` varchar(12) COLLATE utf8_bin NOT NULL,
`location` varchar(128) COLLATE utf8_bin NOT NULL,
`quantity` int(4) NOT NULL DEFAULT '0',
`stock_status_id` int(11) NOT NULL,
`image` varchar(255) COLLATE utf8_bin DEFAULT NULL,
`manufacturer_id` int(11) NOT NULL,
`shipping` tinyint(1) NOT NULL DEFAULT '1',
`price` decimal(15,4) NOT NULL DEFAULT '0.0000',
`points` int(8) NOT NULL DEFAULT '0',
`tax_class_id` int(11) NOT NULL,
`date_available` date NOT NULL,
`weight` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`weight_class_id` int(11) NOT NULL DEFAULT '0',
`length` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`width` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`height` decimal(15,8) NOT NULL DEFAULT '0.00000000',
`length_class_id` int(11) NOT NULL DEFAULT '0',
`subtract` tinyint(1) NOT NULL DEFAULT '1',
`minimum` int(11) NOT NULL DEFAULT '1',
`sort_order` int(11) NOT NULL DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '0',
`date_added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date_modified` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`viewed` int(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`product_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=50 ;
and code to import and insert into database
<?php
require_once 'reader.php';
$Host = "localhost";
$User = "user";
$Password = "password";
$DBname = "test";
$Link = mysql_connect ($Host, $User, $Password) or die (mysql_error());
mysql_select_db($DBname);
if(isset($_POST['submit']))
{
$filename = $_FILES['uploadedfile']['name'];
$TARGET_PATH = "uploads/";
//$filename = mysql_real_escape_string($filename);
$TARGET_PATH .= $filename;
if (move_uploaded_file($_FILES['uploadedfile']['tmp_name'],$TARGET_PATH))
chmod($TARGET_PATH, 0777);
{
$data = new Spreadsheet_Excel_Reader();
$data->setOutputEncoding('CP1251');
$data->read($TARGET_PATH);
$count=0;
for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) {
if($j==1){
$product_id=$data->sheets[0]['cells'][$i][$j];
}
if($j==2){
$model=$data->sheets[0]['cells'][$i][$j];
}
if($j==3){
$sku=$data->sheets[0]['cells'][$i][$j];
}
if($j==4){
$upc=$data->sheets[0]['cells'][$i][$j];
}
if ($j==5){
$location=$data->sheets[0]['cells'][$i][$j];
}
if ($j==6){
$quantity=$data->sheets[0]['cells'][$i][$j];
}
if ($j==7){
$stock_status_id=$data->sheets[0]['cells'][$i][$j];
}
if ($j==8){
$image=$data->sheets[0]['cells'][$i][$j];
}
if ($j==9){
$manufacturer_id=$data->sheets[0]['cells'][$i][$j];
}
if ($j==10){
$shipping=$data->sheets[0]['cells'][$i][$j];
}
if ($j==11){
$shippingamount=$data->sheets[0]['cells'][$i][$j];
}
if ($j==12){
$price=$data->sheets[0]['cells'][$i][$j];
}
if ($j==13){
$points=$data->sheets[0]['cells'][$i][$j];
}
if ($j==14){
$tax_class_id=$data->sheets[0]['cells'][$i][$j];
}
if ($j==15){
$date_available=$data->sheets[0]['cells'][$i][$j];
}
if ($j==16){
$weight=$data->sheets[0]['cells'][$i][$j];
}
if ($j==17){
$weight_class_id=$data->sheets[0]['cells'][$i][$j];
}
if ($j==18){
$length=$data->sheets[0]['cells'][$i][$j];
}
if ($j==19){
$width=$data->sheets[0]['cells'][$i][$j];
}
if ($j==20){
$height=$data->sheets[0]['cells'][$i][$j];
}
if ($j==21){
$length_class_id=$data->sheets[0]['cells'][$i][$j];
}
if ($j==22){
$subtract=$data->sheets[0]['cells'][$i][$j];
}
if ($j==23){
$minimum=$data->sheets[0]['cells'][$i][$j];
}
if ($j==24){
$sort_order=$data->sheets[0]['cells'][$i][$j];
}
if ($j==25){
$status=$data->sheets[0]['cells'][$i][$j];
}
if ($j==26){
$date_added=$data->sheets[0]['cells'][$i][$j];
}
if ($j==27){
$date_modified=$data->sheets[0]['cells'][$i][$j];
}
if ($j==28){
$viewed=$data->sheets[0]['cells'][$i][$j];
}
}
$count++;
$Query72 ="insert into product (product_id,model,sku,upc,location,quantity,stock_status_id,image, manufacturer_id, shipping, shippingamount, price, points, tax_class_id, date_available, weight, weight_class_id, length, width, height, length_class_id, subtract, minimum, sort_order, status, date_added, date_modified,viewed) values('', '$model', '$sku', '$upc', '$location', $quantity, $stock_status_id, '$image', $manufacturer_id, $shipping, $shippingamount, $price, $points, $tax_class_id, $date_available, $weight, $weight_class_id, $length, $width, $height, $length_class_id, $subtract, $minimum, $sort_order, $status, $date_added, $date_modified, $viewed)";
echo $Query72;
mysql_query ($Query72) or die (mysql_error());
if (mysql_affected_rows() >= 1) {
print("ROW $count - update successful!");} else {print("ROW $count - update failed!");
}
}
}
echo "Updated Successfully";
}
?>
Please help me why am getting this error and how can i resolve it
| 0 | [
2,
7019,
133,
9010,
68,
20700,
3893,
77,
6018,
800,
3726,
3726,
31,
589,
9010,
68,
20700,
3893,
20,
51,
6018,
9,
133,
9010,
68,
31,
164,
14,
7019,
8980,
245,
57,
40,
7019,
19,
154,
4444,
255,
22649,
73,
2631,
14,
5132,
30,
17016... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
pgsql query into variable
===
I am using this output with another script and retrieving it as a include, Is there a way to load the "echo "$row[0],\n";" into a variable where I wont have to do a include?
right now I'm doing a include on my other script.
$conn = pg_pconnect("host=localhost dbname=xsoft user=sx");
if (!$conn) {
echo "An error occured.\n";
exit;
}
$result = pg_query($conn, "SELECT phones.phone FROM phones");
if (!$result) {
echo "An error occured.\n";
exit;
}
while ($row = pg_fetch_row($result)) {
echo "$row[0],\n";
} | 0 | [
2,
13,
9623,
18,
22402,
25597,
77,
7612,
800,
3726,
3726,
31,
589,
568,
48,
5196,
29,
226,
3884,
17,
13,
6239,
3272,
8397,
32,
28,
21,
468,
15,
25,
80,
21,
161,
20,
6305,
14,
13,
7,
62,
2613,
13,
7,
4403,
5417,
2558,
387,
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... |
In a typical login situation, how many pages need to be secured with SSL?
===
For example suppose I have login.html which POSTs username and password to verify.html. Do I need to have login.html under SSL or is just verify.html enough? | 0 | [
2,
19,
21,
3874,
6738,
108,
1858,
15,
184,
151,
4434,
376,
20,
44,
6385,
29,
13,
18,
18,
255,
60,
800,
3726,
3726,
26,
823,
5787,
31,
57,
6738,
108,
9,
15895,
56,
9868,
4155,
7259,
17,
20884,
20,
21012,
9,
15895,
9,
107,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there any API to donate money by iTunes account?
===
I am preparing an App for charity on iOS. PayPal is my first choice.
I cannot assume all users have Paypal but I am sure all of them have iTunes account.
Can I let user donate to charity by entering iTune account username and password?
Apple support [Red Cross donation for Japan quake][1].Has Apple open this kind of API?
[1]: http://www.tuaw.com/2011/03/13/apple-now-accepts-donations-to-red-cross-japan-relief-fund-via-i/ | 0 | [
2,
25,
80,
186,
21,
2159,
20,
18377,
875,
34,
12952,
2176,
60,
800,
3726,
3726,
31,
589,
7575,
40,
4865,
26,
4902,
27,
13,
7760,
9,
1372,
6720,
25,
51,
64,
1837,
9,
31,
1967,
7158,
65,
3878,
57,
1372,
6720,
47,
31,
589,
562,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In JMS asynchronous message handling as soon as onMessage() is called, message deleted from queue
===
**Requirement:** I want messages to be persist in queue till onMessage() executed successfully. If any exception occur during execution of onMessage() and if it is not handle then message should be redelivered to listener.
I am having Glassfish v2 as a application server. I am using OpenMQConnectionFactory and JmsTemplate to send message on queue.
**Please note that I am not using MDB.**
<bean id="openMQConnectionFactory"
class="com.is.br.util.OpenMqConnectionFactoryBean">
<property name="imqAddressList" value="mq://localhost:7676" />
<property name="imqDefaultUsername" value="admin" />
<property name="imqDefaultPassword" value="admin" />
</bean>
I tried AUTO_ACKNOWLEDGE as acknowledge mode but in listener when exception thrown message is not redelivered.
**MessageProducer.java**
public void sendMessage(final String responseStream) {
System.out.println("Enter into IsJmsProducer.sendMessage method");
try {
MessageCreator creator = new MessageCreator() {
public Message createMessage(Session session) {
ObjectMessage message = null;
try {
message = session.createObjectMessage(responseStream);
} catch (Exception e) {
System.out.println("Unable create a JMSMessage");
}
return message;
}
};
System.out.println("Sending message to destination: " + this.destination.toString());
this.jmsTemplate.setSessionAcknowledgeMode(Session.AUTO_ACKNOWLEDGE);
this.jmsTemplate.send(this.destination, creator);
System.out.println("SendMessage to queue successfully.");
} catch (Exception ex) {
System.out.println("SendMessage to queue Fail." + ex);
}
System.out.println("Exit from IsJmsProducer.sendMessage method");
}
**SampleJMSConsumer.java**
public class SampleJMSConsumer implements MessageListener {
@Override
public void onMessage(Message message) {
throw new RuntimeException();
}
Then I tried with **this.jmsTemplate.setSessionAcknowledgeMode(Session.CLIENT_ACKNOWLEDGE);** and in listener I called message.acknowledge(); and in catch block I called **session.recover()** still message is not redeliver.
**SampleJMSConsumer.java**
public class SampleJMSConsumer implements MessageListener {
@Override
public void onMessage(Message message) {
ObjectMessage objectMessage = (ObjectMessage) message;
Object object;
try {
object = objectMessage.getObject();
if (object instanceof String) {
System.out.println("Message received - " + object.toString());
throw new JMSException("JMS exception");
}
message.acknowledge();
} catch (JMSException e) {
session.recover();
}
}
When I run the program in debug mode and I send message on queue in broker admin console I am able to see the number of messages but as soon as onMessage() called number of messages get reduce by one. That means message is consumed and deleted from queue. Is that message consider as "delivered"?
Please help me to understand why message is not redeliver when exception occur?
Thanks in advance. | 0 | [
2,
19,
487,
79,
18,
21,
16023,
1291,
2802,
7988,
28,
651,
28,
27,
3845,
18,
1303,
5,
6,
25,
227,
15,
2802,
19584,
37,
22521,
800,
3726,
3726,
13,
1409,
99,
3003,
99,
1130,
45,
1409,
31,
259,
7561,
20,
44,
22084,
19,
22521,
392... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Will MVC framework help me clean my web pages?
===
I am new to web development and have been working on my first web project using Java/JSP for some time now. For this project I decided to (probably, naively) not to use any web framework and implemented a loose MVC type framework of my own in which some JSPs call the FrontController and other use the Java beans directly. After a few code iterations, my JSP code has turned into something like this - https://gist.github.com/3118742
Can some expert please let me know - <br/>
**1)** Is the level of Java/JSP/HTML code mixup as shown in this GIST normal or is it bad?<br/>
**2)** If I use an MVC framework such as Spring MVC or Grails or Apache Wicket will that help me clean up this mess and separate the Java code from HTML pages?
Thanks in advance for your help.
Cheers
| 4 | [
2,
129,
307,
8990,
6596,
448,
55,
2745,
51,
2741,
4434,
60,
800,
3726,
3726,
31,
589,
78,
20,
2741,
522,
17,
57,
74,
638,
27,
51,
64,
2741,
669,
568,
8247,
118,
728,
3401,
26,
109,
85,
130,
9,
26,
48,
669,
31,
868,
20,
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... |
Ext Js - TreeStore not loading data when using ASP.net WCF Service
===
I am trying to build a dynamic tree. I am getting my data from a C# WCF Service. It is returning me JSON data , but data is not reflecting in tree.
I am using EXTJS 4.
.Js Code -
Ext.require([
'Ext.tree.*',
'Ext.data.*',
'Ext.tip.*'
]);
Ext.onReady(function () {
Ext.QuickTips.init();
var store = Ext.create('Ext.data.TreeStore', {
proxy: {
type: 'ajax',
url: 'Services/InfographicsDataService.svc/GetTree'
},
root: {
text: 'Ext JS',
id: 'src',
expanded: true
},
reader: {
type: 'json',
root: 'd'
}
});
// End of store code
var tree = Ext.create('Ext.tree.Panel', {
store: store,
viewConfig: {
plugins: {
ptype: 'treeviewdragdrop'
}
},
renderTo: 'tree-div',
height: 300,
width: 250,
title: 'Files',
useArrows: true
});
// End of tree
});
// End of ready function-
This is the code at my service end-::
[OperationContract]
[WebGet]
public List<TreeNode> GetTree()
{
List<TreeNode> nodes = new List<TreeNode>();
nodes.Add(new TreeNode() { id="src/ModelManager.js", text =
"ModelManager.js" });
nodes.Add(new TreeNode() { id="src/data", text = "data" });
nodes.Add(new TreeNode() { id="src/draw", text = "draw" });
return nodes;
}
Json returned by wcf service--
{"d":[{"__type":"TreeNode:#Infographics.Services.Model","id":"src\/ModelManager.js","leaf":false,"text":"ModelManager.js"}, {"__type":"TreeNode:#Infographics.Services.Model","id":"src\/data","leaf":false,"text":"data"}, {"__type":"TreeNode:#Infographics.Services.Model","id":"src \/draw","leaf":false,"text":"draw"}]
}
Call is going to server and returning the data but not adding nodes in tree
Page is showing just the root Extjs node.
Initially I thought , it is just root property of reader which I need to set to "d" , but there is something more I am missing.
Can somebody help me in finding what is that small mistake I am making ? | 0 | [
2,
1396,
38,
487,
18,
13,
8,
1541,
16828,
52,
12797,
1054,
76,
568,
28,
306,
9,
2328,
11801,
410,
365,
800,
3726,
3726,
31,
589,
749,
20,
1895,
21,
7782,
1541,
9,
31,
589,
1017,
51,
1054,
37,
21,
272,
5910,
11801,
410,
365,
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... |
Make an iOS App Social
===
**Scenario:** Within an iOS app, a user navigates to a product view and makes a "comment" on the product. The comment is stored universally so that all users of the app now view the "comment".
**Question:** Is it necessary to setup a remote database on a server and create an API for communication between the app and the server? Or is there a superior way to accomplish the scenario?
| 0 | [
2,
233,
40,
13,
7760,
4865,
668,
800,
3726,
3726,
13,
1409,
18,
8172,
8756,
45,
1409,
363,
40,
13,
7760,
4865,
15,
21,
4155,
20782,
18,
20,
21,
2374,
1418,
17,
1364,
21,
13,
7,
960,
1130,
7,
27,
14,
2374,
9,
14,
6484,
25,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Codeigniter create associative array from database and use in dropdown
===
I have a database table named `Categories`. I want to create a form dropdown containing all the categories in the db. My solution is to create an associative array and add it in the second parameter of the `form_dropdown()` function. My result is an unwanted multidimensional array.
**Model:**
function list_categories()
{
$user_id = $this->tank_auth->get_user_id();
$this->db->where('user_id', $user_id);
$this->db->order_by("date_created", "desc");
$query = $this->db->get('categories');
return $query;
}
**View:**
//create array
$categories = array();
if ($query->num_rows() > 0)
{
$categories = $query->result_array();
}
//create dropdown
echo form_dropdown('category', $categories, $date_created); //selected value based date created
The code gives a multidimensional array
Array (
[0] => Array ( [cat_id] => 27 [user_id] => 3 [cat_title] => Some Title [status] => 0 [date_created] => 2012-06-22 18:48:14 )
[1] => Array ( [cat_id] => 24 [user_id] => 3 [cat_title] => Title [status] => 0 [date_created] => 2012-06-20 19:37:47 )
[2] => Array ( [cat_id] => 23 [user_id] => 3 [cat_title] => Another Title [status] => 0 [date_created] => 2012-06-20 18:25:45 )
etc...
How can I replace the result above with an Associative Array where the ID key is the category id and value the category title?
Example:
$categories = array(
"23" => "some title",
"14" => "another title",
);
| 0 | [
2,
1797,
9693,
242,
106,
1600,
28,
18,
16325,
3366,
7718,
37,
6018,
17,
275,
19,
2804,
2968,
800,
3726,
3726,
31,
57,
21,
6018,
859,
377,
13,
1,
14375,
1596,
1,
9,
31,
259,
20,
1600,
21,
505,
2804,
2968,
3503,
65,
14,
6422,
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... |
Xmodel Transfer Protocol and Matlab
===
Xmodem file transfer protocol is used to transfer files. Is it possible to read the files that are transferred via xmodem file transfer protocol in matlab?. | 0 | [
2,
993,
13998,
2617,
8494,
17,
4277,
9086,
800,
3726,
3726,
993,
15570,
79,
3893,
2617,
8494,
25,
147,
20,
2617,
6488,
9,
25,
32,
938,
20,
1302,
14,
6488,
30,
50,
2288,
1197,
993,
15570,
79,
3893,
2617,
8494,
19,
4277,
9086,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to show a dialog in an Android app without knowing of the current activity
===
What would be the best way to display a dialog whenever my app receives some sort of notification from the android platform? e.g., orientation or the device language gets changed, etc..
The challenge for me is I don't know how to get the current activity context, so it's hard to use a AlertDialog.
Also, I want to show this dialog only if the app is running in the foreground, so my 2nd question is if there a reliably way to detect if the app is running in the foreground?
Thanks! | 0 | [
2,
184,
20,
298,
21,
28223,
19,
40,
13005,
4865,
366,
2506,
16,
14,
866,
2358,
800,
3726,
3726,
98,
83,
44,
14,
246,
161,
20,
3042,
21,
28223,
6634,
51,
4865,
8359,
109,
2058,
16,
52,
4634,
37,
14,
13005,
2452,
60,
13,
62,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use P12 cert with HTTPWebRequest
===
This is Visual Studio 2010/.Net 4.0/VB.Net
I am trying to use a P12 cert with a HTTPS POST. I imported a certificate file into the Windows store and a P12 was created (not by me, so I'm not sure of the process). In the code, when I don't have the password correct for the P12 I do get an error.
I watch the output with Fiddler and do not see any security information added to my message. When I send the post with soapUI I do see it added. I used winhttpcertcfg.exe to verify that I have the correct credentials for the cert. If I copy the post out of soapUI and send it with my code it works, so it seems - this is a guess - that I'm doing something wrong with the P12 or the way the cert is in the store.
This is my first time working with certs so any help is appreciated.
Greg
Dim request As HttpWebRequest = HttpWebRequest.Create("https://URL")
Dim cred As New NetworkCredential("User Name", "Password", "DOMAIN")
request.Credentials = cred 'CredentialCache.DefaultNetworkCredentials
'I've tried all X509KeyStorageFlags
Dim cert As New X509Certificate2("Full Path to P12 file", "P12 Password", X509KeyStorageFlags.DefaultKeySet)
request.ClientCertificates.Add(cert)
'Not sure if I need this so didn't do anything with it
'request.AuthenticationLevel = Global.System.Net.Security.AuthenticationLevel.MutualAuthRequested
'Dim MyCred As New ServiceModel.Description.ClientCredentials()
Dim postData As String = sPostData.ToString
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
request.ContentType = "text/xml; charset=utf-8"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close() | 0 | [
2,
275,
351,
918,
13,
17580,
29,
7775,
458,
3692,
10351,
800,
3726,
3726,
48,
25,
3458,
1120,
498,
118,
9,
2328,
268,
9,
15928,
20468,
9,
2328,
31,
589,
749,
20,
275,
21,
351,
918,
13,
17580,
29,
21,
7775,
18,
678,
9,
31,
1180... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NSDateFormatter iOS, date pattern
===
I just simply can't figure out how to set NSDateFormatter date format so [formatter dateWithString:] does not return a nil.
The date looks as follows :
> 2008-08-18T14:32:22.1875000+01:00
I tried
formatter setDateFormat:@"yyyy-MM-ddTHH:mm:ss.fffffffzz+GMT"];
Doesn't seem to work :(. Any suggestions, please help. | 0 | [
2,
13,
2172,
8209,
23588,
815,
13,
7760,
15,
1231,
3732,
800,
3726,
3726,
31,
114,
1659,
92,
22,
38,
1465,
70,
184,
20,
309,
13,
2172,
8209,
23588,
815,
1231,
2595,
86,
636,
23588,
815,
1231,
1410,
11130,
45,
500,
630,
52,
788,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
setting dynamic observables with knockoutjs
===
I'm trying to do something like the following:
var viewModel = function() {
var self = this;
$.getJSON("/categories", function(data) {
$.each(data, function(index, cat) {
self[cat] = ko.observable(true);
});
});
}
The data coming in is a json array of category names - I have confirmed in my console log that those are coming through just fine.
In my template though, when I use the "visible: viewModel[catname]" data binding, nothing happens. Not getting any errors though. Any ideas? | 0 | [
2,
2697,
7782,
5122,
10321,
579,
18,
29,
11676,
728,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
107,
301,
101,
14,
249,
45,
4033,
1418,
13998,
800,
1990,
5,
6,
13,
1,
4033,
1119,
800,
48,
73,
5579,
9,
3060,
728,
528,
5,
7,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to update the combo value with the value from server during screen load?
===
I am new to GWT. I am writing a simple GWT program where I have a combo box (an instance of `ValueListBox` ) which lists the numbers from 1 to 12 representing the months in a year. My requirement is to set the current month to the combo on screen load. It works fine if I get the value of the current month from client side and set it to the combo. But, it does not work if I get the value of the current month from server side using RPC and set it to the combo. It always sets the initial value of the variable. In my case, it's zero `(currentMonth = 0 )` irrespective to the value returned from server. Can anyone please help me out how can I achieve this ?
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.text.shared.Renderer;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.ValueListBox;
public class Sample implements EntryPoint {
private int currentMonth = 0;
private final MyServiceAsync service = GWT.create(MyService.class);
public void onModuleLoad() {
setCurrentMonth();
final ValueListBox<Integer> monthCombo = new ValueListBox<Integer>(new Renderer<Integer>() {
@Override
public String render(Integer object) {
return String.valueOf(object);
}
@Override
public void render(Integer object, Appendable appendable) throws IOException {
if (object != null) {
String value = render(object);
appendable.append(value);
}
}
});
monthCombo.setValue(currentMonth);
monthCombo.setAcceptableValues(getMonthList());
RootPanel rootPanel = RootPanel.get();
rootPanel.add(monthCombo);
}
private List<Integer> getMonthList() {
List<Integer> list = new ArrayList<Integer>();
for (int i = 1; i <= 12; i++) {
list.add(i);
}
return list;
}
private void setCurrentMonth() {
service.getCurrentMonth(new AsyncCallback<Integer>() {
@Override
public void onSuccess(Integer month) {
currentMonth = month;
}
@Override
public void onFailure(Throwable caught) {
}
});
}
} | 0 | [
2,
184,
20,
11100,
14,
22621,
1923,
29,
14,
1923,
37,
8128,
112,
2324,
6305,
60,
800,
3726,
3726,
31,
589,
78,
20,
14094,
38,
9,
31,
589,
1174,
21,
1935,
14094,
38,
625,
113,
31,
57,
21,
22621,
1649,
13,
5,
210,
4851,
16,
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... |
Issues with IzPack Install on Ubuntu 12.04
===
I just installed Ubuntu 12.04 on my computer and am trying to get IzPack working correctly to no avail. I've installed IzPack just fine, but setting the JAVA_HOME environment variable is causing problems.
I installed the JDK (I need to compile with IzPack), and am now trying to figure out which path is the correct path for my JAVA_HOME variable.
In /usr/lib/jvm I have the following:
- java-1.6.0-openjdk-amd64
- java-6-openjdk-common
- java-6-openjdk-amd64
- java-7-openjdk-amd64
My question is, what is the difference between these and which one is suppose to be my JAVA_HOME? Additionally, I've tried to set every single one of these to JAVA_HOME and when I try to compile with IzPack I get this error message:
**Warning: JAVA_HOME environment variable is not set.
If build fails because sun.* classes could not be found
you will need to set the JAVA_HOME environment variable
to the installation directory of java.**
Also, the IzPack website says I need to set the following variables as well, if anyone could help me to find the correct paths for the following that would be great. Thanks!
- export JAVA_HOME=/usr/java/j2sdk1.4.2_06
- export JAVA_JAR=/usr/java/java_jar
- export JRE_HOME=/usr/java/j2sdk1.4.2_06/jre
- export CLASSPATH=/usr/java/j2sdk1.4.2_06/bin
- export PATH=/usr/java/j2sdk1.4.2_06/bin:/usr/java/j2sdk1.4.2_06/jre/bin:$PATH
| 0 | [
2,
1549,
29,
13,
3186,
8573,
16146,
27,
287,
12968,
2473,
390,
9,
3277,
800,
3726,
3726,
31,
114,
4066,
287,
12968,
2473,
390,
9,
3277,
27,
51,
1428,
17,
589,
749,
20,
164,
13,
3186,
8573,
638,
12044,
20,
90,
24240,
9,
31,
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... |
Does Pinging Client PCs every five seconds cause problems?
===
I have a gaming zone where I have 20 client PCs and a server. If I run a script(PHP/VB.NET) from my server that pings client PCs every five seconds to see if they are turned on/off, will it cause any problem to the users who are playing games? Or does it have any negative effect to the performance of the computers I have while they are running?
Thanks in Advance :) | 0 | [
2,
630,
13,
3181,
68,
6819,
5168,
18,
352,
355,
2582,
1679,
1716,
60,
800,
3726,
3726,
31,
57,
21,
10968,
2464,
113,
31,
57,
434,
6819,
5168,
18,
17,
21,
8128,
9,
100,
31,
485,
21,
3884,
5,
26120,
118,
20468,
9,
2328,
6,
37,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Full screen Window in Java wont get Keyboard input using KeyListener or KeyBoardFocusManager
===
I'm having problems with getting my `KeyBoardFocusManger` to work with my full screen `Window`. No matter what it just wont get any keys I type, and no erros are thrown. I've tried `KeyListeners` but after I read [this][1] I changed to a `KeyboardFocusManager` and the same thing still happens. Im really getting desperate, from what I can judge, the `Window` is not getting focus of the keyboard?
here is my main:
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
// Determine if full-screen mode is supported directly
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gs = ge.getDefaultScreenDevice();
if (gs.isFullScreenSupported()) {
Frame frame = new Frame(gs.getDefaultConfiguration());
SpaceInvaderUI spaceInvaderUI = new SpaceInvaderUI(frame);
// Enter full-screen mode
gs.setFullScreenWindow(spaceInvaderUI);
} else {
JOptionPane.showMessageDialog(null, "Does not support full screen!", "Error 0x01", JOptionPane.ERROR_MESSAGE);
System.exit(1);
}
}
});
}
and here is the UI which contains the `KeyBoardFocusManger`, and is added in `addListeners()` method:
class SpaceInvaderUI extends Window {
private JPanel drawingPanel;
private Image background;
private JButton btnExit;
public SpaceInvaderUI(Frame frame) {
super(frame);
try {
background = ImageIO.read(getClass().getResourceAsStream("background.png"));
} catch (Exception ex) {
JOptionPane.showMessageDialog(null, "Could not extract resource: " + ex.getMessage(), "Error 0x02", JOptionPane.ERROR_MESSAGE);
System.exit(2);
}
createWindow();
}
private void createComponents() throws HeadlessException {
drawingPanel = new DrawingPanel(background, this);
btnExit = new JButton("Exit");
}
private void createWindow() {
createComponents();
addListeners();
addComponentsToWindow();
}
private void addComponentsToWindow() {
add(drawingPanel, BorderLayout.CENTER);
add(btnExit, BorderLayout.SOUTH);
}
private void addListeners() {
KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
manager.addKeyEventDispatcher(new MyDispatcher());
btnExit.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
System.exit(0);
}
});
}
private class MyDispatcher implements KeyEventDispatcher {
@Override
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getID() == KeyEvent.KEY_PRESSED) {
System.out.println("pressed");
System.exit(0);
} else if (e.getID() == KeyEvent.KEY_RELEASED) {
System.out.println("released");
System.exit(0);
} else if (e.getID() == KeyEvent.KEY_TYPED) {
System.out.println("Typed");
System.exit(0);
}
return false;
}
}
}
The exit button is just because I got tired of killing my app via taskmanager. Finally here is my panel on which the game will take place and my background is painted on:
public class DrawingPanel extends JPanel {
private final Image background;
private final SpaceInvaderUI invaderUI;
DrawingPanel(Image background, SpaceInvaderUI invaderUI) {
this.background = background;
this.invaderUI = invaderUI;
}
@Override
protected void paintComponent(Graphics grphcs) {
super.paintComponent(grphcs);
grphcs.drawImage(background.getScaledInstance((int) invaderUI.getWidth(), (int) invaderUI.getHeight(), Image.SCALE_SMOOTH), 0, 0, this);
}
}
Thank you in advance.
[1]: http://stackoverflow.com/questions/286727/java-keylistener-for-jframe-is-being-unresponsive | 0 | [
2,
503,
2324,
1463,
19,
8247,
7290,
164,
8896,
6367,
568,
1246,
13891,
106,
54,
8896,
23371,
22256,
800,
3726,
3726,
31,
22,
79,
452,
1716,
29,
1017,
51,
13,
1,
4237,
2806,
23371,
177,
1674,
1,
20,
170,
29,
51,
503,
2324,
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... |
Passing result from an interceptor to the next one in chain
===
Could please anyone suggest a way of doing that ? Let say that I'd wanted to pass the result of interceptorA invoke() method to interceptorB instead of having just the method invocation pass through both of them.
<bean id="personTarget" class="com.mycompany.PersonImpl">
<property name="name" value="Tony"/>
<property name="age" value="51"/>
</bean>
<bean id="interceptorA" class="org.springframework.aop.interceptor.DebugInterceptor"/>
<bean id="interceptorB" class="org.springframework.aop.interceptor.DebugInterceptor"/>
<bean id="person"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces" value="com.mycompany.Person"/>
<property name="target" ref="personTarget"/>
<property name="interceptorNames">
<list>
<value>interceptorA</value>
<value>interceptorB</value>
</list>
</property>
</bean> | 0 | [
2,
2848,
829,
37,
40,
13,
24171,
20,
14,
328,
53,
19,
2858,
800,
3726,
3726,
110,
2247,
1276,
5601,
21,
161,
16,
845,
30,
13,
60,
408,
395,
30,
31,
22,
43,
417,
20,
1477,
14,
829,
16,
13,
24171,
58,
28371,
5,
6,
2109,
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... |
Move android widget to dock
===
Some default widgets like "direct contact dial" are moveable to the system (ics) dock.
How can I create such a widget that is moveable to the dock?
Best regards. | 0 | [
2,
780,
13005,
4807,
43,
3060,
20,
6120,
800,
3726,
3726,
109,
12838,
4807,
43,
3060,
18,
101,
13,
7,
14706,
2203,
11601,
7,
50,
780,
579,
20,
14,
329,
13,
5,
8354,
6,
6120,
9,
184,
92,
31,
1600,
145,
21,
4807,
43,
3060,
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,
0,
0,
0,
0,
0,
0,
0... |
Why are my generated OAuth signatures different to Twitter's?
===
I am writing a script to talk with twitter - everything seems fine apart from generating a correct signature, where I get an access error. However, changing my variables to match those on the twitter documentation comes up with a different result. At the bottom of https://dev.twitter.com/docs/auth/creating-signature, it says:
For example, the output given the base string and signing key given on this page is B6 79 C0 AF 18 F4 E9 C5 87 AB 8E 20 0A CD 4E 48 A9 3F 8C B6
My code produces almost the same thing - just no spaces and lowercase. However when I base64_encode() it, I don't get the same value as in the documentation (`tnnArxj06cWHq44gCs1OSKk/jLY=`), even trying with different case/spacing/etc:
echo base64_encode('B679C0AF18F4E9C587AB8E200ACD4E48A93F8CB6');
echo strtolower(base64_encode('B679C0AF18F4E9C587AB8E200ACD4E48A93F8CB6'));
echo base64_encode('B6 79 C0 AF 18 F4 E9 C5 87 AB 8E 20 0A CD 4E 48 A9 3F 8C B6');
echo base64_encode(strtolower('B6 79 C0 AF 18 F4 E9 C5 87 AB 8E 20 0A CD 4E 48 A9 3F 8C B6'));
Resulting:
QjY3OUMwQUYxOEY0RTlDNTg3QUI4RTIwMEFDRDRFNDhBOTNGOENCNg==
qjy3oumwquyxoey0rtldntg3qui4rtiwmefdrdrfndhbotngoencng==
QjYgNzkgQzAgQUYgMTggRjQgRTkgQzUgODcgQUIgOEUgMjAgMEEgQ0QgNEUgNDggQTkgM0YgOEMgQjY=
YjYgNzkgYzAgYWYgMTggZjQgZTkgYzUgODcgYWIgOGUgMjAgMGEgY2QgNGUgNDggYTkgM2YgOGMgYjY=
Am I missing something obvious here? | 0 | [
2,
483,
50,
51,
6756,
635,
1346,
96,
19506,
421,
20,
10623,
22,
18,
60,
800,
3726,
3726,
31,
589,
1174,
21,
3884,
20,
930,
29,
10623,
13,
8,
796,
2206,
1123,
2629,
37,
13500,
21,
4456,
7810,
15,
113,
31,
164,
40,
1381,
7019,
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... |
Inside the Linux 2.6 Completely Fair Scheduler
===
I was studying about scheduling algorithm of CFS which uses RED-BLACK_TREE data structure on this link http://www.ibm.com/developerworks/linux/library/l-completely-fair-scheduler
My question is :What is the purpose of using red-black-tree in CFS ,why cannot use AVL tree.?
| 0 | [
2,
572,
14,
13024,
172,
9,
379,
1524,
1768,
4345,
139,
800,
3726,
3726,
31,
23,
4493,
88,
23096,
9083,
16,
10084,
18,
56,
2027,
402,
8,
5485,
1,
8101,
1054,
1411,
27,
48,
3508,
7775,
6903,
6483,
9,
4598,
79,
9,
960,
118,
26051,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
tab menu with lable and images and drop down in richfaces 4.1
===
is there any component in rihcfaces or in jsf 2.0 for showing menu similar to tab where we have an icon and lable also dropdown for sub menu list .i tried to find out but not able to find such component. i actually tried h:commandButton with image , which changes on click of button but for some reason its action is not invoking.
here is my code :
<rich:toolbar width="1260px" id="abcd">
<c:forEach var="listMenu" items="#{menuBean.menuList}" >
<rich:dropDownMenu disabled="#{!listMenu.enabled}" >
<f:facet name="label" >
<h:commandButton action="#{listMenu.getMenuAction}" image="#{listMenu.imageName}" value="#{listMenu.menuCaption}" id="#{listMenu.menuCaption}">
<f:ajax render="abcd"
listener="#{menuBean.changeImage}" />
<f:param name="menuCap" value="#{listMenu.imageName}" />
</h:commandButton>
</f:facet>
<c:forEach var="menuItem" items="#{listMenu.menuItems}">
<rich:menuItem value="#{menuItem.menuItemCaption}"
action="#{menuItem.getMenuItemAction}"
disabled="#{!menuItem.enabled}"
label="#{menuItem.menuItemCaption}"
>
</rich:menuItem>
</c:forEach>
</rich:dropDownMenu>
</c:forEach>
</rich:toolbar>
| 0 | [
2,
6523,
11379,
29,
644,
579,
17,
3502,
17,
2804,
125,
19,
2042,
6413,
18,
268,
9,
165,
800,
3726,
3726,
25,
80,
186,
5912,
19,
13,
928,
9469,
6413,
18,
54,
19,
487,
18,
410,
172,
9,
387,
26,
3187,
11379,
835,
20,
6523,
113,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Horizontal Scrolling in a TableViewCell
===
I want to implement horizontal scrolling on each cells of a TableView.
The principe seems simple:
- Create a cell 5 times bigger than a normal one.
- Add 5 subviews of normal size in the cell (or 5 CustomCell).
- Create a UIScrollView of the same size as the cell.
But I really can't make it.
Don't have a single idea on how to do so.
And when I'm trying it does nothing: I must be doing something wrong.
I watch very much tutorials and weither it's double TableView (which I don't want), weither a little part of the code.
So, could you help me with that please ? Guiding me or giving me a premade code.
Thanks in advance. | 0 | [
2,
10095,
13,
28166,
19,
21,
859,
4725,
9725,
800,
3726,
3726,
31,
259,
20,
8713,
10095,
13,
28166,
27,
206,
2934,
16,
21,
859,
4725,
9,
14,
28318,
2206,
1935,
45,
13,
8,
1600,
21,
1667,
331,
436,
6197,
119,
21,
1826,
53,
9,
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... |
PHP Input MS SQL Failed to convert date and/or time from character string
===
I'm running a MSSQL function and returning to PHP and I'm using the function twice in the PHP and writing it away to a MySQL database.
The first time I run the function I'm using $to and $from (I'm well aware it's not pretty, I'm not a php coder by trade...)
$to = date("j M Y", mktime());
$year = date("Y", mktime());
$jan = '1 jan ';
$from = $jan . $year;
I'm then using the following
select * from MISYearToDate('$from', '$to')
and that works absolutely fine.
When I then do the same thing but putting in this week's dates using
$weekstarting = date('j M Y', strtotime('last sunday'))."<br>";
$weekending = date('j M Y', strtotime('next saturday'))."<br>";
and then run
select * from MISYearToDate('$weekstarting', '$weekending')
I'm getting the error
[Microsoft][SQL Server Native Client 11.0][SQL Server]Conversion failed when converting date and/or time from character string. )
$From and $to echo
1 jan 2012
27 Jun 2012
$weekstarting and $weekending echo
24 Jun 2012
30 Jun 2012
So as far as I can tell, there really isn't a difference and I'm pretty damn confused! | 0 | [
2,
13,
26120,
6367,
4235,
4444,
255,
1702,
20,
8406,
1231,
17,
118,
248,
85,
37,
925,
3724,
800,
3726,
3726,
31,
22,
79,
946,
21,
4235,
18,
22402,
1990,
17,
2485,
20,
13,
26120,
17,
31,
22,
79,
568,
14,
1990,
2088,
19,
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... |
find smallest sub segment
===
I have given a Long Sentence and some words(to be searched in the sentence),
i have to find the smallest part of the sentence which contains all the words to be Searched in that Sentence and print that part.
I have tried it,
1. First get all locations(indexes) of all words from the given sentence.
2. then try to find smallest part from these indexes of words.
But i am having problem implementing 2nd part .
So i want some advice for it or if you suggest any other algorithm which can make it fast. | 0 | [
2,
477,
11056,
972,
5631,
800,
3726,
3726,
31,
57,
504,
21,
175,
5123,
17,
109,
715,
5,
262,
44,
9036,
19,
14,
5123,
6,
15,
31,
57,
20,
477,
14,
11056,
141,
16,
14,
5123,
56,
1588,
65,
14,
715,
20,
44,
9036,
19,
30,
5123,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Prevent user from derive from incorrect CRTP base
===
I cannot think about a proper question title to describe the problem. Hopefully the details below explains my problem clear.
Consider the following code
#include <iostream>
template <typename Derived>
class Base
{
public :
void call ()
{
static_cast<Derived *>(this)->call_impl();
}
};
class D1 : public Base<D1>
{
public :
void call_impl ()
{
data_ = 100;
std::cout << data_ << std::endl;
}
private :
int data_;
};
class D2 : public Base<D1> // This is wrong by intension
{
public :
void call_impl ()
{
std::cout << data_ << std::endl;
}
private :
int data_;
};
int main ()
{
D2 d2;
d2.call_impl();
d2.call();
d2.call_impl();
}
It will compile and run though the definition of `D2` is intentionally wrong. The first call `d2.call_impl()` will output some random bits which is expected as `D2::data_` was not initialized. The second and third calls will all output `100` for the `data_`.
I understand why it will compile and run, correct me if I am wrong.
When we make the call `d2.call()`, the call is resolved to `Base<D1>::call`, and that will cast `this` to `D1` and call `D1::call_impl`. Because `D1` is indeed derived form `Base<D1>`, so the cast is fine at compile time.
At run time, after the cast, `this`, while it is truly a `D2` object is treated as if it is `D1`, and the call to `D1::call_impl` will modified the memory bits that are supposed to be `D1::data_`, and output. In this case, these bits happened to be where `D2::data_` are. I think the second `d2.call_impl()` shall also be undefined behavior depending on the C++ implementation.
The point is, this code, while intensionally wrong, will give no sign of error to the user. What I am really doing in my project is that I have a CRTP base class which acts like a dispatch engine. Another class in the library access the CRTP base class' interface, say `call`, and `call` will dispatch to `call_dispatch` which can be base class default implementation or derived class implementation. These all will work fine if the user defined derived class, say `D`, is indeed derived from `Base<D>`. It will raise compile time error if it is derived from `Base<Unrelated>` where `Unrelated` is not derived from `Base<Unrelated>`. But it will not prevent user write code like above.
The user use the library by deriving from the base CRTP class and providing some implementation details. There are certainly other design alternatives that can avoid the problem of incorrect use as above (for example an abstract base class). But let's put them aside for now and just believe me that I need this design because of some reason.
So my question is that, is there any way that I can prevent the user from writing incorrect derived class as see above. That is, if user write an derived implementation class, say `D`, but he derived it from `Base<OtherD>`, then a compile time error shall be raised.
One solution is use `dynamic_cast`. However, that is expansive and even when it works it is a run-time error. | 0 | [
2,
2501,
4155,
37,
20576,
37,
18867,
6186,
13726,
1000,
800,
3726,
3726,
31,
1967,
277,
88,
21,
4119,
1301,
581,
20,
4996,
14,
1448,
9,
13416,
14,
3289,
1021,
7346,
51,
1448,
1207,
9,
3563,
14,
249,
1797,
6926,
22640,
13,
1,
1963,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which method to overwrite for view inside ListView to always get correct size
===
Which method should I override to be guaranteed to always get the correct size of a view?
I tried onSizeChanged and onLayout but it seems to me that when views are recycled inside the listView those methods are not always called.
So is there any better way to be notified of the current view size? | 0 | [
2,
56,
2109,
20,
84,
23716,
26,
1418,
572,
968,
4725,
20,
550,
164,
4456,
1072,
800,
3726,
3726,
56,
2109,
378,
31,
84,
11891,
20,
44,
13572,
20,
550,
164,
14,
4456,
1072,
16,
21,
1418,
60,
31,
794,
27,
10454,
16229,
43,
17,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I improve this thumbnail method to support orientations?
===
I found this piece of code that works quite well to generate a square thumbnail image.
If you want to try it out, it is an extension of the UIImage class.
(You can also make it a normal method but then you need to replace the self calls with your UIImage that you pass it.)
I'd like to know how I can improve this so that it keeps the orientation in the returned UIImage.
Btw, the ratio is actually just the size of the width and height.
- (UIImage *)generateThumbnailWithSize:(float)ratio {
// Create a thumbnail version of the image for the event object.
CGSize size = self.size;
CGSize croppedSize;
CGFloat offsetX = 0.0;
CGFloat offsetY = 0.0;
// check the size of the image, we want to make it
// a square with sides the size of the smallest dimension
if (size.width > size.height) {
offsetX = (size.height - size.width) / 2;
croppedSize = CGSizeMake(size.height, size.height);
} else {
offsetY = (size.width - size.height) / 2;
croppedSize = CGSizeMake(size.width, size.width);
}
// Crop the image before resize
CGRect clippedRect = CGRectMake(offsetX * -1, offsetY * -1, croppedSize.width, croppedSize.height);
CGImageRef imageRef = CGImageCreateWithImageInRect([self CGImage], clippedRect);
// Done cropping
// Resize the image
CGRect rect = CGRectMake(0.0, 0.0, ratio, ratio);
UIGraphicsBeginImageContext(rect.size);
[[UIImage imageWithCGImage:imageRef] drawInRect:rect];
UIImage *thumbnail = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
// Done Resizing
return thumbnail;
} | 0 | [
2,
184,
92,
31,
3545,
48,
5078,
325,
947,
2109,
20,
555,
10245,
18,
60,
800,
3726,
3726,
31,
216,
48,
1855,
16,
1797,
30,
693,
1450,
134,
20,
7920,
21,
735,
5078,
325,
947,
1961,
9,
100,
42,
259,
20,
1131,
32,
70,
15,
32,
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... |
Window Behavior in Flash Catalyst
===
I'm trying to do a little flash site but i'm having some problems.
As you can see it here:
http://alexandracardoso.deviantart.com/gallery/?catpath=scraps#/d56idb3
When i open the right window clicking in the tab on the right, i would like that when i open the left one by clicking in the tab, the right one would close and open the left one.
But i'm unable to do that.
I thought and tried using if statement to help me but it doesn't work.
Someone can help me and say how i can make the behavior of opening one little window make the other one disappear. | 0 | [
2,
1463,
3257,
19,
4433,
17072,
800,
3726,
3726,
31,
22,
79,
749,
20,
107,
21,
265,
4433,
689,
47,
31,
22,
79,
452,
109,
1716,
9,
28,
42,
92,
196,
32,
235,
45,
7775,
6903,
22962,
58,
6648,
11231,
9,
14438,
806,
38,
2900,
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... |
reading a file from last line
===
I would read a file from last line using RandomAccessFile.is it possible or I have to use another class?Beside this file change in the time so the last line doesn't remain last forever.During the reading another java program write on it | 0 | [
2,
1876,
21,
3893,
37,
236,
293,
800,
3726,
3726,
31,
83,
1302,
21,
3893,
37,
236,
293,
568,
5477,
20604,
16877,
9,
403,
32,
938,
54,
31,
57,
20,
275,
226,
718,
60,
863,
1416,
48,
3893,
753,
19,
14,
85,
86,
14,
236,
293,
143... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Using clipboard with Phonegap in Android
===
how could I copy text to clipboard with PhoneGap? I found [this](https://github.com/phonegap/phonegap-plugins/tree/master/Android/ClipboardManager) plugin, but it seems to be outdated.
I tried to create my own plugin, but I get this error:
`Can't create handler inside thread that has not called Looper.prepare() `
I found some answers fixing that error, but I'm not too experienced with Java, and I couldn't fix the code by myself. You can view my code from [here](http://pastebin.com/1eydgdL7), it is just modified version of the ClipboardManager plugin.
I'm using Cordova (PhoneGap) version 1.9.0, and I'm also using jQuery Mobile. | 0 | [
2,
568,
12229,
2806,
29,
1132,
1136,
306,
19,
13005,
800,
3726,
3726,
184,
110,
31,
4344,
1854,
20,
12229,
2806,
29,
1132,
1136,
306,
60,
31,
216,
636,
1565,
500,
5,
21127,
18,
6903,
10404,
20926,
9,
960,
118,
7709,
1136,
306,
118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
-webkit-calc() in Chrome for Mobile
===
I would like to use -webkit-calc() on Chrome for Android, but it doesn't seem to be available
Is that correct?
How do I get information on webkit feature support? | 0 | [
2,
13,
8,
14113,
13703,
8,
16304,
5,
6,
19,
13,
12985,
26,
3241,
800,
3726,
3726,
31,
83,
101,
20,
275,
13,
8,
14113,
13703,
8,
16304,
5,
6,
27,
13,
12985,
26,
13005,
15,
47,
32,
1437,
22,
38,
2260,
20,
44,
904,
25,
30,
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,
0,
0,
0... |
JTextArea.setText(null); does not free the memory
===
I'm using Swing and I have a JFrame containing a few JPanels, and inside one of them there is a JTextArea.
The JTextArea content is set when an user clicks on a certain menu (*ActionListener.actionPerformed(populate())*).
The content is taken from a 30MB text file:
private void populate () {
StringBuilder strB = new StringBuilder();
try {
FileReader fr = new FileReader("file30mb.txt");
BufferedReader br = new BufferedReader(fr);
String strLine;
while ((strLine = br.readLine()) != null) {
strB.append(strLine).append(System.getProperty("line.separator"));
}
fr.close();
br.close();
} catch (IOException e) {
System.err.println(e);
}
jTextArea1.setEditable(false);
jTextArea1.setText(strB.toString());
jTextArea1.setCaretPosition(0);
}
This process takes a lot of memory usage, about 200MB.
There is another menu and when an user clicks on it the JTextArea is cleared (basically it calls a method that does *jTextArea1.setText(null)*). The event is handled the same way of before: *ActionListener.actionPerformed(free())*.
So when the JTextArea is empty I expect that the memory usage is lower than before... But unfortunately it's not true. If I go in the task manager I see the same memory usage of before (about 200MB), but the JTextArea is empty!
What am I missing? | 0 | [
2,
487,
11969,
17760,
9,
3554,
11969,
5,
4215,
211,
6,
73,
630,
52,
551,
14,
1912,
800,
3726,
3726,
31,
22,
79,
568,
5587,
17,
31,
57,
21,
487,
8361,
3503,
21,
310,
487,
3206,
6798,
15,
17,
572,
53,
16,
105,
80,
25,
21,
487,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Place 3D object on virtual space in android
===
I want to place a 3D object in Android, for example 2 meters in front of me in the north direction, so when I look with my camera at that location I will see the object. I have tried LookAR, JPCT, min3D, Junaio and OpenGL directly, but I still don´t know how to do it? I don´t know too much about OpenGL.
Does someone know how to do it or where I can find a good tutorial or example about this????
Thank you very much | 2 | [
2,
209,
203,
43,
3095,
27,
6599,
726,
19,
13005,
800,
3726,
3726,
31,
259,
20,
209,
21,
203,
43,
3095,
19,
13005,
15,
26,
823,
172,
4322,
19,
431,
16,
55,
19,
14,
200,
1400,
15,
86,
76,
31,
361,
29,
51,
3336,
35,
30,
1474,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Scrapy - Parse_item not being called
===
I'm having two main problems
1) The parse_item method is not being called/executed after crawling a page
2) When the "callback='self.parse_item'" is included in the rules, scrapy does not continue to follow the links. Instead, it only follows the links immediately available from the Start Urls.
Here is the code
from scrapy.spider import BaseSpider
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from sheprime.items import SheprimeItem
class HerroomSpider(CrawlSpider):
name = "herroom"
allowed_domains = ["herroom.com"]
start_urls = [
"http://www.herroom.com/simone-perele-12p314-trocadero-sheer-seamless-racerback-bra.shtml",
"http://www.herroom.com/hosiery.aspx",
rules = [
Rule(SgmlLinkExtractor(allow=(r'/[A-Za-z0-9\-]+\.shtml', )), callback='self.parse_item')
]
def parse_item(self, response):
print "some message"
#I have put in this simple parse function, because I just want to get it to work
Thanks for your help,
L | 0 | [
2,
10241,
93,
13,
8,
2017,
870,
1,
2119,
79,
52,
142,
227,
800,
3726,
3726,
31,
22,
79,
452,
81,
407,
1716,
137,
6,
14,
2017,
870,
1,
2119,
79,
2109,
25,
52,
142,
227,
118,
1706,
17194,
1427,
75,
19108,
21,
2478,
172,
6,
76,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Automatically redirect website extensions
===
I'm new to web design, and I have been updating a website recently that was written a while ago. All of the pages currently have a .htm extension, and because I've been using a lot of php in the update and that .htm is just archaic, I've changed all the extensions to .php.
I was wondering if there was a way at the site level to tell the server to redirect all requests for *.htm to *.php, or if I have to keep all the .htm pages and add a javascript redirect to the <head>.
Thanks. | 0 | [
2,
7499,
302,
14706,
2271,
17529,
800,
3726,
3726,
31,
22,
79,
78,
20,
2741,
704,
15,
17,
31,
57,
74,
71,
43,
1880,
21,
2271,
1989,
30,
23,
642,
21,
133,
1464,
9,
65,
16,
14,
4434,
871,
57,
21,
13,
9,
9020,
79,
3896,
15,
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... |
Twisted with queue for CPU-bound tasks
===
I have an HTTP server which does some IO stuff, then does some CPU-bound stuff (PIL) and then replies with data (magnitude of megabyte or so).
(a) My first idea is something like this: a process for server and IO, based on Twisted, and several processes for PIL stuff, with queue.
If this architecture is reasonable, then there probably is a library which does exactly that: multiprocess queue for Twisted. However, I'm not really experienced in Twisted and know nothing of its community so the only thing I found is `ampoule`, for which I found neither docs nor description which would persuade me that it's the right tool for a job.
(b) Another idea is to just run several servers in several threads, with both IO and CPU stuff going in each on of them. This seems stupid because CPU stuff will block, but maybe I'm not really understanding it.
So, questions:
1. Is any of these architectures reasonable?
2. How would you implement it (using `Twisted` + `ampoule` or what?)
3. For (a), how would you send a huge pile of data from "worker" to the server thread? Or maybe I can tell the worker to write into the response directly somehow?
4. How many "workers" are reasonable?
| 0 | [
2,
5308,
29,
22521,
26,
17578,
8,
7410,
8674,
800,
3726,
3726,
31,
57,
40,
7775,
8128,
56,
630,
109,
13,
1963,
3217,
15,
94,
630,
109,
17578,
8,
7410,
3217,
13,
5,
10091,
6,
17,
94,
16287,
29,
1054,
13,
5,
9473,
103,
16731,
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... |
Rails best practice for setting not accesible attributes in model
===
I'm a newbie to Rails, and I was thinking in a good solution to set protected attributes in my models before saving them, but I can't find out a proper way of doing it.
Lets say I have Users, who belong to Companies, and these companies can have many Clients. Before saving a new Client, I want to set its company_id, getting it from the current_user's company_id that is stored in the session (I'm using Devise).
I was thinking about using a model callback, as before_create or whatever, but I then I realized that my Rspec model tests may fail, because there will be no current_user while running them...
Is there a best practice of setting this parameters that have to be set automatically?
Thanks in advance! | 0 | [
2,
2240,
18,
246,
1345,
26,
2697,
52,
7602,
160,
3426,
13422,
19,
1061,
800,
3726,
3726,
31,
22,
79,
21,
78,
5893,
20,
2240,
18,
15,
17,
31,
23,
1440,
19,
21,
254,
4295,
20,
309,
3803,
13422,
19,
51,
2761,
115,
7599,
105,
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... |
What is the process behind upgradation of an app in android. Is it replacement of just the Apk or more?
===
What is the process behind upgradation of an app in android. Is it replacement of just the Apk or is it something else.
Also
1. Is it replacement of just the new Apk file (Like reinstalling) or is it updated.
2. What happens to the database tables which are associated with the older version.
3. What happens to the shared preferences associated with the older version.
Can anyone also let us know a proper way to simulate this operation before we actually launch it in the market.
It is very urgent. Thanks in advance | 0 | [
2,
98,
25,
14,
953,
439,
71,
7691,
857,
16,
40,
4865,
19,
13005,
9,
25,
32,
4610,
16,
114,
14,
21,
17244,
54,
91,
60,
800,
3726,
3726,
98,
25,
14,
953,
439,
71,
7691,
857,
16,
40,
4865,
19,
13005,
9,
25,
32,
4610,
16,
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... |
How to get a click event of an input element that moves when active?
===
My website has input buttons that move 1px when they are ":active".
And, I can't catch the click event in case that I click one's border, because it moves a little away.
Here is an example.
You can't get the click event.
**HTML:**
<input type="button" value="Click Me!">
**CSS:**
input{
width: 100px;
height: 50px;
}
input:active{
position: relative;
top: 50px;
left: 100px;
}
**jQuery:**
$(function() {
$('input').on('click', function() {
alert('You caught me!');
});
});
**DEMO:**
http://jsfiddle.net/duwYv/ | 0 | [
2,
184,
20,
164,
21,
10840,
807,
16,
40,
6367,
4520,
30,
4927,
76,
1348,
60,
800,
3726,
3726,
51,
2271,
63,
6367,
12861,
30,
780,
137,
306,
396,
76,
59,
50,
13,
7,
45,
7889,
7,
9,
17,
15,
31,
92,
22,
38,
2949,
14,
10840,
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... |
aggregate ACE_Sig_Set signalSet has incomplete type and cannot be defined found error while compiling . How to remove this error?
===
I wrote following code using ACE_LIB .
ACE_Sig_Set signalSet;
After compiling i got this error(aggregate ACE_Sig_Set signalSet has incomplete type and cannot be defined) . I have included Log_Msg.h,Reactor.h,Event_Handler.h in my program . So how i can remove this error?
| 0 | [
2,
8544,
7878,
1,
18,
2816,
1,
3554,
2800,
3554,
63,
14011,
1001,
17,
1967,
44,
2811,
216,
7019,
133,
24378,
13,
9,
184,
20,
4681,
48,
7019,
60,
800,
3726,
3726,
31,
738,
249,
1797,
568,
7878,
1,
8326,
13,
9,
7878,
1,
18,
2816... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
rant error using ruby 1.9.3
===
Executing one of the rant examples using ruby 1.9.3 in rant directory I get the following error:
~/.rvm/gems/ruby-1.9.3-p194/gems/rant-0.5.7/doc/examples/directedrule
rant -T (reads the Rantfile that resides in the directory above)
String required as target directory
Does anyone has any idea how to fix this error?
Thanks in advance | 0 | [
2,
13,
7874,
7019,
568,
10811,
137,
9,
518,
9,
240,
800,
3726,
3726,
25836,
53,
16,
14,
13,
7874,
3770,
568,
10811,
137,
9,
518,
9,
240,
19,
13,
7874,
16755,
31,
164,
14,
249,
7019,
45,
13,
1,
118,
9,
10359,
79,
118,
20231,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Swipe to select checkboxes in a web browser
===
Sometimes our forms have a lot of checkboxes in a table column. The user has to go through and check a bunch of them (but not all of them).
Often I think it would be nice if you could just click and drag across the checkboxes, selecting the ones you want with one swipe.
I haven't seen this implemented before. Does anyone have an opinion on the usability of something like this?
Has anyone seen a jquery plugin that could enable this? | 0 | [
2,
27246,
20,
5407,
2631,
5309,
160,
19,
21,
2741,
16495,
800,
3726,
3726,
1030,
318,
1997,
57,
21,
865,
16,
2631,
5309,
160,
19,
21,
859,
4698,
9,
14,
4155,
63,
20,
162,
120,
17,
2631,
21,
7653,
16,
105,
13,
5,
811,
52,
65,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 MVC rendering home page
===
I'm trying to learn mvc design pattern for web applications, so i decide write my own php mvc framework. Before writing this post i read a lot of tutorials, and forums about mvc. Now I pretty well understanding mvc idea, and how comunicate controller-model-view. I have write router and few modules (login, categories, ...) seems it's working.
Now I'm confused a bit:
Now if i call "localhost/LogIn" I get only login form, if I call "localhost/categories" i get category list. Everything ok, but i want create index controller and when call "localhost/index" i want see login form, categories and a lot of more modules
**My quastion:** should i call controllers(login, categories) from indexController.php?
I need advice how to catenate needed modules in one page.
P.S. Sorry for broken english :)
| 0 | [
2,
13,
26120,
307,
8990,
15307,
213,
2478,
800,
3726,
3726,
31,
22,
79,
749,
20,
2484,
307,
8990,
704,
3732,
26,
2741,
3767,
15,
86,
31,
4073,
2757,
51,
258,
13,
26120,
307,
8990,
6596,
9,
115,
1174,
48,
678,
31,
1302,
21,
865,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
tinymce loses caret position
===
I have a tinymce custom button, which toggles an emoticons div beside a textarea.
onclick : function() {
ed.focus();
$('#my-input').toggleClass('with-emoticons');
$('#emoticons').toggleClass('emo-visible');
}
When I click the button, the emoticons div has revealed, but the caret goes from the end to the start of my text.
How can I preserve the carets position while clicking the custom button?
| 0 | [
2,
3228,
79,
1105,
14745,
781,
38,
649,
800,
3726,
3726,
31,
57,
21,
3228,
79,
1105,
5816,
5167,
15,
56,
20,
4572,
1355,
40,
3579,
9440,
4710,
13,
12916,
2113,
21,
1854,
17760,
9,
27,
150,
10129,
13,
45,
1990,
5,
6,
13,
1,
13,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Console Applicaction vs WCF Service Application for WCF project in VS 2010
===
I am currently making my first steps into the world of WCF for the past week or so.
And something keeps popping up on my mind regarding when to use a console app or a WCF Service app in Visual Studio 2010?
Is it all about self hosting or IIS and WAS hosting? The way I got it is that if I am self hosting, a console application is the way to go, since that you would implement the HostService and proxy yourself, whereas in case of IIS or WAS hosting we use a WCF Service Application? where the HostService is dynamically generated? is my understanding regarding this issue correct? or there are more things into it? I feel like some link is missing in here... | 0 | [
2,
8650,
4865,
4663,
8645,
4611,
11801,
410,
365,
3010,
26,
11801,
410,
669,
19,
4611,
498,
800,
3726,
3726,
31,
589,
871,
544,
51,
64,
2382,
77,
14,
126,
16,
11801,
410,
26,
14,
640,
877,
54,
86,
9,
17,
301,
8968,
24157,
71,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 an array from a form posted parameter
===
I post a "select" parameter via a form (and other fields)
My Model needs an ARRAY of the parent_musicstyle parameter, but gets an string.
Where and how do I convert this?
In the View, Controller or Model
Form:
<div class="field">
<%= f.label :parent_musicstyle %>
<%= f.select :parent_musicstyle,
Musicstyle.all.map { |m| [m.musicstyle, m._id] },
{:include_blank => "Select a parent (if needed)", :index => nil } %>
</div>
How can I extract/convert the specific param and convert it to an array? | 0 | [
2,
2936,
40,
7718,
37,
21,
505,
6054,
18906,
800,
3726,
3726,
31,
678,
21,
13,
7,
18,
16964,
7,
18906,
1197,
21,
505,
13,
5,
290,
89,
2861,
6,
51,
1061,
2274,
40,
7718,
16,
14,
4766,
1,
7692,
4381,
18906,
15,
47,
3049,
40,
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... |
How to return a generic type object in a static method
===
i have 2 classes:
public class Super {
public static <T> T bar(Class<T> clazz){
try {
return (T)(clazz.newInstance());
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InstantiationException e) {
e.printStackTrace();
}
return null;
}
}
and
public class Sub extends Super{
public static void main(String[] args){
Sub s = Sub.bar(Sub.class);
}
}
now i don't want to use `Class<T> clazz` as a param of `bar`, so how can i return the generic type `T`, thanks. | 0 | [
2,
184,
20,
788,
21,
12733,
1001,
3095,
19,
21,
12038,
2109,
800,
3726,
3726,
31,
57,
172,
2684,
45,
317,
718,
1026,
13,
1,
317,
12038,
13,
1,
38,
1,
13,
38,
748,
5,
1898,
1,
38,
1,
13,
7232,
5092,
6,
1,
1131,
13,
1,
788,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
where to look for on internet for asynctask.java class
===
where can i find the official asynctask.java class. I found one and included into my package but at a certain line it couldn't find the reference to Process: Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
mWorker = new WorkerRunnable<Params, Result>() {
public Result call() throws Exception {
// error here
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
return doInBackground(mParams);
}
};
| 0 | [
2,
113,
20,
361,
26,
27,
2620,
26,
21,
9507,
20255,
3656,
9,
1004,
1385,
718,
800,
3726,
3726,
113,
92,
31,
477,
14,
989,
21,
9507,
20255,
3656,
9,
1004,
1385,
718,
9,
31,
216,
53,
17,
506,
77,
51,
6030,
47,
35,
21,
1200,
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,
1... |
Spring No unique bean of type
===
i have a little trouble in Spring with two component of a service.
I have this component:
@Component
public class SmartCardWrapper
and this one:
@Component
public class DummySmartCardWrapper extends SmartCardWrapper
The service autowire both but spring fails due this expection:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No unique bean of type [com.cinebot.smartcard.SmartCardWrapper] is defined: expected single matching bean but found 2: [dummySmartCardWrapper, smartCardWrapper]
Why it doesn't use class names? | 0 | [
2,
1573,
90,
2619,
15322,
16,
1001,
800,
3726,
3726,
31,
57,
21,
265,
2572,
19,
1573,
29,
81,
5912,
16,
21,
365,
9,
31,
57,
48,
5912,
45,
13,
1,
11103,
218,
2291,
317,
718,
3978,
6648,
499,
525,
8763,
17,
48,
53,
45,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.