unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
How do you check the length of the added text in a WPF TextBox control?
===
I have a `TextChanged` event for my WPF TextBox as follows:
private void textMatch_TextChanged(object sender, TextChangedEventArgs e)
{
var m = e.Changes;//here I can see e.Changes has what I'm looking for
//do some other stuff here.
}
However, what I want to do is to check the length of text that was added. Apparently, `e.Changes` contains that value but I can't figure out a way to find it out *programmatically* neither could I find any example online.
*My current way of checking this is by storing the current length each time text is changed and making sure the new length only increases by 1 but It's sorta like hacking to me.*
Has anyone tried this before? How do I find out the length of the added text using the `TextChangedEventArgs`? Thanks. | 0 | [
2,
184,
107,
42,
2631,
14,
1476,
16,
14,
905,
1854,
19,
21,
619,
7721,
1854,
5309,
569,
60,
800,
3726,
3726,
31,
57,
21,
13,
1,
11969,
16229,
43,
1,
807,
26,
51,
619,
7721,
1854,
5309,
28,
2415,
45,
932,
11364,
1854,
12280,
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... |
Apache axis logging - ClassCastException
===
My Jira 5.0 plugin is broken with the following exception:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
...
Caused by: java.lang.ExceptionInInitializerError
at org.apache.axis.description.OperationDesc.<clinit>(OperationDesc.java:65)
at com.xyz.germander.AddTestTrackLinkDialogAction.doConfirm(AddTestTrackLinkDialogAction.java:23)
... 148 more
Caused by: java.lang.ClassCastException: org.apache.commons.logging.impl.SLF4JLogFactory cannot be cast to org.apache.commons.logging.LogFactory
at org.apache.axis.components.logger.LogFactory.getLogFactory(LogFactory.java:41)
at org.apache.axis.components.logger.LogFactory.<clinit>(LogFactory.java:33)
... 150 more
For reference, this is the method throwing the ClassCastException:
private static final org.apache.commons.logging.LogFactory getLogFactory() {
return (org.apache.commons.logging.LogFactory)
AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return DiscoverSingleton.find(org.apache.commons.logging.LogFactory.class,
org.apache.commons.logging.LogFactory.FACTORY_PROPERTIES,
org.apache.commons.logging.LogFactory.FACTORY_DEFAULT);
}
});
}
... for further reference, org.apache.commons.logging.LogFactory.FACTORY_DEFAULT is "org.apache.commons.logging.impl.LogFactoryImpl", and FACTORY_PROPERTIES is supposed to be the name of the properties file to search for, which in my org.apache.commons.logging jar is "commons-logging.properties".
I've tried creating a commons-logging.properties file in the resource dir of the plugin; that file contains this:
priority=1
org.apache.commons.logging.Log=org.apache.commons.logging.impl.LogFactoryImpl
... but it seems to get ignored since getLogFactory() still gets SLF4JLogFactory and fails to cast it. So it looks like:
- This commons-logging.properties file needs to be somewhere else
- I need to set the logging class to be something else
- The project is otherwise misconfigured, maybe at the Jira level or maybe at the plugin or maybe Maven or... I don't even know
I'm pretty stumped, and would appreciate any guidance.
There is a similar question [here][1], except that poster was getting the same exception in getLogFactory from the initialization of org.apache.axis.attachments.AttachmentsImpl instead of org.apache.axis.description.OperationDesc. (Also a Confluence plugin, not Jira.) Nobody responded there, though.
[1]: http://stackoverflow.com/questions/11464763/getting-slf4jlogfactory-exception-while-trying-to-access-web-services-from-confl | 0 | [
2,
17140,
8577,
13,
13919,
13,
8,
718,
6146,
10066,
872,
800,
3726,
3726,
51,
487,
3517,
331,
9,
387,
10922,
108,
25,
2023,
29,
14,
249,
5391,
45,
8247,
9,
9949,
9,
27977,
9,
108,
2625,
16893,
3958,
3060,
10066,
872,
35,
939,
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... |
How to use AR on an incomplete time series
===
I would like to use the function ar() in R to fit an AR(p) process, but I am using it on an intraday timeseries and the data is not contiguous.
I tried to add NAs at the end of every day to force ar() to not compute the AR on the first p values, by typing this:
ar(c(rbind(ind_series, rep(NA,NCOL(ind_series)))))
But then R complains about the NAs:
Error in na.fail.default(as.ts(x)) : missing values in object
ar() has a na.action parameter but the documentation does not explain how to change it so that I have the behaviour I want. By default, it is set to na.fail().
ind_series is a matrix of 810 rows for every day and there are 39 days of observations (number of columns).
Anyone know how I can fit an AR taking in account the fact that the data is not contiguous ? | 0 | [
2,
184,
20,
275,
13,
512,
27,
40,
14011,
85,
231,
800,
3726,
3726,
31,
83,
101,
20,
275,
14,
1990,
13,
512,
5,
6,
19,
761,
20,
2742,
40,
13,
512,
5,
306,
6,
953,
15,
47,
31,
589,
568,
32,
27,
40,
14369,
1185,
85,
8231,
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... |
expected declaration specifiers or '...' before '&' token
===
Even though this error has been discussed many times before in this forum, Most of time it has been content specific.So i request you to explain me in general when this problem occurs and how to avoid it.
| 0 | [
2,
1727,
7098,
12737,
16292,
18,
54,
13,
22,
9,
9,
9,
22,
115,
13,
22,
1569,
22,
20,
2853,
800,
3726,
3726,
166,
362,
48,
7019,
63,
74,
6078,
151,
436,
115,
19,
48,
5691,
15,
127,
16,
85,
32,
63,
74,
2331,
1903,
9,
656,
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... |
Could not find rake-0.9.2.2 in any of the sources
===
This is an odd one. I'm getting this error when I run rake to do tests but not when I migrate. I'm running RVM, the shell dump below should give any information you need.
Any help would be greatly appreciated. I've seen a few other people with this issue, but no solutions that worked for me yet (or them).
Thanks.
$ rake
Could not find rake-0.9.2.2 in any of the sources
Run `bundle install` to install missing gems.
Could not find rake-0.9.2.2 in any of the sources
Run `bundle install` to install missing gems.
Errors running test:units, test:functionals, test:integration!
$ ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
$ rails -v
Rails 3.1.6
$ more .rvmrc
rvm ruby-1.9.3-p194@...
$ rake db:rollback
== AddAllLocationsToAlert: reverting =========================================
-- remove_column(...
-> 0.0320s
== AddAllLocationsToAlert: reverted (0.0321s) ================================
| 0 | [
2,
110,
52,
477,
21009,
8,
387,
9,
518,
9,
135,
9,
135,
19,
186,
16,
14,
2662,
800,
3726,
3726,
48,
25,
40,
4210,
53,
9,
31,
22,
79,
1017,
48,
7019,
76,
31,
485,
21009,
20,
107,
4894,
47,
52,
76,
31,
22985,
9,
31,
22,
79... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Create new HTML5 video element throught JavaScript
===
I am trying to create a new HTML5 video elemnt entirely throught JS. So I try to do it the same way I create a new image, like: `obj = new Image()` I write `obj = new HTMLVideoElement()`. However this doesn't work. I get the runtime error: **Object doesn't support this action**.
What is wrong? Thanks. | 0 | [
2,
1600,
78,
13,
15895,
264,
763,
4520,
120,
38,
8247,
8741,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
78,
13,
15895,
264,
763,
931,
1503,
2877,
2894,
120,
38,
487,
18,
9,
86,
31,
1131,
20,
107,
32,
14,
205,
161,
31,
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... |
How to straighten a rotated rectangle area of an image using opencv in python?
===
I draw a picture to show what I want. I has the information of the rectangles in the image, width, height, center point and rotation degree. Now, I want to write a script to cut them out and save them as image, but straighten them. I am using opencv python, how can I do this?
Thank you very much for showing me some code, you know, examples of opencv in python is hard to find.
![enter image description here][2]
[1]: http://opencv.willowgarage.com/documentation/cpp/geometric_image_transformations.html?highlight=rotationmatrix#cv-getrotationmatrix2d
[2]: http://i.stack.imgur.com/6Xinc.jpg | 0 | [
2,
184,
20,
19298,
21,
24107,
27181,
217,
16,
40,
1961,
568,
368,
12732,
19,
20059,
60,
800,
3726,
3726,
31,
2003,
21,
2151,
20,
298,
98,
31,
259,
9,
31,
63,
14,
676,
16,
14,
27181,
18,
19,
14,
1961,
15,
9456,
15,
2947,
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... |
Sessions_End and StateServer Sessions mode
===
As we all know , `Session_End` event does not fire when session mode is set to `StateServer`.
But here is a problem ,that in a project I use this event to delete a record that assigned to the current logged in user that its sessions expired
Now I am looking for another way to replace it with this event.
Is there anyone out there to give me an idea about this stuff ?!!
thanks
Ali Foroughi
| 0 | [
2,
5763,
1,
2451,
17,
202,
106,
2304,
5763,
3740,
800,
3726,
3726,
28,
95,
65,
143,
13,
15,
13,
1,
7202,
5991,
1,
2451,
1,
807,
630,
52,
535,
76,
3723,
3740,
25,
309,
20,
13,
1,
3859,
10321,
106,
1,
9,
47,
235,
25,
21,
144... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
script files clashing with each other
===
I am using custom scroll and accordion in a page but when I put both plugin's script in the page thn either one of tat is not working. I tried to merge both but still it is not working.
Here is my script for each plugin
**For custom scroll**
<script type="text/javascript" src="js/jquery.min1.7.2.js"></script>
<script type="text/javascript" src="js/jquery.tinyscrollbar.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#scrollbar1').tinyscrollbar();
$('#maintab').tabs();
});
</script>
For accordion
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/accordion.js"></script>
<script type="text/javascript">
jQuery().ready(function(){
// applying the settings
jQuery('.theMenu').Accordion({
active: 'h3.selected',
header: 'h3.head',
alwaysOpen: false,
animated: true,
showSpeed: 400,
hideSpeed: 800
});
});
</script>
| 0 | [
2,
3884,
6488,
13870,
68,
29,
206,
89,
800,
3726,
3726,
31,
589,
568,
5816,
12159,
17,
20753,
19,
21,
2478,
47,
76,
31,
442,
156,
10922,
108,
22,
18,
3884,
19,
14,
2478,
13,
96,
103,
694,
53,
16,
8537,
25,
52,
638,
9,
31,
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... |
using between in the middle of where clause based on an if condition
===
Select * from MyTable
where myField = 1
And myImportantField ???
...
i have following parameters :
@DoCalculateValues bit,
@FromValue int,
@ToValue int
I NEED THIS
==
if @DoCalculateValues = 1 then
check if myImportantField is between @FromValue and @ToValue
else
ignore values, something like "And myImportantValue = myImportantValue"
please consider that this is all happening in the middle of a "... WHERE ... AND ..." clause
== | 0 | [
2,
568,
128,
19,
14,
772,
16,
113,
9040,
432,
27,
40,
100,
2874,
800,
3726,
3726,
5407,
1637,
37,
51,
5924,
113,
51,
1109,
800,
137,
17,
51,
25716,
1109,
13,
60,
60,
60,
13,
9,
9,
9,
31,
57,
249,
12905,
13,
45,
13,
1,
537,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In-memory scanning of files, ideally using ClamAV
===
We are implementing an enterprise application with a heavy focus on security, which includes the uploading of files. These files need to be virus scanned, but also need to be encrypted.
The current process is that the files are uploaded and then streamed - through an encrypter - to a temporary storage area on disk. The virus-scanner is then called and the files are decrypted on the fly, streamed through to ClamAV via a socket - and then the virus-status returned from the socket.
The problem is that ClamAV seems to write to a temporary area on disk before scanning, which means unencrypted, potentially-sensitive data on the file-system.
Does anyone know how to fix this? Possibly by configuring ClamAV to scan in-memory only (my Google search yielded no results), or maybe some alternative suggestions? | 0 | [
2,
19,
8,
790,
5171,
93,
15863,
16,
6488,
15,
5628,
102,
568,
15786,
5214,
800,
3726,
3726,
95,
50,
17333,
40,
6002,
3010,
29,
21,
1278,
1776,
27,
1221,
15,
56,
1103,
14,
71,
16866,
16,
6488,
9,
158,
6488,
376,
20,
44,
6231,
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... |
Preventing the use of certain dlls or service code in a given location
===
Is there a simple way (using code contracts perhaps?) to prevent the use of certainl dlls/namespace/assemblies within a given portion of an application?
My use case is that I'd like a warning mechanism when I try to use a company wide service layer within my controllers.
Instead we should have a layer beween that service layer and our controllers (the service layer is changing and we'll be switching it out bit by bit for our new SDK).
What are some ways of doing this? Can I simply specify somethig in a code contract to warn of the use of a given assembly in the controller methods? | 0 | [
2,
11520,
14,
275,
16,
1200,
13,
43,
211,
18,
54,
365,
1797,
19,
21,
504,
1474,
800,
3726,
3726,
25,
80,
21,
1935,
161,
13,
5,
12655,
1797,
8712,
1774,
60,
6,
20,
2501,
14,
275,
16,
1200,
255,
13,
43,
211,
18,
118,
7259,
558... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
iOS 6 - 3G Fallback when Gateway on Wifi is offline
===
I noticed on iOS6 Beta 2 and Beta 3 that though I am connected to a Router that definitely is offline my iPhone sends and receives data over 3G. I cross checked with some whatsmyip service that this is actually the case.
As far I know on iOS < 6 when connected to a wifi you were not able to use the 3G connection. Can anyone proof me right or wrong please?
Thanks! | 3 | [
2,
13,
7760,
400,
13,
8,
203,
263,
1080,
1958,
76,
12171,
27,
4807,
1707,
25,
168,
1143,
800,
3726,
3726,
31,
2711,
27,
13,
7760,
379,
8434,
172,
17,
8434,
203,
30,
362,
31,
589,
2587,
20,
21,
858,
139,
30,
4939,
25,
168,
1143... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
text formatting is not showing in sent mail using asp.net
===
net for sending email. The body of email is a
dynamically created web page using HttpWebRequest.create(). This
page is well formatted but not showing that formatting (bold effect,
color of font,size of font) when i opened that mail in my account.
SO my question is it a normal behavior of this mechanism or is there
any way to receive well formatted email from asp.net ? | 0 | [
2,
1854,
2595,
1203,
25,
52,
3187,
19,
795,
4216,
568,
28,
306,
9,
2328,
800,
3726,
3726,
4275,
26,
4907,
8517,
9,
14,
358,
16,
8517,
25,
21,
7782,
1326,
679,
2741,
2478,
568,
7775,
458,
3692,
10351,
9,
6037,
1373,
5,
6,
9,
48... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to read hdf5 boolean enum created by h5py in C
===
I've created an array with 3 doubles and one boolen using `numpy` and written them to file using `h5py`:
import numpy as np
import h5py
data = np.zeros(10, dtype=[("THETA",np.double),("PHI",np.double),("PSI",np. double),("FLAG",np.bool)])
with h5py.File("testout.h5") as f:
f.create_dataset("data", data=data)
`h5py` creates an enum type for the boolean field:
HDF5 "testout.h5" {
GROUP "/" {
DATASET "data" {
DATATYPE H5T_COMPOUND {
H5T_IEEE_F64LE "THETA";
H5T_IEEE_F64LE "PHI";
H5T_IEEE_F64LE "PSI";
H5T_ENUM {
H5T_STD_I8LE;
"FALSE" 0;
"TRUE" 1;
} "FLAG";
}
DATASPACE SIMPLE { ( 10 ) / ( 10 ) }
}
}
}
now I need to read this file using C, and things get complicated:
typedef enum {
false = 0;
true
} bool;
typedef struct {
double THETA, PHI, PSI;
bool FLAG;
} pointing_t;
I do not understand how to define a type that has an enum:
hid_t memtype = H5Tcreate (H5T_COMPOUND, sizeof(pointing_t));
H5Tinsert (memtype, "THETA", HOFFSET (pointing_t, THETA), H5T_NATIVE_DOUBLE);
H5Tinsert (memtype, "PHI", HOFFSET (pointing_t, PHI), H5T_NATIVE_DOUBLE);
H5Tinsert (memtype, "PSI", HOFFSET (pointing_t, PSI), H5T_NATIVE_DOUBLE);
# this should be an ENUM!!
H5Tinsert (memtype, "FLAG", HOFFSET (pointing_t, FLAG), H5T_NATIVE_DOUBLE);
I pasted a complete "not working" example on gist that tries to read the hdf5 files created with the previous python snippet:
[http://gist.github.com/3168909][1]
anybody has suggestions?
thanks!
[1]: http://gist.github.com/3168909 | 0 | [
2,
184,
20,
1302,
8590,
410,
264,
9827,
413,
210,
1957,
723,
679,
34,
746,
264,
6448,
19,
272,
800,
3726,
3726,
31,
22,
195,
679,
40,
7718,
29,
203,
7784,
17,
53,
9827,
2284,
568,
13,
1,
6336,
6448,
1,
17,
642,
105,
20,
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 i create in Objective C a macro for execute many modules in runtime
===
in this source code is link for module FirstDetailViewController
FirstDetailViewController *newDetailViewController = [[FirstDetailViewController alloc] initWithNibName:@"FirstDetailView" bundle:nil];
detailViewController = newDetailViewController;
i want that a string
module = [[NSString] alloc] initWithString:@"SecondDetailViewController"];
i want convert string module to code up for alter in runtime
module *newDetailViewController = [[module alloc] initWithNibName:module bundle:nil];
detailViewController = newDetailViewController;
where module is many names
module = [[NSString] alloc] initWithString:@"ClientDetailViewController"];
...;
module = [[NSString] alloc] initWithString:@"FriendDetailViewController"];
...;
module = [[NSString] alloc] initWithString:@"FishDetailViewController"];
...;
how i use variable module for implement this?
Dario | 0 | [
2,
184,
31,
1600,
19,
7038,
272,
21,
9069,
26,
15644,
151,
17113,
19,
485,
891,
800,
3726,
3726,
19,
48,
1267,
1797,
25,
3508,
26,
12613,
64,
546,
8682,
4725,
12898,
1252,
64,
546,
8682,
4725,
12898,
1252,
1637,
2681,
546,
8682,
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... |
CUDA Branching Optimization
===
I've got a program that uses a few CUDA kernels and this one is taking 50-100ms to run while the others take 0-5ms. I expect this has something to do with all the branching, but I'm not really sure how to reduce it. I'm compiling for a compute capability 2.1 device. If someone could point me in the right direction that would be great.
// chosen using occupancy spreadsheet
#define SCORE_THREADS_PER_BLOCK 448
__device__ double ScoringMatrixVal(double *scoring_matrix, size_t pitch, unsigned int row, unsigned int column) {
return *((double*)((char*) scoring_matrix + row * pitch) + column);
}
__global__ void ScoreBindingSites(char *input_sequence, unsigned long is_length, unsigned int *rvd_sequence, unsigned int rs_len, double cutoff, unsigned int rvd_num, double *scoring_matrix, size_t sm_pitch, unsigned char *results) {
int block_seq_index = SCORE_THREADS_PER_BLOCK * (blockIdx.y * gridDim.x + blockIdx.x);
int thread_id = (blockDim.x * threadIdx.y) + threadIdx.x;
int seq_index = block_seq_index + thread_id;
if (seq_index < 1 || seq_index >= is_length || seq_index + rs_len >= is_length - 1) return;
if (input_sequence[seq_index - 1] == 'T' || input_sequence[seq_index - 1] == 't') {
double thread_result = 0;
for (int i = 0; i < rs_len; i++) {
int rvd_index = i;
int sm_col = 4;
char base = input_sequence[seq_index + i];
if (base == 'A' || base == 'a')
sm_col = 0;
if (base == 'C' || base == 'c')
sm_col = 1;
if (base == 'G' || base == 'g')
sm_col = 2;
if (base == 'T' || base == 't')
sm_col = 3;
thread_result += ScoringMatrixVal(scoring_matrix, sm_pitch, rvd_sequence[rvd_index], sm_col);
}
results[seq_index] |= (thread_result < cutoff ? 1UL : 0UL) << (2 * rvd_num);
}
if (input_sequence[seq_index + rs_len] == 'A' || input_sequence[seq_index + rs_len] == 'a') {
double thread_result = 0;
for (int i = 0; i < rs_len; i++) {
int rvd_index = rs_len - i - 1;
int sm_col = 4;
char base = input_sequence[seq_index + i];
if (base == 'A' || base == 'a')
sm_col = 3;
if (base == 'C' || base == 'c')
sm_col = 2;
if (base == 'G' || base == 'g')
sm_col = 1;
if (base == 'T' || base == 't')
sm_col = 0;
thread_result += ScoringMatrixVal(scoring_matrix, sm_pitch, rvd_sequence[rvd_index], sm_col);
}
results[seq_index] |= (thread_result < cutoff ? 1UL : 0UL) << (2 * rvd_num + 1);
}
}
The full source can be found [here][1] if that would be helpful.
[1]: https://github.com/njbooher/boglab_tfcount/blob/master/tfcount_cuda.cu | 0 | [
2,
272,
5729,
1686,
68,
21597,
800,
3726,
3726,
31,
22,
195,
330,
21,
625,
30,
2027,
21,
310,
272,
5729,
17007,
18,
17,
48,
53,
25,
741,
1222,
8,
4031,
79,
18,
20,
485,
133,
14,
654,
247,
713,
8,
264,
79,
18,
9,
31,
4186,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Need help on this particular syntax
===
I found this on Git hub, but I do not know some of that is going on. Can anyone please explain?
- (id)initWithTitle:(NSString *)title message:(NSString *)message completionBlock:(void (^)(NSUInteger buttonIndex))block cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... {
In particular what is this (void (^) thing, and how is that 3 dots used at the end?
Thanks | 0 | [
2,
376,
448,
27,
48,
1498,
22649,
800,
3726,
3726,
31,
216,
48,
27,
13,
10404,
5814,
15,
47,
31,
107,
52,
143,
109,
16,
30,
25,
228,
27,
9,
92,
1276,
2247,
3271,
60,
13,
8,
13,
5,
1340,
6,
108,
242,
1410,
22235,
45,
5,
217... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UTF Encoding ID list?
===
in SQL Devleoper, I tracked down the encoding ID for some pages, to verify something. I was told that the number 2 represents UTF-8. I cannot find a table of UTF ID codes. Am I crazy? So 1 must be UTF-2? thanks | 0 | [
2,
287,
11720,
19608,
4924,
968,
60,
800,
3726,
3726,
19,
4444,
255,
9664,
413,
9477,
15,
31,
15535,
125,
14,
19608,
4924,
26,
109,
4434,
15,
20,
21012,
301,
9,
31,
23,
470,
30,
14,
234,
172,
4719,
287,
11720,
8,
457,
9,
31,
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... |
Visual C++ must return a valur error
===
I am working on a multiplatform project, and some platforms have disabled features, and in the interface for those features, a common thing I do is something like this:
bool Foo::bar() const {
// disabled
abort();
}
GCC/LLVM do not require that non-void functions return values (they just give a warning), and in this case, where I call abort(), they are smart enough to not even give a warning (since the function will never return anyway).
Is there a way (compile flag?) to make Visual C++ 2010 behave the same way, so I don't keep breaking the windows build? I know I could always return the value after the abort, but when working on the other platforms I usually forget about that, and the behavior of not giving an error seems more appropriate.
| 0 | [
2,
3458,
272,
20512,
491,
788,
21,
3347,
911,
7019,
800,
3726,
3726,
31,
589,
638,
27,
21,
1889,
27035,
669,
15,
17,
109,
6843,
57,
10154,
967,
15,
17,
19,
14,
6573,
26,
273,
967,
15,
21,
757,
584,
31,
107,
25,
301,
101,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Docsplit works fine in command line but ignores code in Ruby script?
===
This is the strangest issue I've ever seen.
I'm using Docsplit to split a multi-page pdf into a bunch of single-page Jpegs. When I use the command line input:
docsplit images scan.pdf --format jpg
Everything works fine. However, in my Ruby script, inputting:
path = "<path_to>/scan.pdf"
Docsplit.extract_images(path, :format => [:jpg])
Does absolutely nothing. It's like Ruby isn't even reading my code. Any pointers? | 0 | [
2,
9765,
25603,
693,
1123,
19,
1202,
293,
47,
7174,
18,
1797,
19,
10811,
3884,
60,
800,
3726,
3726,
48,
25,
14,
2578,
384,
1513,
31,
22,
195,
462,
541,
9,
31,
22,
79,
568,
9765,
25603,
20,
2132,
21,
1889,
8,
6486,
13,
11124,
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... |
Qt 4.7.4 C++ QScrollBar -- Use QStyle to Set Size of Slider
===
I have tried several things to get QScrollBar's slider to change size based on the number of singleSteps(). I would like the stepSize() to be ~1.
The following link has got me the closest, but I can't seem to get it to work.
http://www.qtcentre.org/threads/2133-QScrollBar-custom-slider-s-size
What do I need to do to get the slider size to change? I would post code, however like I said above I have tried many different attempts, I would like to clean off my slate and just see a nice clean example of how to change the slider size. | 0 | [
2,
2593,
38,
268,
9,
465,
9,
300,
272,
20512,
2593,
3862,
8694,
1850,
13,
8,
8,
275,
2593,
4381,
20,
309,
1072,
16,
3295,
106,
800,
3726,
3726,
31,
57,
794,
238,
564,
20,
164,
2593,
3862,
8694,
1850,
22,
18,
3295,
106,
20,
753... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
unusual sql error
===
so i've been stuck on this sql error for some time.
this is the SQL line i'm using:
INSERT INTO images (image_name, orientation, restored, commercial, automotive, bespoke, before, after, date_added)
VALUES ('image4-after.jpg', 'portrait', '1', '1', '1', '1', '24', '5', '2012-07-08')
getting the error message:
> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use
> near 'before, after, date_added) VALUES ('image4-after.jpg',
> 'portrait', '1', '1', '1'' at line 1
can anybody please tell me what i've done wrong?
thanks | 0 | [
2,
4706,
4444,
255,
7019,
800,
3726,
3726,
86,
31,
22,
195,
74,
4549,
27,
48,
4444,
255,
7019,
26,
109,
85,
9,
48,
25,
14,
4444,
255,
293,
31,
22,
79,
568,
45,
14692,
77,
3502,
13,
5,
22039,
1,
7259,
15,
10245,
15,
4617,
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... |
GPU based datastructrue/ algorithm for task
===
I have a list of two-word sequences as shown below:
word1 word2
word4 word7
word5 word2
word5 word6
word7 word2
...
Now, for a given word, say wi, I need to find |{wi-1: wi-1wi exists in the list}|. For example, for word2, the answer will be 3 as word1, word5, and word7 appear before word2. 2 questions:
1) is there a datastructure in CUDA that helps me organize the list such that i can find the answer to the above really fast.
2) Is there an algorithm that can help me find the answer ?
| 0 | [
2,
489,
4201,
432,
1054,
10346,
1820,
62,
118,
9083,
26,
3005,
800,
3726,
3726,
31,
57,
21,
968,
16,
81,
8,
9587,
11173,
28,
1721,
1021,
45,
833,
165,
833,
135,
833,
300,
833,
465,
833,
264,
833,
135,
833,
264,
833,
379,
833,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Programmatically saving image to Django ImageField 2
===
I read many answers and tried all of this in the shell, but does not want save my local image correctly, he truncate files. When image size is 400kb, he create file in media dir with size 10-30kb. I don't know why. For example i have image with path d:/1.png. I tried
from django.core.files import File
fileObject=File(open("d:/1.png"))
object.image.save('1.png',fileObject,True)
fileObject.size show correct size of image, but object.image.size is not correct and file, what he save not full.
Also i tried
from django.core.files.temp import NamedTemporaryFile
temp = NamedTemporaryFile()#with delete=True TypeError: __init__() got an unexpected keywork argument 'delete'
temp.write(open('d:/1.png').read())
temp.flush()
f=File(temp)#f.size not correct
object.image.save('1.png',f,True)
and object.image.size and file not correct, file not full.
I tried using StringIO, but this not work too. I don't know what try to save this images correctly.
Please, help. | 0 | [
2,
625,
6732,
1326,
7599,
1961,
20,
3857,
14541,
1961,
1109,
172,
800,
3726,
3726,
31,
1302,
151,
6709,
17,
794,
65,
16,
48,
19,
14,
3593,
15,
47,
630,
52,
259,
2079,
51,
375,
1961,
12044,
15,
24,
22328,
62,
6488,
9,
76,
1961,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MonoTouch.Dialog: Setting Disclosure Indicator Clear in OwnerDrawnElement
===
I have a custom `OwnerDrawnElement` where I override the GetCell to add a Disclosure Indicator, but it is not transparent. How do I make the DisclosureIndicator `transparent`?
public override UITableViewCell GetCell(UITableView tv)
{
var cell = base.GetCell(tv);
cell.Accessory = UITableViewCellAccessory.DisclosureIndicator;
return cell;
}
Result:
![enter image description here][1]
[1]: http://i.stack.imgur.com/C52oU.jpg | 0 | [
2,
4129,
15725,
9,
4286,
5567,
45,
2697,
21449,
13310,
1207,
19,
2410,
19950,
27567,
800,
3726,
3726,
31,
57,
21,
5816,
13,
1,
10705,
19950,
27567,
1,
113,
31,
84,
11891,
14,
164,
9725,
20,
3547,
21,
21449,
13310,
15,
47,
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... |
Object not recognized in Rails controller
===
I have this code in one of my controllers to get access to eventful.
eventful = Eventful::API.new('my_key_here')
However, I get the following error when I refresh my page
uninitialized constant LocationsController::Eventful
I installed the gem version 2.2.1 as directed through http://api.eventful.com/libs and my gemfile contains the line
gem 'eventfulapi', '2.2.1'
I am trying to recreate the example here: http://api.eventful.com/libs/ruby/doc/index.html
I can get it to work in a separate ruby script (e.x. running 'ruby a.rb' through command line) which leads me to thinking it's totally possible. I just can't get it to work in a controller to feed my application. | 0 | [
2,
3095,
52,
2124,
19,
2240,
18,
9919,
800,
3726,
3726,
31,
57,
48,
1797,
19,
53,
16,
51,
9919,
18,
20,
164,
1381,
20,
807,
1566,
9,
807,
1566,
800,
807,
1566,
45,
45,
2552,
49,
9,
2681,
5,
22,
915,
1,
4237,
1,
6836,
22,
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... |
PHP: mysql_num_rows - conditional
===
Am trying to calculate the number of rows in a table, depending on a certain condition.
So, I did manage to write a code that would function as required, but .. it's a bit too long. So am wondering if there is any easier way to achieve such function.
Code:
// Comments
$sql_total_comments = mysql_query("SELECT * FROM comments");
$sql_pending_comments = mysql_query("SELECT * FROM comments WHERE comment_status = '0'");
$sql_approved_comments = mysql_query("SELECT * FROM comments WHERE comment_status = '1'");
$sql_declined_comments = mysql_query("SELECT * FROM comments WHERE comment_status = '2'");
$total_comments_num = mysql_num_rows($sql_total_comments);
$pending_comments_num = mysql_num_rows($sql_pending_comments);
$approved_comments_num = mysql_num_rows($sql_approved_comments);
$declined_comments_num = mysql_num_rows($sql_declined_comments);
Best regards and thanks in advance. | 0 | [
2,
13,
26120,
45,
51,
18,
22402,
1,
6336,
1,
5417,
18,
13,
8,
21206,
800,
3726,
3726,
589,
749,
20,
18469,
14,
234,
16,
11295,
19,
21,
859,
15,
4758,
27,
21,
1200,
2874,
9,
86,
15,
31,
144,
4705,
20,
2757,
21,
1797,
30,
83,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 new page in html?
===
I am a noob at HTML.
I have a folder on my desktop with page1.html and page2.html.
This is an example of page1
<html>
<h1> Welcome
<title>Website
</h1>
<body>
<p> to page 2
</body>
<a href="page2.html" target="_self">Link</a>
</html>
Whenever I open page1.html, It just says "Welcome", and "to page 2". There is no hyperlink. What am I doing wrong?
| 0 | [
2,
184,
20,
233,
78,
2478,
19,
13,
15895,
60,
800,
3726,
3726,
31,
589,
21,
90,
4995,
35,
13,
15895,
9,
31,
57,
21,
19294,
27,
51,
17404,
29,
2478,
165,
9,
15895,
17,
2478,
135,
9,
15895,
9,
48,
25,
40,
823,
16,
2478,
165,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
unit test static constructor w/ different config values
===
I have a class with a static constructor which I use to read the app.config values. How do I unit test the class with different configuration values. I'm thinking of running each test in different app domain so I can have static constructor executed for each test - but I have two problems here: <br/>
1. I do not know how to run each test run in separate app domain and <br/>
2. how do I change configuration settings at run time?
Can someone please help me with this? Or anyone has a better solution? Thanks. | 0 | [
2,
1237,
1289,
12038,
6960,
248,
619,
118,
421,
13,
14093,
2816,
4070,
800,
3726,
3726,
31,
57,
21,
718,
29,
21,
12038,
6960,
248,
56,
31,
275,
20,
1302,
14,
4865,
9,
14093,
2816,
4070,
9,
184,
107,
31,
1237,
1289,
14,
718,
29,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Looping though JSON data and displaying it in a DIV
===
I have a page with some checkboxes and a submit button. I use AJAX to post the checkbox values to a PHP script, calc.php, run some calculations with the data and assign the result to a PHP session variable. I have another PHP script, json.php, that takes that session data and encodes it as JSON for the jquery to display in the div. My problem is I allow the user to set the amount of data sets they are going to submit, subnumber, and my display loop gets out of sync when the user changes the number of sets.
For example, if they start with 3 data sets, they submit them one by one by pressing #button. After the last set, if (count == max) runs and. Now they can do another calculation and change the number of data sets if they wish. If they change it to say 2, output goes to four instead of reseting to 1 and emptying #log.
$("#button").click(function() {
$.ajax({
type: "POST",
url: "calc.php",
data: $("form#checkboxes").serialize(),
success: function(data) {
if(document.getElementById('calc').checked) {
var max = checkboxes.subnumber.value;
var stop = Number(max) + 1;
count++;
output++;
$.getJSON('json.php', function(data) {
$.each(data, function(key, val) {
$('#log').append(output);
$('#log').append("</br>");
})
})
if (count == max){
count = 0;
$("#results").load('results.php')
}
if(output == stop) {
$("#log").empty();
output = 1;
}
}
})
}
I know it's something simple, but I have been trying to fix it for two hours now and can't figure out the problem. Everything else works perfectly, it's just the output counter that isn't done correctly. | 0 | [
2,
5293,
68,
362,
487,
528,
1054,
17,
17418,
32,
19,
21,
13,
12916,
800,
3726,
3726,
31,
57,
21,
2478,
29,
109,
2631,
5309,
160,
17,
21,
12298,
5167,
9,
31,
275,
20624,
20,
678,
14,
2631,
5309,
4070,
20,
21,
13,
26120,
3884,
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... |
Formula Editor in Vb.NET just like Crystal reports
===
I am working on a Financial system where I have to give a capability to user to generate his own result using some predefined fields from database and performing mathematical calculations on it.
For instance, I have to calculate the Gratuity amount which equals to 10% of Basic + 15% of VDA. This formula varies from time to time and adjustable depending on certain parameters.
The entire module can be seen similar to the formula editor in crystal reports where one can select the fields from the top and add mathematical operations on it in the editor and once you are done with the formula, you have your result.
Initially, I'll have only +,-,*,/,(,),% mathematical operations.
Any idea how to get around it and how to get the mathematical result at run time.
| 0 | [
2,
3729,
1835,
19,
13,
20468,
9,
2328,
114,
101,
4282,
2813,
800,
3726,
3726,
31,
589,
638,
27,
21,
1553,
329,
113,
31,
57,
20,
590,
21,
11480,
20,
4155,
20,
7920,
33,
258,
829,
568,
109,
782,
13439,
2861,
37,
6018,
17,
2955,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 database design for image options relationships
===
I have two tables, **images** and **image_data** and here is an example of my image_data table.
image_id | slide_id | language_id | type |
101 | 1 | 1 | CQ |
101 | 2 | NULL | NULL |
56 | 5 | 1 | TN |
56 | NULL | 2 | NULL |
So basically, each image will have different options and I am wondering the best way to implement this.. because I have a feeling I am doing this the wrong way.
With this, I can run a query to use `GROUP_CONCAT()` to turn values in multiple rows into a single concatenated string.
image_id | slide_id | language_id | type |
101 | 1,2 | 1 | CQ |
56 | 5 | 1,2 | TN |
Which is fine, but the problem with the way I am doing it right now is..it seems like it will be really difficult to update the rows with my backend system.
![enter image description here][1]
[1]: http://i.stack.imgur.com/gdl7I.png
So with my query, I can determine which ones to check based on the database since I have it all in one row since I concatenated it. But now it's like.. when I go to click "Save" and update the rows, which one do I update? there can be more than 1 row of the same image id, so how would I update the right one, and so on.
If I checked off another slide for **image #101** then I would need to create a new row for it. If after that I wanted to add another language_id to it, then I would need to make sure to not add a new row since one exists with a NULL value, and to just replace the NULL value with the new language id.
It just seems really complicated and there's so many factors, that using this method is really hard to program.
What would be the best way to do this? Any suggestions are really appreciated.
Thanks! | 0 | [
2,
51,
18,
22402,
6018,
704,
26,
1961,
6368,
5833,
800,
3726,
3726,
31,
57,
81,
7484,
15,
13,
1409,
22039,
18,
1409,
17,
13,
1409,
22039,
1,
18768,
1409,
17,
235,
25,
40,
823,
16,
51,
1961,
1,
18768,
859,
9,
1961,
1,
1340,
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... |
extract text from xml documents in python
===
This is the sample xml document :
<bookstore>
<book category="COOKING">
<title lang="english">Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>300.00</price>
</book>
<book category="CHILDREN">
<title lang="english">Harry Potter</title>
<author>J K. Rowling </author>
<year>2005</year>
<price>625.00</price>
</book>
</bookstore>
I want to extract the text without specifying the elements how can i do this , because i have 10 such documents. I want so because my problem is that user is entering some word which I don't know , it has to be searched in all of the 10 xml documents in their respective text portions. For this to happen I should know where the text lies without knowing about the element. One more thing that all these documents are different.
Please Help!! | 0 | [
2,
10962,
1854,
37,
23504,
4374,
19,
20059,
800,
3726,
3726,
48,
25,
14,
5717,
23504,
4492,
13,
45,
13,
1,
5199,
16828,
1,
13,
1,
5199,
3230,
3726,
7,
20840,
68,
7,
1,
13,
1,
22235,
4544,
3726,
7,
6024,
7,
1,
12068,
1185,
1186... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GridView Access Data Source
===
I have a GridView control that I would like to display the rows of a table (cartTable), based on the field 'orderNo' which is stored in a integer 'intOrderNo', how can i configure my data source to do as such? | 0 | [
2,
7354,
4725,
1381,
1054,
1267,
800,
3726,
3726,
31,
57,
21,
7354,
4725,
569,
30,
31,
83,
101,
20,
3042,
14,
11295,
16,
21,
859,
13,
5,
1367,
38,
5924,
6,
15,
432,
27,
14,
575,
13,
22,
7861,
251,
22,
56,
25,
8214,
19,
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... |
Method after animation that isn't timed?
===
I have a loading animation while my app is downloading and parsing some XML data.
This is my how I'm doing it right now:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[self performSelector:@selector(hidealert) withObject:nil afterDelay:3];
}
- (void) tapme{
[self.alertView.progressBar setProgress:0 animated:NO];
[self.alertView show];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(startalert) name:@"DoneLoadingInitialView" object:nil];
}
- (void) startalert {
[self.alertView.progressBar setProgress:1 animated:YES];
}
- (void) hidealert {
[self.alertView hide];
}
Right now my animation finishes once all the data is downloaded, but I'm hiding it on a timed basis. Problem is if someone is using something like a 3G or EDGE Connection, it takes longer the the 3 seconds I allotted to hide the animation. How would I make
> [self.alertView hide];
finish right after
> [self.alertView.progressBar setProgress:1 animated:YES];
The method performs, and the animation just makes it visual. So I can't put it right after it, as it hides it immideatly.
Thanks! | 0 | [
2,
2109,
75,
6236,
30,
2532,
22,
38,
85,
43,
60,
800,
3726,
3726,
31,
57,
21,
12797,
6236,
133,
51,
4865,
25,
7121,
68,
17,
2017,
18,
68,
109,
23504,
1054,
9,
48,
25,
51,
184,
31,
22,
79,
845,
32,
193,
130,
45,
13,
8,
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... |
sandwich pattern in javascript code
===
Apologize if the title of the question is misleading. Actually I am looking for the javascript equivalent of the following python code:
<pre><code>
## python code
def call_with_context(fn, *args):
## code to create context, e.g. profiling, db.connect, or drawing context store stack
fn(*args);
## code to close context
</code></pre>
This implements the similiar functionality as the "with statement" in python, which implements the aspect-oriented paradigm.
So my question is what is the javascript way of doing such things? I have seen some code using Array.prototype.slice(arguments, 1) to do so, but I don't know if this is a common pattern in javascript, or there are better patterns supported in javascript (e.g. by closure) so ppl don't really do that. Pls also correct me if I am using the wrong keywords, because I really dont know how to refer to my problem with a better name than sandwich. | 0 | [
2,
11484,
3732,
19,
8247,
8741,
1797,
800,
3726,
3726,
12059,
100,
14,
581,
16,
14,
1301,
25,
23938,
9,
1121,
31,
589,
699,
26,
14,
8247,
8741,
4602,
16,
14,
249,
20059,
1797,
45,
13,
1,
3515,
1,
9375,
1,
6926,
5910,
20059,
1797... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Calculating the degree of a circle
===
Say I have an arc with a maximum degrees of 60, from 0 degrees to 60 degrees, and a maximum value, 16. I want to find out the degrees of a value in relation to the maximum value. I really hope that made sense, it's quite hard to explain.
For example, I have a maximum degrees of 80 and a maximum value of 40. The degrees of the value I am trying to find is 35, so the degrees should be 70 since 40:80 is 2, and 35*2 is 70.
The part I am puzzled about is finding the degrees of an irrational ratio such as 35:78. | 2 | [
2,
22937,
14,
1168,
16,
21,
2775,
800,
3726,
3726,
395,
31,
57,
40,
4686,
29,
21,
2979,
4442,
16,
2083,
15,
37,
713,
4442,
20,
2083,
4442,
15,
17,
21,
2979,
1923,
15,
347,
9,
31,
259,
20,
477,
70,
14,
4442,
16,
21,
1923,
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... |
Entity Framework, MVVM, and Calculations Classes
===
I'm working on a database application that manages industry-specific inputs and then runs that information through somewhat complicated calculations, lookups, etc. to return a series of other values and a go/no-go conclusion.
I've decided to use Entity Framework (code first for provider independence) and WPF (MVVM pattern). I'm using the POCO entities as my data model and the view model is handling the usuals like basic data / business rule validation.
It seems EF + WPF/MVVM are great at displaying and validating input and getting it into the database for querying for your typical business application like a products, customers, orders setup. But it's not at all clear where to plug in a "calculations layer". Between the view models and the data models (my POCOs), things are already feeling a bit bloated, and now I'm facing adding another layer very much like the other two.
Perhaps the best way to approach this is to make the calculations layer a sort of meta-view model and push as much of the validations, change notification, etc. into them and run with lighter actual view models.
Anyone run into a situation like this? | 0 | [
2,
9252,
6596,
15,
17967,
20147,
15,
17,
19186,
2684,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
6018,
3010,
30,
9118,
1230,
8,
9219,
6367,
18,
17,
94,
1461,
30,
676,
120,
4131,
8343,
19186,
15,
361,
15699,
15,
2722,
9,
20,
788,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Most efficient way for reading IMDB movies list
===
I am reading IMDB movies listing from a text file on my harddrive (originally available from IMDB site at ftp://ftp.fu-berlin.de/pub/misc/movies/database/movies.list.gz).It takes around 5 minutes on my machine (basic info: Win7 x64bit, 16GB RAM, 500 GB SATA Hardisk 7200 RPM) to read this file line by line using code below. I have two questions
1. Is there any way I can optimize code to improve the read time?
2. Data access don't need to be sequential as I won't mind reading data from top to bottom / bottom to top or any order for that matter as long as it read one line at a time. I am wondering is there a way to read in multiple directions to improve the read time?
string file = @"D:\movies.list";
FileStream fs = new FileStream(file, FileMode.Open, FileAccess.Read, FileShare.None, 8, FileOptions.None);
using (StreamReader sr = new StreamReader(file))
{
while (sr.Peek() >= 0)
{
Console.WriteLine(sr.ReadLine());
}
} | 0 | [
2,
127,
8243,
161,
26,
1876,
797,
9007,
4795,
968,
800,
3726,
3726,
31,
589,
1876,
797,
9007,
4795,
9554,
37,
21,
1854,
3893,
27,
51,
552,
14573,
13,
5,
14475,
904,
37,
797,
9007,
689,
35,
1187,
306,
6903,
3072,
306,
9,
4096,
8,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to return response from webservice in form of alert
===
I have made a web service and clients will call its methods.Suppose one method takes four parameters and i want to check that if any one of these is empty i want to send a response back to the client and i want to send it like an alerts so client knows what argument is empty.I can not force client to give all parameters accurate.Now tell is this possible if yes please help.
Thanks.
[WebMethod]
Public void Method1(string str1,string str2,string str3,string str4)
{
if((str1=="") || (str2==""))
{
//send response back to client in form of an alert
}
} | 0 | [
2,
184,
20,
788,
1627,
37,
2741,
11449,
19,
505,
16,
7863,
800,
3726,
3726,
31,
57,
117,
21,
2741,
365,
17,
7421,
129,
645,
82,
3195,
9,
18,
576,
15690,
53,
2109,
1384,
222,
12905,
17,
31,
259,
20,
2631,
30,
100,
186,
53,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android LunarLander: first key-down event is not handled
===
Android SDK's LunarLander example expects the player to press the up-arrow key **once** to play the game. In practice, however, just after loading the app in the emulator, one has to press the up-arrow **twice** to start. Adding a Log.d statement to each of the onKeyDown() and onKeyUp() methods (in LunarView.java) reveals that **the very first** key-down event is ignored, but the following key-up event **is** handled.
The same issue occurs if one presses the menu button. After selecting the menu item "resume", if one presses the space bar, the lunar lander's engine will not fire. Again, LogCat reveals that this is because onKeyDown() is not called. However, if one presses the up-arrow, the handling of the key-down event is resumed.
Does anybody know why the very first key-down event is ignored? I am very confused. Since **onKeyDown() does not even get called**, the problem does not seem to stem from the actual code inside this method, but is related to something else. | 0 | [
2,
13005,
12710,
10313,
45,
64,
1246,
8,
2968,
807,
25,
52,
9006,
800,
3726,
3726,
13005,
13,
18,
43,
197,
22,
18,
12710,
10313,
823,
4186,
18,
14,
517,
20,
901,
14,
71,
8,
17638,
1246,
13,
1409,
13120,
1409,
20,
418,
14,
250,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Deploying Java web application to Amazon Elastic Beanstalk
===
My team is developing a Java web application which is to be deployed in Amazon Elastic Beanstalk. The development environment is Eclipse and Subversion. They were able to deploy it using the Eclipse plugin, but to automate the deployment I'm experimenting with the CLI tools provided by Amazon.
Basically, I followed the steps detailed in the [Amazon Blog post][1] after converting the subversion repository into a git repository. I followed the steps explained in [this SO answer][2]
After following the above steps, I issues the command git **aws.push**, which is successfully completed. But while running the application, there are errors and . So I downloaded the war file from the Beanstalk environment and found that the folder structure is messed up and the source files are not compiled to class files. It appears like the source files are uploaded as such.
Do I need to build the application(using ant) prior to using aws.push? Or am I missing something?
[1]: http://aws.typepad.com/aws/2012/06/aws-elastic-beanstalk-simplfied-command-line-eb.html
[2]: http://stackoverflow.com/questions/5368643/how-to-synchronize-a-git-repository-with-svn | 0 | [
2,
17617,
68,
8247,
2741,
3010,
20,
8059,
931,
9428,
14685,
9718,
800,
3726,
3726,
51,
173,
25,
3561,
21,
8247,
2741,
3010,
56,
25,
20,
44,
6698,
19,
8059,
931,
9428,
14685,
9718,
9,
14,
522,
2307,
25,
11652,
17,
972,
10898,
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... |
Unable to get value (post) with jquery.post
===
I have a little problem in order to get some values from a page.
I have the following jQuery UI script :
<script>
$(function() {
$( "#dialog" ).dialog({
autoOpen: false,
show: "slideUp",
hide: "slideDown",
height: "300",
width: "400",
title: "Test pop-up",
buttons: {
"Close": function(){
$(this).dialog("close");
}
}
}
);
$( "p.diag").click(function(e) {
var monUrl = 'test2.php';
$.post("test2.php", { name: "test", time: "test" } );
$('#dialog').load(monUrl, function(response, status) {
$('#test_dialog').html(response);
pos = $("p.diag").attr("id");
});
$( "#dialog" ).dialog("open");
e.preventDefault();
});
The test2.php page looks like this :
<?php
$var = $_POST['name'];
echo 'name = '.$var.'';
?>
I just want to retrieve the "name" value from my jQuery Script, but whatever I do, the $_POST['name'] remains void...
Any clue ? Am-I doing something wrong ?
Thanks ! | 0 | [
2,
2343,
20,
164,
1923,
13,
5,
6962,
6,
29,
487,
8190,
93,
9,
6962,
800,
3726,
3726,
31,
57,
21,
265,
1448,
19,
389,
20,
164,
109,
4070,
37,
21,
2478,
9,
31,
57,
14,
249,
487,
8190,
93,
13,
5661,
3884,
13,
45,
13,
1,
8741,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android NDK Native JPEG encoding
===
How can I encode an array of ARGB pixels into JPEG (jpg) file using the NDK? But not using any call to the Java API wrappers from it?
I saw there is a library call libjpeg, but I couldn't find any tutorial of how to use it in the NDK. Any more options?
Thanks | 0 | [
2,
13005,
13,
706,
197,
1275,
487,
20427,
19608,
800,
3726,
3726,
184,
92,
31,
20523,
40,
7718,
16,
13,
10663,
220,
18146,
18,
77,
487,
20427,
13,
5,
12851,
263,
6,
3893,
568,
14,
13,
706,
197,
60,
47,
52,
568,
186,
645,
20,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to update the data of some fields in one table based on the data of other field present on other table using linq or sql in C#?
===
I have the following view and table in my project,
vw_get_arabia_upod_full_details
![enter image description here][1]
Note: Please zoom the above image for seeing it clearly.
arabia_upod_item_avalability_master
![enter image description here][2]
I want to update quantity and the total price present in vw_get_arabia_upod_full_details for each item_id based on maxAllowed in the same table and availableQuantity present in arabia_upod_item_avalability_master. The availableQuantity is the total no. of quantity that is available. So I need to update quantity for each item checking maxAllowed and assigning maxAllowed (or less than that) to quantity till availableQuantity becomes zero. Could you help me? Thanks in advance.
[1]: http://i.stack.imgur.com/pOOWL.jpg
[2]: http://i.stack.imgur.com/j9yF6.jpg | 0 | [
2,
184,
20,
11100,
14,
1054,
16,
109,
2861,
19,
53,
859,
432,
27,
14,
1054,
16,
89,
575,
734,
27,
89,
859,
568,
6294,
1251,
54,
4444,
255,
19,
272,
5910,
60,
800,
3726,
3726,
31,
57,
14,
249,
1418,
17,
859,
19,
51,
669,
15,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to connect to a cluster in which the namenode has two network cards
===
all
I have a hadoop cluster with 3 nodes, the network topology is like this:
1. For each DataNode, its IP address is like :192.168.0.XXX;
2. For the NameNode, it has two network cards: one is connect with the DataNodes as a local LAN with IP address 192.168.0.110, while the other one is connect to the company network(which eventually connect to the Internet);
--
now I'm trying to debug a MapReduce program on a computer which is in the company network. Since the jobtracker in this scenario is 192.168.0.110:9001, I was wondering how could I connect to the cluster by using eclipse?
Any suggestion would be appreciated.
--
YANG, Lin | 0 | [
2,
184,
20,
6379,
20,
21,
7460,
19,
56,
14,
204,
251,
546,
63,
81,
982,
4092,
800,
3726,
3726,
65,
31,
57,
21,
41,
21709,
7460,
29,
203,
16272,
15,
14,
982,
21661,
25,
101,
48,
45,
137,
9,
26,
206,
1054,
251,
546,
15,
82,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquey zClip, Chrome
===
I need to copy to the clipboard, and I have used this plug-in:
http://www.steamdev.com/zclip/
$('#copy_code').zclip({
path: '/scripts/js/ZeroClipboard.swf',
copy: $('textarea.form_code').val()
});
This works fine in all browsers, but begins to slow down terribly in chrome. and browser gives warnings about flash.
How to avoid this, or pls advise another plugin.
| 0 | [
2,
487,
2005,
93,
2052,
150,
6013,
15,
13,
12985,
800,
3726,
3726,
31,
376,
20,
4344,
20,
14,
12229,
2806,
15,
17,
31,
57,
147,
48,
10922,
8,
108,
45,
7775,
6903,
6483,
9,
18,
6575,
14438,
9,
960,
118,
380,
150,
6013,
118,
557... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error #2154: The NetStream Object is invalid. This may be due to a failed NetConnection
===
I am unable to run the demo multicast application on my Adobe Flash Builder as it always throw the error 2154 mentioned above.
Plz help me how to rectify it....
I think there might be some problem with the server or dev key as previously it was Stratus and now its Cirrus. | 1 | [
2,
7019,
7921,
13758,
45,
14,
4275,
11260,
3095,
25,
16671,
9,
48,
123,
44,
397,
20,
21,
1702,
4275,
25996,
872,
800,
3726,
3726,
31,
589,
2343,
20,
485,
14,
8376,
1889,
6146,
3010,
27,
51,
20299,
4433,
14960,
28,
32,
550,
3814,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Refreshing dataGridView items on adding or deleting entry in database?
===
i am adding , deleting and updating data to database in Winforms. i have gridview on all add,delete and update forms.
After deleting records on clicking "delete" button deleted record should removed instantly from dataGridView.
Code Behind:
private void btnDelete_Click(object sender, EventArgs e)
{
if (txtIDD.Text == "")
{
MessageBox.Show("Please fill ID no. of record to Delete", "Important Message");
}
else
{
try
{
OleDbCommand Cmd = new OleDbCommand();
Cmd.Connection = conn;
conn.Open();
Cmd.CommandText = "DELETE FROM AddressBook WHERE ID="+txtIDD.Text;
Cmd.CommandType = CommandType.Text;
Cmd.ExecuteNonQuery();
Cmd.Connection.Close();
conn.Close();
dataGridView3.Update();
MessageBox.Show("Delete Succesfull");
}
catch (System.Exception err)
{
this.label27.Visible = true;
this.label27.Text = err.Message.ToString();
}
}
}
| 0 | [
2,
27134,
1054,
16375,
4725,
3755,
27,
4721,
54,
121,
1336,
68,
2792,
19,
6018,
60,
800,
3726,
3726,
31,
589,
4721,
13,
15,
121,
1336,
68,
17,
71,
43,
1880,
1054,
20,
6018,
19,
628,
4190,
18,
9,
31,
57,
7354,
4725,
27,
65,
354... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 column size(varchar datatype) is needed to store an image in STRING format?
===
I want to store an image in my SQLITE db. I checked out the length of the image's string with this code:
String res;
int reslen;
Log.i("asd", "doinback");
WebServiceConnecting wbs = new WebServiceConnecting();
res=wbs.SoapAction(new String[] {"FileName"}, new String[] {"1.jpg"}); //gets the image in string format
reslen=res.length();
res=String.valueOf(reslen);
Log.i("string res=",res );
I got the value of reslen as ~300,000. so what size should i give for my varchar column in SQLite db?
| 0 | [
2,
98,
4698,
1072,
5,
3311,
5433,
1054,
4474,
6,
25,
851,
20,
1718,
40,
1961,
19,
3724,
2595,
60,
800,
3726,
3726,
31,
259,
20,
1718,
40,
1961,
19,
51,
4444,
10601,
13,
9007,
9,
31,
6505,
70,
14,
1476,
16,
14,
1961,
22,
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... |
programmatically assign position to a button in android
===
can sum body tell me how to programmatically assign a position to a button in android using linear layout. By default it takes the xtreme left position of the screen.Also i want to do it using Linear layout please do not suggest me using Relative layout.Following is my code
buttons_and_edittext=new LinearLayout(HelloAugmentedWorldActivity.this);
buttons_and_edittext = (LinearLayout)findViewById(R.id.linearLayout1);
buttons_and_edittextParameters = new LinearLayout.LayoutParams(120, 150);
button3 = new Button(this);
button3.setText("log");
buttons_and_edittext.addView(button3,
buttons_and_edittextParameters);
any help will be appreciated thanks
| 0 | [
2,
625,
6732,
1326,
13952,
649,
20,
21,
5167,
19,
13005,
800,
3726,
3726,
92,
3907,
358,
494,
55,
184,
20,
625,
6732,
1326,
13952,
21,
649,
20,
21,
5167,
19,
13005,
568,
6745,
9106,
9,
34,
12838,
32,
1384,
14,
993,
17048,
62,
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... |
Batch file: Variable Gird Maker
===
I have been working on a batch file that creates a gird of variables like this:
%G1%%G2%%G3%%G4%%G5%
%G6%%G7%%G8%%G9%%G10%
%G11%%G12%%G13%%G14%%G15%
but when i try running my batch file it just writes this:
%G1%%G2%%G3%%G4%%G5%
Echo is off.
Echo is off.
Echo is off.
Echo is off.
I have add the code here please could someone tell me what i am doing wrong.
@echo off
title GirdMaker - Pre-Alpha
color 0f
setlocal enabledelayedexpansion
set lineid=0
set COLS=0
set LINES=0
set /p LINES=Enter number of lines:
set /p COLS=Enter the number of colums:
cls
set START=1
set linecount=0
:A
set LINE=
for /l %%I in (%START%,1,%COLS%) do (
set LINE=!LINE!%%G%%I%%
)
set /a linecount=%linecount%+1
echo %LINE%
set /a lineid=%lineid%+%COLS%+1
set START=%lineid%
if %LINES% EQU %linecount% (
pause >nul
exit
)
goto :A
| 0 | [
2,
13064,
3893,
45,
7612,
10698,
43,
11767,
800,
3726,
3726,
31,
57,
74,
638,
27,
21,
13064,
3893,
30,
9695,
21,
10698,
43,
16,
12157,
101,
48,
45,
13,
11881,
263,
2339,
11881,
263,
2603,
11881,
263,
2560,
11881,
263,
2708,
11881,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Entity framework not creating MetaData and complaining about it.
===
I have a normal Entity Framework MVC Application. I tried using the seed method, but, it was quite hard to work out with many relationships and I opted to create a method that basically started off by calling `db.Database.Delete();` followed by `db.Database.Create();` along with a load of insert commands.
I then call this method if I mess something up to basically reset the database.
This has always worked perfectly, however, it seems that if I make some Schema changes then run it, I get the following error: `Model compatibility cannot be checked because the database does not contain model metadata. Ensure that IncludeMetadataConvention has been added to the DbModelBuilder conventions.`
![enter image description here][1]
When this happens, I can inspect the database and I do see the Schema is all there and the metadata table is there but it is empty and I cannot make any more process.
However, if I restart my computer and re-run the method, it then works perfectly!
I have tried many things such as manually deleting the database, restarting the SQL process, opening/closing Visual Studio...
... Nothing seems to help other than a restart and this is getting really frustrating!
Does anyone know what is causing this and most importantly, how to fix it?
[1]: http://i.stack.imgur.com/0X3JX.png | 0 | [
2,
9252,
6596,
52,
2936,
28057,
17,
20154,
88,
32,
9,
800,
3726,
3726,
31,
57,
21,
1826,
9252,
6596,
307,
8990,
3010,
9,
31,
794,
568,
14,
5134,
2109,
15,
47,
15,
32,
23,
1450,
552,
20,
170,
70,
29,
151,
5833,
17,
31,
13920,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Display specific content to a mobile device using javascript or jquery
===
I need to display different information to an iPhone user, as they cant display flash. So therefore display a jpeg for example for anyone using an iphone, and any other device can see the flash content.
I assume the best way to go about this would be to use either javascript or jquery, using the http header information. However I dont know where to start, does anyone have any ideas?
Thanks. | 0 | [
2,
3042,
1903,
2331,
20,
21,
3241,
3646,
568,
8247,
8741,
54,
487,
8190,
93,
800,
3726,
3726,
31,
376,
20,
3042,
421,
676,
20,
40,
21024,
4155,
15,
28,
59,
2973,
3042,
4433,
9,
86,
1793,
3042,
21,
487,
20427,
26,
823,
26,
1276,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
URL rewrite checks for static files then rewrites to index.php
===
OK, I'm pants at rewrite rules in .htaccess files!
My desired scenario is (using the URL `http://doma.in/` as an example):
- First check to see if an `index.html` file exists in the `/public` sub-dir; if it does, serve it
- If it did not; serve (rewrite to) `index.php`
To expand on my example, say we requested the URL `http://doma.in/js/foobar.js`:
- First check to see if an `foobar.js` file exists in the `/public/js` sub-dir; if it does, serve it
- If it did not; serve (rewrite to) `index.php?controller=js%2Ffoobar.js`
That would cover static files but I also need URLs like `http://doma.in/foo`:
- First check to see if an `foo` file exists in the `/public` sub-dir; if it does, serve it
- If it did not; serve (rewrite to) `index.php?controller=foo`
And a URL `http://doma.in/foo/bar`:
- We can assume the file `foo/bar` does not exists in the `/public` sub-dir as files can't be named like that.
- So serve (rewrite to) `index.php?controller=foo&action=bar`
I'm sure if this complicated (for me) bit is covered then I can work query-strings into the occasion too; so `http://doma.in/foo/bar/foo/bar` would serve `index.php?controller=foo&action=bar&querystring=foo%2Fbar`.
I'd also like to make sure that a trailing slash is handled the same as if a trailing slash was omitted, for example: `http://doma.in/foo/bar/foo/bar` and `http://doma.in/foo/bar/foo/bar/`
I'll handle 404s from within my app as if the file did not exist, it would redirect to `index.php` which does exist - I'm happy with this unless you've a better solution :)
I really hope all this makes sense as I've been looking to find a solution to this scenario all day now and this is all I have:
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
#RewriteBase /prompt-v3/
#RewriteCond %{REQUEST_URI} ^/prompt-v3/(.*)$
RewriteCond $1 !^public
RewriteRule ^(.*)$ public/$1 [R]
The commented-out lines deal with a sub-dir when on a remote host. So far I can redirect to the `/public` sub-dir if the file exists there and that's about it.
Thank you everyone for your help!
| 0 | [
2,
287,
6362,
27891,
16602,
26,
12038,
6488,
94,
27891,
18,
20,
4348,
9,
26120,
800,
3726,
3726,
5854,
15,
31,
22,
79,
5622,
35,
27891,
1761,
19,
13,
9,
9020,
20604,
6488,
187,
51,
9264,
12705,
25,
13,
5,
12655,
14,
287,
6362,
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... |
Unable to push to remote GIT repository -- "[...] does not appear to be a git repository"
===
I've set up my GIT repository on my server using the following in the appropriate folder (the root of my subdomain, `git.mydomain.com`):
mkdir foo.git
cd foo.git
git init --bare --shared
This would make the repository available by the URL `git.mydomain.com/foo.git`.
On my client, trying to push the commited files to the server using the following:
mkdir foo
cd foo
git init
git remote add foo myUser@git.mydomain.com:foo.git
git add readme.txt
git commit -m "foo"
git push foo master
.. entering user password ..
Only results in:
fatal: 'foo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
However, following a set of different guides, I seem to be unable to resolve this problem. Any suggestions would be highly appreciated, please bear in mind that I'm quite green to GIT. | 0 | [
2,
2343,
20,
3250,
20,
5388,
13,
10404,
24869,
13,
8,
8,
13,
7,
2558,
9,
9,
9,
500,
630,
52,
1893,
20,
44,
21,
13,
10404,
24869,
7,
800,
3726,
3726,
31,
22,
195,
309,
71,
51,
13,
10404,
24869,
27,
51,
8128,
568,
14,
249,
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... |
Improving a query to find out-of-sync values between two tables
===
I have the following query:
SELECT
tableOneId
SUM(a+b+c) AS tableOneData,
MIN(d) AS tableTwoData,
FROM
tableTwo JOIN tableOne ON tableOneId = tableTwoId
GROUP BY
tableOneId
In `Table One`, I have entries whose sum (columns `a, b, c`) should be equivalent to column `d` in `Table Two`.
A simple example of this:
Table One (id here should read tableOneId to match above query)
id=1, a=1, b=0, c=0
id=1, a=0, b=2, c=0
id=2, a=1, b=0, c=0
Table Two (id here should read tableTwoId to match above query)
id=1, d=3
id=2, d=1
My first iteration used (`SUM(d)/COUNT(*)`) but division is messy so I'm currently using `MIN(d)`. What would be a better way to write this query? All of the mentioned columns are declared as `numeric(30,6) NOT NULL` if that may be relevant.
Please let me know if I left anything important. | 0 | [
2,
9273,
21,
25597,
20,
477,
70,
8,
1041,
8,
9507,
150,
4070,
128,
81,
7484,
800,
3726,
3726,
31,
57,
14,
249,
25597,
45,
5407,
859,
849,
1340,
3907,
5,
58,
2430,
220,
2430,
150,
6,
28,
859,
849,
18768,
15,
4232,
5,
43,
6,
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... |
Compare system Day and DateTime
===
I'm using the code below to compare two Times:
DateTime systemtime = DateTime.Now;
DateTime timestart = Convert.ToDateTime(txtTimestart.Text);
DateTime timeend = Convert.ToDateTime(txtTimeend.Text);
if (systemtime < timestart || systemtime > timeend)
{
MessageBox.Show("not auth.");
}
else
{
MessageBox.Show("auth.");
}
But I also want to compare the current day. For example, if today is Monday or Thursday, the user is authenticated, not if otherwise. How do I do it? Thanks. | 0 | [
2,
11590,
329,
208,
17,
1231,
891,
800,
3726,
3726,
31,
22,
79,
568,
14,
1797,
1021,
20,
11590,
81,
436,
45,
1231,
891,
329,
891,
800,
1231,
891,
9,
1387,
73,
1231,
891,
85,
13680,
800,
8406,
9,
262,
8209,
891,
5,
38,
396,
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... |
jquery Masonry height - fill gaps at container's bottom
===
I've started using jQuery [Masorny][1] plugin, I use images with fixed width of 190px each and it works fine, beside one issue. Naturally there are gaps at the bottom of each column, I want to fill theses gaps with some background.
If I set background to the container, it will be also behinde the gutterWidth that between each element. Is there a way to add some empty divs at the bottom of each columns, or something else that will let style that gaps in the bottom?
My Masonry init code:
jQuery(document).ready(function(){
var $gal = jQuery('#gallery');
$gal.imagesLoaded( function(){
$gal.masonry({
itemSelector : '.item',
columnWidth: 190,
isFitWidth:true,
gutterWidth:2
});
});
});
Here is a working demo for this and also there a screenshot of what I try to achieve:
http://maorb.dyndns-ip.com/masonrytest
I've looked in other questions about Masonry and also in the documentry, it seems not to be mentioned.
Thanks
[1]: http://masonry.desandro.com/index.html | 0 | [
2,
487,
8190,
93,
20964,
2947,
13,
8,
3509,
4127,
18,
35,
12147,
22,
18,
2129,
800,
3726,
3726,
31,
22,
195,
373,
568,
487,
8190,
93,
636,
5250,
248,
1536,
500,
2558,
165,
500,
10922,
108,
15,
31,
275,
3502,
29,
3535,
9456,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reload Solr core with curl
===
I'm trying to reload the Solr core (version 3.6.0) by means of the following sentence:
curl http://localhost:8983/solr/admin/cores?action=RELOAD\&core=mycore
When I execute it, I get the following response:
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">1316</int>
</lst>
</response>
I get a similar response when I put such URL at my browser (the difference is the value of QTime).
My problem is that, if I call to the URL from the browser I can see at the log information that the reload is executed, but if I call it from the CURL statement, I can't see anything at my log info (that is to say, no reload process has been executed).
Do I have to change some config data? | 0 | [
2,
27339,
7176,
139,
2884,
29,
14320,
800,
3726,
3726,
31,
22,
79,
749,
20,
27339,
14,
7176,
139,
2884,
13,
5,
10898,
203,
9,
379,
9,
387,
6,
34,
1108,
16,
14,
249,
5123,
45,
14320,
7775,
6903,
15580,
11694,
45,
3877,
4736,
118,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Please suggest any good newsletter module for drupal 7
===
I am looking for newletter module for drupal 7 which should works with contact us page also | 0 | [
2,
2247,
5601,
186,
254,
17782,
12613,
26,
15708,
6720,
453,
800,
3726,
3726,
31,
589,
699,
26,
78,
19535,
12613,
26,
15708,
6720,
453,
56,
378,
693,
29,
2203,
182,
2478,
67,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Setting RowSource of a Chart in a Microsoft Access 2010 Report
===
I have chart inside a report in Microsoft Access 2010 that gets its RecordSource via VBA in the OnLoad of the report. The reason is that I have a form where the user can select what to include in the report. So the query that is set in VBA is
Me.Chart01.RowSource = "xxxx WHERE tbl_cars.ID In (" & IDs & ");"
Me.Chart01.Requery
DoCmd.Requery
The problem is that the graph does not update. After doing `MsgBox Me.Chart01.RowSource` both before and after where I set the RowSource, the SQL seems to be correct. It works perferctly when I remove the In() part and try it in the Query Design.
(I load the RecordSource of the report the same way, and it works.)
Are the charts in Access too poor to be able to do this, or is there a solution to this problem? | 0 | [
2,
2697,
3131,
12097,
16,
21,
1795,
19,
21,
7099,
1381,
498,
1330,
800,
3726,
3726,
31,
57,
1795,
572,
21,
1330,
19,
7099,
1381,
498,
30,
3049,
82,
571,
12097,
1197,
566,
969,
19,
14,
27,
8294,
16,
14,
1330,
9,
14,
1215,
25,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you make infrastructure code only visible in namespace?
===
I have an implementation of the Shunting-Yard algorithm that I am trying to integrate clearly into our framework. Currently I have it all packed into a class with a simple public interface.
namespace MathematicalParser {
public class ExpressionParser {
public ExpressionParser(string expression, List<string> variables);
public double GetNumericValue(Dictionary<string,double> variableValues);
}
}
Inside this class there are a lot of helper classes, helper enums, static variables etc to map different names to functions. All these are private so that is no concern to the user of the library.
In an effort to improve maintainability of the code I'm trying to separate code that is logically unrelated into their own classes, these classes do however not have any meaning outside of the ExpressionParser so I'd like to limit their visibility to the namespace MathematicalParser (which only contains the ExpressionParser).
How do you best accomplish this in c#, the internal keyword only works on assemblies and private can't be used in namespaces. | 0 | [
2,
184,
107,
42,
233,
5282,
1797,
104,
4560,
19,
204,
5582,
60,
800,
3726,
3726,
31,
57,
40,
6123,
16,
14,
13,
18,
24852,
8,
3476,
9083,
30,
31,
589,
749,
20,
18399,
2885,
77,
318,
6596,
9,
871,
31,
57,
32,
65,
9402,
77,
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... |
MVC 3 - How to display a lookup Value in a view Index view instead of an ID field
===
All
I have a pretty simple need but am unable to figure how it could be done
I have 2 entities
- Employee
- Store
An employee is associated with a store such as (DB) <br>
Employee_id, Store_id <br>
1 1 <br>
2 1
While in the Index View I need to show the Store_name instead of the StoreID. Which is ideal 'MVC' way of doing it? I am using LINQ to SQL as the data access method
| 0 | [
2,
307,
8990,
203,
13,
8,
184,
20,
3042,
21,
361,
576,
1923,
19,
21,
1418,
4348,
1418,
700,
16,
40,
4924,
575,
800,
3726,
3726,
65,
31,
57,
21,
1772,
1935,
376,
47,
589,
2343,
20,
1465,
184,
32,
110,
44,
677,
31,
57,
172,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to verify whether the SQL server instance is correct or not using powershell?
===
We are using Invoke-sqlcmd cmdlet to execute SQL query using powershell.
If SQl server instance is given as wrong it is throwing exception.
How to verify whether SQL server instance is available and it is running before executing any query? | 0 | [
2,
184,
20,
21012,
1472,
14,
4444,
255,
8128,
4851,
25,
4456,
54,
52,
568,
414,
15984,
60,
800,
3726,
3726,
95,
50,
568,
28371,
8,
18,
22402,
9095,
43,
2390,
43,
1336,
20,
15644,
4444,
255,
25597,
568,
414,
15984,
9,
100,
4444,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Surround existing node with another node with Agility Pack
===
How would you go about surrounding all tables in a `<div class="overflow"></div>` node? This apparently does not do it:
if (oldElement.Name == "table")
{
HtmlDocument doc = new HtmlDocument();
HtmlNode newElement = doc.CreateElement("div");
newElement.SetAttributeValue("class", "overflow");
newElement.AppendChild(oldElement);
oldElement.ParentNode.ReplaceChild(newElement, oldElement);
}
Nothing happens to the tables when I try that code. But if i use:
if (oldElement.Name == "table")
{
oldElement.Remove();
}
All tables are indeed removed, so I'm sure that i'm accessing the correct nodes. | 0 | [
2,
12215,
3149,
15421,
29,
226,
15421,
29,
28813,
3607,
800,
3726,
3726,
184,
83,
42,
162,
88,
2470,
65,
7484,
19,
21,
13,
1,
12916,
718,
3726,
7,
2549,
9990,
7,
1,
118,
12916,
1,
15421,
60,
48,
3083,
630,
52,
107,
32,
45,
100... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
get background image url is not working for internet explorer
===
I neec your help...
I'm trying to get the background image of the div... and afterword to change it by adding gray prefix to the bg image name...
well everything is working perfectly in chrome and firefox...
but in IE the value of background image is about-blank... please help me...
var img= $("#nom_"+$(".nomination").attr('id')).css('background-image');
var image = img.split('/').pop();
var img1 = image.split(')',1);
var img1 = "<|UP>/gray"+img1;
the attr('id') is visible in ie...
the problem is with .css('background-image');
but for ie iv changed it to
if($.browser.msie){
var id ="nom_"+$(".nomination").attr('id');
obj=document.getElementById(id);
alert(obj.currentStyle.backgroundImage);
}
but again the returned value is 'about-blank'...
plz plz plz help me | 0 | [
2,
164,
2395,
1961,
287,
6362,
25,
52,
638,
26,
2620,
8520,
800,
3726,
3726,
31,
12616,
150,
154,
448,
9,
9,
9,
31,
22,
79,
749,
20,
164,
14,
2395,
1961,
16,
14,
13,
12916,
9,
9,
9,
17,
75,
9587,
20,
753,
32,
34,
4721,
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... |
how can i get the values that are about to be sent to the database by the TableAdapter through the datagridview?
===
I'm entering sales entries using a TabaleAdapter and a dataGridView. When a row is about to be saved, i want to check the StockBalance of the selected product and verify that current stock for selected product is not less than amount being sold. if its less i want to cancel the sale, so how can get the values that are about to be inserted or updated by the TableAdapter from the example code below?
private void dataGridView1_RowValidated(object sender, DataGridViewCellEventArgs e)
{
this.Validate();
this.itemSalesBindingSource.EndEdit();
this.itemSalesTableAdapter.Update(this.businessDataDataSet);
} | 0 | [
2,
184,
92,
31,
164,
14,
4070,
30,
50,
88,
20,
44,
795,
20,
14,
6018,
34,
14,
859,
27576,
106,
120,
14,
1054,
16375,
4725,
60,
800,
3726,
3726,
31,
22,
79,
4604,
2598,
11399,
568,
21,
6523,
4482,
27576,
106,
17,
21,
1054,
1637... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
checking condition xslt
===
With the previous post.
here is the link
<a href="http://stackoverflow.com/questions/11523708/condition-checking-in-xslt/11534191#11534191">Previous Question</a>
Again Small Update in input xml the other validation are all same. Here only the chapter (element) is changing instead of chapter i will have numbers
<tutorial>
<lessons>
<lesson>
12000 Bat 20
</lesson>
<lesson>
1300 CHG
</lesson>
<lesson>
24000 ENG 10~
</lesson>
</lessons>
</tutorial>
Please help me the for more details please use the above link
Thanks in advance
Karthic | 0 | [
2,
9886,
2874,
993,
18,
255,
38,
800,
3726,
3726,
29,
14,
1158,
678,
9,
235,
25,
14,
3508,
13,
1,
58,
746,
14057,
3726,
7,
21127,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
11698,
14397,
16131,
12530,
22141,
8,
12542,
68,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Stub or mock method of tested class
===
I discovered that stub and mock are very helpful in testing.
But I wondering about one thing. I think an example will show it clearly.
Class A {
public function isOk() {
// some work
}
public function iAmDepend() {
if ($this->isOk()) {
// do work
}
}
}
class TestA {
public function testIsOk() {
// Test itOk here
}
public function testIAmDepend() {
mock(A)->method(isOk)->return(true);
// tests for iAmDepend
}
}
It wise to do something like this? Stub method of tested class. Or maybe it breaks some rules?
PS. I can't refactore code | 0 | [
2,
21354,
54,
10506,
2109,
16,
7631,
718,
800,
3726,
3726,
31,
1848,
30,
21354,
17,
10506,
50,
253,
15600,
19,
4431,
9,
47,
31,
5712,
88,
53,
584,
9,
31,
277,
40,
823,
129,
298,
32,
2885,
9,
718,
21,
13,
1,
317,
1990,
25,
30... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hibernate: Generating Reports (Stored pocedures)
===
I am working on an application using Hibernate (JPA 2.0), Spring 3.0.5 and Oracle 11g.
I need to generate few reports (CSV's) based on a number of tables in the datasbase;
The sample report CSV looks like this:
From_Date TO_Date Group Stat Mon Tue Wed Thu Fri
10/01/2012 10/02/2012 HP Average 29 74 400 99 14
10/02/2012 10/03/2012 HP Average 81 19 22 108 07
10/03/2012 10/04/2012 HP Average 11 62 09 16 01
10/01/2012 10/02/2012 HP Total 924 452 915 100 940
10/02/2012 10/03/2012 HP Total 185 925 266 108 857
10/03/2012 10/04/2012 HP Total 173 201 907 675 169
My question is as this report will depend on many tables and different metrics (average, total, and percentages), what is the best way forward with the given technology stack?
I am currently not using any reporting api currently.
Is stored procedure the way to go???
Thanks !! | 0 | [
2,
4148,
2102,
8820,
45,
13500,
2813,
13,
5,
16828,
43,
13,
23093,
69,
4221,
18,
6,
800,
3726,
3726,
31,
589,
638,
27,
40,
3010,
568,
4148,
2102,
8820,
13,
5,
728,
1060,
172,
9,
387,
6,
15,
1573,
203,
9,
387,
9,
264,
17,
157... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
R - using mixedorder from gtools
===
Can someone please help
Here are two lines of R code which I would like to combine into one
smplA_Bacillus = subset(smplA, select = c(lab_id, Bacillus_C))
smplA_Bacillus = smplA_Bacillus[mixedorder(smplA_Bacillus$Bacillus_C),]
The mixedorder comes from gtools but what I am not sure if I the two commands can be used together.
When I try the following I get an error message
smplA_Bacillus = subset(smplA, select = c(lab_id, Bacillus_C))
smplA_Bacillus = smplA_Bacillus[mixedorder(subset(smplA, select = c(lab_id, Bacillus_C)$Bacillus_C),])
Error: unexpected ']' in "smplA_Bacillus = smplA_Bacillus[mixedorder(subset(smplA, select = c(lab_id, Bacillus_C)$Bacillus_C),]"
Any help would be appreciated
Regards
| 0 | [
2,
761,
13,
8,
568,
2198,
7861,
37,
489,
20799,
18,
800,
3726,
3726,
92,
737,
2247,
448,
235,
50,
81,
1560,
16,
761,
1797,
56,
31,
83,
101,
20,
12287,
77,
53,
7613,
9897,
1,
969,
150,
13898,
800,
16622,
5,
18,
79,
9897,
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... |
Visual Studio 2010 and TFS unwanted check out
===
I am using Visual Studio 2010 SP1 with Team Foundation Server 2010. Whenever I open a project, Visual Studio automatically checks the project file (.csproj) out (not any of the children files, however) and the corresponding .csproj.vspscc file out.
Whenever I compare the project file in my Pending Changes list, it says the files are identical for both the .csproj file and the .csproj.vspscc file -- we just check them back in or undo the changes.
Can someone explain why it's doing this and how it can be fixed so it doesn't check out the .csproj and .vspscc file out every time we open the project? | 0 | [
2,
3458,
1120,
498,
17,
13,
11720,
18,
21095,
2631,
70,
800,
3726,
3726,
31,
589,
568,
3458,
1120,
498,
3782,
165,
29,
173,
1304,
8128,
498,
9,
6634,
31,
368,
21,
669,
15,
3458,
1120,
7499,
16602,
14,
669,
3893,
13,
5,
9,
6824,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
wpf set value for listboxitem templated binding
===
I have this style:
<Style x:Key="SelectableListBoxItemStyle" TargetType="{x:Type ListBoxItem}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border
Background="Transparent"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="4"
BorderThickness="2"
x:Name="IconBorder"
Margin="4,2,4,2">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="IconBorder" Property="BorderBrush" Value="Blue" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
My problem is how do I set the border brush when declaring the listbox in xaml? I would also like to be able to set the selected border color in my xaml, so not to have a style for every color. Also binding the border brush to a static resource I don't like, as I would like to be able to have two list boxes with this same style but different border colors. I have this:
<ListBox
ItemsSource="{Binding SelectedProduct.Pictures}"
SelectedItem="{Binding SelectedSet, Mode=TwoWay}"
ItemContainerStyle="{StaticResource ResourceKey= SelectableListBoxItemStyle}">
</ListBox>
Cheers!
| 0 | [
2,
619,
7721,
309,
1923,
26,
968,
5309,
2119,
79,
22894,
43,
8728,
800,
3726,
3726,
31,
57,
48,
1034,
45,
13,
1,
4381,
993,
45,
4237,
3726,
7,
18,
16964,
579,
5739,
5309,
2119,
79,
4381,
7,
2935,
4474,
3726,
7,
1,
396,
45,
447... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 find the generator matrix when codewords are given
===
Code = { 000, 011 , 101, 110 }
generator matrix = {011, 101}
Here the code matrix is given, and iam supposed to find the generator matrix. But iam clueless in determining the generator matrix. Could someone please shed some light on this ? | 0 | [
2,
184,
107,
31,
477,
14,
15286,
8187,
76,
1797,
12827,
50,
504,
800,
3726,
3726,
1797,
800,
13,
1,
13,
3993,
15,
713,
1306,
13,
15,
7698,
15,
7896,
13,
1,
15286,
8187,
800,
13,
1,
387,
1306,
15,
7698,
1,
235,
14,
1797,
8187,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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# - run mstsc.exe with specified username and password
===
I realize that in Windows 7, it is not possible to save different credentials for the same host, but I need some workaround.
Can I provide the username and password manually in the code? Store them in a temp .rdp file?
Any ideas? Thanks. | 0 | [
2,
272,
5910,
13,
8,
485,
4235,
38,
3862,
9,
1706,
62,
29,
9931,
4155,
7259,
17,
20884,
800,
3726,
3726,
31,
4007,
30,
19,
1936,
453,
15,
32,
25,
52,
938,
20,
2079,
421,
5059,
43,
10107,
18,
26,
14,
205,
2015,
15,
47,
31,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery Mobile List View on Blackberry torch
===
For some reason my Blackberry Torch (OS 6.0 Bundle 2647) DOES NOT render listview in Jquery Mobile 1.1.1
Blackberry Bold works fine.
Any ideas if Listview and Persistent headers are supported in Blackberry Torch ?
Thanks
RG | 0 | [
2,
487,
8190,
93,
3241,
968,
1418,
27,
27367,
11058,
800,
3726,
3726,
26,
109,
1215,
51,
27367,
11058,
13,
5,
759,
400,
9,
387,
10194,
1262,
2918,
6,
630,
52,
16535,
968,
4725,
19,
487,
8190,
93,
3241,
137,
9,
165,
9,
165,
27367... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
what is the execution mechanism of the setInterval function
===
I want to know, How it works the `setInterval` function.
**First:** I have simple example ([Live demo][1])
[1]: http://jsfiddle.net/gGYKV/4/
Also the code below.
**HTML:**
<div id="elem"></div>
<div id="count"></div>
<div id="Timer"></div>
**Javascript:**
var s = 10;
var count = 0;
if (s == 20)
alert("S= 20");
var timer = setInterval(function(){
if (count < 50) {
count++;
document.getElementById('count').innerHTML = "Counter: " + count;
}
else {
clearInterval(timer);
document.getElementById('count').innerHTML = "Counter: End Of Count";
}
}, 50);
s = 20;
document.getElementById('elem').innerHTML = "variable 's': " + s;
document.getElementById('Timer').innerHTML = "Timer value: " +timer;
if (s == 20)
alert("S= 20");
All I want is how the function it works.
| 0 | [
2,
98,
25,
14,
5769,
6534,
16,
14,
309,
6280,
3377,
1990,
800,
3726,
3726,
31,
259,
20,
143,
15,
184,
32,
693,
14,
13,
1,
3554,
6280,
3377,
1,
1990,
9,
13,
1409,
3552,
45,
1409,
31,
57,
1935,
823,
13,
5,
2558,
5928,
8376,
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... |
Adding a node into a linked list, right after the head
===
I have a linked list, and I need to create a node right after the head..
it means I have something like this:
`node *head = NULL;`
and my linked list in the end should be like :
`head -> node -> NULL`...
but when I use a normal addNode function, it gives me a runtime error(not sure which, my debug has problems)...
this is what I wrote:
void addNode(node *head)
{
node *temp = head; // a temp to not move the head
node *newNode = (node*)malloc(sizeof(node)); // The new node
while (temp -> next != NULL)
{
temp = temp -> next // Getting to the last node
}
temp -> next= newNode; // Adding the new node into the linked list insted of the NULL
newNode -> next = NULL; // Adding the NULL after the new node
}
This code works great to me when I have a linked list with already 1 or more nodes ,but if the linked list only has a head, it does problems to me... how can I solve the problem?
(if you didnt understand my problem - With the addNode function I wrote here, i'm getting a runtime error for adding a new node into a head that points to NULL already)..
Thanks, Amit :) | 0 | [
2,
4721,
21,
15421,
77,
21,
4727,
968,
15,
193,
75,
14,
157,
800,
3726,
3726,
31,
57,
21,
4727,
968,
15,
17,
31,
376,
20,
1600,
21,
15421,
193,
75,
14,
157,
9,
9,
32,
1108,
31,
57,
301,
101,
48,
45,
13,
1,
251,
546,
1637,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 possible to run hadoop fs -getmerge in s3?
===
I have an Elastic Map Reduce job which is writing some files in S3 and I want to concatenate all the files to produce a unique text file.
Currently I'm manually copying the folder with all the files to our HDFS (hadoop fs copyFromLocal), then I'm running hadoop fs -getmerge and hadoop fs copyToLocal to obtain the file.
is there anyway to use hadoop fs directly on S3? | 0 | [
2,
25,
938,
20,
485,
41,
21709,
398,
18,
13,
8,
3060,
1263,
834,
19,
13,
18,
240,
60,
800,
3726,
3726,
31,
57,
40,
931,
9428,
2942,
4136,
1205,
56,
25,
1174,
109,
6488,
19,
13,
18,
240,
17,
31,
259,
20,
1065,
9530,
8820,
65,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Code coverage with Sonar : % code coverage not coherent
===
I have a question for `Code coverage` with Sonar.
In this example :
public static void apply(Person person) {
if (person != null) {
callApply(person);
}
}
In my Sonar `Code coverage`, i have the following result :
if (person != null) => hit=(10) % = (75%)
callApply(person); => hit(10) % =()
I don't understand why with the same number of hit, the coverage is 75% ?, and why i don't have any value coverage when we call the method `callApply`
I think this version of Sonar use Jacoco for coverage code.
Thank you. | 0 | [
2,
1797,
5245,
29,
433,
512,
13,
45,
13,
11881,
1797,
5245,
52,
21144,
800,
3726,
3726,
31,
57,
21,
1301,
26,
13,
1,
9375,
5245,
1,
29,
433,
512,
9,
19,
48,
823,
13,
45,
317,
12038,
11364,
5645,
5,
7276,
840,
6,
13,
1,
100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
displaying popup window input text value in parent window?
===
function showEmp(){
if(validate())
{
for(var i=0; i < document.employee.puid.length; i++){
if(document.employee.puid[i].checked){
var emp_value = document.employee.puid[i].value;
}
}
xmlHttp=GetXmlHttpObject();
if(xmlHttp==null){
alert ("Browser does not support HTTP Request")
return
}
var url="getPatient.jsp"
url=url+"?emp_id="+emp_value;
xmlHttp.onreadystatechange=stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
}
function stateChanged()
{
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
var showdata = xmlHttp.responseText;
alert(showdata)
var strar = trim(showdata).split(":");
if(strar.length>0)
{
window.opener.location.reload();
window.location.reload();
opener.document.getElementById("puid").value=strar[1];
opener.document.getElementById("fname").value=strar[2];
window.close();
}
}
}
i am not able to display value in the parent window fields , in this
var showdata = xmlHttp.responseText;
alert(showdata)
here even i just kept alert for showdata , but it is displaying only empty slert box can any one help me , !! | 0 | [
2,
17418,
1675,
576,
1463,
6367,
1854,
1923,
19,
4766,
1463,
60,
800,
3726,
3726,
1990,
298,
62,
2554,
5,
6,
1,
100,
5,
18506,
8209,
5,
6,
6,
13,
1,
26,
5,
3311,
31,
3726,
387,
73,
31,
13,
1,
4492,
9,
1503,
13221,
3616,
62,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery datatable Hidden column showing after calling another script .how can i hide the column specified permanently?
===
My table is
<table id="EmployeesTable" style="width: 100%;" class="grid-table06 border-one">
<thead>
<tr>
<th width="80%" align="left" valign="middle">
Name
</th>
<th width="20%" align="left" valign="middle">
Department
</th>
<th>
Id
</th>
</tr>
</thead>
</table>
My script as follows
<script type="text/javascript">
$(function () {
$(".switchDate").click(function () {
var id = $(this).attr("rel");
fetchEmployeedetails(id);
});
fetchEmployeedetails(@model.Id); //on load
function fetchEmployeedetails(id)
{
$("#EmployeesTable").dataTable({
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/Employees/FetchDetails?Deptid=" +id + "&thresholdLow=4&threshold=100",
"sPaginationType": "full_numbers",
"bDestroy": true,
"aaSorting": [[1,'desc']],
"asStripClasses": ['color01', 'color03'],
"aoColumnDefs": [{"aTargets": [2],"bVisible": false}, {"aTargets": [1],
"fnRender": function (oObj) { return "<a href='#showemployees' rel='" + oObj.aData[2] + "'></a>";
}
}]
});
}
});
on load it works fine not showing the hidden id but in case when i choose the id by switchDate on click function it causes the hidden column to be visible for second
How can i hide the column permenently anyone pls help
| 0 | [
2,
487,
8190,
93,
1054,
5924,
3689,
4698,
3187,
75,
2555,
226,
3884,
13,
9,
1544,
92,
31,
3077,
14,
4698,
9931,
8384,
60,
800,
3726,
3726,
51,
859,
25,
13,
1,
5924,
4924,
3726,
7,
1503,
13221,
3616,
1430,
579,
7,
1034,
3726,
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... |
Mongoid Polymorphic Association + FactoryGirl + RSpec
===
I'm trying to embed emails inside person Mongoid object using polymorphic approach. Getting "BSON::InvalidDocument: Cannot serialize an object of class Mongoid::Relations::Embedded::Many into BSON." whenever I run the test. Please see code below and any will be greatly appreciated. I'm not sure what is correct way to build emails inside person in FactoryGirl. Thanks.
class Email
include Mongoid::Document
include Mongoid::Timestamps
embedded_in :mailable, polymorphic: true
field :email, type: String
field :category, type: String
end
class Person
include Mongoid::Document
embeds_many :emails, as: :mailable #polymorhpic
index "emails.email", unique: true
field :first_name, type: String
field :middle_name, type: String
field :last_name, type: String
validates_uniqueness_of :emails
end
FactoryGirl.define do
sequence(:fn) {|n| "first_name#{n}" }
sequence(:ln) {|n| "last_name#{n}" }
factory :person do
first_name { generate(:fn) }
last_name { generate(:ln) }
gender 'M'
nationality 'USA'
ssn '123-88-1111'
factory :emails_ do
emails { Factory.build(:email) }
end
end
end
FactoryGirl.define do
sequence(:address) {|n| "user#{n}@mail.com" }
factory :email do
email { generate(:address) }
category 'personal'
end
end
| 0 | [
2,
21028,
6516,
3446,
12498,
596,
607,
2754,
3129,
9649,
2754,
13,
1224,
12610,
800,
3726,
3726,
31,
22,
79,
749,
20,
11911,
69,
8517,
18,
572,
840,
21028,
6516,
3095,
568,
3446,
12498,
596,
2141,
9,
1017,
13,
7,
220,
528,
45,
45,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
custom actionbar layout for fragment not inflating?
===
I have a custom layout since my icons are positioned in the left . There are two icons along along with text in the left side of action bar . I am using action Bar Sherlock Holmes library .
Used the following code in OnCreateView of my fragment
getSherlockActivity().getSupportActionBar().setDisplayShowHomeEnabled(false);
and i override the following method :
@Override
public void onCreateOptionsMenu(com.actionbarsherlock.view.Menu menu,
com.actionbarsherlock.view.MenuInflater inflater) {
ActionBar actionBar = getSherlockActivity().getSupportActionBar();
View view = getSherlockActivity().getLayoutInflater().inflate(R.layout.custom_menu_layout_with_back_icon, null);
TextView textView = (TextView) view.findViewById(R.id.action_bar_title);
textView.setText(getResources().getString(R.string.payment_info_actionbar_title));
actionBar.setCustomView(view);
//actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
super.onCreateOptionsMenu(menu, inflater);
}
Also how can i implement on click events ?Overriding onOptionsSelected will work for custom views action bar .
Thanks for the help.
| 0 | [
2,
5816,
1028,
1850,
9106,
26,
14847,
52,
19,
13830,
68,
60,
800,
3726,
3726,
31,
57,
21,
5816,
9106,
179,
51,
9801,
18,
50,
12125,
19,
14,
225,
13,
9,
80,
50,
81,
9801,
18,
303,
303,
29,
1854,
19,
14,
225,
270,
16,
1028,
74... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
dynamic binding of Button Content to an image button'sTextBlock?
===
I have a style for an image button as the following, how could I make the Text of the TextBlock, where equals "POSITION' below, the same as the Content of the button? Thanks.`
<Style x:Key="TopButtonStyle" TargetType="Button">
<Setter Property="Padding" Value="0"/>
<Setter Property="Button.BorderBrush" Value="SteelBlue" />
<Setter Property="Button.BorderThickness" Value="0" />
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<Grid Background="SteelBlue">
<Image Source="images/blue_button_up.png" HorizontalAlignment="Center" Margin="0,0,0,0" Height="Auto" Width="Auto" Stretch="UniformToFill"/>
<TextBlock Text="POSITION" HorizontalAlignment="Center" Foreground="White" Margin="5,5,0,0"/>
</Grid>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>` | 0 | [
2,
7782,
8728,
16,
5167,
2331,
20,
40,
1961,
5167,
22,
18,
11969,
12048,
60,
800,
3726,
3726,
31,
57,
21,
1034,
26,
40,
1961,
5167,
28,
14,
249,
15,
184,
110,
31,
233,
14,
1854,
16,
14,
1854,
12048,
15,
113,
2747,
18,
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... |
Protecting Executable Download in ASP.NET
===
I have an executable that I want to restrict who is able to download. I have UI trimming in place so the link is not present when the user is not authorized to download the executable. And I put a rule into the web.config to protect the resource from unauthorized downloads, but it doesn't seem to be working.
<location path="Utilities/SomeTool.exe">
<system.web>
<authorization>
<allow roles="SomeRole" />
<deny users="*"/>
</authorization>
</system.web>
</location>
What I see when I try to download the resource is the login page, which would be expected if the user didn't belong to the role that should be able to download the resource.
I can change the rule in the web.config so it allows a specific user, and I am able to access the executable with that particular user, but that won't work, as I'll need to modify the access rule for every user added to the role.
<location path="Utilities/SomeTool.exe">
<system.web>
<authorization>
<allow users="MyUserName"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
I have already setup the web.config to take advantage of the Integrated Pipeline in IIS7, by removing and re-adding a list of modules as directed on [this page][1]. This should setup my website to treat all resources as if they are ASP.NET resources.
Is anyone aware of what I might be missing in the configuration of IIS7 to protect the executable?
I have thought of other solutions that I could implement instead to protect the executable from an unauthorized download, such as creating a web service that the link would call into and return the resource. Then inside the web service I could perform the validation of the user's role before returning the executable. But that seems like it is more work than I should need to go through.
As a side note, the web.config works with my web site when it is hosted in Visual Studio 2010, but it fails when running in IIS7.
Thanks in advance.
[1]: http://learn.iis.net/page.aspx/244/how-to-take-advantage-of-the-iis-integrated-pipeline/ | 0 | [
2,
8718,
1396,
17194,
5924,
7121,
19,
28,
306,
9,
2328,
800,
3726,
3726,
31,
57,
40,
1396,
17194,
5924,
30,
31,
259,
20,
15436,
72,
25,
777,
20,
7121,
9,
31,
57,
13,
5661,
8971,
3863,
19,
209,
86,
14,
3508,
25,
52,
734,
76,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to convert Text to Image in Cocoa Objective-C
===
Looking for the proper way to convert text to an image in Cocoa. Everything seems to point to image to text not text to image. This was easy in the M$ world as you just created a bitmap and added the text to it, but i'm having difficulty finding this in cocoa.
Simply I would like to take a word(Kevin) and convert it into an image to manipulate(i.e. skew/etc) and save it to a jpeg.
KT
| 0 | [
2,
184,
20,
8406,
1854,
20,
1961,
19,
24507,
7038,
8,
150,
800,
3726,
3726,
699,
26,
14,
4119,
161,
20,
8406,
1854,
20,
40,
1961,
19,
24507,
9,
796,
2206,
20,
454,
20,
1961,
20,
1854,
52,
1854,
20,
1961,
9,
48,
23,
2010,
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... |
Regex passes in Rubular but not in Python
===
import re
import urllib.request
file_txt = urllib.request.urlopen("ftp://ftp.sec.gov/edgar/data/1408597/0000930413-12-003922.txt")
pattern_item4= re.compile("(Item\\n*\s*4.*)Item\\n*\s*5")
print(re.search(pattern_item4,bytes.decode(f)))
#Returns None
This regex returns what I want in rubular, but obviously it doesn't do what is expected in Python. Would anyone help me abit with this.
The intention of the regex is to basically extract stuff between item4 and item5.
Thank you | 0 | [
2,
7953,
1706,
3789,
19,
7598,
7451,
47,
52,
19,
20059,
800,
3726,
3726,
9010,
302,
9010,
13,
911,
211,
4598,
9,
99,
10351,
3893,
1,
38,
396,
38,
800,
13,
911,
211,
4598,
9,
99,
10351,
9,
911,
16942,
103,
5,
7,
3072,
306,
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... |
ajax dropdown chaking
===
I need some ajax code to do some functions with drop down. I have two table of values: one for category, then id . And I have tow dropdown to show these values.
First it should show:
select category
select id
category=A,B,C.
id=A(001,002,003),B(01,02,03),C(100,200,300) //note( here A,B,c are category)
when i select "A" category then show id=(001,002,003) if select "B" show id=(01,02,03) if select "C" show id=(100,200,300)
I want to do this with ajax. Does any one have a code to do this? | 0 | [
2,
20624,
2804,
2968,
2438,
1581,
800,
3726,
3726,
31,
376,
109,
20624,
1797,
20,
107,
109,
3719,
29,
2804,
125,
9,
31,
57,
81,
859,
16,
4070,
45,
53,
26,
3230,
15,
94,
4924,
13,
9,
17,
31,
57,
20,
499,
2804,
2968,
20,
298,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Inefficient SQL query with DATETIME calculations. How to optimize?
===
The problem comes from real environment where the `production_plan` table captures the order identification and other details in each row. Each row is updated when the product is started to be produced and after its production -- to capture UTC time of the events.
There is a separate table `temperatures` that collects several temperatures at the production line -- in regular intervals, independently on anything, stored with the UTC.
The goal is to extract the sequence of measured temperatures for production of each product. The simplified tables could be defined as:
-- about 91 000 rows
CREATE TABLE temperatures2 (
production_line uniqueidentifier NULL,
UTC datetime NULL,
temperature_1 float NULL
)
and
-- about 31 000 rows
CREATE TABLE production_plan2 (
order_id nvarchar(50) NOT NULL,
production_line uniqueidentifier NULL,
prod_start DATETIME NULL,
prod_end DATETIME NULL
)
No indexes were defined intentionally at this moment. The idea is to join the tables firstly on `production_line` identification, and secondly so, that the temperature UTC time fits between the UTC times of start/end of production of the item:
-- about 45 000 rows in about 24 seconds
SELECT pp.order_id, -- not related to the problem
pp.prod_start, -- UTC of the start of production
pp.prod_end, -- UTC of the end of production
t.UTC, -- UTC of the temperature measurement
t.temperature_1 -- the measured temperature
INTO result_table3
FROM production_plan2 AS pp
JOIN temperatures2 AS t
ON pp.production_line = t.production_line
AND t.UTC BETWEEN pp.prod_start
AND pp.prod_end
ORDER BY t.UTC;
The time about 24 seconds is not acceptable. It is probably because of lack of the indexes. Can you suggest what indexes should be created for the case?
**Second problem -- even much worse efficiency**
Because the temperature measurement is not too frequent and because the places of measurement is a bit shifted in time from starting the production, the time correction must be done. In other words, two offsets must be added to the time-range boundaries. I have ended with the query like this:
-- about 46 000 rows in about 9 minutes!
DECLARE @offset_start INT;
SET @offset_start = -60 -- one minute = one sample before
DECLARE @offset_end INT;
SET @offset_end = +60 -- one minute = one sample after
SELECT pp.order_id, -- not related to the problem
pp.prod_start, -- UTC of the start of production
pp.prod_end, -- UTC of the end of production
t.UTC, -- UTC of the temperature measurement
t.temperature_1 -- the measured temperature
INTO result_table4
FROM production_plan2 AS pp
JOIN temperatures2 AS t
ON pp.production_line = t.production_line
AND t.UTC BETWEEN DATEADD(second, @offset_start, pp.prod_start)
AND DATEADD(second, @offset_end, pp.prod_end)
ORDER BY t.UTC;
However, with the `DATEADD()` calculation, it takes about 9 minutes. I guess that there can be siginificant improvement after adding indexes. But what about the `DATEADD()` calculation? I suspect it can make indexes based on the `prod_start` and `prod_end` useless again.
Thanks for your suggestions. I will update the time results after introduction of the indexes suggested by you. Please, explain the reasons for the expected improvement. I am beginner concerning hands-on experience when writing SQL solutions. | 0 | [
2,
19,
23702,
4444,
255,
25597,
29,
1231,
891,
19186,
9,
184,
20,
22864,
60,
800,
3726,
3726,
14,
1448,
1624,
37,
683,
2307,
113,
14,
13,
1,
11386,
1,
9863,
1,
859,
3683,
18,
14,
389,
8575,
17,
89,
3289,
19,
206,
3131,
9,
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... |
Making a CMD for pyqt GUI app
===
I have been searching around on how to embed a CMD into a pyqt gui. I found the CMD module but it does not work with pyqt even when i did multithreading and processing. Does anyone have an idea or an example on how to? | 0 | [
2,
544,
21,
2390,
43,
26,
7103,
1251,
38,
9457,
4865,
800,
3726,
3726,
31,
57,
74,
5792,
140,
27,
184,
20,
11911,
69,
21,
2390,
43,
77,
21,
7103,
1251,
38,
9457,
9,
31,
216,
14,
2390,
43,
12613,
47,
32,
630,
52,
170,
29,
710... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 There Any Free Online Dictionary or Encyclopedia websites with JSON APIs?
===
As the question is...........
I have seen previous similar questions but there answers are outdated and do not help.
Anyone? | 1 | [
2,
50,
80,
186,
551,
2087,
9186,
54,
13084,
13931,
29,
487,
528,
21,
8954,
60,
800,
3726,
3726,
28,
14,
1301,
25,
9,
9,
9,
9,
9,
9,
9,
9,
9,
9,
9,
31,
57,
541,
1158,
835,
2346,
47,
80,
6709,
50,
70,
43,
1669,
17,
107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Can I use thrust::host_vector or I must use cudaHostAlloc for zero-copy with Thrust?
===
I want to use zero-copy on mapped memory by cudaHostGetDevicePointer. Can I use thrust::host_vector or I must use cudaHostAlloc(...,cudaHostAllocMapped)?
Or is it somehow easier to do with Thrust? | 0 | [
2,
92,
31,
275,
5777,
45,
45,
11694,
1,
28033,
54,
31,
491,
275,
272,
5729,
11694,
192,
10799,
26,
4606,
8,
19625,
29,
5777,
60,
800,
3726,
3726,
31,
259,
20,
275,
4606,
8,
19625,
27,
20877,
1912,
34,
272,
5729,
11694,
3060,
546... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Applet trouble - NoClassDefFoundError
===
I realize there's a million of these posts but none of them have helped me so here goes: I'm trying to deploy a very, very simple applet that will not load properly.
My HTML:
<html>
<head>
<meta http-equiv="Content-Type" content"text/html; charset=utf-8">
</head>
<body>
<applet code = "SimpleApplet.class"
width = "320" height = "100"></applet>
</body>
</html>
My Java:
public class SimpleApplet extends JApplet{
public void init(){
try{
SwingUtilities.invokeAndWait(new Runnable(){
public void run(){
JLabel lbl = new JLabel("Hello World");
add(lbl);
}
});
}
catch(Exception e){
System.out.println(e);
}
}
}
Both files are located in the same directory
/home/me/workspace/myProject/bin/test
If I run the applet on its own via Eclipse, it works fine. When I open the page I get the error
java.lang.NoClassDefFoundError: SimpleApplet (wrong name: test/SimpleApplet)
The error would suggest that I have incorrectly placed or named something. However, after trying
<applet code = "test/SimpleApplet.class"
width = "320" height = "100"></applet>
<applet code = "SimpleApplet.class"
codebase = "/test"
width = "320" height = "100"></applet>
along with other attempts, including removing the ", trying absolute and all partial path names, and using .java, it still does not work and I end up getting a ClassNotFoundException. [Other][1] [answers][2] point out that classpath and codebase (often relating to archive) issues are a primary reason for this occurring. However, I am not using a jar file and both files are in the same directory. Anyone know why this is occurring?
[1]: http://stackoverflow.com/questions/11396646/load-class-myapplet-not-found-java-lang-classnotfoundexception-why-am-i-gett
[2]: http://stackoverflow.com/questions/34413/why-am-i-getting-a-noclassdeffounderror-in-java | 0 | [
2,
4037,
38,
2572,
13,
8,
90,
1898,
13862,
12235,
29992,
800,
3726,
3726,
31,
4007,
80,
22,
18,
21,
507,
16,
158,
9868,
47,
2369,
16,
105,
57,
1456,
55,
86,
235,
1852,
45,
31,
22,
79,
749,
20,
17617,
21,
253,
15,
253,
1935,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Possible conflict between two scripts
===
I have this script which show/hides div's randomly. But for some reason it's not showing anything when the page is loaded:
$(document).ready(function() {
$('.control').on('click', function(e) {
e.preventDefault();
var field = $(this).data('field');
$('.hider:visible').fadeOut("slow", function() {
$('#' + field + '-gallery, #' + field + '-tag').fadeIn("slow");
});
});
var randomIndex = Math.floor((Math.random() * 100) + 1) % 5;
console.log(randomIndex);
var field = $($('a').get(randomIndex)).data('field');
$('#' + field + '-gallery, #' + field + '-tag').fadeIn("slow");
});
and I have this one (in the footer):
/* jQuery.noConflict() for using the plugin along with other libraries.
You can remove it if you won't use other libraries (e.g. prototype, scriptaculous etc.) or
if you include jQuery before other libraries in yourdocument's head tag.
[more info: http://docs.jquery.com/Using_jQuery_with_Other_Libraries] */
//jQuery.noConflict();
/* calling thumbnailScroller function with options as parameters */
(function($){
window.onload=function(){
$("#tS2").thumbnailScroller({
scrollerType:"clickButtons",
scrollerOrientation:"horizontal",
scrollSpeed:2,
scrollEasing:"easeOutCirc",
scrollEasingAmount:600,
acceleration:10,
scrollSpeed:900,
noScrollCenterSpace:10,
autoScrolling:0,
autoScrollingSpeed:2000,
autoScrollingEasing:"easeInOutQuad",
autoScrollingDelay:500
});
}
})(jQuery);
I noticed that if I enable the jQuery.noConflict in the script in the footer, I get an error in the inspector for the top script:
$(document).ready(function() {
$('.control').on('click', function(e) {
Uncaught TypeError: Property '$' of object [object Window] is not a function
e.preventDefault();
But if I disable the noConflict in the footer script, there are no errors, but the top script still doesn't work. Do I need to put another noConflict in the top script, or am I calling it wrong with the $(document).ready?
| 0 | [
2,
938,
2930,
128,
81,
17505,
800,
3726,
3726,
31,
57,
48,
3884,
56,
298,
118,
19522,
18,
13,
12916,
22,
18,
21324,
9,
47,
26,
109,
1215,
32,
22,
18,
52,
3187,
602,
76,
14,
2478,
25,
8572,
45,
5579,
5,
28132,
6,
9,
15193,
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... |
Unix - how to append next line to previous line in a file
===
How can i append the next line to a previous line in a file, delimited by pipe symbol?<br>
**Expectd Input -- content of input.txt**<br>
ABC
BCD
DEF
EFG
FGH
**Expectd Output -- content of output.txt**<br>
|ABC|BCD|
|BCD|DEF|
|DEF|EFG|
|EFG|FGH|
|FGH|| | 0 | [
2,
22540,
13,
8,
184,
20,
4865,
2451,
328,
293,
20,
1158,
293,
19,
21,
3893,
800,
3726,
3726,
184,
92,
31,
4865,
2451,
14,
328,
293,
20,
21,
1158,
293,
19,
21,
3893,
15,
121,
23012,
34,
7642,
4678,
60,
1,
5145,
1,
13,
1409,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Trouble connecting to QuickBooks web connector with SOAP web service PHP/.NET
===
I have been attempting to create a simple web service capable of connecting to the Quickbooks web connector (v2.1.0.30) with quickbooks 2012 on windows 7.
The implementation is clearly described in the programming guide (<http://developer.intuit.com/qbsdk-current/doc/pdf/qbwc_proguide.pdf>).
I keep getting the same error at the authenticate method regardless of the implementation. I first tried to create the web service with php on apache2.2. Thinking it might be an issue communicating between PHP/.NET, I recreated the web service using .Net3.5/VisualStudio 2010 and ended up with the same problem.
It appears as though the first two function calls succeed and the problem is in the authenticate function. The first two simply return a string, while authenticate attempts to return a string array. Perhaps there is a problem with the way the string[] is interpreted.
Any help would be much appreciated.
QBWebConnector.SOAPWebService.instantiateWebService() : AppURL: localhost:1185/Service1.asmx
<br>QBWebConnector.SOAPWebService.do_serverVersion() : Calling serverVersion().
<br>QBWebConnector.SOAPWebService.do_serverVersion() : Received from serverVersion() following parameter:serverVersionRet=""
<br>QBWebConnector.SOAPWebService.do_serverVersion() : This application sent a null for server version. Allowing update operation.
<br>QBWebConnector.SOAPWebService.do_clientVersion() : Calling clientVersion() with following parameter:<productVersion="2.1.0.30">
<br>QBWebConnector.SOAPWebService.do_clientVersion() : Received from clientVersion() following parameter:clientVersionRet=""
<br>QBWebConnector.SOAPWebService.do_clientVersion() : This application agrees with the current version of QBWebConnector. Allowing update operation.
<br>QBWebConnector.SOAPWebService.do_authenticate() : Authenticating to application
<br>QBWebConnector.SOAPWebService.do_authenticate() : *** Calling authenticate() with following parameters:userName="test"password=MaskedForSecurity
<br>QBWebConnector.SOAPWebService.do_authenticate() : QBWC1012: Authentication failed due to following error message. Object reference not set to an instance of an object.**
More info:
StackTrace = at QBWebConnector.WebService.do_authenticate(String& ticket, String& companyFileName)<br>
Source = QBWebConnector
QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
QBWebConnector.RegistryManager.setUpdateLock() : Update session unlocked
QBWebConnector.WebServiceManager.DoUpdateSelected() : Update completed with errors.
QBWebConnector.RegistryManager.setUpdateLock() : HKEY_CURRENT_USER\Software\Intuit\QBWebConnector\UpdateLock has been set to False
QBWebConnector.RegistryManager.setUpdateLock() : Update session unlocked
StopFlexConnector : Object reference not set to an instance of an object.
StopFlexConnector : at QBWebConnector.QBWebConnector.StopFlexConnector() | 0 | [
2,
2572,
6440,
20,
2231,
13828,
2741,
17991,
29,
6447,
2741,
365,
13,
26120,
118,
9,
2328,
800,
3726,
3726,
31,
57,
74,
6314,
20,
1600,
21,
1935,
2741,
365,
3868,
16,
6440,
20,
14,
2231,
13828,
2741,
17991,
13,
5,
710,
135,
9,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fancybox 2 Custom Close Button and Infinite Scroll
===
I am having an issue closing Fancybox using a custom close button on content that is pulled in via Infinite Scroll.
http://fancyapps.com/fancybox/
http://www.infinite-scroll.com/
Everything that is included on the page before Infinite Scroll can open and close just fine. For content that is pulled in via Infinite Scroll, I can launch the Fancybox without issue, but upon clicking close, I simply get thrown backup to the top of the page and the Fancybox never closes.
Here is the code I'm using:
**HTML**
<a href="#" class="fncy-custom-close">
<span>Close</span>
</a>
**JS**
$(document).ready(function() {
$('.fancybox').fancybox({
padding : 0,
scrolling : 'no',
arrows : false,
closeBtn : false,
helpers : {
overlay: {
opacity: 0.6
}
}
});
$('a.fncy-custom-close').click(function(e){
e.preventDefault();
$.fancybox.close();
});
});
Any help is greatly appreciated. Thanks. | 0 | [
2,
12251,
5309,
172,
5816,
543,
5167,
17,
9698,
12159,
800,
3726,
3726,
31,
589,
452,
40,
1513,
4239,
12251,
5309,
568,
21,
5816,
543,
5167,
27,
2331,
30,
25,
881,
19,
1197,
9698,
12159,
9,
7775,
6903,
410,
10821,
7753,
18,
9,
960... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.