unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Multiple Background Images To Repeat on Y left and Y Right
===
I'm trying to get two images to repeat ( one shadow image on the right, the other on the left) in the background exactly like this site.
So far I am unable to get the CSS code correct:
http://www.elegantthemes.com/preview/Modest/
I examined the code for that site and have the shadow images I wish to use. I tried to duplicate the code that Elegant Themes is using on a WordPress site running Headway:
.right-shadow { background: #ffffff url(images/right-shadow.png) repeat-y top right; }
.left-shadow { background:url(images/left-shadow.png) repeat-y top left; }
but it did not work.
Then I tried:
body {background:#ffffff url(http://website.com/wp-content/uploads/2012/07/right-shadow.png) repeat-y right top;}
This worked for the right shadow image - it appears correctly
Then I tried
body {background:#ffffff url(http://websitebuddha.com/wp-content/uploads/2012/07/left-shadow.png) repeat-y left top;}
This worked for the left shadow image - it appears correctly
Now when I tried and combine the code to display both shadow images along Y left and Y right as such:
body {background:#ffffff url(http://website.com/wp-content/uploads/2012/07/right-shadow.png) repeat-y right top, url(http://website.com/wp-content/uploads/2012/07/left-shadow.png) repeat-y left top;}
It does not work - both images do NOT appear
I also tried this:
body {
background-image: url(http://website.com/wp-content/uploads/2012/07/right-shadow.png), (http://website.com/wp-content/uploads/2012/07/left-shadow.png);
background-repeat: repeat-y right top, repeat-y left top;
}
This also does not work - both images do NOT appear
How can I get this to work exactly as it does with the Modest Theme by Elegant themes?
Thanks for reading. | 0 | [
2,
1886,
2395,
3502,
20,
6830,
27,
13,
93,
225,
17,
13,
93,
193,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
81,
3502,
20,
6830,
13,
5,
53,
3118,
1961,
27,
14,
193,
15,
14,
89,
27,
14,
225,
6,
19,
14,
2395,
1890,
101,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL to return matches from multiple queries
===
I need to return values that appear across two or more queries from the same table. Feeling a bit like a noob here but just can't see the wood for the trees.
I have a table of users assigned to different groups. I need to return only the users that appear in all of the requested groups:
User Group
frank 1
Jane 2
Tom 2
frank 2
Jane 1
Tom 3
This is want I need to output:
Result for Group 1 & 2:
frank
Jane
Result for Group 2 & 3:
Jane
Tom
Seems a very 101 question, but grateful for any pointers.
| 0 | [
2,
4444,
255,
20,
788,
1717,
37,
1886,
9386,
2829,
800,
3726,
3726,
31,
376,
20,
788,
4070,
30,
1893,
464,
81,
54,
91,
9386,
2829,
37,
14,
205,
859,
9,
1249,
21,
1142,
101,
21,
90,
4995,
235,
47,
114,
92,
22,
38,
196,
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... |
Notepad regex multiplying operator
===
How to use multiplying operator in Notepad++ by specifying how many copies it applies to?
The manual tells (and as far as I know it is standard) to use `{n}`. But this doesn't work.<br />
For example, if I have a file containing text 123123. Then `\d{2}` returns "Can't find the text ", but `\d\d` works as expected.
This is very basic and trivial, am I missing something? | 0 | [
2,
1945,
8240,
7953,
1706,
26314,
68,
6022,
800,
3726,
3726,
184,
20,
275,
26314,
68,
6022,
19,
1945,
8240,
20512,
34,
19077,
68,
184,
151,
3298,
32,
13169,
20,
60,
14,
5132,
2609,
13,
5,
290,
28,
463,
28,
31,
143,
32,
25,
1236,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 - TRUE or true difference?
===
I just wondering in PHP i have seen people use both these cases..
if($var===TRUE)
if($var===true)
just wondering of there is a actual difference in them or a coding standard/format to be used in boolean value ?
| 0 | [
2,
13,
26120,
13,
8,
1151,
54,
1151,
2841,
60,
800,
3726,
3726,
31,
114,
5712,
19,
13,
26120,
31,
57,
541,
148,
275,
156,
158,
1871,
9,
9,
100,
5,
4403,
3311,
3726,
3726,
3726,
13398,
6,
100,
5,
4403,
3311,
3726,
3726,
3726,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create an ajax search component for Adobe CQ5
===
I would like to create a search box component, similar to the one that comes out of the box with CQ5. But I'd like it to have the following features:
- AJAX search (this would mean that the entire page wouldn't need to refresh on submit)
- Auto-suggest (I'd like the admin to be able to choose an excel spreadsheet with the auto-suggest words)
- Ability to specify one folder to search (this is already a feature in the existing search)
I was thinking of using a free jquery plugin to provide the ajax and auto-suggest features, but I'm new to CQ5, so still figuring out what's possible.
- Is it a good idea to use a jQuery plugin as a starting point?
- Once I've developed the jQuery, what would I need to do to integrate that into a CQ5 component?
- Before I start, is there some way to download or buy a search component for CQ5 that already has some or all of the above features?
Please forgive my noob questions!
Many thanks,
Katie | 0 | [
2,
184,
20,
1600,
40,
20624,
2122,
5912,
26,
20299,
13,
21980,
264,
800,
3726,
3726,
31,
83,
101,
20,
1600,
21,
2122,
1649,
5912,
15,
835,
20,
14,
53,
30,
1624,
70,
16,
14,
1649,
29,
13,
21980,
264,
9,
47,
31,
22,
43,
101,
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... |
Is it possible to block "external" requests from CSS?
===
I'm trying to develop a web application that would allow users to upload their own css to style the pages it serves, kind of like themes. These themes can be shared among users so I do not want anyone to be able to put references to "external" resources other than to my domain - so they can not harvest IP addresses or serve different content based on who makes the request and so on, it should be completely self-contained in the web app.
In another words, ONLY resources from specified domain should be available for retrieval and no other.
Is there any way to accomplish this or something with the same effect of preventing requests "external" of the web application?
Thanks | 0 | [
2,
25,
32,
938,
20,
1921,
13,
7,
1706,
8766,
192,
7,
12279,
37,
272,
18,
18,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
2803,
21,
2741,
3010,
30,
83,
1655,
3878,
20,
71,
8294,
66,
258,
272,
18,
18,
20,
1034,
14,
4434,
32,
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... |
clustered TimerService on jboss 7.1.1?
===
I'm looking for a way to properly cluster a j2ee app that uses timers. by properly cluster i mean i'm looking for the following features:
1. Timer executions should fall back to other cluster nodes. by this i mean that is some EJB on node A created a Timer:<br><code>timerService.createIntervalTimer(/* every 10 seconds */)</code><br>and then went offline (crashed) timeout invocations would start firing on node B (some other cluster node on which the same app is deployed)<br><br>
2. Timers should be accessible across the cluster. by this i mean that if EJB X created a timer running on node A, then the same EJB X (same class, obviously) running on cluster node B could cancel that timer by doing something like <br><code>timerService.getTimers().iterator().next().cancel();</code><br><br>
3. Timer executions could be distributed across the cluster - so for example if my timeout method is some long computation that i didnt complete in 10 seconds (when the timer next expires) i'd like the next timeout invocation to happen on some other, not-as-busy node.
<br><br>
obviously this is my ideal set of features, but any pointer in the right direction would be very welcomed.
| 0 | [
2,
7460,
69,
85,
139,
11449,
27,
487,
10349,
18,
453,
9,
165,
9,
165,
60,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
161,
20,
7428,
7460,
21,
487,
135,
2851,
4865,
30,
2027,
85,
1224,
9,
34,
7428,
7460,
31,
884,
31,
22,
79,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
web application and BIRT
===
I am quite new to BIRT.
I ain't getting any basic tutorial to work with BIRT within JSP.
In my application:
The customer will send a parameter, with which a complete report will be generated using information fetched from DB.
Can anyone please help me guide to a tutorial? | 0 | [
2,
2741,
3010,
17,
8719,
38,
800,
3726,
3726,
31,
589,
1450,
78,
20,
8719,
38,
9,
31,
21,
108,
22,
38,
1017,
186,
2125,
29724,
20,
170,
29,
8719,
38,
363,
487,
3401,
9,
19,
51,
3010,
45,
14,
7705,
129,
2660,
21,
18906,
15,
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... |
Passing a search argument parameters to an NSURL in TWRequest
===
Hi I am conducting a twitter search using the code below. I need to pass an argument (delegate.a) to the search as detailed in the code below. Unfortunately I am getting the message *"Too many arguments to method call, have 2, expected 1"* and a build fail. The argument is passed from another viewController through my app delegate to this tableviewcontroller and I know that is functioning correctly. How do I set up the URL with string to achieve this. I've seen mention of StringWithFormat but that will not work. Thanks in advance!
TWRequest *request = [[TWRequest alloc] initWithURL:[NSURL URLWithString:
@"http://search.twitter.com/search.json?q=%@", delegate.a]
parameters:nil requestMethod:TWRequestMethodGET]; | 0 | [
2,
2848,
21,
2122,
5476,
12905,
20,
40,
13,
103,
4082,
255,
19,
13,
38,
499,
99,
10351,
800,
3726,
3726,
4148,
31,
589,
9202,
21,
10623,
2122,
568,
14,
1797,
1021,
9,
31,
376,
20,
1477,
40,
5476,
13,
5,
24249,
3322,
9,
58,
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... |
Spring + Tomcat: Setup relative file path
===
I am deploying Spring 3 app on Tomcat7. I am using OXM unmarshaller so I need to create StreamSource like this:
unmarshaller.unmarshal(new StreamSource(new FileInputStream(dbSetupPath)))
I set value for dbSetupPath like this and it works in **unit tests**:
@Value("src/main/resources/db-setup.xml")
String dbSetupPath;
When I deploy on Tomcat though, I am getting FileNotFoundException. What is correct path that'll keep my tests passing and Tomcat working? I am deploying exploded:war atm. | 0 | [
2,
1573,
2754,
2067,
5782,
45,
18161,
4543,
3893,
2013,
800,
3726,
3726,
31,
589,
17617,
68,
1573,
203,
4865,
27,
2067,
5782,
465,
9,
31,
589,
568,
7506,
79,
367,
19988,
1233,
106,
86,
31,
376,
20,
1600,
3766,
12097,
101,
48,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Deny inheritance to a folder?
===
How to remove inherited permissions from a folder programatically, the permissions that were inherited from the parent folder..
or else
uncheck checkbox "inherit from parent the permission entires that apply to child objects......etc" from advanced security tab..? | 0 | [
2,
9258,
13852,
20,
21,
19294,
60,
800,
3726,
3726,
184,
20,
4681,
7179,
5572,
18,
37,
21,
19294,
625,
721,
8438,
15,
14,
5572,
18,
30,
46,
7179,
37,
14,
4766,
19294,
9,
9,
54,
962,
367,
12542,
2631,
5309,
13,
7,
108,
1694,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 making a function inline affect the lifetime of temporaries bound to its parameters?
===
This question is related to http://stackoverflow.com/questions/11538478/does-this-c-static-analysis-rule-make-sense-as-is, but is somewhat different. I've now implemented a static analysis rule to find cases where a function returns its const reference parameter as a reference, such as
const X& f(const X& x) { return x; }
This is potentially dodgy when a temporary is bound to `x`, because the lifetime of the temporary will end before the return value of `f` can be bound to a reference in the caller. To put it another way, this would be problematic:
const X& r = f(X());
On running the rule, I'm finding an implementation of `min` in the standard library that looks like this:
template<typename _Tp>
inline const _Tp&
min(const _Tp& __a, const _Tp& __b)
{
// concept requirements
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
//return __b < __a ? __b : __a;
if (__b < __a)
return __b;
return __a;
}
This clearly returns its const reference parameters as references, but the function is `inline`. Does this make a difference in terms of temporary lifetime, or is this genuinely a bit dodgy? The function is marked with the following comment, so it's clearly intended to be callable on temporaries:
* This is the simple classic generic implementation. It will work on
* temporary expressions, since they are only evaluated once, unlike a
* preprocessor macro. | 0 | [
2,
630,
544,
21,
1990,
19,
1143,
6245,
14,
5277,
16,
14935,
525,
2829,
4138,
20,
82,
12905,
60,
800,
3726,
3726,
48,
1301,
25,
1597,
20,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
19275,
25765,
4130,
118,
10739,
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... |
Using SQL Query to echo table noob help :P
===
<?php
$product_list="";
if(isset($_GET['cat'])){
$sql = mysql_query("SELECT*FROM products WHERE category LIKE'$category'");
while($row=mysql_fetch_array($sql)){
$tablerow='3';
$product_list.='<tr>';
while($tablerow >= 0){
$id=$row["id"];
$name=$row["name"];
$price=$row["price"];
$date_added = strftime("%b %d, 20%y",strtotime($row["date_added"]));
$discriptiontags = $row['category'];
$discription = $row['subcategory'];
$size = $row['details'];
$qty= $row['inv'];
$product_list.='<td><img src="inventory_images/'.$id.'.jpg" width="250" height="167"/><br/>$name</td>';
$tablerow=$tablerow-1;
}
$product_list.='</tr>';
}
}else{
$product_list = "no products in this category";
exit();
}
?>
so the thought behind this is; use the $_GET to grab a category tag for my database and use LIKE to find the row info and display each rows info in a single table cell from a table that is 3 columns across and dynamically adds additional rows.
here is the html from the spot it is supposed to be displayed
<table width="760px" border="1" cellpadding="4">
<?php echo $product_list ?>
</table>
[link to page in question][1]
I select the green category for testing because it has 3 items.
also for some reason the page does not display at all if the url variables are not set...????
the rest of the php on the page:
<?php
///conect to mysql
///grab page variable
include "storescript/connect_to_mysql.php";
$category="";
$tab="-1";
if(isset($_GET['cat'])){
$category=$_GET['cat'];}
if(isset($_GET['tab'])){
$tab=$_GET['tab'];
}
?>
Thank you for anyone that actually goes through all this :P I hope its just a simple noob mistake but im all out of ideas.
[1]: http://glamourpawscollars.com/products.php?cat=green&tab=1 | 0 | [
2,
568,
4444,
255,
25597,
20,
8117,
859,
90,
4995,
448,
13,
45,
306,
800,
3726,
3726,
13,
1,
60,
26120,
5579,
14086,
1,
5739,
3726,
7,
7,
73,
100,
5,
11001,
38,
5,
4403,
1,
3060,
2558,
22,
5782,
22,
500,
6,
6,
1,
5579,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
block / unblock Calls. Differencing between incoming / outgoing
===
I'm trying to control calls from my App.
Thanks to this post [Blocking Incoming call][1] - [Call Control in Android][2] -[Question Stackoverflow][3] And [this][4] . I was able cancel incoming/outgoing calls
I register the ITelephony class (com.android.internal.telephony.ITelephony),
defined a receiver in the Manifest:
<receiver android:name=".PhoneCallReceiver" >
<intent-filter android:priority="100" >
<action android:name="android.intent.action.PHONE_STATE" />
</intent-filter>
</receiver>
And in PhoneCallReceiver I override the OnRecive Method, using reflection to instance ITelephony.
@Override
public void onReceive(Context context, Intent intent) {
Log.v(TAG, "Receving....");
TelephonyManager telephony = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
try {
Class c = Class.forName(telephony.getClass().getName());
Method m = c.getDeclaredMethod("getITelephony");
m.setAccessible(true);
telephonyService = (ITelephony) m.invoke(telephony);
//telephonyService.silenceRinger();
if (!(InfoAct.ismodguiaon(context))){
telephonyService.endCall();
} else {
}
} catch (Exception e) {
e.printStackTrace();
}
}
This works, but I want to make differences between incoming and outgoing calls and I don't know how. Anyone can help?
[1]: http://androidsourcecode.blogspot.in/2010/10/blocking-incoming-call-android.html
[2]: http://prasanta-paul.blogspot.com.es/2010/09/call-control-in-android.html
[3]: http://stackoverflow.com/questions/1083527/how-to-block-calls-in-android
[4]: http://stackoverflow.com/questions/9971524/how-to-resolve-this-error-com-android-internal-telephony-cannot-be-resolved-to | 0 | [
2,
1921,
13,
118,
367,
12048,
3029,
9,
11394,
219,
6302,
128,
17126,
13,
118,
25193,
800,
3726,
3726,
31,
22,
79,
749,
20,
569,
3029,
37,
51,
4865,
9,
3669,
20,
48,
678,
636,
12048,
68,
17126,
645,
500,
2558,
165,
500,
13,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make a DLL work with Unity in Mac OS X?
===
I've designed an application in which the user must register himself. For this I've used a Web Service, and the application running in the **Unity Editor** on Mac OS X, or Windows makes the request without errors.
If I build the application as a Windows executable it also works, but when I build the application for **Mac OS X** it no longer works (outside the Editor). The request does not work properly.
In the project I've created **Plugins** folder and introduced both **System.Web** and **System.Web.Services** DLLs.
**Api Compability Level** in Player Settings is **NET 2.0.**
When I try to run the Mac OS X build I get this **error** message in the Log:
at System.Net.WebRequest.GetCreator (System.String prefix) [0x00000] in <filename unknown>:0
at System.Net.WebRequest.Create (System.Uri requestUri) [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.WebClientProtocol.GetWebRequest (System.Uri uri) [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebRequest (System.Uri uri) [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.SoapHttpClientProtocol.GetWebRequest (System.Uri uri) [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.SoapHttpClientProtocol.GetRequestForMessage (System.Uri uri, System.Web.Services.Protocols.SoapClientMessage message) [0x00000] in <filename unknown>:0
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (System.String method_name, System.Object[] parameters) [0x00000] in <filename unknown>:0
at BGWebServiceService.login (.LoginRequestBean bean) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) BGWebServiceService:login (LoginRequestBean)
at ClientObject.loginAsyncRequest () [0x00000] in <filename unknown>:0
I've looked many forums and searched the web and I can't find the answer. I don´t know if it´s necessary to add any other folder, put the DLLs on some other place or do something else in the project.
Any help would be very appreciated.
Thank you.
| 0 | [
2,
184,
20,
233,
21,
13,
43,
211,
170,
29,
8385,
19,
1572,
13,
759,
993,
60,
800,
3726,
3726,
31,
22,
195,
1006,
40,
3010,
19,
56,
14,
4155,
491,
2243,
425,
9,
26,
48,
31,
22,
195,
147,
21,
2741,
365,
15,
17,
14,
3010,
946... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 display center image in gallery display in imageview if user scrolling in gallery in android
===
I have image view and gallery in screen.In gallery have lot of images.If user scroll gallery.I need to display gallery center image should be displayed in image view can anybody tell how to do?
Thanks | 0 | [
2,
184,
20,
3042,
459,
1961,
19,
2246,
3042,
19,
1961,
4725,
100,
4155,
13,
28166,
19,
2246,
19,
13005,
800,
3726,
3726,
31,
57,
1961,
1418,
17,
2246,
19,
2324,
9,
108,
2246,
57,
865,
16,
3502,
9,
821,
4155,
12159,
2246,
9,
49,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cannot implicitly convert type 'class' to 'interface'
===
I have two projects that share code. The original source files are in project/namespace 'ns1'; which has a reference to project/namespace 'ns2'. I cannot add a reference in the other direction too as this would create a circular dependancy. To get around this I have added 'interface I' to 'ns2' by 'add as link' in Visual Studio.
This is basically the definitions of the shared code:
namespace ns1
{
public interface I { }
public class A : I { }
}
namespace ns2
{
using ns1;
public class B : I { }
}
If I then do this:
namespace ns1
{
public class C
{
public method m()
{
List<I> list = new List<I>();
list.Add(new A());
}
}
}
Build succeeds. But if I do this:
namespace ns1
{
using ns2;
public class C
{
public method m()
{
List<I> list = new List<I>();
list.Add(new B());
}
}
}
Build fails - "Cannot implicitly convert type 'ns2.B' to 'ns1.I'".
Can someone please explain/offer a solution? | 0 | [
2,
1967,
20290,
102,
8406,
1001,
13,
22,
1898,
22,
20,
13,
22,
6280,
6413,
22,
800,
3726,
3726,
31,
57,
81,
2314,
30,
1891,
1797,
9,
14,
501,
1267,
6488,
50,
19,
669,
118,
7259,
5582,
13,
22,
2172,
165,
22,
73,
56,
63,
21,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Valgrind: Wrong Version
===
I downloaded Valgrind 3.7.0 and ran:
./configure
make
make install
However when I run valgrind --version, I get 3.5.0. How is this possible? I am running Mac OS X Lion 10.7. I know I downloaded 3.7.0 because the tar file I downloaded from Valgrind's website name is`valgrind-3.7.0`.
What other ways can I check for the version? | 0 | [
2,
3347,
23244,
43,
45,
1389,
615,
800,
3726,
3726,
31,
23887,
3347,
23244,
43,
203,
9,
465,
9,
387,
17,
717,
45,
13,
9,
118,
1126,
15951,
233,
233,
16146,
207,
76,
31,
485,
3347,
23244,
43,
13,
8,
8,
10898,
15,
31,
164,
203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
change outlook MailItem icon
===
I'm developing an outlook 2010 addin that exports the emails to a specific locations when an user clicks a button from the menu. This part is not a problem, but I need also to change the MailItem icon-pictogram if the export was successful. I tried to look for solutions, but I only get that I need to use form regions(http://stackoverflow.com/questions/4256113/change-mailitem-pictogram), but I didn't find a true helpful solution. Any ideas how should I use this form regions?!
Regards | 0 | [
2,
753,
19837,
4216,
2119,
79,
9801,
800,
3726,
3726,
31,
22,
79,
3561,
40,
19837,
498,
3547,
108,
30,
16716,
14,
8517,
18,
20,
21,
1903,
4095,
76,
40,
4155,
10840,
18,
21,
5167,
37,
14,
11379,
9,
48,
141,
25,
52,
21,
1448,
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... |
Grails double decimal point parsing
===
I have a Grails application. I want to save a number with decimal places, e.g. 902.11. In my app, I use Czech locale, so the decimal point is represented as comma "," instead of point ".". But in the browser I want to do some calculations by Javascript, so the decimal point must be represented by ".".
Is there a solution so I can customize the Czech locale in my application so it will use the "." instead of ","? Or is there any other solution to this problem?
Thanks,
Lojza | 0 | [
2,
489,
7301,
18,
1494,
26380,
454,
2017,
18,
68,
800,
3726,
3726,
31,
57,
21,
489,
7301,
18,
3010,
9,
31,
259,
20,
2079,
21,
234,
29,
26380,
1489,
15,
13,
62,
9,
263,
9,
3151,
135,
9,
1306,
9,
19,
51,
4865,
15,
31,
275,
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... |
How do you call removeFromSuperview in RubyMotion?
===
I'm looking to implement this [solution][1] in RubyMotion.
How would the following statement look like?
[self.tabsView removeFromSuperview]
Thanks!
[1]: http://stackoverflow.com/questions/5851205/how-to-remove-a-subview-or-all-subviews-of-a-view | 0 | [
2,
184,
107,
42,
645,
4681,
2665,
8542,
4725,
19,
10811,
15745,
60,
800,
3726,
3726,
31,
22,
79,
699,
20,
8713,
48,
636,
18,
18687,
3309,
500,
2558,
165,
500,
19,
10811,
15745,
9,
184,
83,
14,
249,
3331,
361,
101,
60,
636,
8411,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Deployment of DB TFS MSBuild
===
I have the following problem deploying our ASP.net Webproject. The Deployment just runs fine. I'm using TFS 2010 and deploy the application through the msbuild arguments (/p:DeployOnBuild=True etc.).
The problem I'm running into is the deployment of our database. At the moment I'm trying to use the Package/Publish SQL settings of the web project. The connection string for the destination database looks as follows
Data Source=SomeIP, 1433; Initial Catalog=MYDatabase; User ID=DeploymentUser; Password=PW;
So I'm trying to use an sql login to login to the sql server (sql server 2012, the respective user is dbowner) but every db deployment fails because msbuild always tries to login to the sql server with the buildservice account.
One solution might be to grant access to the sql server of the build account. Unfortunately this is not possible for us because the dbserver is not in our domain.
Any ideas how i can force msbuild using the sql login specified in the connection string? | 0 | [
2,
10475,
16,
13,
9007,
13,
11720,
18,
4235,
29361,
800,
3726,
3726,
31,
57,
14,
249,
1448,
17617,
68,
318,
28,
306,
9,
2328,
2741,
21011,
9,
14,
10475,
114,
1461,
1123,
9,
31,
22,
79,
568,
13,
11720,
18,
498,
17,
17617,
14,
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... |
Using modulus with a cakephp html helper table
===
I have multiple arrays with an unknow amount of items per array. I want to put the items in a html table with 4 td's per row. Our work is a bit pedantic and want us to use the cakephp helper and I am a bit unsure how I would go about using modulus with the HTML helper or does cake have a way to ensure I only have 4 td's per row before going to the next row?
I am sorry, I really have no idea how to go about this, hence no sample code | 0 | [
2,
568,
13,
19673,
267,
29,
21,
8390,
26120,
13,
15895,
448,
106,
859,
800,
3726,
3726,
31,
57,
1886,
7718,
18,
29,
40,
367,
17806,
2006,
16,
3755,
416,
7718,
9,
31,
259,
20,
442,
14,
3755,
19,
21,
13,
15895,
859,
29,
268,
155... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery tab not working
===
i am creating the tab by jquery and my code is bellow
jquery
$("document").ready(function() {
$("#tabs").tabs();
});
and the html
<div id="tabs">
<ul>
<li><a href="#tabs-1">Nunc tincidunt</a></li>
<li><a href="#tabs-2">Proin dolor</a></li>
<li><a href="#tabs-3">Aenean lacinia</a></li>
</ul>
<div id="tabs-1">
<p>Proin ur nec arcu m sodal mpus lectus.</p>
</div>
<div id="tabs-2">
<p> llus p Mauris consectetur tortor et purus.</p>
</div>
<div id="tabs-3">
<p> sus he nec, luctus a, lacus.</p>
</div>
</div>
and the jquer i have included is
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script>
<script src="http://code.jquery.com/ui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
but the tab is not working ? | 0 | [
2,
487,
8190,
93,
6523,
52,
638,
800,
3726,
3726,
31,
589,
2936,
14,
6523,
34,
487,
8190,
93,
17,
51,
1797,
25,
23040,
487,
8190,
93,
5579,
5,
7,
28132,
7,
6,
9,
15193,
5,
22359,
5,
6,
13,
1,
5579,
5,
7,
5910,
15783,
18,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
convert inputs to a selects
===
I'm looking to convert inputs to selects using Jquery, while taking the value form the input and using it as the selected option. But I've only got half way there so far in the below code. Can anyone see where its going wrong? Or maybe suggest an alternative method.
HTML
<div class="inputDiv"><input type="text" id="input01" value="1" name="input01"/></div>
<div class="inputDiv"><input type="text" id="input01" value="4" name="input01"/></div>
<div class="inputDiv"><input type="text" id="input01" value="2" name="input01"/></div>
<div class="inputDiv"><input type="text" id="input01" value="1" name="input01"/></div>
<div class="inputDiv"><input type="text" id="input01" value="4" name="input01"/></div>
JS
$(".inputDiv input[type=text]").each(function() {
var qty = $(this).val();
var currentId = $(this).attr('id');
alert(qty + " is a Number");
alert(currentId + " is a ID");
$(this).replaceWith('<select id="' + currentId + '" name="" class="NewSelect">' +
'<option value="1">1</option>' +
'<option value="2">2</option>' +
'<option value="3">3</option>' +
'<option value="4">4</option>' +
'<option value="5">5</option>' +
'</select>');
$("option[value=" +this.qty+ "]").attr('selected', 'selected');
}); | 0 | [
2,
8406,
6367,
18,
20,
21,
5407,
18,
800,
3726,
3726,
31,
22,
79,
699,
20,
8406,
6367,
18,
20,
5407,
18,
568,
487,
8190,
93,
15,
133,
741,
14,
1923,
505,
14,
6367,
17,
568,
32,
28,
14,
1704,
4255,
9,
47,
31,
22,
195,
104,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
load data from json into extjs
===
i want to load one value from a json into a var in an extjs app. The json output looks like this
{"rechten":[{"name":"baas"}]}
If i want to use it in a store i know what to do but i use that only for grids before. I want a var like this
var rechten = "baas";
so i can check this into something else:
if(rechten == "baas") { alert('je bent de baas') }
else { alert('helaas je bent arbeider')};
so my question is how can i check the name value from that json in this if else statement? | 0 | [
2,
6305,
1054,
37,
487,
528,
77,
1396,
38,
728,
18,
800,
3726,
3726,
31,
259,
20,
6305,
53,
1923,
37,
21,
487,
528,
77,
21,
4033,
19,
40,
1396,
38,
728,
18,
4865,
9,
14,
487,
528,
5196,
1879,
101,
48,
13,
1,
7,
18773,
219,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Track changes with Git using already-changed files and a pristine copy
===
I was given a project with files like so:
MyProject/
a.txt
b.txt
c.txt
I initialized a Git repo in the directory, but (foolishly) did not add all files to the repo at the start. Instead, I added files to the repo right before I realized I'd need to change them.
git add a.txt; git commit -m "Pristine A"
<awesome changes to a.txt>
git commit -am "Awesome Changes"
Unfortunately, in my fervor of mad edits I forgot to do this for some files. (Read: tens of files in many directories, which are going to be hard to find by explicit path.)
<awesome changes to b.txt>
git status # Uh oh, new file b.txt
I can get a snapshot of the project before my awesome changes, so that Git can tell me which files have changed since then. However, I don't want to lose the tens of commits (with descriptions) that I already added.
**How can I take the "pristine" snapshot, and have Git calculate which files have changed compared to my working directory, without losing my existing commits and without getting false positives for those files that did change but that are already recorded in commits?**
_FWIW my original "justification" for not adding the entire directory at the start was because there are thousands of files unrelated to my work, the directory is only available over high-latency SMB, and I **thought** that I knew which files were important._ | 0 | [
2,
792,
1693,
29,
13,
10404,
568,
614,
8,
16229,
43,
6488,
17,
21,
27989,
4344,
800,
3726,
3726,
31,
23,
504,
21,
669,
29,
6488,
101,
86,
45,
51,
21011,
118,
21,
9,
38,
396,
38,
334,
9,
38,
396,
38,
272,
9,
38,
396,
38,
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... |
Securing PDF Generated from iTextPdf
===
I have made a software that generate a pdf as the part of its function, I am using iTextPDF Java library to generate PDF. For a demo version of my software, I added text watermarking (like "demo software") by use of following code
` PdfContentByte under = writer.getDirectContentUnder();
BaseFont baseFont = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.WINANSI, BaseFont.EMBEDDED);
under.beginText();
under.setColorFill(BaseColor.RED);
under.setFontAndSize(baseFont, 25);
under.showTextAligned(PdfContentByte.ALIGN_CENTER," demo software",250, 470,55);
under.endText();`
After it I converted it to .docx format using PDF to Word converter and the resultant docx file does not contain the watermark also the contents are easily editable so as a result the sole purpose of giving demo software is vanished.
How can I achieve permanent watermarking so that pdf to word converter wont be able to remove it.
One idea come to my mind is that instead of putting the text in the pdf there should be a way of converting all the text of a page first into an image then making the pdf comprising of those images. But I am unsure on how to achieve this using iTextPdf.
| 0 | [
2,
13498,
13,
11124,
6756,
37,
31,
11969,
11124,
800,
3726,
3726,
31,
57,
117,
21,
2306,
30,
7920,
21,
13,
11124,
28,
14,
141,
16,
82,
1990,
15,
31,
589,
568,
31,
11969,
11124,
8247,
1248,
20,
7920,
13,
11124,
9,
26,
21,
8376,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 prevent an href to show another page till first page is filled completely
===
i have a link in mobile jquery..
<div data-role="page" id="main" data-title="Main Page">
Here there are two textboxes which must be filled by the user. Then here is a link..
<a href="#sub" data-role="button" id="save" data-icon="star" data-theme="b" data-transition="flip">Show Employee Data</a>
"sub" is data-role="page" which displays the data of these 2 textboxes.
I wrote in .js..
$(document).delegate('#save', 'click', function() {
if(document.getElementById('name').value=="")
{ alert('Name Not Entered..');return; }
}
Every thing runs good, Alert is also shown, but second page is also shown because of href having id="save". All i need is to show this second page only after validation of first page.. Am i doing something wrong ?? Please suggest.. | 0 | [
2,
184,
20,
2501,
40,
746,
14057,
20,
298,
226,
2478,
3924,
64,
2478,
25,
1943,
1524,
800,
3726,
3726,
31,
57,
21,
3508,
19,
3241,
487,
8190,
93,
9,
9,
13,
1,
12916,
1054,
8,
661,
413,
3726,
7,
6486,
7,
4924,
3726,
7,
6232,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C# Regex Expression for a repeated pattern
===
I need to craft a complex regex expression that will match a varying number of repeating patterns in a string..
An example of the string to match would be as follows
1\(E_123456)\(E_34567)\(E_424324234)\(E_8908908)\(E_23132312)\M_133123
I have added the parentheses to highlight the repeating patterns I would need to match. These would not be present in the real string.
The order is important as it describes a certain hierarchy. It is this hierarchy I would be looking to extract and construct. The depth of the pattern (or number of repeating patterns) would not be constant at all so it's not a simple case of x number of groups!
ie.. the above has a depth of 5
E_123456, E_34567, E_424324234, E_8908908, E_23132312
while
1\(E_1)\(E_11111)\(E_354534534)\M_133123
would have a depth of three. (E_1, E_111111, E_354534534)
However I need a regex that will output an ordered list in the order that these values are presented regardless of the depth...
I'm ok with basic regex expressions but they are not my forte so someone's help will be hugely appreciated! | 0 | [
2,
272,
5910,
7953,
1706,
1803,
26,
21,
4251,
3732,
800,
3726,
3726,
31,
376,
20,
6508,
21,
1502,
7953,
1706,
1803,
30,
129,
730,
21,
9852,
234,
16,
17389,
6282,
19,
21,
3724,
9,
9,
40,
823,
16,
14,
3724,
20,
730,
83,
44,
28,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to load multiple jplayer in single instance?
===
I am using jPlyaer to load my mp3 file, i am loading more than 10 files in a page and also it is playing simultaneously all the tracks.
If we see in http://jplayer.org/0.2.1/demo-03/ this page, we are duplicating the code multiple time, i am thinking this is not the best approach, i am using latest jplayer plugin 2.1.0 so how do i can instantiate the player multiple time dynamically instead of hard coding all the way in page.
| 0 | [
2,
184,
20,
6305,
1886,
487,
14049,
19,
345,
4851,
60,
800,
3726,
3726,
31,
589,
568,
13,
12851,
102,
58,
106,
20,
6305,
51,
4628,
240,
3893,
15,
31,
589,
12797,
91,
119,
332,
6488,
19,
21,
2478,
17,
67,
32,
25,
791,
6888,
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... |
How does the z-index affect the formatting of a drop-down menu?
===
Was wondering if anyone could explain how changing the z-index of a div on my template would affect the font styling of my drop down menus in my header? If I set the z-index so that the div is in front of (overlaps) the menu then the menu formatting stays the same. If I set the z-index so that the div is behind the menu then the font changes of some of the menus that overlap but not all!!!. I've googled but there seems to be no reference to z-index affecting anything except the stacking order. The results are the same across browsers.
Any ideas? | 0 | [
2,
184,
630,
14,
2052,
8,
25671,
6245,
14,
2595,
1203,
16,
21,
2804,
8,
2968,
11379,
60,
800,
3726,
3726,
23,
5712,
100,
1276,
110,
3271,
184,
4226,
14,
2052,
8,
25671,
16,
21,
13,
12916,
27,
51,
22894,
83,
6245,
14,
9978,
23020... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 to count the number of lines in a file in java
===
I have one query that is let's say I have a folder in c drive contains 5 java files Now I was trying to develop a program in java that will count the Number of files in that folder along with the lines of code in each indidividual file , rite nOW I have a code that pick up only single file from the folder and count the line of code for that particular file. Please advise.
Program That I have developed..
public class FileCountLine {
public static void main(String[] args) throws FileNotFoundException {
File file = new File("E:/WalgreensRewardsPosLogSupport.java");
Scanner scanner = new Scanner(file);
int count = 0;
while (scanner.hasNextLine()) {
String line = scanner.nextLine();
count++;
}
System.out.println("Lines in the file: " + count);
}
} | 0 | [
2,
3467,
20,
2468,
14,
234,
16,
1560,
19,
21,
3893,
19,
8247,
800,
3726,
3726,
31,
57,
53,
25597,
30,
25,
408,
22,
18,
395,
31,
57,
21,
19294,
19,
272,
1493,
1588,
331,
8247,
6488,
130,
31,
23,
749,
20,
2803,
21,
625,
19,
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... |
"ActionController::RoutingError: No route matches" error when no nested resource
===
I'm migrating a project from one codebase to another to clean up a lot of accumulated cruft, shift to a new presentation layer, etc.
One of the relationships is the canonical `User has_many Order`, which I have expressed as nested resources in `routes.rb`:
resources :users do
resources :orders
end
and so I have the named route `user_orders_path(@user)`. It works just fine if the user has orders, but if the user has no orders, trying to render the route gives the following error:
ActionController::RoutingError (No route matches {:controller=>"orders",
:user_id=>#<User id: 472, account_id: nil, first_name: "Denis", last_name:
"Haskin", ...etc... , last_sign_in_ip: "127.0.0.1">})
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:532:in `raise_routing_error'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:528:in `rescue in generate'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:520:in `generate'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:561:in `generate'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:586:in `url_for'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/url_for.rb:148:in `url_for'
from /Users/dwhsix/.rvm/gems/ruby-1.9.3-p0@zmx2/gems/actionpack-3.2.3/lib/action_dispatch/routing/route_set.rb:213:in `user_orders_path'
from (irb):24
(I'm providing the full stack trace from testing this in `rails console`; for some reason I'm not getting full stack trace for this error in the server log.)
I'm sore of at a loss to explain (and fix) this, and I was hoping this might ring a bell with someone. I tested this in a new empty project and of course it works fine. I guess the next thing I'll try is to strip down as much as I can about these models and the controller, and start adding pieces back until the error recurs. Because I'm migrating over existing code, it's very difficult to isolate this to a small piece of example code.
(At the risk of possibly confusing the issue, I have started using Ryan Bates' [cancan][1] in this project and I'm a little suspicious that it might be playing a role here, but I did strip it out and test without it, with no change in this incorrect behavior.)
[1]: https://github.com/ryanb/cancan/ | 0 | [
2,
13,
7,
8645,
12898,
1252,
45,
45,
8821,
1203,
29992,
45,
90,
858,
1717,
7,
7019,
76,
90,
5618,
69,
6577,
800,
3726,
3726,
31,
22,
79,
28749,
21,
669,
37,
53,
1797,
8436,
20,
226,
20,
2745,
71,
21,
865,
16,
16965,
11498,
307... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 use red5 recorder save as not *.flv but ts format?
===
I record Live Stream With Red5 Media Server successfully.
But the recorded vedio saved as *.flv,I want it saved as ts format.
How can i get it?
Best Regards,
Defonds | 0 | [
2,
184,
92,
31,
275,
402,
264,
14173,
2079,
28,
52,
1637,
9,
4372,
710,
47,
13,
38,
18,
2595,
60,
800,
3726,
3726,
31,
571,
515,
3766,
29,
402,
264,
941,
8128,
3673,
9,
47,
14,
801,
13,
195,
6921,
4377,
28,
1637,
9,
4372,
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... |
Getting a list of lists without using List<List<string>> in F#
===
I have this function here:
let ProcessFile (allLines: string list) =
let list = new List<List<string>>()
let rec SplitFile (input: string list) =
if input.Length <> 0 then
list.Add(new List<string>(input.TakeWhile(fun x -> x <> "")))
let nextGroup = input.SkipWhile(fun x -> x <> "").SkipWhile(fun x -> x = "")
SplitFile (Seq.toList nextGroup)
SplitFile allLines |> ignore
list
It is given the contents of a file as a list of strings and takes each group that is seperated by empty lines as a seperate list, giving me a list of lists.
My question is, is there a better way to do this with a yield that give me something like a string list list instead of me having to use new List< List< string>>? As this doesn't seem particularly neat to me. | 0 | [
2,
1017,
21,
968,
16,
7227,
366,
568,
968,
1,
5739,
1,
11130,
1,
19,
398,
5910,
800,
3726,
3726,
31,
57,
48,
1990,
235,
45,
408,
953,
16877,
13,
5,
1233,
7939,
45,
3724,
968,
6,
800,
408,
968,
800,
78,
968,
1,
5739,
1,
11130... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CA1051 for windows phone 7,5
===
public class TestDB : DataContext
{
public TestDB (string connectionString)
: base(connectionString)
{
}
public Table<MyClass> TableName;
}
[Table(Name = "TableName")]
public class MyClass
{
}
Because field 'TestDB .TableName' is visible
outside of its declaring type, change its accessibility
to private and add a property, with the same accessibility
as the field has currently, to provide access to it
On doing what fxcop says the value is not inserted into table instead it gives an error | 0 | [
2,
1658,
1036,
4246,
26,
1936,
1132,
453,
15,
264,
800,
3726,
3726,
317,
718,
1289,
9007,
13,
45,
1054,
1126,
11969,
13,
1,
317,
1289,
9007,
13,
5,
11130,
2760,
11130,
6,
13,
45,
1000,
5,
25996,
872,
11130,
6,
13,
1,
13,
1,
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... |
Issues with set images in ViewPager pages
===
I'm getting "Source not found" error while trying to set image resource for my ImageView in ViewPager. But I don't have error if I set image in XML. However if I set image in XML, it's not shown while I'm running app.
I'm using [viewpagerindictor][1] lib and android-support-v13.jar.
Activity code
<!-- language: lang-java -->
public class DataActivity extends Activity {
/** Called when the activity is first created. */
int obj_id, type_id, node_id;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.page);
Bundle ex = getIntent().getExtras();
if (ex != null) {
obj_id = ex.getInt("obj");
type_id = ex.getInt("type");
node_id = ex.getInt("node");
}
LayoutInflater inf = LayoutInflater.from(this);
List<View> pages = new ArrayList<View>();
View page = inf.inflate(R.layout.page, null);
ImageView im = (ImageView)page.findViewById(R.id.im_v_obj1);
im.setImageDrawable(getResources().getDrawable(R.drawable.obj1));
pages.add(page);
PageAdapter pa = new PageAdapter(pages);
ViewPager vp = (ViewPager)findViewById(R.id.viewpager);
TitlePageIndicator tpi = (TitlePageIndicator)findViewById(R.id.indicator);
vp.setAdapter(pa);
tpi.setViewPager(vp);
}
}
PageAdapter code
<!-- language: lang-java -->
public class PageAdapter extends PagerAdapter {
List<View> pages = null;
private static String[] titles = new String[]
{
"Object 1"
};
public PageAdapter(List<View> pages) {
this.pages = pages;
}
public String getPageTitle( int position )
{
return titles[ position ];
}
@Override
public Object instantiateItem(View collection, int pos) {
View v = pages.get(pos);
((ViewPager)collection).addView(v, 0);
return v;
}
@Override
public void destroyItem (View collection, int pos, Object view) {
((ViewPager)collection).removeView((View)view);
}
@Override
public int getCount() {
return pages.size();
}
@Override
public boolean isViewFromObject(View v, Object obj) {
return v.equals(obj);
}
XML code
<!-- language: lang-xml -->
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.viewpagerindicator.TitlePageIndicator
android:id="@+id/indicator"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
[1]: http://viewpagerindicator.com/ | 0 | [
2,
1549,
29,
309,
3502,
19,
1418,
6486,
139,
4434,
800,
3726,
3726,
31,
22,
79,
1017,
13,
7,
12097,
52,
216,
7,
7019,
133,
749,
20,
309,
1961,
6577,
26,
51,
1961,
4725,
19,
1418,
6486,
139,
9,
47,
31,
221,
22,
38,
57,
7019,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Asana API get all tags
===
I'm the developer of this PHP class wrapper for Asana API https://github.com/ajimix/asana-api-php-class
In the last Asana API update, tags support were added. I added all the endpoints to my class but I found that one isn't working. This one:
https://app.asana.com/api/1.0/tags
It returns me HTTP code 0...
That fails too:
curl -u API_KEY: https://app.asana.com/api/1.0/tags
Everything is working, get tags by workspace, add tags to task, etc.
But that doesn't and documentation says it should work.
![API Tags Documentation][1]
[1]: http://i.stack.imgur.com/dJj5Z.jpg | 0 | [
2,
28,
1629,
21,
2159,
164,
65,
3383,
18,
800,
3726,
3726,
31,
22,
79,
14,
10058,
16,
48,
13,
26120,
718,
28051,
26,
28,
1629,
21,
2159,
7775,
18,
6903,
10404,
20926,
9,
960,
118,
17102,
15743,
118,
472,
1629,
8,
2552,
49,
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... |
Apache PDFBox: Move the last page to first Page
===
I'm writing a simple Java Application with Apache PDFBox.
I have a several PDFs where the last page is the index of the content in the previous pages.
I need the index (last page) became the first page of the PDF file.
Is it possible? | 0 | [
2,
17140,
13,
11124,
5309,
45,
780,
14,
236,
2478,
20,
64,
2478,
800,
3726,
3726,
31,
22,
79,
1174,
21,
1935,
8247,
3010,
29,
17140,
13,
11124,
5309,
9,
31,
57,
21,
238,
13,
11124,
18,
113,
14,
236,
2478,
25,
14,
4348,
16,
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... |
SELECT rows from a table joining only one row of another table
===
I Have two tables: Home(ID, name) and Photos(ID, homeid, filename, splash)
Home primary key is ID, Photos primary key is ID. A Home can have multiple photos. Splash can be 0 or 1 and, for each HomeID, at most one photo can have splash=1.
Now i'd like to SELECT * FROM Home merging for each home its splash, if exists, else splash returns null.
How can i do?
Here's an example of the tables:
Home
ID name
1 home1
2 home3252
3 home5326
Photos
ID homeid filename splash
1 1 asda.jpg 0
2 1 aspg.jpg 1
3 2 nasf.jpg 0
4 2 qfqj.jpg 1
5 3 vnas.jpg 0
6 3 nfao.jpg 0
| 0 | [
2,
5407,
11295,
37,
21,
859,
3765,
104,
53,
3131,
16,
226,
859,
800,
3726,
3726,
31,
57,
81,
7484,
45,
213,
5,
1340,
15,
204,
6,
17,
7064,
5,
1340,
15,
213,
1340,
15,
3893,
7259,
15,
13873,
6,
213,
1256,
1246,
25,
4924,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create an ipa and run application in iPhone
===
I have my new macbook air.
I have created one test application.
now i want to create ipa file for my application.
but archive button in product menu is not enable.
How to create ipa for this?
and another thing is that i want to run this Application in my iPhone instead of simulator.
How can i do so??
please help.
Thanks in Advance. | 0 | [
2,
184,
20,
1600,
40,
13,
15796,
17,
485,
3010,
19,
21024,
800,
3726,
3726,
31,
57,
51,
78,
1572,
5199,
282,
9,
31,
57,
679,
53,
1289,
3010,
9,
130,
31,
259,
20,
1600,
13,
15796,
3893,
26,
51,
3010,
9,
47,
9250,
5167,
19,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IS warning about string ID "IDS_ERROR_27555" not being found in string table
===
I have an Installshield2010 project that has had this warning since before my employment
`ISDEV : warning -3028: The string ID "IDS_ERROR_27555" was not found in the string table. It is referenced in the table:"Error" in column:"Message".`
Looking in the svn history, this row was added to Error table a few years ago - alongside a seemingly unrelated change
`<row><td>27555</td><td>##IDS_ERROR_27555##</td></row>`
However as the error indicates, there is no corresponding entry in the ISString table.
I'm curious how it got added. The IDS_ERROR strings look like canned strings, it seems really unlikely the person who added this to my ism did so manually.
Of course Flexera's forums [are a ghost town][1]. I did find an [ism that has that string defined][2] as
`<row><td>IDS_ERROR_27555</td><td>1033</td><td>Error attempting to apply permissions to object '[2]'. System error: [3] ([4])</td><td>0</td><td/><td>1394414478</td></row>`
Do any of your ism's have IDS_ERROR_27555 defined or referenced? Am very sure I can delete the string and be no worse for wear... but it bugs me to not know what happened.
[1]: http://forum.installsite.net/index.php?showtopic=19734
[2]: http://code.google.com/p/google-saml-bridge-for-windows/source/browse/tags/2.0/SAML_MSI_2.0/GSARKS_x64/Google+Services+for+Sharepoint.ism?r=130#3534 | 0 | [
2,
25,
3590,
88,
3724,
4924,
13,
7,
9178,
1,
29992,
1,
2567,
22779,
7,
52,
142,
216,
19,
3724,
859,
800,
3726,
3726,
31,
57,
40,
16146,
29026,
2751,
669,
30,
63,
41,
48,
3590,
179,
115,
51,
5029,
13,
1,
403,
14438,
13,
45,
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... |
PHP stdout on Apache
===
Using PHP 5.3 as php5_module in Apache 2.2 on Windows 7.
Where does stdout go in the above configuration?
Tested with following code:
<?php
$stdout = fopen('php://stdout', 'w');
fwrite($stdout, "stdout<br />\n");
$output = fopen('php://output', 'w');
fwrite($output, "output<br />\n");
?>
This only displays `output` in the browser. What happens to stdout?
| 0 | [
2,
13,
26120,
354,
43,
1320,
27,
17140,
800,
3726,
3726,
568,
13,
26120,
331,
9,
240,
28,
13,
26120,
264,
1,
19673,
62,
19,
17140,
172,
9,
135,
27,
1936,
453,
9,
113,
630,
354,
43,
1320,
162,
19,
14,
784,
8091,
60,
7631,
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... |
WP 7.1 RootFrame_NavigationFailed error when using NReadability library
===
I'm trying to use the NReadability library in a windows phone 7 application and am getting an error whenever a reference to the NReadabilityTranscoder or NReadabilityWebTranscoder is found.
Steps to reproduce...
1) Create a Windows Phone 7 Silverlight Application
2) Using the Nu Package Management system, install the NReadability library via Install-Package NReadability
3) In MainPage.xaml.cs, add a a private member - private NReadabilityWebTranscoder transcoder;
When you start the app, it breaks into the `RootFrame_NavigationFailed` function with the `NavigationFailedEventArgs` passed containing the following...
Exception = {"The type 'ReadMode.MainPage', specified in the x:Class of '/MainPage.xaml' could not be found in any loaded assembly."}
However, if I remove any reference to NReadability objects in my code the app runs fine, so I don't see how it can be an issue with the MainPage.xaml file.
Originally I thought it might be an issue with the lib being compiled as a .NET library rather than a WP library, so I grabbed the source from https://github.com/marek-stoj/NReadability , copied the source files into a WP project, fixed errors and built, then tried adding a reference to that, but I ran into the EXACT same problem.
Any help would be appreciated, thanks. | 0 | [
2,
13,
13790,
453,
9,
165,
5900,
8361,
1,
325,
13227,
857,
24910,
69,
7019,
76,
568,
13,
103,
10647,
4091,
1248,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
14,
13,
103,
10647,
4091,
1248,
19,
21,
1936,
1132,
453,
3010,
17,
589,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Complete DKIM verification and signing in C# & Bouncy Castle
===
I'm getting inconsistent results verifying and signing DKIM messages. Would someone point me in the right direction here, and possibly give me a few pre and post canocalization samples?
I'm not sure if my code isn't correct, or my canocalization isn't correct. I'll offer a bounty as soon as I'm able to.
**Original Header**
Delivered-To: fakesmarsh@gmail.com Received: by 10.76.7.129 with SMTP
id j1csp115301oaa;
Tue, 3 Jul 2012 12:21:49 -0700 (PDT) Return-Path: <fakesmartoffice@gmail.com> Received-SPF: pass (google.com: domain of
fakesmartoffice@gmail.com designates 10.182.50.98 as permitted sender)
client-ip=10.182.50.98; Authentication-Results: mr.google.com;
spf=pass (google.com: domain of fakesmartoffice@gmail.com designates
10.182.50.98 as permitted sender) smtp.mail=fakesmartoffice@gmail.com; dkim=pass header.i=fakesmartoffice@gmail.com Received: from
mr.google.com ([10.182.50.98])
by 10.182.50.98 with SMTP id b2mr14287752obo.28.1341343309513 (num_hops = 1);
Tue, 03 Jul 2012 12:21:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=mime-version:date:message-id:subject:from:to:content-type;
bh=TYAZPLOo6ceF7t87kMSUedRkO+9cEihRiFUuRVKrv3o=;
b=a0vXPeFuHGkI0ERo/fsbF3pmqnMZkFiAFX0YNoAre+oEr4TB0ReDlCZJ0Trl79kBpQ
iJAi+GXs7mUXOgf5oQzP6fPswdXok66bOkbYJnJ52V6q9AtWkprijRXt2dmPNFzN64v5
K5xFSzeYQk2n8rfyjnRG9YcW9CvAaAFvT1Q+mZsm9w1O4gQ+BP1ymf+SYTpYfzrBCIZN
Ue2fc3pgmqFM2NJqprBiCqQc28rCtyhrnZkXWOYGYwbktpwXjiOwF6nDQWSVOJdlEiL0
NDhwUEpH6lYJZzdTrAFEjih1Jp8Nop2+o1l3jITxdeMOnUhDdHoO1hlxgwgIqwqETTiO
La8g==
MIME-Version: 1.0
Received: by 10.182.50.98 with SMTP id b2mr14287752obo.28.1341343309507; Tue, 03 Jul 2012 12:21:49 -0700
(PDT)
Received: by 10.76.133.131 with HTTP; Tue, 3 Jul 2012 12:21:49
-0700 (PDT) Date: Tue, 3 Jul 2012 15:21:49 -0400
Message-ID: <CABbVT8OxxFwWDk-AyQzo1H845URqSi00yqXosYuDHdLRN+G5Xw@mail.gmail.com>
Subject: Test123
From: FakeSmartOffice FakeSmartOffice <fakesmartoffice@gmail.com>
To: fakesmarsh@gmail.com
Content-Type: multipart/alternative; boundary=f46d044481d97c2d5304c3f1d3bb
**Results in Canocalized header**
mime-version:1.0
date:Tue, 3 Jul 2012 15:21:49 -0400
message-id:<CABbVT8OxxFwWDk-AyQzo1H845URqSi00yqXosYuDHdLRN+G5Xw@mail.gmail.com>
subject:Test123
from:FakeSmartOffice FakeSmartOffice <fakesmartoffice@gmail.com>
to:fakesmarsh@gmail.com
content-type:multipart/alternative; boundary=f46d044481d97c2d5304c3f1d3bb
dkim-signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=TYAZPLOo6ceF7t87kMSUedRkO+9cEihRiFUuRVKrv3o=; b=
**Body (Is Canocalization required?)**
--f46d044481d97c2d5304c3f1d3bb
Content-Type: text/plain; charset=ISO-8859-1
test
--f46d044481d97c2d5304c3f1d3bb
Content-Type: text/html; charset=ISO-8859-1
test
--f46d044481d97c2d5304c3f1d3bb--
**Code to hash the body**
sbBody = new StringBuilder();
try
{
// using (FileStream fs = new FileStream(, FileMode.Open))
{
using (StreamReader reader = new StreamReader(@"C:\scratch\SampleGmail3body.txt", false))//, Encoding.ASCII))
{
string line = null;
while ((line = reader.ReadLine()) != null)
{
sbBody.Append(line + "\r\n");
}
reader.DiscardBufferedData();
reader.Close();
reader.Dispose();
}
}
}
catch (Exception ex)
{
Trace.WriteLine(ex.ToString());
}
var dataBody = sbBody .ToString();// "test input string";
//dataBody = "\r\n";
var sha = new SHA256CryptoServiceProvider();
byte[] hash = sha.ComputeHash(Encoding.ASCII.GetBytes(dataBody));
string hashString = Convert.ToBase64String(hash);
Console.WriteLine(hashString);
Console.WriteLine("TYAZPLOo6ceF7t87kMSUedRkO+9cEihRiFUuRVKrv3o=");//gmail
Console.ReadLine();
**Public Key extracted from `20120113._domainkey.gmail.com`**
publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA1Kd87/UeJjenpabgbFwh+eBCsSTrqmwIYYvywlbhbqoo2DymndFkbjOVIPIldNs/m40KF+yzMn1skyoxcTUGCQs8g3FgD2Ap3ZB5DekAo5wMmk4wimDO+U8QzI3SD07y2+07wlNWwIt8svnxgdxGkVbbhzY8i+RQ9DpSVpPbF7ykQxtKXkv/ahW3KjViiAH+ghvvIhkx4xYSIc9oSwVmAl5OctMEeWUwg8Istjqz8BZeTWbf41fbNhte7Y+YqZOwq1Sd0DbvYAD9NOZK9vlfuac0598HY+vtSBczUiKERHv1yRbcaQtZFh5wtiRrN04BLUTD21MycBX5jYchHjPY/wIDAQAB";
**Use Bouncy Castle or .NET to verify the signature in "b="**
The following code samples illustrates a few different ways of verifying a message hash
public static bool Verify3(String data, byte[] expectedSig)
{
/* Make the key */
RsaKeyParameters key = ConvertToRSAPublicKey(publicKey);
/* Init alg */
ISigner signer = SignerUtilities.GetSigner("SHA256withRSA");
/* Populate key */
signer.Init(false, key);
/* Get the signature into bytes */
//var expectedSig = Convert.FromBase64String(expectedSignature);
/* Get the bytes to be signed from the string */
var msgBytes = Encoding.UTF8.GetBytes(data);
/* Calculate the signature and see if it matches */
signer.BlockUpdate(msgBytes, 0, msgBytes.Length);
return signer.VerifySignature(expectedSig);
}
public static bool Verify2(String data, byte[] expectedSig)
{
/* Make the key */
RsaKeyParameters key = ConvertToRSAPublicKey(publicKey ); ; // MakeKey(publicModulusHexString, publicExponentHexString, false);
/* Init alg */
ISigner signer = SignerUtilities.GetSigner("SHA256withRSA");
/* Populate key */
signer.Init(false, key);
/* Get the signature into bytes */
//var expectedSig = Convert.FromBase64String(expectedSignature);
/* Get the bytes to be signed from the string */
var msgBytes = Encoding.ASCII.GetBytes(data);
/* Calculate the signature and see if it matches */
signer.BlockUpdate(msgBytes, 0, msgBytes.Length);
return signer.VerifySignature(expectedSig);
}
private static bool VerifyWithPublicKey(string data, byte[] sig)
{
/* A 1024-bit key will encrypt messages up to 117 bytes long. */
// Try using bouncy
// Try using RSA
RSACryptoServiceProvider rsa = null;
RsaKeyParameters kparam = ConvertToRSAPublicKey(publicKey);
RSAParameters p1 = DotNetUtilities.ToRSAParameters(kparam);
rsa = new RSACryptoServiceProvider();
rsa.ImportParameters(p1);
// compute sha1 hash of the data
var sha = new SHA256CryptoServiceProvider();
byte[] hash = sha.ComputeHash(Encoding.ASCII.GetBytes(data));
var r1 = rsa.VerifyData(Encoding.ASCII.GetBytes(data), "SHA256", sig);
var r2 = rsa.VerifyData(hash, "SHA256", sig);
var r21 = Verify2(data, sig);
var r3 = Verify3(data, sig);
var r4 = rsa.VerifyHash(hash, "SHA256", sig);
var r41 = Verify2(data, sig);
Console.WriteLine("{0} {1} {2} {3} {4} {5}",r1,r2,r21,r4,r41,r3);
return rsa.VerifyHash(hash, "SHA256", sig);
}
private static RsaKeyParameters ConvertToRSAPublicKey(string forPubKey)
{
// Read from export format
byte[] publicKeyBytes = Convert.FromBase64String(forPubKey);
AsymmetricKeyParameter asymmetricKeyParameter = PublicKeyFactory.CreateKey(publicKeyBytes);
RsaKeyParameters rsaKeyParameters = (RsaKeyParameters)asymmetricKeyParameter;
return rsaKeyParameters;
}
| 0 | [
2,
1279,
13,
43,
17574,
25056,
17,
5479,
19,
272,
5910,
279,
5963,
14386,
1339,
800,
3726,
3726,
31,
22,
79,
1017,
22380,
1736,
21012,
68,
17,
5479,
13,
43,
17574,
7561,
9,
83,
737,
454,
55,
19,
14,
193,
1400,
235,
15,
17,
2879,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Continue reading from the console, after the offer to enter something
===
I run terminal.
Write
root@debian:/home/user# myprog
all good
>>>
read ok
root@debian:/home/user#
After starting the program myprog brought "all good" and was expected to enter. After that, she brought "read ok" After that the program has completed its execution.
I wrote a script for php:
set_time_limit(160);
$descriptorspec = array(
0 => array("pipe", "r"),
1 => array("pipe", "w"),
2 => array("file", "null", "a")
);
$process = proc_open('/home/user/myprog', $descriptorspec, $pipes);
if (is_resource($process)) {
while ( !feof($pipes[1]) ) {
$s = fgets($pipes[1], 2);
echo $s;
}
fclose($pipes[0]);
fclose($pipes[1]);
proc_close($process);
}
But it only prints "all good" and does not show "read ok".
What to do?
I can not change the program myprog | 0 | [
2,
1816,
1876,
37,
14,
8650,
15,
75,
14,
1994,
20,
2830,
301,
800,
3726,
3726,
31,
485,
3855,
9,
2757,
5900,
1,
546,
10035,
45,
118,
8167,
118,
16704,
5910,
51,
2740,
263,
65,
254,
13,
1,
1302,
5854,
5900,
1,
546,
10035,
45,
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... |
Implementing IEnumerable with an Array
===
This is likely a simple syntax question, but I can't figure it out.
Normally, I would do this:
public class OrderBook : IEnumerable<PriceLevel>
{
private readonly List<PriceLevel> PriceLevels = new List<PriceLevel>();
public IEnumerator<PriceLevel> GetEnumerator()
{
return PriceLevels.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return PriceLevels.GetEnumerator();
}
}
But instead of a list, I want to use an array - like this:
public class ArrayOrderBook : IEnumerable<PriceLevel>
{
private PriceLevel[] PriceLevels = new PriceLevel[500];
public IEnumerator<PriceLevel> GetEnumerator()
{
return PriceLevels.GetEnumerator();
}
IEnumerator IEnumerable.GetEnumerator()
{
return PriceLevels.GetEnumerator();
}
}
The IEnumerator IEnumerable.GetEnumerator() seems to compile fine - but the public IEnumerator<PriceLevel> says that I need some kind of cast - what is the best way of doing this?
William
| 0 | [
2,
17333,
13,
660,
6336,
106,
579,
29,
40,
7718,
800,
3726,
3726,
48,
25,
1720,
21,
1935,
22649,
1301,
15,
47,
31,
92,
22,
38,
1465,
32,
70,
9,
4147,
15,
31,
83,
107,
48,
45,
317,
718,
389,
5199,
13,
45,
13,
660,
6336,
106,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Windows Authentication--Authenticating numerous users
===
I am using Windows authentication on a website but want to have levels of access. Currently, I am using the [Authorize(Users = "userA")] syntax.
However, with upwards of twenty Windows accounts accessing a site, I don't want to have to hard-code in twenty users with each Authorize statement. What's more, some of the users need to have different access than others. I thought of having a list of users that a CustomAuthorizationAttribute iterates through to see if the desired user is among them.
Basically, I'm trying to get roles without using Forms authentication.
What is the most effective, most simple way of doing this?
| 0 | [
2,
1936,
27963,
8,
8,
1346,
2504,
1786,
1880,
1548,
3878,
800,
3726,
3726,
31,
589,
568,
1936,
27963,
27,
21,
2271,
47,
259,
20,
57,
2216,
16,
1381,
9,
871,
15,
31,
589,
568,
14,
636,
10007,
2952,
5,
16704,
18,
800,
13,
7,
267... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Doxygen in-body comments
===
I have some code which I want to document with in-body comments like so:
/*!
* I'm the best blah blah blah
*/
void theBestFunction(int ever)
{
doThings();
/*!
* Does some more things
*/
doMoreThings();
/*!
* Checks that the things it does are the best
*/
checkBest();
}
But when I run `doxygen` on this it seems to format the inside blocks into code fragments, as if the `@code` or `\code` commands were used (which they were not). I would like the in-body comments to be formatted like normal text.
Has anybody encountered this before? Thanks. | 0 | [
2,
107,
15161,
1863,
19,
8,
9760,
7534,
800,
3726,
3726,
31,
57,
109,
1797,
56,
31,
259,
20,
4492,
29,
19,
8,
9760,
7534,
101,
86,
45,
13,
118,
2483,
187,
1637,
31,
22,
79,
14,
246,
27220,
27220,
27220,
1637,
118,
11364,
14,
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... |
Displaying database as List
===
my problem is that I don't know how exactly I can display data from the database.
Here is my DatabaseHelper activity ( I've cut not needed code ), which open/close database and create tables.
final static String PN_TABLE = "Tablica_Poniedzialek";
static final String PN_KEY_ID = "_id";
final static String PN_KEY_TYPE_OF_SESSION ="type_of_session";
final static String PN_KEY_START_TIME ="start_time";
final static String PN_KEY_END_TIME ="end_time";
final static String PN_KEY_NAME ="name";
final static String PN_KEY_ROOM ="room";
Creating and adding data to the database works fine. The problem is that I don't know how exactly I should display data inserted into the database. I've tried using Cursors and List Adapter, but it seems that I've messed up something since application is forced to close every time I am launching it in an Emulator.
This is my activity which is responsible for getting data from Database and then displaying it. I have no clue how actually I can display data as a list view. I am not sure which method would be better, the one which creates list ( I believe that it does ) or one that simply fetch data from database. But, let's say that the first one is correct, then the question is how can I actually display all the data ?
package com.projekt;
import java.util.ArrayList;
import java.util.List;
import android.app.Activity;
import android.app.ListActivity;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
public class PoniedzialekActivity extends Activity implements OnClickListener{
private Button butPnAdd;
private DatabaseHelper dbhelper;
private SQLiteDatabase db;
Cursor cursor;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.layout_poniedzialek);
butPnAdd = (Button) findViewById(R.id.butPnAdd);
butPnAdd.setOnClickListener(this);
List<Poniedzialek> lista_poniedzialek = getAllPnSession();
this.setListAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, lista_poniedzialek));
@Override
public void onClick(View v) {
if(v.getId()==R.id.butPnAdd){
Intent i = new Intent(PoniedzialekActivity.this,dodawaniePoniedzialek.class);
startActivity(i);
}
}
public List<Poniedzialek> getAllPnSession() {
List<Poniedzialek> pnsessionList = new ArrayList<Poniedzialek>();
// Wybierz cale Query
String selectQuery = "SELECT * FROM " + DatabaseHelper.PN_TABLE;
dbhelper.getWritableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null);
// petla po wszystkich rzedach & dodawanie ich do listy
if (cursor.moveToFirst()) {
do {
Poniedzialek pn = new Poniedzialek();
pn.setID(Integer.parseInt(cursor.getString(0)));
pn.setTypeOfSession(cursor.getString(1));
pn.setName(cursor.getString(2));
pn.setStartTime(cursor.getString(3));
pn.setEndTime(cursor.getString(4));
pn.setRoom(cursor.getString(5));
// Dodawanie sesji do listy
pnsessionList.add(pn);
} while (cursor.moveToNext());
}
cursor.close();
// return contact list
return pnsessionList;
}
public Cursor fetchPn() {
SQLiteDatabase db = dbhelper.getWritableDatabase();
return db.query(DatabaseHelper.PN_TABLE, new String[] {DatabaseHelper.PN_KEY_TYPE_OF_SESSION, DatabaseHelper.PN_KEY_START_TIME,
DatabaseHelper.PN_KEY_END_TIME, DatabaseHelper.PN_KEY_NAME, DatabaseHelper.PN_KEY_ROOM}, null, null, null, null, null);
}
} // end PoniedzialekActivity
This is layout_poniedzialek:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<Button
android:id="@+id/butPnAdd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/add_pn"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/tab1"
/>
<ListView
android:id="@+id/pnListView"
android:layout_width="304dp"
android:layout_height="380dp"
android:layout_gravity="center_horizontal" >
</ListView>
</LinearLayout> | 0 | [
2,
17418,
6018,
28,
968,
800,
3726,
3726,
51,
1448,
25,
30,
31,
221,
22,
38,
143,
184,
1890,
31,
92,
3042,
1054,
37,
14,
6018,
9,
235,
25,
51,
6018,
14593,
106,
2358,
13,
5,
31,
22,
195,
1077,
52,
851,
1797,
13,
6,
15,
56,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Time Difference Exists Between the Client and the Server
===
Javascript:
function setinvitexpire(){
var ee = new Date ();
ee.setTime(ee.getTime() + (365 * 24 * 3600 * 1000));
var bb = Math.round(new Date().getTime() / 1000) + (24 * 3600); // remove milliseconds
document.cookie="visit=" + bb + ";expires=" + ee.toGMTString();
}
setinvitexpire();
PHP:
<?php
if(isset($_COOKIE['visit'])){
echo date('m/d/Y g:i A', $_COOKIE['visit']);
echo "<br>";
}
?>
I get:
06/26/2012 11:57 AM
instead of:
06/26/2012 18:07 AM
because the current time in my country is **06/25/2012 18:07 AM**
How can I resolve this and simply save the current time + 24hours in a cookie ? | 0 | [
2,
85,
2841,
5636,
128,
14,
6819,
17,
14,
8128,
800,
3726,
3726,
8247,
8741,
45,
1990,
309,
108,
8901,
6899,
7735,
5,
6,
1,
4033,
13,
2851,
800,
78,
1231,
13,
5,
6,
73,
13,
2851,
9,
3554,
891,
5,
2851,
9,
3060,
891,
5,
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... |
Sass @each loops in scss
===
I had a lot of repeating code in my css and was looking for a better way to organize it. Where to start? I installed Sass and setup my scss file.
I had some button classes like blue, green, red using image sprite. Basically all the code was the same but color and positions. | 0 | [
2,
9233,
18,
13,
1,
14322,
19661,
19,
4729,
18,
18,
800,
3726,
3726,
31,
41,
21,
865,
16,
17389,
1797,
19,
51,
272,
18,
18,
17,
23,
699,
26,
21,
574,
161,
20,
9213,
32,
9,
113,
20,
799,
60,
31,
4066,
9233,
18,
17,
18161,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
convert mealmaster and mastercook recipes A.K.A. parse and recognize text lines
===
I am trying to convert (free) recipes mostly saved in mealmaster and mastercook's formats.
(here you can find some to download: [http://home.earthlink.net/~darkstar105/][1] (it's not my site)). I'd like to create XML files from them.
The problem is that they are complex to convert since there aren't fixed rules for all.
All that I've done for now (in Java) probably save 80% of the ingredients correctly, while for the others I fail to understand where ingredients begin and end and what is an ingredient and what is a measurement.
Those are some examples:
Mastercook:
* Exported from MasterCook II *
A Texas Breakfast Casserole
Recipe By :
Serving Size : 8 Preparation Time :0:10
Categories : Casseroles Breakfast
enter code here
Amount Measure Ingredient -- Preparation Method
-------- ------------ --------------------------------
1 Can Crescent Rolls
1 Pound Sausage -- cooked and drained
Fresh Mushrooms -- sliced
3/4 Pound Monterey Jack Cheese -- grated
6 Eggs -- beaten
1 Can Cream Of Onion Soup
Line a 13x9 inch Pyrex dish with rolls, sealing perforations. Cover with sausage, mushrooms and half the cheese. Mix eggs with soup and pour over casserole. Sprinkle remaining cheese on top. Chill overnight. Bake at 350 for 1 hour. Note: For variation, you can use cooked, crumbled bacon or bite-sized pieces of ham instead of sausage.
Mealmaster:
---------- Recipe via Meal-Master (tm) v8.05
Title: Baked Breakfast Apples
Categories: Brunch, Fruits
Yield: 2 servings
2 md Apples; cut in bite-size chu
2 tb Snipped dates
1/2 ts Ground cinnamon
1/2 c Apple juice
2 tb Raspberry all-fruit spread
1/4 c Reduced-fat granola
In two individual casseroles combine the apples and dates. Sprinkle
with
etc.
(SO formatting is definitely not helping me here)
A parser for those two recipes seems easy, but it should work for all the variations those two programs allow.
Mastercook seems to be the easier one, since I can use the ----- to determine where an Amount/Measure/Ingredient start and finish, but I'm not sure how to find the end of the ingredients list, since sometimes there are more spaces.
Mealmaster makes it more difficult by having some recipes with two colums :(
Note that mealmaster has some kind of documentation for the exported files, but there is a slightly hilarous/depressing note with it. :/
> NOTE: Beginning with v8.03, Meal-Master will attempt to align
the quantity, unit, and name information prior to import.
This means that ingredient lines do not have to follow the
column alignment above, as Meal-Master will automatically
align the quantity, unit, and name fields as long as they
contain valid data.
[1]: http://home.earthlink.net/~darkstar105/ | 0 | [
2,
8406,
7242,
4594,
17,
1129,
20840,
22229,
21,
9,
197,
9,
58,
9,
2017,
870,
17,
5844,
1854,
1560,
800,
3726,
3726,
31,
589,
749,
20,
8406,
13,
5,
4639,
6,
22229,
1555,
4377,
19,
7242,
4594,
17,
1129,
20840,
22,
18,
13767,
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... |
Naming convention for same implementation in different languages?
===
This is rather about avoiding confusion in the documentation. We use Enterprise Architect and we have 5 different implementations for doing more or less the same thing. We kept the name-spacing and API's almost equal for convenience reasons due the coding.
Now the problem pops up when we document the code. We do lots of behavioral and sequence diagrams and there its rather easy to indicate for which language it is. In package overviews we experienced more problems and we currently solve it by prefixing package titles with JS,AS,C etc..
The question is, is it good practice to keep API's and naming equal across different languages ?
Thank you | 0 | [
2,
10929,
3087,
26,
205,
6123,
19,
421,
2556,
60,
800,
3726,
3726,
48,
25,
864,
88,
10298,
5677,
19,
14,
13945,
9,
95,
275,
6002,
3338,
17,
95,
57,
331,
421,
6123,
18,
26,
845,
91,
54,
787,
14,
205,
584,
9,
95,
1025,
14,
204... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Custom request header not getting fetched in WCF project?
===
I am calling my server side code via this code:
$.ajax({
type: "POST",
contentType: "application/json; charset=utf-8",
beforeSend: function (xhr) {
xhr.setRequestHeader("My-Key", 'MyKey123456789');
},
url: "http://xyz.com/Myhandler.ashx",
data: '{"userName":"test","password":"test"}',
dataType: "json",
success: function (response) {
alert(response.HelloWorldResult);
},
error: function (message) {
alert("error has occured");
}
});
I am getting the value of custom header in the Myhandler.ashx handler via
public void ProcessRequest(HttpContext context)
{
context.Request.Headers["My-Key"]
Now if I change the value of url to
http://xyz.com/services/MyService.svc/mymethod
I am not getting any value for my header in my WCF Service handler:
public override void ProcessRequest(ref RequestContext requestContext)
{
i.e I am calling the following code *Headers["My-Key"]* there and it is always calling null. Why this is calling null while I am making a REST call to WCF service? | 0 | [
2,
5816,
3772,
157,
106,
52,
1017,
13,
28998,
19,
11801,
410,
669,
60,
800,
3726,
3726,
31,
589,
2555,
51,
8128,
270,
1797,
1197,
48,
1797,
45,
5579,
9,
6881,
7522,
5,
1,
1001,
45,
13,
7,
6962,
7,
15,
2331,
4474,
45,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
sms gateway api for t-mobile uk
===
I am going to implement SMS sending from my website using any api or gateway.(within UK only)
I see many sms gateway and api provider they charge differently .
what I want is to know if there is any option that I implement this without using or buy credit from any other website that provide api or gateway, but it would be deduct from my own current provider (t-mobile).
because I am willing to send approx 10000 sms/per month.
or is the any other way to implement this without any cost.
or any other way to implement without using api or gateway
thanks for your time
and sorry for my bad english
| 0 | [
2,
7613,
18,
12171,
21,
2159,
26,
13,
38,
8,
12571,
1063,
800,
3726,
3726,
31,
589,
228,
20,
8713,
7613,
18,
4907,
37,
51,
2271,
568,
186,
21,
2159,
54,
12171,
9,
5,
1410,
108,
1063,
104,
6,
31,
196,
151,
7613,
18,
12171,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Banner exchange for iPhone apps
===
Does anyone know of or use any banner exchanges to help publicise their iPhone app?
I'm currently using tapfortap.com in my apps which is free and works quite well, but they don't have massive capacity so I end up collecting more credits than I can spend.
I thought flurry's app circle might be this kind of thing but it's really just an advertising platform.
Thanks. | 0 | [
2,
7492,
1950,
26,
21024,
4865,
18,
800,
3726,
3726,
630,
1276,
143,
16,
54,
275,
186,
7492,
1950,
18,
20,
448,
317,
2628,
66,
21024,
4865,
60,
31,
22,
79,
871,
568,
5526,
6469,
2552,
9,
960,
19,
51,
4865,
18,
56,
25,
551,
17,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get the present dimension of a JFrame during run time
===
I want to get the present size of my Jframe whenever i click on the button1. This is the code which i have written in my button1clickevent initially when i click on the button i do get a width and height but when i change the size of my Jframe and then again i click on button1 i get the same width and height as i got earlier.The values are not changing anytime.
AppDisplay ap=new AppDisplay();
int f12;
f12=ap.getContentPane().getSize().width;
System.out.println(f12+"\n");
f12=ap.getContentPane().getSize().height;
System.out.println(f12);
| 0 | [
2,
184,
20,
164,
14,
734,
9547,
16,
21,
487,
8361,
112,
485,
85,
800,
3726,
3726,
31,
259,
20,
164,
14,
734,
1072,
16,
51,
487,
8361,
6634,
31,
10840,
27,
14,
5167,
165,
9,
48,
25,
14,
1797,
56,
31,
57,
642,
19,
51,
5167,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
detect if word is Noun, Verb or Adjective
===
In my ios app I have an area where the user enters a word and I need to detect if that is a Noun, Verb or Adjective and return it. What database can I use that will do this.It can be a website interface i need to be able to create the interface and display the output. Thank You. | 0 | [
2,
9092,
100,
833,
25,
12072,
15,
9504,
54,
20535,
800,
3726,
3726,
19,
51,
13,
7760,
4865,
31,
57,
40,
217,
113,
14,
4155,
8104,
21,
833,
17,
31,
376,
20,
9092,
100,
30,
25,
21,
12072,
15,
9504,
54,
20535,
17,
788,
32,
9,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
copy shared files/folders using net share migrate on linux
===
I am trying copy the shared files/folders from others computers on my network via command line from linux ( specifically ubuntu )/
There are both linux and windows computers on my network.
Currently I am trying the following command which is executing successfully **but without any result** (it does not copy that shared file/folder on the network). But I want them to be copied to my localhost.
net rpc share migrate shares <sharedfiles> -S 192.168.12.23 --destination=localhost
To view the shared folders(to get the value of 'sharedfiles') on a particular host I am using this command :
net rpc share list -I 192.168.12.23 | 2 | [
2,
4344,
2592,
6488,
118,
8814,
445,
568,
4275,
1891,
22985,
27,
13024,
800,
3726,
3726,
31,
589,
749,
4344,
14,
2592,
6488,
118,
8814,
445,
37,
654,
7774,
27,
51,
982,
1197,
1202,
293,
37,
13024,
13,
5,
3524,
287,
12968,
2473,
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... |
Explain monomorphism restriction to me please?
===
I started doing 99 haskell problems and I was on [problem 7](http://www.haskell.org/haskellwiki/99_questions/Solutions/7#column-one) and my unittests were blowing up.
Apparently, it's due to this: http://www.haskell.org/haskellwiki/Monomorphism_restriction
I just wanted to make sure I understood this correctly because I'm kinda confused.
situation 1: func `a` is defined with no type def or with a non-strict type def and then used once, the compiler has no issues infering the type at compile time.
situation 2: the same func `a` is used many times in the program, the compiler can't be 100% sure what the type is unless it recomputes the function for the given arguments.
To avoid the computation loss, ghc complains to the programmer that it needs a strict type def on `a`
to work correctly.
I think in my situation, `assertEqual` has the type def of
assertEqual :: (Eq a, Show a) => String -> a -> a -> Assertion
I was getting an error when `test3` was defined that I interpreted as saying that it had 2 possible types for the return of `testcase3` (Show and Eq) and didn't know how to continue.
Does that sound correct or am I completely off?
problem7.hs:
-- # Problem 7
-- Flatten a nested list structure.
import Test.HUnit
-- Solution
data NestedList a = Elem a | List [NestedList a]
flatten :: NestedList a -> [a]
flatten (Elem x) = [x]
flatten (List x) = concatMap flatten x
-- Tests
testcase1 = flatten (Elem 5)
assertion1 = [5]
testcase2 = flatten (List [Elem 1, List [Elem 2, List [Elem 3, Elem 4], Elem 5]])
assertion2 = [1,2,3,4,5]
-- This explodes
-- testcase3 = flatten (List [])
-- so does this:
-- testcase3' = flatten (List []) :: Eq a => [a]
-- this does not
testcase3'' = flatten (List []) :: Num a => [a]
-- type def based off `:t assertEqual`
assertEmptyList :: (Eq a, Show a) => String -> [a] -> Assertion
assertEmptyList str xs = assertEqual str xs []
test1 = TestCase $ assertEqual "" testcase1 assertion1
test2 = TestCase $ assertEqual "" testcase2 assertion2
test3 = TestCase $ assertEmptyList "" testcase3''
tests = TestList [test1, test2, test3]
-- Main
main = runTestTT tests
1st situation: `testcase3 = flatten (List [])`
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( problem7.hs, interpreted )
problem7.hs:29:20:
Ambiguous type variable `a0' in the constraints:
(Eq a0)
arising from a use of `assertEmptyList' at problem7.hs:29:20-34
(Show a0)
arising from a use of `assertEmptyList' at problem7.hs:29:20-34
Probable fix: add a type signature that fixes these type variable(s)
In the second argument of `($)', namely
`assertEmptyList "" testcase3'
In the expression: TestCase $ assertEmptyList "" testcase3
In an equation for `test3':
test3 = TestCase $ assertEmptyList "" testcase3
Failed, modules loaded: none.
Prelude>
2nd situation: `testcase3 = flatten (List []) :: Eq a => [a]`
GHCi, version 7.4.2: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main ( problem7.hs, interpreted )
problem7.hs:22:13:
Ambiguous type variable `a0' in the constraints:
(Eq a0)
arising from an expression type signature at problem7.hs:22:13-44
(Show a0)
arising from a use of `assertEmptyList' at problem7.hs:29:20-34
Possible cause: the monomorphism restriction applied to the following:
testcase3 :: [a0] (bound at problem7.hs:22:1)
Probable fix: give these definition(s) an explicit type signature
or use -XNoMonomorphismRestriction
In the expression: flatten (List []) :: Eq a => [a]
In an equation for `testcase3':
testcase3 = flatten (List []) :: Eq a => [a]
Failed, modules loaded: none. | 0 | [
2,
3271,
4129,
13348,
18732,
20,
55,
2247,
60,
800,
3726,
3726,
31,
373,
845,
7787,
63,
16507,
1716,
17,
31,
23,
27,
636,
2740,
2854,
79,
453,
500,
5,
21127,
6903,
6483,
9,
6482,
16507,
9,
5583,
118,
6482,
16507,
17375,
118,
3483,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Workaround for MySQL trigger error when updating table which is already being used
===
I created a trigger which throws an error whenever new entry is stored. Here is the trigger:
CREATE TRIGGER `htmlid` BEFORE INSERT ON `makelist_food`
FOR EACH ROW BEGIN
IF (NEW.html_id IS NULL) THEN
INSERT INTO makelist_food SET html_id = CONCAT('f', NEW.id);
END IF;
END
And the error is: #1442 - Can't update table 'makelist_food' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
There are many discussions out there about this error but I haven't found any solution or workaround. Here is an answer from 2010 [stackoverflow.com/questions/1582683/mysql-trigger-stored-trigger-is-already-used-by-statement-which-invoked-stored-t][1] which states that this is simply not supported in MySQL.
Since this is more than 2 years old answer I was wondering if SO knows some workaround for this problem. I couldn't find any.
[1]: http://stackoverflow.com/questions/1582683/mysql-trigger-stored-trigger-is-already-used-by-statement-which-invoked-stored-t | 0 | [
2,
170,
10037,
26,
51,
18,
22402,
7286,
7019,
76,
71,
43,
1880,
859,
56,
25,
614,
142,
147,
800,
3726,
3726,
31,
679,
21,
7286,
56,
13566,
40,
7019,
6634,
78,
2792,
25,
8214,
9,
235,
25,
14,
7286,
45,
1600,
7286,
13,
1,
15895,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Change opacity on hover jQuery
===
I have been trying to make it so that when you hover over any part in the box then the box-hover (div) will fadein to opacity 0.7 so that it looks mostly black but little transparent.
But nothing I have done is working. And I don't want to assign it with ID since there will be more boxes.
Here is the code I am trying to make: http://pastebin.com/3ZRcrx57
Thanks | 0 | [
2,
753,
13,
11490,
5788,
27,
21350,
487,
8190,
93,
800,
3726,
3726,
31,
57,
74,
749,
20,
233,
32,
86,
30,
76,
42,
21350,
84,
186,
141,
19,
14,
1649,
94,
14,
1649,
8,
252,
2549,
13,
5,
12916,
6,
129,
11381,
108,
20,
13,
11490... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 capture screen with Blue-Ray DVD played on Windows 7 or 8?
===
I am trying to capture entire screen and audio of a pc running windows 7. Most of time there is no problem but when a blue-ray DVD is played back in a window, not only contents of the windows is not captureable but neither is the audio.
Does anybody here know to work around such an issue?
Thanks in advance!! | 0 | [
2,
184,
20,
3683,
2324,
29,
705,
8,
2787,
3527,
257,
27,
1936,
453,
54,
469,
60,
800,
3726,
3726,
31,
589,
749,
20,
3683,
1078,
2324,
17,
4023,
16,
21,
5168,
946,
1936,
453,
9,
127,
16,
85,
80,
25,
90,
1448,
47,
76,
21,
705,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pass ArrayList between two activities using Parcelable and Intent
===
At the moment I have the problem to pass an `ArrayList<MyClass>` from one activity to another. I tried to implement Parcelable in MyClass and use an intent in the activity but it seems that I did something wrong. When I call `startActivity` with the `intent` the window of the app freezes and I get the Error "!!! Failed Bender Transaction !!!". I've read here and on some other places that the size of the transaction may cause the error. MyClass holds one Image. In the moment `startActivity` is called the `ArrayList` holds five elements with one bitmap for each element. The size of all images together is below 70kb.
Here is my actual code:
public class MyClass implements Parcelable {
public enum Type {
VIDEO, AUDIO
}
private int id;
private String name;
private String url;
private double longitude;
private double latitude;
private double gpsDistance;
private String description;
private String thumb;
private Bitmap thumbpic;
private Type type;
public MyClass() {
this.gpsDistance = 0;
}
public MyClass(Parcel in) {
readFromParcel(in);
}
/* Setter & Getter */
public void writeToParcel(Parcel dest, int flags) {
dest.writeInt(id);
dest.writeString(name);
dest.writeString(url);
dest.writeDouble(longitude);
dest.writeDouble(latitude);
dest.writeDouble(gpsDistance);
dest.writeString(description);
dest.writeString(thumb);
dest.writeParcelable(thumbpic, flags);
dest.writeString((type == null) ? "" : type.name());
}
private void readFromParcel(Parcel in) {
this.id = in.readInt();
this.name = in.readString();
this.url = in.readString();
this.longitude = in.readDouble();
this.latitude = in.readDouble();
this.gpsDistance = in.readDouble();
this.description = in.readString();
this.thumb = in.readString();
this.thumbpic = (Bitmap) in.readParcelable(getClass().getClassLoader());
try {
type = Type.valueOf(in.readString());
} catch (IllegalArgumentException x) {
type = null;
}
}
public static final Parcelable.Creator CREATOR = new Parcelable.Creator() {
public MyClass createFromParcel(Parcel in) {
return new MyClass(in);
}
public MyClass[] newArray(int size) {
return new MyClass[size];
}
};
}
Some code snippets from the activity (`MainActivity`) which starts the second one (`ListActivity`)
ArrayList<Content> contentElements = new ArrayList<Content>();
Intent intent = new Intent(MainActivity.this,ListActivity.class);
intent.putParcelableArrayListExtra("content", contentElements);
The handling in the `ListActivity`
Intent i = getIntent();
contentElements= i.getParcelableArrayListExtra("content");
Does someone have an idea what caused this problem and have solution or an alternative approach?
Thanks a lot! | 0 | [
2,
1477,
7718,
5739,
128,
81,
1648,
568,
16554,
579,
17,
6936,
800,
3726,
3726,
35,
14,
688,
31,
57,
14,
1448,
20,
1477,
40,
13,
1,
8576,
93,
5739,
1,
915,
1898,
1,
37,
53,
2358,
20,
226,
9,
31,
794,
20,
8713,
16554,
579,
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... |
"Executing SQL directly; no cursor." error in Access 2007 VB code
===
I've got a stored procedure I run from VB code in an Access 2007 database. Usually the code runs fine however sometimes I receive the following error:
Error # -2147217900 was generated by Microsoft OLE DB Provider for ODBC Drivers
[Microsoft][SQL Server Native Client 10.0][SQL Server]Executing SQL directly; no cursor.
I have done quite a bit of research on this and I haven't come up with much. There are two sources I've seen; one of the reasons is insufficient permissions and the other has to do with a problem in the Stored Procedure itself. I no the permissions is not an issue. Also the stored procedure runs absolutely fine in management studio no matter how many times I run it.
Help Please!!! | 0 | [
2,
13,
7,
1706,
17194,
1203,
4444,
255,
1703,
73,
90,
29588,
9,
7,
7019,
19,
1381,
624,
13,
20468,
1797,
800,
3726,
3726,
31,
22,
195,
330,
21,
8214,
7004,
31,
485,
37,
13,
20468,
1797,
19,
40,
1381,
624,
6018,
9,
951,
14,
179... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
iPhone app is automatically being logged off/killed after approximately every 20 minutes
===
PLATFORM AND VERSION iOS
iPhone 4s, iOS version 5.1.1
DESCRIPTION OF PROBLEM
Whenever my application is placed in the background it is automatically being logged off / killed after approximately every 20 minutes. In our application we have the ability to upload data if the app is moved to background. If I comment out this section, the application is no longer killed.
The application gets logged off (killed by the operating system) even if there is no activity or no user intervention and its just sitting in the background.
STEPS TO REPRODUCE
Please find below the code snippet which is uploading the attachments
in the background.
-(void) endTaskWidthIdentifier:(NSNumber *)paramIdentifier{
UIBackgroundTaskIdentifier identifier = [paramIdentifier integerValue];
[[UIApplication sharedApplication] endBackgroundTask:identifier]; }
- (void)applicationDidEnterBackground:(UIApplication *)application {
backgroundTaskIdentifier = [application
beginBackgroundTaskWithExpirationHandler:^{
NSNumber *backgroundTask = [NSNumber
numberWithInteger:backgroundTaskIdentifier];
[self
performSelectorOnMainThread:@selector(endTaskWidthIdentifier:)
withObject:backgroundTask waitUntilDone:YES];
backgroundTaskIdentifier = UIBackgroundTaskInvalid;
}];
}
Once this code is executed, the application logs out after 15-20 minutes when kept in the background with no user intervention.
If I comment this code, application remains in the background and does not exits and remains in the suspended mode.
Question:
What is wrong with this code. What is this code doing that it should not?
| 0 | [
2,
21024,
4865,
25,
7499,
142,
13,
19287,
168,
118,
7577,
69,
75,
1357,
352,
434,
902,
800,
3726,
3726,
2452,
17,
615,
13,
7760,
21024,
268,
18,
15,
13,
7760,
615,
331,
9,
165,
9,
165,
5318,
16,
1448,
6634,
51,
3010,
25,
1037,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Drawing a Retina-resolution Image Reflection
===
I'm having difficulty dynamically drawing a reflection of a UIImage at Retina resolution (2x scale). Apple's sample code for drawing reflections was never updated to take advantage of the higher resolution. Is there an easy solution? | 0 | [
2,
3533,
21,
24325,
8,
29346,
1961,
9138,
800,
3726,
3726,
31,
22,
79,
452,
6967,
7782,
1326,
3533,
21,
9138,
16,
21,
13,
5661,
22039,
35,
24325,
4302,
13,
5,
135,
396,
3464,
6,
9,
4037,
22,
18,
5717,
1797,
26,
3533,
20498,
23,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... |
Looping through MySQL left join in php vs. 2 separate queries
===
I have a simple question and answer section on my website that allows comments. I currently populate the answers using a loop and a $_GET['id'] value. Here is my query
<?php
try{
$parent=$_GET['id'];
$post_type = "2";
$dbh = new PDO("mysql:host=$mysql_hostname;dbname=$mysql_dbname", $mysql_username, $mysql_password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $dbh->prepare(
"SELECT p.post_id, p.content, p.author, p.created, pc.comment_id AS comment_id, pc.content AS comment_content
FROM posts AS p
LEFT JOIN posts_comments AS pc
ON p.post_id = pc.parent_id
WHERE p.post_type = :post_type AND p.parent = :parent ");
$stmt->bindParam(':parent', $parent, PDO::PARAM_INT);
$stmt->bindParam(':post_type', $post_type, PDO::PARAM_INT);
$stmt->execute();
$answers_array = array();
while ($answers = $stmt->fetch(PDO::FETCH_ASSOC))
{
$answers_array[]= $answers;
}
}
catch(Exception $e)
{
echo $e;
echo ("error");
}
?>
This returns the following array
Array (
[0] => Array (
[post_id] => 12
[content] => I have an answer
[author] => Author1
[created] => 2012-06-09 21:43:56
[comment_id] =>
[comment_content] => )
[1] => Array (
[post_id] => 13
[content] => My second answer
[author] => Author1
[created] => 2012-06-10 06:30:58
[comment_id] => 35
[comment_content] => 1st comment )
[2] => Array (
[post_id] => 13
[content] => My second answer
[author] => Author2
[created] => 2012-06-10 06:30:58
[comment_id] => 36
[comment_content] => 2nd comment? )
[3] => Array (
[post_id] => 13
[content] => My second answer
[author] => Author2
[created] => 2012-06-10 06:30:58
[comment_id] => 37
[comment_content] => 3rd comment )
[4] => Array (
[post_id] => 14
[content] => Here is another answer
[author] => Author2
[created] => 2012-06-10 07:11:57
[comment_id] =>
[comment_content] => )
)
On my question.php page I know I will need to loop through these results with something like
<?php $answer_count = count($answers_array);
for($x = 0; $x < $answer_count; $x++) {
$answers = $answers_array[$x];
}
?>
My question -
I don't know whether to use two separate queries to pull the comments associated with each answer or use the join I have above and build another array with php. I don't know how to do that honestly. If I use the join I would like an array that looks like this but I'm not sure how to build it using a loop in php.
Array (
[0] => Array (
[post_id] => 12
[content] => I have an answer
[author] => Author1
[created] => 2012-06-09 21:43:56
[comment_id] =>
[comment_content] => )
[1] => Array (
[post_id] => 13
[content] => My second answer
[author] => Author1
[created] => 2012-06-10 06:30:58
Array(
[1] => Array (
[comment_id] => 35
[comment_content] => 1st comment)
[2] => Array (
[comment_id] => 36
[comment_content] => 2nd comment)
[3] => Array (
[comment_id] => 37
[comment_content] => 3rd comment))
[2] => Array (
[post_id] => 14
[content] => Here is another answer
[author] => Author2
[created] => 2012-06-10 07:11:57
[comment_id] =>
[comment_content] => ) )
Once I have an array like that I was thinking I could do a for each inside my original php loop on the question.php page. | 0 | [
2,
5293,
68,
120,
51,
18,
22402,
225,
1865,
19,
13,
26120,
4611,
9,
172,
1725,
9386,
2829,
800,
3726,
3726,
31,
57,
21,
1935,
1301,
17,
1623,
1050,
27,
51,
2271,
30,
2965,
7534,
9,
31,
871,
1675,
12383,
14,
6709,
568,
21,
5293,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Need recommendations on pushing the envelope with SqlBulkCopy on SQL Server
===
I am designing an application, one aspect of which is that it is supposed to be able to receive massive amounts of data into SQL database. I designed the database stricture as a single table with bigint identity, something like this one:
CREATE TABLE MainTable
(
_id bigint IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
field1, field2, ...
)
I will omit how am I intending to perform queries, since it is irrelevant to the question I have.
I have written a prototype, which inserts data into this table using SqlBulkCopy. It seemed to work very well in the lab. I was able to insert tens of millions records at a rate of ~3K records/sec (full record itself is rather large, ~4K). Since the only index on this table is autoincrementing bigint, I have not seen a slowdown even after significant amount of rows was pushed.
Considering that the lab SQL server was a virtual machine with relatively weak configuration (4Gb RAM, shared with other VMs disk sybsystem), I was expecting to get significantly better throughput on the physical machine, but it didn't happen, or lets say the performance increase was negligible. I could, maybe get 25% faster inserts on physical machine. Even after I configured 3-drive RAID0, which performed 3 times faster than a single drive (measured by a benchmarking software), I got no improvement. Basically: faster drive subsystem, dedicated physical CPU and double RAM almost didn't translate into any performance gain.
I then repeated the test using biggest instance on Azure (8 cores, 16Gb), and I got the same result. So, adding more cores did not change insert speed.
At this time I have played around with following software parameters without any significant performance gain:
* Modifying SqlBulkInsert.BatchSize parameter
* Inserting from multiple threads simultaneously, and adjusting # of threads
* Using table lock option on SqlBulkInsert
* Eliminating network latency by inserting from a local process using shared memory driver
I am trying to increase performance at least 2-3 times, and my original idea was that throwing more hardware would get tings done, but so far it doesn't.
So, can someone recommend me:
* What resource could be suspected a bottleneck here? How to confirm?
* Is there a methodology I could try to get reliably scalable bulk insert improvement considering there is a single SQL server system?
| 0 | [
2,
376,
12121,
27,
5076,
14,
9127,
29,
4444,
255,
9077,
197,
19625,
27,
4444,
255,
8128,
800,
3726,
3726,
31,
589,
15026,
40,
3010,
15,
53,
7289,
16,
56,
25,
30,
32,
25,
2293,
20,
44,
777,
20,
2588,
3787,
8545,
16,
1054,
77,
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... |
Put JButton in bottom right
===
I need to put a button in the bottom right of an otherwise empty JPanel
+-----------------------------------+
| |
| |
| |
| |
| |
| |
| |
| |
| +-----------+|
| | Click Me! ||
| +-----------+|
+-----------------------------------+
How do I do that? It should be easy right? I would like to find the correct layout manager rather than using a sequence of nested panels.
JPanel panel = new JPanel();
panel.setLayout(new SomeKindOfLayoutManagerThatDoesThis());
panel.add(new JButton("Click Me!"), SETTINGS);
| 0 | [
2,
442,
487,
811,
444,
19,
2129,
193,
800,
3726,
3726,
31,
376,
20,
442,
21,
5167,
19,
14,
2129,
193,
16,
40,
3190,
2424,
487,
3206,
532,
2754,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
hiding unnecessary fields in Access Report
===
At my workplace there is a "Daily Feedback" database where details are entered of any errors made by Customer Service Officers (CSOs), such as who made the mistake, when, and what service it was for. this is so we can gather data which would show areas where CSO's are repeatedly making mistakes so we can feed this back to them and train them in those areas if need be.
i currently have a report where an CSOs name is entered along with a date range and it produces the report showing the number of errors made for each service for that date range.
the code used is -
=Sum(IIf([Service]="Housing",1,0))
=Sum(IIf([Service]="Environmental Health",1,0))
etc etc for each Service.
The problem i have is that not every CSO does EVERY service and so there are usually a few results showing as "0". and i cannot be sure if thats because they dont do the service or if they are just very good at that service.
Being absolutely useless at SQL (or any other possible way of fixing this) i cannot figure out how to HIDE the entries that produce the zero value.
any help here would be greatly appreciated!
| 0 | [
2,
5314,
16435,
2861,
19,
1381,
1330,
800,
3726,
3726,
35,
51,
16932,
80,
25,
21,
13,
7,
9394,
102,
13111,
7,
6018,
113,
3289,
50,
1297,
16,
186,
11908,
117,
34,
7705,
365,
2041,
13,
5,
6824,
759,
6,
15,
145,
28,
72,
117,
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... |
Highlight field content onFocus
===
Can anyone enlighten me to a way I can Highlight the content of an input field OnFocus preferably by XAML only?
So if a user bring focus to a field, it will highlight the string or whatever is in there so they can for example just tab to it, and replace the existing string as soon as they start typing instead of having to manually highlight and delete it first?
I've seen answers that require code, but wondering if there's a XAML only route? Thanks! | 0 | [
2,
14373,
575,
2331,
27,
23371,
800,
3726,
3726,
92,
1276,
1957,
3130,
219,
55,
20,
21,
161,
31,
92,
14373,
14,
2331,
16,
40,
6367,
575,
27,
23371,
6369,
4801,
34,
13,
6791,
8184,
104,
60,
86,
100,
21,
4155,
1499,
1776,
20,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error RROR [08001] [IBM] SQL30081N when connecting to AS400 (iSeries) from NHibernate using C#
===
I have absolutely no experience with NHibernate so please forgive any glaring mistakes as I am learning as I go along. I have 2 boxes I can connect to running **v5r3** or **v4r3.** and I am using **NHibernate 3**. However, when I try and connect I keep getting the following exception :-
ERROR [08001] [IBM] SQL30081N A communication error has been detected.
Communication protocol being used: "TCP/IP". Communication API being used: "SOCKETS".
Location where the error was detected: "192.168.1.11". Communication function detecting the error: "connect". Protocol specific error code(s): "10061", "*", "*". SQLSTATE=08001
Below is my NHibernate configuration file:-
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.DB2400Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.DB2Driver</property>
<property name="connection.connection_string">Server=192.168.1.11;Database=TESTDB;UID=XXX;PWD=XXX; </property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
<property name="command_timeout">15000</property>
<property name="current_session_context_class">thread_static</property>
</session-factory>
</hibernate-configuration>
I am not sure if this is because the versions of AS400 are too early? my nhibernate configuration is incorrect? or I have something set up incorrectly on the AS400 itself.
Any advice would be most appreciated.
Many thanks in advance | 0 | [
2,
7019,
13,
5932,
248,
636,
3099,
18951,
500,
636,
4598,
79,
500,
4444,
255,
6571,
3980,
103,
76,
6440,
20,
28,
7114,
13,
5,
49,
8231,
6,
37,
12109,
15191,
8820,
568,
272,
5910,
800,
3726,
3726,
31,
57,
6916,
90,
1496,
29,
1210... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.focus() event is not working
===
when my php page loads some jQuery should set focus to my input textbox but it does not
I have tried css selectors like `input[tabindex=1]` and `#31` but to no avail...
here is the jQuery
$(function() {
$('input[tabindex=1]').focus(); // also tried $('#31').focus();
});
and here is the HTML
<input tabindex='1' type='text' class='tablefilter' id='31' style='width:80px;border:inset 2px grey;background-color:white;font-size:12px;border-radius:0px;-moz-border-radius:0px;-webkit-border-radius:0px;'/>
any clues as to why this isn't working? | 0 | [
2,
13,
9,
23371,
5,
6,
807,
25,
52,
638,
800,
3726,
3726,
76,
51,
13,
26120,
2478,
19069,
109,
487,
8190,
93,
378,
309,
1776,
20,
51,
6367,
1854,
5309,
47,
32,
630,
52,
31,
57,
794,
272,
18,
18,
23946,
18,
101,
13,
1,
108,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Errors With Sending Login Packet to Minecraft Server in Python
===
I have the following script, which I found online, in Python. What it does is tries to connect to a MineCraft server, first by sending a 'handshake', then sending a login request. The protocol specs can be found here: http://wiki.vg/Protocol
Anyway, the python script works fine. However, I think the second packet is encoded wrong, as when it is sent, nothing appears on the server console. The player isn't connected or anything. It just eventually times out and closes the connection due to the 'client' not logging in in time.
Basically, anyway who has experience with struct.pack() should be able to help me here. I have commented the line where I am unsure of whether I have encoded everything right. The detailed information on packing the data is shown in the link above.
Any help would be greatly appreciated, I'm pretty clueless with encoding/packing data. :(
Here's the code
import struct
import socket
import time
import urllib
import urllib2
host = str(raw_input('What is the host ip: '))
port = int(raw_input('What is the server port: '))
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host, port))
usrnm = str(raw_input('What is your username: '))
psswrd = str(raw_input('What is your password: '))
logindata = {'user':usrnm, 'password':psswrd, 'version':'12'}
data = urllib.urlencode(logindata)
print('Sending data to login.minecraft.net...')
req = urllib2.Request('https://login.minecraft.net', data)
response = urllib2.urlopen(req)
returndata = response.read()
returndata = returndata.split(":")
mcsessionid = returndata[3]
del req
del returndata
print("Session ID: " + mcsessionid)
data = {'user':usrnm,'host':host,'port':port}
enc_user = data['user'].encode('utf-16BE')
packfmt = '>bih{}shiibBB'.format(len(enc_user))
packetbytes = struct.pack(packfmt, 1, 23, len(data['user']), enc_user, 0, 0, 0, 0, 0, 0)
stringfmt = u'%(user)s;%(host)s:%(port)d'
string = stringfmt % data
structfmt = '>bh'
packetbytes = struct.pack(structfmt, 2, len(string))+string.encode('utf-16BE')
s.send(packetbytes)
connhash = s.recv(1024)
print("Connection Hash: " + connhash)
print('Sending data to http://session.minecraft.net/game/joinserver.jsp?user=' + usrnm + '&sessionId=' + mcsessionid + '&serverId=' + connhash + '...')
req = urllib.urlopen('http://session.minecraft.net/game/joinserver.jsp?user=' + usrnm + '&sessionId=' + mcsessionid + '&serverId=' + connhash)
returndata = req.read()
if(returndata == 'OK'):
print('session.minecraft.net says everything is okay, proceeding to send data to server.')
else:
print('Oops, something went wrong.')
time.sleep(5)
# All above here works perfectly.
enc_user = data['user'].encode('utf-16BE')
packfmt = '>bih{}shiibBB'.format(len(enc_user))
packetbytes = struct.pack(packfmt, 1, 23, len(data['user']), enc_user, 0, 0, 0, 0, 0, 0)
#This line is probably where something's going wrong:
packetbytes = struct.pack('>bih', 1, 23, len(data['user'])) + data['user'].encode('utf-16BE') + struct.pack('>hiibBB', 2,0,0,0,0,0)
print(len(packetbytes))
print('Sending ' + packetbytes + ' to server.')
s.send(packetbytes)
while True:
data = s.recv(1024)
if data:
print(data)
| 0 | [
2,
11908,
29,
4907,
6738,
108,
12795,
20,
1114,
7856,
8128,
19,
20059,
800,
3726,
3726,
31,
57,
14,
249,
3884,
15,
56,
31,
216,
2087,
15,
19,
20059,
9,
98,
32,
630,
25,
3919,
20,
6379,
20,
21,
1114,
7856,
8128,
15,
64,
34,
490... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
merge adjacent html table cells based on class or value
===
I have a html table with a variable number of cells.
For the sake of this example i will say 20x20 (although it's quite bigger).
This is generated via php and the dataset to populate the table has been pulled from mysql.
Each one of these cells has a numeric value, and it needs to specifically be placed where is is. So if cell A(10,15) has a value of 100, that 100 needs to specifically be on 10,15-
And while the table is being generated i have no way to analyze the positioning.
Now, many of these cells, have other adjacent cells with the same value. Either horizontally or vertically.
What i need to do is merge adjacent cells of a this table that have the same value.
This could be horizontal, vertical, or both, but still keeping it a rectangle- Nothing too funky.
For example if i have
0 1 1 1 0<br>
2 2 5 0 4<br>
5 5 5 1 4
i need to modify the colspan and/or rowspan based on value-
To be noted is that upon generation i can actually define classes or ids for each one
of these cells. Also during generation i can identify wether there will be more than one in a series in a row, but i have no way of knowing wether there will be one on the row below.
ps: i did do a bit a research and found this thread.
http://stackoverflow.com/questions/9181596/complex-table-merging-javascript-jquery-algorithm
modified the jsfiddle example to affect both colspan and rowspan of the cell but it seems to flip out when it needs to merge more that two cells-
What could be a suggested approach on the matter?
Thank you in advance | 0 | [
2,
12666,
4209,
13,
15895,
859,
2934,
432,
27,
718,
54,
1923,
800,
3726,
3726,
31,
57,
21,
13,
15895,
859,
29,
21,
7612,
234,
16,
2934,
9,
26,
14,
8132,
16,
48,
823,
31,
129,
395,
434,
396,
1323,
13,
5,
8655,
32,
22,
18,
145... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Truncating Double with VBA in excel
===
I need to truncate the amount of decimal places of my double value for display in a textbox. How would one achieve this with vba? | 0 | [
2,
22328,
68,
1494,
29,
566,
969,
19,
20700,
800,
3726,
3726,
31,
376,
20,
22328,
62,
14,
2006,
16,
26380,
1489,
16,
51,
1494,
1923,
26,
3042,
19,
21,
1854,
5309,
9,
184,
83,
53,
4689,
48,
29,
566,
969,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Add unique classes to order review's total, shipping and tax in Magento
===
For tracking purposes I need to distinguish Grand total, shipping, and tax by unique CSS classes. By default Magento adds "price" as class to all the lines in Order Review. Is there anyway to add custom classes for each line, and change price to shipping-price, tax-price and total-price?
Below is the mark-up for Order Review:
<tfoot class="test">
<tr class="first">
<td colspan="3" class="a-right" style="">
Subtotal </td>
<td class="a-right last" style="">
<span class="price">$2.99</span> </td>
</tr>
<tr>
<td colspan="3" class="a-right" style="">
Shipping & Handling (Flat Rate - Fixed) </td>
<td class="a-right last" style="">
<span class="price">$0.00</span> </td>
</tr>
<tr>
<td colspan="3" class="a-right" style="">
Tax </td>
<td class="a-right last" style=""><span class="price">$0.21</span></td>
</tr>
<tr class="last">
<td colspan="3" class="a-right" style="">
<strong>Grand Total</strong>
</td>
<td class="a-right last" style="">
<strong><span class="price">$3.20</span></strong>
</td>
</tr>
</tfoot>
Thanks,
| 0 | [
2,
3547,
2619,
2684,
20,
389,
1487,
22,
18,
600,
15,
7405,
17,
2225,
19,
4723,
17050,
800,
3726,
3726,
26,
10353,
4612,
31,
376,
20,
9705,
920,
600,
15,
7405,
15,
17,
2225,
34,
2619,
272,
18,
18,
2684,
9,
34,
12838,
4723,
17050,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android get data from gcm notification
===
is there a way how to get data from "gcm notification". Here is a part of my json string which I send with gcm: "data":{"id":"123"}} I need get value of id in my app, but I don't know how ... thanks a lot | 0 | [
2,
13005,
164,
1054,
37,
489,
9095,
52,
4634,
800,
3726,
3726,
25,
80,
21,
161,
184,
20,
164,
1054,
37,
13,
7,
10362,
79,
52,
4634,
7,
9,
235,
25,
21,
141,
16,
51,
487,
528,
3724,
56,
31,
2660,
29,
489,
9095,
45,
13,
7,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Detach process from screen session being inside screen session
===
I have an application which i schedule using screen by command:
> screen -A -m -d -S test mytestapplication
What this `mytestapplication` should do to detach his process from this `test` session, being inside this session.
Thanks! | 0 | [
2,
28683,
953,
37,
2324,
3723,
142,
572,
2324,
3723,
800,
3726,
3726,
31,
57,
40,
3010,
56,
31,
4345,
568,
2324,
34,
1202,
45,
13,
1,
2324,
13,
8,
58,
13,
8,
79,
13,
8,
43,
13,
8,
18,
1289,
51,
10543,
2552,
20669,
98,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASP.NET v4 Extensionless URL feature does not work on IIS 6.0
===
To avoid static requests impact performance, I want to use the ASP.NET v4.0 Extensionless URL feature, but it does not work.
My environment:<br />
1.windows server sp2 and IIS6<br />
2.asp.net MVC 3 with .net 4<br />
3.The site is configured for ASP.NET 4.0 and no virtual folders<br />
4.no isapi rewriting
I requested the url like "http://domain.com/home/", the get /home/eurl.axd/f7e1f50533b94f47869a8856c16dffdf/ 404 error.
I want to know how to resolve this problem?
(I need extensionless url and can not use wildcard script mapping) | 0 | [
2,
28,
306,
9,
2328,
566,
300,
3896,
923,
287,
6362,
1580,
630,
52,
170,
27,
595,
18,
400,
9,
387,
800,
3726,
3726,
20,
2658,
12038,
12279,
2261,
956,
15,
31,
259,
20,
275,
14,
28,
306,
9,
2328,
566,
300,
9,
387,
3896,
923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Simplify the Doctrine query
===
## I am new to Doctrine ORM or any ORM ##
$em = Zend_Registry::getInstance ()->entitymanager;
$p = $em->createQuery ( "
SELECT u
FROM Teon_Model_User u
WHERE u.app_auth IN (:app_auth)" );
$p->setParameter ( 'app_auth', $app_auth );
$array = $p->getArrayResult();
$customer_id = $array[0]['customer_id'];
$p = $em->createQuery ( "
SELECT p
FROM Teon_Model_Purchase p
WHERE p.customer IN (:customer_id)" );
$p->setParameter ( 'customer_id', $customer_id );
$array = $p->getArrayResult();
$purchase_id = $array[0]['id'];
$p = $em->createQuery ( "
SELECT pm
FROM Teon_Model_PurchaseManual pm
WHERE pm.purchase_id IN (:purchase_id)" );
$p->setParameter ( 'purchase_id', $purchase_id );
$array = $p->getArrayResult();
$m_id = $array[0]['manual_id'];
Can you simplify this query, it looks so stupid, I am using Doctrine in zend framework
this query is to authenticate the user whether he has manual_id in his purchases by supplying a authentication code.. | 0 | [
2,
28257,
14,
7521,
25597,
800,
3726,
3726,
6926,
5910,
31,
589,
78,
20,
7521,
54,
79,
54,
186,
54,
79,
6926,
5910,
5579,
1503,
800,
10526,
43,
1,
12463,
702,
622,
45,
45,
3060,
108,
384,
2416,
13,
5,
6,
8,
1,
2291,
856,
22256... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Selectnodes not working in vb.net
===
Hai i am having xml like
<author-group id="a001">
<author id="aa001">
<given-name id="g001">Name</given-name>
<surname id="s001">Name</surname>
</author>
<author id="aa002">
<given-name id="g002">Name</given-name>
<surname id="s002">Name</surname>
</author>
<author id="aa003">
<given-name id="g003">Name</given-name>
<surname id="s003">Name</surname>
</author>
</author-group>
I want nodelist of author so i used the follwing code
Dim xDom As New Xml.XmlDocument
Dim Lst As XmlNodeList = xDom.SelectNodes("//author")
Dim Cnt as Integer =Lst.Count()
Here the Cnt value is zero i dont know why its working. And i am using the UTF-8 encoded xml file.
| 0 | [
2,
5407,
251,
3196,
52,
638,
19,
13,
20468,
9,
2328,
800,
3726,
3726,
8349,
31,
589,
452,
23504,
101,
13,
1,
10007,
8,
8024,
4924,
3726,
7,
58,
18951,
7,
1,
13,
1,
10007,
4924,
3726,
7,
6887,
18951,
7,
1,
13,
1,
8448,
103,
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... |
onBackPressed() gets called automatically in ActivityGroup
===
I have a question about `ActivityGroup`. Let say I have **within the same tab** two activities. For developing this structure I used and ActivityGroup like this:
http://pastie.org/4197603
In the class extending the ActivityGroup I have the following method:
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
onBackPressed();
return true;
}
return super.onKeyUp(keyCode, event);
}
@Override
public void onBackPressed() {
int length = mIdList.size();
if ( length > 1) {
Activity current = getLocalActivityManager().getActivity(mIdList.get(length-1));
current.onBackPressed();
}
}
Now in the ActivityGroup I have retaind the first activity:
**Activity A**
When I click on a listView I get to Activity B
**Activity B**
I have also this method
public void onBackPressed(){
System.out.println("activity B");
}
Now, from Activity B I move to another class which I **outside the ActivityGroup**, let say Activity C.
And here is my problem:
When I come back from **Activity C** using the back button of the device I get to **Activity B** and then automatically(without pressing again the back button) **onBackPressed()** method of the ActivityGroup gets called. And this really complicates things for me.
Do you have any idea how could I stop this weird behaviour?
**IMPORTANT:** Activity C is not contained in the ActivityGroup(only Activity A and Activity B are there.)
| 0 | [
2,
27,
1958,
5890,
69,
5,
6,
3049,
227,
7499,
19,
2358,
8024,
800,
3726,
3726,
31,
57,
21,
1301,
88,
13,
1,
19348,
8024,
1,
9,
408,
395,
31,
57,
13,
1409,
1410,
108,
14,
205,
6523,
1409,
81,
1648,
9,
26,
3561,
48,
1411,
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... |
Python + Django - Update value in list of lists
===
I'm trying to update values in a list of lists using the following source code:
target_agreement = get_object_or_404(TargetAgreement.objects, pk=agreement_id)
target_category_set = TargetCategory.objects.filter(company=target_agreement.company, is_active=True).order_by('position')
category_targets = []
if target_category_set:
totals = [[0]*3]*len(target_category_set) #list of lists with list on level 2 having length of 3
else:
totals = [[0]*3]*1
for (index1,target_category) in enumerate(target_category_set):
category_targets_temp = []
for (index2,target) in enumerate(target_category.category_targets.filter(user=request.user, agreement=target_agreement)):
category_targets_temp.append(target)
print "*******"
print "index is: "
print index1
print totals[index1][0]
totals[index1][0] = totals[index1][0] + target.weight
print totals[index1][0]
print "totals are"
print totals
print "*******"
print "final result"
print totals[index1][0]
print totals
print "-----"
category_targets.append(category_targets_temp)
print totals
The behavior I do not understand is that totals[index1][0] = totals[index1][0] + target.weight is not only updating the first element in the list referenced by index1, but all first elements in all lists.
The result is like the following:
[[88, 0, 0], [88, 0, 0], [88, 0, 0], [88, 0, 0]]
But I would have expected:
[[36, 0, 0], [50, 0, 0], [1, 0, 0], [1, 0, 0]]
Can somebody clarify what I did wrong. Thanks for your help. | 0 | [
2,
20059,
2754,
3857,
14541,
13,
8,
11100,
1923,
19,
968,
16,
7227,
800,
3726,
3726,
31,
22,
79,
749,
20,
11100,
4070,
19,
21,
968,
16,
7227,
568,
14,
249,
1267,
1797,
45,
2935,
1,
3302,
99,
9632,
800,
164,
1,
23793,
1,
248,
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... |
Ruby app running on Sinatra using HAML, can't access files in uploads directory?
===
I have a Ruby app which is an Image Resizer. It uses the RMagick gem to do this. The app asks the user to upload a file, and then resizes it and saves the newly generated file.
It seems that Sinatra by default puts all uploaded files into the 'uploads' directory, and the newly generated file also seems to be saved there. I am assuming this is default behavior, not sure how to change this, but it isn't an immediate problem at the moment (although if you know how to do this, that would be appreciated too).
Now, in my 'success.haml' page which is displayed after the file is generated correctly, I am trying to display the newly generated image with a simple img tag. The path to the file is found in @filepath, so when I did:
%img(src=@filepath)
the HTML rendered (when inspected using Firebug) is correctly showing
<img src="uploads/filename.jpg">
and this file does indeed exist in my folder structure. However, the image appears broken.
Any ideas on how to overcome this problem?
Thank you.
| 0 | [
2,
10811,
4865,
946,
27,
21491,
568,
4111,
255,
15,
92,
22,
38,
1381,
6488,
19,
71,
8294,
18,
16755,
60,
800,
3726,
3726,
31,
57,
21,
10811,
4865,
56,
25,
40,
1961,
10719,
11907,
9,
32,
2027,
14,
761,
21200,
197,
8551,
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... |
Dialog box editting
===
<a href="http://jqueryui.com/themeroller/#ffDefault=Verdana%2C+Arial%2C+sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=6px&bgColorHeader=444444&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=44&borderColorHeader=333333&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=000000&bgTextureContent=14_loop.png&bgImgOpacityContent=25&borderColorContent=555555&fcContent=ffffff&iconColorContent=cccccc&bgColorDefault=222222&bgTextureDefault=03_highlight_soft.png&bgImgOpacityDefault=35&borderColorDefault=444444&fcDefault=eeeeee&iconColorDefault=cccccc&bgColorHover=003147&bgTextureHover=03_highlight_soft.png&bgImgOpacityHover=33&borderColorHover=0b93d5&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=0972a5&bgTextureActive=04_highlight_hard.png&bgImgOpacityActive=20&borderColorActive=26b3f7&fcActive=ffffff&iconColorActive=222222&bgColorHighlight=eeeeee&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=80&borderColorHighlight=cccccc&fcHighlight=2e7db2&iconColorHighlight=4b8e0b&bgColorError=ffc73d&bgTextureError=02_glass.png&bgImgOpacityError=40&borderColorError=ffb73d&fcError=111111&iconColorError=a83300&bgColorOverlay=5c5c5c&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=50&opacityOverlay=80&bgColorShadow=cccccc&bgTextureShadow=01_flat.png&bgImgOpacityShadow=30&opacityShadow=60&thicknessShadow=7px&offsetTopShadow=-7px&offsetLeftShadow=-7px&cornerRadiusShadow=8px">click here</a>
plz see this link...
i m using the open dialog box from here......i want to write something left to the ok and cancel button.....
any ideas | 1 | [
2,
28223,
1649,
9392,
1203,
800,
3726,
3726,
13,
1,
58,
746,
14057,
3726,
7,
21127,
6903,
728,
2005,
11867,
49,
9,
960,
118,
124,
790,
8694,
106,
118,
5910,
2460,
13862,
9708,
3726,
2304,
15584,
11881,
135,
150,
2430,
2905,
192,
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... |
run netbeans java project in a terminal
===
I'm trying to run a java app. inside a jar file that uses an axis2 web service. This jar contains a /axis2client directory with some modules that the petition needs to use, for example rampart.mar security module.
The problem is that the java app. works fine while running it with netbeans, but it shows an exception if I try to run it in a terminal using the jar.
>java -jar myfile.jar
shows:
org.apache.axis2.AxisFault: invalid url:
//file:/home/usr/Escritorio/myfile.jar!/axis2client/
(java.net.MalformedURLException: no protocol:
//file:/home/usr/Escritorio/myfile.jar)
As you can see it's trying to use the /axis2client directory inside the jar, but It fails with a MalformedURLException. I think it's something about the protocol 'file:', maybe //file:/ must be file:///.
The problem is that I cannot change this call to the directory. The method that loads the /axis2client directory it's not mine, it's from another library that use my project.
So, any idea...?? Thanks in advance!
| 0 | [
2,
485,
4275,
863,
5950,
8247,
669,
19,
21,
3855,
800,
3726,
3726,
31,
22,
79,
749,
20,
485,
21,
8247,
4865,
9,
572,
21,
5112,
3893,
30,
2027,
40,
8577,
135,
2741,
365,
9,
48,
5112,
1588,
21,
13,
118,
19676,
135,
150,
18513,
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... |
mysql query for rating system
===
mysql> select user_id,@pos:=(@pos+1) as new_position,(coins+total_item_costs) as wealth from user_ledger join users using (user_id),(select @pos:=0) p ORDER BY wealth DESC limit 10;
+---------+--------------+------------+
| user_id | new_position | wealth |
+---------+--------------+------------+
| 19 | 19 | 1112823871 |
| 11 | 11 | 13318047 |
| 8 | 8 | 7292407 |
| 6 | 6 | 6122746 |
| 27 | 27 | 5271889 |
| 23 | 23 | 5263050 |
| 9 | 9 | 5171734 |
| 3 | 3 | 5136092 |
| 15 | 15 | 5097488 |
| 4 | 4 | 5089487 |
+---------+--------------+------------+
10 rows in set (0.01 sec)
The new_position is incorrect..
What's wrong, guys? :)
ps. pls dont tell me to use temporary table
| 0 | [
2,
51,
18,
22402,
25597,
26,
4647,
329,
800,
3726,
3726,
51,
18,
22402,
1,
5407,
4155,
1,
1340,
15,
1,
12551,
45,
3726,
5,
1,
12551,
16628,
6,
28,
78,
1,
9339,
15,
5,
716,
108,
18,
2430,
20148,
1,
2119,
79,
1,
15155,
18,
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... |
ImageView and Listview - Android
===
Good Day!!!
I have a problem with the layout specially in the landscape orientation in android.
When I am going to change the orientation to landscape, it seems that the ImageView is in a fixed position and I can only see scrollbar in the listview...I just want to have a layout that also the imageview can be scrolled so that I can see clearly the list items.
Here's my layout xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:layout_height="wrap_content"
android:contentDescription="@string/app_name"
android:src="@drawable/banner" />
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/imageView1"
android:drawSelectorOnTop="true" />
</RelativeLayout>

| 0 | [
2,
1961,
4725,
17,
968,
4725,
13,
8,
13005,
800,
3726,
3726,
254,
208,
28116,
31,
57,
21,
1448,
29,
14,
9106,
13444,
19,
14,
4453,
10245,
19,
13005,
9,
76,
31,
589,
228,
20,
753,
14,
10245,
20,
4453,
15,
32,
2206,
30,
14,
1961... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C++ How to iterate through a std::vector of objects and show content on console
===
For loop should iterate through std::vector and populate content.
First for loop gives me an error message saying:
NO BINARY OPERATOR FOUND << No convert possible
vector<MyClass>classVector;
for (vector<MyClass>::iterator i = classVector.begin();
i != classVector.end();
++i)
{
cout << *i << endl;
}
MyClass.h:
class MyClass{
private:
string newTodayTaskString;
public:
MyClass(string t) : newTodayTaskString (t){}
~MyClass(){}
};
This for loop iterates through a vector of strings and works perfectly. Why?
vector<string>stringVector;
for (vector<string>::iterator i = stringVector.begin();
i != stringVector.end();
++i)
{
cout<<*i<<endl;
}
| 0 | [
2,
272,
20512,
184,
20,
32,
106,
1373,
120,
21,
354,
43,
45,
45,
28033,
16,
3916,
17,
298,
2331,
27,
8650,
800,
3726,
3726,
26,
5293,
378,
32,
106,
1373,
120,
354,
43,
45,
45,
28033,
17,
1675,
12383,
2331,
9,
64,
26,
5293,
235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SSIS: I don't see the package configuration wizard
===
Using SQLServer 2012 Enterprise, I don't see "Package Configuration Wizard" in SSIS when I do a right click in Control Flow tab. I can see all the other items (Log, Digital Signing...).
Here are info about my install:
Microsoft Visual Studio 2010
Version 10.0.40219.1 SP1Rel
Microsoft .NET Framework
Version 4.0.30319 SP1Rel
Professional
SQL Server Analysis Services
Concepteur Microsoft SQL Server Analysis Services
Version 11.0.2100.60
SQL Server Integration Services
Concepteur Microsoft SQL Server Integration Services
Version 11.0.2100.60
SQL Server Reporting Services
Concepteurs Microsoft SQL Server Reporting Services
Version 11.0.2100.60
| 0 | [
2,
13,
18,
4557,
45,
31,
221,
22,
38,
196,
14,
6030,
8091,
10276,
800,
3726,
3726,
568,
4444,
255,
10321,
106,
563,
6002,
15,
31,
221,
22,
38,
196,
13,
7,
8573,
1303,
8091,
10276,
7,
19,
13,
18,
4557,
76,
31,
107,
21,
193,
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... |
C# MongoDB set ReadPreference
===
Probably right in front of me, but I am not sure how to set the ReadPreference.Secondary setting in the C# driver? I wanted to distribute the query load to my secondary nodes as opposed to the default. I have set slaveOk() on the nodes themselves.
Any help / example would be appreciated. I just can't find a good example of setting that property.
Thanks,
S | 0 | [
2,
272,
5910,
3521,
5474,
220,
309,
1302,
306,
28018,
800,
3726,
3726,
910,
193,
19,
431,
16,
55,
15,
47,
31,
589,
52,
562,
184,
20,
309,
14,
1302,
306,
28018,
9,
24979,
2697,
19,
14,
272,
5910,
2425,
60,
31,
417,
20,
14751,
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... |
Dropdownlist post in ASP.NET MVC3 and Entity Framework Model
===
I have 3 tables:
RateProfile
- RateProfileID
- ProfileName
Rate
- RateID
- RateProfileID
- PanelID
- Other stuff to update
Panel
- PanelID
- PanelName
I have models for each of these. I have an edit page using the RateProfile model. I display the information for RateProfile and also all of the Rates associated with it. This works fine and I can update it fine. However, I also added a dropdown so that I can filter Rates by PanelID. I need it to post back on change so that it can display the filtered rates.
I'm using
@Html.DropDownList("PanelID", (SelectList)ViewData["PanelDropDown"], new { onchange = "$('#RateForm').submit()" })
for my dropdownlist. Whenever it posts back to my HttpPost Edit method though, it seems to be missing all information about the Rates navigation property. It's weird because I thought it would do exactly what the input/submit button that I have in the form does (which actually passes the entire model back to my HttpPost Edit action and does what I want it to do). The panelID is properly being passed to my HttpPost Edit method and on to the next view, but when I try to query the Model.Rates navigation property is null (only when the post comes from the dropdown. Everything works fine when the post comes from my submit input).
Get Edit:
public ActionResult Edit(int id, int panelID = 1)
{
RateProfile rateprofile = db.RateProfiles.Single(r => r.RateProfileID == id);
var panels = db.Panels;
ViewData["PanelDropDown"] = new SelectList(panels, "PanelID", "PanelName", panelID);
ViewBag.PanelID = panelID;
return View(rateprofile);
}
HttpPost Edit:
[HttpPost]
public ActionResult Edit(RateProfile rateprofile, int panelID)
{
var panels = db.Panels;
ViewData["PanelDropDown"] = new SelectList(panels, "PanelID", "PanelName", panelID);
ViewBag.PanelID = panelID;
if (ModelState.IsValid)
{
db.Entry(rateprofile).State = EntityState.Modified;
foreach (Rate dimerate in rateprofile.Rates)
{
db.Entry(dimerate).State = EntityState.Modified;
}
db.SaveChanges();
return View(rateprofile);
}
return View(rateprofile);
}
View:
@model PDR.Models.RateProfile
@using (Html.BeginForm(null,null,FormMethod.Post, new {id="RateForm"}))
{
<div>
@Html.Label("Panel")
@Html.DropDownList("PanelID", (SelectList)ViewData["PanelDropDown"], new { onchange = "$('#RateForm').submit()" })
</div>
@{var rates= Model.Rates.Where(a => a.PanelID == ViewBag.PanelID).OrderBy(a => a.minCount).ToList();}
@for (int i = 0; i < rates.Count; i++)
{
<tr>
<td>
@Html.HiddenFor(modelItem => rates[i].RateProfileID)
@Html.HiddenFor(modelItem => rates[i].RateID)
@Html.HiddenFor(modelItem => rates[i].PanelID)
@Html.EditorFor(modelItem => rates[i].minCount)
@Html.ValidationMessageFor(model => rates[i].minCount)
</td>
<td>
@Html.EditorFor(modelItem => rates[i].maxCount)
@Html.ValidationMessageFor(model => rates[i].maxCount)
</td>
<td>
@Html.EditorFor(modelItem => rates[i].Amount)
@Html.ValidationMessageFor(model => rates[i].Amount)
</td>
</tr>
}
<input type="submit" value="Save" />
}
To summarize my problem, the below query in my view only works when the post comes from the submit button and not when it comes from my dropdownlist.
@{var rates= Model.Rates.Where(a => a.PanelID == ViewBag.PanelID).OrderBy(a => a.minCount).ToList();} | 0 | [
2,
2804,
2968,
5739,
678,
19,
28,
306,
9,
2328,
307,
8990,
240,
17,
9252,
6596,
1061,
800,
3726,
3726,
31,
57,
203,
7484,
45,
1684,
14503,
13,
8,
1684,
14503,
1340,
13,
8,
5296,
7259,
1684,
13,
8,
1684,
1340,
13,
8,
1684,
14503,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 including a file using php function not work?
===
**MY PHP FUNCTION IS**
function functionName()
{
include($_SERVER['DOCUMENT_ROOT']."/path/file.php");
}
**Content of File.php is**
<?php
$foo = 'bar';
**Calling function (content of file test.php)**
functionName();
**When call function and variable not work**
echo $foo; <- not works
But when adding code below its works (content of file test.php)
include($_SERVER['DOCUMENT_ROOT']."/path/file.php");
echo $foo; <- its works | 0 | [
2,
76,
215,
21,
3893,
568,
13,
26120,
1990,
52,
170,
60,
800,
3726,
3726,
13,
1409,
915,
13,
26120,
1990,
25,
1409,
1990,
1990,
7259,
5,
6,
13,
1,
468,
5,
4403,
1,
10321,
106,
2558,
22,
28132,
1,
14032,
22,
500,
9,
7,
118,
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... |
Forming a predicate to filter between dates
===
Say I have two dates:
minDate:2012-08-29 12:22:17 +0000
maxDate:2011-12-01 18:14:38 +0000
I have a Core Data object called MBDate which has an NSDate property. I want to get all MBDate's with days including and in between the days above. So it should disregard the hours, seconds, and minutes, and just get all days in between and including 8/29 - 12/01.
Something like:
predicate = [NSPredicate predicateWithFormat:@"date < %@ AND date > %@", maxDate, minDate];
But I'm not sure how I would tell it to disregard the hours and minutes and just look at the days. Any ideas?
| 0 | [
2,
5075,
21,
28712,
20,
11945,
128,
4076,
800,
3726,
3726,
395,
31,
57,
81,
4076,
45,
594,
1373,
45,
3212,
8,
3099,
8,
2738,
390,
21660,
45,
1053,
2754,
21903,
2049,
8209,
45,
3097,
8,
918,
8,
3026,
474,
45,
1419,
22284,
2754,
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... |
WPF Decrease Indetation for Bullets
===
I am using WPF RichTextBox control. When I apply decrease indetation bullets are removing and the content is moving to left side, bullets disappear. How do I make it programatically using c#?
It worked out for increase indentation with this code very well:
private void IncIndentBulletNumber()
{
if (currentRtb == null) return;
List list = FindListAncestor(currentRtb.Selection.Start.Parent);
if (list != null)
{
if (list.MarkerStyle == TextMarkerStyle.Disc)
{
// bullets
Thickness margin = (Thickness) list.GetValue(Paragraph.MarginProperty);
if (margin.Left.Equals(double.NaN))
margin.Left = 18;
else
margin.Left += 18;
margin.Right = 0;
margin.Top = 0;
margin.Bottom = 0;
list.SetValue(Paragraph.MarginProperty, margin);
}
...
}
}
When I try it similar to get decreasing indentation It does not work...Any idea will be accepted!
Thanks in advance! | 0 | [
2,
619,
7721,
9826,
19,
546,
8593,
26,
11366,
800,
3726,
3726,
31,
589,
568,
619,
7721,
2042,
11969,
5309,
569,
9,
76,
31,
5645,
9826,
19,
546,
8593,
11366,
50,
9096,
17,
14,
2331,
25,
1219,
20,
225,
270,
15,
11366,
10866,
9,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to remove Twitter names from a string with ReGex
===
I would like to remove all twitter nicknames (@xxx) from a string like this:
Hi @xxx and @yyy and @zzz.
I would like to get a sting that will contain only (Hi and and).
Thanks
| 0 | [
2,
184,
20,
4681,
10623,
1817,
37,
21,
3724,
29,
7953,
1706,
800,
3726,
3726,
31,
83,
101,
20,
4681,
65,
10623,
7157,
18,
13,
5,
1,
13290,
6,
37,
21,
3724,
101,
48,
45,
4148,
13,
1,
13290,
17,
13,
1,
93,
93,
93,
17,
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.