unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Java in Eclipse, using replaceAll for int int
===
I'm working on code for a Java project, I currently have replaceAll(String, int) in the code block of public String getDAT(int col, int MULTIPLIER). Eclipse is saying replaceAll is for (String, String) and not (String, int) how I'm trying to use it. However the only suggestions are to change it to either replace(), replaceFirst(), or to change MULTIPLIER to a string. I can't do the last because it must be an integer. When I change it according to those first two, the error is essentially the same. I'm pretty new to Java so I don't know too much about it. Here's that code block (ignore ChatColor and ConfigManager, they go with the rest of the code):
public String getDAT(int col, int MULTIPLIER)
{
String RESULT = this.LANGUAGE_DATA[this.LANGUAGE][col];
RESULT = RESULT.replaceAll("%murk%", ChatColor.DARK_GREEN + ConfigManager.Murk() + ChatColor.WHITE);
if (MULTIPLIER > 0)
RESULT = RESULT.replaceAll("%mult%", MULTIPLIER);
return RESULT;
} | 0 | [
2,
8247,
19,
11652,
15,
568,
3934,
1233,
26,
19,
38,
19,
38,
800,
3726,
3726,
31,
22,
79,
638,
27,
1797,
26,
21,
8247,
669,
15,
31,
871,
57,
3934,
1233,
5,
11130,
15,
19,
38,
6,
19,
14,
1797,
1921,
16,
317,
3724,
164,
593,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 access my old files(ftp - media files) in windows azure deployment?
===
I have migrated and deployed my asp.net (2010) application to windows azure cloud service.
I have small doubts here.
In my previous hosting my application files(media, documents) are located in the local folder of ftp site. And storage (db ) was in server. But according to windows azure i just deployed my application to cloud with db created in windows azure portal.
i). How can i use my previous files here? | 0 | [
2,
184,
20,
1381,
51,
315,
6488,
5,
3072,
306,
13,
8,
941,
6488,
6,
19,
1936,
25715,
10475,
60,
800,
3726,
3726,
31,
57,
14204,
17,
6698,
51,
28,
306,
9,
2328,
13,
5,
2751,
6,
3010,
20,
1936,
25715,
4005,
365,
9,
31,
57,
284... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Returning an array from 1 array with incomplete keys and another with the values
===
Ok, so here is an array...
$values = array('value1', 'value2', 'value3', 'value4', 'value5', 'value6');
And another array with the keys being ordered in the way it needs to be ordered.
$keys = array(0, 2, 1, 5);
However, if you notice the 2nd array has 2 missing keys from it. In this case, it should return the 2 missing keys in ASCENDING order, from lowest to highest. So, the 2 missing keys are 3 and 4. So it should fill the $keys array like so: `array(0, 2, 1, 5, 3, 4);`
I need to return an array from these 2 arrays that if the values of these 2 arrays are as listed above, it needs to be returned like so:
$output = array('value1', 'value3', 'value2', 'value6', 'value4', 'value5');
In any case, it MUST grab all of the values from the $values array only 1 time whether or not any keys are listed in the $keys array. For example, if the $keys array is an empty array, than it should return the $values array exactly as it is. If the $keys array only contains 1 key in it. Example: `$keys = array(5);` than it should return `array('value6', 'value1', 'value2', 'value3', 'value4', 'value5');` It should also be smart enough to deal with ALL keys, in case the $keys array has all key values listed in it for the $values array.
Ok, so I have the $values and $keys arrays, I just need to figure out how to return the $output array for this. I'm pretty sure there will need to be a foreach loop on the $values array for this to work. But I'm running into a wall here trying to figure this thing out...
Any help would be greatly appreciated. Thanks, you guys are all so awesome here! :) | 0 | [
2,
13,
26120,
2485,
40,
7718,
37,
137,
7718,
29,
14011,
5534,
17,
226,
29,
14,
4070,
800,
3726,
3726,
5854,
15,
86,
235,
25,
40,
7718,
9,
9,
9,
5579,
15165,
18,
800,
7718,
5,
22,
15165,
165,
22,
15,
13,
22,
15165,
135,
22,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PHP Explode - A quick query
===
I've got an array of data which is as follows :
> 'valid' => string 'true' (length=4)
>
> 'test_status' => string 'true' (length=4)
>
> 'trans_id' => string 'TRAN000102' (length=10)
>
> 'mpi_status_code' => string '200' (length=3)
>
> 'mpi_message' => string 'Payer Verification Required' (length=27)
>
> 'acs_url' => string
> 'https%3A%2F%2Fwww.secpay.com%2Fjava-bin%2FACSSimulator%3Fpartner%3Dsecpay%26VAA%3DB'
> (length=83)
>
> 'MD' => string '1158465348' (length=10)
>
> 'PaReq' => string
> 'eJxVUmFvgjAQ/b5fQfwBtBQwao4apybzA+o2s++kXJQNChaY7N/vqjBdE5J7d/d6716BeVfkzjeaOit1NPJcPprLJzicDOLqHVVrUEKMdZ0c0clS6vDCSTAO/WAykrBfvOFZQk+XxHYFsAESz6hTohsJiTo/b7YyEFMuAmA9hALNZiVDPvYDEXr8doDd0qCTAmWusNQ594BdIaiy1Y35kRMxBjYAaE0uT01TzRi7XC7ujZRpdFXptl/AbB3YXc++tVFN93VZKuPD2tutXsX2EPPdcnHc3L8ImO2ANGlQCu7R4cLh05kXznxScM1DUlghkmqkvgdQ2RmLx8pjBshag1oNmwwIsKtKjdRBTv7FkGKt5JKGmUwfnfW5zaqCCiTAFoDdF1q+WLtVQw5+fK4F7dbFr1FkTb8m7YCMPPN8a2oPgFka69+T9Q9O0b8f4ReyL7Xp'
> (length=452)
I'm using PHP Explode to seperate the arguements using the following code :
foreach ( $args as $arg) {
list($key, $value) = explode("=", $arg);
$result_arr[$key] = $value;
}
Now my question is that sometimes when I send that PaReq code it comes back invalid. The people at the payment side have said that I am missing == from the end of the string.
When using explode("=") is that would could be causing the == to dissapear from the end of the string?
If so what would be the better way to seperate and read the array. Or does it not make a difference anyway?
Thanks in advance guys. | 0 | [
2,
13,
26120,
13383,
13,
8,
21,
2231,
25597,
800,
3726,
3726,
31,
22,
195,
330,
40,
7718,
16,
1054,
56,
25,
28,
2415,
13,
45,
13,
1,
13,
22,
18506,
43,
22,
800,
1,
3724,
13,
22,
13398,
22,
13,
5,
6325,
3726,
300,
6,
13,
1,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: R unresolved variable when duplicating activities
===
I am attempting to duplicate my project with a different title and package name. However, when I copy and paste the activities, it returns that R is an unresolved variable that I can either import from android or from my package. Is there a better way to copy my project or is there a way to resolve R? | 0 | [
2,
13005,
45,
761,
367,
99,
5594,
4763,
7612,
76,
1052,
25971,
1203,
1648,
800,
3726,
3726,
31,
589,
6314,
20,
19429,
51,
669,
29,
21,
421,
581,
17,
6030,
204,
9,
207,
15,
76,
31,
4344,
17,
640,
62,
14,
1648,
15,
32,
4815,
30,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reading bean list using jstl and adding to javascript variable
===
I am using facelet and draw function has jstl tag:
<ui:define name="content" >
<h:outputScript name="js/graphics/paths.js"/>
<h:outputScript name="js/graphics/draw.js"/>
----
function showMap(){
var data = {
<c:forEach items="${list.KPI}" var="ctag" varStatus="loop">
'${ctag.USTER}': ${ctag.Value}
${!loop.last ? ',' : ''}
</c:forEach>
}
}
Error:
----
![enter image description here][1]
Is it possible to use jstl with facelets? Why am i getting this error? I am using there links:
1) [is it possible for javascript to extract value from cforeach tag][2]
2) [populating-javascript-array-from-jsp-list][3]
[1]: http://i.stack.imgur.com/2jSXB.png
[2]: http://stackoverflow.com/questions/4506816/is-possible-javascript-extract-value-from-cforeach-tag
[3]: http://stackoverflow.com/questions/3040645/populating-javascript-array-from-jsp-list | 0 | [
2,
1876,
15322,
968,
568,
487,
18,
7786,
17,
4721,
20,
8247,
8741,
7612,
800,
3726,
3726,
31,
589,
568,
276,
1336,
17,
2003,
1990,
63,
487,
18,
7786,
3383,
45,
13,
1,
5661,
45,
546,
7509,
204,
3726,
7,
25424,
7,
13,
1,
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... |
Efficient traversal/search algorithm to fetch data from RDF?
===
I have my data as a RDF graph in DB and using SPARQL i am retriving the data. Now the nodes (objects) in the graphs gets huge and the traversal/search gets much slower now.
a. Can anyone suggest the efficient traversal/search algorithm to fetch the data?
As a next step, i have federated data i.e the data from external applications like SAP. In this case, the search becomes even much slower.
b. What efficient search algorithm do i use in this case?
This seems like a common issue in an large enterprise systems, and any inputs on how these problems have been solved in such systems will also be helpful.
| 0 | [
2,
8243,
19501,
192,
118,
25136,
9083,
20,
18312,
1054,
37,
13,
897,
410,
60,
800,
3726,
3726,
31,
57,
51,
1054,
28,
21,
13,
897,
410,
7210,
19,
13,
9007,
17,
568,
12196,
22402,
31,
589,
302,
3367,
8397,
14,
1054,
9,
130,
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... |
Meteor connection count
===
What would be the best way to record a live count of connections using the Meteor framework? I have the requirement of live sharing users online and have resorted to creating a collection and just replacing a record on initialize for each user, but the count seems to reset, what I have so far below, thanks in advanced.
Counts = new Meteor.Collection "counts"
if Meteor.is_client
if Counts.findOne()
new_count = Counts.findOne().count + 1
Counts.remove {}
Counts.insert count: new_count
Template.visitors.count = ->
Counts.findOne().count
if Meteor.is_server
reset_data = ->
Counts.remove {}
Counts.insert count: 0
Meteor.startup ->
reset_data() if Counts.find().count() is 0 | 0 | [
2,
17522,
2760,
2468,
800,
3726,
3726,
98,
83,
44,
14,
246,
161,
20,
571,
21,
515,
2468,
16,
6760,
568,
14,
17522,
6596,
60,
31,
57,
14,
8981,
16,
515,
6126,
3878,
2087,
17,
57,
4765,
69,
20,
2936,
21,
1206,
17,
114,
5496,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to recognise mifare classic and mifare ultralight when tag is discovered in Android
===
I am working on nfc in android and I want to know whether the tag is discovered is Mifare Classic or Mifare Ultralight or any other. plz tell me How to do it? | 0 | [
2,
184,
20,
16945,
534,
1473,
99,
2732,
17,
534,
1473,
99,
6885,
3130,
76,
3383,
25,
1848,
19,
13005,
800,
3726,
3726,
31,
589,
638,
27,
25161,
19,
13005,
17,
31,
259,
20,
143,
1472,
14,
3383,
25,
1848,
25,
534,
1473,
99,
2732,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 nose from a script to gather tests and tests
===
How would I use nose from a python script to
1. gather python files from a directory
2. foreach file
1. run all test classes found
2. **__ init __** each test class
Here's an example, given files
run.py
/tests/TestClassA.py
and within __TestClassA.py__ is the code
class A():
__init__(self, i):
self._b = b
test_run():
print("%s",self._b)
<br /><br />
***To restate the need:***<br />
I want to call nose from run.py. I want nose (or some part of nose) to
1. find **class A**
2. create an instance ___a___ and pass the **__ init __** function the string **"foo"**
3. call **a.run()**
What is the python nose code that goes in **run.py**? <br />
If not the nose code, would unittests do any better? | 0 | [
2,
20059,
2689,
37,
21,
3884,
20,
7442,
4894,
17,
4894,
800,
3726,
3726,
184,
83,
31,
275,
2689,
37,
21,
20059,
3884,
20,
137,
9,
7442,
20059,
6488,
37,
21,
16755,
172,
9,
26,
14322,
3893,
137,
9,
485,
65,
1289,
2684,
216,
172,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Move Add to cart button next to More info image in Jquery
===
**on this page http://tinyurl.com/cv5xbqs want to move the add to cart image next to more info
so detach this**
<a href="/ShoppingCart.asp?ProductCode=QH1225272">
<img border="0" align="absmiddle" src="/v/vspfiles/templates/210/images/buttons/btn_addtocart_small.gif">
</a>
**and attach infront of**
<a class="smalltext colors_text" href="http://www.QUALITYHANGERS.COM/Natural-Wood-Suit-Combo-Hanger-17-p/qh1225272.htm">
<img border="0" src="/v/vspfiles/templates/210/images/Bullet_MoreInfo.gif">
</a>
**Shall i assign a ID to image tag Bullet_MoreInfo.gif** | 0 | [
2,
780,
3547,
20,
6420,
5167,
328,
20,
91,
15404,
1961,
19,
487,
8190,
93,
800,
3726,
3726,
13,
1409,
218,
48,
2478,
7775,
6903,
2864,
4703,
6362,
9,
960,
118,
12732,
264,
396,
220,
1251,
18,
259,
20,
780,
14,
3547,
20,
6420,
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... |
Can a Delphi application be certified for Windows 8 (using Windows App Certification Kit)?
===
Apparently, Delphi (any version) [does not support safe exception handlers][1] (/SAFESEH switch in Visual Studio). This results in a warning when using Windows App Certification Kit on Windows 8. Per [certification requirements][2] for Windows 8 desktop apps:
> Your app must be compiled using the /SafeSEH flag to ensure safe exceptions handling
Obviously Delphi lacks this switch, so it cannot be done. My questions are:
1. Is my understanding correct, that even though the Kit displays only a warning (not fail), since this is a "must" requirement, any Delphi app today cannot be certified for Windows 8 and therefore cannot be included in the Windows app store?
2. Can SafeSEH tables be added to a PE file after the compilation somehow (e.g. extracting needed info from the map file or debug symbols), or we absolutely need a compiler/linker support for this, and therefore must wait till when Embarcadero implements this feature?
[1]: https://forums.embarcadero.com/thread.jspa?messageID=473469
[2]: http://msdn.microsoft.com/en-us/library/windows/desktop/hh749939 | 0 | [
2,
92,
21,
23030,
3010,
44,
6935,
26,
1936,
469,
13,
5,
12655,
1936,
4865,
10439,
6346,
6,
60,
800,
3726,
3726,
3083,
15,
23030,
13,
5,
6001,
615,
6,
636,
10739,
52,
555,
1834,
5391,
24641,
18,
500,
2558,
165,
500,
13,
5,
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... |
Trigger on one table field works for all table
===
I have a trigger which is for a few fields in a table. But for some reason, if another field is changed (which is not defined in trigger) then it still fires.
CREATE OR REPLACE TRIGGER INTEGRATION_EMPLOYMENT
AFTER UPDATE OF start_day_of_employment, end_of_employment ON hr_employment_data
FOR EACH ROW
DECLARE
BEGIN
IF UPDATING THEN
MERGE INTO ad_integration intg USING dual ON (intg.user_id = :NEW.user_id AND intg.integrated = 'NO')
WHEN MATCHED THEN
UPDATE SET
intg.start_day_of_employment = decode(:NEW.start_day_of_employment, NULL, ' ', :NEW.start_day_of_employment),
intg.end_of_employment = decode(:NEW.end_of_employment, NULL, ' ', :NEW.end_of_employment),
intg.manager_status = :NEW.manager_status,
intg.pid = (SELECT pid FROM arc.user_info WHERE user_id = :NEW.user_id),
intg.network_access_start_date = (SELECT network_access_start_date FROM hr_extension_data WHERE user_id = :NEW.user_id)
WHEN NOT MATCHED THEN
INSERT (intg.user_id, intg.start_day_of_employment, intg.end_of_employment, intg.manager_status, intg.pid, intg.network_access_start_date
VALUES (:NEW.user_id, :NEW.start_day_of_employment, :NEW.end_of_employment, :NEW.manager_status, (SELECT pid FROM arc.user_info WHERE user_id = :NEW.user_id), (SELECT network_access_start_date FROM hr_extension_data WHERE user_id = :NEW.user_id));
END IF;
END HR_ADINTEGRATION_EMPLOYMENT;
Is it because of using DUAL or something am I missing?
Cheers! :-) | 0 | [
2,
7286,
27,
53,
859,
575,
693,
26,
65,
859,
800,
3726,
3726,
31,
57,
21,
7286,
56,
25,
26,
21,
310,
2861,
19,
21,
859,
9,
47,
26,
109,
1215,
15,
100,
226,
575,
25,
1015,
13,
5,
2140,
25,
52,
2811,
19,
7286,
6,
94,
32,
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 internationalize Android app?
===
How do I determine the language setting of an Android device. I am doing this to internationalize my app. Thanks! | 0 | [
2,
184,
20,
294,
2952,
13005,
4865,
60,
800,
3726,
3726,
184,
107,
31,
3746,
14,
816,
2697,
16,
40,
13005,
3646,
9,
31,
589,
845,
48,
20,
294,
2952,
51,
4865,
9,
3669,
187,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Flipping a control in windows phone 7
===
Hi I am developing an animation in which flip animation is required as shown in http://www.avatar-app.com/dev/2012/01/24/ios-flip-transform/. Now I am successful in achieving this by making use of two border one above the other and animating one border using planeprojection. And here is my code
<Grid x:Name="ContentPanel" Background="Wheat" Grid.Row="1" Margin="12,0,12,0">
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid.Resources>
<Storyboard x:Name="myStoryboard">
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="ScaleX"
To="1.5"
Duration="0:0:3"/>
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="ScaleY"
To="1.2"
Duration="0:0:3"/>
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="CenterX"
To="100"
Duration="0:0:3"/>
<DoubleAnimation Storyboard.TargetName="scaleTransform"
Storyboard.TargetProperty="CenterY"
To="-300"
Duration="0:0:3"/>
<DoubleAnimation Duration="0:0:3"
Storyboard.TargetName="PlaneProjectionRotationX_1"
Storyboard.TargetProperty="RotationX"
To="90" />
<DoubleAnimation Duration="0:0:3"
Storyboard.TargetName="PlaneProjectionRotationX_1"
Storyboard.TargetProperty="CenterOfRotationZ"
To="-50" />
</Storyboard>
</Grid.Resources>
<Border Background="AliceBlue" Grid.Row="0" ManipulationStarted="Border_ManipulationStarted">
<TextBlock Text="gfdshfgdshfgdsjfhgdsjfhgdsjfgdjsfgdsjfjdfjhds" TextWrapping="Wrap" Foreground="Black"/>
<Border.RenderTransform >
<ScaleTransform x:Name="scaleTransform" />
</Border.RenderTransform>
<Border.Projection>
<PlaneProjection x:Name="PlaneProjectionRotationX_1"/>
</Border.Projection>
</Border>
<Border Background="Aqua" Grid.Row="1">
</Border>
</Grid>
The problem is, here I am using two controls(Border), but I want to use animation on only one control i.e dividing the animation so that it applies to half part of the control(only one border)?
| 0 | [
2,
21422,
21,
569,
19,
1936,
1132,
453,
800,
3726,
3726,
4148,
31,
589,
3561,
40,
6236,
19,
56,
8805,
6236,
25,
1390,
28,
1721,
19,
7775,
6903,
6483,
9,
4961,
3958,
8,
7753,
9,
960,
118,
14438,
118,
3212,
118,
387,
13301,
12918,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Content ot Remote HTML page
===
I want to get remote html contents that on "li" that with a spacific Class name and Children of em using divs.
My remote content is Like this
><ul>
><li class="user">
>><div class="name">My Name 1</div>
>><div class="rep">20</div>
></li>
><li class="user">
>><div class="name">My Name 2</div>
>><div class="rep">23</div>
></li>
><li class="user">
>><div class="name">My Name 3</div>
>><div class="rep">40</div>
></li>
></ul>
After get their data it must be like this.
>[My Name 1,20]
>[My Name 2,23]
>[My Name 3,40]
Thanks.
Sorry for the My Poor English
Note : Have more content than this on remote page. | 0 | [
2,
184,
20,
164,
2331,
13,
2779,
5388,
13,
15895,
2478,
800,
3726,
3726,
31,
259,
20,
164,
5388,
13,
15895,
8478,
30,
27,
13,
7,
1210,
7,
30,
29,
21,
13,
18,
15228,
718,
204,
17,
391,
16,
3579,
568,
13,
12916,
18,
9,
51,
538... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use fiddler only for some processes
===
I was wondering if I could use Fiddler2 on only some processes instead of all applications which use system proxy settings. I know there is a filter option in Fiddler2, but as far as I know, it only *hides* information and the traffic is captured anyway. | 0 | [
2,
275,
12759,
139,
104,
26,
109,
5102,
800,
3726,
3726,
31,
23,
5712,
100,
31,
110,
275,
12759,
139,
135,
27,
104,
109,
5102,
700,
16,
65,
3767,
56,
275,
329,
27188,
12410,
9,
31,
143,
80,
25,
21,
11945,
4255,
19,
12759,
139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ISO 8859-1 filename not decoding
===
I'm extracting files from MIME messages in a python milter and am running across issues with files named as such:
=?ISO-8859-1?Q?Certificado=5FZonificaci=F3n=5F2010=2Epdf?=
I can't seem to decode this name into UTF. In order to solve a prior ISO-8859-1 issue, I started passing all filenames to this function:
def unicodeConvert(self, fname):
normalized = False
while normalized == False:
try:
fname = unicodedata.normalize('NFKD', unicode(fname, 'utf-8')).encode('ascii', 'ignore')
normalized = True
except UnicodeDecodeError:
fname = fname.decode('iso-8859-1')#.encode('utf-8')
normalized = True
except UnicodeError:
fname = unicode(fname.content.strip(codecs.BOM_UTF8), 'utf-8')
normalized = True
except TypeError:
fname = fname.encode('utf-8')
return fname
which was working until I got to this filename.
Ideas are appreciated as always. | 0 | [
2,
11899,
8746,
3902,
8,
165,
3893,
7259,
52,
121,
15458,
800,
3726,
3726,
31,
22,
79,
10962,
68,
6488,
37,
26193,
7561,
19,
21,
20059,
7097,
815,
17,
589,
946,
464,
1549,
29,
6488,
377,
28,
145,
45,
800,
60,
11037,
8,
3020,
390... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Table Name Includes Date
===
Sorry for any incorrect terms as I am not proficient in SQL...
I have a query that I need to run daily, however the table that i need to query includes todays date. Normally I run:
SELECT m.displayName,a.source,count(a.agentGuid) from ntEventLog20120725 a LEFT OUTER JOIN machNameTab m ON a.agentGuid = m.agentGuid WHERE a.eventTime > DATEADD(hour, -1, CURRENT_TIMESTAMP)
GROUP BY a.agentGuid, m.displayName,a.source
HAVING COUNT(a.agentGuid) > 1000
ORDER BY m.displayName
However the table I want to query each day is different. Todays table is ntEventLog20120725, tomorrows will be ntEventLog20120726. I know how to get the date in that format:
select convert(varchar,getDate(),112)
I just do not know how to combine the two together so that I can schedule this to run everyday. | 0 | [
2,
859,
204,
1103,
1231,
800,
3726,
3726,
1875,
26,
186,
18867,
1663,
28,
31,
589,
52,
28140,
19,
4444,
255,
9,
9,
9,
31,
57,
21,
25597,
30,
31,
376,
20,
485,
1954,
15,
207,
14,
859,
30,
31,
376,
20,
25597,
1103,
786,
18,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
wcf customBinding for httpTransport with endpointBehaviors webHttp not working
===
Please help me, i am new to wcf and not able to track the bellow error.
Error message:
The endpoint at 'http://localhost:50680/SSO.Service/SSOService.svc/user' does not have a Binding with the None MessageVersion. 'System.ServiceModel.Description.WebScriptEnablingBehavior' is only intended for use with WebHttpBinding or similar bindings.
Config File :
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<services>
<service behaviorConfiguration="Developmentalmadness.SSOBehavior" name="Developmentalmadness.SSOService">
<endpoint address="user" name="userEndpoint" contract="Developmentalmadness.ISSOService"
binding="customBinding"
bindingConfiguration="userHttp"
behaviorConfiguration="Developmentalmadness.SSOEndpointBehavior">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="partner" name="partnerEndpoint" contract="Developmentalmadness.ISSOPartnerService"
binding="webHttpBinding"
bindingConfiguration="partnerHttp"
behaviorConfiguration="Developmentalmadness.SSOEndpointBehavior">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding name="partnerHttp">
<!-- uncomment to secure communication using SSL
<security mode="Transport" />
-->
</binding>
</webHttpBinding>
<customBinding>
<binding name="userHttp">
<httpTransport/>
</binding>
</customBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="Developmentalmadness.customEndpointBehaviour">
<webHttp/>
</behavior>
</endpointBehaviors>
<endpointBehaviors>
<behavior name="Developmentalmadness.SSOEndpointBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="Developmentalmadness.SSOBehavior">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<extensions>
<bindingElementExtensions>
<add name="jsonpMessageEncoding"
type="Microsoft.Ajax.Samples.JsonpBindingExtension, SSO.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</bindingElementExtensions>
</extensions>
</system.serviceModel>
| 0 | [
2,
11801,
410,
5816,
22260,
26,
7775,
7028,
1993,
29,
241,
3132,
863,
20358,
248,
18,
2741,
21127,
52,
638,
800,
3726,
3726,
2247,
448,
55,
15,
31,
589,
78,
20,
11801,
410,
17,
52,
777,
20,
792,
14,
23040,
7019,
9,
7019,
2802,
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 to setup NServiceBus 3.2.2 distributer
===
I am using NSB3.2.2 and facing problem in setting up distributers
I have a one publisher and two load balanced services
Work flow is like this
• Publisher sends message to Service1 Distributer
• Service 1 distributer send it to Service1 worker
• Service1 worker send a message to Service2 Distributer
• Service2 Distributer sends it to Service2 worker
• Service2 worker does bus.Reply<ResponseMessage >( response message)
Now question is where should Service2 worker reply go?
I observer sometimes it’s going to Service 1 distributer in queue and sometimes going to Service1 worker in queue
I want Service2 worker Bus. Reply to send message to Service1 worker in queue. What should be the configuration to achieve that?
| 0 | [
2,
184,
20,
18161,
13,
103,
11449,
3822,
203,
9,
135,
9,
135,
14751,
139,
800,
3726,
3726,
31,
589,
568,
13,
2172,
220,
240,
9,
135,
9,
135,
17,
4325,
1448,
19,
2697,
71,
14751,
1224,
31,
57,
21,
53,
5916,
17,
81,
6305,
13966,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bring footer up to end of content
===
I am trying to get my footer to appear directly after the last div on my page and I can't work out why it is sitting lower than I would like. Can anyone help?
Heres the code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Millington & Hope</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="container">
<div id="header">
<h1>
<!--<a href="#"><img src="tracylogo7.jpg" alt="Millington and Hope" /></a> -->
<a href="#"><img src="tracylogo6header.jpg" alt="Millington and Hope" /></a>
</h1>
<h2>
<!--<a href="#"><img src="tracylogo5_header.jpg" alt="Millington and Hope" /></a> -->
</h2>
</div>
<ul id="nav">
<li><a href="index.html">Home</a></li><!--
--><li><a href="stock.html">Stock</a></li><!--
--><li><a href="events.html">Events</a></li><!--
--><li><a href="contact.html">Contact</a></li>
</ul>
<div id="box">
<a href="#"><img src="home4.jpg" alt="Slideshow Image 1" /></a>
<a href="#"><img src="home6.jpg" alt="Slideshow Image 2" /></a>
<a href="#"><img src="home4.jpg" alt="Slideshow Image 3" /></a>
</div>
<div id="box2">
<a href="#"><img src="tracylogosmall.jpg" alt="Logo" /></a>
</div>
<div id="footer">
<p class="client">Tel: 0785740 E-mail: tjdelape@hotmail.co.uk</p>
</div>
</div>
</body>
</html>
<style type="text/css">
html,body
{
height: 100%;
width: 100%;
padding: 0;
margin: 0;
}
body
{
background:rgb(171,163,144);
text-align: center;
min-width: 600px;
}
#container
{
margin:0 auto;
background:rgb(171, 163, 144);
width:80%;
}
#nav
{
border:1px solid #ccc;
border-width:1px 0;
list-style:none;
margin:0;
padding:0;
text-align:center;
/*background:rgb(161,153,134) /* for non-css3 browsers */
background: -webkit-radial-gradient(circle, rgb(151,143,124),rgb(171, 163, 144));
background: -moz-radial-gradient(circle, rgb(151,143,124),rgb(171, 163, 144));
}
#nav li
{
display:inline;
}
#nav a
{
display:inline-block;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
padding:10px 20px 10px 20px;
text-decoration:none;
color:white;
}
#nav a:hover
{
background:rgb(171, 163, 144);
}
#header
{
padding: 0px;
color: white;
width:100%;
text-align:center;
}
#header h1
{
margin: 0;
}
#stock
{
position:relative;
margin:0 auto;
margin-top:35px;
width: 1000px;
border-collapse:collapse;
}
#stock th
{
height: 30px;
background:rgb(151,143,124);
}
table, td, th
{
color:white;
border: solid 1px black;
padding: 2px;
}
#events
{
position:relative;
margin:0 auto;
margin-top:35px;
width: 1000px;
border-collapse:collapse;
}
#events th
{
height: 30px;
background:rgb(151,143,124);
}
#footer {
position:fixed;
left:0px;
bottom:0px;
height:25px;
width:100%;
background:rgb(151,143,124);
border-top:solid 1px white;
}
.client
{
color:white;
margin:3px auto;
text-indent:1cm;
text-align:left;
}
#sold
{
color: red;
}
#box
{
position:relative;
margin:0 auto;
width:100%;
height:200px;
margin-top:100px;
}
#box img
{
margin:0 auto;
border:solid 1px white;
margin: 10px;
}
#box2
{
position:relative;
margin-top:200px;
width: 100%;
}
#box2 img
{
margin:0 auto;
opacity:0.5;
filter:alpha(opacity=50);
}
h3
{
color:white;
text-decoration:underline;
}
#container2 {
clear:left;
float:left;
width:100%;
overflow:hidden;
background:rgb(171,163,144); /* column 2 background colour */
}
#container1 {
float:left;
width:100%;
position:relative;
right:50%;
background:rgb(171,163,144); /* column 1 background colour */
}
#left {
float:left;
width:46%;
position:relative;
left:52%;
text-align:left;
overflow:hidden;
}
#right{
float:left;
text-align:left;
width:46%;
position:relative;
left:56%;
overflow:hidden;
}
p
{
color:white;
}
</style>
The footer appears as if there is a big margin after my last div but I dont think this is what I have declared? | 0 | [
2,
1499,
1749,
106,
71,
20,
241,
16,
2331,
800,
3726,
3726,
31,
589,
749,
20,
164,
51,
1749,
106,
20,
1893,
1703,
75,
14,
236,
13,
12916,
27,
51,
2478,
17,
31,
92,
22,
38,
170,
70,
483,
32,
25,
1805,
987,
119,
31,
83,
101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to set as default this format of current time and date on page load?
===
I am using a jQuery script that let me choose a date and time. However on page's load the textbox does not have any date+time in it. I would like to display the current date and time like the format below.
**2012-07-25 15:10**
$(function () {
var now = new Date();
$('#date').scroller({
preset: 'datetime',
minDate: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
dateFormat: 'yy-mm-dd',
timeFormat: 'HH:ii',
}).val('what should I write here?');
}); | 0 | [
2,
184,
20,
309,
28,
12838,
48,
2595,
16,
866,
85,
17,
1231,
27,
2478,
6305,
60,
800,
3726,
3726,
31,
589,
568,
21,
487,
8190,
93,
3884,
30,
408,
55,
3538,
21,
1231,
17,
85,
9,
207,
27,
2478,
22,
18,
6305,
14,
1854,
5309,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Create a new Event in Google Calendar using a Post Request
===
I'm trying to create a new event in Google Calendar using a POST Request but I always get a 400 error.
So far I have this:
String url = "https://www.googleapis.com/calendar/v3/calendars/"+ calendarID + "/events?access_token=" + token;
String data = "{\n-\"end\":{\n\"dateTime\": \"" + day + "T" + end +":00.000Z\"\n},\n" +
"-\"start\": {\n \"dateTime\": \"" + day + "T" + begin + ":00.000Z\"\n},\n" +
"\"description\": \"" + description + "\",\n" +
"\"location\": \"" + location + "\",\n" +
"\"summary\": \"" + title +"\"\n}";
System.out.println(data);
URL u = new URL(url);
HttpURLConnection connection = (HttpURLConnection) u.openConnection();
connection.setDoOutput(true);
connection.setDoInput(true);
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("POST");
String a = connection.getRequestMethod();
connection.setRequestProperty("Content-Type", "application/json");
connection.setRequestProperty("Accept-Charset", "utf-8");
connection.setRequestProperty("Authorization", "OAuth" + token);
connection.setUseCaches(false);
DataOutputStream wr = new DataOutputStream(connection.getOutputStream ());
wr.writeBytes(data);
wr.flush();
// Get the response
BufferedReader rd = new BufferedReader(new InputStreamReader(connection.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
System.out.println(line);
}
wr.close();
rd.close();
But when I create the BufferedReader to read my response I get a 400 error. What's wrong?
Thanks in advance! | 0 | [
2,
1600,
21,
78,
807,
19,
8144,
7036,
568,
21,
678,
3772,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
78,
807,
19,
8144,
7036,
568,
21,
678,
3772,
47,
31,
550,
164,
21,
4353,
7019,
9,
86,
463,
31,
57,
48,
45,
3724,
287,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
setOnItemClickListener was not work with the checkbox?
===
My `ListView` contains Ten Rows. Each rows contained the `CheckBox`. How to checked and unchecked the `CheckBox` using `setOnItemClickListener`
Sample Code : (it's not working for me)
listview.setOnItemClickListener( new OnItemClickListener()
{
public void onItemClick( AdapterView<?> parent, final View v, final int position, long id )
{
Toast.makeText( this, " Position is " + position, Toast.LENGTH_SHORT ) .show();
holder.checkbox = ( CheckBox ) v.findViewById( R.id.lock_File_CheckBox );
holder.checkbox.toggle();
}
});
How do we find `CheckBox` is checked or unchecked.
Give me idea... Thanks in advanced. | 0 | [
2,
309,
218,
2119,
4829,
10129,
13891,
106,
23,
52,
170,
29,
14,
2631,
5309,
60,
800,
3726,
3726,
51,
13,
1,
5739,
4725,
1,
1588,
652,
11295,
9,
206,
11295,
3437,
14,
13,
1,
12542,
5309,
1,
9,
184,
20,
6505,
17,
367,
12542,
69... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a way to make the WrapPanel's height calculated automatically depending on its children?
===
Is there a way to make the [WrapPanel][1]'s height calculated automatically depending on its children?
I mean I wanted it to keep extending until all items got fitted.
**Note**: The desire behavior is to extend vertically since its Orientation is Horizontal and its width is fixed.
[1]: http://msdn.microsoft.com/en-us/library/system.windows.controls.wrappanel.aspx | 0 | [
2,
25,
80,
21,
161,
20,
233,
14,
8118,
3206,
532,
22,
18,
2947,
10785,
7499,
4758,
27,
82,
391,
60,
800,
3726,
3726,
25,
80,
21,
161,
20,
233,
14,
636,
7127,
24332,
532,
500,
2558,
165,
500,
22,
18,
2947,
10785,
7499,
4758,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 restore a trashed document in lotus domino in java
===
I want to restore a trashed document in lotus domino.
On what basis we can know the parent view of a trashed document?
And how we can get all the items of the document back? | 0 | [
2,
184,
20,
8454,
21,
10744,
69,
4492,
19,
15175,
23320,
19,
8247,
800,
3726,
3726,
31,
259,
20,
8454,
21,
10744,
69,
4492,
19,
15175,
23320,
9,
27,
98,
2239,
95,
92,
143,
14,
4766,
1418,
16,
21,
10744,
69,
4492,
60,
17,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... |
3-layer architecture - passing data between layers
===
Trying to implement 3-layer (not: tier, I just want to separate my project logically, on one machine) architecture I've found so many different approaches that I'm confused, what's the best way (if there's any) to make that in WinForms app.
Now I have no doubts only about 3 layers that should be present in the project:
- UI (Presentation Layer)
- BLL (Business Logic Layer)
- DAL (Data Acces Layer)
In **UI** I put all the WinForms. There must be also some logic to fill the object with data from controls and pass it to BLL layer.
In **DAL** I want to put classes and methods for data manipulations using ADO.NET, like:
public class OrderDAL
{
public OrderDAL()
{
}
public int Add(Order order)
{
//...add order to database
}
public int Update(Order order)
{
//...update order in database
}
//...etc.
}
The problem is with BLL and the question - should I use **Data Transfer Objects** to pass data between layers, or should I pass the whole Class?
If I choose to use **DTO**, then I've to create additional common class, `Order`, that reference to UI, BLL and DAL:
public class Order
{
public int Id { get; set; }
public DateTime Date { get; set; }
public string Number { get; set; }
public string CustomerName { get; set; }
public Order ()
{
}
}
and put the logic **separated** into BLL:
public class OrderBLL
{
public OrderBLL()
{
}
public int Add(Order order)
{
OrderDAL orderDAL = new OrderDAL();
return orderDAL.Add(order);
}
public int Update(Order order)
{
OrderDAL orderDAL = new OrderDAL();
return orderDAL.Update(order);
}
//...etc.
}
This approach, under different names, is used among others: [here][1] or [here][2].
On the other hand, some "wise guys" and their followers (like [here][3]) call it [Anemic Domain Model][4] and complain it's a bad design and anti-pattern that should not be used.
**The pros:**
- DTO can easily by design to represent Database table,
- it's light and clear, contains only fields needed for database,
- DAL doesn't have to reference BLL,
**The cons:**
- anti-pattern (sounds scary ;P),
- violation of OOP (separated properties from methods),
- because logic is in different class, it may be more difficult to maintain when something changes.
So, the opposite approach is to pass the whole object between layers, like [here][5]: no DTO, just BLL looking like that:
public class Order
{
public int Id { get; set; }
public DateTime Date { get; set; }
public string Number { get; set; }
public string CustomerName { get; set; }
public Order()
{
}
public int Add()
{
OrderDAL orderDAL = new OrderDAL();
return orderDAL.Add(this);
}
public int Update(Order order)
{
OrderDAL orderDAL = new OrderDAL();
return orderDAL.Update(order);
}
}
**The pros:**
- it's a nicely encapsulated object, following OOP rules (I suppose ;)).
- both logic and properties are in one place, easier to maintain and debug.
**The cons:**
- to use the object, DAL has to reference BLL (that's not how the 3-tier layer should do, isn't it?).
- class may contain some fields that are not used in Database, as well as some fields from Database (like Id) do not represent "real life" object.
So, **it looks like whatever I choose, I'll violate some rules**. What's better way then, which should I choose? Maybe there is other approach I haven't found?
[1]: http://www.codeproject.com/Articles/36847/Three-Layer-Architecture-in-C-NET
[2]: http://www.aspdotnet-suresh.com/2010/05/introduction-to-3-tier-architecture-in_17.html
[3]: http://martinfowler.com/bliki/AnemicDomainModel.html
[4]: http://en.wikipedia.org/wiki/Anemic_domain_model
[5]: http://www.codeproject.com/Articles/11128/3-tier-architecture-in-C | 0 | [
2,
203,
8,
15187,
2607,
13,
8,
2848,
1054,
128,
9124,
800,
3726,
3726,
749,
20,
8713,
203,
8,
15187,
13,
5,
1270,
45,
7197,
15,
31,
114,
259,
20,
1725,
51,
669,
11545,
102,
15,
27,
53,
1940,
6,
2607,
31,
22,
195,
216,
86,
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... |
Inheritance and Polymorphism in LINQ Lambdas
===
I've got a couple of classes inheriting from a base class
Public MustInherit Class BaseClass
Public Property Name as String
End Class
Public MustInherit Class ClassA
Inherits BaseClass
Public Property Something As String
End Class
Public MustInherit Class ClassB
Inherits BaseClass
Public Property SomethingElse As String
End Class
I want to be able to use a single expression to query multiple lists of objects, all of which inherit from the same base class
Public Function DoStuff(Expression as System.Linq.Expressions.Expression(Of Func(Of BaseClass, Boolean)))
Dim ListA As New List(Of ClassA) ''Populating this elsewhere
Dim ListB As New List(Of ClassB) ''and this
Dim ResultSetA = ListA.Where(Expression) ''Problems on this line
Dim ResultSetB = ListA.Where(Expression) ''and this
End Function
Since both `ClassA` and `ClassB` inherit from the same base class, and since the LINQ query is against the base class, it _should_ work. The `Expression` can only refer to properties of the base class which are guaranteed to be present on both derived classes but I get the following compile-time typing error:
Value of type 'System.Linq.Expressions.Expression(Of System.Func(Of BaseClass, Boolean))' cannot be converted to 'System.Linq.Expressions.Expression(Of System.Func(Of ClassA, Boolean))'
Is there any way I can add a widening conversion (or something similar) to allow this to work?
or do I need to provide the exact same query multiple times against each derived class? | 0 | [
2,
13852,
17,
3446,
13348,
19,
6294,
1251,
13,
24187,
18,
800,
3726,
3726,
31,
22,
195,
330,
21,
1335,
16,
2684,
17569,
68,
37,
21,
1000,
718,
317,
491,
108,
1694,
242,
718,
1000,
1898,
317,
1354,
204,
28,
3724,
241,
718,
317,
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... |
JPA and generics
===
I'm wondering how an abstract class with generics would handle with JPA? I mean what kind of annotations do I need for the field?
Consider these:
@MappedSuperclass
public abstract class AbstractMyClass<T> {
// What about Strings and Integers? Do I need some kind of @LOB?
private T field;
public T getField() {
return field;
}
public void setField(T field) {
this.field = field;
}
}
And then these
@Entity
@Table(name = "String")
public class MyStringClass extends AbstractMyClass<String> {
}
@Entity
@Table(name = "Integer")
public class MyIntegerClass extends AbstractMyClass<Integer> {
}
| 0 | [
2,
487,
1060,
17,
12733,
18,
800,
3726,
3726,
31,
22,
79,
5712,
184,
40,
8502,
718,
29,
12733,
18,
83,
3053,
29,
487,
1060,
60,
31,
884,
98,
825,
16,
40,
1270,
7504,
107,
31,
376,
26,
14,
575,
60,
3563,
158,
45,
13,
1,
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... |
loading application on blackberry playbook simulator encountered an error
===
I developed an application in BlackBerry playbook native sdk using QNX. I try to test it on simulator(running in vmware) an error occurred like `"'Downloading and starting the application...' has encoundered a problem"`. The screenshot attached below![][1]
**Please Help me to solve this problem**
[1]: http://i.stack.imgur.com/9EREa.png | 0 | [
2,
12797,
3010,
27,
27367,
418,
5199,
24565,
8208,
40,
7019,
800,
3726,
3726,
31,
885,
40,
3010,
19,
27367,
418,
5199,
1275,
13,
18,
43,
197,
568,
2593,
103,
396,
9,
31,
1131,
20,
1289,
32,
27,
24565,
5,
11325,
19,
13,
20147,
50... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to export gridview image and data to PDF using asp.net or Export gridview data to PDF using asp.net
===
protected void Button4_Click(object sender, EventArgs e)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition","attachment;filename=GridViewExport.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
GridView1.AllowPaging = false;
GridView1.DataBind();
GridView1.RenderControl(hw);
StringReader sr = new StringReader(sw.ToString());
Document pdfDoc = new Document(PageSize.A4, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfDoc);
PdfWriter.GetInstance(pdfDoc, Response.OutputStream);
pdfDoc.Open();
htmlparser.Parse(sr);//this is the error line
pdfDoc.Close();
Response.Write(pdfDoc);
Response.End();
} | 0 | [
2,
184,
20,
7487,
7354,
4725,
1961,
17,
1054,
20,
13,
11124,
568,
28,
306,
9,
2328,
54,
7487,
7354,
4725,
1054,
20,
13,
11124,
568,
28,
306,
9,
2328,
800,
3726,
3726,
3803,
11364,
5167,
300,
1,
150,
10129,
5,
23793,
2660,
106,
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 grid view using jquery in asp.net and click a select Field column, then Update,Delete and Insert new recorde
===
I want to create a grid view using jQuery in asp.net(C#),in which is a column(select) then click select
link show all records in the editing form where I want to edit,delete,insert records using jquery. | 0 | [
2,
184,
20,
1600,
7354,
1418,
568,
487,
8190,
93,
19,
28,
306,
9,
2328,
17,
10840,
21,
5407,
575,
4698,
15,
94,
11100,
15,
24249,
591,
17,
14692,
78,
571,
62,
800,
3726,
3726,
31,
259,
20,
1600,
21,
7354,
1418,
568,
487,
8190,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
url does not change when redirecting using request.getRequestDispatcher("../login.jsp")
===
On session logout the page should redirect to login.jsp.It is redirecting to login.jsp if I use request.getRequestDispatcher("../login.jsp").forward(request, response) but the url is not changing.
what should I do so that it go and change the url too and redirect me to login page?
Thanks | 0 | [
2,
287,
6362,
630,
52,
753,
76,
302,
14706,
68,
568,
3772,
9,
3060,
99,
10351,
2906,
23661,
106,
5,
7,
9,
9,
118,
5567,
108,
9,
728,
3401,
7,
6,
800,
3726,
3726,
27,
3723,
6738,
1320,
14,
2478,
378,
302,
14706,
20,
6738,
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... |
Model of curriculum vitae with Latex
===
Please, is there any patterns (model or package) to download to do a cv with latex?
Thank you so much | 2 | [
2,
1061,
16,
8880,
13,
11038,
62,
29,
456,
396,
800,
3726,
3726,
2247,
15,
25,
80,
186,
6282,
13,
5,
13998,
54,
6030,
6,
20,
7121,
20,
107,
21,
13,
12732,
29,
456,
396,
60,
3531,
42,
86,
212,
3,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
PHP - Upload picture and display on page
===
The following code allows me to upload pictures (using a html form) to a directory on my server. Is there anyway to modify it so that it will add to a html page instead?
`<?php`
`$target = "http://www.mockcourt.org.uk/user/htdocs/pics/2012/";`
`$target = $target . basename( $_FILES['uploaded']['name']) ;`
`$ok=1;`
`if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{`
`echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
} `
`else {`
`echo "Sorry, there was a problem uploading your file.";`
`}`
`?>`
Thanks | 0 | [
2,
13,
26120,
13,
8,
71,
8294,
2151,
17,
3042,
27,
2478,
800,
3726,
3726,
14,
249,
1797,
2965,
55,
20,
71,
8294,
3104,
13,
5,
12655,
21,
13,
15895,
505,
6,
20,
21,
16755,
27,
51,
8128,
9,
25,
80,
2774,
20,
17579,
32,
86,
30,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Eclipse Juno - Assertion Failed Error
===
I recently installed `Eclispe Juno for Java`. I usually press `.` after a class name to know the associated methods, in case I wish to choose another some other method instead of one already choosen from this list the following error pops up in the IDE.
How can tell IDE that this is not an error and there is no need to pop this message again and again?
![enter image description here][1]
[1]: http://i.stack.imgur.com/c9wjW.jpg | 0 | [
2,
11652,
21715,
13,
8,
20878,
1702,
7019,
800,
3726,
3726,
31,
1989,
4066,
13,
1,
3319,
3159,
1664,
21715,
26,
8247,
1,
9,
31,
951,
901,
13,
1,
9,
1,
75,
21,
718,
204,
20,
143,
14,
1598,
3195,
15,
19,
610,
31,
2536,
20,
353... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 post image on friends wall in Facebook with Facebook-sdk
===
1)I simply post the message on Facebook friends wall but I wants post an Image on Facebook friends wall, what I add in my code?
2)Facebook SDK Vs Graph APi (what the difference).
I use the following code for posting message on Facebook friend's wall
thanks
[[FBRequestWrapper defaultManager] sendFBRequestWithGraphPath:_graphPath params:[NSMutableDictionary dictionaryWithObject:@"Post on wall :)" forKey:@"message"] andDelegate:self];
| 0 | [
2,
184,
20,
678,
1961,
27,
954,
769,
19,
9090,
29,
9090,
8,
18,
43,
197,
800,
3726,
3726,
137,
6,
49,
1659,
678,
14,
2802,
27,
9090,
954,
769,
47,
31,
2846,
678,
40,
1961,
27,
9090,
954,
769,
15,
98,
31,
3547,
19,
51,
1797,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is the following interface contract not allowed?
===
I'm thinking about offering a new feature to Java and I would like to ask why have it been restricted by design so far:
public abstract class BodyPart {
abstract public void followBodyPart(BodyPart part);
}
public class Head extends BodyPart{
public void followBodyPart(Body body ) { //Why is this kind of implementation not allowed?
...
}
}
public class Body extends BodyPart{
public void followBodyPart(Head head ) { //and this
...
}
public void followBodyPart(Forearm leftForearm ) { //and also this
...
}
...
}
//Arm, Forearm, etc...
Why is followBodyPart(Body body) in Head not implementing followBody in BodyPart? If it would, the advantages would be clear.
<p>Firstly, the IDE would be able to offer within it's autocomplete feature Body objects as parameters to followBody instead of any other BodyParts objects that Head can not follow.
<p>Secondly, the current version of Body consists of one function and many instanceof's, which could be eliminated.
<p>Finally, generics can help here but not solve the problem, since this code should be ported to Java ME devices.
<p> This question was already asked, in the not appropriate forum as I discovered [here][1]
<p> Thanks.
[1]: https://forums.oracle.com/forums/thread.jspa?messageID=10424263� | 0 | [
2,
483,
25,
14,
249,
6573,
1305,
52,
1159,
60,
800,
3726,
3726,
31,
22,
79,
1440,
88,
4090,
21,
78,
1580,
20,
8247,
17,
31,
83,
101,
20,
1349,
483,
57,
32,
74,
7079,
34,
704,
86,
463,
45,
317,
8502,
718,
358,
3091,
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... |
print variable with alignment
===
I manually execute a query and copy paste the output to an editor.Now it is well aligned like
"Hi,
This is sample data.
Thanks."
If I stored the output of the query in a php varibale and print it using echo command it is not aligned. It looks like
"Hi, This is sample data. Thanks."
Is it possible to print the output as it is in php? | 0 | [
2,
4793,
7612,
29,
12448,
800,
3726,
3726,
31,
23671,
15644,
21,
25597,
17,
4344,
640,
62,
14,
5196,
20,
40,
1835,
9,
1387,
32,
25,
134,
13,
12740,
101,
13,
7,
1822,
15,
48,
25,
5717,
1054,
9,
3669,
9,
7,
100,
31,
8214,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get SSLIdentityAndCertificates in a iphone projet?
===
I downloaded SecureHTTPServer project from CocoaHTTPServer.
Now i am trying to implement this in a iphone project. **But DDKeychain and Cocoa.h is not available for iOS**inside the DDKeyChain class there is method for get the
**SecCertificateRefs**.
> How can i create this method in iPhone?
Following are the function description of SSLIdentityAndCertificates.
/*Returns an array of SecCertificateRefs except for the first element in the array, which is a SecIdentityRef.
Currently this method is designed to return the identity created in the method above.
You will most likely alter this method to return a proper identity based on what it is you're trying to do.
*/
**+ (NSArray *)SSLIdentityAndCertificates**
| 0 | [
2,
184,
20,
164,
13,
18,
18,
255,
13384,
856,
290,
17580,
24831,
3231,
19,
21,
21024,
895,
10307,
60,
800,
3726,
3726,
31,
23887,
4315,
21127,
10321,
106,
669,
37,
24507,
21127,
10321,
106,
9,
130,
31,
589,
749,
20,
8713,
48,
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... |
Npapi Plugin not detected in demobrowser of QtWebkit
===
I am a newbie to StackOverflow and QtWebkit as well. I have written a very basic Npapi plugin which has functions like NP_GetMimeTypeDescription and Np_Initialise etc for Mimetype 'application/basic-plugin' and Mimetype description 'application/basic-plugin:bsc:Plug-ins SDK sample'.
But I am facing a problem while loading it on the demobrowser of QtWebKit and also on Mozilla Firefox. I have placed the generated .so file in the paths where ever browser finds plugins like /usr/lib/mozilla/plugins/ and Qt Lib path.
I have a test.html file which contains the Mimetype application/basic-plugin. I am trying to launch this plugin in both the Mozilla browser and QtWebKit Demo Browser But in both the cases its not launching the plugin.
I am not able to find out why.
Any suggestions are Welcome...
| 0 | [
2,
13,
103,
1060,
2159,
10922,
108,
52,
11968,
19,
8376,
25699,
4104,
16,
2593,
38,
14113,
13703,
800,
3726,
3726,
31,
589,
21,
78,
5893,
20,
7566,
2549,
9990,
17,
2593,
38,
14113,
13703,
28,
134,
9,
31,
57,
642,
21,
253,
2125,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
disable sure-fire and execute fail-safe report to run my test cases in a maven project
===
In My Parent POM I have configured for sure fire report. But in some modules , I need to skip the sure fire report generation and instead I want to run fail-safe plugin to generate the test report.
I have tried like
<properties>
<skipTests>true</skipTests>
<skipFailsafeTests>false</skipFailsafeTests>
</properties>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.5</version>
<configuration>
<skipTests>${skipFailsafeTests}</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipExec>${skipTests}</skipExec>
<skipTests>${skipTests}</skipTests>
</configuration>
</plugin>
But Still it seems sure-fire report is running..
Is there any way to overcome it?
Regards
Sujeesh
| 0 | [
2,
1460,
579,
562,
8,
5929,
17,
15644,
7476,
8,
18166,
1330,
20,
485,
51,
1289,
1871,
19,
21,
1216,
3124,
669,
800,
3726,
3726,
19,
51,
4766,
16214,
31,
57,
28895,
26,
562,
535,
1330,
9,
47,
19,
109,
17113,
13,
15,
31,
376,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Nesting a variable number of keys to create a multidimensional array without using eval()
===
I've created a function that returns a nested array based in the values and keys of another two arrays and assigns a third value to the deepest key (hope it makes any sense with the code):
function myfunc_build_array($mydata,$keys,$value)
{
$newarr=array();
foreach ($mydata as $data)
{
$evalvar='$newarr';
foreach ($keys as $key)
{
$evalvar.="['".$data[$key]."']";
}
$evalvar.='=$value;';
eval($evalvar);
}
return $newarr;
}
So, i.e. if we have:
$mydata=array(
0=>array('section'=>'NS1','subsection'=>'NS1A','employee'=>'2812','name'=>'Bob'),
1=>array('section'=>'NS1','subsection'=>'NS1A','employee'=>'2811','name'=>'Bib'),
2=>array('section'=>'NS1','subsection'=>'NS1B','employee'=>'2718','name'=>'Bub'),
);
$keys= array('section','subsection','employee');
The result for myfunc_build_array($mydata,$keys,"active"); is:
array(1) {
["NS1"]=>
array(2) {
["NS1A"]=>
array(2) {
[2812]=>
string(6) "active"
[2811]=>
string(6) "active"
}
["NS1B"]=>
array(1) {
[2718]=>
string(6) "active"
}
}
}
It works fine but as I usually avoid using eval(), I was wondering if there is a better way to do it, more elegant or faster. | 0 | [
2,
24338,
21,
7612,
234,
16,
5534,
20,
1600,
21,
1889,
7865,
7718,
366,
568,
13,
62,
3377,
5,
6,
800,
3726,
3726,
31,
22,
195,
679,
21,
1990,
30,
4815,
21,
5618,
69,
7718,
432,
19,
14,
4070,
17,
5534,
16,
226,
81,
7718,
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 do I ensure that I run the code I've just installed?
===
Developing on Android, very often the following happens:
- I export a release build of my application, I install it on the device and I run it.
- I do some changes. I export it again
- I reinstall it on the device
- I kill EVERYTHING from the Task Manager
- I run the installation again
So I would expect the newly installed version of the application to be run. But instead, I'm still running the old code. I can tell it for sure because I've added some Log.d() traces and they don't show up in the logs.
So, I guess the old version of the classes are still somewhere in memory and the new ones are not loaded until.......... until something.
So what do I have to do (except reboot, please) in order to make sure that when I run the application, I run the newly installed one?
Isn't killing the application enough?
I'd hate to have to uninstall it before reinstall, for several reasons. Or is that the only way? | 0 | [
2,
184,
107,
31,
4062,
30,
31,
485,
14,
1797,
31,
22,
195,
114,
4066,
60,
800,
3726,
3726,
3561,
27,
13005,
15,
253,
478,
14,
249,
5531,
45,
13,
8,
31,
7487,
21,
830,
1895,
16,
51,
3010,
15,
31,
16146,
32,
27,
14,
3646,
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... |
Doctrine Migrations, problems using custom doctrine types
===
I'm building a application using Symfony2 + Doctrine2. My application needs to store geospatial data, so I wrote the proper doctrine extensions. All is working pretty good and the app have been running in a production enviroment for a long time.
Now I have to add some new features and I need to update the database without deleting all the data. I thougth about using the DoctrineMigrationBundle but when I run:
$ php app/console doctrine:migrations:status
I got this error:
[Doctrine\DBAL\DBALException]
Unknown database type point requested,
Doctrine\DBAL\Platforms\MySqlPlatform may not
support it.
This is the relevant section of my config.yml:
# Doctrine Configuration
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
types:
point: App\EngineBundle\DoctrineExtensions\PointType
The custom type 'point' has been mapped, so what am I doing wrong? | 0 | [
2,
7521,
8443,
18,
15,
1716,
568,
5816,
7521,
2551,
800,
3726,
3726,
31,
22,
79,
353,
21,
3010,
568,
13,
7261,
10229,
93,
135,
2754,
7521,
135,
9,
51,
3010,
2274,
20,
1718,
6389,
18,
10563,
192,
1054,
15,
86,
31,
738,
14,
4119,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 ping timeout parameter doesn't seem to work
===
If I do 'ping -w 5 google.com' from a command prompt on my Windows XP (also Windows 7) box, I get all packets returned successfully, but all have a trip time of more than 5 ms. Am I mis-understanding how the -w flag is supposed to work?
Thanks,
Al. | 0 | [
2,
1936,
13,
3181,
85,
1320,
18906,
1437,
22,
38,
2260,
20,
170,
800,
3726,
3726,
100,
31,
107,
13,
22,
3181,
13,
8,
499,
331,
8144,
9,
960,
22,
37,
21,
1202,
11443,
4417,
27,
51,
1936,
23045,
13,
5,
2573,
1936,
453,
6,
1649,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java thread garbage collection
===
Is a thread garbage collected when the `run()` method within the thread is finished or when the function where it was called from finishes?
I don't have an issue or anything, but I want to avoid memory leaks and such.
For people who like code:
public void SomeClass {
public SomeClass() {
}
public void someMethod() {
Object data = veryBigObject;
while(true) {
MyThread thread = new MyThread(veryBigObject);
thread.run();
try {
Thread.sleep(1000);
} catch (InterruptedException e) { /* do nothing */ }
}
}
public static void main(String[] args) {
SomeClass myclass = SomeClass();
myclass.someMethod();
}
}
public class MyThread extends Thread {
private Object data;
public Thread(Object data) {
this.data = data;
}
public void run() {
// do stuff with data
}
}
In all languages I know, garbage (if the language has any) is collected when a method ends. I assume Java does as well. That means that theoretically the threads I create in `someMethod()` are not collected until `someMethod()` ends. If we assume the while loop runs for a very long time, the application would run out of memory and crash.
My question: is this true? If so, what to do to avoid it? | 0 | [
2,
8247,
9322,
15024,
1206,
800,
3726,
3726,
25,
21,
9322,
15024,
3674,
76,
14,
13,
1,
3169,
5,
6,
1,
2109,
363,
14,
9322,
25,
842,
54,
76,
14,
1990,
113,
32,
23,
227,
37,
13625,
60,
31,
221,
22,
38,
57,
40,
1513,
54,
602,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Prevent htaccess 301 redirects on sub-domain
===
I have 301 redirects which direct /index.html to /site folder and when i created a sub-domain it also redirects the link to /site which causes 404 Not Found
For example: members.mysite.com redirects to members.mysite/site which causes 404 error can I add execption for specific forlder or something without changing the redirect.
**htaccess content**
AddType text/x-server-parsed-html .htm .html
RedirectMatch 301 ^/index.html(.*)$ /site$1
| 0 | [
2,
2501,
13,
9020,
20604,
13,
18979,
302,
14706,
18,
27,
972,
8,
537,
6232,
800,
3726,
3726,
31,
57,
13,
18979,
302,
14706,
18,
56,
1744,
13,
118,
25671,
9,
15895,
20,
13,
118,
9097,
19294,
17,
76,
31,
679,
21,
972,
8,
537,
62... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does string replace modifies the original variable value?
===
9.3 I'm getting a strange behaviour and I cannot understand why:
s = self.shopify_p
s.title
=> "Disco (Wholesale)"
Right now I'd like to have a new variable with the content of s.title without the " (Wholesale)" part.
So I do the following:
original_title = s.title
=> "Disco (Wholesale)"
original_title[" (Wholesale)"] = ""
=> ""
Now if I do:
original_title
=> "Disco"
Which is ok but the strange thing is that it seems that the last string replace affected even the original s variable:
s.title
=> "Disco"
I really cannot understand this...can you tell me what is happening here?
s.title should still be "Disco (Wholesale)"...or not?
| 0 | [
2,
483,
630,
3724,
3934,
7226,
12970,
14,
501,
7612,
1923,
60,
800,
3726,
3726,
561,
9,
240,
31,
22,
79,
1017,
21,
2578,
7727,
17,
31,
1967,
1369,
483,
45,
13,
18,
800,
1119,
9,
18,
5347,
8612,
1,
306,
13,
18,
9,
22235,
800,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Execute google analytics code after ajax request
===
What is the best way of executing google tracking javascript when an ajax request has successfully completed?
The ajax request:
$('#form').ajaxSubmit({
url:'process.php',
success:function(response) {
if(response == 'success')
{
// trigger analytics code
}
}
});
Google Analytics Code:
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = xxxxxxx;
/* ]]> */
</script>
<script type="text/javascript" src="http://www.googleadservices.com/pagead/conversion.js">
</script>
<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/"/>
</div>
</noscript>
Would I need to add the analytics code to a separate js file and then use http://api.jquery.com/jQuery.getScript/ ?
Or could I just append `<img height="1" width="1" style="border-style:none;" alt="" src="http://www.googleadservices.com/"/>` to the page? | 0 | [
2,
15644,
8144,
26320,
1797,
75,
20624,
3772,
800,
3726,
3726,
98,
25,
14,
246,
161,
16,
25836,
8144,
10353,
8247,
8741,
76,
40,
20624,
3772,
63,
3673,
1066,
60,
14,
20624,
3772,
45,
5579,
5,
22,
5910,
4190,
22,
6,
9,
6881,
7522,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google Charts as Image
===
I am trying to use Google charts to embed images of charts in the emails. So Each user will have a unique graph.
Can we use the API and embed a unique URL that will render the Charts and deliver an Image to the email Client. | 0 | [
2,
8144,
5158,
28,
1961,
800,
3726,
3726,
31,
589,
749,
20,
275,
8144,
5158,
20,
11911,
69,
3502,
16,
5158,
19,
14,
8517,
18,
9,
86,
206,
4155,
129,
57,
21,
2619,
7210,
9,
92,
95,
275,
14,
21,
2159,
17,
11911,
69,
21,
2619,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
jquery beforeunload submit form
===
I have a form.edit_recipe and my aim is to get this form to successfully save (if there is new data) before the page unloads, without the prompting of the user.
This is the critical bit of JQ:
$(document).ready(function() {
$(window).bind('beforeunload', function() {
if (auto_save_timer) { // auto_save_timer == true means there are changes
$("#auto_save_overlay").css('display', 'block'); // shows a spinner
$(".edit_recipe").submit();
}
});
});
On clicking a link to the next page, sometimes the changes save and sometimes they don't, even in identical situations and data sets.
I'm 99% certain my other variables and JQ on the page aren't effecting this, but I can update with more code samples if needs be.
I'm lost or what the issue is but I feel it's to do with the form data being interrupted by the next page loading.
Any suggestions? | 0 | [
2,
487,
8190,
93,
115,
1020,
8294,
12298,
505,
800,
3726,
3726,
31,
57,
21,
505,
9,
69,
242,
1,
15110,
1664,
17,
51,
5226,
25,
20,
164,
48,
505,
20,
3673,
2079,
13,
5,
821,
80,
25,
78,
1054,
6,
115,
14,
2478,
367,
8294,
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 avoid "ls: write error: Broken pipe" with php exec
===
I'm having an error that causes me a very big waste of time. This is the line:
exec ("ls -U ".$folder." |head -1000", $ls_u);
This command runned on my shell needs less than a second, launched by php (direct from console, not throw apache) needs more than 15 seconds and I get this error:
ls: write error: Broken pipe
In the directory where is performing this action has more than 4.5M files, for this reason I use ls -U | head -1000 of course if the | fails it needs to list 4.5M files, besides than do just 1K.
Where is the error? Or using pipes in php exec is not a good idea?!
Thanks | 0 | [
2,
184,
20,
2658,
13,
7,
7532,
45,
2757,
7019,
45,
2023,
7642,
7,
29,
13,
26120,
1396,
3319,
800,
3726,
3726,
31,
22,
79,
452,
40,
7019,
30,
4047,
55,
21,
253,
580,
4600,
16,
85,
9,
48,
25,
14,
293,
45,
1396,
3319,
13,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I implement IEnumerable<T>
===
I know how to implement the non generic IEnumerable, like this:
using System;
using System.Collections;
namespace ConsoleApplication33
{
class Program
{
static void Main(string[] args)
{
MyObjects myObjects = new MyObjects();
myObjects[0] = new MyObject() { Foo = "Hello", Bar = 1 };
myObjects[1] = new MyObject() { Foo = "World", Bar = 2 };
foreach (MyObject x in myObjects)
{
Console.WriteLine(x.Foo);
Console.WriteLine(x.Bar);
}
Console.ReadLine();
}
}
class MyObject
{
public string Foo { get; set; }
public int Bar { get; set; }
}
class MyObjects : IEnumerable
{
ArrayList mylist = new ArrayList();
public MyObject this[int index]
{
get { return (MyObject)mylist[index]; }
set { mylist.Insert(index, value); }
}
IEnumerator IEnumerable.GetEnumerator()
{
return mylist.GetEnumerator();
}
}
}
However I also notice that IEnumerable has a generic version, `IEnumerable<T>`, but I can't figure out how to implement it.
If I add `using System.Collections.Generic;` to my using directives, and then change:
class MyObjects : IEnumerable
to:
class MyObjects : IEnumerable<MyObject>
And then right click on `IEnumerable<MyObject>` and select `Implement Interface => Implement Interface`, Visual Studio helpfully adds the following block of code:
IEnumerator<MyObject> IEnumerable<MyObject>.GetEnumerator()
{
throw new NotImplementedException();
}
Returning the non generic IEnumerable object from the `GetEnumerator();` method doesn't work this time, so what do I put here? The CLI now ignores the non generic implementation and heads straight for the generic version when it tries to enumerate through my array during the foreach loop.
Thanks | 0 | [
2,
184,
107,
31,
8713,
13,
660,
6336,
106,
579,
1,
38,
1,
800,
3726,
3726,
31,
143,
184,
20,
8713,
14,
538,
12733,
13,
660,
6336,
106,
579,
15,
101,
48,
45,
568,
329,
73,
568,
329,
9,
15015,
5757,
73,
204,
5582,
8650,
2552,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Twitter-Bootstrap/Jquery : Dropdown doesn't lie below button, rather start from start of div
===
Here is the jsfiddle : http://jsfiddle.net/hhimanshu/sYLRq/
**Current**
- Click on "Add to list" and drop-down falls way left
**Required**
- Click on "Add to list" and drop-down falls just below "Add to list button"
What is wrong I am doing here?
What is that I need to fix?
Thank you | 0 | [
2,
10623,
8,
10858,
38,
18,
16514,
118,
728,
8190,
93,
13,
45,
2804,
2968,
1437,
22,
38,
2850,
1021,
5167,
15,
864,
799,
37,
799,
16,
13,
12916,
800,
3726,
3726,
235,
25,
14,
487,
18,
1707,
12312,
13,
45,
7775,
6903,
728,
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... |
excel .save() not working in 2007
===
The following vb.net code works in 2010, but it often breaks in 2007. It's not even consistent.
_Application1.ActiveWorkbook.Save()
where _Applicatio1n is of type `Microsoft.Office.Interop.Excel.Application`
This is the error-code:`0x800A03EC`
The file is not on network drive or anything (which seems to be the common reason based on google search).
| 0 | [
2,
20700,
13,
9,
19863,
5,
6,
52,
638,
19,
624,
800,
3726,
3726,
14,
249,
13,
20468,
9,
2328,
1797,
693,
19,
498,
15,
47,
32,
478,
7947,
19,
624,
9,
32,
22,
18,
52,
166,
8224,
9,
13,
1,
2552,
20669,
165,
9,
7889,
3783,
519... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Attaching an event from an unreferenced library
===
I need to fire a method in library b, when a method is called in library a.
For example, is it somehow possible for `library b` to attach to the event `testEvent` in library a?
**library a - cannot reference library b (because of a circular dependency)**
public event testEvent = null;
pubic class alpha{
public void main(){//application entry point
}
}
**library b - has reference to `library a`**
public class beta{
public void hello(){
}
}
Failing that, I think I will have to create a third library, `library c`, that has a reference to `library b`, and is referenced by `library a`.
| 0 | [
2,
19514,
68,
40,
807,
37,
40,
367,
28018,
43,
1248,
800,
3726,
3726,
31,
376,
20,
535,
21,
2109,
19,
1248,
334,
15,
76,
21,
2109,
25,
227,
19,
1248,
21,
9,
26,
823,
15,
25,
32,
3625,
938,
26,
13,
1,
1210,
2559,
622,
334,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cocuchbase .Net client library GetView caching issue
===
I'm running couchbase server 2.0 (dev preview 4) and using .net client library version 1.2.
When I add some document (json) to my database and then in few seconds (less then 10) I try to get this document via GetView through .net client library and it always returns old value on first query. Only on second query it returns actual value.
When I exec same query through REST api, it returns actual value.
Can anyone provide some information about this? | 0 | [
2,
326,
150,
6396,
8436,
13,
9,
2328,
6819,
1248,
164,
4725,
1658,
7192,
1513,
800,
3726,
3726,
31,
22,
79,
946,
4914,
8436,
8128,
172,
9,
387,
13,
5,
14438,
16121,
268,
6,
17,
568,
13,
9,
2328,
6819,
1248,
615,
137,
9,
135,
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... |
HTML5 Storage wildcard domain?
===
I think I know the answer already but I'm wondering if there is any support or possibility of storing LocalStorage and SessionStorage via wildcard domain?
The only solution I've come up with is storing it in a single domain then use a hidden iframe and postmessage to accomplish this for storing and retrieving. This works but is a hack and requires an iframe load each time as an extra request. Any other suggestion that is cleaner besides using wildcard cookies that bulk up the bandwidth?
Also, the HTML5 specification should have already included this. Cookies do already so who were the geniuses on that decision board and why wasn't I on it? | 0 | [
2,
13,
15895,
264,
4326,
23003,
4603,
60,
800,
3726,
3726,
31,
277,
31,
143,
14,
1623,
614,
47,
31,
22,
79,
5712,
100,
80,
25,
186,
555,
54,
4813,
16,
25615,
375,
18,
2153,
1303,
17,
5763,
2153,
1303,
1197,
23003,
4603,
60,
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... |
condense many ul elements into one
===
My html is generated like this:
<div class="tags">
<ul>
<li>Red</li>
<li>Green</li>
</ul>
<ul>
<li>Blue</li>
<li>Yellow</li>
</ul>
</div>
Whats the best way to strip out the extra ul elements and condense into one. For example:
<div class="tags">
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
<li>Yellow</li>
</ul>
</div>
Many thanks | 0 | [
2,
19691,
23157,
151,
13,
1287,
2065,
77,
53,
800,
3726,
3726,
51,
13,
15895,
25,
6756,
101,
48,
45,
13,
1,
12916,
718,
3726,
7,
8628,
18,
7,
1,
13,
1,
1287,
1,
13,
1,
1210,
1,
2095,
1,
118,
1210,
1,
13,
1,
1210,
1,
6852,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 draw a Flash object into a memory DC?
===
I'm writing a small game (with DC), I would like to use some Flash files to show the animation to screen in my game, but i'm using memory DC to draw.
I would like change the FlashPlayer's output device to my memory DC. Is that possible? What should i do? Thank you! | 0 | [
2,
184,
20,
2003,
21,
4433,
3095,
77,
21,
1912,
4752,
60,
800,
3726,
3726,
31,
22,
79,
1174,
21,
284,
250,
13,
5,
1410,
4752,
6,
15,
31,
83,
101,
20,
275,
109,
4433,
6488,
20,
298,
14,
6236,
20,
2324,
19,
51,
250,
15,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how do I write javascript to redirect on a home page, if screen.width <=480, only once, upon it's first encounter by a mobile device
===
I have created a redirect based on screen width.
The page is <https://galleryofjewels.businesscatalyst.com/home>
I would like the redirect to only happen once, when the mobile phone first encounters “home” here: https://galleryofjewels.businesscatalyst.com/home
I am redirecting the “home” page to a page called “about-us-mobile” designed for 480 or less screen width using this javascript:
if (screen.width <= 480) {
document.location = "about-us-mobile ";
enter code here`}
I only have 2 pages that are optimized for the 480 or less and a link “shop”on those two pages which go back to galleryofjewels.businesscatalyst
I want the mobile phone to click the “shop” button to see the full “home” page without being redirected again to “about-us-mobile”.
So I created a page which is a copy of the “home” page and called it “home_full_site_shop”. It has no redirect on it. The “shop” button on the mobile pages links to this page.
If the mobile phone eventually tries to link back to the home page again via the “shop” button on any page of galleryofjewels.businesscatalyst I would like it ***Not*** to redirect again to “about-us-mobile”.
In short, I would like the redirect to only happen once, when the mobile phone first encounters the galleryofjewels.businesscatalyst home page
| 0 | [
2,
184,
107,
31,
2757,
8247,
8741,
20,
302,
14706,
27,
21,
213,
2478,
15,
100,
2324,
9,
3976,
43,
96,
13,
1,
3726,
16318,
15,
104,
382,
15,
685,
32,
22,
18,
64,
7007,
34,
21,
3241,
3646,
800,
3726,
3726,
31,
57,
679,
21,
302... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is an explicit readonly property with set & get equivalent to get & private set?
===
Let's say I have 2 properties
public readonly list<int> numberListReadonly { get; set; }
public list<int> numberListPrivateSet { get; private set; }
For those property I can have a constructor / private function in Foo, I can initiate those list without error
public Foo()
{
numberListReadonly = new list<int>();
numberListPrivateSet = new list<int>();
}
public void FooInside()
{
numberListReadonly = new list<int>();
numberListPrivateSet = new list<int>();
}
When I access from outside of the class
void FooOutside()
{
Foo.numberListReadonly = new List<int>();
Foo.numberListPrivateSet = new List<int>()
}
The compiler throws error, which is expected.<br />
"Foo.numberListReadonly cannot be assigned to -- it is readonly" <br />
"Foo.numberListPrivateSet cannot be assigned to -- it is readonly"
----------
I do a search it seems that the "common practice" is to use private set on "readonly" property with the ability of "set" within the class<br />
So is an explicit readonly property with set & get equivalent to get & private set? | 0 | [
2,
25,
40,
14990,
1302,
4965,
1354,
29,
309,
279,
164,
4602,
20,
164,
279,
932,
309,
60,
800,
3726,
3726,
408,
22,
18,
395,
31,
57,
172,
3704,
317,
1302,
4965,
968,
1,
6391,
1,
234,
5739,
10647,
4965,
13,
1,
164,
73,
309,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Heroku SSL certificate: change default email address.
===
I am trying to add an SSL certificate which I just bought to my custom domain heroku app. Right now I have www.tradespring.net CNAME'd to tradespring.herokuapp.com.
I have gotten to the step in this article (https://devcenter.heroku.com/articles/ssl) (including all the aquiring certificate steps) where it say add your SSL add-on. I have been using an email address/heroku account (lets call it email 1)
the installing the add-on works perfectly but when I try to enter
heroku certs:add final.crt site.key
it tries to access a different app that is under a different email address/heroku account that I made previously (email 2). This app is the default app for push and pull into heroku. This is in spite of the fact that I am logged in my email 1 account on heroku.
I want it to add the certs for the app in (email 1). I think the reason this is happening is that my email 2 is actually the one I used for all the other steps. it is my default email for my registration of www.tradespring.net. and also the email I used to buy the SSL certificate. I don't know how to change these. But how can I tell heroku to look at my email 1 account and my email 1 app when applying the certificate. Can I add the email name to the line of code?
| 0 | [
2,
36,
9266,
13,
18,
18,
255,
6259,
45,
753,
12838,
8517,
3218,
9,
800,
3726,
3726,
31,
589,
749,
20,
3547,
40,
13,
18,
18,
255,
6259,
56,
31,
114,
2448,
20,
51,
5816,
4603,
36,
9266,
4865,
9,
193,
130,
31,
57,
13,
6483,
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... |
Weird IntelliSense with generic methods
===
I have a code like this:
void F(bool a, bool b) { }
void F(int a) { }
int G<T1, T2>(int a) { return 1; }
class A { }
class B { }
void Main(string[] args)
{
int G = 1;
int A = 1;
int B = 1;
F(G<A, B>(7)); // call F(int a)
F(G<A, B>(7 / 3)); // call F(int a)
F(G<A, B>3); // call F(bool a, bool b)
}
But when I put the mouse over the `A` on the third call in the `Main` function, it says it is `class Sample.Program.A` instead of `(local variable) int A`. Why was it like this?
![enter image description here][1]
I am using Visual Studio 2010 Professional in framework 4. Is it the same with your IntelliSense?
[1]: http://i.stack.imgur.com/fraPV.jpg | 0 | [
2,
5455,
14635,
3159,
6498,
29,
12733,
3195,
800,
3726,
3726,
31,
57,
21,
1797,
101,
48,
45,
11364,
398,
5,
1192,
1823,
21,
15,
1607,
1823,
334,
6,
13,
1,
13,
1,
11364,
398,
5,
6391,
21,
6,
13,
1,
13,
1,
19,
38,
489,
1,
38... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can't run symofny 2 on MAC OS X
===
Using MAC OS X Lion. Newest Version XAMPP.
My Problem:
Warning: require_once(/Users/test/workspace/Symfony/app/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php) [function.require-once]: failed to open stream: No such file or directory in /Users/test/workspace/Symfony/app/autoload.php on line 25
Fatal error: require_once() [function.require]: Failed opening required '/Users/test/workspace/Symfony/app/../vendor/symfony/src/Symfony/Component/Locale/Resources/stubs/functions.php' (include_path='.:/Applications/XAMPP/xamppfiles/lib/php:/Applications/XAMPP/xamppfiles/lib/php/pear') in /Users/test/workspace/Symfony/app/autoload.php on line 25
Configuration: XAMPP:
<VirtualHost *:80>
ServerName sym.tolisto.de
ServerAdmin webmaster@localhost
DocumentRoot /Users/test/workspace/Symfony/web
<Directory /Users/test/workspace/Symfony/web>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
</IfModule>
</Directory>
</VirtualHost>
Symfony 1.4 works. But Symfony2 doesn't Why?
Using MAC OS X Lion. Newest Version XAMPP.
Any suggestions? | 0 | [
2,
92,
22,
38,
485,
13,
7261,
1041,
1536,
172,
27,
1572,
13,
759,
993,
800,
3726,
3726,
568,
1572,
13,
759,
993,
6023,
9,
17175,
615,
993,
765,
3421,
9,
51,
1448,
45,
3590,
45,
4077,
1,
13120,
5,
118,
16704,
18,
118,
10543,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Writing command line argument parsers
===
There are many well known command line argument parsers, like argp or a subset of boost::program_options for C++.
E.g., I recently tried to wrote one that let me parse simple scenarios in C++ like this:
int main (int argc, char *argv[]) {
auto state = parse (argc, argv);
const auto foo = mandatory<int> (state, {'f', "foo"});
const auto bar = optional_with_default<int>(state, {'b', "bar"}, 42);
const auto frob = optional<std::string> (state, {'F', "frob"});
if (!frob) {
...
}
}
but soon discovered that parsing position independent flags is not trivial (e.g. `-fgx` would be the same as `-f -xg`), then throwing position independent flags with value args in the mix became really non trivial (e.g. `tar -xvzf frob.tar.gz`).
The problems became obvious by empiricism only; I didn't find anything for example for [this](www.google.com/#q=how+to+write+a+command+line+argument+parser) search.
Do you know any good resources on the topic? What are your own best practices?
| 0 | [
2,
1174,
1202,
293,
5476,
2017,
18,
445,
800,
3726,
3726,
80,
50,
151,
134,
167,
1202,
293,
5476,
2017,
18,
445,
15,
101,
13,
10663,
306,
54,
21,
16622,
16,
10419,
45,
45,
19746,
1,
25458,
4710,
26,
272,
20512,
9,
13,
62,
9,
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... |
Best for content management wiki with files ?
===
I'm looking for a best content management software which can be installed in a local machine and share the url to other network users.
Requirement:
1) Need to add huge pages - more than 100 or 1000 with clear navigation
2) Need to provide links in the page for the files uploaded
Tried media wiki but it doesn't seems to be that great or easy to modify
Could someone suggest me a best software?
Thanks,
Kathir
| 0 | [
2,
246,
26,
2331,
1097,
13,
17375,
29,
6488,
13,
60,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
246,
2331,
1097,
2306,
56,
92,
44,
4066,
19,
21,
375,
1940,
17,
1891,
14,
287,
6362,
20,
89,
982,
3878,
9,
8981,
45,
137,
6,
376,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WMI query of reporting service instances returns all instances regardless of parent sql server path
===
We have some code to identify the SQL Server instances and their associated Reporting Server instances which is returning unexpected results.
A machine has two instances of SQL Express (2008) - (local)/SQLEXPRESS and (local)/EXPRESS_BOB - each with their own Reporting Server. Using WMI, we identifiy the SQL Server instances and this works as expected. For each instance we then query for RS instances as follows:
public void QueryServers(string wmiPath)
{
using (
var searcher = new ManagementObjectSearcher(
wmiPath,
"Select * from MSReportServer_ConfigurationSetting"))
{
ManagementObjectCollection moc = searcher.Get();
//
// Process objects in moc
//
}
}
This is run for two values of wmiPath (note - requires Run as Admin):
- wmiPath = "root\\Microsoft\\SqlServer\\ReportServer\\RS_SQLEXPRESS\\v10\\Admin"
- wmiPath = "root\\Microsoft\\SqlServer\\ReportServer\\RS_EXPRESS_5fBOB\\v10\\Admin"
Regardless of the value of `wmiPath`, the `moc` collection always holds *two* values:
- *moc[0]* ["InstanceName"] = "SQLEXPRESS"
- *moc[1]* ["InstanceName"] = "EXPRESS_BOB"
How is it that a query under a specified SQL Server instances' WMI path returns Report Server instances that (I expect to) live under a different path?
Is this the correct path to be querying? | 0 | [
2,
619,
1435,
25597,
16,
6670,
365,
13946,
4815,
65,
13946,
7148,
16,
4766,
4444,
255,
8128,
2013,
800,
3726,
3726,
95,
57,
109,
1797,
20,
5808,
14,
4444,
255,
8128,
13946,
17,
66,
1598,
6670,
8128,
13946,
56,
25,
2485,
9380,
1736,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Wallpost from app by PHP SDK doesn't works
===
I am using this:
$facebook->api('/me/feed', 'post', array('link' => 'www.google.com','message'=> 'test', 'cb' => ''));
everything was working perfect yesterday, but the app doesnt post the link on my wall today and it doesnt throws any errors. | 0 | [
2,
769,
6962,
37,
4865,
34,
13,
26120,
13,
18,
43,
197,
1437,
22,
38,
693,
800,
3726,
3726,
31,
589,
568,
48,
45,
5579,
6413,
5199,
8,
1,
2552,
49,
5,
22,
118,
790,
118,
20954,
22,
15,
13,
22,
6962,
22,
15,
7718,
5,
22,
62... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a triangle with for loops
===
I don't seem to be able to find the answer to this-
I need to draw a simple triangle using for loops.
*
***
*****
*******
*********
I can make a half triangle, but I don't know how to add to my current loop to form a full triangle.
*
**
***
****
*****
for (int i=0; i<6; i++)
{
for (int j=0; j<i; j++)
{
System.out.print("*");
}
System.out.println("");
}
Thanks- | 0 | [
2,
2936,
21,
8676,
29,
26,
19661,
800,
3726,
3726,
31,
221,
22,
38,
2260,
20,
44,
777,
20,
477,
14,
1623,
20,
48,
8,
31,
376,
20,
2003,
21,
1935,
8676,
568,
26,
19661,
9,
1637,
8980,
8980,
1409,
8980,
1409,
1409,
8980,
1409,
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... |
Fortran90: array of pointer arrays defined as pointer (bug in ifort 11.1?)
===
I have one question and one problem (I think they are related).
question: Can I use in Fortran90 array of pointer arrays defined as pointer?
type string
character, pointer :: str(:)
end type
type(string), pointer :: arr(:)
problem:
I have code (see below) for which ifort 11.1 gives segfault in the last write. Other compilers, such as gfortran 4.6.3, ifort 11.1.072, 12.0.1, ..., worked without a problem
You can think about the code as simulation of python append function.
program test
implicit none
type string
integer, pointer :: key
character, pointer :: str(:)
end type
type(string), pointer :: arr(:), tmp(:)
allocate(arr(1))
allocate(arr(1)%str(1))
arr(1)%str(1) = 'A'
write(6,*) arr(1)%str(1)
! --------------------
tmp => arr
write(6,*) tmp(1)%str(1)
! --------------------
nullify(arr)
allocate(arr(2))
arr(1)%str => tmp(1)%str
write(6,*) arr(1)%str(1)
end program
Expected result is:
A
A
A
ifort 11.1 gives segmentation fault on the last line. Now comes the weird thing. If you comment out declaration of integer in type string you will get the expected result also with ifort 11.1.
Is this compiler problem or am I using non-standard Fortran90 structures? | 0 | [
2,
26,
17685,
3165,
45,
7718,
16,
454,
106,
7718,
18,
2811,
28,
454,
106,
13,
5,
16254,
19,
31,
6469,
547,
9,
165,
60,
6,
800,
3726,
3726,
31,
57,
53,
1301,
17,
53,
1448,
13,
5,
49,
277,
59,
50,
1597,
6,
9,
1301,
45,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how does iOS scale up a non fullscreen launch image to show it as a fullscreen launch image
===
iOS guidelines ask us to package 768 x 1004 (portrait launch image) or 1024 x 748 (landscape launch image) sized launch images for iPad irrespective of the fact whether the app is fullscreen or not. However if we intend to extend the duration of our full screen by showing the same launch image for some more time so that we can do the initialization in the backend, we tend to see a small drift (the launch image shown by us shifts by a small amount).
This is because of the fact that scaling used by iOS to show the non fullscreen image is different from what when we display the image.
Can someone help me fix this? | 0 | [
2,
184,
630,
13,
7760,
3464,
71,
21,
538,
503,
7187,
3394,
1961,
20,
298,
32,
28,
21,
503,
7187,
3394,
1961,
800,
3726,
3726,
13,
7760,
12629,
1349,
182,
20,
6030,
453,
4279,
993,
808,
300,
13,
5,
26423,
3394,
1961,
6,
54,
332,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to run math action/function from a list in a specific order at any called time, one by one
===
I'm trying to build an algorithm in java, which in ugly way looks like this:
while (true) {
Point p; //a point given in the class constuctor.
p.x+=1;
checkColor(p); // a function that returns true or false for a pixel color.
p.y+=1;
checkColor(p);
p.x-=2;
checkColor(p);
p.y-=3;
... ...
}
and so on and on.. obviously I want to use a loop at this one but, how can I set a specific object to a specific value, at any time when I call add(i);
Which will make this much shorter, up to even 3-5 code lines. | 0 | [
2,
184,
20,
485,
5057,
1028,
118,
22359,
37,
21,
968,
19,
21,
1903,
389,
35,
186,
227,
85,
15,
53,
34,
53,
800,
3726,
3726,
31,
22,
79,
749,
20,
1895,
40,
9083,
19,
8247,
15,
56,
19,
9212,
161,
1879,
101,
48,
45,
133,
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... |
Build XML literal containing Anti-XML object
===
Suppose I have an Anti-XML object, e.g.:
import com.codecommit.antixml._
val child = <child attr="val">...</child>
I want to construct an XML object that contains `child` as a child:
<parent foo="bar"><foo/><child attr="val">...</child><foo/></parent>
The obvious way would be
val parent = <parent foo="bar"><foo/>{ child }<foo/></parent>
The problem is that Scala's XML literals don't recognize Anti-XML's objects, so `child` gets converted to a string, and embedded in `parent` as a text node:
<parent foo="bar"><foo/><child attr="val">...</child><foo/></parent>
How can I work around this issue? | 0 | [
2,
1895,
23504,
20665,
3503,
1082,
8,
396,
8184,
3095,
800,
3726,
3726,
5787,
31,
57,
40,
1082,
8,
396,
8184,
3095,
15,
13,
62,
9,
263,
9,
45,
9010,
13,
960,
9,
9375,
960,
5130,
9,
5578,
396,
8184,
9,
1,
3347,
850,
800,
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... |
STL Priority Queue: When/How Does Resorting Occur?
===
If I have a STL priority_queue of structs, where priority is based on some attribute of the struct, and I change the attribute of one of the structs, such that the new order would be different, would the priority queue know to resort itself? Or would I have to remove it from the queue and push it in again? I read somewhere that the sorting is done when push() and pop() are called, but I'd like to make sure.
| 0 | [
2,
354,
255,
9857,
22521,
45,
76,
118,
1544,
630,
4765,
68,
3744,
60,
800,
3726,
3726,
100,
31,
57,
21,
354,
255,
9857,
1,
2005,
4185,
16,
13,
10346,
18,
15,
113,
9857,
25,
432,
27,
109,
35,
14755,
16,
14,
13,
10346,
15,
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... |
Rails 3 MongoID and nested forms (embedded documents) - how to add form fields of fields_for
===
I am using mongoid (3.0) and rails 3.2 to create a form that stores a model with multiple addresses. How can I add form fields on demand (since I want to let the user decide how much addresses to add to a model)?
In the "new" controller, i use @person.addresses.build to create the embedded document, everything works as expected, even if I try to add several addresses via the Rails console. But how can I create a dynamic form that adds nested fields on user request?
the form:
<%= simple_form_for @person, :html => { :multipart => true } do |f| %>
<%= f.input_field :title %>
<%= f.fields_for :addresses do |t| %>
this is an address input:
<%= t.input :foo %>
<% end %>
<% end %>
the models:
class Rootobject
include Mongoid::Document
field :title
embeds_many :addresses
accepts_nested_attributes_for :addresses
end
class Person < Rootobject
field :firstname
end
class Address
include Mongoid::Document
field :foo
embedded_in :rootobject, :inverse_of => :addresses
end
The above code is simplified from what i am trying to do. My address form actually is in a partial. What would be the most simple way to make the nested form of addresses display another iteration (partial)?
Thanks a lot.
| 0 | [
2,
2240,
18,
203,
21028,
6516,
17,
5618,
69,
1997,
13,
5,
1503,
4283,
7424,
4374,
6,
13,
8,
184,
20,
3547,
505,
2861,
16,
2861,
1,
1106,
800,
3726,
3726,
31,
589,
568,
21028,
6516,
13,
5,
240,
9,
387,
6,
17,
2240,
18,
203,
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... |
Multiple activites in a TabHost
===
This code works well for displaying separate xml items in my main.xml. But is there any way to run an activity in each tab? Preferably without extending `TabActivity`, because its deprecated. Or should i use a completely different approach?
Thanks
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabs = (TabHost)findViewById(R.id.TabHost01);
tabs.setup();
TabHost.TabSpec spec1 = tabs.newTabSpec("tag1");
spec1.setContent(R.id.AnalogClock01);
spec1.setIndicator("Analog Clock");
tabs.addTab(spec1);
TabHost.TabSpec spec2 = tabs.newTabSpec("tag2");
spec2.setContent(R.id.DigitalClock01);
spec2.setIndicator("Digital Clock");
tabs.addTab(spec2);
} | 0 | [
2,
1886,
13,
19516,
6359,
19,
21,
6523,
11694,
800,
3726,
3726,
48,
1797,
693,
134,
26,
17418,
1725,
23504,
3755,
19,
51,
407,
9,
396,
8184,
9,
47,
25,
80,
186,
161,
20,
485,
40,
2358,
19,
206,
6523,
60,
6369,
4801,
366,
8176,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What does getLine1Number() return with dual SIM phones?
===
What does `getLine1Number()` method of `TelephonyManager` return with dual SIM phones like [`LG Optimus Net Dual`][1]?
[1]: http://www.gsmarena.com/lg_optimus_net_dual-4309.php | 0 | [
2,
98,
630,
164,
1143,
165,
16299,
5,
6,
788,
29,
5747,
4861,
14830,
60,
800,
3726,
3726,
98,
630,
13,
1,
3060,
1143,
165,
16299,
5,
6,
1,
2109,
16,
13,
1,
14305,
22031,
22256,
1,
788,
29,
5747,
4861,
14830,
101,
636,
1,
10641... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Calculate Working Days in PHP - Doesn't work for months where the 12th is on Monday
===
I have the strangest issue. I have a script that calculates what the current work day is in a month along with the total amount of working days for the month. For example, today June 25, the script would output "day 17/21".
The strange thing is, for months where the 12th falls on a monday, from the 12th till the end of the month, the current work day shows as 0.0417 days less than what it actually is. For example, for March 11th (a sunday) it shows "7/22". But for March 12th, it shows "7.95833333/22"
Below is my code for the script which I had found on a post somewhere on the internet. Every other time it works perfectly except for this odd occasion.
//##########################################################
//Date Calculations
//##########################################################
$datepicker = $_POST['datepicker'];
$dpyear = date("Y", strtotime($datepicker));
$dpmonth = date("m", strtotime($datepicker));
$dpday = date("d", strtotime($datepicker));
$end = date('Y/m/d', mktime(0, 0, 0, $dpmonth, $dpday, $dpyear)); // seconds * minutes * hours * days
$first = date('Y/m/d', mktime(0, 0, 0, $dpmonth, 1, $dpyear));
$firstOfYear = date('Y/m/d', mktime(0, 0, 0, 1, 1, $dpyear));
$last = date('Y/m/d', mktime(0, 0, 0, $dpmonth + 1, 0, $dpyear));
$firstprevyear = date('Y/m/d', mktime(0, 0, 0, $dpmonth, 1, $dpyear-1));
$lastprevyear = date('Y/m/d', mktime(0, 0, 0, $dpmonth + 1, 0, $dpyear-1));
$prevyearmonth = date('M\'y', mktime(0, 0, 0, $dpmonth + 1, 0, $dpyear-1));
$prevyeardate = "sojd.InvoiceDate >= '$firstprevyear' and sojd.InvoiceDate <= '$lastprevyear' ";
$mtddaterange = "sojd.InvoiceDate >= '$first' and sojd.InvoiceDate <= '$end' ";
$ytddaterange = "sojd.InvoiceDate >= '$firstOfYear' and sojd.InvoiceDate <= '$end' ";
if (date("w", strtotime($datepicker)) == 1) { // if today is Monday, combine weekend and Monday's numbers
$startDate = date('Y/m/d', mktime(0, 0, 0, $dpmonth, $dpday - 2, $dpyear));
$prevdaterange = "sojd.InvoiceDate >= '$startDate' and sojd.InvoiceDate <= '$end'";
$daterange = "sojd.InvoiceDate >= '$startDate' and sojd.InvoiceDate <= '$end'";
$params = array($startDate, $end);
} else {
$prevdaterange = "sojd.InvoiceDate = '$end' ";
$daterange = "sojd.InvoiceDate = '$end'";
$params = array($end);
}
$holidays=array("2012-01-02","2012-05-28","2012-07-04","2012-09-03","2012-11-22","2012-12-25");
function getWorkingDays($startDate,$endDate,$holidays){
// do strtotime calculations just once
$endDate = strtotime($endDate);
$startDate = strtotime($startDate);
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
//We add one to inlude both dates in the interval.
$days = ($endDate - $startDate) / 86400 + 1;
$no_full_weeks = floor($days / 7);
$no_remaining_days = fmod($days, 7);
//It will return 1 if it's Monday,.. ,7 for Sunday
$the_first_day_of_week = date("N", $startDate);
$the_last_day_of_week = date("N", $endDate);
//---->The two can be equal in leap years when february has 29 days, the equal sign is added here
//In the first case the whole interval is within a week, in the second case the interval falls in two weeks.
if ($the_first_day_of_week <= $the_last_day_of_week) {
if ($the_first_day_of_week <= 6 && 6 <= $the_last_day_of_week) $no_remaining_days--;
if ($the_first_day_of_week <= 7 && 7 <= $the_last_day_of_week) $no_remaining_days--;
}
else {
// (edit by Tokes to fix an edge case where the start day was a Sunday
// and the end day was NOT a Saturday)
// the day of the week for start is later than the day of the week for end
if ($the_first_day_of_week == 7) {
// if the start date is a Sunday, then we definitely subtract 1 day
$no_remaining_days--;
if ($the_last_day_of_week == 6) {
// if the end date is a Saturday, then we subtract another day
$no_remaining_days--;
}
}
else {
// the start date was a Saturday (or earlier), and the end date was (Mon..Fri)
// so we skip an entire weekend and subtract 2 days
$no_remaining_days -= 2;
}
}
//The no. of business days is: (number of weeks between the two dates) * (5 working days) + the remainder
//---->february in none leap years gave a remainder of 0 but still calculated weekends between first and last day, this is one way to fix it
$workingDays = $no_full_weeks * 5;
if ($no_remaining_days > 0 )
{
$workingDays += $no_remaining_days;
}
//We subtract the holidays
foreach($holidays as $holiday){
$time_stamp=strtotime($holiday);
//If the holiday doesn't fall in weekend
if ($startDate <= $time_stamp && $time_stamp <= $endDate && date("N",$time_stamp) != 6 && date("N",$time_stamp) != 7)
$workingDays--;
}
return $workingDays;
}
$currSalesDay = getWorkingDays($first,$end,$holidays);
$totalSalesDay = round(getWorkingDays($first,$last,$holidays),0);
| 0 | [
2,
18469,
638,
509,
19,
13,
26120,
13,
8,
1437,
22,
38,
170,
26,
818,
113,
14,
390,
96,
25,
27,
5745,
800,
3726,
3726,
31,
57,
14,
2578,
384,
1513,
9,
31,
57,
21,
3884,
30,
18469,
18,
98,
14,
866,
170,
208,
25,
19,
21,
161... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PyPNG to draw a simple filled box
===
I am trying to draw a simple 256x256 pixel RGBA square using python's png module.
I'd like to use the png.Writer function and I imagine I'd have to draw it out using the write() method. I have not had any luck however! I don't have faith in my current code so I'm willing to take suggestions from scratch
I prefer not to use the PIL if avoidable.
Any suggestions? | 0 | [
2,
7103,
306,
2723,
20,
2003,
21,
1935,
1943,
1649,
800,
3726,
3726,
31,
589,
749,
20,
2003,
21,
1935,
13,
16910,
396,
16910,
18146,
13,
8911,
969,
735,
568,
20059,
22,
18,
351,
2723,
12613,
9,
31,
22,
43,
101,
20,
275,
14,
351,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Client certificate removed when calling .Net web service
===
I am trying to send a client certificate to a web service written in .Net hosted in IIS 7.
The web service is at an enterprise/ intranet level and the certificate is issued by an internal issuer on the client's domain.
As part of the specification for the web service we are required to log the details of the client certificate. However I have discovered that .Net code requires the certificate to be installed on the host server otherwise the certificate is removed from the request.
I have setup a test console app with logging and it appears that the webservice does not have permission to see the client certificate in the LOCAL_MACHINE folder so it is being removed from the request.
It appears there is some issue with the certificate as we have a test system with a different certificate which had a similar issue. However we were able to resolve the issue by using the winhttpcertcfg command line utility to change the permissions for the certificate.
When I try and do this for the production certificate I receive the error "Access was not successfully obtained for the private key. This can only be done by the user that installed the certificate." What I don't understand is the certificate is a client certificate and therefore it doesn't contain a private key, only a public key.
Any help would be greatly appreciated. We have googled the issue extensively but as client certificates are rarely used I've been struggling to find any answers. I have tried running the winhttpcertcfg utility as an administrator. | 0 | [
2,
6819,
6259,
1974,
76,
2555,
13,
9,
2328,
2741,
365,
800,
3726,
3726,
31,
589,
749,
20,
2660,
21,
6819,
6259,
20,
21,
2741,
365,
642,
19,
13,
9,
2328,
2812,
19,
595,
18,
453,
9,
14,
2741,
365,
25,
35,
40,
6002,
118,
14369,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Blocking background content and focus on modal dialog
===
I am trying to block the background with my two jquery modal dialogs until the closes the user closes the window. Any idea on how to achieve this?
Here is my code below:
// sign up dialog
$( "#aboutus_dialog" ).dialog({
autoOpen: false,
show: "fadein",
hide: "fadeout"
});
// sign up dialog
$( "#signup_dialog" ).dialog({
autoOpen: false,
show: "fadein",
hide: "fadeout"
});
// about us modal
$('#aboutus').click(function() {
modal: true,
$("#aboutus_dialog").dialog("open");
return false;
});
// about us modal
$('#signup').click(function() {
$("#signup_dialog").dialog("open");
return false;
});
}); | 0 | [
2,
11828,
2395,
2331,
17,
1776,
27,
13,
20756,
28223,
800,
3726,
3726,
31,
589,
749,
20,
1921,
14,
2395,
29,
51,
81,
487,
8190,
93,
13,
20756,
28223,
18,
163,
14,
543,
18,
14,
4155,
543,
18,
14,
1463,
9,
186,
882,
27,
184,
20,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Keep Error Count and Get Top 10 With Associated Word?
===
I have been having a real headache over this, I can't think of way of doing this, so I hope someone can help out.
I have a few hundred words in arrays in a plist, somewhat like below:
PLIST:
Array 1:
- words here
-
-
-
Array 2:
-
-
-
-
-
etc...
Now I need to have a number associated with every word which increments so that I can then fetch the top 10 most failed words (top ten with highest count). This what I can't get my head around, how to keep a number associated with a word and then get the top ten most incorrect words.
Hope you can help me with this, or help me figure out a better method, I have my list of words, perhaps a number is needed, but I need to keep a record of the most common errors (I have a method which is called when an error is made, I just need to know how to store the error so I can retrieve the ten most incorrect words later).
Thanks! | 0 | [
2,
643,
7019,
2468,
17,
164,
371,
332,
29,
1598,
833,
60,
800,
3726,
3726,
31,
57,
74,
452,
21,
683,
14276,
84,
48,
15,
31,
92,
22,
38,
277,
16,
161,
16,
845,
48,
15,
86,
31,
1376,
737,
92,
448,
70,
9,
31,
57,
21,
310,
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... |
Loading a javascript file dynamically is not working
===
I have the following piece of code that is suppose to include a javascript file dynamically however it fails to do so:
<script>
function AddScript(url, callback) {
var script = document.createElement('script');
script.src = url;
script.type = 'text/javascript';
script.defer = false;
if (typeof callback != "undefined" && callback != null) {
// IE only, connect to event, which fires when JavaScript is loaded
script.onreadystatechange = function() {
if (this.readyState == 'complete' || this.readyState == 'loaded') {
this.onreadystatechange = this.onload = null; // prevent duplicate calls
callback();
}
}
// FireFox and others, connect to event, which fires when JavaScript is loaded
script.onload = function() {
this.onreadystatechange = this.onload = null; // prevent duplicate calls
callback();
};
}
var head = document.getElementsByTagName('head').item(0);
head.appendChild(script);
}
var adParams = {
a: "7462284", numOfTimes: "9",duration: "1",period: "Minute"
};
AddScript("http://cdn.adk2.com/adstract/scripts/popunder/popunder.js",
function() {
});
</script>
the code is suppose to load a popunder but when its executed nothing happens and it fails to open the js URL.
What is wrong with the code? | 0 | [
2,
12797,
21,
8247,
8741,
3893,
7782,
1326,
25,
52,
638,
800,
3726,
3726,
31,
57,
14,
249,
1855,
16,
1797,
30,
25,
5787,
20,
468,
21,
8247,
8741,
3893,
7782,
1326,
207,
32,
13614,
20,
107,
86,
45,
13,
1,
8741,
1,
1990,
3547,
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 get the resumable-media-link for uploading to google docs / xhr.status is zero
===
The fetchResumableLink returns xhr status of 0, if there a way to get the resumable-media-link which is simpler please point to resource
Constraints - javascript/chrome, oauth2
var DOCLIST_SCOPE = 'https://docs.google.com/feeds';
var DOCLIST_FEED = DOCLIST_SCOPE + '/default/private/full/';
var google = new OAuth2('google', {
client_id: 'my-client-id',
client_secret: 'my-client-secret',
api_scope: DOCLIST_SCOPE
});
google.authorize(checkAuthorized);
var URI = fetchResumableLink();
function fetchResumableLink() {
var TASK_CREATE_URL = DOCLIST_FEED;
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function(event) {
if (xhr.readyState == 4) {
if(xhr.status == 200) {
// Great success: parse response with JSON
var doc = JSON.parse(xhr.responseText);
return doc;
} else {
// Request failure: something bad happened
console.log(xhr.status);
console.log(xhr.responseText);
}
}
};
xhr.open('GET', TASK_CREATE_URL, true);
//xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Authorization', 'OAuth ' + google.getAccessToken());
xhr.setRequestHeader('GData-Version', '3.0');
xhr.send();
} | 0 | [
2,
184,
20,
164,
14,
10719,
723,
579,
8,
8260,
8,
6258,
26,
71,
16866,
20,
8144,
9765,
18,
13,
118,
993,
3112,
9,
10631,
267,
25,
4606,
800,
3726,
3726,
14,
18312,
99,
18,
723,
579,
6258,
4815,
993,
3112,
1782,
16,
713,
15,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
print unicode characters in terminal with python 3
===
I'm currently writing a 2-player chess game for the terminal and I'd like to be able to print the actual unicode characters for the pieces (for instance, http://en.wikipedia.org/wiki/Rook_(chess)#Unicode). How would one go about printing actual unicode representations in python 3 instead of escape characters? does the charset of the terminal need to be changed (I primarily use windows and linux), and can that be done by a system call in the program itself? | 0 | [
2,
4793,
28010,
1766,
19,
3855,
29,
20059,
203,
800,
3726,
3726,
31,
22,
79,
871,
1174,
21,
172,
8,
14049,
6168,
250,
26,
14,
3855,
17,
31,
22,
43,
101,
20,
44,
777,
20,
4793,
14,
3463,
28010,
1766,
26,
14,
2491,
13,
5,
1106,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
multiple sortable lists using jqueryui - don't want items to mix between list groups
===
I have two pairs of drag/drop/sortable lists using JqueryUI.http://jqueryui.com/demos/sortable/
My problem is that I can move items from sortable1, sortable2 into sortable3 and 4. I want them to be debated. So items can only move between ( 1 and 2 ) and (3 and 4).
Do I have to assign a different class to sortable3 and sortable4 for this to happen? Is there anyway I can somehow combine the function?
$(function() {
$( "ul.droptrue" ).sortable({
connectWith: "ul"
});
$( "ul.dropfalse" ).sortable({
connectWith: "ul",
dropOnEmpty: false
});
$( "#sortable1, #sortable2" ).disableSelection();
$( "#sortable3, #sortable4").disableSelection();
});
<ul id="sortable1" class='droptrue'>
<li class="ui-state-default">Can be dropped..</li>
<li class="ui-state-default">..on an empty list</li>
<li class="ui-state-default">Item 3</li>
<li class="ui-state-default">Item 4</li>
<li class="ui-state-default">Item 5</li>
</ul>
<ul id="sortable2" class='dropfalse'>
<li class="ui-state-highlight">Cannot be dropped..</li>
<li class="ui-state-highlight">..on an empty list</li>
<li class="ui-state-highlight">Item 3</li>
<li class="ui-state-highlight">Item 4</li>
<li class="ui-state-highlight">Item 5</li>
</ul>
<ul id="sortable3" class='droptrue'>
<li class="ui-state-default">Can be dropped..</li>
<li class="ui-state-default">..on an empty list</li>
<li class="ui-state-default">Item 3</li>
<li class="ui-state-default">Item 4</li>
<li class="ui-state-default">Item 5</li>
</ul>
<ul id="sortable4" class='dropfalse'>
<li class="ui-state-highlight">Cannot be dropped..</li>
<li class="ui-state-highlight">..on an empty list</li>
<li class="ui-state-highlight">Item 3</li>
<li class="ui-state-highlight">Item 4</li>
<li class="ui-state-highlight">Item 5</li>
</ul> | 0 | [
2,
1886,
2058,
579,
7227,
568,
487,
2005,
11867,
49,
13,
8,
221,
22,
38,
259,
3755,
20,
2917,
128,
968,
1170,
800,
3726,
3726,
31,
57,
81,
7473,
16,
5501,
118,
12361,
118,
22843,
579,
7227,
568,
487,
2005,
11867,
49,
9,
21127,
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... |
JQuery caching selectors - am I misunderstanding?
===
I'm working on some JQuery code and I have a question about caching selectors. I have a certain function that is called when scrolling (and thus needs to be fast). I tried caching the selectors used in the function during the initialization, like so:
var myElement = $('#myElement');
function onScroll()
{
myElement.whatever();
}
When I profile the code in firebug, I see that the JQuery selector function gets called exactly 5 times as often as the `onScroll` function (I use 5 different selectors in the function), and is responsible for the majority of execution time.
1) So what exactly is the benefit of caching this way? I'm not being sardonic :)
2) I understand that the selector needs to be re-run in case the DOM changes, but is there any way to cache a single selected object so that the function doesn't need to run each time, while staying within JQuery? | 0 | [
2,
487,
8190,
93,
1658,
7192,
23946,
18,
13,
8,
589,
31,
13,
21558,
60,
800,
3726,
3726,
31,
22,
79,
638,
27,
109,
487,
8190,
93,
1797,
17,
31,
57,
21,
1301,
88,
1658,
7192,
23946,
18,
9,
31,
57,
21,
1200,
1990,
30,
25,
227,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android AppWidget Lifecycle
===
I am finding during a reboot that the AppWidget onUpdate method is being called twice - on very clean basic code - with a correct manifest. My code is not an issue, this problem is definitely system related (hence I'm not posting any code).
Has this been resolved post 2.3.7 (my current development platform)?
How does one eliminate this programmatically? As my onUpdate often calls a service (to eliminate ANR on slow stuff) I am forced to resolve the issue with a pseudo-semaphore approach. Not ideal.
Thanks.
| 0 | [
2,
13005,
4865,
3976,
43,
3060,
201,
12467,
800,
3726,
3726,
31,
589,
3007,
112,
21,
25312,
30,
14,
4865,
3976,
43,
3060,
27,
576,
8209,
2109,
25,
142,
227,
2088,
13,
8,
27,
253,
2745,
2125,
1797,
13,
8,
29,
21,
4456,
13160,
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... |
AnythingSlider - video.js causes iOS failure - Is there a partial build of this JS file?
===
I have several videos placed within AnythingSlider slides along with other content types in each. They play fine on all the browsers I have tested with the exception of iOS on an iPhone 3 and an iPhone 4. I am using the AnythingSlider Video Controller 1.3 beta (the one that still comes with the AnythingSlider 1.8.6 download).
If I take the jquery.anythingslider.video.js out of the equation, the video will play on iPhones. The problem is that without the video.js, any video placed inside a slider will continue to play even after clicking next/previous and advancing. Wouldn't be such a drawback if the videos didn't have audio (but some of mine do, so you still hear it when you are viewing completely different slides).
I tracked down the issue in the jquery.anythingslider.video.js with respect to the iOS crashes. It seems to happen because of the Flash handling used by this script. Anything using Flash, even when it's part of a function in JS (or many times when it is only used as the fallback), seems to trip the iPhones.
My question is this: Is there a partial build of jquery.anythingslider.video.js that would only stop the video automatically on slide advance, while containing no Flash references so that it can still be used with iOS successfully?
Thanks for taking the time to read this and for any input you may have. | 0 | [
2,
602,
18,
1210,
1157,
13,
8,
763,
9,
728,
18,
4047,
13,
7760,
2990,
13,
8,
25,
80,
21,
7284,
1895,
16,
48,
487,
18,
3893,
60,
800,
3726,
3726,
31,
57,
238,
6610,
1037,
363,
602,
18,
1210,
1157,
18066,
303,
29,
89,
2331,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hooking document.createElement using function prototype
===
I want to hook onto the document.createElement function in such a way that, every time I create a div element, my hook will attach a "foo" attribute to the div. This is what I have currently:
<script>
window.onload = function () {
console.log("document loaded");
document.prototype.createElement = function (input) {
var div = document.createElement(input);
console.log("createElement hook attached!");
if (input == "div")div.foo = "bar";
return div;
}
document.body.addEventListener('onready', function () {
var div = document.createElement("div");
console.log(div.foo);
});
}
</script>
When I run this in Chrome, I get an error saying
Uncaught TypeError: Cannot set property 'createElement' of undefined test.html:4 window.onload
(I changed the line number in the error message above to match my code)
What am I wrong here? How can I fix this? | 0 | [
2,
5559,
68,
4492,
9,
6037,
1373,
27567,
568,
1990,
7063,
800,
3726,
3726,
31,
259,
20,
5559,
1204,
14,
4492,
9,
6037,
1373,
27567,
1990,
19,
145,
21,
161,
30,
15,
352,
85,
31,
1600,
21,
13,
12916,
4520,
15,
51,
5559,
129,
19514... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Make a redirect without rendering the redirect page
===
After a user submitted some data to make a new object I want the backend to redirect him to the object detail, as usual:
I'm doing something like:
if obj.is_valid():
obj.save()
flash('%s created' % obj, )
return redirect(url_for('provider', provider_id=obj.id))
But doing te request via curl (I'm building an API, testing it with curl)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>Redirecting...</title>
<h1>Redirecting...</h1>
<p>You should be redirected automatically to target URL: <a href="/provider/11">/provider/11</a>. If not click the link.
user@box
Which is unfortunate because I only want the response of `/provider/:id` not the intermediate step.
What's the correct way to address this issue? | 0 | [
2,
233,
21,
302,
14706,
366,
15307,
14,
302,
14706,
2478,
800,
3726,
3726,
75,
21,
4155,
7368,
109,
1054,
20,
233,
21,
78,
3095,
31,
259,
14,
97,
2451,
20,
302,
14706,
61,
20,
14,
3095,
6110,
15,
28,
3820,
45,
31,
22,
79,
845,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Clear contents of a excel using macro, without clearing the clipboard
===
How do I clear the contents of a excel sheet using macro, without clearing the contents of the clipboard?
I am currently using the below code, but this clears the clipboard also.
Sub clearly()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.UsedRange.ClearContents
Next ws
End Sub
Thanks,
Kiran | 0 | [
2,
1207,
8478,
16,
21,
20700,
568,
9069,
15,
366,
8130,
14,
12229,
2806,
800,
3726,
3726,
184,
107,
31,
1207,
14,
8478,
16,
21,
20700,
6125,
568,
9069,
15,
366,
8130,
14,
8478,
16,
14,
12229,
2806,
60,
31,
589,
871,
568,
14,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trying to get the value of a textarea when a page is submitted
===
Hi I have textarea on a control page, which using jQuery I've 'turned' into a simple HTML Text editor (allowing users to embolden text and create simple unordered lists).
When the page is submitted I'm trying to get the value that's in the textarea and process into a database (keeping the html markup that's inside the textarea) but I can't find the control and therefore can't get the markup that's inside it.
So the page is something like (It's on the servers at work so this is from memory).
<div id="zone">
<textarea id="txtDescription" cols="20" rows="2"></textarea>
</div>
And when the form is submitted I'm running
HtmlTextArea zArea = (HtmlTextArea)Page.FindControl("txtDescription");
Although I get no errors the value of zArea is always null.
It could be that I'm going about this the wrong way so any help would be greatly welcome.
Thanks,
Craig | 0 | [
2,
749,
20,
164,
14,
1923,
16,
21,
1854,
17760,
76,
21,
2478,
25,
7368,
800,
3726,
3726,
4148,
31,
57,
1854,
17760,
27,
21,
569,
2478,
15,
56,
568,
487,
8190,
93,
31,
22,
195,
13,
22,
19598,
22,
77,
21,
1935,
13,
15895,
1854,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Add images directory to makefile
===
I have a local folder which includes the icons I want to use at my program.The directory is /images/icons in the src directory.
When I make the tarball the directory with the images does not appear so i guess I have to include it in the makefile.If so, how can I do that? | 0 | [
2,
3547,
3502,
16755,
20,
233,
16877,
800,
3726,
3726,
31,
57,
21,
375,
19294,
56,
1103,
14,
9801,
18,
31,
259,
20,
275,
35,
51,
625,
9,
124,
16755,
25,
13,
118,
22039,
18,
118,
49,
12124,
19,
14,
13,
18,
5453,
16755,
9,
76,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SVG features supported in iOS
===
I can't seem to find a good list of SVG features supported in iOS, the best I got is this:
http://caniuse.com/#cats=SVG
I'm studying the viability of developing a webpage that uses a lot of visual elements and we want to use SVG, I don't have deep knowledge of SVG, so I was wondering what are the major compatibility, performance and lack of features issues in iOS Safari.
From the link above it seems I can not use:
SMIL animations. Animations as SVG tags, correct? The link says:
"Partial support in Safari refers to not working in HTML files."
So it works as long as the SVG is not inside an HTML file? So it means that I can't use it at all?
Can I still animate using Javascript?
SVG Filters, now this I don't exactly know what it covers. Are gradients supported in SVG on iOS? What about other useful filters that are not supported (shadows)? | 0 | [
2,
13,
18,
22955,
967,
1827,
19,
13,
7760,
800,
3726,
3726,
31,
92,
22,
38,
2260,
20,
477,
21,
254,
968,
16,
13,
18,
22955,
967,
1827,
19,
13,
7760,
15,
14,
246,
31,
330,
25,
48,
45,
7775,
6903,
1245,
2366,
62,
9,
960,
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... |
About Control meter
===
Can any body give me idea? Actually em working on Android Application in which i have to use
A meter like a general meter.In Which i Calculate some values then show ans and also control the needle of meter with respect to the result. e.g result is 45 and also show on a meter
like in this application
http://www.craziness.com/games/play-love-tester/
in which when i calculate the love among different people then this application show me result and also show result on the meter so i want to know what should i used in code to control the needle of the meter or you can say how to control the meter with respect to result.please any body give idea about the problem? | 1 | [
2,
88,
569,
12587,
800,
3726,
3726,
92,
186,
358,
590,
55,
882,
60,
1121,
3579,
638,
27,
13005,
3010,
19,
56,
31,
57,
20,
275,
21,
12587,
101,
21,
297,
12587,
9,
108,
56,
31,
18469,
109,
4070,
94,
298,
40,
18,
17,
67,
569,
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... |
django model: objects.all().delete() doesn't
===
I am trying to clear out and reload a table in my django model, and
>>> models.PuzzleSum.objects.all().count()
2644
>>> models.PuzzleSum.objects.all().delete()
>>> models.PuzzleSum.objects.all().count()
2535
... wtf? Always the magic number 109. I know I could just go into the database and delete them by hand (or loop until they're all gone) but I'm curious.
(Django 1.3.1 on Mac OS X Lion btw) | 0 | [
2,
3857,
14541,
1061,
45,
3916,
9,
1233,
5,
6,
9,
24249,
591,
5,
6,
1437,
22,
38,
800,
3726,
3726,
31,
589,
749,
20,
1207,
70,
17,
27339,
21,
859,
19,
51,
3857,
14541,
1061,
15,
17,
13,
1,
2761,
9,
4201,
5092,
1355,
723,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.