unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
EXtJS chart bar/column not fitting in window container, expanding beyond/out of it
===
I am using EXtJS charts to chart data and for some reason it is expanding to the right of window containing it and when using columns, above the window. It seems to be a scaling issue as with just one column/bar it scales and fits everything in perfectly.

{
title: title,
closable:true,
collapsible: true,
//width: 600,
height: 400,
layout: 'fit',
store: Ext.create('Ext.data.Store', {
fields : [ 'metrics', 'dimensions' ],
data : [ {'metrics':metrics, 'dimensions':dimensions}
]
}),
tbar: [{
text: 'Save Chart',
handler: function() {
Ext.MessageBox.confirm('Confirm Download', 'Would you like to download the chart as an image?', function(choice){
if(choice == 'yes'){
var chart = Ext.getCmp('barchart');
chart.save({
type: 'image/png'
});
}
});
}
}, {
text : 'Add a Date Range',
handler : function() {
DateMenu.showBy(this,"bl");
dateMenuContext=this;
}
}],
items: [
{
xtype: 'chart',
animate: true,
shadow: true,
style: 'background:#fff',
store: store,
legend: {
position: 'right'
},
axes: [{
type: 'Numeric',
position: axesposition,
fields: x,
title: title+String(" [Metrics: "+String(metrics)).concat(((dimensions!=null)&&(dimensions!=""))? String(", Dimensions: "+dimensions+"]") : "]"),
grid: true,
minimum: 0,
label: {
renderer: function(v) {
return String(v);
}
},
roundToDecimal: false
}, {
type: 'Category',
position: categoryposition,
fields: y,
title: false
}],
series: [{
type: tp,
label : {
display : "outside",
color : '#333',
'text-anchor' : 'middle',
field : x
},
axis: seriesaxisposition,
gutter: 80,
xField: y,
yField: x,
highlight: true,
tips: {
trackMouse: true,
width: 140,
height: 28,
renderer: function(storeItem, item) {
this.setTitle(String(item['yField'])+": "+String(item.value[1]));
}
}
}]
},
]
}; | 0 | [
2,
1396,
38,
728,
18,
1795,
748,
118,
716,
4404,
103,
52,
11857,
19,
1463,
12147,
15,
9393,
1701,
118,
1320,
16,
32,
800,
3726,
3726,
31,
589,
568,
1396,
38,
728,
18,
5158,
20,
1795,
1054,
17,
26,
109,
1215,
32,
25,
9393,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Class implementing Externalizable have a map?
===
I have a class that is implementing the Externalizable interface. The only attribute of the class is a Map, the values of which are objects of other classes which implement the Externalizable interface. I'm not able to serialize this map using the ObjectOutput, and was wondering if that's even possible? Sorry if this is a silly question, this is the first time I'm reading about serialization and stuff.
Thanks! | 0 | [
2,
718,
17333,
4886,
3186,
579,
57,
21,
2942,
60,
800,
3726,
3726,
31,
57,
21,
718,
30,
25,
17333,
14,
4886,
3186,
579,
6573,
9,
14,
104,
35,
14755,
16,
14,
718,
25,
21,
2942,
15,
14,
4070,
16,
56,
50,
3916,
16,
89,
2684,
56... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using a boolean attribute as a conditional on an update action on a model in Rails 3
===
Imagine I have a boolean and a string attribute on my model with data like this:
Model.locked => true
Model.status => "Available"
When the Update action is invoked, I want to use the boolean attribute to control whether the string attribute gets modified by the update, all other attributes in the update should be saved regardless.
So if
Model.locked => true
and we try
Model.status = "Sold"
then
Model.status => "Available"
Currently I have my model like this...
before_update :dont_update_locked_item, :if => :item_locked?
def item_locked?
self.locked
end
def dont_update_locked_item
#Some rails magic goes here
end
How do I prevent a single attribute from being updated?
I know the answer is going to hurt, but someone help me out. It's late, I'm tired and I'm fresh out of talent. ;-) | 0 | [
2,
568,
21,
9827,
413,
210,
35,
14755,
28,
21,
21206,
27,
40,
11100,
1028,
27,
21,
1061,
19,
2240,
18,
203,
800,
3726,
3726,
4382,
31,
57,
21,
9827,
413,
210,
17,
21,
3724,
35,
14755,
27,
51,
1061,
29,
1054,
101,
48,
45,
1061,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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# freezes when I try to get content of url
===
First see my Source Code:
WebClient client = new WebClient();
String url = "http://localhost";
client.Headers.Add("user-agent", "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.0.3705;)");
try
{
Stream data = client.OpenRead(url);
if (data == null)
throw new WebException("Cannot browse the url...");
StreamReader reader = new StreamReader(data);
string s = reader.ReadToEnd();
textBox1.Text = s;
data.Close();
reader.Close();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
When I run my application, It will freeze in the duration of this operation.
Which part of my code is wrong? | 0 | [
2,
272,
5910,
11551,
18,
76,
31,
1131,
20,
164,
2331,
16,
287,
6362,
800,
3726,
3726,
64,
196,
51,
1267,
1797,
45,
2741,
150,
18513,
38,
6819,
800,
78,
2741,
150,
18513,
38,
5,
6,
73,
3724,
287,
6362,
800,
13,
7,
21127,
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... |
Why am I missing git2.h and how do I get it back?
===
I am experiencing an odd problem every time I try the set-up of pygit2. Below is what I run and the error generated.
$ python3 setup.py install
running install
running build
running build_py
running build_ext
building '_pygit2' extension
/usr/bin/clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/include -I/usr/local/include -Iinclude -I/usr/local/Cellar/python3/3.2.3/include/python3.2m -c src/pygit2.c -o build/temp.macosx-10.7-x86_64-3.2/src/pygit2.o
In file included from src/pygit2.c:32:
include/pygit2/error.h:6:10: fatal error: 'git2.h' file not found
#include <git2.h>
^
1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
I think I have successfully installed libgit2 (the build and make finished fine). Maybe it is a path issue? I have set LIBGIT2 environment variable to the src directory in the libgit2 folder. Is that the right place?
Any help would be appreciated!
NZ | 0 | [
2,
483,
589,
31,
2863,
13,
10404,
135,
9,
252,
17,
184,
107,
31,
164,
32,
97,
60,
800,
3726,
3726,
31,
589,
15138,
40,
4210,
1448,
352,
85,
31,
1131,
14,
309,
8,
576,
16,
7103,
10404,
135,
9,
1021,
25,
98,
31,
485,
17,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to custom sort array by a specific month key
===
I am sure this has been answered somewhere before but I couldn't find the answer to this exact case...
I know I can use the usort function, but can't figure out the logic to do what I want eventhough it's relatively simple
I have a dynamic area being generated as such:
$details[$pageYear][$pageMonth][] = array("id"=>$page['id'],"title"=>$page['title']);
I want the array $details to be eventually sorted descending by year, then by month
the month value is string (january, february, march, etc... and not numeric), which seems to be my main issue (how to sort the month 'strings' by actual order and not letter order)
any help would be greatly appreciated
sorry if this turns out to be a duplicate | 0 | [
2,
184,
20,
5816,
2058,
7718,
34,
21,
1903,
1617,
1246,
800,
3726,
3726,
31,
589,
562,
48,
63,
74,
3094,
3493,
115,
47,
31,
711,
22,
38,
477,
14,
1623,
20,
48,
5340,
610,
9,
9,
9,
31,
143,
31,
92,
275,
14,
287,
22843,
1990,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 hibernate validator JodaTime bean validation constraints in JBoss
===
We have an enterprise application that uses the Joda DateTime library. The application is deployed into a JBoss 7.2.0 Alpha1 Container. Some classes in our domain model have @Past annotations on fields of type DateTime. In order to validate these constraints we'd like to use the constraint validators provided by hibernate-validator. Therefore we added a dependency 'org.hibernate.validator' to the MANIFEST.MF of our ear file. We are using version 2.0 of the Joda library. Therefore we have packaged the joda-time-2.0.jar file in our ear. We are not using the version 1.6.2 that is available as a module of JBoss 7
When validating an object with a DateTime field following exception is thrown:
10:51:41,140 ERROR [org.acme.GlobalExceptionHandler] (EJB default - 10) Exception caught by global exception handler: javax.validation.UnexpectedTypeException: No validator could be found for type: org.joda.time.DateTime
at org.hibernate.validator.engine.ConstraintTree.verifyResolveWasUnique(ConstraintTree.java:383) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.validator.engine.ConstraintTree.findMatchingValidatorClass(ConstraintTree.java:364) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.validator.engine.ConstraintTree.getInitializedValidator(ConstraintTree.java:313) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:144) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:117) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:84) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
at org.hibernate.validator.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:452) [hibernate-validator-4.2.0.Final.jar:4.2.0.Final]
After some debugging we detected that the call to 'TypeUtils.isAssignable( validatorType, type )' in 'ConstraintTree.findSuitableValidatorTypes' fails since the available validator types are taken from the Joda library that has been shipped with JBoss instead of the Joda library that is packaged in our ear file.
I guess we are doing something wrong regarding classloading. Can anybody give me a hint? | 0 | [
2,
568,
4148,
2102,
8820,
7394,
3457,
2640,
593,
891,
15322,
27999,
16747,
19,
487,
10349,
18,
800,
3726,
3726,
95,
57,
40,
6002,
3010,
30,
2027,
14,
2640,
593,
1231,
891,
1248,
9,
14,
3010,
25,
6698,
77,
21,
487,
10349,
18,
453,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Parsing Environment Variables as Arguments in JNLP File
===
I would like to know if there is a way of passing windows environment variables as arguments in JNLP files?
I have a JNLP file in which I specify an argument which should be passed to the application's main method. If possible I would like the argument to take the form %USERPROFILE%/dir/file however when I try to execute like this webstart is taking userprofile as a literal value instead of replacing with the environment variable. | 0 | [
2,
2017,
18,
68,
2307,
12157,
28,
10553,
19,
13,
19180,
5478,
3893,
800,
3726,
3726,
31,
83,
101,
20,
143,
100,
80,
25,
21,
161,
16,
2848,
1936,
2307,
12157,
28,
10553,
19,
13,
19180,
5478,
6488,
60,
31,
57,
21,
13,
19180,
5478,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Solr StandardTokenizerFactory keep one char
===
I want to keep one character the "@" sign when using the standardtokenizer from solr/lucene, and let it do its work. Is that possible? I've been going through the different tokenizers and it seems that this is not built in. Is that correct? | 0 | [
2,
7176,
139,
1236,
262,
2853,
11907,
17455,
93,
643,
53,
4892,
800,
3726,
3726,
31,
259,
20,
643,
53,
925,
14,
13,
7,
1,
7,
1676,
76,
568,
14,
1236,
262,
2853,
11907,
37,
7176,
139,
118,
2377,
13739,
15,
17,
408,
32,
107,
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... |
Changing url and path to object level Paperclip
===
I have one polymorphic model which has attachment. For example:
Image : Polymorphic model
Product and Customer are two different model which uses Image as polymorphic
Image model has attachment called :file which has :path and :url.
I don't want to share :url and :path for Product and customer.
I need different url and path for Product and Customer model (i.e) I want to differentiate
url and path based on object type.
Please help me. | 0 | [
2,
4226,
287,
6362,
17,
2013,
20,
3095,
662,
1397,
150,
6013,
800,
3726,
3726,
31,
57,
53,
3446,
12498,
596,
1061,
56,
63,
14575,
9,
26,
823,
45,
1961,
13,
45,
3446,
12498,
596,
1061,
2374,
17,
7705,
50,
81,
421,
1061,
56,
2027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
hyper v cluster
===
I want to create a hyper v cluster.I want to know how to create a hyper v cluster with SCVMM and without SCVMM.
what are the power shell or WMI commands to create the cluster?
what type of clusters provided/possible in hyper v? | 0 | [
2,
5443,
566,
7460,
800,
3726,
3726,
31,
259,
20,
1600,
21,
5443,
566,
7460,
9,
49,
259,
20,
143,
184,
20,
1600,
21,
5443,
566,
7460,
29,
13,
18,
12732,
3363,
17,
366,
13,
18,
12732,
3363,
9,
98,
50,
14,
414,
3593,
54,
619,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 break or continue knockout's arrayforeach?
===
This is sample code. I want to break (or continue) knockout's ko.util.arrayForEach.
ko.utils.arrayForEach(items, function (item) {
if (...) break;
if (...) continue;
} | 0 | [
2,
184,
92,
31,
1442,
54,
1816,
11676,
22,
18,
7718,
1106,
14322,
60,
800,
3726,
3726,
48,
25,
5717,
1797,
9,
31,
259,
20,
1442,
13,
5,
248,
1816,
6,
11676,
22,
18,
1584,
9,
14255,
9,
8576,
93,
1106,
14322,
9,
1584,
9,
14255,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: how to add "cartoon" style animation (movie) to the slide?
===
I'm wondering if it's possible to have a slide with text AND add some animation into it for an iPad app. See screenshot below to get an idea of what I need. I want that guy jump up and down and smile. I'm sure I'm not capable of drawing that image using Objective-C primitives myself, so I'm looking at the following options:
1. Do complete animation in 3rd-party tool (Adobe?) and then add it as single standalone file on the slide. But I do not know, what formats are supported in iOS, what are standard formats, etc. Can somebody clarify this please?
2. Do complete animation, and then save frames as images, and then quickly change images to give illusion of a movie.
Am I missing something? Are there any other ways? what's the best option?
Please let me know if I'm not clear enough - I will try to provide more information.
Thank you.
![enter image description here][1]
[1]: http://i.stack.imgur.com/uBJ4d.png | 0 | [
2,
13,
7760,
45,
184,
20,
3547,
13,
7,
1367,
262,
218,
7,
1034,
6236,
13,
5,
22607,
6,
20,
14,
6464,
60,
800,
3726,
3726,
31,
22,
79,
5712,
100,
32,
22,
18,
938,
20,
57,
21,
6464,
29,
1854,
17,
3547,
109,
6236,
77,
32,
26,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.NET https authentication (pingdom api)
===
I have to receive the API from Pingdom. The address is https://api.pingdom.com
How can I in .NET do a http get when it is https? Google gives me nothing to work with :(
Best regards | 0 | [
2,
13,
9,
2328,
7775,
18,
27963,
13,
5,
3181,
5555,
21,
2159,
6,
800,
3726,
3726,
31,
57,
20,
2588,
14,
21,
2159,
37,
13,
3181,
5555,
9,
14,
3218,
25,
7775,
18,
6903,
2552,
49,
9,
3181,
5555,
9,
960,
184,
92,
31,
19,
13,
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... |
selecting a specific children element using jquery?
===
i want to select a specific children elements from the $el.html, thiers two types of children elements, one with `<span>....</span>`, the other has a span class `<span class = "special">..</span>` for example:
var orig = $(".example").html()
,$el = $(".example")
,text = $.trim($el.text())
,words = text.split(" ")
,html = "";
for (var i = 0; i < words.length; i++) {
if (words[i] === "senior")
html += "<span class='special'>" + words[i] + ((i+1) === words.length ? "" : " ") + "</span>";
else
html += "<span>" + words[i] + ((i+1) === words.length ? "" : " ") + "</span>";
};
$el.html(html).children().hide().each(function(i){
// if $('span.special')
$(this).delay(i*200).fadeIn(700);
// else (normal span)
$(this).delay(i*600).fadeIn(900);
}).promise().done(function(){
$('.example:first').html(orig)
})
i tried searching this on google, couldn't find anything specfic, thanks
> the working demo is here : http://jsfiddle.net/6czap/15/ | 0 | [
2,
20764,
21,
1903,
391,
4520,
568,
487,
8190,
93,
60,
800,
3726,
3726,
31,
259,
20,
5407,
21,
1903,
391,
2065,
37,
14,
5579,
532,
9,
15895,
15,
8581,
445,
81,
2551,
16,
391,
2065,
15,
53,
29,
13,
1,
18,
3206,
1,
9,
9,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ruby on Rails: jquery Datepicker alternate field format change
===
I'm trying to search on a date, and the format in my database is, 2012-05-15. When I use datepicker, I have it so that the user can pick a date and it is then displayed as 15-05-2012.
I'm wanting to search on the 2012-05-15 format, without changing the way the viewer sees it. I tried to change format in the model, but had no luck.
Here's my search view:
<%= form_tag search_path, method: :get do %>
<%= text_field_tag("start_date") %></br>
<%= submit_tag "Search", name: nil %>
<% end %>
Here's my application.js:
jQuery(function(){
jQuery('#start_date').val("");
jQuery('#start_date').datepicker({dateFormat: 'dd-mm-yy'});
});
My Controller:
def search
@project_search = Project.search( params[:start_date].order(sort_column + ' ' + sort_direction).paginated_for_index(per_page, page)
@project = Project.new(params[:project])
respond_to do |format|
format.html # search.html.erb
format.json { render :json => @project }
end
end
and my model:
def self.search(search_start_date)
return scoped unless search_start_date.present?
where([start_date LIKE ?, "%#{search_start_date}%"])
end
I tried using jquery options, but had no luck.
jQuery(function(){
jQuery('#start_date').val("");
jQuery('#start_date').datepicker({altField: '#start_date2', dateFormat: 'yy-mm-dd'});
});
Hopefully someone can help me out. Thanks in advance! | 0 | [
2,
10811,
27,
2240,
18,
45,
487,
8190,
93,
1231,
16855,
106,
4912,
575,
2595,
753,
800,
3726,
3726,
31,
22,
79,
749,
20,
2122,
27,
21,
1231,
15,
17,
14,
2595,
19,
51,
6018,
25,
15,
563,
8,
4071,
8,
1193,
9,
76,
31,
275,
1231... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
View is getting inflated everytime in getView. findViewById(...) is done many times. I have used View Holder
===
public View getView(final int pos, View arg1, ViewGroup arg2) {
ViewHolder holder;
View view=arg1;
if(arg1==null)
{
holder =new ViewHolder();
System.out.println("Inflating view");
arg1=mInflater.inflate(R.layout.inflatefreedownlod,arg2 ,false);
holder.im= (ImageView) arg1.findViewById(R.id.imf1);
holder.tv1= (TextView) arg1.findViewById(R.id.tvf1);
holder.tv2= (TextView) arg1.findViewById(R.id.mini1);
holder.tv3= (TextView) arg1.findViewById(R.id.m1);
arg1.setTag(holder);
}
else
{
holder = (ViewHolder) arg1.getTag();
}
holder.tv1.setText(NAME.get(pos).toString());
holder.tv2.setText(contentName.get(pos).toString());
holder.tv3.setText(minidescp.get(pos).toString());
URL url1;
try {
url1 = new URL(imurl.get(pos).toString());
bmp = BitmapFactory.decodeStream(url1.openConnection().getInputStream());
holder.im.setImageBitmap(bmp);
//bmp.recycle();
}catch (Exception e) {
e.printStackTrace();
}
arg1.setOnClickListener(new OnClickListener()
{
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
for(int i=0;i<NAME.size();i++)
if(pos==i)
{
getFreeContent(Cid.get(pos).toString(),Vid.get(pos).toString(),contentName.get(pos).toString());
}
}
});
return arg1;
}
I see the logcat which shows Inflating View 3 times. I have 3 LinearLayout displayed in listview when i test it on emulator. Why is my view null everytime?. View also is inflated every time. Anything wrong with my code | 0 | [
2,
1418,
25,
1017,
29788,
352,
891,
19,
164,
4725,
9,
477,
4725,
779,
1340,
5,
9,
9,
9,
6,
25,
677,
151,
436,
9,
31,
57,
147,
1418,
8979,
800,
3726,
3726,
317,
1418,
164,
4725,
5,
4932,
19,
38,
12928,
15,
1418,
13,
10663,
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... |
Jasperreport with xml subreport xPath
===
Hi all i have a master report that call a sub report when a group change.
I pass two Document that are the different datasource for the master and the sub report.
The subreport is printing , but every subreport lose the 2 first records of the data.
I think is a wrong xPath expression, but i try several solution but no one works for me.
Master :
<queryString language="xPath"><![CDATA[riepilogo-ec/dettagli/dettaglio]]></queryString>
<group name="GiroGroup" isStartNewColumn="false" isStartNewPage="false"
isReprintHeaderOnEachPage="true" keepTogether="true">
<groupExpression>
<![CDATA[$F{giro}]]>
</groupExpression>
<groupFooter>
<band height="20" isSplitAllowed="false">
<subreport>
<reportElement isPrintRepeatedValues="true" x="0" y="0" width="507" height="10"
isRemoveLineWhenBlank="true" backcolor="#ffcc99"> </reportElement>
<subreportParameter name="REPORT_DATA_SOURCE">
<subreportParameterExpression>
<![CDATA[new net.sf.jasperreports.engine.data.JRXmlDataSource( $P{subTotale}).dataSource("totali/totale[@giro=" + $F{giro}+ "]/tot-cau")]]>
<!-- <![CDATA[new net.sf.jasperreports.engine.data.JRXmlDataSource( $P{subTotale})]]>-->
<!--<![CDATA[new net.sf.jasperreports.engine.data.JRXmlDataSource( $P{subTotale}).subDataSource("/totali/totale[@giro=1]")]]>-->
</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="XML_DATE_PATTERN">
<subreportParameterExpression>$P{XML_DATE_PATTERN}</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="XML_NUMBER_PATTERN">
<subreportParameterExpression>$P{XML_NUMBER_PATTERN}</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="XML_LOCALE">
<subreportParameterExpression>$P{XML_LOCALE}</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="XML_TIME_ZONE">
<subreportParameterExpression>$P{XML_TIME_ZONE}</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="pageNumberMaster">
<subreportParameterExpression>$V{PAGE_NUMBER}</subreportParameterExpression>
</subreportParameter>
<subreportParameter name="giro">
<subreportParameterExpression>$F{giro}</subreportParameterExpression>
</subreportParameter>
<subreportExpression class="net.sf.jasperreports.engine.JasperReport"
>$P{subReport}</subreportExpression>
</subreport>
</band>
</groupFooter>
</group>
Sub report :
<queryString language="xPath"><![CDATA[totali/totale/tot-cau]]></queryString>
Master data :
<dettagli>
<dettaglio>
<giro>1</giro>
<cod-riv>1</cod-riv>
<check-digit>G</check-digit>
<desc-riv>FUSARO GIANCARLO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.162,44 </forniture>
<addebiti/>
<rese>461,46 </rese>
<accrediti/>
<saldo-contabile/>
<saldo-ec>700,98 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>2</cod-riv>
<check-digit>H</check-digit>
<desc-riv>BENINI LAURA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>785,16 </forniture>
<addebiti/>
<rese>250,92 </rese>
<accrediti/>
<saldo-contabile/>
<saldo-ec>534,24 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>4</cod-riv>
<check-digit>J</check-digit>
<desc-riv>CAMPOLONGO FLAVIO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>7.472,82 </forniture>
<addebiti/>
<rese>443,84 </rese>
<accrediti/>
<saldo-contabile/>
<saldo-ec>7.028,98 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>5</cod-riv>
<check-digit>K</check-digit>
<desc-riv>LA COMETA S.N.C.</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>877,32 </forniture>
<addebiti/>
<rese>29,48 </rese>
<accrediti/>
<saldo-contabile>302,40 </saldo-contabile>
<saldo-ec>847,84 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>68</cod-riv>
<check-digit>V</check-digit>
<desc-riv>BENINI DAVIDE</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.073,16 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile>1.507,56 </saldo-contabile>
<saldo-ec>1.073,16 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>101</cod-riv>
<check-digit>C</check-digit>
<desc-riv>AMBROSI CARLA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.127,34 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile>1.276,80 </saldo-contabile>
<saldo-ec>1.127,34 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>110</cod-riv>
<check-digit>L</check-digit>
<desc-riv>JANA HAVRLANTOVA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>579,06 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>579,06 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>228</cod-riv>
<check-digit>Z</check-digit>
<desc-riv>PIZZINI ARTURO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>985,50 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>985,50 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>252</cod-riv>
<check-digit>X</check-digit>
<desc-riv>PERINA ROBERTO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>5.099,76 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile>1.347,36 </saldo-contabile>
<saldo-ec>5.099,76 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>279</cod-riv>
<check-digit>Y</check-digit>
<desc-riv>FASOLI GIUSEPPE</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>611,10 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>611,10 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>256</cod-riv>
<check-digit>B</check-digit>
<desc-riv>MIGLIORINI VITTORINA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.077,66 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>1.077,66 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>309</cod-riv>
<check-digit>C</check-digit>
<desc-riv>CASTIONI SERGIO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>8.302,44 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile>447,30 </saldo-contabile>
<saldo-ec>8.302,44 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>310</cod-riv>
<check-digit>D</check-digit>
<desc-riv>EDICOLA MANCALACQUA SNC</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>716,40 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>716,40 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>332</cod-riv>
<check-digit>Z</check-digit>
<desc-riv>VILLABONI ANNA MARIA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>571,68 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>571,68 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>376</cod-riv>
<check-digit>R</check-digit>
<desc-riv>ZARAMELLA NADIA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>581,94 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>581,94 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>404</cod-riv>
<check-digit>T</check-digit>
<desc-riv>CASTIONI GIORGIO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.508,94 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>1.508,94 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>405</cod-riv>
<check-digit>U</check-digit>
<desc-riv>CARTOLERIA AMBROSI DANIEL</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.029,42 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>1.029,42 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>395</cod-riv>
<check-digit>K</check-digit>
<desc-riv>EDERLE MIRELLA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>304,20 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile>178,80 </saldo-contabile>
<saldo-ec>304,20 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>486</cod-riv>
<check-digit>X</check-digit>
<desc-riv>RAGUSO ANTONIO</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>545,40 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>545,40 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>558</cod-riv>
<check-digit>R</check-digit>
<desc-riv>TROIANI SAS</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>3.741,66 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>3.741,66 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>514</cod-riv>
<check-digit>Z</check-digit>
<desc-riv>IL PUNTO DI COPPINI M.</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>959,22 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile>1.194,48 </saldo-contabile>
<saldo-ec>959,22 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>515</cod-riv>
<check-digit>A</check-digit>
<desc-riv>GIOACHINI LAURA</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>5.450,30 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>5.450,30 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>624</cod-riv>
<check-digit>F</check-digit>
<desc-riv>GDO PRESS S.R.L.</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>190,08 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>190,08 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>700</cod-riv>
<check-digit>D</check-digit>
<desc-riv>MACH 2 AUTOGR.SCAL.NORD</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.118,52 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>1.118,52 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>701</cod-riv>
<check-digit>E</check-digit>
<desc-riv>MACH 2 AUTOGR.SCAL.SUD</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.118,52 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>1.118,52 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>1</giro>
<cod-riv>814</cod-riv>
<check-digit>N</check-digit>
<desc-riv>MACH DUE C/O IL SOLE SOMM</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>785,16 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>785,16 </saldo-ec>
</dettaglio>
<dettaglio>
<giro>2</giro>
<cod-riv>259</cod-riv>
<check-digit>E</check-digit>
<desc-riv>EL GIORNALAR</desc-riv>
<riporto/>
<versamenti-acconti/>
<riporto/>
<forniture>1.051,20 </forniture>
<addebiti/>
<rese/>
<accrediti/>
<saldo-contabile/>
<saldo-ec>1.051,20 </saldo-ec>
</dettaglio>
</dettagli>
SubReport data :
<?xml version="1.0" ?>
<totali>
<totale giro="1">
<tot-cau>
<cod-cau-tot>5</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Resa Periodici Esteri</desc-cau-tot>
<importo-cau>9,74 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>201</cod-cau-tot>
<tipo-cau-tot>1</tipo-cau-tot>
<desc-cau-tot>NS.FATTURA 20%</desc-cau-tot>
<importo-cau>6.254,70 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>52</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Fornitura Periodici esteri</desc-cau-tot>
<importo-cau>15,10-</importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>11</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>RESA X CESS.ATTIVITA'</desc-cau-tot>
<importo-cau>79,18 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>38</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Diff. resa quotidiani</desc-cau-tot>
<importo-cau>169,32 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>76</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Add.lavorazione extra</desc-cau-tot>
<importo-cau>0,00 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>54</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Fornitura Quot./Illus.</desc-cau-tot>
<importo-cau>30,54 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>2</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Resa Quotidiani</desc-cau-tot>
<importo-cau>28,26 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>1</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Versamento</desc-cau-tot>
<importo-cau>23.319,64 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>8</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Integrazione resa periodici</desc-cau-tot>
<importo-cau>210,16 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>3</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Resa PERIODICI</desc-cau-tot>
<importo-cau>353,72 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>46</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Versamento RID</desc-cau-tot>
<importo-cau>19.439,04 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>4</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Resa Periodici esteri</desc-cau-tot>
<importo-cau>332,32 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>41</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>ACCREDITO RESA FUORI BOLLA</desc-cau-tot>
<importo-cau>3,00 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>51</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Fornitura PERIODICI</desc-cau-tot>
<importo-cau>26.464,00 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>108</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Insoluto RID</desc-cau-tot>
<importo-cau>200,00 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>50</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Fornitura Quotidiani</desc-cau-tot>
<importo-cau>90,10 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>86</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>ADDEBITO CONTO DEPOSITO</desc-cau-tot>
<importo-cau>21.205,66 </importo-cau>
</tot-cau>
</totale>
<totale giro="2">
<tot-cau>
<cod-cau-tot>201</cod-cau-tot>
<tipo-cau-tot>1</tipo-cau-tot>
<desc-cau-tot>NS.FATTURA 20%</desc-cau-tot>
<importo-cau>2.539,80 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>51</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Fornitura PERIODICI</desc-cau-tot>
<importo-cau>27.180,72 </importo-cau>
</tot-cau>
<tot-cau>
<cod-cau-tot>1</cod-cau-tot>
<tipo-cau-tot>10</tipo-cau-tot>
<desc-cau-tot>Versamento</desc-cau-tot>
<importo-cau>7.196,26 </importo-cau>
</tot-cau>
</totale>
</totali> | 0 | [
2,
16750,
17437,
29,
23504,
972,
17437,
993,
8353,
800,
3726,
3726,
4148,
65,
31,
57,
21,
1129,
1330,
30,
645,
21,
972,
1330,
76,
21,
214,
753,
9,
31,
1477,
81,
4492,
30,
50,
14,
421,
1054,
12097,
26,
14,
1129,
17,
14,
972,
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... |
WINSCP LOGIN ISSUE
===
I am trying to login on winscp using correct username and password.
Under Environment> SFTP > SFTP Server --- sudo /usr/lib/openssh/sftp-server
Under Session i type in th Host Name Username and password
When I click on login I get "Connection has been unexpectedly closed. Server sent command exit status 1.
Cannot initialize SFTP protocol. Is the host running a SFTP server? "
sudo: no tty present and no askpass program specified
this is the link of the complete log http://pastebin.com/GcmpK2kj
I really would appreciate your help. Thanks in advance! | 0 | [
2,
4041,
7439,
6738,
108,
1513,
800,
3726,
3726,
31,
589,
749,
20,
6738,
108,
27,
4041,
7439,
568,
4456,
4155,
7259,
17,
20884,
9,
131,
2307,
1,
15025,
13726,
13,
1,
15025,
13726,
8128,
13,
8,
8,
8,
13,
18,
18601,
13,
118,
267,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why doesn't MongoDb store my slashes in this string?
===
Can anyone tell me why this command doesn't work from the MongoDB shell client:
db.coll.update({'live':true},{$set:{'mask':"\D\D\D\D\D\D\D\D"}},false,true)
but
db.coll.findOne({'id':'someId'})
returns the mask field as:
"mask" : "DDDDDDDD",
Where are the slashes going?
I've tried "double escaping" with \\D and that inserts both slashes:
"mask" : "\\D\\D\\D\\D\\D\\D\\D\\D",
MongoDB shell version: 2.0.6, MongoDB version: 2.0.5, OSX Lion
Thanks | 0 | [
2,
483,
1437,
22,
38,
3521,
5474,
220,
1718,
51,
14098,
160,
19,
48,
3724,
60,
800,
3726,
3726,
92,
1276,
494,
55,
483,
48,
1202,
1437,
22,
38,
170,
37,
14,
3521,
5474,
220,
3593,
6819,
45,
13,
9007,
9,
20410,
9,
576,
8209,
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... |
magento transactional e-mail don't work after upgrade
===
My Magento shop doesn't send e-mails after upgrading 1.4.1 to 1.6.2. We changed the location of the magento files from /magento-1.4 to the root during the upgrade.
The server hasn't changed and other installations on the same server are able to send magento mails.
Mail configuration hasn't changed since the previous installation. I've checked them and they all seem fine.
Any suggestions?
| 0 | [
2,
4723,
17050,
12799,
192,
13,
62,
8,
8079,
221,
22,
38,
170,
75,
9483,
800,
3726,
3726,
51,
4723,
17050,
2546,
1437,
22,
38,
2660,
13,
62,
8,
8079,
18,
75,
26939,
137,
9,
300,
9,
165,
20,
137,
9,
379,
9,
135,
9,
95,
1015,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Retrieving JSON throws ClientProtocolException
===
I've written two nearly identical methods of retrieving a `JSONObject`. The newer method throws `ClientProtocolException`, code 500. I'm trying to figure out what difference between these two methods could possibly cause one to throw an exception and the other to work perfectly fine.
Method #1:
HttpClient client = new DefaultHttpClient();
String url = getString(R.string.url);
String result = null;
try
{
HttpGet getMethod = new HttpGet(url);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
result = client.execute(getMethod, responseHandler);
}
Method #2
String result = null;
HttpClient httpClient = new DefaultHttpClient();
HttpGet getRequest = new HttpGet(this.URL);
try
{
ResponseHandler<String> handler = new BasicResponseHandler();
result = httpClient.execute(getRequest, handler); // Throws exception here
}
Both methods return `result` and then process it into a `JSONObject`. Or at least, both methods are supposed to. The only major difference that I can think of is that **Method #1** is coded as a class method of the main activity whereas **Method #2** exists in a stand-alone class. Could this difference be what throws the `ClientProtocolException`?
| 0 | [
2,
13,
6239,
3272,
8397,
487,
528,
13566,
6819,
2740,
262,
7771,
10066,
872,
800,
3726,
3726,
31,
22,
195,
642,
81,
1212,
6323,
3195,
16,
13,
6239,
3272,
8397,
21,
13,
1,
728,
528,
23793,
1,
9,
14,
12372,
2109,
13566,
13,
1,
150... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
disable a spark button bar button by index
===
Can I disable a Spark Button Bar Button via an index value or do I have to do it through the buttons skin as shown [here][1] using the label.
and example of what I would like to do:
public function disableButton(index:uint):void
{
var button:ButtonBarButton = this.getChildAt(index) as ButtonBarButton;
button.enabled = false;
}
This does not work as the button object comes back null.
[1]: http://blog.flexexamples.com/2009/08/01/disabling-specific-buttons-in-a-spark-buttonbar-control-in-flex-4/ | 0 | [
2,
1460,
579,
21,
9026,
5167,
748,
5167,
34,
4348,
800,
3726,
3726,
92,
31,
1460,
579,
21,
9026,
5167,
748,
5167,
1197,
40,
4348,
1923,
54,
107,
31,
57,
20,
107,
32,
120,
14,
12861,
1188,
28,
1721,
636,
6836,
500,
2558,
165,
500... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google Analytics Service API - Determining if access token is expired
===
I am wondering if anyone knows a clean programmatic way of detecting a 401 response with the analytics API. I know the underlying HTTP transport probably has it but when the call is made via Analytics object the only indicator of failure is an IOException (which could indicate an error of any type). If there was some way to get at the JSON response that gets shown in the stack trace you could check there maybe, but right now the only thing I can think of is to parse the e.getMessage() string. Example:
GaData gadata = null;
try {
gaData = analytics.data().ga().get(
"ga:" + profileId,
"2012-06-01",
"2012-06-30",
"ga:visits")
.execute();
} catch (IOException ioe) {
if (ioe.contains("401")) {
System.out.println("A 401 occurred.");
}
}
The reason for isolating this case is because it indicates that the access token has expired, so an alternate solution would be a better way for checking if the access token has expired. If this can be done then the code can make a call using the API key to grant a new access token.
| 0 | [
2,
8144,
26320,
365,
21,
2159,
13,
8,
13521,
100,
1381,
20,
2853,
25,
15524,
800,
3726,
3726,
31,
589,
5712,
100,
1276,
3620,
21,
2745,
625,
6732,
161,
16,
9092,
68,
21,
13,
20658,
1627,
29,
14,
26320,
21,
2159,
9,
31,
143,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
export external jar in blackberry but does'nt work
===
I generated a jar that contain the class with I user always in my application, but I add this jar into the proyecto following the next steps:
1. right click in the proyect.
2. properties
3. Build
4. Libraries
5. Add external jars or add jars
6. ok
I can use these libraries as I write my code, but when IM loading my project in the emulator or device it said that my library "NOT FOUND".
Please help, what is the correct form to use external jar in blackberry projects? | 0 | [
2,
7487,
4886,
5112,
19,
27367,
47,
630,
22,
2877,
170,
800,
3726,
3726,
31,
6756,
21,
5112,
30,
3717,
14,
718,
29,
31,
4155,
550,
19,
51,
3010,
15,
47,
31,
3547,
48,
5112,
77,
14,
895,
93,
3319,
262,
249,
14,
328,
2382,
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... |
XML parsing in python: expaterror not well-formed
===
I'm using Python's xml.etree.ElementTree to do some XML parsing on a file. However, I get this error mid-way through the document:
xml.parsers.expat.ExpatError: not well-formed (invalid token): line X, column Y
So I go to line X, column Y in vim and I see an ampersand (&) with red background highlighting. What does this mean?
Also the two characters preceeding it are >>, so maybe there's something special about ">>&"?
Anyone know how to fix this?
Thanks. | 0 | [
2,
23504,
2017,
18,
68,
19,
20059,
45,
1396,
5972,
29992,
52,
134,
8,
12609,
800,
3726,
3726,
31,
22,
79,
568,
20059,
22,
18,
23504,
9,
62,
8101,
9,
27567,
8101,
20,
107,
109,
23504,
2017,
18,
68,
27,
21,
3893,
9,
207,
15,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
python twisted stdio example on windows doesn't work
===
I start playing with python/twisted but when I test the following example on Windows from cmd.exe
http://twistedmatrix.com/trac/browser/trunk/doc/core/examples/stdin.py
I'm using python 2.7 and twisted 12.1.0 (binary msi package) but the example doesn't work. I hoped it was a problem of buffering so I tried also running the script with "python -u stdin.y" but nothing changed.
Obviouvsly this script works on Linux and on OSx, any direction?
Tnx, pz | 0 | [
2,
20059,
5308,
354,
6921,
823,
27,
1936,
1437,
22,
38,
170,
800,
3726,
3726,
31,
799,
791,
29,
20059,
118,
26284,
69,
47,
76,
31,
1289,
14,
249,
823,
27,
1936,
37,
2390,
43,
9,
1706,
62,
7775,
6903,
26284,
69,
540,
17224,
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... |
parsing dojo tundra dijits in ajax response
===
I am having massive problems re-parsing my dojo elements in an ajax response in Zend framework. I have a simple validationTextBox and a submit button. When the index page is first rendered, all the dojo/dijit tundra styles/attributes etc are parsed correctly. However, when I have an ajax call that rebuilds the dojo form and posts it back to the Index View. The form if posted back ok but the tundra styles are no longer working. I have tried so many different things but have spent many hours getting nowhere. I thank anyone in advance who attempts to assist. I have added the simplest example to this post to explain.
**layout.phtml**
<?php
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo $this->doctype();
?>
<html>
<head>
<meta content="text/html; charset=UTF-8" />
<script>
function showForm()
{
dojo.xhrGet( {
url: "../public/index.php?ajax=true",
// The load function is called on successful response from server
// It inserts the response to the HTML div “put_here” placeholder
handleAs:"text",
sync:true,
load: function(response, ioArgs)
{ dojo.byId("welcome").innerHTML = response;
return response;
},
// The error function displays error message if server does not
// respond right
error: function(response, ioArgs)
{
console.error("HTTP status code: ", ioArgs.xhr.status);
return response;
}
});
// dojo.parser.parse(dojo.byId("welcome"));
}
</script>
<?php
echo $this->headTitle();
echo $this->headStyle();
echo $this->headScript();
echo $this->dojo()->setDjConfigOption('parseOnLoad', true);
echo $this->dojo()->addStyleSheetModule('dijit.themes.tundra');
echo $this->dojo();
?>
</head>
<body class='tundra'>
<div id='ajaxcontent'>
<?php echo $this->layout()->content; ?>
</div>
</body>
</html>
**indexController.php**
<?php
//require_once '../public/js/custom.js';
class IndexController extends Zend_Controller_Action
{
public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('index', 'html')
->initContext();
}
public function indexAction()
{
$form = new Zend_Dojo_Form('dojoForm', array('dojotype'=> 'dijit.layout.ContentPane'));
$element = new Zend_Dojo_Form_Element_ValidationTextBox('TestBoxName',
array(
'id' => 'TextBoxId',
'required' => true
)
);
$button = new Zend_Dojo_Form_Element_Button('TestButton',
array(
'value'=> 'Button',
'onclick' => 'showForm()'
));
$form->addElements(array($element,$button));
$this->view->form = $form;
}
}
**View index.phtml**
<div id="welcome" >
<?php
echo $this->form;
?>
</div>
| 0 | [
2,
2017,
18,
68,
107,
1636,
10227,
3030,
926,
13803,
18,
19,
20624,
1627,
800,
3726,
3726,
31,
589,
452,
3787,
1716,
302,
8,
3574,
18,
68,
51,
107,
1636,
2065,
19,
40,
20624,
1627,
19,
10526,
43,
6596,
9,
31,
57,
21,
1935,
27999... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
"HTTP Status 405 - Request method 'POST' not supported" on form submit
===
Trying to do a very simple form in Spring/Hibernate. It should be adding an entry to the database. This is based off an example which worked for me, so it's weird that I would be getting this error. But it is what it is.
Here's the page with the form:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<html>
<head><title>Add Owned Game</title></head>
<body>
<h1>Add Owned Game</h1>
<br />
<br />
<c:url var="saveGameeUrl" value="/games/save.html" />
<form:form modelAttribute="game" method="POST" action="${saveGameUrl}">
<form:label path="title">Game Title:</form:label>
<form:input path="title" />
<br />
<input type="submit" value="Add Game" />
</form:form>
</body>
</html>
And here's the relevant controller method:
@RequestMapping(value = "/save", method = RequestMethod.POST)
public ModelAndView saveGame(@ModelAttribute("game") Game game,
BindingResult result) {
gameService.addOwnedGame(game);
return new ModelAndView("redirect:/games/owned.html");
}
If you need to see anything else, let me know. | 0 | [
2,
13,
7,
21127,
1782,
13,
21817,
13,
8,
3772,
2109,
13,
22,
6962,
22,
52,
1827,
7,
27,
505,
12298,
800,
3726,
3726,
749,
20,
107,
21,
253,
1935,
505,
19,
1573,
118,
8630,
106,
8820,
9,
32,
378,
44,
4721,
40,
2792,
20,
14,
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... |
How can I calculate rank based on highest points and lowest time in SQL server
===
I have searched and searched but have been unable to get this working. I'd really appreciate it if someone could help me out.
I have a table that stores the information for games played (small quiz application.)
I need to be able to determine the top 5 ranked players based on having the highest score, followed by the lowest time. (Many players have the max score).
I also need to determine the users rank at any given time.
Here is a sample of the games table:
<pre>
user_id credits time_played alias
64 490 180 DaPlaya
93 690 187 Superman
64 336 187 DaPlaya
75 196 192 Flake
93 182 197 Superman
57 844 198 John Smith
75 350 198 Flake
64 858 384 DaPlaya
73 858 400 littleguy
57 858 412 John Smith
101 858 420 FLASH
73 858 423 littleguy
73 858 434 littleguy
65 858 460 Sheena
122 858 540 Sugar Queen
126 858 545 Rachel
176 350 2417 The Fire Light
157 350 2442 Big Q
161 350 2456 Joey Blue
</pre>
The current query i'm using is this:
`select top 5 alias,user_id, rank() over (order by max(credits) desc,min(time_played)) as rank from games,users where games.user_id=users.id and users.id <> 20 and games.credits > 0 group by user_id,alias`
(As you can see from the query, the alias is actually stored in the users table.)
I thought this query was working, as it seemed to show the correct results, however now that the site is live, and I have thousands of games, I can see that it's wrong.
The above query basically gives me 5 players that have the highest possible score, but it ranks them on their lowest game-time. (so faster games with lower scores).
Please let me know how I can tweak/modify this query or rewrite it entirely.
(Note, I could do this much simpler using php with a loop, but that wouldn't be very efficient.)
I'm happy to provide more information if needed.
Thanks in advance,
Aaron. | 0 | [
2,
184,
92,
31,
18469,
2839,
432,
27,
1554,
819,
17,
6543,
85,
19,
4444,
255,
8128,
800,
3726,
3726,
31,
57,
9036,
17,
9036,
47,
57,
74,
2343,
20,
164,
48,
638,
9,
31,
22,
43,
510,
8831,
32,
100,
737,
110,
448,
55,
70,
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... |
Text Compression - What algorithm to use
===
I need to compress some text data of the form
[70,165,531,0|70,166,562|"hi",167,578|70,171,593|71,179,593|73,188,609|"a",1,3|
The data contains a few thousand characters(10000 - 50000 approx).
I read upon the various compression algorithms, but cannot decide which one to use here.
The important thing here is : The compressed string **should contain only alphanumberic characters**(or a few special characters like +-/&%@$..) I mean most algorithms provide gibberish ascii characters as compressed data right? That must be avoided.
Can someone guide me on how to proceed here?
P.S The text contains `numbers` , `'` and the `|` character predominantly. Other characters occur very very rarely. | 0 | [
2,
1854,
14864,
13,
8,
98,
9083,
20,
275,
800,
3726,
3726,
31,
376,
20,
26060,
109,
1854,
1054,
16,
14,
505,
636,
3318,
15,
11077,
15,
4022,
7396,
1,
3318,
15,
13126,
15,
3776,
135,
1,
7,
1822,
7,
15,
13232,
15,
264,
4130,
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... |
Download images from web and use downloaded images when presen
===
My C# program needs to display, of many possible images, one at a time. The images are on the web and I have a precise URL for each one. The program needs to either load the image from the web or, if it has been loaded previously, load it from memory/file (as the previous loading from the web should have saved it to memory/file). How do I implement this? I can get the loading from the web with a WebRequest object, but that's not enough to save it for later, faster, use.
WebRequest request = WebRequest.Create(imageURL);
Stream stream = request.GetResponse().GetResponseStream();
pictureBoxFirstPack.Image = Image.FromStream(stream); | 0 | [
2,
7121,
3502,
37,
2741,
17,
275,
23887,
3502,
76,
782,
1264,
800,
3726,
3726,
51,
272,
5910,
625,
2274,
20,
3042,
15,
16,
151,
938,
3502,
15,
53,
35,
21,
85,
9,
14,
3502,
50,
27,
14,
2741,
17,
31,
57,
21,
11114,
287,
6362,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 construct redirect URL for foursquare iOS app
===
I'm developing an iPhone app using foursquare api. It has a Venue checkin screen with 'Check-IN' button and when the user clicks the button the foursquare authentication page will open up. The problem is that how do I get back to the Venue Checking page after successful authentication and checkin at foursquare.
I guess I have to use REDIRECT_URL judiciously for iphone app - but have very little clue how to do it.
Any suggestion will be very helpful.
Thanking you all in advance.
| 0 | [
2,
184,
20,
6960,
302,
14706,
287,
6362,
26,
222,
12300,
13,
7760,
4865,
800,
3726,
3726,
31,
22,
79,
3561,
40,
21024,
4865,
568,
222,
12300,
21,
2159,
9,
32,
63,
21,
5704,
2631,
108,
2324,
29,
13,
22,
12542,
8,
108,
22,
5167,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Output of quantile to a data frame
===
This is a fairly basic question, but haven't seen a good answer on various forums.
Say I've a simple vector
x = runif(10,1,4)
> x
[1] 3.292108 1.388526 2.774949 3.005725 3.904919 1.322561 2.660862 1.400743
[9] 2.252095 3.567267
>
Next I compute some quantiles,
> z = quantile(x,c(0.1,0.8))
> z
10% 80%
1.381929 3.347140
>
I need this output as a data frame. So I tried the following
> y = data.frame(id = names(z),values=z)
> y
id values
10% 10% 1.381929
80% 80% 3.347140
I see that the "%" column is repeated. Also when I try
> y$id[1]
[1] 10%
Levels: 10% 80%
whereas I'm expecting it to be either just "10%" or 0.1
Any help appreciated.
| 0 | [
2,
5196,
16,
9836,
9802,
20,
21,
1054,
3523,
800,
3726,
3726,
48,
25,
21,
6647,
2125,
1301,
15,
47,
2933,
22,
38,
541,
21,
254,
1623,
27,
617,
5691,
18,
9,
395,
31,
22,
195,
21,
1935,
7497,
993,
800,
485,
821,
5,
1036,
15,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript replace `sq-` or `sq.`
===
I'd like to do a replace on a string that contains `sq-` or `sq.` I was thinking of doing something like this:
var imgSrc = event.dataTransfer.getData('Text');
imgSrc = imgSrc.replace('sq-', 'mt-') || imgSrc.replace('sq.', 'mt.');
Any ideas on how I can get this working? | 0 | [
2,
8247,
8741,
3934,
13,
1,
18,
1251,
8,
1,
54,
13,
1,
18,
1251,
9,
1,
800,
3726,
3726,
31,
22,
43,
101,
20,
107,
21,
3934,
27,
21,
3724,
30,
1588,
13,
1,
18,
1251,
8,
1,
54,
13,
1,
18,
1251,
9,
1,
31,
23,
1440,
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... |
VNC viewer implementation
===
Our team is implementing a VNC viewer (=VNC client) on Windows. The protocol (called RFB) is stateful, meaning that the viewer has to read 1 byte, see what it is, then read either 3 or 10 bytes more, parse them, and so on.
We've decided to use asynchronous sockets and a single (UI) thread. Consequently, there are 2 ways to go:
1) state machine -- if we get a block on socket reading, just remember the current state and quit. Later on, a socket notification will arrive and the interrupted logic will resume from the proper stage;
2) inner message loop -- once we determine that reading from the socket would block, we enter an inner message loop and spin there until all the necessary data is finally received.
UI is not thus frozen in case of a block.
As experience showed, the second approach is bad, as any message can come while we're in the inner message loop. I cannot tell the full story here, but it simply is not reliable enough. Crashes and kludges.
The first option seems to be quite acceptable, but it is not easy to program in such a style. One has to remember the state of an algorithm and values of all the local variables required for further processing.
This is quite possible to use multiple threads, but we just thought that the problems in this case would be even much harder: synchronization of frame-buffer access, multi-threading issues, etc. Moreover, even in this variant it seems necessary to use asynchronous sockets as well.
So, what way is in your opinion the best ?
The problem is quite a general one. This is the problem of organizing asynchronous communication through stateful protocols. | 0 | [
2,
566,
6897,
16812,
6123,
800,
3726,
3726,
318,
173,
25,
17333,
21,
566,
6897,
16812,
13,
5,
3726,
16578,
150,
6819,
6,
27,
1936,
9,
14,
8494,
13,
5,
4580,
761,
13478,
6,
25,
146,
1566,
15,
1813,
30,
14,
16812,
63,
20,
1302,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 create DB "rake db:create", rake aborted
===
I have been trying out ROR sample blog app. in Windows 7. But when i try to create db it's getting some errors like rake aborted.
C:\Ruby193\blog>rake db:create --trace
rake aborted!
uninitialized constant Blog
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/ext/module.rb:36:in `c
onst_missing'
C:/Ruby193/blog/Rakefile:7:in `<top (required)>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `
load'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `
load_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in
`raw_load_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `
block in load_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `
load_rakefile'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `
block in run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
`standard_exception_handling'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `
run'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)
>'
C:/Ruby193/bin/rake:23:in `load'
C:/Ruby193/bin/rake:23:in `<main>'
Thanks
| 0 | [
2,
2343,
20,
1600,
13,
9007,
13,
7,
4951,
62,
13,
9007,
45,
6037,
1373,
7,
15,
21009,
21557,
69,
800,
3726,
3726,
31,
57,
74,
749,
70,
761,
248,
5717,
8146,
4865,
9,
19,
1936,
453,
9,
47,
76,
31,
1131,
20,
1600,
13,
9007,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Return multiple functions
===
I am new to javascript, so I apologize if this is all totally wrong, but I'm trying to validate a form right now, and I have the simple functions for testing. I want the function validateForm() to return all three of the functions checkName(), checkEmail, and checkMessage(). The way I have the validateForm() function, it only runs the checkName() function. Any ideas?
function checkName(){
var name=document.forms["contactForm"]["Name"].value;
if(name==null || name==""){
$("input#name").css("border-color", "#ff0000");
$("input#name").attr("placeholder","Your name is required");
return false;
}
else {
$("input#name").css("border-color", "#00a8ff");
$("input#name").attr("placeholder","");
return true;
}
}
function checkEmail(){
var email=document.forms["contactForm"]["Email"].value;
if(email==null || email==""){
$("input#email").css("border-color", "#ff0000");
$("input#email").attr("placeholder","Your email is required");
return false;
}
else {
$("input#email").css("border-color", "#00a8ff");
$("input#email").attr("placeholder","");
return true;
}
}
function checkMessage(){
var message=document.forms["contactForm"]["Message"].value;
if(message==null || message==""){
$("textarea#message").css("border-color", "#ff0000");
$("textarea#message").attr("placeholder","Your message is required");
return false;
}
else {
$("textarea#message").css("border-color", "#00a8ff");
$("textarea#message").attr("placeholder","");
return true;
}
}
function validateForm(){
return checkName() && checkEmail() && checkMessage();
} | 0 | [
2,
788,
1886,
3719,
800,
3726,
3726,
31,
589,
78,
20,
8247,
8741,
15,
86,
31,
12059,
100,
48,
25,
65,
5139,
1389,
15,
47,
31,
22,
79,
749,
20,
7394,
1373,
21,
505,
193,
130,
15,
17,
31,
57,
14,
1935,
3719,
26,
4431,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
javascript client side time to php servertime
===
Im having the hardest time trying to convert client side time to server time. The reason is I have a cron job executing once every hour. I manage to get the timezone offset in java script, but I'am clueless on how to apply the timezone offset. For instance, my timezone offset is 7. Ok!? than what? How should I apply this offset?
To get the offset I use
var offset = new Date().getTimezoneOffset();
Server side is handled by php. | 0 | [
2,
8247,
8741,
6819,
270,
85,
20,
13,
26120,
8128,
891,
800,
3726,
3726,
797,
452,
14,
20766,
85,
749,
20,
8406,
6819,
270,
85,
20,
8128,
85,
9,
14,
1215,
25,
31,
57,
21,
13,
19587,
1205,
25836,
382,
352,
1671,
9,
31,
4705,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Generating a random time intervall in xcode
===
I am pretty new to XCode but I am trying to put a simple reaction game together. Therefore I need to generate the time intervall of the NSTimer randomly. Currently I have tried the code below.
int randomNumber = rand() %5;
changeColor = [NSTimer scheduledTimerWithTimeInterval:(randomNumber) target:self selector:@selector(changeBackground) userInfo:nil repeats:YES]; | 0 | [
2,
13500,
21,
5477,
85,
14422,
255,
19,
993,
9375,
800,
3726,
3726,
31,
589,
1772,
78,
20,
993,
9375,
47,
31,
589,
749,
20,
442,
21,
1935,
3006,
250,
429,
9,
1793,
31,
376,
20,
7920,
14,
85,
14422,
255,
16,
14,
13,
2172,
891,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
$errors[] not returning
===
I am working on building a PHP login and registration system for my website. The coding calls for using $errors[] if form fields are empty and functions to check if the input username exist on the database. I am not recieving any errors, even if I do not put in any information.
<b>login.php</b>
<?php
include 'cic/initalize.php';
if (user_exists('cassey') === true) {
echo 'exists';
}
die();
if (empty($_POST) === false) {
$username = $_POST['username'];
$password = $_POST['password'];
if (empty($username) === true || empty($password) === true) {
$errors[] = 'Please provide your username and password.';
} else if (user_exists($username) === false) {
$errors[] = 'We can\'t find the username entered, please enter a valid
username or register to continue';
}
}
?>
<b>clients.php (users)</b>
<?php
function user_exists($username) {
$username = sanitize($username);
return (mysql_result(mysql_query("SELECT userId FROM clients WHERE
username = '$username'"), 0) === 1) ? true : false;
}
?> | 0 | [
2,
5579,
29992,
18,
2558,
500,
52,
2485,
800,
3726,
3726,
31,
589,
638,
27,
353,
21,
13,
26120,
6738,
108,
17,
8587,
329,
26,
51,
2271,
9,
14,
13,
15458,
3029,
26,
568,
5579,
29992,
18,
2558,
500,
100,
505,
2861,
50,
2424,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Options for simple geolocation feature?
===
I need to add location features to a classifieds app. Basically,
- Users must search for classifieds by city and state
- Results should include nearby city and states (e.g. results within 50 miles)
I am clueless about the APIs I could use, if any. Any help would be appreciated. Thank you. | 0 | [
2,
6368,
26,
1935,
6389,
19032,
1580,
60,
800,
3726,
3726,
31,
376,
20,
3547,
1474,
967,
20,
21,
5110,
18,
4865,
9,
11374,
15,
13,
8,
3878,
491,
2122,
26,
5110,
18,
34,
136,
17,
146,
13,
8,
1736,
378,
468,
1754,
136,
17,
202,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
rack-mini-profiler is showing profiling static files
===
I'm using rack-mini-profiler after watching it's railscast (http://railscasts.com/episodes/368-miniprofiler).
I added it to my Gemfile:
gem 'rack-mini-profiler'
Installed it using bundler and started my dev environment using "rails s".
The profilling works, it shows up at the left upper corner of the web page, but it happens to profile all the static files (js, css, images, etc). It also seems that it has a limit of 10 lines, so the actual request is hidden.
![enter image description here][1]
![enter image description here][2]
Is it possible to configure it so it wil avoid profiling static files?
[1]: http://i.stack.imgur.com/sm9hl.png
[2]: http://i.stack.imgur.com/OxMX2.png | 0 | [
2,
10257,
8,
6840,
8,
14503,
139,
25,
3187,
8721,
49,
802,
12038,
6488,
800,
3726,
3726,
31,
22,
79,
568,
10257,
8,
6840,
8,
14503,
139,
75,
1953,
32,
22,
18,
2240,
18,
6146,
13,
5,
21127,
6903,
7301,
18,
6146,
18,
9,
960,
118... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hy Everyone Please Somebody Help me
===
hy everyone.
I designed a report with ireport with a parameter to connect to a excel file as database.
when I move it to netbeans it work but when I chanege my query I have an error :
net.sf.jasperreports.engine.JRException: Error executing SQL statement for : ReportX
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:246)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1073)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:667)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1235)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:859)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:804)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:61)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:849)
my query is :SELECT f92002,f92003,f92004,f92011,f92012 FROM [ns92000$] WHERE ((F92004 in(4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24))"
+ "and (F92003 in(265)) and(F92002 in(" + shobe + ")))
and when i want to have a sum column like this
my query is :SELECT f92002,f92003,f92004,sum(f92011),f92012 FROM [ns92000$] WHERE ((F92004 in(4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24))"
+ "and (F92003 in(265)) and(F92002 in(" + shobe + "))) it happend .
here is my report,s code:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ReportX" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="afa5bd31-a445-4441-bf71-3953d99e74a1">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="New Dataset 1" uuid="e021b85d-1973-4792-b497-d63fd868b407">
<field name="F92001" class="java.lang.String"/>
<field name="F92002" class="java.lang.String"/>
<field name="F92003" class="java.lang.String"/>
<field name="F92004" class="java.lang.String"/>
<field name="F92005" class="java.lang.String"/>
<field name="F92006" class="java.lang.String"/>
<field name="F92007" class="java.lang.String"/>
<field name="F92008" class="java.lang.String"/>
<field name="F92009" class="java.lang.String"/>
<field name="F92010" class="java.lang.String"/>
<field name="F92011" class="java.lang.String"/>
<field name="F92012" class="java.lang.String"/>
<field name="F92013" class="java.lang.String"/>
<field name="F92014" class="java.lang.String"/>
<field name="F92015" class="java.lang.String"/>
<field name="F92016" class="java.lang.String"/>
<field name="F92017" class="java.lang.String"/>
<field name="F92018" class="java.lang.String"/>
</subDataset>
<parameter name="Sqlparam" class="java.lang.String"/>
<queryString>
<![CDATA[$P!{Sqlparam}]]>
</queryString>
<field name="F92002" class="java.lang.Long"/>
<field name="F92003" class="java.lang.Long"/>
<field name="F92004" class="java.lang.Long"/>
<field name="F92011" class="java.lang.Long"/>
<field name="F92012" class="java.lang.Long"/>
<group name="F92002">
<groupExpression><![CDATA[$F{F92002}]]></groupExpression>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="79" splitType="Stretch"/>
</title>
<pageHeader>
<band height="35" splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="61" splitType="Stretch">
<staticText>
<reportElement uuid="cb38e098-71bf-4cfc-b046-95a3b24b5bf3" x="455" y="30" width="100" height="20"/>
<textElement/>
<text><![CDATA[F92002]]></text>
</staticText>
<staticText>
<reportElement uuid="1c1fc08b-e671-4e86-9811-b972325b5a41" x="345" y="30" width="100" height="20"/>
<textElement/>
<text><![CDATA[F92003]]></text>
</staticText>
<staticText>
<reportElement uuid="add4e154-6aed-47fa-bccb-2228f8517883" x="233" y="30" width="100" height="20"/>
<textElement/>
<text><![CDATA[F92011]]></text>
</staticText>
<staticText>
<reportElement uuid="128464e4-332b-463e-96ea-a181eee0915e" x="121" y="30" width="100" height="20"/>
<textElement/>
<text><![CDATA[F92012]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="29" splitType="Stretch">
<textField>
<reportElement uuid="9d08af2f-9a1c-4c61-a9b1-33602962ef34" x="455" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{F92002}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="13d4e202-c8bd-4112-a28e-38c6bc78246d" x="345" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{F92003}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="510b4a83-a321-4c50-a4f6-09ff72be4a2e" x="233" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{F92011}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="00dd5562-5cfc-4d84-924f-703235df0f8d" x="121" y="0" width="100" height="20"/>
<textElement/>
<textFieldExpression><![CDATA[$F{F92012}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="45" splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band height="54" splitType="Stretch"/>
</pageFooter>
<summary>
<band height="42" splitType="Stretch"/>
</summary>
</jasperReport>
I used in netbeans This way:
private void ViewReportX(Connection con1, String sqlstr1) {
File theFile = new File("src/Report/ReportX.jrxml");
try
{
JasperDesign jasperDesign = JRXmlLoader.load(theFile);
JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
Map parametersMap = new HashMap();
parametersMap.put("Sqlparam",sqlstr1);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parametersMap, con1);
JasperViewer.viewReport(jasperPrint);
} catch (JRException ex) {
Logger.getLogger(Mainmdrfrm.class.getName()).log(Level.SEVERE, null, ex);
}
} | 0 | [
2,
4085,
1266,
2247,
8861,
448,
55,
800,
3726,
3726,
4085,
1266,
9,
31,
1006,
21,
1330,
29,
31,
17437,
29,
21,
18906,
20,
6379,
20,
21,
20700,
3893,
28,
6018,
9,
76,
31,
780,
32,
20,
4275,
863,
5950,
32,
170,
47,
76,
31,
6122,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Second call to HttpWebRequest.GetRequestStream() throws timeout exception
===
Help... I can't figure out why HttpWebRequest.GetRequestStream() is throwing a timeout
exception... it ALWAYS occurs when trying to establish the second (and subsequent)
connections using POST. Basically, I am trying to create the connection
every 30 seconds. Here is the relevent code:
My Main Loop:
for( int i = 0; i < students.Count; i++ ) {
Log( "Processing: " + students[i].DbID + ";" + students[i].Username + ";" + students[i].Password );
UserConnection uc = new UserConnection( students[i] );
uc.ParseAll();
Log( "Done Processing: " + students[i].DbID + ";" + students[i].Username + ";" + students[i].Password );
}
From User Connection:
public UserConnection( Student student )
{
this.student = student;
this.cookies = new CookieContainer();
this.InitCookies();
this.courses = new List<Course>();
}
private void InitCookies()
{
HttpWebRequest req = (HttpWebRequest)WebRequest.Create( baseUri );
req.Method = "GET";
req.CookieContainer = this.cookies;
req.GetResponse();
}
public void ParseAll()
{
ParseCourseInfo(); //get info for each class
.
.
.
}
private void ParseCourseInfo()
{
HtmlDocument page = GetPage( "POST", homeUri, "username=" + student.Username + "&password=" + student.Password + "&testcookies=1" );
.
.
.
}
The following exception is occuring in GetPage:
29/07/2012 1:04:22 PM : Exception: System.Net.WebException
Message: The operation has timed out
Source: System
Stack Trace: at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)
at System.Net.HttpWebRequest.GetRequestStream()
at URCoursesParserV2.UserConnection.GetPage(String method, Uri pageUri, String queryString) in UserConnection.cs:line 167
Here is the GetPage code where the problem is:
private HtmlDocument GetPage( string method, Uri pageUri, String queryString = "" )
{
Stream data = null;
HttpWebResponse res = null;
HttpWebRequest req = null;
try {
req = (HttpWebRequest)WebRequest.Create( pageUri );
req.CookieContainer = this.cookies;
req.Timeout = 1000 * 10; //10 seconds - I've also tried leaving it as default
req.KeepAlive = false; ////I've also tried leaving it as true.
if( method.ToUpper() == "POST" ) {
req.Method = "POST";
if( queryString != "" ) {
byte[] postBytes = Encoding.UTF8.GetBytes( queryString );
req.ContentType = "application/x-www-form-urlencoded";
req.ContentLength = postBytes.Length;
using( data = req.GetRequestStream() ) { //////////////EXCEPTION HERE ON SECOND ITERATION
data.Write( postBytes, 0, postBytes.Length );
data.Close();
}
}
} else if( method.ToUpper() == "GET" ) {
req.Method = "GET";
if( queryString != "" ) {
pageUri = new Uri( pageUri.ToString() + '?' + queryString );
}
} else {
return null;
}
HtmlDocument page = null;
using( res = (HttpWebResponse)req.GetResponse() ) {
using( data = res.GetResponseStream() ) {
page = new HtmlDocument();
page.Load( data );
}
}
return page;
} catch(WebException e) {
URCoursesParser.Log( e );
return null;
} catch( Exception e ) {
URCoursesParser.Log( e );
return null;
} finally { ///data and res probably don't need to be checked here now because of 'using' blocks
if( data != null ) {
data.Close();
data = null;
}
if( res != null ) {
res.Close();
res = null;
}
if( req != null ) {
req.Abort();
req = null;
}
}
}
Any ideas!?! The first iteration is always fine. If I terminate the program and restart the first iteration is again fine... It's always the second and subsequent iterations.
| 0 | [
2,
153,
645,
20,
7775,
458,
3692,
10351,
9,
3060,
99,
10351,
11260,
5,
6,
13566,
85,
1320,
5391,
800,
3726,
3726,
448,
9,
9,
9,
31,
92,
22,
38,
1465,
70,
483,
7775,
458,
3692,
10351,
9,
3060,
99,
10351,
11260,
5,
6,
25,
6033,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Circuit Diagram visualization framework for Java
===
I am looking for a **framework to visualize Circuit Diagrams in Java application**.
I have to show Diagrams like that:
![enter image description here][2]
For one of my previous projects (in 2008 year) I used [Jung][3]. It worked well, but maybe somebody could offer more suitable for my needs framework? Does anyone have a similar task or know a good tools?
Also one of my tasks is to try to layout elements, because there is only info about connections in DB, but there is no layout information. I want to try to minimize manual layout work and looking for **layout algorithms**.
Thank you in advance.
PS: It is very desirable that the framework will be free.
PPS: Also I am interested in frameworks which can help to show (and edit) such type of diagrams using web browser.
[2]: http://i.stack.imgur.com/I5GU7.jpg
[3]: http://jung.sourceforge.net/ | 0 | [
2,
3343,
14161,
28873,
6596,
26,
8247,
800,
3726,
3726,
31,
589,
699,
26,
21,
13,
1409,
8361,
3783,
20,
3458,
2952,
3343,
14161,
18,
19,
8247,
3010,
1409,
9,
31,
57,
20,
298,
14161,
18,
101,
30,
45,
13,
187,
2558,
13679,
1961,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get consistent criterion benchmarks, or interpret results across runs?
===
I'm trying to optimize some code, using criterion to try to compare, for example, the effect of adding `INLINE` pragma to a function. But I'm finding results are not consistent between re-compiles/runs.
I need to know how to get results either to be consistent across runs so that I can compare them, or how to assess whether a benchmark is reliable or not, i.e. (I guess) how to interpret the details about variance, "cost of a clock call", etc.
## Details on my particular case ##
This is orthogonal to my main questions above, but a couple things might be causing inconsistency in my particular case:
1. I'm trying to benchmark `IO` actions using `whnfIO` because the method using `whnf` in [this example](https://github.com/bos/criterion/blob/master/examples/Judy.hs) didn't work.
2. my code uses concurrency
3. I've got a lot of tabs and crap open
### Example output ###
Both of these are from the same code, compiled in the exact same way. I did the first run directly below, made a change and did another benchmark, then reverted and ran the first code again, compiling with:
ghc --make -fforce-recomp -threaded -O2 Benchmark.hs
First run:
estimating clock resolution...
mean is 16.97297 us (40001 iterations)
found 6222 outliers among 39999 samples (15.6%)
6055 (15.1%) high severe
estimating cost of a clock call...
mean is 1.838749 us (49 iterations)
found 8 outliers among 49 samples (16.3%)
3 (6.1%) high mild
5 (10.2%) high severe
benchmarking actors/insert 1000, query 1000
collecting 100 samples, 1 iterations each, in estimated 12.66122 s
mean: 110.8566 ms, lb 108.4353 ms, ub 113.6627 ms, ci 0.950
std dev: 13.41726 ms, lb 11.58487 ms, ub 16.25262 ms, ci 0.950
found 2 outliers among 100 samples (2.0%)
2 (2.0%) high mild
variance introduced by outliers: 85.211%
variance is severely inflated by outliers
benchmarking actors/insert 1000, query 100000
collecting 100 samples, 1 iterations each, in estimated 945.5325 s
mean: 9.319406 s, lb 9.152310 s, ub 9.412688 s, ci 0.950
std dev: 624.8493 ms, lb 385.4364 ms, ub 956.7049 ms, ci 0.950
found 6 outliers among 100 samples (6.0%)
3 (3.0%) low severe
1 (1.0%) high severe
variance introduced by outliers: 62.576%
variance is severely inflated by outliers
Second run, ~3x slower:
estimating clock resolution...
mean is 51.46815 us (10001 iterations)
found 203 outliers among 9999 samples (2.0%)
117 (1.2%) high severe
estimating cost of a clock call...
mean is 4.615408 us (18 iterations)
found 4 outliers among 18 samples (22.2%)
4 (22.2%) high severe
benchmarking actors/insert 1000, query 1000
collecting 100 samples, 1 iterations each, in estimated 38.39478 s
mean: 302.4651 ms, lb 295.9046 ms, ub 309.5958 ms, ci 0.950
std dev: 35.12913 ms, lb 31.35431 ms, ub 42.20590 ms, ci 0.950
found 1 outliers among 100 samples (1.0%)
variance introduced by outliers: 84.163%
variance is severely inflated by outliers
benchmarking actors/insert 1000, query 100000
collecting 100 samples, 1 iterations each, in estimated 2644.987 s
mean: 27.71277 s, lb 26.95914 s, ub 28.97871 s, ci 0.950
std dev: 4.893489 s, lb 3.373838 s, ub 7.302145 s, ci 0.950
found 21 outliers among 100 samples (21.0%)
4 (4.0%) low severe
3 (3.0%) low mild
3 (3.0%) high mild
11 (11.0%) high severe
variance introduced by outliers: 92.567%
variance is severely inflated by outliers
I notice that if I scale by "estimated cost of a clock call" the two benchmarks are fairly close. Is that what I should do to get a real number for comparing? | 0 | [
2,
184,
107,
31,
164,
8224,
21991,
25324,
18,
15,
54,
11584,
1736,
464,
1461,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
22864,
109,
1797,
15,
568,
21991,
20,
1131,
20,
11590,
15,
26,
823,
15,
14,
1590,
16,
4721,
13,
1,
108,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there an equivalent/alternative to deferred.defer from Google App Engine in Django?
===
I am looking at porting a Google App Engine app (written in Python) to Django, which is currently heavily relying on `deferred.defer` from `google.appengine.ext` to fire off high IO tasks and keep moving. Is there an equivalent/alternative to `deferred.defer` that is typically used in Django apps? | 0 | [
2,
25,
80,
40,
4602,
118,
27556,
20,
29419,
9,
546,
2407,
37,
8144,
4865,
1406,
19,
3857,
14541,
60,
800,
3726,
3726,
31,
589,
699,
35,
1295,
68,
21,
8144,
4865,
1406,
4865,
13,
5,
6390,
19,
20059,
6,
20,
3857,
14541,
15,
56,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C++ several object serialization
===
So I make a serialization of a single object but I had problem with several.
Here is the code:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
class MyTest
{
private:
string test;
public:
MyTest():test(""){};
void setTest(const string& test) {this->test = test;};
string getTest() const {return this->test;};
};
void writeToFile(const MyTest& m)
{
ofstream ofs("data.mbp", ios::app|ios::binary);
ofs.clear();
ofs.write((char *)&m, sizeof(m));
ofs.flush();
ofs.close();
return;
};
MyTest& readTest(MyTest& m,int num)
{
ifstream ifs;
ifs.open("data.mbp", ios::in|ios::binary);
for ( int i = 1 ; i <= num ; i++)
ifs.read((char *)&m, sizeof(m));
return m;
}
int main(int argc,char* argv[])
{
MyTest m,t;
m.setTest("Hello");
writeToFile(m);
t.setTest("World");
writeToFile(t);
t = readTest(t,1);
cout << t.getTest() << endl;
m = readTest(m,2);
cout << m.getTest() << endl;
return 0;
}
The problem is that I do not know how to write two or more objects in a binary file and after that how can I read them.
Does anybody know?
Thanks in advance. | 0 | [
2,
272,
20512,
238,
3095,
5956,
1829,
800,
3726,
3726,
86,
31,
233,
21,
5956,
1829,
16,
21,
345,
3095,
47,
31,
41,
1448,
29,
238,
9,
235,
25,
14,
1797,
45,
6926,
22640,
13,
1,
1963,
11260,
1,
6926,
22640,
13,
1,
410,
11260,
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... |
testing nested route in functional tests
===
I have a nested route:
<!-- language-all: lang-rails -->
resources :stories do
resources :comments
end
this is my create method in controller:
def create
@story = Story.find(params[:story_id])
@comment = @story.comments.build(params[:comment])
@comments = @story.comments.all
respond_to do |format|
if @comment.save
format.html { redirect_to @story, notice: t('controllers.comments.create.flash.success') }
format.json { render json: @comment, status: :created, location: @comment }
else
format.html { render template: "stories/show" }
format.json { render json: @comment.errors, status: :unprocessable_entity }
end
end
end
And here is it's test:
setup do
@comment = comments(:one)
@story = stories(:one)
end
....
test "should create comment" do
assert_difference('Comment.count') do
post :create, :story_id => @story.id, comment: { content: @comment.content, name: @comment.name, email: @comment.email }
end
assert_redirected_to @story_path
end
that ends up with this error:
1) Failure:
test_should_create_comment(CommentsControllerTest) [/home/arach/workspace/Web/ruby/nerdnews/test/functional/comments_controller_test.rb:25]:
Expected response to be a redirect to <http://test.host/stories/980190962/comments> but was a redirect to <http://test.host/stories/980190962>
I don't know why the test expect to redirect to `stories/:id/comments`. I tried other things like `story_comment_path` but it didn't help either. `story_path` without `@` also ends up with another error:
ActionController::RoutingError: No route matches {:action=>"show", :controller=>"stories"}
same error happens for `story_path, :story_id => @story.id`. Any idea why this happens? | 0 | [
2,
4431,
5618,
69,
858,
19,
7652,
4894,
800,
3726,
3726,
31,
57,
21,
5618,
69,
858,
45,
13,
1,
187,
8,
8,
816,
8,
1233,
45,
4544,
8,
7301,
18,
13,
8,
8,
1,
2566,
13,
45,
18,
262,
2829,
107,
2566,
13,
45,
960,
6601,
241,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
remove blank spaces between html tags using html agility pack
===
The next thing you should try doing is that removing leading spaces at the start of para or tag. For e.g. you would find many ref like
<p class="MsoNoSpacing"><span style='font-size:12.0pt'> In these
types of levers, the <i>fulcrum</i> F is in between the <i>effort </i>E and the
<i>load </i>L as shown in Fig 3.1 (a).</span></p>
This should be converted to
<p class="MsoNoSpacing"><span style='font-size:12.0pt'>In these
types of levers, the <i>fulcrum</i> F is in between the <i>effort </i>E and the
<i>load </i>L as shown in Fig 3.1 (a).</span></p>
i am using html agility pack i can anyone help me with this | 0 | [
2,
4681,
6463,
7644,
128,
13,
15895,
3383,
18,
568,
13,
15895,
28813,
3607,
800,
3726,
3726,
14,
328,
584,
42,
378,
1131,
845,
25,
30,
9096,
1005,
7644,
35,
14,
799,
16,
2258,
54,
3383,
9,
26,
13,
62,
9,
263,
9,
42,
83,
477,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 store the Facebook profile picture in sql database
===
As you can see the code below retrieve and shows all the required information from a Facebook profile..
Access Token:
User ID:
Name: Aneesh
First Name:
Last Name:
Email:
Gender:
Birthday:
Location: N
Time Zone:
but i am not able to store the profile picture in sql database ?
<?php
require 'lib/db.php';
require 'lib/facebook.php';
require 'lib/fbconfig.php';
session_start();
$facebook=$_SESSION['facebook'];
$userdata=$_SESSION['userdata'];
$logoutUrl=$_SESSION['logout'];
$access_token_title='fb_'.$facebook_appid.'_access_token';
$access_token=$facebook[$access_token_title];
if(!empty($userdata))
{
echo '<h1>Login User Details</h1>';
echo '<img src="https://graph.facebook.com/'.$userdata['id'].'/picture">';
At the moment the above the code displays the image...but how to store is the problem
I used BLOB which showed error
echo "<br/>";
echo '<b>Access Token: </b>'.$access_token;
echo "<br/>";
echo '<b>User ID: </b>'.$userdata['id'];
echo "<br/>";
echo '<b>Name: </b>'.$userdata['name'];
echo "<br/>";
echo '<b>First Name: </b>'.$userdata['first_name'];
echo "<br/>";
echo '<b>Last Name: </b>'.$userdata['last_name'];
echo "<br/>";
echo '<b>Email: </b>'.$userdata['email'];
echo "<br/>";
echo '<b>Gender: </b>'.$userdata['gender'];
echo "<br/>";
echo '<b>Birthday: </b>'.$userdata['birthday'];
echo "<br/>";
echo '<b>Location: </b>'.$userdata['location']['name'];
echo "<br/>";
echo '<b>Time Zone: </b>'.$userdata['timezone'];
echo "<br/>";
echo "<br/>";
$facebook_id=$userdata['id'];
$name=$userdata['name'];
$email=$userdata['email'];
$gender=$userdata['gender'];
$birthday=$userdata['birthday'];
$location=mysql_real_escape_string($userdata['location']['name']);
$hometown=mysql_real_escape_string($userdata['hometown']['name']);
$bio=mysql_real_escape_string($userdata['bio']);
$relationship=$userdata['relationship_status'];
$timezone=$userdata['timezone'];
$inserty = "INSERT INTO `users` (`facebook_id`, `name`, `email`, `gender`, `birthday`, `location`,`timezone`, `access_token`,`??????`)
VALUES ('$facebook_id','$name','$email','$gender','$birthday','$location','$timezone','$access_token',`?????`)";
mysql_query($inserty, $connection);
????? I meant column for image
echo "<br/>";
echo '<a href="'.$logoutUrl.'">Logout Facebook</a>';
echo '<a href="http://www.xxxxxx.co.uk/Mosaic/logout.php">Logout Facebook</a>';
include('status_update.php');
}
else
{
header("Location: fblogin.php");
}
?>
| 0 | [
2,
2343,
20,
1718,
14,
9090,
5296,
2151,
19,
4444,
255,
6018,
800,
3726,
3726,
28,
42,
92,
196,
14,
1797,
1021,
11917,
17,
1285,
65,
14,
1390,
676,
37,
21,
9090,
5296,
9,
9,
1381,
20,
2853,
45,
4155,
4924,
45,
204,
45,
40,
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... |
Cannot display datapicker in JSF page
===
I want to display datepicker in JSF page but for some reason it's not working. This example is working:
<h:panelGroup>
<h:inputText id="username" value="#{AddAccountController.formMap['USERNAME']}"
validator="#{ValidatorController.validateUsername}" autocomplete="off">
<f:ajax event="blur" render="usernamevalidator" />
</h:inputText>
<h:message id="usernamevalidator" for="username" />
</h:panelGroup>
<script type="text/javascript">
//For calendar
$(".datepicker").datetimepicker({
inline: true,
showWeek: true,
firstDay: 1,
dateFormat: 'dd-MM-yy',
timeFormat: 'hh:mm:ss',
separator: ' ',
showSecond: true
});
</script>
But when I want to use datepicker in this way it's not working:
<tr>
<td>User Expire Date</td>
<td>
<h:outputText value="#{ud.userexpiredate}"
rendered="#{not AccountProfileController.editable}" />
<h:inputText styleClass="datepicker" value="#{ud.userexpiredate}" rendered="#{AccountProfileController.editable}" />
</td>
</tr>
<script type="text/javascript">
//For calendar
$(".datepicker").datetimepicker({
inline: true,
showWeek: true,
firstDay: 1,
dateFormat: 'dd-MM-yy',
timeFormat: 'hh:mm:ss',
separator: ' ',
showSecond: true
});
</script>
Any ideas why the datepicker is not working into the second example? | 0 | [
2,
1967,
3042,
1054,
16855,
106,
19,
487,
18,
410,
2478,
800,
3726,
3726,
31,
259,
20,
3042,
1231,
16855,
106,
19,
487,
18,
410,
2478,
47,
26,
109,
1215,
32,
22,
18,
52,
638,
9,
48,
823,
25,
638,
45,
13,
1,
252,
45,
3206,
53... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
COM interop and double*
===
I apologize if this is a duplicate. I am writing a class that needs to interact with an old c++ unmanaged dll. There is one method that I am having a hard time mapping to managed code:
long DoSomething(int id, double* points, long numberOfPoints, bool useShaping)
I have been thus far unable to map that to an extern method that does not throw a stack unbalanced exception. The problem is with the double pointer. What would the method signature look for in managed code? Here's what I've tried that does not work as an example.
[DllImport("Something.Dll", EntryPoint = "DoSomething")]
public static extern long DoSomething(int id, double[] points, long numberOfPoints, bool useShaping) | 0 | [
2,
13,
960,
1480,
2594,
17,
1494,
2483,
800,
3726,
3726,
31,
12059,
100,
48,
25,
21,
19429,
9,
31,
589,
1174,
21,
718,
30,
2274,
20,
10001,
29,
40,
315,
272,
20512,
367,
177,
8030,
13,
43,
211,
9,
80,
25,
53,
2109,
30,
31,
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... |
improve runtime in code in assembly
===
homework question -assembly 8086
Consider the following 80X86 code segment. Assume that when the code is run, ECX is non-zero.
L: MOV AL, [ESI]
XOR [EDI], AL
XOR AL, [EDI]
XOR [EDI], AL
MOV [ESI], AL
INC ESI
INC EDI
LOOP L, ECX
I need to Re-write the above code segment for better runtime efficiency, under the assumption that ECX initially is divisible by 4.
how to do that? | 0 | [
2,
3545,
485,
891,
19,
1797,
19,
1475,
800,
3726,
3726,
22334,
1301,
13,
8,
29432,
2972,
3274,
3563,
14,
249,
2972,
396,
3274,
1797,
5631,
9,
7158,
30,
76,
14,
1797,
25,
485,
15,
6695,
396,
25,
538,
8,
15938,
9,
644,
45,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is my cube failing to draw properly in LWJGL/OpenGL?
===
I believe it has something to do with draw order, but I've just given up at this point.
Basically, the Quads are drawing, but they're not in the right order, and backface culling is enabled but doesn't help.
import java.awt.Color;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.DoubleBuffer;
import javax.imageio.ImageIO;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
import org.lwjgl.util.glu.GLU;
public class Main {
public Main() {
this.start();
}
private void start() {
try {
Display.setDisplayMode(new DisplayMode(640,640));
Display.setTitle("FPSTest");
Display.create();
} catch (LWJGLException e) {
e.printStackTrace();
}
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GL11.glOrtho(-5, 5, -5, 5, -1, 5);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
int x=0;
while (!Display.isCloseRequested()) {
Display.sync(60);
//poll for keypresses first, default key is 'forward'
//if(Keyboard.isKeyDown(Keyboard.KEY_NUMPAD8));
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT|GL11.GL_COLOR_BUFFER_BIT);
GL11.glEnable(GL11.GL_CULL_FACE|GL11.GL_DEPTH_TEST);
GL11.glColor3f(1, 0, 0);
GL11.glRotatef(x++, 1, 1, 1);
GL11.glBegin(GL11.GL_QUADS);
GL11.glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green
GL11.glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top)
GL11.glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top)
GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top)
GL11.glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top)
GL11.glColor3f(1.0f,0.5f,0.0f); // Set The Color To Orange
GL11.glVertex3f( 1.0f,-1.0f, 1.0f); // Top Right Of The Quad (Bottom)
GL11.glVertex3f(-1.0f,-1.0f, 1.0f); // Top Left Of The Quad (Bottom)
GL11.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Bottom)
GL11.glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Bottom)
GL11.glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red
GL11.glVertex3f( 1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Front)
GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Front)
GL11.glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Front)
GL11.glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Front)
GL11.glColor3f(1.0f,1.0f,0.0f); // Set The Color To Yellow
GL11.glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Back)
GL11.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Back)
GL11.glVertex3f(-1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Back)
GL11.glVertex3f( 1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Back)
GL11.glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue
GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Left)
GL11.glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Left)
GL11.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Left)
GL11.glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Left)
GL11.glColor3f(1.0f,0.0f,1.0f); // Set The Color To Violet
GL11.glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Right)
GL11.glVertex3f( 1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Right)
GL11.glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Right)
GL11.glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Right)
GL11.glEnd();
GL11.glLoadIdentity();
Display.update();
}
Display.destroy();
}
public static void main(String[] argv) {
new Main();
}
}
| 0 | [
2,
483,
25,
51,
13682,
7250,
20,
2003,
7428,
19,
13,
23281,
728,
8430,
118,
10157,
8430,
60,
800,
3726,
3726,
31,
985,
32,
63,
301,
20,
107,
29,
2003,
389,
15,
47,
31,
22,
195,
114,
504,
71,
35,
48,
454,
9,
11374,
15,
14,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
FacesContext in session-scoped JSF Managed Bean
===
I had a request-scoped JSF 1.2 Managed Bean that I needed to refactor to session-scoped bean because it is doing some expensive operation on @postConstruct and that is being called multiple times which really needs to be done only once. The sideeffect of changing the scope to session is now I cannot inject facescontext anymore in faces-config by doing like this:
<managed-property>
<property-name>context</property-name>
<value>#{facesContext}</value>
</managed-property>
where I have
setContext(FacesContext ctx) {}
in my managedBean.
In one of my action methods I need the context to access ExternalContext/HttpServletResponse. I don't want to invoke
FacesConfig.getCurrentInstance();
inside my action method but somehow call setContext(FacesContext ctx) externally to allow isolation of context injection for ease of mocked testing. I tried putting the setContext inside the @postConstruct only to realize later that facesContext is a per request thing and my ExternalContext was reset to null once a new request is being submitted.
How could I call setContext(FacesContext ctx) auto-magically every time I hit a new request although the managed bean itself is a session-scoped? | 0 | [
2,
4904,
1126,
11969,
19,
3723,
8,
11555,
43,
487,
18,
410,
1471,
15322,
800,
3726,
3726,
31,
41,
21,
3772,
8,
11555,
43,
487,
18,
410,
137,
9,
135,
1471,
15322,
30,
31,
851,
20,
302,
17455,
20,
3723,
8,
11555,
43,
15322,
185,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Flags in objdump output of object file
===
There is this output of objdump on some object file:
$ objdump -h main.o
main.o: file format elf32-i386
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000000b 00000000 00000000 00000034 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 00000000 00000000 00000040 2**2
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000000 00000000 00000000 00000040 2**2
ALLOC
3 .note.GNU-stack 00000000 00000000 00000000 00000040 2**0
CONTENTS, READONLY, CODE
What do these flags CONTENTS, ALLOC, LOAD and so on mean? | 0 | [
2,
9318,
19,
5122,
728,
43,
11134,
5196,
16,
3095,
3893,
800,
3726,
3726,
80,
25,
48,
5196,
16,
5122,
728,
43,
11134,
27,
109,
3095,
3893,
45,
5579,
5122,
728,
43,
11134,
13,
8,
252,
407,
9,
111,
407,
9,
111,
45,
3893,
2595,
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... |
Create a GTK+ Cellrenderer with cairo
===
This has now bugged me for at least a few days(and, sadly, nights). I wanna write a rather easy cellrenderer in Gtk+. Since I'm only drawing text(plus the additions with cairo), I'm subclassing from Gtk.CellRendererText(it's Vala+Gtk3 btw).
I've made a minimal example here:
class CellRendererTest : CellRendererText{
public override void render (Cairo.Context ctx, Widget tree,
Gdk.Rectangle background_area, Gdk.Rectangle cell_area,
CellRendererState flags) {
base.render (ctx, tree, background_area, cell_area, flags);
ctx.rectangle(x, y, 20, 20);
ctx.fill();
}
}
class Test : Window{
public Test(){
TreeStore store = new TreeStore(1, typeof(string));
TreeView tv = new TreeView.with_model(store);
tv.insert_column_with_attributes (-1, "Foo",
new CellRendererTest(), "text", 0);
TreeIter iter;
store.append (out iter, null);
store.set (iter, 0, "first", -1);
store.append(out iter, null);
store.set (iter, 0, "second", -1);
store.append (out iter, null);
store.set (iter, 0, "third", -1);
add(tv);
this.show_all();
}
static void main(string[] args){
Gtk.init(ref args);
new Test();
Gtk.main();
}
}
So I thought this would give every entry in the treeview a black box at the upper left corner, but in fact it only draws the box once. This exampe doesn't make this clear, but it's also not possible that the box gets drawn at the same position three times(I've tried that with some different code).
So, does anyone know how to achieve the desired effect here? | 0 | [
2,
1600,
21,
9509,
197,
2430,
1667,
99,
16706,
106,
29,
11772,
800,
3726,
3726,
48,
63,
130,
6256,
6430,
55,
26,
35,
639,
21,
310,
509,
5,
290,
15,
16382,
15,
6472,
6,
9,
31,
11024,
2757,
21,
864,
2010,
1667,
99,
16706,
106,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
iOS/Android Syncing with Delphi/C# Desktop Application
===
Not sure if this is the correct Stack Exchange website but here goes..
A client has asked me to look into the possibility of having a iOS/Android App for typing in information and then syncing up with the main desktop application.
The desktop application is a Windows one written currently in Delphi 7.
Are there any API's to sync data from a SQLLite database on iOS/Android that Delphi can use?
If not, then would it be better if the desktop application was written in C# as its a newer language that can consume the API's easier? | 0 | [
2,
13,
7760,
118,
290,
18524,
6063,
6302,
29,
23030,
118,
150,
5910,
17404,
3010,
800,
3726,
3726,
52,
562,
100,
48,
25,
14,
4456,
7566,
1950,
2271,
47,
235,
1852,
9,
9,
21,
6819,
63,
411,
55,
20,
361,
77,
14,
4813,
16,
452,
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... |
jQuery selector not working on callback function
===
I have my code like this
$.post('JSP/Commands/Search.jsp', $("#search_field").serialize(),
function(id) {
$('#div_to_load').load('JSP/Details.jsp');
$("#headCollapsed_" + id).trigger('click');
});
I have checked that the function is returning the correct id response, however $("#headCollapsed_" + id) is not being selected. When i check
alert( $("#headCollapsed_" + id).length > 0 );
returns true. The div is however present when i'm viewing it in my browser.
Clicking on the element should slideToggle() another div which is already present on the DOM as well.
What could be wrong with this? Thanks. | 0 | [
2,
487,
8190,
93,
23946,
52,
638,
27,
645,
1958,
1990,
800,
3726,
3726,
31,
57,
51,
1797,
101,
48,
5579,
9,
6962,
5,
22,
728,
3401,
118,
16239,
18,
118,
25136,
9,
728,
3401,
22,
15,
5579,
5,
7,
5910,
25136,
1,
1109,
7,
6,
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... |
Rewrite manually created nested JSON to use php's built in functions
===
I have in me table records that are related one to another by parentId field. When fetching them from the DB I need to create JSON array of objects where the child records are added to 'children' property of parent objects :
[{
//main object
children : [
{
//#1st level children object
children: [
{
//#2nd level children object
}
]
}
]
},
{
(...)
]
Right now I'm building the JSON string manually :
//first get the parents
$q = 'SELECT * FROM table WHERE parentId = 0';
$r = mysql_query($q);
$x=1;
$nr = mysql_num_rows($r);
while($e = mysql_fetch_array($r)){
if($x==1){
echo '[ { ';
}
else{
echo ' { ';
}
if($e['leaf']==1){
$leaf = 'true';
} else {
$leaf = 'false';
}
echo '"EndDate" : "'.str_replace('T00:00:00','',$e['EndDate']).'",
"Id" : '.$e['Id'].',
"Name" : "'.$e['Name'].'",
"BaselineStartDate" : "'.str_replace('T00:00:00','',$e['BaselineStartDate']).'"';
if($leaf){
echo ',"leaf": '.$leaf.'';
}
childs($e['Id'], $x, $nr);
if($x<$nr){
echo ',';
}
$x++;
}
if($x>1){
echo ']';
}
function childs($id, $x, $nr, $x2='', $nr2=''){
//now see if there are childern
$q2 = 'SELECT * FROM table WHERE parentId = "'.$id.'" ';
$r2 = mysql_query($q2);
$nr2 = mysql_num_rows($r2);
if($nr2>0){
echo ',"children": [ ';
$x2 =1;
while($e2 = mysql_fetch_array($r2)){
if($e2['leaf']==1){
$leaf2 = 'true';
}
else{
$leaf2 = 'false';
}
echo '{
"EndDate" : "'.str_replace('T00:00:00','',$e2['EndDate']).'",
"Id" : '.$e2['Id'].',
"Name" : "'.$e2['Name'].'",
"BaselineStartDate" : "'.str_replace('T00:00:00','',$e2['BaselineStartDate']).'",
"leaf" : "'.$leaf2.'"';
childs($e2['Id'],$x,$nr,'',$x2,$nr2);
if($x2<$nr2){
echo ',';
}
$x2++;
}
echo '] }';
}
else{
echo ',"children" : []}';
}
}
Is there an easy way to make this code more robust using some built-in php features like fetch_assoc or something like that ? | 0 | [
2,
27891,
23671,
679,
5618,
69,
487,
528,
20,
275,
13,
26120,
22,
18,
392,
19,
3719,
800,
3726,
3726,
31,
57,
19,
55,
859,
742,
30,
50,
1597,
53,
20,
226,
34,
4766,
1340,
575,
9,
76,
18312,
68,
105,
37,
14,
13,
9007,
31,
376... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reading file formatted with C in C#
===
I have a file, that was written in C using fprintf, which contains a long stream of numbers.
First it contains subsequently 4 times an int (so the first 16 bytes are 4 ints) and then it contains doubles (I assume every 8 bytes a new double).
The file was normally written using fprintf(FILE* fout, "%d%d%d%d%lf%lf%lf...", int a, int b, int c, int d, double e, double f...);
There are no spaces at any point or anything else. Now I need to read the data with C# but so far everything I tried simply didn't work, any suggestions? | 0 | [
2,
1876,
3893,
13,
29850,
29,
272,
19,
272,
5910,
800,
3726,
3726,
31,
57,
21,
3893,
15,
30,
23,
642,
19,
272,
568,
398,
10299,
410,
15,
56,
1588,
21,
175,
3766,
16,
2116,
9,
64,
32,
1588,
1724,
268,
436,
40,
19,
38,
13,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Query objects with an array, based on user selecting from drop down
===
I've been using the great example by Darin from [this page][1] and am trying to expand it for my purposes.
Simply, I need to build a drop down box, whose contents are based on all of the 'property1' variables, in all my records (1 / 2 / 3). The user will select from the drop-down. Next, I need to take that selection and make my query search with it (at the moment it's searching for '1'). Is there a simple way to do this? I am brand new to scripting, let alone js!
var myArray = ['1'];
var json = [{
'property1': '1',
'property2': 'A'
}, {
'property1': '2',
'property2': 'B'
}, {
'property1': '3',
'property2': 'C'
}];
var result = new Array();
for (var i = 0; i < myArray.length; i++) {
for (var j = 0; j < json.length; j++) {
if (json[j].property1 === myArray[i]) {
result.push(json[j].property2);
}
}
}
// at this point result will contain ['A']
document.write(result)
[1]: http://stackoverflow.com/questions/3530351/query-objects-with-an-array-without-3rd-party-script | 0 | [
2,
25597,
3916,
29,
40,
7718,
15,
432,
27,
4155,
20764,
37,
2804,
125,
800,
3726,
3726,
31,
22,
195,
74,
568,
14,
374,
823,
34,
3178,
108,
37,
636,
1565,
2478,
500,
2558,
165,
500,
17,
589,
749,
20,
6073,
32,
26,
51,
4612,
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 do I replace the fragment from inside a fragment?
===
While I realize that nested fragments is not an option i still have an issue that I simply cannot figure out an answer to.
I'm using ActionBarSherlock's FragmentsTabPager example to create an interface where it is possible to page through the tabs with swiping rather than clicking on the tabs. My problem is that one of these tabs consists of a listview. When this listview is clicked, a different fragment containing a new list(with data based on the item clicked) is launched. How to I accomplish this ?
I figured you might need a bit of the cose from my BaseActivity(The one with the ViewPager and the TabsAdapter
*snippet*
public class BaseActivity extends SherlockFragmentActivity {
TabHost mTabHost;
ViewPager mViewPager;
TabsAdapter mTabsAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_tabs_pager);
mTabHost = (TabHost)findViewById(android.R.id.tabhost);
mTabHost.setup();
mViewPager = (ViewPager)findViewById(R.id.pager);
mTabsAdapter = new TabsAdapter(this, mTabHost, mViewPager);
mTabsAdapter.addTab(mTabHost.newTabSpec("home").setIndicator("Home"),
FragmentStackSupport.CountingFragment.class, null);
mTabsAdapter.addTab(mTabHost.newTabSpec("players").setIndicator("PLAYERS"),
PlayerRankingFragment.class, null);
mTabsAdapter.addTab(mTabHost.newTabSpec("teams").setIndicator("TEAMS"),
FederationRanksFragment.class, null);
if (savedInstanceState != null) {
mTabHost.setCurrentTabByTag(savedInstanceState.getString("tab"));
}
}
/**
* This is a helper class that implements the management of tabs and all
* details of connecting a ViewPager with associated TabHost. It relies on a
* trick. Normally a tab host has a simple API for supplying a View or
* Intent that each tab will show. This is not sufficient for switching
* between pages. So instead we make the content part of the tab host
* 0dp high (it is not shown) and the TabsAdapter supplies its own dummy
* view to show as the tab content. It listens to changes in tabs, and takes
* care of switch to the correct paged in the ViewPager whenever the selected
* tab changes.
*/
public static class TabsAdapter extends FragmentPagerAdapter
implements TabHost.OnTabChangeListener, ViewPager.OnPageChangeListener {
private final Context mContext;
private final TabHost mTabHost;
private final ViewPager mViewPager;
private final ArrayList<TabInfo> mTabs = new ArrayList<TabInfo>();
static final class TabInfo {
private final String tag;
private final Class<?> clss;
private final Bundle args;
TabInfo(String _tag, Class<?> _class, Bundle _args) {
tag = _tag;
clss = _class;
args = _args;
}
}
*Snippet*
BaseActivity -> Tab "Teams" -> Teams ListView(AllianceFragment) -> Teams Item Clicked -> Players ListView(PlayersFragment).
And lastly here's a screenshot of the app in question:
![https://dl.dropbox.com/u/11917448/Screenshot_2012-06-28-13-32-21.png][1]
[1]: http://i.stack.imgur.com/JtnNU.png | 0 | [
2,
184,
107,
31,
3934,
14,
14847,
37,
572,
21,
14847,
60,
800,
3726,
3726,
133,
31,
4007,
30,
5618,
69,
10837,
25,
52,
40,
4255,
31,
174,
57,
40,
1513,
30,
31,
1659,
1967,
1465,
70,
40,
1623,
20,
9,
31,
22,
79,
568,
1028,
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... |
Why does google pagespeed asks to specify ETag even when cache headers are set
===
I have set cache headers to be far in future (1 year from now) and have disabled the ETags as advised by the YSlow (http://developer.yahoo.com/performance/rules.html#etags) but Google pagespeed seems to require ETag (or last-modified) even after the cached headers are set.
"It is important to specify one of Expires or Cache-Control max-age, and one of Last-Modified or ETag, for all cacheable resources."
The two rules seems to be conflicting each other. | 0 | [
2,
483,
630,
8144,
2478,
6708,
3913,
20,
19077,
13,
62,
8628,
166,
76,
16522,
157,
445,
50,
309,
800,
3726,
3726,
31,
57,
309,
16522,
157,
445,
20,
44,
463,
19,
1022,
13,
5,
165,
159,
37,
130,
6,
17,
57,
10154,
14,
13,
5735,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create exe from a selenium framework
===
I have created a selenium Framework which has many folders. Every folders contains some peice of code, selnium jars, poi jars, reports etc. I want to create a single executable which can contain all this and can be shared with client.
Thanks
Anoop | 0 | [
2,
184,
20,
1600,
1396,
62,
37,
21,
23027,
14311,
6596,
800,
3726,
3726,
31,
57,
679,
21,
23027,
14311,
6596,
56,
63,
151,
19294,
18,
9,
352,
19294,
18,
1588,
109,
3560,
3568,
16,
1797,
15,
6254,
14311,
5112,
18,
15,
2353,
49,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to create a new entry in collections in storageroom from my form?
===
I have a form and i have to add an entry from my form to storageroom cms by calling that api?
But i could not do it because it asks for a specific format. So please help me doing.
The format is
{"entry":
{"@book":""
}
} | 0 | [
2,
184,
20,
1600,
21,
78,
2792,
19,
5721,
19,
4326,
4447,
37,
51,
505,
60,
800,
3726,
3726,
31,
57,
21,
505,
17,
31,
57,
20,
3547,
40,
2792,
37,
51,
505,
20,
4326,
4447,
2390,
18,
34,
2555,
30,
21,
2159,
60,
47,
31,
110,
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... |
Keyboard stoped working on Intel x86 Android emulator after upgrading to ADT 20
===
I mean I cant type from my laptop keyboard into android emulator anymore.
Virtual and on-screen keyboards are working fine.
Any suggestions how this could be fixed? | 0 | [
2,
8896,
747,
69,
638,
27,
14635,
993,
3274,
13005,
3579,
14868,
75,
26939,
20,
21,
43,
38,
434,
800,
3726,
3726,
31,
884,
31,
2973,
1001,
37,
51,
12294,
8896,
77,
13005,
3579,
14868,
3375,
9,
6599,
17,
27,
8,
7187,
5362,
50,
63... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... |
how to get the class name through selenium
===
<table >
<tr class="odd First"><td>1one Cell</td><td>2one Cell</td><td>3one Cell</td><td>4one Cell</td> </tr>
<tr class="even Second"><td>Two Cell</td><td>2Two Cell</td><td>3Two Cell</td><td>4Two Cell</td></tr>
<tr class="odd Thrid"><td>1Three Cell</td><td>2Three Cell</td><td>3Three Cell</td><td>4Three Cell</td></tr>
<tr class="even Fourth"><td>1Five Cell</td><td>2Five Cell</td><td>3Five Cell</td><td>4Five Cell</td></tr>
</table>
How can i get the class names of the tr. Please suggest me. | 0 | [
2,
184,
20,
164,
14,
718,
204,
120,
23027,
14311,
800,
3726,
3726,
13,
1,
5924,
13,
1,
13,
1,
6384,
718,
3726,
7,
22530,
64,
7,
1,
38,
43,
1,
165,
849,
1667,
1,
118,
38,
43,
1,
38,
43,
1,
135,
849,
1667,
1,
118,
38,
43,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 find the number of columns within a row key in hbase
===
How to find the number of columns within a row key in hbase (since a row can have many columns) | 0 | [
2,
184,
20,
477,
14,
234,
16,
7498,
363,
21,
3131,
1246,
19,
746,
8436,
800,
3726,
3726,
184,
20,
477,
14,
234,
16,
7498,
363,
21,
3131,
1246,
19,
746,
8436,
13,
5,
7412,
21,
3131,
92,
57,
151,
7498,
6,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How do I know what my jquery selectors have selected?
===
So I had a general question. Often, while traversing different tree elements I find that the JQuery selector that I think I need ends up selecting something else, or much worse, it seems to select nothing.
For example sometimes using `.child()` or `.sibling()` it is easy to lose track of what is actually being selected.
Sometimes I can use `alert()`s or a `console.log()` to isolate the problem. Sometimes though even that doesn't do the trick. **I was curious whether anyone knew of any good tricks to know what (if anything) the selector I am using has actually selected.** I don't know if there is any firebug tools, or something else that is useful.
Any suggestions? Thanks alot. | 0 | [
2,
184,
107,
31,
143,
98,
51,
487,
8190,
93,
23946,
18,
57,
1704,
60,
800,
3726,
3726,
86,
31,
41,
21,
297,
1301,
9,
478,
15,
133,
19501,
68,
421,
1541,
2065,
31,
477,
30,
14,
487,
8190,
93,
23946,
30,
31,
277,
31,
376,
3451... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
KnockoutJS - printing html snippets
===
I'm trying to render a new div with the class `row-fluid` on every 4th object in my observableArray. Unfortunately putting html snippets into an if block doesn't seem to accomplish anything.
Is there another way to accomplish this?
<!-- ko foreach: detailsVm.addresses -->
<!-- ko if: $index % 3 === 0 -->
<div class="row-fluid">
<!-- /ko -->
<div class="span4">
My Content
</div>
<!-- ko if: $index % 3 === 0 -->
</div>
<!-- /ko -->
<!-- /ko --> | 0 | [
2,
11676,
728,
18,
13,
8,
7312,
13,
15895,
13,
29061,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
16535,
21,
78,
13,
12916,
29,
14,
718,
13,
1,
5417,
8,
12848,
1340,
1,
27,
352,
268,
96,
3095,
19,
51,
5122,
10321,
579,
8576,
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 work with Git merge and update my working directory?
===
I download the last version from the server with
git fetech
as far as I understood now the repository is updated.
I have two questions :
1. Now I worked on file that was changed from the server and I want to do the merge ?
when Do I need to do the merge ? Do I need to do it after the git fetech or when I do the add files ? could you please exaplain me what should be the statmentes for the merge process ?
2. If I want to update my workign directory and I don't have any merge How I can do it ?
I tried to do it with :
git checkout -f "mybranch"
git rebase
git checkout "mybranch"
is it ok ? Do I have different way ?
| 0 | [
2,
184,
20,
170,
29,
13,
10404,
12666,
17,
11100,
51,
638,
16755,
60,
800,
3726,
3726,
31,
7121,
14,
236,
615,
37,
14,
8128,
29,
13,
10404,
3686,
6524,
28,
463,
28,
31,
4014,
130,
14,
24869,
25,
6372,
9,
31,
57,
81,
2346,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to remove specific element from char array in Java
===
I have tested different elements in a char array and if they do not meet the conditions I want to remove them from the array. Is there a way to do this?
EDIT:
Here is some code
String s;
char[] b = inputString.toCharArray();
b = new char[b.length];
do
{
if(!(b[i]>='0')&&(b[i]<='9')&&(b[i]!='.'))
{
s = Character.toString(b[i]);
if(s.equals("+"))
{
t = 1;
}
else if(s.equals("-"))
{
t = 2;
}
else if(s.equals("x"))
{
t = 3;
}
else if(s.equals("÷"))
{
t = 4;
}
else
{
t = 1029;
}
//want to delete element here if they fail if test
} | 0 | [
2,
184,
20,
4681,
1903,
4520,
37,
4892,
7718,
19,
8247,
800,
3726,
3726,
31,
57,
7631,
421,
2065,
19,
21,
4892,
7718,
17,
100,
59,
107,
52,
1255,
14,
2039,
31,
259,
20,
4681,
105,
37,
14,
7718,
9,
25,
80,
21,
161,
20,
107,
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... |
WPF Window OnClosing when windows is shutting down
===
In my WPF Main Window I handle the OnClosing event - protected override void OnClosing(CancelEventArgs e). This event is also fired when Windows is shutting down, and tries to close the programs opened.
But, when Windows is shutting down, I would like to have a different logic than I would have if the user had clicked on the X button on the top right. Is there a way to distinguish if the window close was initiated by the user and not by the system?
| 0 | [
2,
619,
7721,
1463,
27,
13023,
18,
68,
76,
1936,
25,
19796,
125,
800,
3726,
3726,
19,
51,
619,
7721,
407,
1463,
31,
3053,
14,
27,
13023,
18,
68,
807,
13,
8,
3803,
84,
11891,
11364,
27,
13023,
18,
68,
5,
1245,
19537,
6645,
10663,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 input opacity change on hover, focus and val
===
I'm trying to have an input field which is set at opacity:0.8; fade to 1.0 if the mouse is over the input field as well as if the input is in focus and if there is data in the input.
If any of the above condition aren't true, then have the input fade back to 0.8.
I've used the focus function with a mixture of mouseover/mouseout and change function which verifies the val() of the input but I can't get the desired effect.
Anyone can help? Let me know if you need more information.
| 0 | [
2,
487,
8190,
93,
6367,
13,
11490,
5788,
753,
27,
21350,
15,
1776,
17,
3347,
800,
3726,
3726,
31,
22,
79,
749,
20,
57,
40,
6367,
575,
56,
25,
309,
35,
13,
11490,
5788,
45,
387,
9,
457,
73,
11381,
20,
137,
9,
387,
100,
14,
75... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is this C code giving me a bus error?
===
I have, as usual, been reading quite a few posts on here. I found a particular useful posts on bus errors in general, see [here][1]. My problem is that I cannot understand why my particular code is giving me an error.
My code is an attempt to teach myself C. It's a modification of a game I made when I learned Java. The goal in my game is to take a huge 5049 x 1 text file of words. Randomly pick a word, jumble it and try to guess it. I know how to do all of that. So anyway, each line of the text file contains a word like:
5049
must
lean
better
program
now
...
So, I created an string array in C, tried to read this string array and put it into C. I didn't do anything else. Once I get the file into C, the rest should be easy. Weirder yet is that it complies. My problem comes when I run it with `./blah` command.
The error I get is simple. It says:
zsh: bus error ./blah
My code is below. I suspect it might have to do with memory or overflowing the buffer, but that's completely unscientific and a gut feeling. So my question is simple, why is this C code giving me this bus error msg?
#include<stdio.h>
#include<stdlib.h>
//Preprocessed Functions
void jumblegame();
void readFile(char* [], int);
int main(int argc, char* argv[])
{
jumblegame();
}
void jumblegame()
{
//Load File
int x = 5049; //Rows
int y = 256; //Colums
char* words[x];
readFile(words,x);
//Define score variables
int totalScore = 0;
int currentScore = 0;
//Repeatedly pick a random work, randomly jumble it, and let the user guess what it is
}
void readFile(char* array[5049], int x)
{
char line[256]; //This is to to grab each string in the file and put it in a line.
FILE *file;
file = fopen("words.txt","r");
//Check to make sure file can open
if(file == NULL)
{
printf("Error: File does not open.");
exit(1);
}
//Otherwise, read file into array
else
{
while(!feof(file))//The file will loop until end of file
{
if((fgets(line,256,file))!= NULL)//If the line isn't empty
{
array[x] = fgets(line,256,file);//store string in line x of array
x++; //Increment to the next line
}
}
}
}
As always, with humble respect to all.
GeekyOmega
[1]: http://stackoverflow.com/questions/212466/what-is-a-bus-error
| 0 | [
2,
483,
25,
48,
272,
1797,
1438,
55,
21,
1683,
7019,
60,
800,
3726,
3726,
31,
57,
15,
28,
3820,
15,
74,
1876,
1450,
21,
310,
9868,
27,
235,
9,
31,
216,
21,
1498,
4811,
9868,
27,
1683,
11908,
19,
297,
15,
196,
636,
6836,
500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are some good examples of using javascript in an iOS webview?
===
I'm trying to use javascript in a web view, but I've never seen this be done before. It would be very useful if I could find a good example to compare with my project. | 1 | [
2,
98,
50,
109,
254,
3770,
16,
568,
8247,
8741,
19,
40,
13,
7760,
2741,
4725,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
8247,
8741,
19,
21,
2741,
1418,
15,
47,
31,
22,
195,
243,
541,
48,
44,
677,
115,
9,
32,
83,
44,
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,
0... |
key-value coding compliance
===
I was foolish and didn't test continually as I programmed, so now I'm not sure where the error has crept in. Am working on a programmable calculator. When I run, it crashes before displaying anything and gives me this message:
*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<CalculatorViewController 0x6a405a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key description.'
I'd use NSLog to look for the bug, but I don't know where to try it when the crash happens before anything shows up. Thoughts on what I'm doing wrong?
Here's CalculatorViewController.m, with some extra property declarations for unfinished, commented-out code I've omitted:
#import "CalculatorViewController.h"
#import "CalculatorBrain.h"
@interface CalculatorViewController ()
@property (nonatomic) BOOL userIsEnteringNumber;
@property (nonatomic) BOOL numberIsNegative;
@property (nonatomic,strong) CalculatorBrain *brain;
@end
@implementation CalculatorViewController
@synthesize display = _display;
@synthesize descriptionLabel = _descriptionLabel;
@synthesize userIsEnteringNumber = _userIsEnteringNumber;
@synthesize numberIsNegative;
@synthesize brain = _brain;
-(CalculatorBrain *)brain
{
if (!_brain) _brain = [[CalculatorBrain alloc] init];
return _brain;
}
//This adds a pressed digit to the display label.
- (IBAction)digitPressed:(UIButton *)sender
{
NSString *digit = sender.currentTitle;
//Enter digit if it wouldn't create a two-decimal-point case.
NSRange range = [self.display.text rangeOfString:@"."];
if (range.location==NSNotFound || (![digit isEqualToString:@"."]))
if (self.userIsEnteringNumber)
{
self.display.text = [self.display.text stringByAppendingString:digit];
self.descriptionLabel.text = [self.display.text stringByAppendingString:@" "];
}
else
{
self.descriptionLabel.text = [self.descriptionLabel.text stringByAppendingString:digit];
self.descriptionLabel.text = [self.descriptionLabel.text stringByAppendingString:@" "];
if (![sender.currentTitle isEqualToString:@"."])
{
self.display.text = digit;
}
else
{
self.display.text = @"0.";
}
self.userIsEnteringNumber = YES;
}
}
//This sets up an operation.
- (IBAction)operationPressed:(UIButton *)sender
{
if (self.userIsEnteringNumber) [self enterPressed];
NSString *operation = sender.currentTitle;
double result = [self.brain performOperation:operation];
self.display.text = [NSString stringWithFormat:@"%g",result];
{
NSString *descr = [self.brain description];
self.descriptionLabel.text = descr;
}
}
- (IBAction)enterPressed
{
NSCharacterSet *set = [NSCharacterSet decimalDigitCharacterSet];
NSRange range = [self.display.text rangeOfCharacterFromSet:set];
if (range.location==NSNotFound)
{
[self.brain pushOperandAsVariable:self.display.text];
}
else
{
[self.brain pushOperand:[self.display.text doubleValue]];
}
self.userIsEnteringNumber = NO;
}
@end
And here's CalculatorBrain.m:
#import "CalculatorBrain.h"
@interface CalculatorBrain()
@property (nonatomic, strong) NSMutableArray *programStack;
@property (nonatomic,strong)NSDictionary *variableValues;
@end
@implementation CalculatorBrain
@synthesize programStack = _programStack;
@synthesize variableValues = _variableValues;
- (NSMutableArray *)programStack
{
if (!_programStack) _programStack = [[NSMutableArray alloc] init];
return _programStack;
}
- (id)program
{
return [self.programStack copy];
}
//Here are the two types of pushes that the ViewController can implement. First, operand pushes . . .
- (void)pushOperand:(double)operand
{
[self.programStack addObject:[NSNumber numberWithDouble:operand]];
}
//. . . and then variable pushes.
- (void) pushOperandAsVariable:(NSString *)variable
{
//Create dictionary
//Move this later on to ViewController but for now leave where it is....
NSMutableArray *variablesUsed = [[NSMutableArray alloc] init];
NSArray *objects = [[NSArray alloc] initWithObjects:[NSNumber numberWithDouble:3],[NSNumber numberWithDouble:4.1],[NSNumber numberWithDouble:-6],[NSNumber numberWithDouble:4.5298], [NSNumber numberWithDouble:3.14159], nil];
NSArray *keys = [[NSArray alloc] initWithObjects:@"x",@"y",@"z",@"foo", @"π", nil];
NSDictionary *variableValues = [[NSDictionary alloc] initWithObjects:objects forKeys:keys];
//Check program for keys
NSNumber *operand;
for (int i=0; i<keys.count; i++)
{
if ([[keys objectAtIndex:i] isEqual:variable])
[variablesUsed addObject:variable];
operand = [variableValues objectForKey:variable];
}
[self.programStack addObject:operand];
}
- (double)performOperation:(NSString *)operation
{
[self.programStack addObject:operation];
return [[self class] runProgram:self.program];
}
+ (double)popOffStack:(NSMutableArray *)stack
{
double result = 0;
id topOfStack = [stack lastObject];
if (topOfStack) [stack removeLastObject];
if ([topOfStack isKindOfClass:[NSNumber class]])
{
result = [topOfStack doubleValue];
}
//Here are the results for various operations.
else if ([topOfStack isKindOfClass:[NSString class]])
{
NSString *operation = topOfStack;
if ([operation isEqualToString:@"+"])
{
result = [self popOffStack:stack] +
[self popOffStack:stack];
}
else if ([@"*" isEqualToString:operation])
{
result = [self popOffStack:stack] *
[self popOffStack:stack];
}
else if ([operation isEqualToString:@"-"])
{
double subtrahend = [self popOffStack:stack];
result = [self popOffStack:stack] - subtrahend;
}
else if ([operation isEqualToString:@"/"])
{
double divisor = [self popOffStack:stack];
if (divisor) result = [self popOffStack:stack] / divisor;
}
else if ([operation isEqualToString:@"sin"])
{
result = sin([self popOffStack:stack]);
}
else if ([operation isEqualToString:@"cos"])
{
result = cos([self popOffStack:stack]);
}
else if ([operation isEqualToString:@"√"])
{
result = sqrt([self popOffStack:stack]);
}
else if ([operation isEqualToString:@"π"])
{
result = M_PI;
}
}
return result;
}
+ (double)runProgram:(id)program
{
//Run program.
NSMutableArray *mutableCopyOfProgram;
if ([program isKindOfClass:[NSArray class]])
{
mutableCopyOfProgram = [program mutableCopy];
return [self popOffStack:mutableCopyOfProgram];
}
else return 0;
}
@end
As always, thanks for your help.
| 0 | [
2,
1246,
8,
15165,
13,
15458,
14969,
800,
3726,
3726,
31,
23,
12596,
17,
223,
22,
38,
1289,
16609,
28,
31,
2866,
43,
15,
86,
130,
31,
22,
79,
52,
562,
113,
14,
7019,
63,
14249,
19,
9,
589,
638,
27,
21,
625,
79,
579,
28539,
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... |
Magento admin menu link not showing up
===
I have created 2 modules (A and B) in Magento. Each of these modules are managed from the admin section.
I tried creating a menu link under cms(menu) in the admin section for each module by writing the following configuration in modules' config files
Module A>etc>config.xml
<adminhtml>
<menu>
<a module="A">
<title>A</title>
<sort_order>100</sort_order>
<children>
<items module="A">
<title>Manage A</title>
<sort_order>0</sort_order>
<action>a/adminhtml_a</action>
</items>
</children>
</a>
</menu>
<adminhtml>
Module B>etc>config.xml
<adminhtml>
<menu>
<b module="B">
<title>B</title>
<sort_order>100</sort_order>
<children>
<items module="B">
<title>Manage B</title>
<sort_order>1</sort_order>
<action>b/adminhtml_b</action>
</items>
</children>
</b>
</menu>
<adminhtml>
However only the link for Module B shows up under CMS menu. How can I show both links? | 0 | [
2,
4723,
17050,
21,
43,
2160,
11379,
3508,
52,
3187,
71,
800,
3726,
3726,
31,
57,
679,
172,
17113,
13,
5,
58,
17,
334,
6,
19,
4723,
17050,
9,
206,
16,
158,
17113,
50,
1471,
37,
14,
21,
43,
2160,
1050,
9,
31,
794,
2936,
21,
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... |
Outlook 2010 and Dialog Box Launcher
===
I am developing a custom ribbon for Outlook 2010 and I need to add a Dialog Box Launcher to the group in the custom ribbon. I have followed http://msdn.microsoft.com/en-us/library/microsoft.office.tools.ribbon.ribbongroup.dialoglauncherclick.aspx
however when I click on the icon on the bottom right of the group, nothing happens.
I double checked everything that I could think of and still no luck.
Can someone help me please????? | 0 | [
2,
19837,
498,
17,
28223,
1649,
19755,
800,
3726,
3726,
31,
589,
3561,
21,
5816,
9162,
26,
19837,
498,
17,
31,
376,
20,
3547,
21,
28223,
1649,
19755,
20,
14,
214,
19,
14,
5816,
9162,
9,
31,
57,
709,
7775,
6903,
79,
18,
43,
103,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google Earth KmlModel Altitude
===
I am using the google earth plugin to manipulate a google earth window within my browser, however I can't seem to change altitude of KmlModels.
The offending script looks like this:
(mostly copied from an example)
var placemark = ge.createPlacemark('');
placemark.setName('model');
// Placemark/Model (geometry)
var model = ge.createModel('');
placemark.setGeometry(model);
// Placemark/Model/Link
var link = ge.createLink('');
link.setHref('http://earth-api-samples.googlecode.com/svn/trunk/examples/' +
'static/splotchy_box.dae');
model.setLink(link);
// get center look at location
var lookAt = ge.getView().copyAsLookAt(ge.ALTITUDE_RELATIVE_TO_GROUND);
// Placemark/Model/Location
var loc = ge.createLocation('');
loc.setLatitude(37.929828);
loc.setLongitude(-100.02596);
loc.setAltitude(6562); //Has no effect
model.setLocation(loc);
// add the model placemark to Earth
ge.getFeatures().appendChild(placemark);
// zoom into the model
lookAt.setRange(300);
lookAt.setTilt(80);
lookAt.setLatitude(37.929828);
lookAt.setLongitude(-100.02596);
ge.getView().setAbstractView(lookAt);
Does anyone know why? My model is always clamped to the ground no matter what. This is very frustrating. | 0 | [
2,
8144,
1073,
401,
255,
13998,
7128,
800,
3726,
3726,
31,
589,
568,
14,
8144,
1073,
10922,
108,
20,
18468,
21,
8144,
1073,
1463,
363,
51,
16495,
15,
207,
31,
92,
22,
38,
2260,
20,
753,
7128,
16,
401,
255,
13998,
18,
9,
14,
168,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Inserting image as thumbnail into word doc
===
I am wondering how to insert a picture as a thumbnail into word doc. Can anyone help me on this? | 0 | [
2,
14692,
68,
1961,
28,
5078,
325,
947,
77,
833,
9765,
800,
3726,
3726,
31,
589,
5712,
184,
20,
14692,
21,
2151,
28,
21,
5078,
325,
947,
77,
833,
9765,
9,
92,
1276,
448,
55,
27,
48,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Port from GtkTable to GtkGrid
===
I tried to port this code from GtkTable to GtkGrid, but any attempt result in application crashes:
Code:
static int timeout_id = -1;
static GtkWidget *file_lbl, *size_lbl;
static GtkWidget *status_dialog;
void close_status_window(void)
{
if (timeout_id >= 0)
{
g_source_remove(timeout_id);
timeout_id = -1;
}
if (status_dialog)
gtk_widget_destroy(GTK_WIDGET(status_dialog));
status_dialog = NULL;
tray_icon_items_set_sensible(TRUE);
}
static gboolean timeout_cb(gpointer data)
{
Recording *recording = data;
gint s;
gchar *size=NULL;
g_assert(recording);
if (!gtk_widget_get_visible(status_dialog))
gtk_widget_show_all(status_dialog);
s = get_file_size(recording->filename);
if (s > 0) {
if (s < 1024) size = g_strdup_printf(_("%i byte"), s);
if ((s >= 1024) && (s < 1024*1024)) size = g_strdup_printf(_("%i kB"), s>>10);
if (s >= 1024*1024) size = g_strdup_printf(_("%.2f MB"), (float)s/1024/1024);
} else {
if (s) size = g_strdup(_("Error"));
else size = g_strdup(_("0 byte"));
}
gtk_label_set_text(GTK_LABEL(file_lbl), recording->filename);
gtk_label_set_text(GTK_LABEL(size_lbl), size);
g_free(size);
return TRUE;
}
void run_status_window(Recording *recording)
{
timeout_id = g_timeout_add(500, (GSourceFunc) timeout_cb, recording);
}
static void button_clicked_cb(GtkButton *button, gpointer data)
{
Recording *recording = data;
close_status_window();
recording_stop(recording);
}
static gint delete_event_cb(GtkWidget* window, GdkEventAny* e, gpointer data)
{
button_clicked_cb(NULL, data);
return TRUE;
}
GtkWidget* record_status_window(Recording *recording)
{
GtkWidget *btn_label, *btn_pixmap, *button;
GtkWidget *vbox, *btn_box, *hbox;
GtkWidget *table;
GtkWidget *title, *f_lbl, *s_lbl;
char *text, *str;
status_dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(status_dialog),_("Recording status"));
gtk_window_set_default_size(GTK_WINDOW(status_dialog), 400, -1);
vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
gtk_container_set_border_width(GTK_CONTAINER(vbox), 6);
table = gtk_table_new(3, 2, FALSE);
gtk_table_set_row_spacings(GTK_TABLE(table), 10);
gtk_table_set_col_spacings(GTK_TABLE(table), 12);
gtk_container_set_border_width(GTK_CONTAINER(table), 6);
str = g_strdup_printf(_("Recording from station %s"), recording->station);
text = g_strdup_printf("<b><big>%s</big></b>", str);
g_free(str);
title = gtk_label_new(text);
g_free(text);
gtk_label_set_use_markup(GTK_LABEL(title), TRUE);
text = g_strdup_printf(" <b>%s</b>", _("Destination:"));
f_lbl = gtk_label_new(text);
g_free(text);
gtk_label_set_use_markup(GTK_LABEL(f_lbl), TRUE);
text = g_strdup_printf(" <b>%s</b>", _("Filesize:"));
s_lbl = gtk_label_new(text);
g_free(text);
gtk_label_set_use_markup(GTK_LABEL(s_lbl), TRUE);
file_lbl = gtk_label_new("");
gtk_label_set_ellipsize(GTK_LABEL(file_lbl), PANGO_ELLIPSIZE_START);
size_lbl = gtk_label_new("");
gtk_misc_set_alignment(GTK_MISC(title), 0.0f, 0.0f);
gtk_misc_set_alignment(GTK_MISC(f_lbl), 1.0f, 0.5f);
gtk_misc_set_alignment(GTK_MISC(s_lbl), 1.0f, 0.5f);
gtk_misc_set_alignment(GTK_MISC(file_lbl), 0.0f, 0.5f);
gtk_misc_set_alignment(GTK_MISC(size_lbl), 0.0f, 0.5f);
gtk_table_attach(GTK_TABLE(table), title, 0, 2, 0, 1, GTK_FILL | GTK_SHRINK, GTK_FILL | GTK_EXPAND, 0, 0);
gtk_table_attach(GTK_TABLE(table), f_lbl, 0, 1, 1, 2, GTK_FILL | GTK_SHRINK, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(table), s_lbl, 0, 1, 2, 3, GTK_FILL | GTK_SHRINK, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(table), file_lbl, 1, 2, 1, 2, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
gtk_table_attach(GTK_TABLE(table), size_lbl, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, GTK_FILL, 0, 0);
button = gtk_button_new();
btn_box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
btn_label = gtk_label_new(_("Stop Recording"));
btn_pixmap = gtk_image_new_from_stock(GTK_STOCK_STOP, GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start (GTK_BOX(btn_box), btn_pixmap, FALSE, FALSE, 2);
gtk_box_pack_start (GTK_BOX(btn_box), btn_label, FALSE, FALSE, 2);
gtk_container_add(GTK_CONTAINER(button), btn_box);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_pack_end (GTK_BOX(hbox), button, TRUE, FALSE, 0);
gtk_box_pack_start (GTK_BOX(vbox), table, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(status_dialog), vbox);
g_signal_connect(G_OBJECT(status_dialog), "delete_event", G_CALLBACK(delete_event_cb), recording);
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_clicked_cb), recording);
gtk_window_set_modal(GTK_WINDOW(status_dialog), TRUE);
return status_dialog;
}
warning: assignment from incompatible pointer type [enabled by default]
Will be grateful for any help. Thanks | 0 | [
2,
1295,
37,
9509,
197,
5924,
20,
9509,
197,
16375,
800,
3726,
3726,
31,
794,
20,
1295,
48,
1797,
37,
9509,
197,
5924,
20,
9509,
197,
16375,
15,
47,
186,
1735,
829,
19,
3010,
21563,
45,
1797,
45,
12038,
19,
38,
85,
1320,
1,
1340... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF/PHP - XML Parser can't handle HTML entities?
===
My RESTful WCF service accepts XML request bodies from clients, most clients are PHP applications.
The PHP applications encode their requests with htmlentities(), which is placed within the element tags. For example, a request to add a new user-account might look like this:
$body = "<user>
<userName>" . htmlentities( $userName ) . "</userName>
</user>"
The system works fine, there have been zero errors with it, until today.
I looked through the logs and saw this request had failed:
<user>
<userName>èeesu</userName>
</user>
with the following exceptions:
InvalidOperationException: "There is an error in XML document (4, 12)."
XmlException: "Character reference not valid. Line 4, position 12."
(where line 4, position 12, refers to the `<userName>` element's InnerText (i.e. the string `èeesu;`).
`è` is a valid HTML entity, but I understand that XML only defines a minimum set of character references (`&`, `<`, etc), and that XML expects all other characters to be in their document encoding representation instead, and so will reject things like `è`.
Can someone confirm this is the case? And if so, how can I get PHP to only encode XML-specific entities instead of HTML entities? | 0 | [
2,
11801,
410,
118,
26120,
13,
8,
23504,
2017,
4104,
92,
22,
38,
3053,
13,
15895,
12549,
60,
800,
3726,
3726,
51,
760,
1566,
11801,
410,
365,
16548,
23504,
3772,
2576,
37,
7421,
15,
127,
7421,
50,
13,
26120,
3767,
9,
14,
13,
26120... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 height of LI using jQuery so news ticker scrolls up the exact amount needed
===
I am using a script from
http://www.yourinspirationweb.com/en/jquery-how-to-create-a-news-ticker-with-just-a-few-javascript-lines/
which is a great newsticker, designed to scroll up just one article at a time, then append it again at the end in a continuous loop. But the limitation of this script is that the news items in each <li> have to be the same height as eachother, which isn't always possible.
I have been trying to modify the script so that it will automatically get the outerheight of '#ticker li:first'. and scroll it so that marginTop equals the negative of that outerheight. rather than the default '-120px'. But i've realised it's written as CSS style, i don't know how to rewrite it. Help!
here's the original script:
$(function()
{
var ticker = function()
{
setTimeout(function(){
$('#ticker li:first').animate( {marginTop: '-120px'}, 800, function()
{
$(this).detach().appendTo('ul#ticker').removeAttr('style');
});
ticker();
}, 4000);
};
ticker();
}); | 0 | [
2,
164,
2947,
16,
2093,
568,
487,
8190,
93,
86,
996,
8809,
106,
12159,
18,
71,
14,
5340,
2006,
851,
800,
3726,
3726,
31,
589,
568,
21,
3884,
37,
7775,
6903,
6483,
9,
4314,
108,
15363,
3309,
14113,
9,
960,
118,
219,
118,
728,
819... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unity Custom Membership Dependency Not Working
===
I can't seem to figure out how to get dependency injection to work in a custom membership provider. I'm aware that the membership provider base class is managed deep in ASP.NET, but there should be some way to get dependency injection to work on private data members.
I'm using Unity and see this issue only in my membership and role providers
my issue is two fold:
1. The application complains that it doesn't have a parameterless
constructor for "MyMembershipProvider"
2. even if I try this: http://stackoverflow.com/a/9815425/595335, security service is null in the ValidateUser method
public class MyMembershipProvider : MembershipProvider
{
public ISecurityService securityService;
public MyMembershipProvider(ISecurityService securityService)
{
this.securityService = new SecurityService();
}
public override bool ValidateUser(string username, string password)
{
User user = securityService.GetUserByUsername(username);
...ommited...
}
| 0 | [
2,
8385,
5816,
4363,
26835,
52,
638,
800,
3726,
3726,
31,
92,
22,
38,
2260,
20,
1465,
70,
184,
20,
164,
26835,
13646,
20,
170,
19,
21,
5816,
4363,
11747,
9,
31,
22,
79,
3854,
30,
14,
4363,
11747,
1000,
718,
25,
1471,
855,
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... |
I have this jQuery Validation function issue. Validation only works once
===
The function below works as it should. It's to validate a form. In short, I have a couple input fields. If I hit submit and no text has been entered in either input, the validation errors appear. If I fill in one field, only one of the fields will update. But if I hit "submit" again, even without filling in the second form input, the else{} gets fired, not the if{} that should assure it's filled out, etc.
Not familiar, but is it a return false; issue?
if ($('input[type="text"]:visible').val().length == 0) {
$('.submitModal').click(function () {
$('.modal').modal('show');
});
}
else {
$('.submitModal').click(function () {
$('.modal').modal('hide');
});
}
Any idea what Im doing wrong? | 0 | [
2,
31,
57,
48,
487,
8190,
93,
27999,
1990,
1513,
9,
27999,
104,
693,
382,
800,
3726,
3726,
14,
1990,
1021,
693,
28,
32,
378,
9,
32,
22,
18,
20,
7394,
1373,
21,
505,
9,
19,
502,
15,
31,
57,
21,
1335,
6367,
2861,
9,
100,
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... |
Jumping to-and fro between Kernel and user code in Linux
===
I am doing some kernel hacking on Linux running x86-64 for a research project. From a kernel routine I need to jump to a user mode code page and immediately return back to kernel code. In other words, I need to do a trampoline on user code while executing in the kernel.
I am wondering whether this can be at all possible or not. If possible, can somebody give some idea how this can be achieved?
Thanks
Arka | 0 | [
2,
8759,
20,
8,
290,
8467,
128,
17007,
17,
4155,
1797,
19,
13024,
800,
3726,
3726,
31,
589,
845,
109,
17007,
25787,
27,
13024,
946,
993,
3274,
8,
3470,
26,
21,
527,
669,
9,
37,
21,
17007,
8275,
31,
376,
20,
3936,
20,
21,
4155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery combobox Styling issue
===
I am rendering a jQuery combobox, but the height of input element does not match the height of toggle button as shown in screen shot below. This is happening in both, IE 9 and FireFox 13.
![enter image description here][1]
[1]: http://i.stack.imgur.com/o3NGw.png
The style being used for jQuery combobox is as below.
<style>
.ui-combobox {
position: relative;
display: inline-block;
}
.ui-combobox-toggle {
position: absolute;
top: 0;
bottom: 0;
margin-left: -1px;
padding: 0;
/* adjust styles for IE 6/7 */
*height: 1.7em;
*top: 0.1em;
}
.ui-combobox-input {
margin: 0;
padding: 0.3em;
}
.ui-autocomplete { height: 200px; overflow-y: auto; }
</style> | 0 | [
2,
487,
8190,
93,
22621,
5309,
23020,
1513,
800,
3726,
3726,
31,
589,
15307,
21,
487,
8190,
93,
22621,
5309,
15,
47,
14,
2947,
16,
6367,
4520,
630,
52,
730,
14,
2947,
16,
20,
263,
4875,
5167,
28,
1721,
19,
2324,
999,
1021,
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... |
What is the proper way to deal with changing a single UIView within a storyboard scene
===
Lets say I have a scene which includes a UIView container on the top half of the screen, and a UIView container on the bottom half of the screen and a few buttons at the very bottom of the screen.
Basically the bottom container will always display static text while the buttons across the bottom will change the content of the top container which may include an image, more buttons, or more text depending on what button is pressed on the bottom. Also each time a bottom button is pressed the top container is transitioned to the new view with a flip from bottom transition.
I have achieved this purely programmatically, but decided to convert my app to a storyboard file since it makes producing the rest of my app much faster and simpler, plus makes the code not look like a crazy mess.
My limited understanding of storyboards seems to deduce that I would need a separate story board scene for every UIView change, and Apple's coding conventions with storyboards seem to imply that we should use a new ViewController every time you create a new scene. All this adds up to an even bigger mess than I currently have.
Is there a better way of doing this? Am I misunderstanding something? If I am not confused, is there some way to make all these scene and view controller duplication cleaner? | 0 | [
2,
98,
25,
14,
4119,
161,
20,
1183,
29,
4226,
21,
345,
13,
5661,
4725,
363,
21,
609,
2806,
1691,
800,
3726,
3726,
6884,
395,
31,
57,
21,
1691,
56,
1103,
21,
13,
5661,
4725,
12147,
27,
14,
371,
519,
16,
14,
2324,
15,
17,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C++ List of objects are only copies
===
I find myself needing to keep two lists of objects for performance reasons (speed over memory).
I'm using object pointers such as
std::list<MyClass*> m_list1;
std::list<MyClass*> m_list2;
I add objects to the list by
MyClass* myObject = new MyClass();
m_list1.push_back(myObject);
m_list2.push_back(myObject);
The problem I'm facing is that changes I make to list1 are not effecting list2, so clearly they are copies and not the real deal.
What is the correct way to store these so they won't be copies? Not using pointers isn't an option as these will all be allocated on the heap. | 0 | [
2,
272,
20512,
968,
16,
3916,
50,
104,
3298,
800,
3726,
3726,
31,
477,
992,
12210,
20,
643,
81,
7227,
16,
3916,
26,
956,
2932,
13,
5,
6708,
84,
1912,
6,
9,
31,
22,
79,
568,
3095,
454,
445,
145,
28,
354,
43,
45,
45,
5739,
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... |
Does WordPress preload pages?
===
While surfing my site and reviewing my server access logs, it appears the 'next' page in my site is served along with the page I navigated to (one click, two pages). Sometimes it does it in order, other times it appears to be random, grabbing unlisted pages and serving those.
That is, I click on the 'about' page, and the logs report serving 'about' AND 'contact'.
There's nothing visibly wrong on the front end, and everything validates. I'm using HighslideJS for my gallery which uses preloaders for images, and I looked into potential bugs with WP-supercache but haven't found an answer.
This doesn't seem like normal behavior since it's polluting my logs. Any leads to follow would be appreciated. | 0 | [
2,
630,
833,
5890,
782,
8294,
4434,
60,
800,
3726,
3726,
133,
22449,
51,
689,
17,
18046,
51,
8128,
1381,
18893,
15,
32,
1780,
14,
13,
22,
20021,
22,
2478,
19,
51,
689,
25,
423,
303,
29,
14,
2478,
31,
20782,
43,
20,
13,
5,
849,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Audio Units to play several short audio files with overlap
===
I have run through an audio units tutorial for a sine wave generator and done a bit of reading, and I understand basically how it is working. What I would actually like to do for my app, is play a short sound file in response to some external event. These sounds would be about 1-2 seconds in duration and occur at a rate of about about 1-2 per second.
Basically where I am at right now is trying to figure out how to play an actual audio file using my audio unit, rather than generating a sine wave. So basically my question is, how do I get an audio unit to play an audio file?
Do I simply read bytes from the audio file into the buffer in the render callback?
(if so what class do I need to deal with to convert / decompress / other voodo and read data from the audio file)
or is there some simpler method where I could maybe just hand off the entire buffer and tell it to play?
Any names of specific classes or APIs I will need to look at to accomplish this would be very helpful. | 0 | [
2,
568,
4023,
1398,
20,
418,
238,
502,
4023,
6488,
29,
15406,
800,
3726,
3726,
31,
57,
485,
120,
40,
4023,
1398,
29724,
26,
21,
13,
18,
1149,
2367,
15286,
17,
677,
21,
1142,
16,
1876,
15,
17,
31,
1369,
11374,
184,
32,
25,
638,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Request with NSMutableURLRequest
===
I tried to make an login page to make user authenticate to the website. I tried something like:
NSURL *myURL = [NSURL URLWithString:@"https://www.freelancer.com/users/onlogin.php"];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:myURL
cachePolicy:NSURLRequestReloadIgnoringLocalCacheData
timeoutInterval:60];
NSLog(@"ispost");
[request setHTTPMethod:@"POST"];
[request setValue:usernameField.text forKey:@"username"];
[request setValue:passwordField.text forKey:@"passwd"];
NSURLConnection *theConnection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
if (!theConnection) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Network Error" message:@"Could not login!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
}
I got an erroras followed:
`2012-07-07 10:09:37.354 Auth[6062:f803] ispost
2012-07-07 10:09:37.357 Auth[6062:f803] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSMutableURLRequest 0x68d69d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key username.'`
Can anyone suggest me what i did wrong?
Thanks for any help | 0 | [
2,
3772,
29,
13,
2172,
7903,
579,
911,
255,
99,
10351,
800,
3726,
3726,
31,
794,
20,
233,
40,
6738,
108,
2478,
20,
233,
4155,
14351,
1373,
20,
14,
2271,
9,
31,
794,
301,
101,
45,
13,
103,
4082,
255,
1637,
915,
911,
255,
800,
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... |
How to save android acvitiy history and retrieve at later time?
===
How do I save previous activity and have that update into a listview so that when a user launches the app at a later time he can click on a menu option called history which will bring a listview of the last few activities. Let's say the listview holds 5 activies and after the 5 activies it deletes the oldest activity saved and saves the new activity in it's place.
For example if someone wants to view history of an android activity that he viewed two days ago, he can simply click on a button called history and view his past 5 entries which will be displayed in a listview.
Any ideas? | 0 | [
2,
184,
20,
2079,
13005,
21,
150,
25410,
93,
447,
17,
11917,
35,
138,
85,
60,
800,
3726,
3726,
184,
107,
31,
2079,
1158,
2358,
17,
57,
30,
11100,
77,
21,
968,
4725,
86,
30,
76,
21,
4155,
22933,
14,
4865,
35,
21,
138,
85,
24,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
find virtualenv current package directory for vim
===
I want to be able to reach source code from my virtualenv library via ctags but to be able to do this I need to know which virtualenv I am using, so for example, I have this code in my .vimrc:
nnoremap <F6> :!ctags -R --python-kinds=-i * <CR>
nnoremap <F7> :!ctags -R --python-kinds=-i -a ~/.virtualenvs/MYPROJECT/lib/python2.7/site-packages/django/*<CR>
in line 1 I create my tags (indexing). In line 2 I append more indexing so I can go see source code from django. I want to do something like:
nnoremap <F7> :!ctags -R --python-kinds=-i -a $CURRENT_PROJECT_PACKAGES/django/*
so I can append the indexing from the current project I am working on. | 0 | [
2,
477,
6599,
219,
710,
866,
6030,
16755,
26,
1790,
79,
800,
3726,
3726,
31,
259,
20,
44,
777,
20,
1470,
1267,
1797,
37,
51,
6599,
219,
710,
1248,
1197,
272,
8628,
18,
47,
20,
44,
777,
20,
107,
48,
31,
376,
20,
143,
56,
6599,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to get its own view controller inside itself?
===
@interface RecentPhotosViewController () <PhotoViewControllerDelegate>
- (void)viewDidLoad
{
[super viewDidLoad];
[[self.tabBarController.viewControllers objectAtIndex:1] setDelegate:self];
}
The RecentPhotosViewController is a tableviewcontroller which implements a delegate.
I want to set self(RecentPhotosViewController) as the delegate in vieDidLoad(), but when i tried to type:self.setDelegate it turned out self doesn't have this setDelegate method, then i tried this:[[self.tabBarController.viewControllers objectAtIndex:1] setDelegate:self];(this tableview is one of the viewcontrollers of the tabBarControllers.
Then i got an error:[RecentPhotosViewController setDelegate:]: unrecognized selector sent to instance 0xc939960. I don't know how to fix this. | 0 | [
2,
184,
20,
164,
82,
258,
1418,
9919,
572,
1145,
60,
800,
3726,
3726,
13,
1,
6280,
6413,
1764,
25445,
18,
4725,
12898,
1252,
13,
5,
6,
13,
1,
25445,
4725,
12898,
1252,
24249,
3322,
1,
13,
8,
13,
5,
2625,
1340,
6,
4725,
3052,
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... |
android redraw layout programmatically
===
My layout sometimes does not position elements properly. I tried a lot of solutions but unique working one is rotate from portrait to landscape and then return from landscape to portrait. Then layout is automaticaly redrawed and fits perfectly. I set orientation|keyboard so content is not reloaded, only redrawed. How to redraw content programmaticaly like landscape-portrait does? Thank you. | 0 | [
2,
13005,
402,
12404,
9106,
625,
6732,
1326,
800,
3726,
3726,
51,
9106,
1030,
630,
52,
649,
2065,
7428,
9,
31,
794,
21,
865,
16,
6776,
47,
2619,
638,
53,
25,
21448,
37,
5548,
20,
4453,
17,
94,
788,
37,
4453,
20,
5548,
9,
94,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.