unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Full Text search returns duplicate keys
===
I have a search like the example below. The problem is that the result returns a key muliple times if the term "beach" is in myTextColumn multiple times, for example "I went to the beach because the beach is cool". I need it to be returned only once.
SELECT DISTINCT
Src.[Key] AS MyID
FROM
CONTAINSTABLE(MyTable, myTextColumn, N'FORMSOF(INFLECTIONAL,beach )',500) Src
ORDER BY
MyID | 0 | [
2,
503,
1854,
2122,
4815,
19429,
5534,
800,
3726,
3726,
31,
57,
21,
2122,
101,
14,
823,
1021,
9,
14,
1448,
25,
30,
14,
829,
4815,
21,
1246,
6633,
49,
5106,
436,
100,
14,
981,
13,
7,
863,
3211,
7,
25,
19,
51,
11969,
716,
4404,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HashMap keySet changes not reflected in map
===
I am trying to iterate on `HashMap` and rewrite some of the elements to the other map, but I have following problem:
@Test
public void test() {
Map<SubClass, String> map = new HashMap<SubClass,String>();
Map<SubClass, String> anotherMap = new HashMap<SubClass,String>();
map.put(new SubClass(), "10");
for(SubClass i : map.keySet()) {
System.out.println(i);
System.out.println(map.get(i)); // 10
// here it's ok...
i.name="another";
System.out.println(i);
System.out.println(map.get(i)); // null!
// but here it occurs that map.get(i) returns null!
anotherMap.put(i, map.get(i));
}
for(SubClass i : anotherMap.keySet()) {
System.out.println(i);
System.out.println(map.get(i)); // null!
}
}
// SubClass has String name; and hashCode and equals implemented
According to javadoc:
java.util.Map.keySet()
Returns a Set view of the keys contained in this map. The set is backed by the map, so changes to the
map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in
progress (except through the iterator's own remove operation), the results of the iteration are
undefined. The set supports element removal, which removes the corresponding mapping from the map,
via the Iterator.remove, Set.remove, removeAll, retainAll, and clear operations. It does not support the
add or addAll operations.
It says "changes to the map are reflected in the set, and vice-versa". So why does it behave this way and most important: how can I overcome it to make both maps contain only modified key and non-null value? | 0 | [
2,
19170,
15022,
1246,
3554,
1693,
52,
7037,
19,
2942,
800,
3726,
3726,
31,
589,
749,
20,
32,
106,
1373,
27,
13,
1,
25436,
15022,
1,
17,
27891,
109,
16,
14,
2065,
20,
14,
89,
2942,
15,
47,
31,
57,
249,
1448,
45,
13,
1,
10543,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
receiving json on php from android on webserver (it's not localhost)
===
i'm currently trying to decode json inputs that's sent from my android application. It was working fine when i was testing on my local apache server but it isn't working properly when i'm using the same identical code on a web server that i've purchased
So basically i have JSONObject in my java code
json = new JSONObject();
json.put("USER_IP", IP);
And I am using HttpPost object and .execute method to execute php file on my webserver and it is embedded with json object
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
HttpClient client = new DefaultHttpClient(setHttpParams());
HttpPost request = new HttpPost(PATH + FILENAME);
request.setEntity(new ByteArrayEntity(json.toString().getBytes("UTF8")));
request.setHeader("json", json.toString());
HttpResponse response = client.execute(request);
following is the php file that i have
<?php
$json = file_get_contents('php://input');
$obj = json_decode($json);
// include db connect class
require_once __DIR__ . '/../db_connect.php';
// connecting to db
$db = new DB_CONNECT();
$q=mysql_query("
SELECT USER_IP FROM users WHERE USER_IP = '".$obj->{'USER_IP'}."'
");
while($e=mysql_fetch_assoc($q))
$output[]=$e;
print(json_encode($output));
$db->close();
?>
I have no problem with executing it, but it always returns nothing or null, i think json input wasn't received properly. It was working totally fine when i was testing it on my local apache server. I'm guessing i have to change something with `$json = file_get_contents('php://input');` part. Thanks for you help.
| 0 | [
2,
3396,
487,
528,
27,
13,
26120,
37,
13005,
27,
2741,
10321,
106,
13,
5,
242,
22,
18,
52,
375,
11694,
6,
800,
3726,
3726,
31,
22,
79,
871,
749,
20,
121,
9375,
487,
528,
6367,
18,
30,
22,
18,
795,
37,
51,
13005,
3010,
9,
32,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Are SSIS Package Template Useful in 2012
===
I have used SSIS Package Templates in 2005 and 2008 to enforce some standards and provide for some reuse in my packages. But with the improvements in 2012 (Project Deployment Model, Connection Managers, Parameters, and Configurations) is there really much use for a package template any longer? | 0 | [
2,
50,
13,
18,
4557,
6030,
22894,
4811,
19,
563,
800,
3726,
3726,
31,
57,
147,
13,
18,
4557,
6030,
22894,
18,
19,
812,
17,
570,
20,
16525,
109,
3364,
17,
1181,
26,
109,
302,
3699,
19,
51,
16875,
9,
47,
29,
14,
7951,
19,
563,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
convert curl query to ajax query using mootools
===
I'm using curl to get json data from nuxeo, this my curl function
curl -X POST -H "Content-Type:application/json+nxrequest" -d
"{ params:
{
query:'SELECT * FROM Document'
}
}" -u Administrator:Administrator http://localhost:8080/nuxeo/site/automation/Document.Query
this function run fine, but now (with ajax version) I have error http 500. this is the code of ajax version
function getData(){
var uri = "http://localhost:8080/nuxeo/site/automation/Document.Query" ;
var options = { method : 'post', data : 'query=SELECT * FROM Document' };
var myCall = new Ajax(uri,options);
myCall.request();
}
| 0 | [
2,
8406,
14320,
25597,
20,
20624,
25597,
568,
13,
8765,
20799,
18,
800,
3726,
3726,
31,
22,
79,
568,
14320,
20,
164,
487,
528,
1054,
37,
3152,
396,
3894,
15,
48,
51,
14320,
1990,
14320,
13,
8,
396,
678,
13,
8,
252,
13,
7,
25424,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL Joins Confusion
===
**DB Structure:**
**CoachingCourses**
--Coaching_ID
--Course_ID
**CourseList**
--Course_ID
--Course_Name
I want to select all the names of the courses a particular coaching is teaching.
SELECT CourseList.Course_Name, CoachingCourses.Course_ID, CoachingCourses.Coaching_ID FROM CourseList INNER JOIN CoachingCourses ON CourseList.Course_ID = CoachingCourses.Course_ID WHERE (CoachingCourses.Coaching_ID = @CoachingID)
I wrote this query but it only returns me one course. Kindly help me.
Thanks | 3 | [
2,
4444,
255,
10612,
5677,
800,
3726,
3726,
13,
1409,
9007,
1411,
45,
1409,
13,
1409,
19273,
68,
17556,
18,
1409,
13,
8,
8,
19273,
68,
1,
1340,
13,
8,
8,
17556,
1,
1340,
13,
1409,
17556,
5739,
1409,
13,
8,
8,
17556,
1,
1340,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is WMI a good choice to gather application specific metrics?
===
We have a requirement to gather and analyse several metrics. Some of them quite general - memory and processor usage. Other metrics are application specific. For example we receive price changes for papers, and would like to gather the number of changes per sec, and so on. So it seems reasonable to use WMI for gathering memory and cpu utilization information. What about application specific metrics? | 0 | [
2,
25,
619,
1435,
21,
254,
1837,
20,
7442,
3010,
1903,
11544,
18,
60,
800,
3726,
3726,
95,
57,
21,
8981,
20,
7442,
17,
13,
21702,
238,
11544,
18,
9,
109,
16,
105,
1450,
297,
13,
8,
1912,
17,
14762,
7514,
9,
89,
11544,
18,
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... |
Memory for large data in PDO
===
PDO seems like a little tricky, but I have a large database and I'm getting this error,
Fatal error: Allowed memory size of 100663296 bytes exhausted (tried to allocate 256 bytes)
When using,
fetchAll()
What is the best way to solve it? | 0 | [
2,
1912,
26,
370,
1054,
19,
351,
537,
800,
3726,
3726,
351,
537,
2206,
101,
21,
265,
5514,
93,
15,
47,
31,
57,
21,
370,
6018,
17,
31,
22,
79,
1017,
48,
7019,
15,
8773,
7019,
45,
1159,
1912,
1072,
16,
808,
3526,
3125,
4060,
34,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Latest ADT doesn't allow typing values for width and height
===
I just got the latest ADT and have found that I can no longer type width and height values for layouts. It has a drop down which lets me select fill, match and wrap but I can't type numbers in for dip values etc.
Is this an intentional change by Google to encourage the use of an alternative method, and if so, what is it? | 0 | [
2,
5736,
21,
43,
38,
1437,
22,
38,
1655,
25266,
4070,
26,
9456,
17,
2947,
800,
3726,
3726,
31,
114,
330,
14,
5736,
21,
43,
38,
17,
57,
216,
30,
31,
92,
90,
1045,
1001,
9456,
17,
2947,
4070,
26,
9106,
18,
9,
32,
63,
21,
2804,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
linq to entities does not recognize the method int32 toint32
===
I get this error when I try to compare int to int (when comparing string it works)
IEnumerable<Commune> myCommunes = from d in db.Communes
where d.CodePostal == Convert.ToInt32(CodePostal.Text)
select d;
foreach (Commune c in myCommunes)
{
CommunesList.Add(c);
}
![enter image description here][1]
Any ideas ?
[1]: http://i.stack.imgur.com/JKuJ0.png | 0 | [
2,
6294,
1251,
20,
12549,
630,
52,
5844,
14,
2109,
19,
38,
3125,
20,
6391,
3125,
800,
3726,
3726,
31,
164,
48,
7019,
76,
31,
1131,
20,
11590,
19,
38,
20,
19,
38,
13,
5,
3185,
15047,
3724,
32,
693,
6,
13,
660,
6336,
106,
579,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 the button after clicking the button once IE8 issue
===
I want to disable submit button once it is clicked..Let me explain it as below
1)On form submission validation is done using ajax call and submit button is disabled using
**.attr("disabled",true);**
2)If response is 'Fail'(i.e. validation fails) button is clickable again using **.attr("disabled",false)** in ajax response
This work absolutely fine in FF and chrome but in IE8 whenever button is pressed,effect of being enable to disable is visible(button is normal when clicked,visible like disabled). don't want this momentarily change in appearance on IE8.
I even tried some suggestion like using **.attr("disabled","disabled")**; and **.removeAttr("disabled");** to make it disable and enable.
Thanks.
| 0 | [
2,
1460,
579,
14,
5167,
75,
25590,
14,
5167,
382,
13,
660,
457,
1513,
800,
3726,
3726,
31,
259,
20,
1460,
579,
12298,
5167,
382,
32,
25,
15802,
9,
9,
1336,
55,
3271,
32,
28,
1021,
137,
6,
218,
505,
10923,
27999,
25,
677,
568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I read frame by frame, rtsp streaming in android?
===
I have a problem at this time. I need to load a video escreaming (webcams), however the application makes me very slowly.
The solution would to read the stream frame by frame, right? Thus one would assynktask that every x time would fill a ImageView.
The type of stream is rtsp, does anyone know how to read the stream frame by frame?
Thank you, and sorry my english | 0 | [
2,
184,
92,
31,
1302,
3523,
34,
3523,
15,
13,
5256,
3401,
11920,
19,
13005,
60,
800,
3726,
3726,
31,
57,
21,
1448,
35,
48,
85,
9,
31,
376,
20,
6305,
21,
763,
13,
160,
22738,
68,
13,
5,
14113,
8760,
18,
6,
15,
207,
14,
3010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make a list of IDs of a table so I cycle through the IDs and use in a different table
===
I created a distance table/chart in the chart I want the ability to ada a city.
I created a stored procedure in mssql which goes something like this
ALTER PROCEDURE dbo.sup_InsertCity
(
@cityName nvarChar(50)
)
AS
Insert into citiesTest (cityName)
values (@cityName)
declare @counter int
declare @cityNumber int
declare @cityID int
SELECT @cityNumber = COUNT(idCities) FROM citiesTest
SELECT @cityID = @@Identity
set @counter = 0
while @counter < @cityNumber
begin
set @counter = @counter + 1
/*
*/
insert into DistanceTest (CityTop, CityRight, Distance, time)
values (@cityID, @counter, 0, 0)
insert into DistanceTest (CityTop, CityRight, Distance, time)
values ( @counter, @cityID, 0, 0)
end
RETURN
Now the problem is that this would only work if one didn't delete city's making a gap in the cities id. Instead of doing a course I would like to go thrould a collection of the id's in the other table to assign as the second city.
Thx in advance | 0 | [
2,
184,
20,
233,
21,
968,
16,
13,
9178,
16,
21,
859,
86,
31,
4150,
120,
14,
13,
9178,
17,
275,
19,
21,
421,
859,
800,
3726,
3726,
31,
679,
21,
1583,
859,
118,
5433,
38,
19,
14,
1795,
31,
259,
14,
2165,
20,
13,
4405,
21,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Notepad++ with .less colour highlight
===
I want Notepad++ to treat my .less files just as my .css files and thereby get color highlighting. Any tip? | 0 | [
2,
1945,
8240,
20512,
29,
13,
9,
923,
4609,
14373,
800,
3726,
3726,
31,
259,
1945,
8240,
20512,
20,
5752,
51,
13,
9,
923,
6488,
114,
28,
51,
13,
9,
6824,
18,
6488,
17,
8535,
164,
1665,
23102,
9,
186,
4265,
60,
3,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
MSDE .BAK not compatible with SQL Server 12?
===
I'm trying to copy a database from ye old MSDE to SQL Server 12 Express, since Microsoft decided not to make MSDE compatible with Windows 7. Lo and behold, when I try the osql restore from disk command, I get the message that 8.0.2055 backups are not compatible with 12.* SQL Server. How can I transfer the database and information in it? Every single Google result has either assumed I was trying to downgrade rather than upgrade, or assumed it was an xp-xp transfer. | 0 | [
2,
4235,
546,
13,
9,
13344,
52,
14961,
29,
4444,
255,
8128,
390,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
4344,
21,
6018,
37,
3617,
315,
4235,
546,
20,
4444,
255,
8128,
390,
2999,
15,
179,
7099,
868,
52,
20,
233,
4235,
546,
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... |
new() in method
===
public interface IDbContextFactory
{
DbContext GetContext();
}
public class Repo<T> : IRepo<T> where T : Entity, new()
{
protected readonly DbContext c;
public Repo(IDbContextFactory f)
{
c = f.GetContext();
}
What's the keyword new() (in class IRepo< T >)makes?
| 0 | [
2,
78,
5,
6,
19,
2109,
800,
3726,
3726,
317,
6573,
31,
9007,
1126,
11969,
17455,
93,
13,
1,
13,
9007,
1126,
11969,
164,
1126,
11969,
5,
6,
73,
13,
1,
317,
718,
302,
1638,
1,
38,
1,
13,
45,
31,
99,
1638,
1,
38,
1,
113,
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... |
jQuery - Style checkbox, replace with image
===
I need this script to hide my checkboxes and put an image of a styled checkbox in place of it. It is properly hiding it and showing the default image, but it will not update the checkbox to checked or unchecked once I click on it, nor will it update the image. I'm assuming it's a simple thing I am overlooking, I'm still new to jQuery.
Here is the script:
$(".check").each(function() {
$(this).hide();
var $image = $("<img src='assets/images/layout/checkbox/unchecked.png' />").insertAfter(this);
$image.click(function() {
var $checkbox = $(this).prev(".check");
$checkbox.prop('checked', !$checkbox.prop('checked'));
if($checkbox.prop("checked")) {
$image.attr("src", "assets/images/layout/checkbox/checked.png");
} else {
$image.attr("src", "assets/images/layout/checkbox/unchecked.png");
}
})
});
Here is the HTML:
<input type="checkbox" class="check" />
Edit: Also, is this generally the best approach to styling checkboxes? I can't seem to find anything that is much easier than this, so any suggestions are appreciated. | 0 | [
2,
487,
8190,
93,
13,
8,
1034,
2631,
5309,
15,
3934,
29,
1961,
800,
3726,
3726,
31,
376,
48,
3884,
20,
3077,
51,
2631,
5309,
160,
17,
442,
40,
1961,
16,
21,
1034,
43,
2631,
5309,
19,
209,
16,
32,
9,
32,
25,
7428,
5314,
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... |
Drag + scroll in jquery
===
with jquery.Draggable and its option `containment` I was able to setup a draggable box within a wrapper. Say that the wrapper is 1000 x 1000 pixel large, I'd like to put it within a viewport div that is only 100 x 100 pixel large with overflow: scroll set.
How can I make the dragging of my 10x10px box make the inner div scroll within the viewport div when dragged towards its margins?
I've tried with the scroll option but it didn't work.
Thanks | 0 | [
2,
5501,
2754,
12159,
19,
487,
8190,
93,
800,
3726,
3726,
29,
487,
8190,
93,
9,
3030,
4572,
579,
17,
82,
4255,
13,
1,
1126,
5851,
1130,
1,
31,
23,
777,
20,
18161,
21,
5501,
263,
579,
1649,
363,
21,
28051,
9,
395,
30,
14,
28051... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Simple way to post image and comment to users wall with Facebook API
===
I simply want to post an image and comment from my own site to the facebook users own wall.
I've looked in various places and through the Facebook API documentation but cant find a straight forward way of achieving what should be a rudimentary task.
FB's own documentation seems overly complex. I have set up the app, along with objects and actions and aggregations from within the graph API tab but can't seem to get what I'm after.
Can anyone suggest a method or article outlining the correct procedure that allows me to pass comment and image parameters, or an article that better deconstructs the problem than FB's own docs.
Any pointers would be greatly appreciated. | 0 | [
2,
1935,
161,
20,
678,
1961,
17,
6484,
20,
3878,
769,
29,
9090,
21,
2159,
800,
3726,
3726,
31,
1659,
259,
20,
678,
40,
1961,
17,
6484,
37,
51,
258,
689,
20,
14,
9090,
3878,
258,
769,
9,
31,
22,
195,
292,
19,
617,
1489,
17,
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... |
Changing expiry date in SugarCRM workflow do net send a mail to test administrator
===
I have a workflow defined in SugarCRM defined on Tasks modules it works perfectly when i create a new task, automatically a mail will be send to the Test Administrator. But if i edit the same task or any other previously defined task to increase the expiry date no mail is send to the Test Administrator. Can you explain it is the default behaviour of SugarCRM or i am getting wrong at some point. My scheduler is functioning properly on the interval of every 5 minutes.
For further details please examine the image provided below:
![Workflow Definition Screen][1]
[1]: http://i.stack.imgur.com/vi9fk.png
Any help in this regard will be appreciated | 0 | [
2,
4226,
1396,
2159,
622,
1231,
19,
4200,
6711,
79,
170,
9990,
107,
4275,
2660,
21,
4216,
20,
1289,
8890,
800,
3726,
3726,
31,
57,
21,
170,
9990,
2811,
19,
4200,
6711,
79,
2811,
27,
8674,
17113,
32,
693,
5759,
76,
31,
1600,
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 parse empty element tag with jquery parser?
===
<lb/>vendanges au commencement de au
<lb rend="hyphen"/>tomne, les bergiers de la contree
Is this possible to parse the <lb/> tag in the jquery parser to get the text and if it was possible to get the rendering also??
or i have to change the empty tag into open and close first and then the parsing will be easy?? | 0 | [
2,
184,
20,
2017,
870,
2424,
4520,
3383,
29,
487,
8190,
93,
2017,
4104,
60,
800,
3726,
3726,
13,
1,
10819,
118,
1,
3124,
12487,
160,
10343,
24449,
121,
10343,
13,
1,
10819,
5365,
43,
3726,
7,
5608,
16012,
7,
118,
1,
6015,
556,
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... |
fancybox not working with validation engin
===
I want to launch fancybox after validation engin validation got success.... code that I am using are mentioned below....
<button type="button" class="addcncl" value="<s:message code='createMonitorProfile' />" name="createProfile" id="createProfile" ><s:message code='createMonitorProfile' /></button>
$("#createProfile").fancybox({
'titlePosition' : 'outside',
'overlayColor' : '#000',
'autoSize' : false,
'autoDimensions' :false,
'overlayOpacity' : 0.7,
'scrolling' :'yes',
});
$("#createProfile").bind("click", function()
{
if($('#createMonitorProfileForm').validationEngine('validate'))
{
//if this condition is true then I want to upload fancybox content with ajax request.
}
});
problem that i am getting is that my fancybox appearing before the validation happens...
| 0 | [
2,
12251,
5309,
52,
638,
29,
27999,
13,
4367,
108,
800,
3726,
3726,
31,
259,
20,
3394,
12251,
5309,
75,
27999,
13,
4367,
108,
27999,
330,
1280,
9,
9,
9,
9,
1797,
30,
31,
589,
568,
50,
2211,
1021,
9,
9,
9,
9,
13,
1,
811,
444,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Database Merge with tables having different no. of columns
===
Here is a scenario.
I have around 300 tables in my database and I want to merge another database in my database. Both the databases have same tables but the datatype and no of columns vary.
Now how to convert data from other database to my database ?
eg.
db1: Table T1(col1 int,col2 char,......,col31 int)
db2: Table T1(col1 int,col2 char,......,col31 int,col32 char,col33 char )
Since datatype and no of column vary,I cant use
"insert into db1.tbl
select * from db2.tbl ".
I dont want to create script for each and every table . Help me out !!! | 0 | [
2,
6018,
12666,
29,
7484,
452,
421,
90,
9,
16,
7498,
800,
3726,
3726,
235,
25,
21,
12705,
9,
31,
57,
140,
3565,
7484,
19,
51,
6018,
17,
31,
259,
20,
12666,
226,
6018,
19,
51,
6018,
9,
156,
14,
6018,
18,
57,
205,
7484,
47,
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... |
Convert inputstream to textfield.text objective-c
===
I have some problem with my objective-c app. I want to convert input stream to textfield.text in objective-c.
Any ideas how can I do this?
| 0 | [
2,
8406,
6367,
11260,
20,
1854,
1109,
9,
11969,
7038,
8,
150,
800,
3726,
3726,
31,
57,
109,
1448,
29,
51,
7038,
8,
150,
4865,
9,
31,
259,
20,
8406,
6367,
3766,
20,
1854,
1109,
9,
11969,
19,
7038,
8,
150,
9,
186,
3478,
184,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to replace 3 or more letters occurring together with doubles using java regex?
===
How to replace 3 or more letters occurring together with doubles using java regex?
like oooooops with oops
and yesssssss with yess | 0 | [
2,
184,
20,
3934,
203,
54,
91,
2516,
10428,
429,
29,
7784,
568,
8247,
7953,
1706,
60,
800,
3726,
3726,
184,
20,
3934,
203,
54,
91,
2516,
10428,
429,
29,
7784,
568,
8247,
7953,
1706,
60,
101,
13,
28290,
21709,
18,
29,
13,
21709,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Ruby On Rails: Convert a path in a string to a recursive Hash
===
Is somebody able to suggest me a way to do this ? ( all is in the subject :D )
what I want is using a "path" and tranform it as a suit of sub key,
e.g. : I have that params: path = "earth/animal/human/men/young/" value = "martin"
and I want :
`Global_hash = { earth => { human => { men => { young => "martin"
}
}
}
}`
path = "earth/animal/human/men/old/" value = "John"
and I want :
Global_hash = { earth => { human => { men => { young => "martin",
old => "John"
}
}
}
}
add an other
path = "earth/animal/human/women/old/" value = "Eve"
and I want :
`Global_hash = { earth => { human => { men => { young => "martin",
old => "John"
},
women => { old => "Eve"
}
}
}
}
`
The final goal is a way to produce yml file with 2 parameters :
the path and the value
the exemple produces :
`
earth:
animal:
human:
men:
young: "martin"
old: "John"
women:
old: "Eve"
`
it will allow us to have a yml file with all object sort by sections thanks to their path.
Thanks per advance
| 0 | [
2,
10811,
27,
2240,
18,
45,
8406,
21,
2013,
19,
21,
3724,
20,
21,
302,
24244,
19170,
800,
3726,
3726,
25,
8861,
777,
20,
5601,
55,
21,
161,
20,
107,
48,
13,
60,
13,
5,
65,
25,
19,
14,
1550,
13,
45,
43,
13,
6,
98,
31,
259,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HQL (Hibernate) how to check if a list of elements is a subset of another list?
===
I am having tough time creating a HQL query that checks if a list of records 'a' of table 'X' is included within another list 'b' of the same table 'X'.
Here is an example i am using:
select r from Role r where (select p from Permission p where p.name = 'test') in elements(r.permissions)
Now this query is just as an example, to clarify a bit, each role has 1 or more permission.
Now here's what happen, if the the subselect (permission p) returns 1 row, all work fine. But if more are selected, the query fails, since I am trying to check if a list is within a list...
I am sure I am missing something here, so please any help would be appretiated.
Thanks | 0 | [
2,
746,
22402,
13,
5,
8630,
106,
8820,
6,
184,
20,
2631,
100,
21,
968,
16,
2065,
25,
21,
16622,
16,
226,
968,
60,
800,
3726,
3726,
31,
589,
452,
6161,
85,
2936,
21,
746,
22402,
25597,
30,
16602,
100,
21,
968,
16,
742,
13,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Static Cell properties having no effect when set in storyboard IB
===
I have dragged a table view into my view, set it to static, set the number of cells and sections, changed colours, added controls and modified the size. When I run it though, the changes do not show up. Am I missing something here? | 0 | [
2,
12038,
1667,
3704,
452,
90,
1590,
76,
309,
19,
609,
2806,
13,
4598,
800,
3726,
3726,
31,
57,
7465,
21,
859,
1418,
77,
51,
1418,
15,
309,
32,
20,
12038,
15,
309,
14,
234,
16,
2934,
17,
4501,
15,
1015,
8739,
15,
905,
8671,
17... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to store data what needs to be accessible by all members?
===
I have the following problem (just learning OOP style C++): I have 3 classes:
1. app
2. objectManager
3. object
The app class sets up startup variables and creates an instance of objectManager. It tells objectManager to load values from different files and to precalculate some data in a vector what will be required for each object.
My problem is the following: **I would like to use a precalculated vector accessable for each object**. I don't understand how can I possibly access this variable from the objects, as they know absolutely nothing about the manager's instance.
I've read about **singletons** but I have no idea how should I implement it.
I've read about **static data members** but AFAIK it seems that I still have to somehow connect to the objectManager instance, so it doesn't help me.
I've tried **global variables** (I know...), but ended up with compiling errors.
I've tried to put **static variables outside of a class definition** in objectManager.h (is it a global case?), and I ended up with something strange:
I can access the variables from all parts of the program what includes objectManager.h, but it's value is different/uninitialized in different classes.
objectManager.h
#pragma once
#include "Object.h"
static int xxxtest;
class objectManager
{
objectManager.cpp
xxxtest = 123456;
cout << xxxtest << endl;
-> 123456
while in object.cpp or app.cpp (after)
cout << xxxtest << endl;
-> 0
Can you explain to me what is happening here?
**Can you recommend me a simple and clean way of organizing such a program**, while making a precalculated variable accessable to other parts of the program?
| 0 | [
2,
184,
20,
1718,
1054,
98,
2274,
20,
44,
7342,
34,
65,
443,
60,
800,
3726,
3726,
31,
57,
14,
249,
1448,
13,
5,
2759,
2477,
13,
21709,
1034,
272,
20512,
6,
45,
31,
57,
203,
2684,
45,
137,
9,
4865,
172,
9,
3095,
22256,
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... |
ASP.NET Members Section - Cannot create and connect to Database
===
Visual Studio 2010
MSSQL 2005
Windows Vista
I am creating an ASP.NET website using webforms, I want to create a members section using Web Site Administration Tool. I am following this youtube tutorial (http://www.youtube.com/watch?v=vxxFhGF-Z7E) but I am stuck at 2:58 mins into vid.
After I have created users and roles the vid says ASP.NET should automatically create a Database with tables in the APP_Data section in the Solution explorer in ASP.NET. BUT.... mine doesnt create this database. And when I go into the "Provider" tab in Web Site Administration Tool and test the connection I get an error:
Could not establish a connection to the database.
If you have not yet created the SQL Server database, exit the Web Site Administration tool, use the aspnet_regsql command-line utility to create and configure the database, and then return to this tool to set the provider.
I have looked into lots of solutions online for this but cannot find a solution. Would anyone know what I am doing wrong? | 0 | [
2,
28,
306,
9,
2328,
443,
1050,
13,
8,
1967,
1600,
17,
6379,
20,
6018,
800,
3726,
3726,
3458,
1120,
498,
4235,
18,
22402,
812,
1936,
13520,
31,
589,
2936,
40,
28,
306,
9,
2328,
2271,
568,
2741,
4190,
18,
15,
31,
259,
20,
1600,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Getting PEB from remote process in Win 7
===
**Specs**: Windows 7 x64, Visual C++
**Objective**: I'm trying to get the remote [PEB](http://en.wikipedia.org/wiki/Process_Environment_Block) from a sample program (calc.exe e.g.). I've found the proc ID and I've opened a handle to the process with all the good rights. I've now moved on to writing a class to retrieve the location of the PEB from the process using PROCESS_BASIC_INFORMATION.
**Problem**: I've found several posts elsewhere that seem to indicate that the *NtQueryInformationProcess* turned to shit at MS. One post suggests a method of dynamic-runtime-linking NtQueryInformationProcess out of ntdll.dll. However, I think this would be unstable in the long-run (MS could remove NtQueryInformationProcess tomorrow) without extensive error handling.
This idea is realized later in [this thread](http://www.gamedev.net/topic/582261-problem-using-ntqueryinformationprocess/), and it is then suggested by Mike2343 that one should "use other methods."
**Questions**: What would be another method to locate the PEB of a remote process that doesn't involve NtQueryInformationProcess?
Thanks to anyone who spends any time looking at this. | 0 | [
2,
1017,
3560,
220,
37,
5388,
953,
19,
628,
453,
800,
3726,
3726,
13,
1409,
18,
12610,
18,
1409,
45,
1936,
453,
993,
3470,
15,
3458,
272,
20512,
13,
1409,
23793,
1284,
1409,
45,
31,
22,
79,
749,
20,
164,
14,
5388,
636,
1664,
220... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 createsuperuser not working
===
#error
You just installed Django's auth system, which means you don't have any superusers defined.
Would you like to create one now? (yes/no): yes
Traceback (most recent call last):
File "/Users/Abhimanyu/Documents/workspace/doctor/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 443, in execute_from_command_line
utility.execute()
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 382, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 196, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 371, in handle
return self.handle_noargs(**options)
File "/Library/Python/2.6/site-packages/django/core/management/commands/syncdb.py", line 110, in handle_noargs
emit_post_sync_signal(created_models, verbosity, interactive, db)
File "/Library/Python/2.6/site-packages/django/core/management/sql.py", line 189, in emit_post_sync_signal
interactive=interactive, db=db)
File "/Library/Python/2.6/site-packages/django/dispatch/dispatcher.py", line 172, in send
response = receiver(signal=self, sender=sender, **named)
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 73, in create_superuser
call_command("createsuperuser", interactive=True, database=db)
File "/Library/Python/2.6/site-packages/django/core/management/__init__.py", line 150, in call_command
return klass.execute(*args, **defaults)
File "/Library/Python/2.6/site-packages/django/core/management/base.py", line 232, in execute
output = self.handle(*args, **options)
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 70, in handle
default_username = get_default_username()
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 105, in get_default_username
default_username = get_system_username()
File "/Library/Python/2.6/site-packages/django/contrib/auth/management/__init__.py", line 85, in get_system_username
return getpass.getuser().decode(locale.getdefaultlocale()[1])
TypeError: decode() argument 1 must be string, not None
#doubt
I created this application using eclipse and when i ran the command sync db , it worked fine and prompted to create a super user , as i typed yes it gave me the following error.
please help. | 0 | [
2,
3857,
14541,
1600,
8542,
16704,
52,
638,
800,
3726,
3726,
6926,
29992,
42,
114,
4066,
3857,
14541,
22,
18,
10343,
96,
329,
15,
56,
1108,
42,
221,
22,
38,
57,
186,
1026,
16704,
18,
2811,
9,
83,
42,
101,
20,
1600,
53,
130,
60,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to scale images in a newsletter that's viewed on a mobile device using media queries?
===
I'd like to improve usability of my newsletter for people who read it on their mobile devices.
In order to do that I want to scale my images according to device's screen width.
The following code *works* in a desktop browser (with `min-width`) while it fails when `min-device-width` is used.
Instead of two scaled images next to each other I see one full size image and the other one is scaled to about 2px/2px.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html>
<head>
<title></title>
</head>
<body>
<style type="text/css">
@media only screen and (min-device-width : 100px) and (max-device-width : 480px) {
body {
background: red;
}
table[class='element'] {
width: 100%;
}
table[class='element'] img {
width: 100%;
height: auto;
}
}
</style>
<table class="element" align="center" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td><img src="http://www.dummyimage.com/360x270/ddd/fff.jpg" alt="" height="270" width="360"></td>
<td><img src="http://www.dummyimage.com/360x270/ccc/fff.jpg" alt="" height="270" width="360"></td>
</tr>
</tbody>
</table>
</body>
</html> | 0 | [
2,
184,
20,
3464,
3502,
19,
21,
17782,
30,
22,
18,
6084,
27,
21,
3241,
3646,
568,
941,
9386,
2829,
60,
800,
3726,
3726,
31,
22,
43,
101,
20,
3545,
182,
4091,
16,
51,
17782,
26,
148,
72,
1302,
32,
27,
66,
3241,
4690,
9,
19,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ARM Neon Intrinsics Rotation
===
Hi I'm trying to optimize my code using Neon Intrinsics...
I have a 24-bit rotation over a 128 bits array (8 x uin16_t).
Here is my c code:
uint16_t rotated[8];
uint16_t temp[8];
uint16_t j;
for(j = 0; j < 8; j++){
//Rotation <<< 24 over 128 bits (x << shift) | (x >> (16 - shift)
rotated[j] = ((temp[(j+1) % 8] << 8) & 0xffff) | ((temp[(j+2) % 8] >> 8) & 0x00ff);
}
I've checked the gcc documentation about [Neon Intrinsics][1] and it doesn't have instruction for vector rotations. Moreover, I've tried to do this using vshlq_n_u16(temp, 8) but all the bits shifted outside a uint16_t word are lost.
How to achieve this using neon intrinsics ? By the way is there a better documentation about GCC Neon Intrinsics ?
[1]: http://gcc.gnu.org/onlinedocs/gcc/ARM-NEON-Intrinsics.html | 0 | [
2,
813,
17907,
22892,
18,
9431,
800,
3726,
3726,
4148,
31,
22,
79,
749,
20,
22864,
51,
1797,
568,
17907,
22892,
18,
9,
9,
9,
31,
57,
21,
937,
8,
3326,
9431,
84,
21,
13218,
10181,
7718,
13,
5,
457,
993,
287,
108,
1091,
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... |
Begin transaction in VB.net AND SQLServer 2008
===
I begin a transaction in vb.net. Execute stored proc on SQL Server 2008. Storeproc contains begintransaction. it fails, and Rollback in Catch block runs...
BEGIN CATCH
IF @@TRANCOUNT > 1 ROLLBACK
EXEC p_RethrowError
END CATCH
Rethrow effectively does a 'raiserror'.
Execution passes back to vb.net. Rollback in "Catch sqlException " executes.
Questions:
Why is @@TRANCOUNT 1 Rather than 2 (ie how come begin trans in vb.net is not included?)
Why does Rollback in SQL Not rollback Client trans as well (but a rollback in client does rollback SQLServer)?
And finally, in vb.net, if you try to rollback transaction twice within client, you get exception "transaction has completed". Is there anyway of knowing whether the transaction has completed, or is still pending? Thanks.
| 0 | [
2,
2348,
12799,
19,
13,
20468,
9,
2328,
17,
4444,
255,
10321,
106,
570,
800,
3726,
3726,
31,
2348,
21,
12799,
19,
13,
20468,
9,
2328,
9,
15644,
8214,
13,
15617,
27,
4444,
255,
8128,
570,
9,
1718,
15617,
1588,
2348,
7028,
8645,
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... |
Is there an SVG to VML conversion tool? Offline or Online. (Not on the fly)
===
I have been hunting high and low for a tool to convert an SVG file into VML which is readable by internet explorer.
I have found several 'on the fly' solutions but these are unnecessary as it we only wish to use vector graphics on for a few simple, non changing, but scaleable drawings.
Is there any tool out there, offline or online that will accept an SVG file and output VML code?
Kind regards. | 0 | [
2,
25,
80,
40,
13,
18,
22955,
20,
566,
8184,
6263,
5607,
60,
168,
1143,
54,
2087,
9,
13,
5,
1270,
27,
14,
2855,
6,
800,
3726,
3726,
31,
57,
74,
5038,
183,
17,
708,
26,
21,
5607,
20,
8406,
40,
13,
18,
22955,
3893,
77,
566,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 move a panorama item closer to the panorama title WP7
===
I have a panorama view with a title and no headers for the items. Now there is a big gap between the title (applicationTitle) and the content. Is there a way to move the content closer to the top? | 0 | [
2,
184,
20,
780,
21,
24805,
9101,
1788,
20,
14,
24805,
581,
13,
13790,
465,
800,
3726,
3726,
31,
57,
21,
24805,
1418,
29,
21,
581,
17,
90,
157,
445,
26,
14,
3755,
9,
130,
80,
25,
21,
580,
4127,
128,
14,
581,
13,
5,
2552,
206... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Aptana Studio messed up my default editor settings in Eclipse
===
Since I installed the 'stand-alone' Aptaba Studio, my Eclipse wants to open certian files, e.g. "MSG.utf", in Aptana Studio.
Note that I never installed the Aptaba Plugin.
And even after uninstalling Aptana as documented (i.e. just moving the Application Folder to the trash, in OS X), the settings are noct changed back. Instead, Eclipse now does not open these files at all anymore. So:
1) Why has Aptana Studio messed up my Eclipse settings?
2) What other file types /Ednings and other settings might be affected?
3) How can I change this back to normal/before? | 0 | [
2,
8442,
9068,
1120,
21537,
71,
51,
12838,
1835,
12410,
19,
11652,
800,
3726,
3726,
179,
31,
4066,
14,
13,
22,
10731,
8,
17979,
22,
8442,
21828,
1120,
15,
51,
11652,
2846,
20,
368,
6173,
6248,
6488,
15,
13,
62,
9,
263,
9,
13,
7,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How Can i set TimeInterval as a xAxis Label in Core plot?
===
I want to display time formant on xAxis label in core plot. How can i set that ? I show an Example [link][1]
[1]: http://stackoverflow.com/questions/5729366/moving-date-on-x-axis
but that time didn't show on Xaxis but if i mantion Date on xAxis DD:MM:YY format then it did show so what i change in that link code so it will work fine ?
Thanks | 0 | [
2,
184,
92,
31,
309,
85,
6280,
3377,
28,
21,
993,
19676,
1899,
19,
2884,
3798,
60,
800,
3726,
3726,
31,
259,
20,
3042,
85,
505,
1830,
27,
993,
19676,
1899,
19,
2884,
3798,
9,
184,
92,
31,
309,
30,
13,
60,
31,
298,
40,
823,
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... |
Moving Bitmap region in C#
===
In order to make my question more understandable I give you pseudocode snippet:
// dx (i.e. offset value) can be arbitrary.
for(i = 0; i < bitmap.columnsCount - dx; i++)
{
// "=" means copy pixels from one column to another.
bitmap.column[i] = bitmap.column[i+dx];
}
How should I do this? Of course I can take raw pixels through LockBitmap and then somehow use MarshalCopy or unsafe section... But this is ugly and too complicated. Is there are better way?
I tried to find something similar to `MoveBitmapRegion()` method, but i can't. The idea of drawing bitmap to itself did not work:
Graphics g = Graphics.FromImage(bmp);
g.DrawImage(bmp, 0, 0, new Rectangle(dx, 0, bmp.Width - dx, bmp.Height), GraphicsUnit.Pixel);
Making a copy of the bitmap helps, but I think it's too expensive operation:
Graphics g = Graphics.FromImage(bmp);
g.DrawImage(new Bitmap(bmp), 0, 0, new Rectangle(dx, 0, bmp.Width - dx, bmp.Height), GraphicsUnit.Pixel); | 0 | [
2,
1219,
1142,
15022,
632,
19,
272,
5910,
800,
3726,
3726,
19,
389,
20,
233,
51,
1301,
91,
1369,
579,
31,
590,
42,
8452,
9375,
13,
29061,
45,
12894,
13,
43,
396,
13,
5,
49,
9,
62,
9,
17493,
1923,
6,
92,
44,
17237,
9,
26,
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... |
Trying to create an alarm using rtc ans i2c on Atmega64 but having a query
===
I have to create a clock and calendar with rtc using i2c which I have done and it is working fine. But I want to implement a multiple alarms feature in this program. Now when I do add an alarm for a specific time for the buzzer to start ringing, the time is not displayed until the buzzer stops! So since my buzzer rings for 2 seconds my time skips three seconds in the display screen which is not what I want. Is there any way in which my buzzer can continue to ring while the time is displayed continuously. Kind of like multi-threading? Thanks for the help guys. | 0 | [
2,
749,
20,
1600,
40,
6490,
568,
761,
6668,
40,
18,
31,
135,
150,
27,
35,
22168,
3470,
47,
452,
21,
25597,
800,
3726,
3726,
31,
57,
20,
1600,
21,
4229,
17,
7036,
29,
761,
6668,
568,
31,
135,
150,
56,
31,
57,
677,
17,
32,
25,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Carrierwave: pseudo version for dynamic resizing
===
In order to be able to have dynamic image sizes ( yeah. i know ) i came up with the following `version` which just creates a temporary file on each request ( jap, stupid i know -- [ store file in cache based on args ? ])
version :resized do
def url(*args)
width,height,gravity,region = args[0],args[1],args[2],args[3]
manipulate! do |img|
cols, rows = img[:dimensions]
img.combine_options do |cmd|
if width != cols || height != rows
scale = [width/cols.to_f, height/rows.to_f].max
cols = (scale * (cols + 0.5)).round
rows = (scale * (rows + 0.5)).round
cmd.resize "#{cols}x#{rows}"
end
cmd.gravity gravity
cmd.extent "#{width}x#{height}#{region}" if cols != width || rows != height
end
img = yield(img) if block_given?
img
end
convert "jpg"
super()
end
end
The problem i am having is that since i don't `process` this version it quasi duplicates the original and uses it for the 'on-request' manipulation. If that original file was a 100MB tiff this gets messy !
So now i am looking for a way to keep that version from actually creating a file and to use a different version's file for that 'on-request' manipulation.
Any ideas ? | 0 | [
2,
5812,
10134,
45,
8452,
615,
26,
7782,
10719,
3335,
800,
3726,
3726,
19,
389,
20,
44,
777,
20,
57,
7782,
1961,
13403,
13,
5,
3979,
9,
31,
143,
13,
6,
31,
281,
71,
29,
14,
249,
13,
1,
10898,
1,
56,
114,
9695,
21,
4700,
3893... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 move an image from the top of the screen to the bottom and have it stay there in Xcode / iOS?
===
I have been trying to build an entry effect for a logo to come from the top of the screen to the bottom and remain there when a new view loads in my application. I have seen all of the tutorials that use NSTimer to bounce an image but once my logo hits the bottom it needs to exit. I'm going to read up on animation block codes to see if my solution resides there.
Apologies I'm a new be and am very grateful for the assistance. | 0 | [
2,
184,
107,
31,
780,
40,
1961,
37,
14,
371,
16,
14,
2324,
20,
14,
2129,
17,
57,
32,
1179,
80,
19,
993,
9375,
13,
118,
13,
7760,
60,
800,
3726,
3726,
31,
57,
74,
749,
20,
1895,
40,
2792,
1590,
26,
21,
6449,
20,
340,
37,
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 attach image in grid view from a folder out side the application?
===
this is my rad grid column
<telerik:GridImageColumn HeaderText="Image" DataImageUrlFields="ContentName" DataType="System.String"
DataImageUrlFormatString="~/SlideImages/{0}" UniqueName="Upload" Visible="false"
ImageHeight="80px" ImageWidth="80px">
<HeaderStyle Width="10%" HorizontalAlign="Center" />
</telerik:GridImageColumn>
In my application i am saving image out of application folder, but at run time when the grid coulm try to attach the image through setting the out side folder path, it is unable to attach the images for the column, how to fix it?
when i set it for internal folder it works fine, as of now i have set path for application folder image. Please let me know on it. | 0 | [
2,
184,
20,
19514,
1961,
19,
7354,
1418,
37,
21,
19294,
70,
270,
14,
3010,
60,
800,
3726,
3726,
48,
25,
51,
4944,
7354,
4698,
13,
1,
14305,
6639,
45,
16375,
22039,
716,
4404,
103,
157,
106,
11969,
3726,
7,
22039,
7,
1054,
22039,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MySQL UNION with WHERE
===
I have the following 2 tables
tableA a (id, name, surname, program, date)
tableB b (id, aid, name, surname, extracard)
with tableA.id = tableB.aid (1 to n relationship)
Sample data for tableA:
| ID | NAME | SURNAME | PROGRAM | DATE | EXPIRES |
----------------------------------------------------------
| 1 | TOM | JONES | 1,2,3 | 12/8/2012 | 12/8/2013 |
| 2 | JAMIE | OLIVER | 4,5,6 | 15/8/2012 | 15/8/2013 |
Sample data for tableB:
| ID | AID | NAME | SURNAME | CARD |
-------------------------------------
| 1 | 1 | ANNE | JONES | 1 |
| 2 | 1 | JACK | BOWER | 0 |
| 3 | 2 | KATE | PERRY | 1 |
| 4 | 2 | JOHN | DOE | 0 |
| 5 | 2 | HARRY | POTTER | 0 |
In the results, each member of tableB should have all values (program, date, expires, etc...) from tableA and display only the name, surname from tableB. Also, I need to use a between clause for a.id between (%id1 and %id2) and also a WHERE statement for selecting rows where tableB.card=1
| a.ID | NAME | SURNAME | PROGRAM | DATE | EXPIRES |
------------------------------------------------------------
| 1 | TOM | JONES | 1,2,3 | 12/8/2012 | 12/8/2013 |
| 1 | ANNE | JONES | 1,2,3 | 12/8/2012 | 12/8/2013 |
| 2 | JAMIE | OLIVER | 4,5,6 | 15/8/2012 | 15/8/2013 |
| 2 | KATE | PERRY | 4,5,6 | 15/8/2012 | 15/8/2013 |
| 0 | [
2,
51,
18,
22402,
667,
29,
113,
800,
3726,
3726,
31,
57,
14,
249,
172,
7484,
859,
58,
21,
13,
5,
1340,
15,
204,
15,
11311,
15,
625,
15,
1231,
6,
859,
220,
334,
13,
5,
1340,
15,
3096,
15,
204,
15,
11311,
15,
2230,
6648,
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... |
memory allocation for functions in c
===
Is the memory for the c function allocated when the program is compiled first or is it allocated when the function call is seen first?i.e is memory for c function allocated in stack or code segment. | 0 | [
2,
1912,
16840,
26,
3719,
19,
272,
800,
3726,
3726,
25,
14,
1912,
26,
14,
272,
1990,
11685,
76,
14,
625,
25,
9316,
64,
54,
25,
32,
11685,
76,
14,
1990,
645,
25,
541,
64,
60,
49,
9,
62,
25,
1912,
26,
272,
1990,
11685,
19,
756... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Translation of Delete Selected Documents Action
===
in the "delete selected documents" action it is possible to specify a confirm message, so i can tranlsate this message in every language.
But, if no document was selected, a dialog appears with the message "Please select one or more documents to delete.".
Is there any way to translate this message?
Thanks Mario | 0 | [
2,
4064,
16,
27448,
1704,
4374,
1028,
800,
3726,
3726,
19,
14,
13,
7,
24249,
591,
1704,
4374,
7,
1028,
32,
25,
938,
20,
19077,
21,
10265,
2802,
15,
86,
31,
92,
12748,
7532,
1373,
48,
2802,
19,
352,
816,
9,
47,
15,
100,
90,
449... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 paypal required cards to process payments for some and not for all websites?
===
I just want to ask, I'm using wordpress, s2member plugin and I can't successfully process the payment for my subscriptions since I need first a card for my Paypal account (unverified) to pay (testing purposes).
However, using the same paypal account I have already purchased some items online, on a wordpress website (e-commerce). Why is this happening? Can I avoid or do something that can process the subscriptions (just like the other website I mentioned) to purchase online using unverified Paypal accounts? | 0 | [
2,
483,
1372,
6720,
1390,
4092,
20,
953,
11161,
26,
109,
17,
52,
26,
65,
13931,
60,
800,
3726,
3726,
31,
114,
259,
20,
1349,
15,
31,
22,
79,
568,
833,
5890,
15,
13,
18,
135,
6990,
10922,
108,
17,
31,
92,
22,
38,
3673,
953,
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... |
Parsing coverFlow images through web service
===
I have implemented coverFlow usinng http://chaosinmotion.com/flowcover.m this link. Its working fine. I want to get coverFlow images through web service. Its working fine for single image. Anyone send me code for getting multiple coverFlow images. | 0 | [
2,
2017,
18,
68,
1227,
9990,
3502,
120,
2741,
365,
800,
3726,
3726,
31,
57,
6807,
1227,
9990,
182,
108,
2723,
7775,
6903,
1651,
759,
108,
15745,
9,
960,
118,
9990,
14069,
9,
79,
48,
3508,
9,
82,
638,
1123,
9,
31,
259,
20,
164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get UNIX timestamp (ie UTC timestamp) from a Python timezone aware date
===
My computer is running in Pacific time (hence datetime.datetime.fromtimestamp(0) gives me 1969-12-31 16:00:00). My problem is that given a timezone aware datetime object in Python, I want to get the UNIX timestamp (ie the UTC timestamp). What is the best way to do so?
| 0 | [
2,
164,
22540,
436,
38,
10158,
13,
5,
660,
13,
11440,
436,
38,
10158,
6,
37,
21,
20059,
85,
11661,
3854,
1231,
800,
3726,
3726,
51,
1428,
25,
946,
19,
1819,
85,
13,
5,
252,
2940,
1231,
891,
9,
8209,
891,
9,
2665,
891,
384,
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 draw a path on google maps by zip code
===
i want to show a path map and distance between to points by zip code or city name l ike we enter to and from place and map will generate between them , total distance between them will be calculated, please help it's urgent .
thanks in advance | 0 | [
2,
184,
20,
2003,
21,
2013,
27,
8144,
6867,
34,
12133,
1797,
800,
3726,
3726,
31,
259,
20,
298,
21,
2013,
2942,
17,
1583,
128,
20,
819,
34,
12133,
1797,
54,
136,
204,
644,
13,
7660,
95,
2830,
20,
17,
37,
209,
17,
2942,
129,
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... |
C++ program sees an included .txt file as code
===
I am just learning the very basic aspects of input/output streams, and can't seem to have my program read a text file. It gives me errors that indicate it is trying to read the .txt file as C++ code, while I am just using values in there to test my stream.
These are the contents of my included .txt file:
12345
Success
And here is the main program's code:
#include <fstream>
#include <iostream>
#include "C:\Users\Pavel\Desktop\strings.txt"
using namespace std;
int main (int nNumberOfArgs, char* pszArgs[])
{
ifstream in;
in.open("C:\Users\Pavel\Desktop\strings.txt");
int x;
string sz;
in << x << sz;
in.close();
return 0;
}
The first error message I receive is "expected unqualified-id before numeric constant" which tells me the program is attempting to compile the included file. How can I prevent this and have the text file read as intended? | 0 | [
2,
272,
20512,
625,
6895,
40,
506,
13,
9,
38,
396,
38,
3893,
28,
1797,
800,
3726,
3726,
31,
589,
114,
2477,
14,
253,
2125,
4842,
16,
6367,
118,
1320,
4881,
9464,
15,
17,
92,
22,
38,
2260,
20,
57,
51,
625,
1302,
21,
1854,
3893,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 select names in oracle10g database?
===
![enter image description here][1]
i want to search the name who having skills in java and oracle
[1]: http://i.stack.imgur.com/DGAos.png
and i know the coding like
select name from table_name where skills like '%java%' or skills like '%oracle%';
but my problem is,In servlet How can i do this?
String skills=request.getParameter("skill");
my select query
select name from table_name where skill like '"++"';
Here i am confused ,
i tried like this
select name from table_name where skill like '"+%skills%+"';
but not working.
I am a webdeveloper very new to oracle ,please help me
I am using oracle10g | 0 | [
2,
184,
20,
5407,
1817,
19,
15759,
1036,
263,
6018,
60,
800,
3726,
3726,
13,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
165,
500,
31,
259,
20,
2122,
14,
204,
72,
452,
3207,
19,
8247,
17,
15759,
636,
165,
500,
45,
7775,
6903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
onclicklistener textView in android
===
I have one textview with two different colors. here if i click mini it should redirect to one activity,if i click metro redirect to other activity.TextView =(TextView)v.findViewById(R.id.text);String text = "<font color=#000000><b>"+"mini"+"</b></font><font color=#000000> added </font><font color=#1569C7>"+"Metro"+"</font><font color=#000000> as a favourite.</font>";t.setText(Html.fromHtml(text)); | 0 | [
2,
27,
150,
10129,
13891,
106,
1854,
4725,
19,
13005,
800,
3726,
3726,
31,
57,
53,
1854,
4725,
29,
81,
421,
5268,
9,
235,
100,
31,
10840,
4236,
32,
378,
302,
14706,
20,
53,
2358,
15,
821,
31,
10840,
3986,
302,
14706,
20,
89,
235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to have many contracts in on service?
===
I have a service, that principal I would like to be duplex, however, for some operations, I need to use the streamed transfer mode, so I would like to have two contracts, one is the general contract, that let me interact with the database and send messages to the client from the service if I need it, and other contract to interact with files, save and get the files to the database.
I need the two contracts because the tcp binding is not compatible with duplex.
The service is hosted in a WPF application, and the config files is the following:
<system.serviceModel>
<services>
<service name="GTS.CMMS.Service.Service" behaviorConfiguration="behaviorConfig">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:7997/CMMSHost"/>
<add baseAddress="http://localhost:7998/CMMSHost"/>
</baseAddresses>
</host>
<endpoint address="/ServiceCore"
binding="netTcpBinding"
bindingConfiguration="tcpBinding"
name="ServiceCore"
contract="GTS.CMMS.Service.IService">
<!--<identity>
<dns value="localhost" />
</identity>-->
</endpoint>
<endpoint address="/ServiceDocumentos"
binding="netTcpBinding"
bindingConfiguration="tcpBindingDocumentos"
name="ServiceDocumentos"
contract="GTS.CMMS.Service.IServiceDocumentos">
<!--<identity>
<dns value="localhost" />
</identity>-->
</endpoint>
<endpoint contract="IMetadataExchange" binding="mexTcpBinding" address="net.tcp://localhost:5000/mex" />
</service>
</services>
<!--El behavior son datos de configuración del servicio que no forman parte del endpoint.
Por ejemplo, si el servicio da una excepción, se querrá informar al cliente.-->
<behaviors>
<serviceBehaviors>
<behavior name="behaviorConfig">
<serviceMetadata httpGetEnabled="true" />
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<!--Necesario para poder mandar excepciones desde el servicio hasta el cliente.-->
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" />
</behavior>
<behavior name="behaviorConfigDocumentos">
<!--<serviceMetadata httpGetEnabled="true" />-->
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<!--Necesario para poder mandar excepciones desde el servicio hasta el cliente.-->
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100" />
<serviceMetadata/>
</behavior>
</serviceBehaviors>
</behaviors>
<!--Se necesita la configuración del binding para que funcione correctamente la comunicación entre el cliente y el servidor.-->
<bindings>
<netTcpBinding>
<!--Se configura el binding que se utilizará para el endPoint ChatServiceAssembly.IChat-->
<binding name="tcpBinding" maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
transferMode="Buffered" closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100">
<security mode="None"/>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
</binding>
<binding name="tcpBindingDocumentos" maxBufferSize="67108864"
maxReceivedMessageSize="67108864" maxBufferPoolSize="67108864"
transferMode="Streamed" closeTimeout="00:00:10"
openTimeout="00:00:10" receiveTimeout="00:20:00"
sendTimeout="00:01:00" maxConnections="100">
<security mode="None"/>
<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647"
maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<reliableSession enabled="true" inactivityTimeout="00:20:00" />
</binding>
</netTcpBinding>
</bindings>
</system.serviceModel>
To check if all works, I go to the internet explorer and go to:
http://localhost:7998/CMMSHost
If I have the two endpoints, the page is not found, but if I comment the second endpoint, the "/ServiceDocumentos" the page is found and I can use svcutil to create the proxy.
How could I configure many endpoints?
Thanks. | 0 | [
2,
184,
20,
57,
151,
8712,
19,
27,
365,
60,
800,
3726,
3726,
31,
57,
21,
365,
15,
30,
2279,
31,
83,
101,
20,
44,
1052,
11326,
15,
207,
15,
26,
109,
1311,
15,
31,
376,
20,
275,
14,
21822,
2617,
3740,
15,
86,
31,
83,
101,
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... |
mutiple json sring in android
===
i have return All my JSON string.forexample i have one json string
[{"Locationvalue":"Payroll - 9","LocationId":"465","IsSelected":false}]
and also returned second JSON string
[{"CC2Description":"Denver - DN","CC2":"DN","isSelected":false},{"CC2Description":"Las Vegas - LV","CC2":"LV","isSelected":false}]
ans so on
in android i have written this
JSONArray JsonObject = new JSONArray(JsonString.toString());
for(int i=0;i<JsonObject.length();i++)
{
Log.v("log", JsonObject.getString(i));
}
but i can only access one json Array ..i want other Json Array also
| 0 | [
2,
22072,
5106,
487,
528,
13,
18,
2090,
19,
13005,
800,
3726,
3726,
31,
57,
788,
65,
51,
487,
528,
3724,
9,
1106,
29041,
31,
57,
53,
487,
528,
3724,
636,
1,
7,
19032,
15165,
7,
45,
7,
12224,
8694,
13,
8,
561,
7,
15,
7,
19032... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
RMI lookup works but method invocation not
===
I'm working on a java application which uses RMI for network communication.
On one computer everythings works good, but if i try to run it via the internet i ran into problems.
It seems, that the client is able to retreive the registry from the server and to lookup the lobby-object.
But if the client tries to call the login method of the lobby object via rmi, it takes very long time and i receive the following exception:
Strange thing is, that there is the wrong ip mentioned in this exception.
And if I run a client on the same machine as the server, it works perfectly.
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.ConnectException: Connection refused to host: <wrong ip of the server>; nested exception is:
java.net.ConnectException: Die Wartezeit für die Verbindung ist abgelaufen (=time out)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:353)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:553)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:808)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:667)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:273)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:251)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:160)
at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:194)
at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:148)
at $Proxy0.einloggen(Unknown Source)
at Client.login(Client.java:64)
----------
**Here is the relevant code:**
My server class:
public static final int RMI_PORT = 55555;
public static final String SERVER_IP = "xyz.com";
/**
* Startet Spielserver
*
* @param args
*/
public static void main(String[] args) {
System.out.println("Server starten..");
System.setProperty("java.rmi.server.hostname", SERVER_IP);
try {
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}
Registry registry = LocateRegistry.getRegistry(SERVER_IP, RMI_PORT);
Lobby lobby = new LobbyImpl();
UnicastRemoteObject.exportObject(lobby, 0);
registry.bind("Lobby", lobby);
} catch (RemoteException e) {
e.printStackTrace();
} catch (AlreadyBoundException e) {
e.printStackTrace();
}
}
Client class:
public Client() {
try {
Registry registry = LocateRegistry.getRegistry("xyz.com", Server.RMI_PORT);
lobby = (Lobby) registry.lookup("Lobby");
} catch (RemoteException e) {
e.printStackTrace();
} catch (NotBoundException e) {
e.printStackTrace();
}
this.gui = new GUI(this);
}
public void login(String name) throws RemoteException {
Player player = new Player(name);
this.lobby.login((Player)UnicastRemoteObject.exportObject(player, 0));
}
Client startscript:
#!/bin/bash
SCRIPTDIR=$(dirname $0)
java -classpath $SCRIPTDIR/bin Client
Server startscript:
#!/bin/bash
SCRIPTDIR=$(dirname $0)
cd ${SCRIPTDIR}/bin
rmiregistry 55555 &
cd -
java -classpath $SCRIPTDIR/bin -Djava.security.policy=$SCRIPTDIR/src/server.policy -Djava.rmi.server.codebase=file:$SCRIPTDIR/bin/ Server
killall rmiregistry
and last but not least my first (test) policy file:
grant {
permission java.security.AllPermission;
};
what could be the problem?
regards | 0 | [
2,
761,
1435,
361,
576,
693,
47,
2109,
19,
2625,
16893,
52,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
8247,
3010,
56,
2027,
761,
1435,
26,
982,
3291,
9,
27,
53,
1428,
796,
18,
693,
254,
15,
47,
100,
31,
1131,
20,
485,
32,
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... |
Change item order in plist file
===
I want to change order in plist file **not** programmatically but from xcode. Is there a way in Xcode where i can sort by value? I simply want to arrange it for myself. For now if i want add new item it will always goes to tail.
![Like here][1]
[1]: http://i.stack.imgur.com/TQ863.png
How to sort it ? To 100 value go to the top? | 0 | [
2,
753,
9101,
389,
19,
351,
5739,
3893,
800,
3726,
3726,
31,
259,
20,
753,
389,
19,
351,
5739,
3893,
13,
1409,
1270,
1409,
625,
6732,
1326,
47,
37,
993,
9375,
9,
25,
80,
21,
161,
19,
993,
9375,
113,
31,
92,
2058,
34,
1923,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I convert from Array<String> to String[] in Java
===
I have to get a part of my content provider query in a String[] format. Currently I use:
String[] selectionArgs = {"",""};
selectionArgs[0] = Integer.toString(routeScheduleID);
selectionArgs[1] = runDate.toString();
But in this case I have an unknown number of elements.
How can I change the number at runtime (or use something like an Array<String> and convert back to String[]. Is this possible?
| 0 | [
2,
92,
31,
8406,
37,
7718,
1,
11130,
1,
20,
3724,
2558,
500,
19,
8247,
800,
3726,
3726,
31,
57,
20,
164,
21,
141,
16,
51,
2331,
11747,
25597,
19,
21,
3724,
2558,
500,
2595,
9,
871,
31,
275,
45,
3724,
2558,
500,
3155,
10663,
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... |
ASP.NET MVC 2.0 and Flash Navigation
===
We are working on a website which is small but it use Flash Navigation, as we are using flash so we hard coded the links inside flash, we have given links as below
for home page
> home/aboutus
> home/services
and so on for rest of links, the first click work fine, and the url is http://mysite.com/home/aboutus but if we click on services link its making url as http://mysite.com/home/home/aboutus
adding extra home to it, and it also don't work for home page
thanks
Regards | 0 | [
2,
28,
306,
9,
2328,
307,
8990,
172,
9,
387,
17,
4433,
8368,
800,
3726,
3726,
95,
50,
638,
27,
21,
2271,
56,
25,
284,
47,
32,
275,
4433,
8368,
15,
28,
95,
50,
568,
4433,
86,
95,
552,
13,
22254,
14,
6271,
572,
4433,
15,
95,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get the single returned value with PDO
===
For this query:
`$sql='select col from table where other_col=?';`
I am currently getting the returned data like so:
`$data=$statement->fetch()['col'];`
That doesn't look very good to me.
Is there a better way of doing that or is that fine as it is? | 0 | [
2,
164,
14,
345,
587,
1923,
29,
351,
537,
800,
3726,
3726,
26,
48,
25597,
45,
13,
1,
4403,
18,
22402,
3726,
22,
18,
16964,
3313,
37,
859,
113,
89,
1,
7771,
3726,
5663,
73,
1,
31,
589,
871,
1017,
14,
587,
1054,
101,
86,
45,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mongodb update with upsert fails
===
Here is the statement which fails:
`db.some_collection.update(query,modifier_set, upsert=True, safe=True)`
**modifier_set** is of the form `{"$inc":{...}, "$addToSet":{...}}`
I get an `OperationFailure` error:
`$ operator made object too large`
Now, it's highly unlikely that my document it more that 16MB.
Any other possible reasons for such failure ? | 0 | [
2,
3521,
5474,
220,
11100,
29,
71,
18,
6767,
13614,
800,
3726,
3726,
235,
25,
14,
3331,
56,
13614,
45,
13,
1,
9007,
9,
3220,
1,
15015,
872,
9,
576,
8209,
5,
8190,
93,
15,
13670,
16292,
1,
3554,
15,
71,
18,
6767,
3726,
13398,
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... |
MS Dynamics 4.0: Checking whether record exists based on email address
===
I'm having trouble with a method that needs to return the GUID of a record based a given email address. This is what I have at the moment:
ColumnSet columnSet = new ColumnSet();
columnSet.AddColumns(new[] { "leadid" });
var query = new QueryExpression
{
EntityName = "lead",
ColumnSet = columnSet
};
FilterExpression leadFilter = new FilterExpression();
leadFilter.AddCondition(new ConditionExpression
{
AttributeName = "emailaddress1",
Operator = ConditionOperator.Equal,
Values = new object[] { emailAddress }
});
query.Criteria = leadFilter;
BusinessEntityCollection result = crmService.RetrieveMultiple(query);
foreach (BusinessEntity record in result)
{
//Guid leadId = ?? Not sure how to extract it.
}
A) this seems like overkill, because I only need one record (but don't think I can use Retrieve because I don't have an id).
B) How do I actually retrieve the GUID from the above within the foreach?
Thanks. | 0 | [
2,
4235,
12289,
268,
9,
387,
45,
9886,
1472,
571,
5636,
432,
27,
8517,
3218,
800,
3726,
3726,
31,
22,
79,
452,
2572,
29,
21,
2109,
30,
2274,
20,
788,
14,
9457,
43,
16,
21,
571,
432,
21,
504,
8517,
3218,
9,
48,
25,
98,
31,
57... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF Data Services: An error occurred while processing this request
===
I set breakpoints everywhere and single-stepped through all my code, but could not find the source of the error. I saw no point in Googling for such a non-specific error..
I am getting this inner exception
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<code></code>
<message xml:lang="en-US">Forbidden</message>
</error>
whats the problem?? | 0 | [
2,
11801,
410,
1054,
687,
45,
40,
7019,
2437,
133,
5511,
48,
3772,
800,
3726,
3726,
31,
309,
1442,
3132,
18,
6417,
17,
345,
8,
8375,
3631,
120,
65,
51,
1797,
15,
47,
110,
52,
477,
14,
1267,
16,
14,
7019,
9,
31,
441,
90,
454,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Port forwarding required when using reverse proxy on internal servers?
===
Main question is, do I need to port forward if I'm reverse proxying between internal servers, I'll try to explain the setup as good as possible.
So, port 80 is forwarded on **MACHINE1** and it's an IIS Webserver,
Live Domains have the A address set to **MACHINE1** since we only have 1 IP address at the moment.
We have a Linux webserver which we want IIS to reverse proxy the specific domain to, all is working on the linux side.
Question is, **do I need to port forward the ports on the linux server so the domain is accessible by public?**, if so, why?
The linux server is fully reachable through the IIS server without the ports forwarded. But external addresses get the response from IIS:
502 - Web server received an invalid response while acting as a gateway or proxy server. | 0 | [
2,
1295,
917,
68,
1390,
76,
568,
7006,
27188,
27,
3117,
17595,
60,
800,
3726,
3726,
407,
1301,
25,
15,
107,
31,
376,
20,
1295,
917,
100,
31,
22,
79,
7006,
27188,
68,
128,
3117,
17595,
15,
31,
22,
211,
1131,
20,
3271,
14,
18161,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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's the difference between HttpResponseException and HttpException
===
From http://www.asp.net/web-api/overview/web-api-routing-and-actions/exception-handling
> HttpResponseException
>
> What happens if a Web API controller throws an exception? By default,
> most exceptions are translated into an HTTP response with status code
> 500, Internal Server Error.
>
> The HttpResponseException type is a special case. This exception
> returns any HTTP status code that you specify in the constructor of
> the exception.
Except that it **doesn't**. Fiddler shows me a 500 is returned.
However, HttpException seems to do what that article says.
Is the documentation wrong or am I missing something?
**UPDATE**
While typing that out, I had an idea. I tried both from two controllers, an ApiController and a standard MVC controller.
The two exception work in reverse to each other depending on the type of controller they're thrown from.
- Use HttpResponseException to return a proper HTTP code from an API
controller.
- Use HttpException to return a proper HTTP code from an
MVC controller.
| 0 | [
2,
98,
22,
18,
14,
2841,
128,
7775,
99,
18,
8782,
870,
10066,
872,
17,
7775,
10066,
872,
800,
3726,
3726,
37,
7775,
6903,
6483,
9,
472,
306,
9,
2328,
118,
14113,
8,
2552,
49,
118,
2549,
4725,
118,
14113,
8,
2552,
49,
8,
8821,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you disable the title in Twitter Bootstrap's popover plugin?
===
I'm using popover to display an image which doesn't require a title. If you don't set "title", it still displays an area where the title would be. How do you turn this off completely?
| 0 | [
2,
184,
107,
42,
1460,
579,
14,
581,
19,
10623,
5894,
16514,
22,
18,
1675,
2549,
10922,
108,
60,
800,
3726,
3726,
31,
22,
79,
568,
1675,
2549,
20,
3042,
40,
1961,
56,
1437,
22,
38,
4077,
21,
581,
9,
100,
42,
221,
22,
38,
309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
3D Game using 2D Ortographic camera
===
I'm scaling enemy of 800 polygons while moving them throw space and animating them while using an orthographic camera and cheap shaders ... but i'm having really bad problems with performance (super high drawcalls , low framerate) for Iphone 3G , 4 ,4S.
When i disable the scaling , performance goes very well .
Then my question is , Are there any other ways to use an ortographic camera or simulating an ortographic camera with a good performance without scaling the elements in the game? | 0 | [
2,
203,
43,
250,
568,
172,
43,
54,
38,
11113,
3336,
800,
3726,
3726,
31,
22,
79,
26829,
2436,
16,
7993,
21309,
18,
133,
1219,
105,
3814,
726,
17,
14487,
1203,
105,
133,
568,
40,
17241,
12084,
3336,
17,
9148,
7546,
1224,
13,
9,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Transposing a Key Value pair SQL table
===
I have a table which consists of a few columns, including a Key Value pairing. So imagine:
**BookID, Key, Value**
MyBook, Price, 19.99
MyBook, ISBN, 987878495793
MyBook, Pages, 354
I need to get this into the format:
**BookID, Price, ISBN, Pages**
MyBook, 19.99, 987878495793, 354
i.e transposing the cells- how would I do this in SQL? | 0 | [
2,
2982,
14717,
21,
1246,
1923,
2146,
4444,
255,
859,
800,
3726,
3726,
31,
57,
21,
859,
56,
2043,
16,
21,
310,
7498,
15,
215,
21,
1246,
1923,
23028,
9,
86,
4382,
45,
13,
1409,
5199,
1340,
15,
1246,
15,
1923,
1409,
51,
5199,
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... |
UITableView cornerRadius with border performance issues on iOS
===
I have some interesting notice with scrolling performance on UITableView with cornerRadius, borderWidth and borderColor enabled.
self.tableView.layer.cornerRadius = 10.f;
self.tableView.layer.borderWidth = 1.0f;
self.tableView.layer.borderColor = [UIColor whiteColor].CGColor;
If I remove borderWidth and borderColor than scrolling gets 60 FPS no problem. As long as I add those two properties to layer FPS drops.
Does anyone have a suggestion or explanation why this strange behavior happens?
Many Thanks! | 0 | [
2,
13,
11193,
579,
4725,
1531,
9560,
267,
29,
1862,
956,
1549,
27,
13,
7760,
800,
3726,
3726,
31,
57,
109,
4883,
3551,
29,
13,
28166,
956,
27,
13,
11193,
579,
4725,
29,
1531,
9560,
267,
15,
1862,
3976,
43,
96,
17,
1862,
11282,
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... |
Implementing a dynamic multiple timeline queue
===
## Introduction
I would like to implement a *multiple timeline queue*. The context here is **scheduling** in general.
## What is a *timeline queue*?
This is still simple: It is a timeline of tasks, where each event has its start and end time. Tasks are grouped as jobs. This group of tasks need to preserve its order, but can be moved around in time as a whole. For example it could be represented as:
--t1-- ---t2.1-----------t2.2-------
' ' ' ' '
20 30 40 70 120
I would implement this as a [heap queue](http://docs.python.org/library/heapq.html) with some additional constraints. The Python [`sched`](http://docs.python.org/library/sched.html) module has some basic approaches in this direction.
## Definition *multiple timeline queue*
One queue stands for a resource and a resource is needed by a task. Graphical example:
R1 --t1.1----- --t2.2----- -----t1.3--
/ \ /
R2 --t2.1-- ------t1.2-----
<br/>
## Explaining "*dynamic*"
It becomes interesting when a task can use one of multiple resources. An additional constraint is that consecutive tasks, which can run on the same resource, must use the same resource.
Example: If (from above) task `t1.3` can run on `R1` or `R2`, the queue should look like:
R1 --t1.1----- --t2.2-----
/ \
R2 --t2.1-- ------t1.2----------t1.3--
<br/>
## Functionality
- **Enqueue** a job as earliest as possible on the multiple resources by regarding the constraints (mainly: correct order of tasks, consecutive tasks on same resource)
- **Put** a job at a specific time and move the tail backwards
- **Delete** a job
- **Recalculate**: After delete, test if some tasks can be executed earlier.
<br/>
## Key Question
The point is: How can I **represent** this information to provide the functionality **efficiently**? Implementation is up to me ;-)
| 0 | [
2,
17333,
21,
7782,
1886,
18398,
22521,
800,
3726,
3726,
6926,
5910,
3445,
31,
83,
101,
20,
8713,
21,
1637,
21531,
5106,
18398,
22521,
2483,
9,
14,
4141,
235,
25,
13,
1409,
7526,
11203,
68,
1409,
19,
297,
9,
6926,
5910,
98,
25,
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... |
combining strings of n length in a list python
===
Whenever I use permutations, I have to create a list of the permutations because it returns a 'itertools.permutations object at 0x0190A5D0'. Then after I create the list, I have to combine the strings in each list so that I have the permutation I wanted originally. If it is a number, then I have to make them all integers again.
EG. permutations('123') becomes permutation object. list(permutation('123')) becomes [('1','2','3'),('1','3','2')...] <--then I have to combine these with [%s%s%s % xxx for xxx in list]
Two part question:
1) Is there an easier way to do a permutation and create the list of numbers?
2) Below I've created a permutation of a number with 5 digits. However, where I have '12345', I want the user to input their own number. Thus the formatting string b=['s%s%s...] will have to be n %s and n x. Anyone know how to do this?
(FYI my program is trying to find the next largest number with the same digits given a user's input so 12345 next largest is 12354)
def nexthighest():
from itertools import permutations
numb = str(12345)
a = list(permutations(numb))
b = ['%s%s%s%s%s' % xxxxx for xxxxx in a] #<-- this is where the n length problem occurs
c = list(map(int,b))
for i in c:
if i >12345:
print(i)
break | 0 | [
2,
12803,
7887,
16,
13,
103,
1476,
19,
21,
968,
20059,
800,
3726,
3726,
6634,
31,
275,
28706,
18,
15,
31,
57,
20,
1600,
21,
968,
16,
14,
28706,
18,
185,
32,
4815,
21,
13,
22,
242,
106,
20799,
18,
9,
1432,
7903,
7504,
3095,
35,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 line with multi color on graphic like nike plus
===
I want to draw stroke a path on graphic with multi color.
This is my code:
<b>
// line 1
CGContextBeginPath(context);
CGContextMoveToPoint(context, 50, 10);
CGContextAddLineToPoint(context, 60, 120);
CGContextStrokePath(context);
// line 2
CGContextBeginPath(context);
CGContextSetStrokeColorWithColor(context, [UIColor yellowColor].CGColor);
CGContextMoveToPoint(context, 60, 120);
CGContextAddLineToPoint(context, 20, 140);
CGContextStrokePath(context);
// line 3
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
CGContextMoveToPoint(context, 20, 140);
CGContextAddLineToPoint(context, 30, 170);
</b>
How to create a line like Nike plus route?
image url:
[enter link description here][1]
[1]: http://appshopper.com/blog/wp-content/uploads/2010/09/nike-plus-map.jpg | 0 | [
2,
184,
20,
2003,
293,
29,
1889,
1665,
27,
8479,
101,
18593,
3123,
800,
3726,
3726,
31,
259,
20,
2003,
7080,
21,
2013,
27,
8479,
29,
1889,
1665,
9,
48,
25,
51,
1797,
45,
13,
1,
220,
1,
12894,
293,
137,
13,
15123,
1126,
11969,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Default password for Windows Server 2008 R2
===
I've just started using a free cloud server trial and it came with Windows Server 2008.
After about 10 minutes, the the server was running and I could connect to it using the console on my provider's website.
I am presented with the login screen of Windows and it asks me for my password. It is logged into the Administrator account and when I enter my password for the site, it says incorrect username and password. I've also tried entering nothing and that also didn't work. Also, I wasn't asked what I would like the password to be as the setup process was probably automated.
Please, could someone help me out here? What is the default administrator username for Windows Server 2008?
Thanks | 0 | [
2,
12838,
20884,
26,
1936,
8128,
570,
761,
135,
800,
3726,
3726,
31,
22,
195,
114,
373,
568,
21,
551,
4005,
8128,
2178,
17,
32,
281,
29,
1936,
8128,
570,
9,
75,
88,
332,
902,
15,
14,
14,
8128,
23,
946,
17,
31,
110,
6379,
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... |
Python inheritance: TypeError: object.__init__() takes no parameters
===
I get this error:
TypeError: object.__init__() takes no parameters
when running my code, I don't really see what I'm doing wrong here though:
class IRCReplyModule(object):
activated=True
moduleHandlerResultList=None
moduleHandlerCommandlist=None
modulename=""
def __init__(self,modulename):
self.modulename = modulename
class SimpleHelloWorld(IRCReplyModule):
def __init__(self):
super(IRCReplyModule,self).__init__('hello world')
| 0 | [
2,
20059,
13852,
45,
1001,
29992,
45,
3095,
9,
1,
108,
242,
1,
5,
6,
1384,
90,
12905,
800,
3726,
3726,
31,
164,
48,
7019,
45,
1001,
29992,
45,
3095,
9,
1,
108,
242,
1,
5,
6,
1384,
90,
12905,
76,
946,
51,
1797,
15,
31,
221,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Play 2.0.1: Module problems when i want to use it
===
I want to use the Authentication and Authorization module for play 2.0.
I follow these instructions to
<a href="https://github.com/t2v/play20-auth/blob/master/README.md">install it</a>.
But when I launch my app i have this error :
not found: type AuthConfig
So I don't know if the error are in my configuration or in the module.
Do you have an idea when i have to look to resolve this error.
Thank you for your help | 0 | [
2,
418,
172,
9,
387,
9,
165,
45,
12613,
1716,
76,
31,
259,
20,
275,
32,
800,
3726,
3726,
31,
259,
20,
275,
14,
27963,
17,
22677,
12613,
26,
418,
172,
9,
387,
9,
31,
1740,
158,
7650,
20,
13,
1,
58,
746,
14057,
3726,
7,
21127,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Handling Sessions on Google App Engine with Android/IPhone
===
I'm starting to write an app whereby a mobile app (Android/IPhone) will communicate with the GAE backend (Python) through a series of Web API calls using JSON.
I can't use Google Accounts for authentication so I need to implement my own auth. I have an idea of how to do this, but I'm not sure if there is a better way.
Can anyone help with some code examples/suggestions of how to achieve the below please?
**Method**
1. Mobile app calls a Login method on the server which authenticates and creates a session key in the store and returns this to the app - *not sure how to generate the key/session or where on the request/response it should be.*
2. On every call, the app passes this key for the server to authenticate and allows the action if it passes.
3. User should not have to login on mobile again unless they explicitly logout or lose the key.
**Login Method - without key generation**
class Login(webapp.RequestHandler):
def post(self):
args = json.loads(self.request.body)
email = args['e']
pwd = args['p']
ret = {}
user = User.gql('WHERE email = :1', email).get()
if user and helpers.check_password(pwd, user.password):
ret['ret_code'] = 0
ret['dn'] = user.display_name
else:
ret['ret_code'] = 1
self.response.headers['Content-Type'] = 'application/json'
self.response.out.write(json.dumps(ret)) | 0 | [
2,
7988,
5763,
27,
8144,
4865,
1406,
29,
13005,
118,
49,
7709,
800,
3726,
3726,
31,
22,
79,
1422,
20,
2757,
40,
4865,
15630,
21,
3241,
4865,
13,
5,
290,
18524,
118,
49,
7709,
6,
129,
8709,
29,
14,
13,
17721,
97,
2451,
13,
5,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Image Processing on CUDA or OpenCV?
===
I need to develop an image processing program for my project in which I have to count the number of cars on the road. I am using GPU programming. Should I go for OpenCV program with GPU processing feature or should I develop my entire program on CUDA without any OpenCV library?
The algorithms which I am using for counting the number of cars is background subtraction, segmentation and edge detection.
| 0 | [
2,
1961,
5511,
27,
272,
5729,
54,
368,
12732,
60,
800,
3726,
3726,
31,
376,
20,
2803,
40,
1961,
5511,
625,
26,
51,
669,
19,
56,
31,
57,
20,
2468,
14,
234,
16,
2137,
27,
14,
383,
9,
31,
589,
568,
489,
4201,
3143,
9,
378,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
symfoyn2 native query is null but the sql query has one
===
has anybody an idea why the nativequery result is null?
$rsm = new ResultSetMapping;
$rsm->addEntityResult('AcmeTestBundle:event', 'e');
$rsm->addFieldResult('e', 'id', 'id');
$query = $this->getEntityManager()->createNativeQuery('SELECT id FROM event WHERE publickey COLLATE latin1_general_cs = ?', $rsm);
$query->setParameter(1, $eventkey);
return $query->getSingleResult();
When i run the query directly in mysql, i become the correct result.
This is the created query from the console:
[2012-06-24 18:08:08] doctrine.DEBUG: SELECT id FROM event WHERE publickey COLLATE latin1_general_cs = ? (["key"]) [] []
I'm using the same function on an other entity and i become the correct result.
Has anybody an idea?
Thank you!
| 0 | [
2,
13,
7261,
25094,
103,
135,
1275,
25597,
25,
16203,
47,
14,
4444,
255,
25597,
63,
53,
800,
3726,
3726,
63,
11181,
40,
882,
483,
14,
1275,
8190,
93,
829,
25,
16203,
60,
5579,
1224,
79,
800,
78,
1736,
1198,
540,
5574,
73,
5579,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Data Binding DateTime to a label->text converts the value to local time
===
I have a custom control that shows the contents of a dataBase with a bindingsource in between. I use labels in the control to bind the text property to the data in the dataset through a bindingsource with the following code:
mycontrol->Controls[i]->DataBindings->Add((gcnew System::Windows::Forms::Binding(L"Text",
this->bindingSourceRelRev_Data, mycolumn,true, System::Windows::Forms::DataSourceUpdateMode::OnValidation,
nullptr, L"t")));
Please, note that the code is an excerpt of a loop that iterates on all the controls, therefore the control[i], which would be the label control, and the variable mycolumn, which would be the column of the dataset to be binded to. It works fine apart of an unwanted behaviour that I haven't yet found the way to change.
The sofware runs in different parts of the world but the records must be in local time. The database stores the time in localtime as a DateTime value but the dataBinding interprets it as UTC and shows the time in the label with the timezone difference applied. For example, if the data is 24/06/2012 16:40, it will show 24/06/2012 22:40 in a 4 hours difference time zone.
I need it to show just the value as it was stored, without changes.
I can think of different ways to go arround, but non elegant:
-capture the text update event of the label and un-do the change...
-Store the date as String in the DB...
-fill manually the labels...
-...
If I bind without formating, it will not change the value, but then I have the raw datetime string on the label...
Please, any magic I am missing in the binding so that it will not assume it has to change the time zone?
Thank you very much in advance!
Adan | 0 | [
2,
1054,
8728,
1231,
891,
20,
21,
1899,
8,
1,
11969,
8406,
18,
14,
1923,
20,
375,
85,
800,
3726,
3726,
31,
57,
21,
5816,
569,
30,
1285,
14,
8478,
16,
21,
6018,
29,
21,
8728,
12097,
19,
128,
9,
31,
275,
13173,
19,
14,
569,
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... |
asp.net mvc 3 - remove time from date
===
I am having a model in with a DateTime property:
public DateTime? DateNaissance { get; set; }
and a View with a @Html.TextBoxFor for the property
@Html.TextBoxFor(model => model.DateNaissance)
All I want is to get the date typed, however, when I type in 01/06/2012 as date I am having the "01/06/2012 00:00:00" in the controller
All I want is to get the date, why the time is added ?, how to automatically remove it ?
I tried out without success:
[DisplayFormat(DataFormatString = "{0:dd/MM/yyyy}")]
Thanks
| 0 | [
2,
28,
306,
9,
2328,
307,
8990,
203,
13,
8,
4681,
85,
37,
1231,
800,
3726,
3726,
31,
589,
452,
21,
1061,
19,
29,
21,
1231,
891,
1354,
45,
317,
1231,
891,
60,
1231,
6632,
18,
18,
2416,
13,
1,
164,
73,
309,
73,
13,
1,
17,
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... |
Issue with reading data from socket, UI freeze in Android application
===
I am currently working on an android application which requires reading data from bluetooth socket. The code I am using is as follows:
runOnUiThread(new Runnable() {
public void run()
{
try{
ReadData();
}catch(Exception ex){}
}
});
public void ReadData() throws Exception{
try {
b1 = new StringBuilder();
stream = socket.getInputStream();
int intch;
String output = null;
String k2 = null;
byte[] data = new byte[10];
// read data from input stream if the end has not been reached
while ((intch = stream.read()) != -1) {
byte ch = (byte) intch;
b1.append(ByteToHexString(ch) +"/");
k++;
if(k == 20) // break the loop and display the output
{
output = decoder.Decode(b1.toString());
textView.setText(output);
k=0;
break;
}
}
// close the input stream, reader and socket
if (stream != null) {
try {stream.close();} catch (Exception e) {}
stream = null;
}
if (socket != null) {
try {socket.close();} catch (Exception e) {}
socket = null;
}
} catch (Exception e) {
}
}
However, when I run the application on android device, the UI doesn't update automatically and it keeps freezing. Does anyone know how to resolve the UI freeze issue? I would like to display the data on UI dynamically rather than display the data after finishing the loop.
Thanks for any helps in advance.
Regards,
Charles | 0 | [
2,
1513,
29,
1876,
1054,
37,
18482,
15,
13,
5661,
11551,
19,
13005,
3010,
800,
3726,
3726,
31,
589,
871,
638,
27,
40,
13005,
3010,
56,
4781,
1876,
1054,
37,
705,
15808,
18482,
9,
14,
1797,
31,
589,
568,
25,
28,
2415,
45,
485,
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... |
Facebook Javascript SDK in Joomla Extensions - loading the sdk twice?
===
I made a module out of the facebook comments plugin and am now developing a plugin to add a like button to the end of articles. If the comments module is on the same page as an article, the page won't even load. I just get a blank white screen. I have now tried copying the comments module and putting two of it on the same page, this makes the page say HTTP Error 500. For Joomla, it is good programming to make your modules work if duplicated on the same page and obviously my article plugin HAS to work with the comments box. How can I make these compatible (and with themselves)?
//Article plugin loading fb:
$like = '<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, \'script\', \'facebook-jssdk\'));</script>
<div id="likeBox"><div class="fb-like"'.$fdatahref.' data-send="false" data-layout="button_count"></div></div>';
//Comments module loading fb:
$parameters = 'data-href="'.$url.'" data-num-posts="'.$quantity.'" data-width="'.$width.'">';
<div class="fb-comments" <?php echo $parameters ?></div>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $appID ?>', // App ID
channelUrl : '/modules/mod_fcbk_cmnts/channel.html',
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
//Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
</script> | 0 | [
2,
9090,
8247,
8741,
13,
18,
43,
197,
19,
2640,
2636,
531,
17529,
13,
8,
12797,
14,
13,
18,
43,
197,
2088,
60,
800,
3726,
3726,
31,
117,
21,
12613,
70,
16,
14,
9090,
7534,
10922,
108,
17,
589,
130,
3561,
21,
10922,
108,
20,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 should I send resourcebundle messages across controllers in spring mvc?
===
Most of the spring tutorials and examples show you how to get the message from the resource file and how to show it in your view (jsp), but not how you should handle those messages in your controller and between views.
Here is an example of how im doing it now where I have a view/controller that handles forgotten passwords. When the password is sent I redirect back to the login screen with a message that "your password is sent ..."
@RequestMapping(value="/forgottenpassword")
public String forgottenpassword(@RequestParam String email) {
....something something
if(email != null){
return "redirect:/login?forgottenpassword=ok";
}
}
@RequestMapping(value="/login")
public String login(HttpServletRequest request) {
if(request.getParameter("forgottenpassword") != null && request.getParameter("forgottenpassword").equals("ok")) {
data.put("ok_forgottenpassword", "forgottenpassword.ok");
}
return "login";
}
Finaly I display the message in my view, in this case a freemarker template
<#if (ok_forgottenpassword?exists)>
<div class="alert alert-success"><@spring.message "${ok_forgottenpassword}" /></div>
</#if>
Is this the best way of doing it in a Spring framework? It's simple with just 1 type of message, but what if I need 5?
| 0 | [
2,
184,
378,
31,
2660,
6577,
9930,
413,
7561,
464,
9919,
18,
19,
1573,
307,
8990,
60,
800,
3726,
3726,
127,
16,
14,
1573,
29724,
18,
17,
3770,
298,
42,
184,
20,
164,
14,
2802,
37,
14,
6577,
3893,
17,
184,
20,
298,
32,
19,
154,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
extern access modifiers don't work
===
I'm trying to hide my P/Invoke functions, like this one:
[<DllImport("kernel32.dll", SetLastError=true)>]
extern bool private CreateTimerQueueTimer(IntPtr& phNewTimer, nativeint TimerQueue, WaitOrTimerDelegate Callback, nativeint Parameter, uint32 DueTime, uint32 Period, ExecuteFlags Flags)
Strangely, though, the `private` gets ignored -- which is really annoying, because I want to hide all the unwieldy structs and enums associated with these functions.
I guess I could put everything in a private module, so it's not too big of a deal, but am I missing something? | 0 | [
2,
1396,
8766,
1381,
7226,
16292,
18,
221,
22,
38,
170,
800,
3726,
3726,
31,
22,
79,
749,
20,
3077,
51,
351,
118,
108,
2625,
1048,
3719,
15,
101,
48,
53,
45,
636,
1,
8643,
8585,
1993,
5,
7,
2429,
7440,
3125,
9,
43,
211,
7,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Logging out from TabBarViewController to UIViewController using AccessToken
===
I am facing problem in how to logging out from "TabBarViewController" to "UIViewController".
Firstly I am logging In(using SOAP web service + XML parsing) from UIViewController page, If the userId and Password is Correct then 'Access Token' is generated in database and(collected in variable using XML parsing in our page) and TabBarViewController is loaded(user profile page). Now after logging I want to "LogOut". On Profile Page I placed one button called "Logout".
Now here, I need your Help how to LogOut using 'Access Token'(which is generated during successful logging) So that I turn back to LogIn page agian ?????
Below is code is running when I Press "Login" button after entering "User ID" and "Password" in UITextField :
-(IBAction)Login{
txtuser.text = @"test";
txtpwd.text = @"test";
if([txtuser.text isEqualToString:@"" ]|| [txtpwd.text isEqualToString:@""])
{
UIAlertView *myAlert = [[UIAlertView alloc]
initWithTitle:nil message:@"Please fill all fields" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[myAlert show];
[myAlert release];
}
else
{
md5 =[txtpwd text];
//Calling MD5 Method to Convert password into "hashcode"(Hexadecimal) formate
md5 = [md5 MD5];
NSLog(@"%@",md5);
itmselected =FALSE;
// Calling Web Service Method
NSString *soapmessage = [NSString stringWithFormat:@"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"
"<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
"<soap:Body>\n"
"<Login xmlns=\"http://boleapp.com/\">\n"
"<UserName>%@</UserName>\n"
"<PassHash>%@</PassHash>\n"
"</Login>\n"
" </soap:Body>\n"
" </soap:Envelope>\n",[txtuser text],md5];
NSLog(@"%@",soapmessage);
NSURL *url = [NSURL URLWithString:@"http://weibotest.dotnetgeekz.com/servicemain.asmx"];
NSMutableURLRequest *req = [[NSMutableURLRequest alloc]initWithURL:url];
NSString *msglength = [NSString stringWithFormat:@"%d",[soapmessage length]];
[req addValue:@" text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[req addValue:@"http://boleapp.com/Login" forHTTPHeaderField:@"SOAPAction"];
[req addValue:msglength forHTTPHeaderField:@"Content-Length"];
[req setHTTPMethod:@"POST"];
[req setHTTPBody:[soapmessage dataUsingEncoding:NSUTF8StringEncoding]];
[NSURLConnection connectionWithRequest:req delegate:self];
webadata = [[NSMutableData alloc]init];
[txtuser resignFirstResponder];
[txtpwd resignFirstResponder];
}
}
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
[webadata appendData:data];
}
-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error{
NSLog(@"error");
}
-(void)connectionDidFinishLoading:(NSURLConnection *)connection{
xmlparser = [[NSXMLParser alloc]initWithData:webadata];
[xmlparser setDelegate:self];
[xmlparser parse];
}
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict{
if([elementName isEqualToString:@"Login"])
soapresult = [[NSMutableString alloc]init];
itmselected = YES;
}
-(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
if(itmselected){
NSLog(@"Bool value and Access Token Number and UserID= %@",string);
if([string isEqualToString:@"false"]){
[invaliduser setImage:[UIImage imageNamed:@"invalid_username.png"]];
}
else{
NSArray* splits = [string componentsSeparatedByString: @","];
NSString *strbool = [splits objectAtIndex:0];
NSString *strAtoken = [splits objectAtIndex:1];
id UserIdLogin = [splits objectAtIndex:2];
if ([strbool isEqualToString:@"true"]){
main.strAccessTokenMain = strAtoken;
main.UserIdMain = UserIdLogin;
NSLog(@"strAccessTokenMain = %@",[main strAccessTokenMain]);
// Calling "showtabbar" method for Loading TabBarViewController page
[main showtabbar];
}
}
[soapresult appendString:string];
}
}
-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
if([elementName isEqualToString:@"LoginResult"]){
itmselected = NO;
}
}
// "showtabbar" Method For Launching TabBarViewController
-(void)showtabbar{
//Removing UIViewController's 'Login' page
[self.view removeFromSuperview];
[BoleApp release];
NSLog(@"userID = %@",UserIdMain);
tabbarcontroller = [[UITabBarController alloc]init ];
//Creating Object of "Profile" Class for Launching as First tab of TabBarViewController
profile *view1 = [[profile alloc]initWithNibName:@"profile" bundle:nil ];
view1.strAccessToken = strAccessTokenMain;
view1.UserIdProfile = UserIdMain;
NSLog(@"view1str = %@",view1.strAccessToken);
view1.title = @"Profile";
view1.tabBarItem.image = [UIImage imageNamed:@"profile.png"];
//Second Tab of TabBarViewController
Brandslist *view2 = [[Brandslist alloc]init];
view2.BrandAccToken = strAccessTokenMain;
view2.UserIdBrndList = UserIdMain;
Instruction *view3 = [[Instruction alloc]init];
settings *view4 = [[settings alloc]init];
view2.title = @"Brands";
view2.tabBarItem.image = [UIImage imageNamed:@"brands.png"];
// Third Tab of TabBarViewController
view3.title = @"Info";
view3.tabBarItem.image = [UIImage imageNamed:@"info.png"];
// Fourth Tab of TabBarViewController
view4.title = @"Settings";
view4.tabBarItem.image = [UIImage imageNamed:@"settings.png"];
view4.AccessToken = strAccessTokenMain;
view4.user_ID = UserIdMain;
[tabbarcontroller setViewControllers:[NSArray arrayWithObjects:view1,view2,view3,view4, nil]];
[mainWindow addSubview:tabbarcontroller.view];
}
This is my profile page's "Logout" Method where I want to write code for Logging out from Profile page to Login page(UIViewController)
-(IBAction)Logout{
NSLog(@"Logout Button Clicked !!!");
// What to code here for resuming back to Login page ????? Please Help me out
?
?
?
}
Friends, Please revert back. Your help would be appreciated .
Thanks,
Tauseef Khan | 0 | [
2,
13,
13919,
70,
37,
6523,
1850,
4725,
12898,
1252,
20,
13,
5661,
4725,
12898,
1252,
568,
1381,
262,
2853,
800,
3726,
3726,
31,
589,
4325,
1448,
19,
184,
20,
13,
13919,
70,
37,
13,
7,
15783,
1850,
4725,
12898,
1252,
7,
20,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to run jFileChooser in console-application? Is it possible?
===
I tried to do this with this piece of code:
JFileChooser chooser = new JFileChooser();
int retval = JFileChooser.CANCEL_OPTION;
chooser.setFileSelectionMode( JFileChooser.DIRECTORIES_ONLY);
retval = chooser.showDialog(null, "Select");
But it didn't work. Console just waited for input... | 0 | [
2,
184,
20,
485,
487,
16877,
2613,
759,
106,
19,
8650,
8,
2552,
20669,
60,
25,
32,
938,
60,
800,
3726,
3726,
31,
794,
20,
107,
48,
29,
48,
1855,
16,
1797,
45,
487,
16877,
2613,
759,
106,
3538,
139,
800,
78,
487,
16877,
2613,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Playing sound with AVAudioPlayer
===
I'm trying to play a mp3 file in objective c with Xcode for the iPhone.
In viewDidLoad:
NSURL *mySoundURL = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/mySound.mp3", [[NSBundle mainBundle] resourcePath]]];
NSError *myError;
mySound = [[AVAudioPlayer alloc] fileURLWithPath:heartBeatURL error:&myError];
[mySound play];
I found a suggestion here: http://stackoverflow.com/questions/7304803/problem-while-playing-sound-using-avaudioplayer
but it did not work for me, it only generated more issues.
When the program launches I get this in output and the program crashes:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AVAudioPlayer", referenced from:
objc-class-ref in SecondViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
What am I doing wrong here? | 0 | [
2,
791,
646,
29,
13656,
6785,
111,
14049,
800,
3726,
3726,
31,
22,
79,
749,
20,
418,
21,
4628,
240,
3893,
19,
7038,
272,
29,
993,
9375,
26,
14,
21024,
9,
19,
1418,
3052,
8294,
45,
13,
103,
4082,
255,
1637,
915,
8489,
911,
255,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Apache 2 treating index and index.php as the same file
===
I'm working on a PHP project using Apache 2.2.22 and PHP 5.3.10 and I'm running into an issue where index and index.php are being treated as the same file.
I have an admin/index.php that redirects to admin/index to allow my mod_rewrite rules in .htaccess to take over and reroute the request into a custom framework. The problem is, when the browser goes to admin/index it goes into an infinite redirect loop because the request is being sent to admin/index.php which redirects to admin/index
I've tried removing the htaccess file to see if there was a problem with my mod_rewrite rules that was causing it and it didn't change anything. It just redirects to admin/index endlessly.
I've never heard of this behavior before, skimming over some Google results and skimming through the apache configuration files didn't show anything really obvious. Has anyone seen this before and know how to fix it? | 0 | [
2,
17140,
172,
13749,
4348,
17,
4348,
9,
26120,
28,
14,
205,
3893,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
13,
26120,
669,
568,
17140,
172,
9,
135,
9,
2287,
17,
13,
26120,
331,
9,
240,
9,
1036,
17,
31,
22,
79,
946,
77,
40,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Particles vs ParticleSystem in three.js
===
I'm struggling with a visualization I'm working on that involves a stream of repeated images. I have it working with a single sprite with a ParticleSystem, but I can only apply a single material to the system. Since I want to choose between textures I tried creating a pool of Particle objects so that I could choose the materials individually, but I can't get an individual Particle to show up with the WebGL renderer.
This is my first foray into WebGL/Three.js, so I'm probably doing something bone-headed, but I thought it would be worth asking what the proper way to go about this is. I'm seeing three possibilities:
- I'm using Particle wrong (initializing with a mapped material, adding to the scene, setting position) and I need to fix what I'm doing.
- I need a ParticleSystem for each sprite I want to display.
- What I'm doing doesn't fit into particles at all and I really should be using another object type.
All the examples I see using the canvas renderer use Particle directly, but I can't find an example using the WebGL renderer that doesn't use ParticleSystem. Any hints? | 0 | [
2,
9497,
4611,
11534,
10724,
19,
132,
9,
728,
18,
800,
3726,
3726,
31,
22,
79,
7587,
29,
21,
28873,
31,
22,
79,
638,
27,
30,
6569,
21,
3766,
16,
4251,
3502,
9,
31,
57,
32,
638,
29,
21,
345,
27902,
29,
21,
11534,
10724,
15,
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... |
django-cms: urls used by apphooks don't work with reverse() or {% url %}
===
I'm using django-cms with apphooks to display book detail information. I need the page with the app hook to accept a slug that specifies which book to display.
I created a page called 'books' and added the apphook 'BookDetailApp'.
Here's what my books.cms_app file looks like:
class BooksApp (CMSApp):
name = _('Book Detail Page Application')
urls = ['books.urls']
apphook_pool.register(BooksApp)
Here's what my books.urls looks like:
urlpatterns = patterns('',
url(r'^(?P<slug>[\w\-]+)?', BookDetailView.as_view(), name='book_detail'),
)
And here's what my books.views file looks like:
class BookDetailView (DetailView):
model = Book
template_name = 'layouts/book-detail.html'
context_object_name = 'book'
This all works fine when I go directly to book detail page.
So going to `http://localhost:8000/books/the-book-slug/` works exactly how I want to.
The problem is that I need be able to link to specific book detail pages from promos on the home page and none of the expected methods are working for me.
Using the page_url template tag from django-cms doesn't work because it only accepts one argument, so i can't provide the slug needed to determine which book to display:
<a href="{% page_url 'book_detail' %}">go</a>
As expected this only redirects to `http://localhost:8000/books/` which throws an error because the required slug was not included.
So my next options are to use the url template tag or defining an get_absolute_url() function on the model. Neither of these options work:
<a href="{% url book_detail book.slug %}">go</a>
def get_absolute_url(self):
return reverse('book_detail', args=[self.slug])
These both result in a NoReverseMatch: Reverse for 'book_detail' not found error.
If I include the books.urls conf in my main url conf then it works. So it would appear that if the url is only being used by a cms apphook that it can't be reversed by django.
Including books.urls in my main urls seems like a dirty solution and I definitely do not want to hardcode the urls in the template or the get_absolute_url function. Neither of those solutions seems very 'pythonesque'.
Any suggestions?
| 0 | [
2,
3857,
14541,
8,
9095,
18,
45,
13,
911,
7532,
147,
34,
4865,
20378,
18,
221,
22,
38,
170,
29,
7006,
5,
6,
54,
13,
1,
11881,
287,
6362,
13,
11881,
1,
800,
3726,
3726,
31,
22,
79,
568,
3857,
14541,
8,
9095,
18,
29,
4865,
203... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Microsoft Threat Modeling Tool and Open Source Bug Tracking Systems?
===
Has anyone successfully got any open source bug tracking tools (MANTIS, Bugzilla, etc.) to work with Microsoft's SDL Threat Modeling Tool? Out of the box, it seems to support Microsoft Team Foundation Server; however, I was hoping to use something else.
It looks like they provide a library to help developers extend their bug tracking system to support the Threat Modeling Tool, I'm just not sure if this has ever been done.
For reference, at the end of the video here, microsoft talks about the capability of supporting 3rd party bug tracking systems: [Microsoft Threat Modeling Introduction][1].
[1]: http://msdn.microsoft.com/en-us/security/gg674976 | 0 | [
2,
7099,
3603,
12807,
5607,
17,
368,
1267,
6256,
10353,
1242,
60,
800,
3726,
3726,
63,
1276,
3673,
330,
186,
368,
1267,
6256,
10353,
4672,
13,
5,
177,
3409,
15,
6256,
380,
3247,
15,
2722,
9,
6,
20,
170,
29,
7099,
22,
18,
13,
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... |
Long PHP Script keeps getting server error
===
Hi I am having an issue with a script in PHP,
It's basically only ever running at most 2 millions mysql queries so it takes a while to complete but before it can complete, the page keeps showing internal server error.
I have already included:
ini_set('max_execution_time', 0);
so this leads me to beleive it's not the PHP causing it...
Thanks in advance. | 0 | [
2,
175,
13,
26120,
3884,
8968,
1017,
8128,
7019,
800,
3726,
3726,
4148,
31,
589,
452,
40,
1513,
29,
21,
3884,
19,
13,
26120,
15,
32,
22,
18,
11374,
104,
462,
946,
35,
127,
172,
11999,
51,
18,
22402,
9386,
2829,
86,
32,
1384,
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 measure width of a string precisely?
===
First of all, question "How to measure width of character precisely?" which is answered, doesn't really help for this case, so this isn't a duplicate of that.
I have a string I draw using graphics.DrawString, however when I need to put another one after it, I need to know the precise width of previous string.
For this I use graphics.MeasureString with:
`StringFormat format = new StringFormat(StringFormat.GenericTypographic);
format.Alignment = StringAlignment.Center;
format.Trimming = StringTrimming.None;
format.FormatFlags = StringFormatFlags.MeasureTrailingSpaces;`
I have tried many other functions, just as TextRendered.MeasureText however all of them fail, with all possible combinations of parameters.
the mentioned combination of MeasureString is most close to what I need (it works in most cases, except for special characters), however using characters like # break it. The width is either shorter or longer.
Is there a way to get a precise size of text produced by DrawString function? How does the DrawString calculate the size of drawing area? It must be clearly some other function because the size always differ. | 0 | [
2,
184,
20,
4058,
9456,
16,
21,
3724,
11628,
60,
800,
3726,
3726,
64,
16,
65,
15,
1301,
13,
7,
1544,
20,
4058,
9456,
16,
925,
11628,
60,
7,
56,
25,
3094,
15,
1437,
22,
38,
510,
448,
26,
48,
610,
15,
86,
48,
2532,
22,
38,
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... |
PDO returns wrong value for select statement
===
I've a PHP application that works with MySQL through PDO. I have a table with different records and I have to prevenet inserting a duplicate one. But when I want to check existing items, `select` statement does not return a true value. This is my code:
$sql = "SELECT COUNT(id) FROM tbl_product_category1 WHERE title = '?'";
$q = $db->prepare($sql);
$q->execute(array($title));
if ($q->fetchColumn() == 0)
{
...
I also tested this one:
$sql = "SELECT id FROM tbl_product_category1 WHERE title = '?'";
$q = $db->prepare($sql);
$q->execute(array($title));
$rows = $q->rowCount();
if ($rows == 0)
{
...
Imagine `$title=1`. I have 4 records with this value. But I can not see anything in `SELECT` statement. What is wrong here ? | 0 | [
2,
351,
537,
4815,
1389,
1923,
26,
5407,
3331,
800,
3726,
3726,
31,
22,
195,
21,
13,
26120,
3010,
30,
693,
29,
51,
18,
22402,
120,
351,
537,
9,
31,
57,
21,
859,
29,
421,
742,
17,
31,
57,
20,
782,
10263,
38,
14692,
68,
21,
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... |
Tracking events on parts of website - Google Analytics?
===
I'm building a single page ad-free portfolio-type website using jquery Isotope. I would like to track how often each project (Isotope element - div with text and a slideshow in it) will be clicked to be able to compare project popularity. Can this be done with Google Analytics? Is that the best tool for that purpose or are there simpler/better/other ones? The provider provides a tool called Webalizer, but that does not allow me to hook up each project element. Google Analytics gives me only information regarding the entire site, not its parts. Thanks for any advice... | 0 | [
2,
10353,
963,
27,
1341,
16,
2271,
13,
8,
8144,
26320,
60,
800,
3726,
3726,
31,
22,
79,
353,
21,
345,
2478,
21,
43,
8,
4639,
10588,
8,
4474,
2271,
568,
487,
8190,
93,
21288,
9,
31,
83,
101,
20,
792,
184,
478,
206,
669,
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 to make gRaphael assets visible to assets pipeline in Rails?
===
i've been looking on how to integrate gRaphael with Rails and been using this [gem][1]
From the gem i notice it has a class for the Rails Engine:
File graphael-rails.rb
module Graphael
module Rails
class Engine < ::Rails::Engine
end
end
end
And since the rails guides mention a similar behavior for jquery :
> 7 Adding Assets to Your Gems Assets can also come from external
> sources in the form of gems.
>
> A good example of this is the jquery-rails gem which comes with Rails
> as the standard JavaScript library gem. This gem contains an engine
> class which inherits from Rails::Engine. By doing this, Rails is
> informed that the directory for this gem may contain assets and the
> app/assets, lib/assets and vendor/assets directories of this engine
> are added to the search path of Sprockets.
I guess the files would be recognized adding `//= require Graphael` to my application.js, but it seems not, since i'm getting the error message `Sprockets::FileNotFound couldn't find file 'Graphael'` ...
What might i do for sprockets to recognize gRaphael?
Thank you
[1]: http://rubygems.org/gems/graphael-rails | 0 | [
2,
184,
20,
233,
7210,
58,
532,
6223,
4560,
20,
6223,
12250,
19,
2240,
18,
60,
800,
3726,
3726,
31,
22,
195,
74,
699,
27,
184,
20,
18399,
7210,
58,
532,
29,
2240,
18,
17,
74,
568,
48,
636,
20231,
500,
2558,
165,
500,
37,
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... |
icon smoothing in TabbedViewNavigator
===
I tried different things to get smooth icons in the TabbedViewNavigator tabs.
It's so annoying... why Adobe didn't put the smooth/ing boolean as part of it ?
I already tried to manually call the tab's icon object and apply 'smooth = true' or 'smoothing = true' unsuccessfully.
Any suggestions ? | 0 | [
2,
9801,
3905,
68,
19,
6523,
4283,
4725,
16424,
15807,
800,
3726,
3726,
31,
794,
421,
564,
20,
164,
3905,
9801,
18,
19,
14,
6523,
4283,
4725,
16424,
15807,
6523,
18,
9,
32,
22,
18,
86,
17610,
9,
9,
9,
483,
20299,
223,
22,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trying to access Instagram API using jquery. Failing with every try
===
So I'm trying to deal with Instagram API and I'm making ajax requests in a do-while loop until the next_url is null. This code is giving me the creeps and I think if you'll read this, it will give some creeps to you too. All I want this code to do is, fetch all the followers by making continuous requests until it's done. What is wrong in this code? When I remove the do-while loop it doesn't gives me no error, but as soon as a I use the ajax request within a loop, it never stops, clearly the $next_url string is not changing to the newly fetched next_url, why? What is wrong?
$(document).ready(function(e) {
$('#fetch_followers').click(function(e) {
var $next_url = 'https://api.instagram.com/v1/users/{user-id}/followed-by?access_token={access-token}&count=100';
var $access_token = '{access-token}';
var $is_busy = false;
var $count = 0;
do {
while($is_busy) {}
$.ajax({
method: "GET",
url: $next_url,
dataType: "jsonp",
jsonp : "callback",
jsonpCallback: "jsonpcallback",
success: function(data) {
$is_busy = true;
$.each(data.data, function(i, item) {
$("#log").val($("#log").val() + item.id + '\n');
});
$("#log").val($("#log").val() + data.pagination.next_url + '\n');
$next_url = data.pagination.next_url;
},
error: function(jqXHR, textStatus, errorThrown) {
$is_busy = true;
//alert("Check you internet Connection");
$("#log").val($("#log").val() + 'Error\n');
},
complete: function() {
++$count;
$is_busy = false;
}
});
} while($next_url !== '' || $count <= 50);
});
});
After I failed in my logic, I added the $count variable that can break the do-while loop, because the do-while loop was running infinitely. After adding it, it still runs infinitely, and I have no idea why. | 0 | [
2,
749,
20,
1381,
28205,
21,
2159,
568,
487,
8190,
93,
9,
7250,
29,
352,
1131,
800,
3726,
3726,
86,
31,
22,
79,
749,
20,
1183,
29,
28205,
21,
2159,
17,
31,
22,
79,
544,
20624,
12279,
19,
21,
107,
8,
10144,
5293,
163,
14,
328,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 crop image on camera preview "Goggles style" - Android
===
I'm trying to make a small Android application that reads text from pictures. I've already implemented Tesseract tools for Android and I'm able to recognize text from pictures taken with camera. My current problem is that distance for taking picture is really strict. It's not really user friendly if users has to be at very exact distance from text (s)he's trying to read.
I was thinking that best way would do it like in Google Goggles where user is able to crop specific part of image (on camera preview) that (s)he likes to scan. Is there any ready custom cameras (couldn't find any) or have any of you done it?
Thanks, Lasse | 0 | [
2,
184,
20,
9833,
1961,
27,
3336,
16121,
13,
7,
839,
4572,
1355,
1034,
7,
13,
8,
13005,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
284,
13005,
3010,
30,
11137,
1854,
37,
3104,
9,
31,
22,
195,
614,
6807,
13338,
106,
5183,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.