unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
iphone Database update Issue
===
I am working on iPhone app and calling following code on my button click, its updating my Database table only on first click. When I click it second time it gives me success message but database table is not getting updated.
Code is :
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Games.sqlite"];
NSMutableArray *arrayRandomLevel = [[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",nil];
for (int i = 0; i< 5; i++)
{
NSUInteger randomIndex = arc4random() % 5;
[arrayRandomLevel exchangeObjectAtIndex:i withObjectAtIndex:randomIndex];
//firstObject +=1;
}
NSLog(@"arrayRandomLevel = %@",arrayRandomLevel);
for (int level = 0; level < 5; level++)
{
NSString *strLevel = [@"" stringByAppendingFormat:@"%d",level+1];
int finalLevel = [[arrayRandomLevel objectAtIndex:level] intValue];
NSLog(@"Static level = %@, Changed level = %d",strLevel,finalLevel);
sqlite3 *database;
if(sqlite3_open([path UTF8String], &database) == SQLITE_OK)
{
NSString *cmd = [NSString stringWithFormat:@"UPDATE zquestionsdata SET zdifficultylevel = %d WHERE zanswertype = '%@' AND zquestiontype = '%@';",finalLevel,strLevel,@"Geni"];
const char * sql = [cmd UTF8String];
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sql, -1, &compiledStatement, NULL) == SQLITE_OK)
{
sqlite3_step(compiledStatement); // Here is the added step.
NSLog(@"update SUCCESS - executed command %@",cmd);
}
else {
NSLog(@"update FAILED - failed to execute command %@",cmd);
}
sqlite3_finalize(compiledStatement);
}
else {
NSLog(@"pdateContact FAILED - failed to open database");
}
sqlite3_close(database);
}
Please help me on this or provide any other solution to update table each time.
Thanks in advance. | 0 | [
2,
21024,
6018,
11100,
1513,
800,
3726,
3726,
31,
589,
638,
27,
21024,
4865,
17,
2555,
249,
1797,
27,
51,
5167,
10840,
15,
82,
71,
43,
1880,
51,
6018,
859,
104,
27,
64,
10840,
9,
76,
31,
10840,
32,
153,
85,
32,
2352,
55,
1280,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
parport module source code
===
I've done lsmod command. I found these lines in the output.
parport_pc 25962 1
lp 7028 0
parport 32635 3 ppdev,parport_pc,lp
From the above lines, I understood that there are modules exist, like,
- parport_pc
- lp
- parport
I've found source code parport_pc.c, lp.c, in the directory /usr/src/drivers/parport. But I can't find the source code for parport in my entire file system. Eventhough I found parpot.ko inside /lib/modules/linux2.6.32-37-generic/kernel/parport.
Also in the directory /usr/src/drivers/parport, I've seen a line in the Makefile like,
obj-$(CONFIG_PARPORT) += parport.o
So where can I find the parport.c file ? I've searched the entire file system using the command
find / -name parport.c
but no result. Is Linux hiding something? Please help me.
Thanks.
| 0 | [
2,
2017,
1993,
12613,
1267,
1797,
800,
3726,
3726,
31,
22,
195,
677,
644,
18,
13670,
1202,
9,
31,
216,
158,
1560,
19,
14,
5196,
9,
2017,
1993,
1,
5779,
13,
23864,
3698,
137,
6759,
3201,
2714,
713,
2017,
1993,
13,
25434,
2599,
203,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
on touchstart or mouseover of one image another image need to get open using Kinetic.js in html5
===
I have to overlap one image over other on touchstart or mouseover of an image using Kinetic.js in HTML5.
Please suggest me ho wit could be done. | 0 | [
2,
27,
1723,
13680,
54,
7567,
2549,
16,
53,
1961,
226,
1961,
376,
20,
164,
368,
568,
13,
16905,
9,
728,
18,
19,
13,
15895,
264,
800,
3726,
3726,
31,
57,
20,
15406,
53,
1961,
84,
89,
27,
1723,
13680,
54,
7567,
2549,
16,
40,
196... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Websphere MQ .NET API versions conflict
===
All,
I manage to connect with MQ Websphere version 6 from C# using two DLLs from IBM:
amqmdnet.dll (assembly version: 1.0.0.3)
amqmdxcs.dll (assembly version: 6.0.0.0)
The above assemblies are deployed locally with my application.
However if try in a server that already has MQ Websphere version 7 installed in the GAC then I have a big issue.
Basically the above two DLLs are in the GAC but they are very different from the ones I have as they are for version 7. However the assembly version is the same.
Hence my application fails because it picks the version 7 assemblies as they have the same assembly version and same public key token.
One solution is obviously removing the version 7 DLLs from the GAC.
Is there any other option?
Thanks
MK
| 0 | [
2,
2741,
14079,
307,
1251,
13,
9,
2328,
21,
2159,
3281,
2930,
800,
3726,
3726,
65,
15,
31,
4705,
20,
6379,
29,
307,
1251,
2741,
14079,
615,
400,
37,
272,
5910,
568,
81,
13,
43,
211,
18,
37,
10233,
45,
589,
1251,
79,
43,
2328,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extjs 4 nested xml into treepanel
===
I have a java webservice I can't modify. It produce xml like :
<query>
<entity TYPE="Location">
<value TYPE="Id"/>
<value TYPE="Class"/>
<value TYPE="Name"/>
</entity>
<entity TYPE="Activity">
<value TYPE="Id"/>
<value TYPE="Date"/>
<value TYPE="Duration"/>
</entity>
</query>
I need to put the xml into the treestore, entities will be folder and values as leafs. I tried to describe 2 models with relations :
Ext.define( 'modelEntity' , {
extend : 'Ext.data.Model' ,
proxy: {
type: 'ajax',
url: 'query.xml', //just for tests
reader: { type: 'xml' , root: 'query' , record: 'entity' } ,
},
fields: [
{ name: 'leaf' , type: 'boolean', defaultValue: true} ,
{ name: 'text' , type: 'string', mapping: '@TYPE'}
],
hasMany: { model: "modelValue", name: "value", }
});
Ext.define( 'modelValue' , {
extend : 'Ext.data.Model' ,
fields: [
{ name: 'leaf' , type: 'boolean', defaultValue: true} ,
{ name: 'text' , type: 'string', mapping: '@TYPE'}
],
belongsTo: "modelEntity"
});
with one treestore and a treepanel :
Ext.define('storeQuery' , {
extend: 'Ext.data.TreeStore',
model: 'modelEntity',
root: {
expanded: true,
leaf: false,
children: []
},
autoLoad: false
});
Ext.create('Ext.tree.Panel', {
store: Ext.create('storeQuery'),
rootVisible: false
......
});
Obviously it doesn't work, only entities are displayed, their children nodes aren't. Help me please ! =) | 0 | [
2,
1396,
38,
728,
18,
268,
5618,
69,
23504,
77,
1541,
3206,
532,
800,
3726,
3726,
31,
57,
21,
8247,
2741,
11449,
31,
92,
22,
38,
17579,
9,
32,
2213,
23504,
101,
13,
45,
13,
1,
8190,
93,
1,
13,
1,
2291,
856,
1001,
3726,
7,
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... |
tan(deg2rad()) returns odd values for degrees between 180 to 360
===
$degree = 179;
$aX = $valueB + ($valueA - $aY)/tan(deg2rad($degree));
returns 742.710038369 as $aX
but when $degree is 180;
$degree = 180;
$aX = $valueB + ($valueA - $aY)/tan(deg2rad($degree));
returns -8.1656196766E+15 as $aX
and similar values all the way to 361 when it completes a full turn and returns 857.289961631 as $aX again.
How do I fix this, do I need to convert the different value or change something else?
Thanks in advance for your answers! | 0 | [
2,
3461,
5,
546,
263,
135,
8278,
5,
6,
6,
4815,
4210,
4070,
26,
4442,
128,
9094,
20,
11760,
800,
3726,
3726,
5579,
17513,
800,
13,
10953,
73,
5579,
7522,
800,
5579,
15165,
220,
2754,
13,
5,
4403,
15165,
58,
13,
8,
5579,
3707,
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... |
Idiomatic way to build list with successive function calls on that list
===
It's a bit hard to explain in a concise title what I'm asking, so here's the explanation. I have a list of classes and these objects all hold there own set of data. The problem that I'm having is that I try to iterate over these objects and filter out data that is used in one of the objects that precedes the current one in the list. The code fragment looks like this:
objs = [list-of-objects]
used = set([])
for obj in objs:
used = used.union(obj.callSomeFunc(used))
That callSomeFunc member returns a set of data that it has that does not intersect with the current used set.
This code works, but I don't really like it, and I can't believe that there isn't a better way to do this. | 0 | [
2,
28380,
12479,
161,
20,
1895,
968,
29,
12002,
1990,
3029,
27,
30,
968,
800,
3726,
3726,
32,
22,
18,
21,
1142,
552,
20,
3271,
19,
21,
29455,
581,
98,
31,
22,
79,
3379,
15,
86,
235,
22,
18,
14,
5764,
9,
31,
57,
21,
968,
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... |
String to double, then back again. (Java)
===
I am trying to make a simple tax calculator program in Java, and cant seem to make the calculation work right. In the code I ended up having to turn the JTextField input into a double variable and then a string. For some reason, this does not work and brings up a bunch of errors. I know there must be some sort of simpler way to write this, so any ideas would be appreciated.
import javax.swing.*;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.lang.*;
public class TaxCalculator extends JFrame{
String twelve;
JTextField input;
JLabel ans;
public TaxCalculator()
{
JFrame frame = new JFrame("Tax Calculator");
JTextField input = new JTextField(10);
JLabel ans = new JLabel("");
JButton twelve = new JButton("12%");
frame.setVisible(true);
frame.setLayout(new FlowLayout());
frame.setSize(250,100);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.add(new JLabel("Price of Item:"));
frame.add(input);
frame.add(ans);
frame.add(twelve);
twelve.addActionListener(new HandlerClass());
}
public static void main(String[] args)
{
TaxCalculator calc = new TaxCalculator();
}
public class HandlerClass implements ActionListener
{
public void actionPerformed(ActionEvent ae)
{
double fnum = Double.parseDouble(input.getText());
if (ae.getSource()==twelve)
{
fnum = (fnum / 0.12) + fnum;
ans.setText(Double.toString(fnum));
}
}
}
} | 0 | [
2,
3724,
20,
1494,
15,
94,
97,
188,
9,
13,
5,
1004,
1385,
6,
800,
3726,
3726,
31,
589,
749,
20,
233,
21,
1935,
2225,
28539,
625,
19,
8247,
15,
17,
2973,
2260,
20,
233,
14,
19644,
170,
193,
9,
19,
14,
1797,
31,
1272,
71,
452,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where are Android apps installed?
===
What is the actual directory where. APKs are installed? The only directory I could find that somewhat resembles this is
sdcard/Android/data/
but it doesn't contain all my apps. | 2 | [
2,
113,
50,
13005,
4865,
18,
4066,
60,
800,
3726,
3726,
98,
25,
14,
3463,
16755,
113,
9,
21,
17244,
18,
50,
4066,
60,
14,
104,
16755,
31,
110,
477,
30,
4131,
14920,
48,
25,
13,
18,
43,
6648,
118,
290,
18524,
118,
18768,
118,
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,
0,
0,
0,
0,
0,
0,
0... |
Ruby nested hash syntax & structure
===
I'm building a tree of html elements, class names and their counts.
**How would I structure this code with the proper syntax?**
$html = {
:p => [
{ 'quote' => 10 },
{ 'important' => 4 }
],
:h2 => [
{ 'title' => 33 },
{ 'subtitle' => 15 }
]
}
I'm confused by the nested hash syntax. Thanks for the help setting me straight. | 0 | [
2,
10811,
5618,
69,
19170,
22649,
279,
1411,
800,
3726,
3726,
31,
22,
79,
353,
21,
1541,
16,
13,
15895,
2065,
15,
718,
1817,
17,
66,
9927,
9,
13,
1409,
1544,
83,
31,
1411,
48,
1797,
29,
14,
4119,
22649,
60,
1409,
5579,
15895,
80... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
The speed of 'extract(year from sysdate)'
===
I have two queries:
with tmp as (
select asy.aim_student_id, ast.aim_test, asq.response
from aim_student_test ast
join aim_student_qst asq on (asq.aps_yr = ast.aps_yr and asq.aim_test = ast.aim_test and asq.aim_id = ast.aim_id)
join aim_student_yr asy on (asy.aps_yr = ast.aps_yr and asy.aim_student_yr_id = ast.aim_student_yr_id)
where asq.aps_yr = '2012'
and asq.qst_num = 1)
select aim_student_id, aim_test, response
from tmp
where response is null
-- execution-time: 0.032 seconds
define this_year = extract(year from sysdate)
with tmp as (
select asy.aim_student_id, ast.aim_test, asq.response
from aim_student_test ast
join aim_student_qst asq on (asq.aps_yr = ast.aps_yr and asq.aim_test = ast.aim_test and asq.aim_id = ast.aim_id)
join aim_student_yr asy on (asy.aps_yr = ast.aps_yr and asy.aim_student_yr_id = ast.aim_student_yr_id)
where asq.aps_yr = &this_year
and asq.qst_num = 1)
select aim_student_id, aim_test, response
from tmp
where response is null
-- execution-time: 82.202 seconds
The only difference is that in one I use '2012' and the other I implement extract(year from sysdate).
I can only imagine that Oracle is computing extract(year from sysdate) for EVERY record it checks, and that I just can't figure out how to make it compute this once and use it as a variable. Searching has not returned me the answers I seek... so I come to the magicians of SO.com. HOW do I properly use
extract(year from sysdate)
as a variable? | 0 | [
2,
14,
1362,
16,
13,
22,
1706,
19915,
5,
731,
37,
10315,
18,
8209,
6,
22,
800,
3726,
3726,
31,
57,
81,
9386,
2829,
45,
29,
13,
38,
2554,
28,
13,
5,
5407,
28,
93,
9,
58,
1660,
1,
24822,
1,
1340,
15,
28,
38,
9,
58,
1660,
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... |
Css and Js file loactions in a maven project
===
I a currently working on a maven project on eclipse , my HTML , css , js and jsp files are under
webapp
|
WEB-INF
|
css/style.css
js/myjs.js
index.jsp
index1.html
my webapp cannot seem to access the css and js , I keep getting the following error in chrome for my css , img and js files
GET "URL....................css" 404 (Not Found) friend:5
I have seen a lot of questions related to this , but none of the solutions seem to work , any help would be appreciated !
| 0 | [
2,
272,
18,
18,
17,
487,
18,
3893,
2205,
8645,
18,
19,
21,
1216,
3124,
669,
800,
3726,
3726,
31,
21,
871,
638,
27,
21,
1216,
3124,
669,
27,
11652,
13,
15,
51,
13,
15895,
13,
15,
272,
18,
18,
13,
15,
487,
18,
17,
487,
3401,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS Drop down Menu Levels
===
I have a CSS Dropdown menu and I am struggling with customizing it for different levels. For example, what you see on first drop down is level 1, and next drop down from out of that is level 2. I want to customize things for different levels.
div#dropMenu li.submenu
{
background: url(../images/arrows/arrow11.png) no-repeat 99% 99%;
}
div#dropMenu li.submenu:hover
{
background: url(../images/arrows/arrow9.png) no-repeat 99% 99%;
}
Above code puts an image of an arrow if you have a submenu item. This is working fine, however, I don't want it on the top menu, I want it just on first drop down and forward. How can I specify it? I tried 'div#dropMenu li.level1.submenu' and it doesn't work.
Here I posted rest of the CSS sheet:
div#dropMenu {
width:1000px;
margin:0px 0px;
text-align:center;
z-index:1000;
position:relative;
}
div#dropMenu ul {
border-left: 1px solid #333;
margin:0;
padding:0;
}
div#dropMenu li {
border-right: 1px solid #999;
position:relative;
list-style:none;
margin:0;
float:left;
line-height:1em;
width:19.90%;
/**width:16.55%;*/
}
div#dropMenu ul.level1 {
width:100%;
margin:0 auto;
text-align:left;
background: url(../images/menu_bg.png) repeat-x; margin-top: 0px; color: #fff;/*background color of top menu when NOT selected. */
z-index:1000;
float:left;
}
div#dropMenu ul.level2 li {
padding-top: 6px;
border-top: 1px solid #999999;
}
div#dropMenu li a {
display: block;
/* Hides from IE5-mac \*/
height: 1%;
/* End hide from IE5-mac */
padding: 15px 0px 10px 0px;
text-decoration: none;
color: #555;
font-size: 13px;
-webkit-font-smoothing: antialiased;
text-align:center;
font-weight: bold;
border-right: 0px solid ;
}
div#dropMenu li:hover {}
div#dropMenu li.submenu:hover {}
div#dropMenu li a.noLine {
border:none;
}
div#dropMenu>ul a {
width: auto;
z-index:1000;
}
div#dropMenu ul ul {
display: none;
}
div#dropMenu ul ul li {
width:16.5em;
}
div#dropMenu ul.level1 li.submenu:hover ul.level2,
div#dropMenu ul.level2 li.submenu:hover ul.level3,
div#dropMenu ul.level3 li.submenu:hover ul.level4,
div#dropMenu ul.level4 li.submenu:hover ul.level5,
div#dropMenu ul.level5 li.submenu:hover ul.level6,
div#dropMenu ul.level6 li.submenu:hover ul.level7,
div#dropMenu ul.level7 li.submenu:hover ul.level8 {
position: absolute;
width: 12em;
display:block;
z-index:1000;
width: 16.5em;
}
| 0 | [
2,
272,
18,
18,
2804,
125,
11379,
2216,
800,
3726,
3726,
31,
57,
21,
272,
18,
18,
2804,
2968,
11379,
17,
31,
589,
7587,
29,
5816,
3335,
32,
26,
421,
2216,
9,
26,
823,
15,
98,
42,
196,
27,
64,
2804,
125,
25,
662,
137,
15,
17,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Visibility of Vector3 - 3D to 2D projection
===
I already asked this question over there:
[https://github.com/mrdoob/three.js/issues/2070#issuecomment-6372113][1]
But I did not really get it right now.
Here is my problem again:
i am using this function to calculate the screen position (x,y) of my Vector3.
this.toScreenXY = function(position, camera, canvas)
{
var pos3D = position.clone();
var pos2D = projector.projectVector( pos3D, camera );
return {
x : ((pos2D.x + 1) * canvas.domElement.width / 2 + canvas.domElement.offsetLeft),
y : ((-pos2D.y + 1) * canvas.domElement.height / 2 + canvas.domElement.offsetTop)
};
};
But when I got the correct screen position, turn the camera by 180 degree (about the y-axis), I got the same x,y values even if the real Vector3 is behind the Cameras view.
Any idea how to check wether the Vector3 is in Cameras view or not?
Thank you for your help!
[1]: https://github.com/mrdoob/three.js/issues/2070#issuecomment-6372113 | 0 | [
2,
19476,
16,
7497,
240,
13,
8,
203,
43,
20,
172,
43,
11607,
800,
3726,
3726,
31,
614,
411,
48,
1301,
84,
80,
45,
636,
21127,
18,
6903,
10404,
20926,
9,
960,
118,
5189,
537,
4995,
118,
5642,
9,
728,
18,
118,
12565,
18,
118,
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... |
Get DOM elements by tag name with DOMDocument::loadHTML and getElementsByTagName
===
Sorry if this is reposted, but I can't wrap my mind around it and I've tried all the available documentation and examples I could find.
I am trying to get the first `img` element of a string containing HTML
**PHP**
$html = '<p><img src="http://placekitten.com/200/300" alt="" width="200" height="300" /></p>';
$dom = new DOMDocument;
$dom->loadHTML($html);
$imgs = $dom->getElementsByTagName('img');
var_dump($imgs);
This spits `object(DOMNodeList)#57 (0) { }` when it should find the one occurrence.
I've tried with XPath with no luck either. | 0 | [
2,
164,
11859,
2065,
34,
3383,
204,
29,
11859,
28132,
45,
45,
8294,
15895,
17,
164,
27567,
18,
779,
8628,
7259,
800,
3726,
3726,
1875,
100,
48,
25,
302,
6962,
69,
15,
47,
31,
92,
22,
38,
8118,
51,
594,
140,
32,
17,
31,
22,
195... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 display a count from another table in a gridview?
===
I building a blog for school i would like to display the count of comments for each thread made. However I'm a bit lost to how to achieve this goal any help would be great thank you!
i have 2 tables
CREATE TABLE `blog_message` (
`MessageID` int(30) NOT NULL AUTO_INCREMENT,
`Username` varchar(45) NOT NULL,
`Message` text,
`AddedDate` datetime DEFAULT NULL,
`Title` varchar(45) DEFAULT NULL,
PRIMARY KEY (`MessageID`)
)
CREATE TABLE `blog_comments` (
`CommentID` int(30) NOT NULL AUTO_INCREMENT,
`MessageID` int(30) DEFAULT NULL,
`Author` varchar(45) DEFAULT NULL,
`CommentMessage` text,
`AddedDate` datetime DEFAULT NULL,
PRIMARY KEY (`CommentID`),
KEY `blog_comments_ibfk_1` (`MessageID`),
CONSTRAINT `blog_comments_ibfk_1` FOREIGN KEY (`MessageID`) REFERENCES `blog_message` (`MessageID`)
)
my goal is
to display in a gridview
int a table format
Comment count | title | Username | Date of creation | 0 | [
2,
184,
107,
31,
3042,
21,
2468,
37,
226,
859,
19,
21,
7354,
4725,
60,
800,
3726,
3726,
31,
353,
21,
8146,
26,
116,
31,
83,
101,
20,
3042,
14,
2468,
16,
7534,
26,
206,
9322,
117,
9,
207,
31,
22,
79,
21,
1142,
529,
20,
184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
captureStillImageAsynchronouslyFromConnection without JPG intermediary
===
I'm trying to get as good an image as possible from the camera, but can only find examples that captureStillImageAsynchronouslyFromConnection and then go straight to:
NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer];
UIImage *image = [[UIImage alloc] initWithData:imageData];
JPEG being lossy and all, is there any way to get the data as PNG, or even just RGBA (BGRA, what-have-you?). AVCaptureStillImageOutput doesn't seem to have any other NSData* methods....
Actually looking at the CMSampleBufferRef, it seems like it's already locked as JPEG ~
formatDescription = <CMVideoFormatDescription 0xfe5e1f0 [0x3e5ac650]> {
mediaType:'vide'
mediaSubType:'jpeg'
mediaSpecific: {
codecType: 'jpeg' dimensions: 2592 x 1936
}
extensions: {(null)}
}
Is there some other way to take a full-res picture and get the raw data? | 0 | [
2,
3683,
8073,
22039,
58,
16023,
13985,
2665,
25996,
872,
366,
487,
9623,
1480,
8260,
622,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
28,
254,
40,
1961,
28,
938,
37,
14,
3336,
15,
47,
92,
104,
477,
3770,
30,
3683,
8073,
22039,
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... |
clustering with limited maximum size
===
I want to cluster some data points but the maximum number of points per cluster is limited. So there is a maximum size per cluster. Is there any clustering algorithm for that?
Also Can I define my own size function. For example, instead of considering the number of points in a cluster as its size, I want to sum a column of all the points in the cluster. | 0 | [
2,
7460,
68,
29,
1317,
2979,
1072,
800,
3726,
3726,
31,
259,
20,
7460,
109,
1054,
819,
47,
14,
2979,
234,
16,
819,
416,
7460,
25,
1317,
9,
86,
80,
25,
21,
2979,
1072,
416,
7460,
9,
25,
80,
186,
7460,
68,
9083,
26,
30,
60,
67... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Animation in VB.NET
===
I am trying to create an animation in VB.NET. This may be simple enough for most of you, but I am still a novice programmer.
Are there any sites which can help me? And do I have to download any software?
I am trying to make a facial animation. A face morphs into that of a chimpanzee's or something like that. Please help. I can't seem to get any headstart | 0 | [
2,
6236,
19,
13,
20468,
9,
2328,
800,
3726,
3726,
31,
589,
749,
20,
1600,
40,
6236,
19,
13,
20468,
9,
2328,
9,
48,
123,
44,
1935,
511,
26,
127,
16,
42,
15,
47,
31,
589,
174,
21,
21999,
17968,
9,
50,
80,
186,
3259,
56,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding transition effects to externally loaded images
===
I have issues adding transitions effects to externally loaded images. The above displayed code gives errors. I am loading the images externally using the UI component. Can someone help me out? This is the code,
var myimage:String="Img/img1.png";
var readimg:URLRequest=new URLRequest(myimage);
TransitionManager.start(readimg, {type:Wipe, direction:Transition.IN, duration:3, easing:None.easeNone, startPoint:1});
imagecontainer.load(readimg); | 0 | [
2,
4721,
4513,
2292,
20,
4886,
102,
8572,
3502,
800,
3726,
3726,
31,
57,
1549,
4721,
4513,
18,
2292,
20,
4886,
102,
8572,
3502,
9,
14,
784,
6115,
1797,
2352,
11908,
9,
31,
589,
12797,
14,
3502,
4886,
102,
568,
14,
13,
5661,
5912,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a new windoes partition
===
I was trying to create new partition for an ubuntu installation , but while shrinking the volume (D:) to use the 21 gb free space available as seen in the snapshot but windows shows only 7GB is shrinkable . I tries it after defraging the logical volume but it yielded the same result .
I would like to know why this happens and i am not able to use the complete 20 gb
![The following snapshot][1]
[1]: http://i.stack.imgur.com/UiIym.png | 2 | [
2,
2936,
21,
78,
628,
10739,
10711,
800,
3726,
3726,
31,
23,
749,
20,
1600,
78,
10711,
26,
40,
287,
12968,
2473,
7758,
13,
15,
47,
133,
16269,
68,
14,
2310,
13,
5,
43,
45,
6,
20,
275,
14,
852,
14857,
551,
726,
904,
28,
541,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding thousand to number=1000
===
im trying to add 1000 to my button based on what number=0 in my url
mywebsite.com/people.php?number=0
Now i want that to say
mywebsite.com/people.php?number=1000
And so on...
Every time this button is clicked
<?php
$count = 1000;
?>
<a href="people.php?number=<?php $_GET['number'] + $count ++ ;?>">Next 1000</a>
I know there are a ton of pagination scripts but i am using a nice jquery table to call 1000 people at a time.
I just want a button to allow the user to load the next 1000 if they had to.
Thanks in advance.
Jonny | 0 | [
2,
4721,
2996,
20,
234,
3726,
19484,
800,
3726,
3726,
797,
749,
20,
3547,
6150,
20,
51,
5167,
432,
27,
98,
234,
3726,
387,
19,
51,
287,
6362,
51,
14113,
9097,
9,
960,
118,
10171,
9,
26120,
60,
16299,
3726,
387,
130,
31,
259,
30,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: How to set text link as the actual URL and not the text tag from HTML
===
I've been trying to figure this one out for a bit using patterns or other utils but haven't gotten it to work just yet.
Say I have an HTML link:
<a href="http://www.google.com">Google, Inc.</a>
I want to make a link into a text view BUT set the text of the link as the actual URL not Google, Inc.
So for example if the data I received is:
--Hey if you want to try a search go to `<a href="http://www.google.com">Google, Inc.</a>` and it's easy as that.
I want it to display as:
*--Hey if you want to try a search go to http://www.google.com and it's easy as that.*
Instead of:
*--Hey if you want to try a search go to Google, Inc. and it's easy as that.*
Html.fromHtml() makes it show as "Google, Inc." automatically, but isn't the result that I want.
Also, I don't need this to work for specifically this example, I need it to work for all html links as I don't know what links I will get as data.
| 0 | [
2,
13005,
45,
184,
20,
309,
1854,
3508,
28,
14,
3463,
287,
6362,
17,
52,
14,
1854,
3383,
37,
13,
15895,
800,
3726,
3726,
31,
22,
195,
74,
749,
20,
1465,
48,
53,
70,
26,
21,
1142,
568,
6282,
54,
89,
13,
14255,
18,
47,
2933,
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... |
A Better way to optimize these MySQL queries
===
I have two MySQL tables:
- attributes (attributeid, name)
- productsattributes (productid, attributeid, displayvalue)
The required is for each attribute name called "Product Type" get all other attributes associated with this "Product Type".
As an example -
attributes table will look like:
<pre>
attributeid name
1 A
2 B
3 Product Type
4 D
</pre>
productsattributes table will look like:
<pre>
productid attributeid displayvalue
1 3 FAN
1 1 Brown
1 2 Stand
2 3 FAN
2 4 D
3 3 CAR
3 4 imported
</pre>
So the final result should be:
<pre>
FAN (A,B, Product Type,D)
CAR (Product Type, imported)
</pre>
Here is my try:<br>
-first I get all the "displayvalues" from productattributes:
<pre>
SELECT DISTINCT displayvalue
FROM productsttributes
WHERE attributeid = 3
</pre>
-then I loop through each "displayvalues" to find the other attributes:
<pre>
SELECT a.name
FROM attributes a
INNER JOIN productsattributes pa
ON pa.attributeid = a.attributeid
AND productid in
(
SELECT productid
FROM productsttributes
WHERE dispalyvale = '$displayvalue'
)
ORDER BY a.name
</pre>
The problem is the productattributes table has about 7 million rows, so my script is taking forever .. of course I am not looking for 10 minutes solution but at least it will improve my queries a bit.
| 0 | [
2,
21,
574,
161,
20,
22864,
158,
51,
18,
22402,
9386,
2829,
800,
3726,
3726,
31,
57,
81,
51,
18,
22402,
7484,
45,
13,
8,
13422,
13,
5,
721,
14755,
1340,
15,
204,
6,
13,
8,
1985,
721,
14755,
18,
13,
5,
14086,
1340,
15,
35,
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... |
Creating BinaryWriter in a loop gets better performance than creating it once?
===
I examined memory mapped files to check their performance effect and while doing it I noticed, that if I recreate BinaryWriter, every time I'm going to write to file, it makes my code run 30% faster.
Would anyone have an explanation?
***This code runs 30% faster than the one below:***
using (MemoryMappedViewStream stream = mmf.CreateViewStream())
{
dt = DateTime.Now;
for (int i = 0; i < 1000000; i++)
{
BinaryWriter writer = new BinaryWriter(stream); // In or out?
try
{
mutex.WaitOne();
writer.Write(i);
mutex.ReleaseMutex();
}
}
}
***This code runs 30% slower than the one above:***
using (MemoryMappedViewStream stream = mmf.CreateViewStream())
{
BinaryWriter writer = new BinaryWriter(stream); // In or out?
dt = DateTime.Now;
for (int i = 0; i < 1000000; i++)
{
try
{
mutex.WaitOne();
writer.Write(i);
mutex.ReleaseMutex();
}
}
} | 0 | [
2,
2936,
14171,
9657,
19,
21,
5293,
3049,
574,
956,
119,
2936,
32,
382,
60,
800,
3726,
3726,
31,
9005,
1912,
20877,
6488,
20,
2631,
66,
956,
1590,
17,
133,
845,
32,
31,
2711,
15,
30,
100,
31,
21119,
14171,
9657,
15,
352,
85,
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... |
get form values from jquery dialog iframe
===
I have tried to scale this code down to the basics
I have this jquery dialog. It has an iframe that is a populated JSP with a form
When the user clicks the save button, i want to grab some of the form values from the iframe form.
I am just not sure how to access those form fields(title,htmldata are the form field names) from the the Save function.
$("#dialog-edit-raw").dialog({
autoOpen: false, height: 300, width: 500, position: [200, 100], modal: true,
buttons: {
Save: function() {
$.ajax({
type: "POST",
url: "/servlet/trainingServlet",
data: ({method: 'ajaxSaveArticle',title: title_from_Form }),
cache: false,
dataType: 'json',
beforeSend: function(){
},
error: function(jqXHR, textStatus, errorThrown){
},
success: function(data){
}
});
},
Close: function() {
$( this ).dialog( "close" );
}
},
close: function() {
$( this ).html('');
}
});
--------------------------
$( ".ui-state-default" ).live("click", function(event){
$("#dialog-edit-raw")
.html('<iframe id="iframeedit" style="border: 0px; " src="/servlet/myServlet?method=editDoc&ID='+tID+'&raw=1" width="100%" height="580" "></iframe>')
.dialog('open');
});
The form looks like has two inputs
input name="title" id="title" size="50" value="" type="text"
textarea cols="50" id="htmldata" name="htmldata" rows="6"
Thanks for any help
| 0 | [
2,
164,
505,
4070,
37,
487,
8190,
93,
28223,
31,
8361,
800,
3726,
3726,
31,
57,
794,
20,
3464,
48,
1797,
125,
20,
14,
2125,
18,
31,
57,
48,
487,
8190,
93,
28223,
9,
32,
63,
40,
31,
8361,
30,
25,
21,
11111,
487,
3401,
29,
21,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get Multicast Group Address from datagramReceived in Twisted?
===
This is the following code example from Twisted for dealing with receiving of multicasts. I currently am listening to many groups with the same client and I want to be able to print out which group a certain datagram packet came from. I would think that this can be received from the address parameter of datagramReceived; however, this only gives me a tuple containing the local ip and port that a group is bound to, but not the address of the group itself.
**Question:** How can I print the multicast address from where a datagram originated from within the Twisted protocol/API?
from twisted.internet.protocol import DatagramProtocol
from twisted.internet import reactor
class MulticastPingClient(DatagramProtocol):
def startProtocol(self):
# Join the multicast address, so we can receive replies:
self.transport.joinGroup("228.0.0.5")
self.transport.joinGroup("229.0.2.11")
self.transport.joinGroup("221.3.3.3")
# Send to 228.0.0.5:8005 - all listeners on the multicast address
# (including us) will receive this message.
self.transport.write('Client: Ping', ("228.0.0.5", 8005))
def datagramReceived(self, datagram, address):
print "Datagram %s received from %s" % (repr(datagram), repr(address))
reactor.listenMulticast(8005, MulticastPingClient(), listenMultiple=True)
reactor.run()
| 0 | [
2,
184,
20,
164,
1889,
6146,
214,
3218,
37,
1054,
6295,
27700,
19,
5308,
60,
800,
3726,
3726,
48,
25,
14,
249,
1797,
823,
37,
5308,
26,
5746,
29,
3396,
16,
1889,
6146,
18,
9,
31,
871,
589,
4948,
20,
151,
1170,
29,
14,
205,
681... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IE7-8 issue with jQuery click
===
I'm really just lost as to why IE would throw a fit. It works in Chrome and IE9. Here's my script:
var utilityNav = function() {
$('#head-nav a').click(function(e) {
e.preventDefault();
$('#head-nav a').removeClass('head-link-active').next('div').removeClass('shadow').slideUp('fast').css('z-index', '7999');
if ($(this).next('div').is(':hidden')) {
var linkPos = $(this).position().left + $(this).width()/2 + 4;
$(this).addClass('head-link-active');
$(this).next('div').addClass('shadow').slideDown().css('left', linkPos + 'px').css('z-index', '8000');
}
});
$('.utility-three').children('.utility-three-block').eq(1).addClass('borders');
};
I don't think anything is syntactically wrong with it, but I'd really appreciate some help. Thanks. | 0 | [
2,
13,
660,
465,
8,
457,
1513,
29,
487,
8190,
93,
10840,
800,
3726,
3726,
31,
22,
79,
510,
114,
529,
28,
20,
483,
13,
660,
83,
3814,
21,
2742,
9,
32,
693,
19,
13,
12985,
17,
13,
660,
518,
9,
235,
22,
18,
51,
3884,
45,
4033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
edit array value with php
===
I have an output like this:
Array
(
[0] => stdClass Object
(
[post] => john Has site <a href='http://www.mysite.com/events/info/4240'>this is a test</a>
[date_created] => 1341853220
)
[1] => stdClass Object
(
[post] => jane Has site <a href='http://www.mysite.com/events/info/1'>test venue</a>
[date_created] => 1341849999
)
[2] => stdClass Object
(
[post] => james Has site <a href='http://www.mysite.com/events/info/4240'>this is a test</a>
[date_created] => 1341680695
)
I want to know if there is any way to get result like this:
Array
(
[0] => stdClass Object
(
[post] => john Has site this is a test
[number] => 4240
[date_created] => 1341853220
)
[1] => stdClass Object
(
[post] => jane Has site test venue
[number] => 1
[date_created] => 1341849999
)
[2] => stdClass Object
(
[post] => james Has site this is a test
[number] => 4240
[date_created] => 1341680695
)
what I want is to eliminate the html tags along with the url and just keep the name and the number at the end of the url so that i can store it and use it later.
I was trying to use str_replace inside a foreach but I cant find the right way to do it or is there another way to accomplish this?
thanks | 0 | [
2,
9392,
7718,
1923,
29,
13,
26120,
800,
3726,
3726,
31,
57,
40,
5196,
101,
48,
45,
7718,
13,
5,
636,
387,
500,
800,
1,
354,
43,
1898,
3095,
13,
5,
636,
6962,
500,
800,
1,
239,
63,
689,
13,
1,
58,
746,
14057,
3726,
22,
21127... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
__strong or __weak (or something else) for parameter when overrideing -isEqual:?
===
I'm overriding `- (BOOL) isEqual:(id)object` in a custom class.
Out of the 4 choices, which are `__weak`, `__strong`, `__autoreleasing`, and `__unsafe_unretained`, which should I be using on the parameter for the `isEqual:` method signature?
I'm thinking this is where the problem is, since when I'm trying to add an instance of my class to a `NSMutableDictionary`, I'm getting an `EXC_BAD_ACCESS(code=2, address=0x10)` at the declaration of the method.
In other words, the line at which the debugger gets the `EXC_BAD_ACCESS` is:
- (BOOL) isEqual:(id __strong)object {
before any of the method body is executed. | 0 | [
2,
13,
1,
15004,
54,
13,
1,
458,
1378,
13,
5,
248,
301,
962,
6,
26,
18906,
76,
84,
11891,
68,
13,
8,
2628,
14512,
45,
60,
800,
3726,
3726,
31,
22,
79,
84,
5175,
68,
13,
1,
8,
13,
5,
1192,
1823,
6,
25,
62,
14512,
45,
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... |
Pin a function pointer
===
I need to pass a managed callback to an unmanaged TCP receiver. Since its a thread that needs to exist for the lifetime of the application, I need to prevent it from getting garbage collected. I have read everywhere that pinning function pointers is not required and the GCHandle.Alloc will do the job of preventing garbage collection.
But is this a given? I have seen that the AppPool hosting this code crashes with an access violation. Why should I not suspect the fact that this error occurs because the function pointer was garbage collected?
This [post][1] supports this fact.
[1]: http://stackoverflow.com/a/3366436/382795 | 0 | [
2,
3459,
21,
1990,
454,
106,
800,
3726,
3726,
31,
376,
20,
1477,
21,
1471,
645,
1958,
20,
40,
367,
177,
8030,
13,
38,
7439,
6264,
9,
179,
82,
21,
9322,
30,
2274,
20,
3182,
26,
14,
5277,
16,
14,
3010,
15,
31,
376,
20,
2501,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
@Secured annotations not working in AspectJ Mode with Autoproxy
===
I'm trying to get my Spring MVC app to play nice with Spring @Secured annotations and AspectJ auto-proxying but it doesn't seem to be proxying or recognising my @Secured annotations. I have a controller like this:
@Controller
@RequestMapping("/")
public class ApplicationController {
private ApplicationFactory applicationFactory;
@Inject
public ApplicationController(ApplicationFactory applicationFactory) {
super();
this.applicationFactory = applicationFactory;
}
@Secured("ROLE_USER")
@ResponseBody
@RequestMapping(method = GET)
public Application getApplicationInfo() {
return applicationFactory.buildApplication(this);
}
}
And a spring security XML that looks something like this:
Code:
<security:global-method-security secured-annotations="enabled" mode="aspectj" proxy-target-class="true" />
<security:http auto-config="true" use-expressions="true">
<security:http-basic/>
</security:http>
The above is being loaded by a no-xml Spring @Configuration component like this:
@Configuration
@ComponentScan(basePackages = {"com.example"})
@EnableWebMvc
@ImportResource("classpath:security.xml")
public class ApplicationConfiguration extends WebMvcConfigurerAdapter {
}
Which in turn is loaded using a Servlet 3.0 WebApplicationInitializer:
public class SpringMvcInitializer implements WebApplicationInitializer {
private final AnnotationConfigWebApplicationContext context = new AnnotationConfigWebApplicationContext();
public void onStartup(ServletContext servletContext) throws ServletException {
context.register(ApplicationConfiguration.class);
servletContext.addListener(new ContextLoaderListener(context));
servletContext.addListener(new Log4jConfigListener());
final DelegatingFilterProxy proxy = new DelegatingFilterProxy("springSecurityFilterChain", context);
FilterRegistration.Dynamic filter = servletContext.addFilter("securityFilter", proxy);
filter.addMappingForUrlPatterns(EnumSet.of(REQUEST), false, "/*");
final DispatcherServlet servlet = new DispatcherServlet(context);
ServletRegistration.Dynamic dispatcher = servletContext.addServlet("dispatcher", servlet);
dispatcher.setLoadOnStartup(1);
dispatcher.addMapping("/*");
}
}
However, Spring Security isn't detecting the annotation and I'm still able the secured endpoint above without being authorised. According to the [Spring Security FAQ][1], this maybe because the `<global-method-security>` element is being loaded in the wrong application context, but I don't no how to ensure this using the above no-xml Spring configuration.
Am I missing something? I tried adding the @EnableAspectJAutoProxy(proxyTargetClass = true) to my application configuration but that didn't help either. Is there anyway to have run time weaving or will I have to use compile time weaving to enable annotation-based security for my application?
[1]: http://static.springsource.org/spring-security/site/faq.html#faq-method-security-in-web-context | 0 | [
2,
13,
1,
22917,
43,
40,
1270,
7504,
52,
638,
19,
7289,
728,
3740,
29,
3108,
4899,
9229,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
51,
1573,
307,
8990,
4865,
20,
418,
2210,
29,
1573,
13,
1,
22917,
43,
40,
1270,
7504,
17,
7289... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can abstract class be override in derived class without implementing in base class
===
I have a an abstract classA with one signature.
And this class is inherited with another class but the above signature(method) is not implemented in classB.
Now another classC is inherited with classB and wants to override or implement classA signature(method).
How to do this?
| 0 | [
2,
92,
8502,
718,
44,
84,
11891,
19,
3981,
718,
366,
17333,
19,
1000,
718,
800,
3726,
3726,
31,
57,
21,
40,
8502,
718,
58,
29,
53,
7810,
9,
17,
48,
718,
25,
7179,
29,
226,
718,
47,
14,
784,
7810,
5,
5909,
1807,
43,
6,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
can not use sign in, even after getting the confirmation email using devise
===
I have used devise gem for all having the signup functionality and all went fine until I added the :confirmable aspect.
I want to know how to what to add where to get the email confirmation to work properly.
----------------------
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.raise_delivery_errors = true
config.action_mailer.smtp_settings = {
:address => 'smtp.example.com',
:port => '25',
:domain => 'example.com',
:user_name => 'someone@example.com',
:password => 'secret',
:authentication => 'plain',
:enable_starttls_auto => true,
:openssl_verify_mode => OpenSSL::SSL::VERIFY_NONE,
}
I have added these lines to the config/environment/development.rb file and I do receive emails with a link to click on but once I click on that link than too it doesnt let me complete the login.
What am I doing wrong?
I have ruby 1.9.3 and rails 3.2.3. And I have been following the "Rails 3 in Action" book as a reference and the Rspec tests in that are all working fine.
I have not added anything else for the confirmable aspect to work.
These features work fine with my application.
Feature: Signing in
In order to use the site
As a user
I want to be able to sign in
Scenario: Signing in via confirmation
Given there are the following users:
| email | password | unconfirmed |
| user@authorize.com | password | true |
And "user@authorize.com" opens the email with subject "Confirmation instructions"
And they click the first link in the email
Then I should see "Your account was successfully confirmed"
Then I should see "Signed in as user@authorize.com"
Scenario: Signing in via form
Given there are the following users:
| email | password |
| user@authorize.com | password |
And I am signed in as them
I have used the email_spec gem and added email.rb file in the features/support directory.
also I ran the migration:
rails g migration add_confirmable_fields_to_user.rb
| 0 | [
2,
92,
52,
275,
1676,
19,
15,
166,
75,
1017,
14,
15939,
8517,
568,
29276,
800,
3726,
3726,
31,
57,
147,
29276,
8551,
26,
65,
452,
14,
1676,
576,
18548,
17,
65,
296,
1123,
163,
31,
905,
14,
13,
45,
1126,
20590,
579,
7289,
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... |
PHP : Execute a program in background multiple times, once
===
I have written a program with " C ", and I would like to execute it with php, I tried to use the function php_exec, but It doesn't work. To be more specific in my problem I will tell you some details. This program is used to make downloads faster, in brief, the users will enter to a webpage, a put their direct links, then submit their links to have a direct link from my server, the problem here is that " How can I can let the user use it, is there any equivalent to php_exec ? " Because I think that php_exec does not work if many users send their links in the same time, also I would like to know, can this harm my server ?
Thank you ! | 0 | [
2,
13,
26120,
13,
45,
15644,
21,
625,
19,
2395,
1886,
436,
15,
382,
800,
3726,
3726,
31,
57,
642,
21,
625,
29,
13,
7,
272,
13,
7,
15,
17,
31,
83,
101,
20,
15644,
32,
29,
13,
26120,
15,
31,
794,
20,
275,
14,
1990,
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... |
How to set the default host when using Rubber to deploy to EC2?
===
I am running Rails 3.0.3 and trying to use Rubber to deploy my app to Amazon ec2. I watched Railscast #347 on this subject and followed every step. But when I run `cap rubber:create_staging`, I get `.../gems/amazon-ec2-0.9.17/lib/AWS.rb:142:in 'initialize': No :server provided (AWS::ArgumentError)`, which when I look at the line in AWS.rb seems like I should have set a default_host somewhere, but Ryan Bates never mentioned that in the Railscast and I don't know where to set that or what that even really means in this context. In which config file can I set the default host? Or is this indicative of a different problem? Thanks so much in advance. | 0 | [
2,
184,
20,
309,
14,
12838,
2015,
76,
568,
8457,
20,
17617,
20,
6695,
135,
60,
800,
3726,
3726,
31,
589,
946,
2240,
18,
203,
9,
387,
9,
240,
17,
749,
20,
275,
8457,
20,
17617,
51,
4865,
20,
8059,
6695,
135,
9,
31,
1634,
2240,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Core Data object graph design decision
===
I am designing an app which tracks data on `Game`s. Each `Game` has a `name`, a `date` and other attributes. The problem I am having arises because I want the user to be able to add more `name`s to pick from in the application. (in this case from a UITableView)
I currently have a new entity called `GameName` so that I can show the user a list of game names to pick from when they are adding a new `Game`. My dilemma is that I want to know if this is a good practice or if I should just be adding the names to the `Game` object itself. It seems that if I use the former practice, I will end up having a lot of entities with just one attribute, for the sake of allowing the user to pick from a customizable list.
I hope this makes sense. I can clarify anything upon request. | 0 | [
2,
2884,
1054,
3095,
7210,
704,
1401,
800,
3726,
3726,
31,
589,
15026,
40,
4865,
56,
1633,
1054,
27,
13,
1,
5128,
1,
18,
9,
206,
13,
1,
5128,
1,
63,
21,
13,
1,
7259,
1,
15,
21,
13,
1,
8209,
1,
17,
89,
13422,
9,
14,
1448,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
workaround for prepending to a LinkedHashMap in Scala?
===
I have a LinkedHashMap which I've been using in a typical way: adding new key-value
pairs to the end, and accessing them in order of insertion. However, now I have a
special case where I need to add pairs to the "head" of the map. I think there's
some functionality inside the LinkedHashMap source for doing this, but it has private
accessibility.
I have a solution where I create a new map, add the pair, then add all the old mappings.
In Java syntax:
newMap.put(newKey, newValue)
newMap.putAll(this.map)
this.map = newMap
It works. But the problem here is that I then need to make my main data structure
(this.map) a var rather than a val.
Can anyone think of a nicer solution? Note that I definitely need the fast lookup
functionality provided by a Map collection. The performance of a prepending is not
such a big deal.
More generally, as a Scala developer how hard would you fight to avoid a var
in a case like this, assuming there's no foreseeable need for concurrency?
Would you create your own version of LinkedHashMap? Looks like a hassle frankly.
| 0 | [
2,
170,
10037,
26,
15884,
7601,
20,
21,
4727,
25436,
15022,
19,
25975,
60,
800,
3726,
3726,
31,
57,
21,
4727,
25436,
15022,
56,
31,
22,
195,
74,
568,
19,
21,
3874,
161,
45,
4721,
78,
1246,
8,
15165,
7473,
20,
14,
241,
15,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Router / StateManager - can't make it work
===
I've been trying to implement a router as specified in [this guide][1], but I can't make it work. Can anyone give a quick code sample using the latest version of Ember to enable a router that supports routing through urls?
[1]: http://emberjs.com/guides/outlets/ | 0 | [
2,
858,
139,
13,
118,
146,
22256,
13,
8,
92,
22,
38,
233,
32,
170,
800,
3726,
3726,
31,
22,
195,
74,
749,
20,
8713,
21,
858,
139,
28,
9931,
19,
636,
1565,
3378,
500,
2558,
165,
500,
15,
47,
31,
92,
22,
38,
233,
32,
170,
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... |
Black edge around transparent png in IE7
===
There are many working solutions to display transparent pngs correct in IE, but all these solutions will not work if the image is in a rotated container.
I' ve tried
img{
background: transparent;
-ms-filter: “progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF)”;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
zoom: 1;
}
to work around IE' s transparent png bug, but it does not work.
Ive created a show case at .
[http://jsfiddle.net/s__a/Hmyc2/][1]
Please be shure you visit this with **Microsoft Internet Explorer 7**, rotation is not implemented there for IE8.
Can anybody help to display the rotated image correct in **IE7**/IE8?
Best regards.
[1]: http://jsfiddle.net/s__a/Hmyc2/
| 0 | [
2,
319,
1407,
140,
14862,
351,
2723,
19,
13,
660,
465,
800,
3726,
3726,
80,
50,
151,
638,
6776,
20,
3042,
14862,
351,
2723,
18,
4456,
19,
13,
660,
15,
47,
65,
158,
6776,
129,
52,
170,
100,
14,
1961,
25,
19,
21,
24107,
12147,
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... |
C++ Default Constructor Not Found
===
I'm having a problem with some code in Visual C++ 2010 Express. I'm trying to make a class that has a constructor that accepts an argument which has a default value. Here's a short program that shows what I'm trying to achieve:
//Class declaration
class Class {
private:
int mValue;
public:
Class(int);
int GetValue();
};
Class::Class(int val=1) : mValue(val)
{
}
int Class::GetValue()
{
return mValue;
}
int main()
{
Class test;
cout << test.GetValue() << endl;
}
Now this seems to work fine. If I replace <code>Class test</code> with <code>Class test(10)</code>, say, <code>mValue</code> is initialised correctly.
However, in a second program I'm trying to do exactly the same thing. I have a class defined like this:
namespace mobs {
Class Monster {
private:
mHitPoints;
public:
Monster(int);
int GetHitPoints() const;
};
}
with the implementation of the functions like this:
namespace mobs {
Monster::Monster(int hp=10) : mHitPoints(hp)
{
}
int Monster::GetHitPoints() const
{
return mHitPoints;
}
}
but when I try to declare a class and use the <code>GetHitPoints()</code> function like so:
mobs::Monster testmonster;
cout << testmonster.GetHitPoints() << endl;
Visual C++ tells me that "no default constructor exists for class mobs::Monster". Why is this? | 0 | [
2,
272,
20512,
12838,
6960,
248,
52,
216,
800,
3726,
3726,
31,
22,
79,
452,
21,
1448,
29,
109,
1797,
19,
3458,
272,
20512,
498,
2999,
9,
31,
22,
79,
749,
20,
233,
21,
718,
30,
63,
21,
6960,
248,
30,
16548,
40,
5476,
56,
63,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.htaccess ErrorDocument issue
===
Problem with custom error pages.
My server root is "C:\www" and error pages are in "C:\www\errors".
So I put a .htaccess file in "C:\www" with following:
ErrorDocument 404 /errors/404.html
ErrorDocument 403 /errors/403.html
ErrorDocument 500 /errors/500.html
This works for anything in "mysite.net". But I also have subdirectories like "first.mysite.net", "second.mysite.net" and so on, and .htaccess from root doest work there. It's searching for "errors" folder in these subfolders and return the default 404 page.
I've tried this:
ErrorDocument 500 C:/www/errors/500.html
ErrorDocument 500 C:\www\errors\500.html
Doesn't work.
ErrorDocument 500 http://mysite.net/errors/500.html
This works, but it makes a redirect and I don't want this. I want the browser to keep adress line the same.
Can anyone make this clear for me? Thanks. | 0 | [
2,
13,
9,
9020,
20604,
7019,
28132,
1513,
800,
3726,
3726,
1448,
29,
5816,
7019,
4434,
9,
51,
8128,
5900,
25,
13,
7,
150,
45,
1,
6483,
7,
17,
7019,
4434,
50,
19,
13,
7,
150,
45,
1,
6483,
1,
29992,
18,
7,
9,
86,
31,
442,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can you fill a UITableView with data from two arrays of two different object types?
===
Currently I fill a UITableView using this method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"CharNameCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
MyObject *obj = (MyObject*)[self.characters objectAtIndex:indexPath.row];
cell.textLabel.text = obj.name;
return cell;
}
But what could one do if you had two different arrays from two different types and you wanted to display a property from each in the cells?
Pseudocode:
MyObject1
MyObject2
cellTextLabel.text = Myobject1.name;
cellTextLabel.text = MyObject2.name;
Assuming that each object has a name property. I know my syntax above isn't correct, but I think you should get the drift. | 0 | [
2,
184,
92,
42,
3509,
21,
13,
11193,
579,
4725,
29,
1054,
37,
81,
7718,
18,
16,
81,
421,
3095,
2551,
60,
800,
3726,
3726,
871,
31,
3509,
21,
13,
11193,
579,
4725,
568,
48,
2109,
45,
13,
8,
13,
5,
11193,
579,
4725,
9725,
1637,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Drawable Landscape isn't loaded on Orientation Change
===
I want to prevent my activity from restarting when I change the orientation from portrait to landscape, so I call this on the corresponding activity on manifest:
android:configChanges="orientation|screenSize"
My activity isn't restarted anymore but unfortunately the drawables and layout I have for the activity on landscape orientation isn't loaded.
When I removed the line above, the drawables and layout are loaded correctly but then the activity restarted.
is there any way to prevent the activity from restarting while the landscape resources are still loaded correctly? | 0 | [
2,
2003,
579,
4453,
2532,
22,
38,
8572,
27,
10245,
753,
800,
3726,
3726,
31,
259,
20,
2501,
51,
2358,
37,
22767,
68,
76,
31,
753,
14,
10245,
37,
5548,
20,
4453,
15,
86,
31,
645,
48,
27,
14,
7265,
2358,
27,
13160,
45,
13005,
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... |
SQLite DataAdapter UpdateBatchSize Error
===
Background:
I am attempting to copy a DataTable to a SQLite database. In comparison to an equivalent data set running on a SQLServer database, the SQLite version takes about 5 times longer. In order to streamline this, I am trying to use the UpdateBatchSize property of the SQLiteDataAdapter I'm using to enable batch processing.
Problem:
However, any attempt to set the value results in a System.NotSupportedException. How do you properly set that value? See code:
public int InsertDataTable(SQLiteConnection conn, DataTable dt, string selectCommand)
{
SQLiteDataAdapter myAdapter = new SQLiteDataAdapter(selectCommand, m_conn);
myAdapter.UpdateBatchSize = 0;
int rowsAffected = myAdapter.Update(dt.Select());
return rowsAffected;
} | 0 | [
2,
4444,
10601,
1054,
27576,
106,
11100,
4900,
673,
10454,
7019,
800,
3726,
3726,
2395,
45,
31,
589,
6314,
20,
4344,
21,
1054,
5924,
20,
21,
4444,
10601,
6018,
9,
19,
6050,
20,
40,
4602,
1054,
309,
946,
27,
21,
4444,
255,
10321,
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... |
Camera Troubles in Mathematica
===
I'm trying to animate a torus being cut by a plane, so that as the plane enters the torus the part in front of the plane disappears (the idea is to show the cross section). That much I can do, but I can't seem to get the camera to behave. I'd like everything to stay the same size and position, but despite setting `ViewVector`, `ViewAngle`, and `ViewVertical` the scene becomes smaller as the animation progresses. Note that I chose the settings pretty arbitrarily. I am baffled as to why the camera view changes with these three options fixed.
Here is the code (I produce the frames in a table, and then export them for the animation).
Table[Show[
ContourPlot3D[(1 - Sqrt[x^2 + (y + 1/2)^2])^2 + z^2 - 1/4 ==
0, {x, -2, 2}, {y, -2, 2 - 2 t}, {z, -2, 2}, Mesh -> False], (*The torus*)
ContourPlot3D[y == 2 - 2 t, {x, -2, 2}, {y, -2, 2}, {z, -2, 2},
Mesh -> False, ContourStyle -> {White, Opacity[.5]}], (*The plane*)
Axes -> False, Boxed -> True,
ViewVector -> {{5 Sqrt[6], 10 Sqrt[6], 5 Sqrt[6]}, {0, 0, 0}},
ViewAngle -> 3 Pi/50, ViewVertical -> {0, 0, 1}], {t, 0, 1, .5}]
And here is the result.
![Torus cross sections][1]
As you can see, the camera zooms out and seems to rotate slightly. Any idea how to fix this?
[1]: http://i.stack.imgur.com/dAmjH.png | 2 | [
2,
3336,
16615,
19,
5057,
5996,
12630,
800,
3726,
3726,
31,
22,
79,
749,
20,
14487,
591,
21,
20,
3403,
142,
1077,
34,
21,
3627,
15,
86,
30,
28,
14,
3627,
8104,
14,
20,
3403,
14,
141,
19,
431,
16,
14,
3627,
20341,
13,
5,
124,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple Ports on a single Embedded Tomcat instance
===
I want to extend an application already existing at my company. Atm we have an EMBEDDED Tomcat in Java that creates a login page on localhost:8081/ (redirects to login.jsf)
Now, I want to use the same Tomcat Object and tell him that I want a totally different service on a different port (e.g. 8088). But because I use an embedded Tomcat, it seems we dont have a server.xml file which I found often during my research on this topic.
So what is the source code to tell our Embedded Tomcat that when surfing to :8081 call the login interface as before but when surfing to :8088 bring up a totally different site (e.g. just an xml file)?
I think you need a Connector object for each "use case", right? But how do I configure the stuff correctly? I couldn't find a solution
Thanks a lot | 0 | [
2,
1886,
9551,
27,
21,
345,
12138,
2067,
5782,
4851,
800,
3726,
3726,
31,
259,
20,
7206,
40,
3010,
614,
3149,
35,
51,
237,
9,
35,
79,
95,
57,
40,
12138,
2067,
5782,
19,
8247,
30,
9695,
21,
6738,
108,
2478,
27,
375,
11694,
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... |
making form elements disappear with javascript
===
I'm a little new to javascript. I have a bunch of checkboxes for an html form. The checkboxes are dynamically generated from a python script. The last checkbox I have is entitled "N/A", I want to make it so that if any of the other checkboxes are checked, the "N/A" checkbox automatically disappears. If the N/A checkbox is checked, the others disappear. And of course, if I uncheck the boxes, the opposite should occur. I know that i need to assign the different input fields different id's so javascript can identify them, but I'm not sure how to write the javascript to make the actual disappearing action to occur.
Thank you. | 0 | [
2,
544,
505,
2065,
10866,
29,
8247,
8741,
800,
3726,
3726,
31,
22,
79,
21,
265,
78,
20,
8247,
8741,
9,
31,
57,
21,
7653,
16,
2631,
5309,
160,
26,
40,
13,
15895,
505,
9,
14,
2631,
5309,
160,
50,
7782,
1326,
6756,
37,
21,
20059,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
windows ce 5.0 bat copy permission
===
I'm trying to create a bat file to copy a dll to paste in the windows foler, the file already exists in windows but I want to print my own.
The code I have is:
DIR \Windows\shdoclc.dll
icacls \Windows\shdoclc.dll
ATTRIB -R -S -H \Windows\shdoclc.dll
COPY \Temp\shdoclc.dll \Windows\shdoclc.dll
pause
I can copy/paste it manually from windows ce, everywan, or activesync, but the command terminal doesn't work because of the file location, the file is hidden/ read only/ and a system file, the attribute command doesn't work.
and it gives me an error every time the \windows\shdolc.dll is involved, but if I change the file name or location the copy works fine.
I think it's a problem with the permision of the command prompt, don't nkow how to change it though. | 0 | [
2,
1936,
4000,
331,
9,
387,
3570,
4344,
5572,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
3570,
3893,
20,
4344,
21,
13,
43,
211,
20,
640,
62,
19,
14,
1936,
8938,
106,
15,
14,
3893,
614,
5636,
19,
1936,
47,
31,
259,
20,
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... |
query_posts using custom taxonomy
===
Im having trouble displaying posts from a custom post type called 'tfg-properties' in the order that i need them to appear.
I have created a custom taxonomy for this post type called 'featured-properties' what I want to do is have the posts from taxonomy - 'featured-properties' display before the other posts.
**Custom Taxonomy - 'featured-properties'**
register_taxonomy('featured-properties', 'tfg-properties', array(
"hierarchical" => true,
"label" => "Featured Properties",
'update_count_callback' => '_update_post_term_count',
'query_var' => true,
'rewrite' => array(
'slug' => 'featured-property',
'with_front' => false ),
'public' => true,
'show_ui' => true,
'show_tagcloud' => true,
'_builtin' => false,
'show_in_nav_menus' => false)
);
I am able to achieve this using categories but since I am also incorporating a blog this will not work..
Here is how I am querying my posts..
**Query posts by category id**
// Get all posts from featured properties
$catId = get_cat_ID('Featured Property');
query_posts('post_type=tfg-properties&cat=' . $catId);
// begin the loop
while( have_posts() ): the_post(); ?>
<li class="single-prop">
...
</li>
<?php endwhile; ?>
</ul><!-- end property-post -->
<ul class="prop-post">
<?php
// Get all posts from featured properties
query_posts('post_type=tfg-properties&cat=-' . $catId);
// begin the loop
while( have_posts() ): the_post(); ?>
<li class="single-prop">
...
</li>
<?php endwhile; ?>
Is there any way I can sort the custom posts with custom tax to display before the other posts?
Thanks in advance! | 0 | [
2,
25597,
1,
6962,
18,
568,
5816,
26802,
800,
3726,
3726,
797,
452,
2572,
17418,
9868,
37,
21,
5816,
678,
1001,
227,
13,
22,
38,
19109,
8,
10890,
106,
3915,
22,
19,
14,
389,
30,
31,
376,
105,
20,
1893,
9,
31,
57,
679,
21,
5816... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WATIR can't find iframe links after losing focus
===
I'm on Ubuntu Linux/Firefox 13 and WATIR.
I have a Webpage that contains links to about 16 iframes.. all linked like this....
<a href="javascript:nextPage(8);">9</a>
<a href="javascript:nextPage(9);">10</a>
<a href="javascript:nextPage(10);">11</a>
<a href="javascript:nextPage(11);">12</a>
Clicking the number will put the iframe into the page and on the page is another box for comments (main page)
Here's what I ** DO ** know because I have verified it by the script. The page will come up showing all 16 links. I have my WATIR script to click the 11th link. It does that, it fills in the text boxes, it will then go back to the main page by using the browser.frame(:index,0).locate method and fill in the comments box which resides below the place where the iframes are filled in.
None of this is a problem.
The problem is trying to get the script to then click the link labeled "12". (It needs to go through these iframes sequentially)
It can't find the links on the main page again. I end up with ....
[remote server] file:///tmp/webdriver-profile20120730-32067-1haylz3/extensions/fxdriver@googlecode.com/components/command_processor.js:5780:in `unknown': Element is not currently visible and so may not be interacted with (Selenium::WebDriver::Error::ElementNotVisibleError)
My script (the relevant parts) are below....
#!/usr/local/bin/ruby
require 'rubygems'
require 'watir-webdriver'
require "webdriver-user-agent"
require 'headless'
require 'thread'
#Firefox 13 path below. Doesn't work with 14
Selenium::WebDriver::Firefox.path = '/home/janie/Downloads/firefox/firefox'
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = false;
browser=Watir::Browser.new :firefox, :profile => profile
browser.goto("http://myurl/test")
browser.link(:text,"11").click
browser.frame(:name,"page_11").locate
puts "Text fields "
puts browser.frame(:name,"page_11").text_fields.length
$counter=0
#This if loop works like a champ
if browser.frame(:id,"page_11").text_fields.length > 0
puts "Found and iterating through Text Boxes"
while $counter < browser.frame(:id, "page_11").text_fields.length do
browser.frame(:id, "page_11").text_field(:index, $counter).set("Robot_Test")
end
end
#Now go back to the main page
browser.frame(:index,0).locate
#The below works too so I know I am back on the top level/parent
if browser.text.include? "This is the main page"
puts "--> Test Passed. Found the test string"
else
puts "--> Test Failed! Could not find:"
end
#Now we are back in the main page again
browser.text_field(:name,"COMMENTS").set("ROBOT_TEST")
#The above works great
#And now the problem.....
browser.link(:text,"12").click
Kaboom! I get the can't find element error above.
For some reason, it no longer sees the links on the page. Any idea what could be causing this? I have been searching for this all day and this about the ONLY thing left before I can run this script everything else works great.
Does anyone know how to get around this behavior in Watir?
Many thanks!
Janie | 0 | [
2,
15553,
1523,
92,
22,
38,
477,
31,
8361,
6271,
75,
2281,
1776,
800,
3726,
3726,
31,
22,
79,
27,
287,
12968,
2473,
13024,
118,
5929,
18219,
539,
17,
15553,
1523,
9,
31,
57,
21,
2741,
6486,
30,
1588,
6271,
20,
88,
347,
31,
8361,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Enumerating Decorated DLL Functions in C++
===
In my project, I need to load DLLs at run time and I have no information about them prior to that. I need to be able to enumerate the functions with their (decorated) names to be called with LoadLibrary and GetProcAddress (this is a requirement imposed on me). The names may or may not be decorated, and obviously GetProcAddress needs the decorated name if it has one.
Is there a reasonable way to do this?
I can use Depends and other tools to pull out decorated names myself, but this needs to be done at run time. With functions like [UnDecorateSymbolName][1], there's got to be a way to get the decorated name out that I'm missing. I tried SymEnumSymbols but that undecorated the names.
Note that I'm not asking about calling the functions, just enumerating names from the DLL without a .DEF file. I'm on Visual Studio 2010 and it is assumed all DLLs will be compiled on Visual Studio.
[1]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms681400%28v=vs.85%29.aspx | 0 | [
2,
26940,
68,
6933,
13,
43,
211,
3719,
19,
272,
20512,
800,
3726,
3726,
19,
51,
669,
15,
31,
376,
20,
6305,
13,
43,
211,
18,
35,
485,
85,
17,
31,
57,
90,
676,
88,
105,
1313,
20,
30,
9,
31,
376,
20,
44,
777,
20,
26940,
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... |
How do I let my module implement user defined dataclass (Currently Use String)
===
I am still not entirely familiar with Haskell but when I was doing some exercises on my own, I came across a problem that would seem might come up in the future. Even if it doesn't I would like to know how to do this in the future.
Lets say I have a module
module UserType where
data ThisModulesData = UserData String | ThisModulesInternal Int
moduleMethod :: (ThisModulesData -> Int) -> ThisModulesData -> Int
moduleMethod func dat = case dat of
UserData _ -> func dat
ThisModulesInternal i -> i
processList :: (ThisModulesData -> Int) -> [ThisModulesData] -> Int
processList func xs = sum $ map (moduleMethod func) xs
Then if I wanted to use this module I would have something like
dataList :: [ThisModulesData]
dataList = [UserData "Type1", UserData "Type2", ThisModulesInternal 8]
processFunction :: ThisModulesData -> Int
processFunction (UserData command) = case command of
"Type1" -> 1
"Type2" -> 2
_ -> 0
processFunction _ = 0
result :: Int
result = processList processFunction dataList
What I would like to do is replace the string with something more haskell like so it is type safe and could raise a compile error if I had
dataList = [UserData "Wrong", UserData "ThisIsWrong", ThisModulesInternal 97]
Thanks. I have had a pretty good time learning Haskell thanks to the help at StackOverflow. | 0 | [
2,
184,
107,
31,
408,
51,
12613,
8713,
4155,
2811,
1054,
1898,
13,
5,
24947,
275,
3724,
6,
800,
3726,
3726,
31,
589,
174,
52,
2894,
3694,
29,
63,
16507,
47,
76,
31,
23,
845,
109,
12612,
27,
51,
258,
15,
31,
281,
464,
21,
1448,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 maps with mysql in j2ee framework
===
I am working on a web application with j2ee that takes the address of the peoples from mysql database and shows their location on the Google maps . Currently I am doing it manually as i dont know about integration of google maps with jsp kindly give me some sort of direction to do so with java.
please help!!!!! | 0 | [
2,
8144,
6867,
29,
51,
18,
22402,
19,
487,
135,
2851,
6596,
800,
3726,
3726,
31,
589,
638,
27,
21,
2741,
3010,
29,
487,
135,
2851,
30,
1384,
14,
3218,
16,
14,
148,
18,
37,
51,
18,
22402,
6018,
17,
1285,
66,
1474,
27,
14,
8144,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Capitalize a string with html in RoR
===
I'm building a web app with RoR. How do I take this:
<b>this is my text</b>
and capitalize the first word, so it looks like this
<b>This is my text</b>
I have tried using the capitalize method, but it doesn't work on HTML. Is there any way to do this, preferably without have to install any extra gems?
(For what it's worth, the string ONLY ever contains a `<b>` tag and text.) | 0 | [
2,
1057,
2952,
21,
3724,
29,
13,
15895,
19,
761,
248,
800,
3726,
3726,
31,
22,
79,
353,
21,
2741,
4865,
29,
761,
248,
9,
184,
107,
31,
247,
48,
45,
13,
1,
220,
1,
1565,
25,
51,
1854,
1,
118,
220,
1,
17,
1057,
2952,
14,
64,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Outputting XLS File
===
<p>I'm using PHPExcel to generate excel files (crazy right ?) with information i get from a database, the thing is whenever i create the file it is saved in the server and then i just send a link to that file to the user so he can access it. </p>
<p>I doubt this is the right way of doing it, what i'm looking for is to just send the file to the browser without saving it on the server</p>
Here is my code:
$fileName = "Request_" . $idRequest . "_Update.xls";
$objWriter = PHPExcel_IOFactory::createWriter($excel, 'Excel5');
$objWriter->save($fileName);
$objPHPExcel = PHPExcel_IOFactory::load($fileName);
echo json_encode(array(
"ExitCode" => 0,
"Message" => "Success",
"data" => $request,
"File" => "../reports/$fileName"
));
Once i receive `File` in the `$.ajax` call that receives it just add it to an anchor tag:
$.ajax({
...
success : function(response){
$('#container').append('<a href="'+response.File+'">Here is your file</a>
}
| 0 | [
2,
5196,
1203,
993,
7532,
3893,
800,
3726,
3726,
13,
1,
306,
1,
49,
22,
79,
568,
13,
26120,
1706,
11040,
20,
7920,
20700,
6488,
13,
5,
23282,
193,
13,
60,
6,
29,
676,
31,
164,
37,
21,
6018,
15,
14,
584,
25,
6634,
31,
1600,
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... |
ARINC424 Parsing and SID/STAR Procedure Decoding
===
I am programming in VB2010 and am going through the procedures section of an ARINC424 datafile. What I'm doing is creating a simple GIS viewer for the procedures. Currently i am implementing my own routines to take each leg type (PathTerminator) and calculate geographically the leg parts. For example IF and TF are fairly easy. The more complex ones like RF and CR are more involved. Is there an existing library or class that would help me process this type of data? | 0 | [
2,
21,
2445,
150,
300,
1996,
2017,
18,
68,
17,
7027,
118,
2265,
7004,
121,
15458,
800,
3726,
3726,
31,
589,
3143,
19,
13,
20468,
2751,
17,
589,
228,
120,
14,
8876,
1050,
16,
40,
21,
2445,
150,
300,
1996,
1054,
16877,
9,
98,
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... |
How to get IE9 standards support for dialogs opened by HTA?
===
I'm translating some of my old HTAs from Quirks to IE9 standards. However, it seems that modal and modeless dialogs opened by HTA don't support IE9 standards mode.
Test dialog:
<!DOCTYPE html>
<html>
<head>
<title>TestDialog</title>
<meta http-equiv="x-ua-compatible" content="ie=9" />
</head>
<body>
<svg>
<circle cx="100" cy="100" r="50" fill="#0f0" />
</svg>
</body>
</html>
In the HTA main page:
<button onclick="showModalDialog(...)">Modal</button>
<button onclick="showModelessDialog(...)">Modeless</button>
When opening TestDialog from HTA, it's empty. If the main page is a regular html-document, the green circle appears in the dialog. When opening from HTA, there's no difference if the dialog file itself were htm or hta.
I've also tested `addEventListener()`, JSON etc, but nothing seems to work in dialogs.
So, can I "force" dialogs to support IE9 standards when opening from HTA?
| 0 | [
2,
184,
20,
164,
13,
660,
518,
3364,
555,
26,
28223,
18,
520,
34,
13,
17134,
60,
800,
3726,
3726,
31,
22,
79,
25237,
109,
16,
51,
315,
13,
17134,
18,
37,
19321,
18,
20,
13,
660,
518,
3364,
9,
207,
15,
32,
2206,
30,
13,
20756... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Virtualbox Memory Corruption?
===
I have a virtual Ubuntu 11.10 machine that I recently cloned and trnasfered the .vdi file to a different computer. However, when I was examing memory in GDB of an Apache process, for example:
x/i *0x0804bd88
GDB returns:
0x6c28c358: Cannot access memory at 0x6c28c358
and when I look at the /proc/PID/maps file of the Apache process it shows that 0x0804bd88 is part of the process' memory layout. What can I do to fix this problem? | 0 | [
2,
6599,
5309,
1912,
7858,
60,
800,
3726,
3726,
31,
57,
21,
6599,
287,
12968,
2473,
547,
9,
1036,
1940,
30,
31,
1989,
13871,
43,
17,
9235,
6169,
2407,
69,
14,
13,
9,
710,
1115,
3893,
20,
21,
421,
1428,
9,
207,
15,
76,
31,
23,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I write Java code that will press the Shift, Home and End keyboard buttons?
===
All I can find on google is code to add listeners and events to wait for buttons to be pressed.
I am trying to make it so that the code actually presses the buttons.
I know that KeyModifier.SHIFT and Key.HOME exist but I don't know how to use them or if they are the right keywords.
Any help would be greatly appreciated. | 0 | [
2,
184,
107,
31,
2757,
8247,
1797,
30,
129,
901,
14,
4471,
15,
213,
17,
241,
8896,
12861,
60,
800,
3726,
3726,
65,
31,
92,
477,
27,
8144,
25,
1797,
20,
3547,
15672,
17,
963,
20,
1760,
26,
12861,
20,
44,
2931,
9,
31,
589,
749,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Easymock incompatiable return value type error
===
I'm trying to create a EasyMock for this particular piece of code, such that innerfValue is of type IJavaValue, which is a subclass of IJavaObject. I've tried conventional methods of dealing with this by mocking innerfValue and then just assuming aJavaValue points to innerfValue and mocking the sendmessage method as if it were a method of innerfValue, but its hasen't been working and by the time I get to the end it gives me a incompatible return value type when I do (symbolvalue in this case is a mock object that I made to return after the sendmessage method was called on my mock innerfValue object, not the saem as the symbolValue in the other piece of code):
EasyMock.expect(((IJavaObject)symbolValue).toString()).andReturn("aValue");
Here is the piece of code
IJavaObject aJavaValue = (IJavaObject)innerfValue.getValue();
IJavaObject symbolValue = (IJavaObject) ((IJavaObject)aJavaValue).sendMessage(
"toString", "()Ljava/lang/String;", null, thread, false);
value = symbolValue.toString(); | 0 | [
2,
2010,
79,
5668,
19,
960,
10563,
579,
788,
1923,
1001,
7019,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
2010,
79,
5668,
26,
48,
1498,
1855,
16,
1797,
15,
145,
30,
3754,
410,
15165,
25,
16,
1001,
13,
9603,
1385,
15165,
15,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
grab svg text value with javascript
===
Let's say I have this..
<svg version="1.1"
baseProfile="full"
xmlns="http://www.w3.org/2000/svg">
<rect width="100%" height="100%" fill="red" />
<circle cx="150" cy="100" r="80" fill="green" />
<text name="textName" x="150" y="125" font-size="60" text-anchor="middle" fill="white">SVG</text>
</svg>
And I want to use Javascript to do something like this...
alert(document.svg.text.textName.value);
How do I do this? | 0 | [
2,
4931,
13,
18,
22955,
1854,
1923,
29,
8247,
8741,
800,
3726,
3726,
408,
22,
18,
395,
31,
57,
48,
9,
9,
13,
1,
18,
22955,
615,
3726,
7,
165,
9,
165,
7,
1000,
14503,
3726,
7,
13727,
7,
23504,
2172,
3726,
7,
21127,
6903,
6483,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 write to a file and save it dynamically in java
===
I have a requirenment to write to a file rather than in System.out.println and save it at same time so that user can see the progress anytime by opening the file.
Right now I am using following code
FileWriter fstream = null;
File file1 = new File(logFile);
fstream = new FileWriter(file1);
out = new BufferedWriter(fstream);
out.write(msg);
out.write("\n");
but it does not save the contents to the file unless I say Out.close();
FYI - 1. This is a J2ee application code.
2. I donot want to user Log4jLogger
Is there any simpler way to do this? Any pointers? | 0 | [
2,
184,
20,
2757,
20,
21,
3893,
17,
2079,
32,
7782,
1326,
19,
8247,
800,
3726,
3726,
31,
57,
21,
4077,
103,
1130,
20,
2757,
20,
21,
3893,
864,
119,
19,
329,
9,
1320,
9,
10299,
16600,
17,
2079,
32,
35,
205,
85,
86,
30,
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... |
iOS Custom UITableView cell
===
How to custom the cell with UITextLabel
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:@"Cell"];
self.codeLabel.text = [[courseMURArray objectAtIndex:indexPath.row] objectForKey:@"courseCode"];
self.nameLabel.text = [[courseMURArray objectAtIndex:indexPath.row] objectForKey:@"courseName"];
self.houreLabel.text = @"3";
self.priceLabel.text = @"0.000";
return cell;}
| 0 | [
2,
13,
7760,
5816,
13,
11193,
579,
4725,
1667,
800,
3726,
3726,
184,
20,
5816,
14,
1667,
29,
13,
5661,
11969,
21018,
13,
8,
13,
5,
11193,
579,
4725,
9725,
1637,
6,
5924,
4725,
45,
5,
11193,
579,
4725,
1637,
6,
5924,
4725,
1667,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Convert HTML string to a PDF document in iOS & base64 string
===
I hope this doesn't count as a duplicate, as I'm using a base64 string to convert the image before I want to do the conversion.
Anyway, to my code! I'm currently using the following to get some data out of the data graph and display it via HTMl <table tags>
self.htmlString = [[NSMutableString alloc] initWithString:@"<html><body>"];
[self.htmlString appendString:@"<table border=""1""><tr><th>Snag Number</th><th>Snag Photo</th><th>Snag Description</th><th>Date Taken</th>"];
for (int i = 0; i < self.fetchedResultsController.fetchedObjects.count; i++) {
NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation([self.photoArray objectAtIndex:i])];
NSString *base64String = [imageData base64EncodedString];
Snag *snag = [self.fetchedResultsController.fetchedObjects objectAtIndex:i];
NSString *tableString = [NSString stringWithFormat:@"<tr><td>%i</td><td><p><b><img src='data:image/png;base64,%@'></b></p></td><td>%@</td><td>%@</td></tr>", i+1, base64String, snag.snagDescription, snag.dateTaken];
[self.htmlString appendString:tableString];
I attached this to an email and can email it perfectly fine, it even renders the images properly in the browser.
All I need to do is convert this html document / string to a PDF document. I know it has been done and I've done plenty of research, however I cannot find a suitable solution.
I'd love some help on this.
| 0 | [
2,
8406,
13,
15895,
3724,
20,
21,
13,
11124,
4492,
19,
13,
7760,
279,
1000,
3470,
3724,
800,
3726,
3726,
31,
1376,
48,
1437,
22,
38,
2468,
28,
21,
19429,
15,
28,
31,
22,
79,
568,
21,
1000,
3470,
3724,
20,
8406,
14,
1961,
115,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Phonegap: can't make localStorage persist
===
So I init everything:
var Store = new Lawnchair({table:'mightapp', adaptor:'gears'},
function(s) {
var obj = {msg: 'hooray!'};
s.save({key: "msg", value: obj});
});
Then I comment out the message to test if it persisted...
var Store = new Lawnchair({table:'mightapp', adaptor:'gears'},
function(s) {
//var obj = {msg: 'hooray!'};
//s.save({key: "msg", value: obj});
});
And it doesn't -- what am I doing wrong? I'm making a fitness app and I need to persist people's workouts/workout stats pretty much permanently... should I just do some file i/o? | 0 | [
2,
1132,
1136,
306,
45,
92,
22,
38,
233,
375,
18,
2153,
1303,
22084,
800,
3726,
3726,
86,
31,
19,
242,
796,
45,
4033,
1718,
800,
78,
9413,
14045,
5,
1,
5924,
45,
22,
24577,
7753,
22,
15,
9924,
248,
45,
22,
834,
5446,
22,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF Async Service or MVC Async controller thread usage?
===
Can anyone explain when to use async controller versus an async wcf service? As in thread usage etc?
My async controller looks like this
public class EventController : AsyncController
{
[HttpPost]
public void RecordAsync(EventData eventData)
{
AsyncManager.OutstandingOperations.Increment();
Debug.WriteLine(string.Empty);
Debug.WriteLine("****** Writing to database -- n:{0} l:{1} ******", eventData.Name, eventData.Location);
new Thread(() =>
{
AsyncManager.Parameters["eventData"] = eventData;
AsyncManager.OutstandingOperations.Decrement();
}).Start();
}
public ActionResult RecordCompleted(EventData eventData)
{
Debug.WriteLine("****** Complete -- n:{0} l:{1} ******", eventData.Name, eventData.Location);
Debug.WriteLine(string.Empty);
return new EmptyResult();
}
}
vs my WCF Service
[ServiceBehavior(Namespace = ServiceConstants.Namespace)]
public class EventCaptureService: IEventCaptureService
{
public EventCaptureInfo EventCaptureInfo { get; set; }
public IAsyncResult BeginAddEventInfo(EventCaptureInfo eventInfo, AsyncCallback wcfCallback, object asyncState)
{
this.EventCaptureInfo = eventInfo;
var task = Task.Factory.StartNew(this.PersistEventInfo, asyncState);
return task.ContinueWith(res => wcfCallback(task));
}
public void EndAddEventInfo(IAsyncResult result)
{
Debug.WriteLine("Task Completed");
}
private void PersistEventInfo(object state)
{
Debug.WriteLine("Foo:{0}", new object[]{ EventCaptureInfo.Foo});
}
}
Notice the WCF Service uses Task whereas the Controller uses Thread. I know little about threads and how they work. I was just wondering which of these would be more effecient and not bomb my server. The overall goal is to capture some activity in a Web App and call either the controller or the service (either of which will be on a different domain) and which is a better approach is better. Which is truly async? Do they use the same threads? Any help, tips, tricks, links etc... is always appreciated. My basic question is Async WCF Service or Async MVC Controller?
Thanks! | 0 | [
2,
11801,
410,
21,
9507,
150,
365,
54,
307,
8990,
21,
9507,
150,
9919,
9322,
7514,
60,
800,
3726,
3726,
92,
1276,
3271,
76,
20,
275,
21,
9507,
150,
9919,
5706,
40,
21,
9507,
150,
11801,
410,
365,
60,
28,
19,
9322,
7514,
2722,
60... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
iPhone iOS how to add a UILongPressGestureRecognizer and UITapGestureRecognizer to the same control and prevent conflict?
===
I'm building an iPhone app that would let the user rearrange some of the UI elements on the screen.
How can I add a tap gesture recognizer and a long press gesture recognizer to the same UIView? When I lift up the finger from the long press, the tap gesture recognizer fires. How can I temporarily disable the tap gesture recognizer or prevent it from firing when the user is performing a long press?
Thank you! | 0 | [
2,
21024,
13,
7760,
184,
20,
3547,
21,
13,
5661,
2701,
5890,
5133,
6418,
14673,
22007,
3592,
17,
13,
11193,
2552,
5133,
6418,
14673,
22007,
3592,
20,
14,
205,
569,
17,
2501,
2930,
60,
800,
3726,
3726,
31,
22,
79,
353,
40,
21024,
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... |
Yii CActiveForm client validation is not working in my Widget
===
I need "Report Bug" modal form on all pages of my application. So I made it in form of widget and placed it on the main layout template of my application.
<? $reportBugForm = $this->widget('application.widgets.reportBugWidget.reportBug',array(),true); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
....
</head>
<body>
<? echo $reportBugForm; ?>
I placed it at the top of the page, because it should post ajax requests to itself, regardless of the current page (I don't want to use any controller). Here is the code of widget class itself:
<?php
require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'reportBugForm.php');
class reportBug extends CWidget {
public $id = 'reportBug';
public $name = 'reportBugForm';
private $_form;
public function init() {
$this->_form = new reportBugForm;
if(Yii::app()->request->isAjaxRequest && isset($_POST[$this->name]) && !empty($_POST[$this->name])) {
$this->_form->attributes = $_POST[$this->name];
if($this->_form->validate()) {
echo 'Form is submited!';
} else
echo 'You have incorrectly filled out the form!';
Yii::app()->end();
}
}
public function run() {
$this->render('form',array(
'model'=>$this->_form,
'id'=>$this->id,
'name'=>$this->name
));
}
}
Model is right; form is validated properly, I've checked it; I've placed `$this->error(...);` under all required fields. But client validation is NOT working! I think this is happens because some JavaScript does not manage to load. What can you suggest?
P.S. I don't know maybe it makes difference, but I'm using Twitter Bootstrap extension for Yii.
P.S.S. JQuery code is working fine in my widget. Only Yii client validation is not working. | 0 | [
2,
7679,
49,
272,
7889,
4190,
6819,
27999,
25,
52,
638,
19,
51,
4807,
43,
3060,
800,
3726,
3726,
31,
376,
13,
7,
17437,
6256,
7,
13,
20756,
505,
27,
65,
4434,
16,
51,
3010,
9,
86,
31,
117,
32,
19,
505,
16,
4807,
43,
3060,
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... |
Hide a select when a value has been selected (and page reloads)
===
I have some drop-down boxes that act as filters on a page. When either one is selected the page reloads and filters the posts based on the selection.
What I'm trying to do, is hide a particular select when the page reloads, if the value is not a blank string (e.g. if someone selects 'Auckland', I want that select input to disappear from the page when it reloads, but the other select should stay visible).
Here is the HTML...
<ul>
<li>
<label style="display:none;">Location:</label>
<select onchange="this.form.submit();" name="locations" class="filter-dropdown">
<option value="">SELECT</option>
<option value="auckland" class="level-0">Auckland</option>
<option value="tauranga" class="level-0">Tauranga</option>
<option value="wellington" class="level-0">Wellington</option>
</select>
</li>
<li>
<label style="display:none;">Product or service:</label>
<select onchange="this.form.submit();" name="typeofproduct" class="filter-dropdown">
<option value="">SELECT</option>
<option value="clothing" class="level-0">Clothing</option>
<option value="food" class="level-0">Food</option>
<option value="shoes" class="level-0">Shoes</option>
<option value="travel" class="level-0">Travel</option>
</select>
</li>
</ul>
And here is my poor attempt at using jQuery...
jQuery('.filter-dropdown').bind('change', function(event) {
var x = jQuery(".filter-dropdown option:selected").text();
if (x == "") {
jQuery(this).show();
}
else{
jQuery(this).hide();
}
});
I've tried various this, but the closest I've got is the page hiding all the dropdowns (should only be for ones that have been selected. The reason I'm using classes and not ID's is because there may be more dropdowns on other pages. | 0 | [
2,
3077,
21,
5407,
76,
21,
1923,
63,
74,
1704,
13,
5,
290,
2478,
27339,
18,
6,
800,
3726,
3726,
31,
57,
109,
2804,
8,
2968,
8120,
30,
601,
28,
21062,
27,
21,
2478,
9,
76,
694,
53,
25,
1704,
14,
2478,
27339,
18,
17,
21062,
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 achieve data search in python list
===
i am a newbie to python need some guidance:
what is the best way on itering the below list.
[('admincases', 'test_case_6'), ('admincases', 'test_case_8'),('admincases1', 'test_case_8'),('admincases1', 'test_case_9'),('admincases1', 'test_case_10')]
first i want to get all the admincases uniq value it would be like :
[admincases,admincases1]
then itering the above casees i should get the list of test for the specified case
admincase
[test_case_6,test_case_8]
admincase1
[test_case_8,test_case_9,test_case_10]
| 0 | [
2,
184,
20,
4689,
1054,
2122,
19,
20059,
968,
800,
3726,
3726,
31,
589,
21,
78,
5893,
20,
20059,
376,
109,
8193,
45,
98,
25,
14,
246,
161,
27,
32,
7882,
14,
1021,
968,
9,
636,
5,
22,
1283,
2160,
10325,
18,
22,
15,
13,
22,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to pass Multiline Subject line to find Certificate or in Command line
===
I used to give Certificate name to the some command line tools like `certmgr.exe` or `FindPrivateKey.exe` etc like this.
`certmgr -del -r LocalMachine -s TrustedPeople -c -n "CN=localhost"`
I this case the Subject only one like `"CN=localhost"`.
Now the problem is that I am getting a Certificate with multiline Subject.
![enter image description here][1]
[1]: http://i.stack.imgur.com/NUngy.png
How to give that long, multiline Subject name in Command line | 0 | [
2,
184,
20,
1477,
1889,
1143,
1550,
293,
20,
477,
6259,
54,
19,
1202,
293,
800,
3726,
3726,
31,
147,
20,
590,
6259,
204,
20,
14,
109,
1202,
293,
4672,
101,
13,
1,
17580,
79,
8807,
9,
1706,
62,
1,
54,
13,
1,
19811,
20181,
4237,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MS SQL 2008 mirror performance
===
We have a SQL Server 2008 R2 on production and failover server. Not setup as a cluster.
There are about 30 databases consuming about 70GB disk space. Database files are growing at a steady rate, about 5GB a month.
Both servers have 48GB RAM, most of it dedicated to SQL server.
Planning to setup mirroring between the production and fail over server.
Are there performance issues with mirroring that we should be aware of? Will this slow down the query response time on production server?
Similar question with SQL 2012. Any experience with mirroring (via Always On) performance on SQL 2012?
Thank you
Abhi
| 0 | [
2,
4235,
4444,
255,
570,
3402,
956,
800,
3726,
3726,
95,
57,
21,
4444,
255,
8128,
570,
761,
135,
27,
637,
17,
7476,
2549,
8128,
9,
52,
18161,
28,
21,
7460,
9,
80,
50,
88,
712,
6018,
18,
13,
17601,
88,
3201,
11400,
8582,
726,
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... |
DDMS Files Not Found Android\platform-tools\adb.exe
===
I have Eclipse and Java SE and am running Windows XP and am trying to setup Android for Eclipse.
I first:
Visit http://developer.android.com.
2. On the main page that appears, click the link to download the Android SDK.
3. Find a link appropriate to your operating system (Windows, Mac OS X, or Linux).
4. Click the link to begin the download.
I installed the Android SDK Tools
I then installed ADT as followed ( note I used http instead of https ) under downloading the ADT plugin.
http://developer.android.com/sdk/installing/installing-adt.html
It gave me some errors saying that somethings needed to be installed which would have been installed if i'd installed Java EE.
I saw a site that said go into the SDK Manager, so I tried installing somethind and it gave me this error:
[2012-06-28 14:32:27 - DDMS] DDMS files not found: K:\Android\platform-tools\adb.exe
[2012-06-28 14:32:27 - DDMS] DDMS files not found: K:\Android\platform-tools\adb.exe
What does this mean, and how can I get Android to work. Do I still need some thigns that Java EE has for Android?
| 0 | [
2,
13,
8096,
79,
18,
6488,
52,
216,
13005,
1,
27035,
8,
20799,
18,
1,
1283,
220,
9,
1706,
62,
800,
3726,
3726,
31,
57,
11652,
17,
8247,
1353,
17,
589,
946,
1936,
23045,
17,
589,
749,
20,
18161,
13005,
26,
11652,
9,
31,
64,
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... |
Images in wx.ListControl are cut off
===
I have a wx.ListCtrl in REPORT mode and i use an image list to display icons which are 50x50 pixels with SetItemColumnImage. The problem now is that the text I display in the column right of the icon is less than 50 pixels high and the parts of the icons that are higher than the text are cut off.
Is there a way to tell ListCtrl to adjust the row height to the height of the icons? Last refuge would be to change the fontsize of the text, but there should be a better way. | 0 | [
2,
3502,
19,
619,
396,
9,
5739,
12898,
50,
1077,
168,
800,
3726,
3726,
31,
57,
21,
619,
396,
9,
5739,
4812,
6362,
19,
1330,
3740,
17,
31,
275,
40,
1961,
968,
20,
3042,
9801,
18,
56,
50,
1222,
396,
2290,
18146,
18,
29,
309,
211... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Countdown Issue
===
I've been working on a live ticker and with the help of some code I found on the internet i've managed to find something that is sort of working.
I'm getting a date out of a database and splitting it and putting it into milliseconds and this is where the code I found takes over.
Now the rest of it works out perfect except for the days, it seems to be always 30 days plus however many is left??
This is the code:
GregorianCalendar endDate = new GregorianCalendar(Integer.parseInt(separated[0]), Integer.parseInt(separated[1]), Integer.parseInt(separated[2]), Integer.parseInt(Time[0]), Integer.parseInt(Time[1]), 00);
GregorianCalendar startDate = new GregorianCalendar(year, month, day, hours, minutes, seconds);
long diffInMs = endDate.getTimeInMillis() - startDate.getTimeInMillis();
new CountDownTimer(diffInMs, 1000) {
public void onTick(long millisUntilFinished) {
int seconds = (int)(millisUntilFinished / 1000) % 60 ;
int minutes = (int)((millisUntilFinished / (1000*60)) % 60);
int hours = (int)((millisUntilFinished / (1000*60*60)) % 24);
int days = (int)((millisUntilFinished / (1000*60*60*24)) % 365);
//int years = (int)(millisUntilFinished / 1000*60*60*24*365);
ArrayList<String> timeArray = new ArrayList<String>();
// if(years > 0)
// timeArray.add(String.valueOf(years) + "y");
if(days > 0)
timeArray.add(String.valueOf(days) + "d");
if(hours>0)
timeArray.add(String.valueOf(hours) + "h");
if(minutes>0)
timeArray.add(String.valueOf(minutes) + "min");
if(seconds>0)
timeArray.add(String.valueOf(seconds) + "sec");
String time = "";
for (int i = 0; i < timeArray.size(); i++)
{
time = time + timeArray.get(i);
if (i != timeArray.size() - 1)
time = time + ", ";
}
if (time == "")
time = "0 sec";
Countdown.setText("Database Lock: " + time );
}
Now I can't see why the days would work out wrong?
Any ideas on what might be wrong?
Thanks,
Chris | 0 | [
2,
13005,
22566,
1513,
800,
3726,
3726,
31,
22,
195,
74,
638,
27,
21,
515,
8809,
106,
17,
29,
14,
448,
16,
109,
1797,
31,
216,
27,
14,
2620,
31,
22,
195,
1471,
20,
477,
301,
30,
25,
2058,
16,
638,
9,
31,
22,
79,
1017,
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... |
Creating GENERATOR EXPRESSION or LIST COMPREHENSION without variable "x in" (e.g. for range) in Python
===
In Python, is there any way to write this list comprehension without the "x in" variable (since it is left completely unused)? Same applies to a generator expression. I doubt this comes up very often, but I stumbled onto this a few times and was curious to know.
Here's an example:
week_array = ['']*7
four_weeks = [week_array[:] for x in range(4)]
(Also perhaps, is there a more elegant way to build this?) | 0 | [
2,
2936,
15286,
1803,
54,
968,
27300,
366,
7612,
13,
7,
396,
19,
7,
13,
5,
62,
9,
263,
9,
26,
978,
6,
19,
20059,
800,
3726,
3726,
19,
20059,
15,
25,
80,
186,
161,
20,
2757,
48,
968,
27300,
366,
14,
13,
7,
396,
19,
7,
7612,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to connect to MS Active Directory using LDAP in Xcode
===
I need to connect to Microsoft Active Directory to retrieve user details about group membership. I have the LDAP path and have done this many times in C sharp. But now I need to understand how to do this in Xcode.
There are several questions relating to retrieval of data from AD, but i have not managed to find one explaining how to connect int the first place. So any suggestions/code sample much appreciated thank you.
| 0 | [
2,
184,
20,
6379,
20,
4235,
1348,
16755,
568,
644,
20472,
19,
993,
9375,
800,
3726,
3726,
31,
376,
20,
6379,
20,
7099,
1348,
16755,
20,
11917,
4155,
3289,
88,
214,
4363,
9,
31,
57,
14,
644,
20472,
2013,
17,
57,
677,
48,
151,
436... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Challenge problems for new programmers
===
So I'm training someone at job in PHP, MySQL, HTML, etc and was wondering if anyone out there knew of any good entry-level challenges to have him complete in PHP. I've had him do a bunch already and I'm starting to run out of ideas. He has no previous programming experience. | 4 | [
2,
2404,
1716,
26,
78,
17968,
18,
800,
3726,
3726,
86,
31,
22,
79,
838,
737,
35,
1205,
19,
13,
26120,
15,
51,
18,
22402,
15,
13,
15895,
15,
2722,
17,
23,
5712,
100,
1276,
70,
80,
404,
16,
186,
254,
2792,
8,
3906,
7595,
20,
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... |
Cannot decode base64 uncaught error - HTML canvas element to sd card
===
I'm trying to store a signature (which is drawn on the canvas element) on the device's sd card. I'm using eclipse + phonegap(version 1.7.0).
I came across the following link -
https://groups.google.com/forum/?fromgroups#!topic/phonegap/I23hrgFOgN8
I tried the following code -
var canvas = document.getElementById("can");
var writer = new FileWriter("/mnt/sdcard/sign6.jpeg");
ctxt = canvas.getContext("2d");
var img = canvas.toDataURL();
var img64 = canvas.toDataURL("image/png").replace(/data:image\/png;base64,/, '');
var img = atob(img64);
navigator.notification.alert(img64);
writer.write(img64);
But I encounter the following error - Uncaught Error: Cannot decode base64 (at the line where I have used atob). | 0 | [
2,
1967,
121,
9375,
1000,
3470,
16061,
12647,
7019,
13,
8,
13,
15895,
9696,
4520,
20,
13,
18,
43,
2056,
800,
3726,
3726,
31,
22,
79,
749,
20,
1718,
21,
7810,
13,
5,
2140,
25,
3160,
27,
14,
9696,
4520,
6,
27,
14,
3646,
22,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
mysql: increment maximum field value on insert
===
I have a table with a field called 'sort' which contains sorting number. When I add a new row, I would like the sort field to be filled with the maximum existing value + 1. I tried this:
insert into highlights set sort=max(sort)+1
but I get a 1111 error "Invalid use of group function"
If I try with a subquery,
insert into highlights set sort=(select max(sort) from highlights)+1
I get a 1093 error since apparently I cannot subquery the same table I am inserting into.
Any ideas? Thanks! | 0 | [
2,
51,
18,
22402,
45,
13,
28461,
2979,
575,
1923,
27,
14692,
800,
3726,
3726,
31,
57,
21,
859,
29,
21,
575,
227,
13,
22,
22843,
22,
56,
1588,
2058,
68,
234,
9,
76,
31,
3547,
21,
78,
3131,
15,
31,
83,
101,
14,
2058,
575,
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... |
PHP: Creating a unique identifier for clients (independent of time, cookies and IP number)
===
I am thinking of a method for banning users
* Creating a hash value for multiple variables coming from the user, (like browser and version and something else) and adding them to a table which stores a list of banned users or such values. I've found a list of http vriables here [http://www.php.net/manual/en/reserved.variables.server.php][1]
but I think you probably have experience in this one. I am planning to use it to ban people from the website when necessary and renewing IP number and removing the cookies should not help the person to gain access.
What variables can I use to generate an identifier for the client?
[1]: http://www.php.net/manual/en/reserved.variables.server.php | 0 | [
2,
13,
26120,
45,
2936,
21,
2619,
25570,
26,
7421,
13,
5,
17390,
16,
85,
15,
19396,
17,
15735,
234,
6,
800,
3726,
3726,
31,
589,
1440,
16,
21,
2109,
26,
23756,
3878,
1637,
2936,
21,
19170,
1923,
26,
1886,
12157,
880,
37,
14,
415... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Referance Error TFS & Nuget
===
The type 'System.Net.Http.HttpMessageHandler' is defined in an
assembly that is not referenced. You must add a reference to assembly 'System.Net.Http,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
\Global.cs
The package that were trying to get to work is the AspNetWebApi from nuget from the Nightly Builds from aspnetwebstack
Got some trouble with TFS Referance, when i make nuget install-package to the current projectand all dlls are locally places since its a website project, i get this wierd message, if i rebuild the whole solution it will run smoothly, but when i change the slightliest thing in a CS file that needs to compile the error repeats it self.
and can you make nuget just install the referances with out the package dir and packages.config?
Wonder if anyone have any solution to this problem?
if you have any good articles about referances nuget & tfs practices
| 0 | [
2,
5017,
2416,
7019,
13,
11720,
18,
279,
3152,
3060,
800,
3726,
3726,
14,
1001,
13,
22,
10724,
9,
2328,
9,
21127,
9,
21127,
3845,
18,
1303,
3203,
1252,
22,
25,
2811,
19,
40,
1475,
30,
25,
52,
17571,
9,
42,
491,
3547,
21,
2801,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to update partial page(DIV) if the DIV loads a subpage with a redirection button?
===
I'm confused with that I can embed a child-page into the parent-page's DIV,
but I can't restrict any actions of the child-page within such DIV.
If I push the button which is belong to the child-page,
it will refresh whole page to the new one. Not partially updating.
My HTML is as follows:
The parent-page:
< div id="container" >
< /div>
<script>
$("#container").load("/child-page/");
</script>
The child-page:
< input type="button" name="Create"
value="Create"
onclick="$("#container").load("/child-page/")" />
How can I only update the parent-page's DIV without refreshing whole page ?
Best regards,
Josh
| 0 | [
2,
184,
20,
11100,
7284,
2478,
5,
12916,
6,
100,
14,
13,
12916,
19069,
21,
972,
6486,
29,
21,
302,
14706,
872,
5167,
60,
800,
3726,
3726,
31,
22,
79,
4230,
29,
30,
31,
92,
11911,
69,
21,
850,
8,
6486,
77,
14,
4766,
8,
6486,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 check obstacle and bugs crossing in cocos2d?
===
Am trying to find the bugs and obstacle detection and that time Bugs jumping.How could am check
the detection between bugs and obstacle in the cocos2d page.
Below i added my code..
if (CGRectIntersectsRect(redShip.boundingBox, spriteobstacle.boundingBox)){
// bridge.visible = NO;
float xx=[redShip position].x;
float yy=[redShip position].y;
float xx1=[spriteobstacle position].x;
float yy1=[spriteobstacle position].y;
if ((xx>xx1)&&(yy>yy1)) {
NSLog(@"1");
newY = oldY+2;
newX = oldX;
// [redShip runAction:[CCMoveTo actionWithDuration:0.2 position:ccp(redShip.position.x,redShip.position.y+2)]];
}
else if ((xx>xx1)&&(yy<yy1)) {
NSLog(@"2");
// [redShip runAction:[CCMoveTo actionWithDuration:0.2 position:ccp(redShip.position.x,redShip.position.y-2)]];
newY = oldY-2;
newX = oldX;
}
else if ((xx<xx1)&&(yy>yy1)) {
newY = oldY;
newX = oldX-2;
NSLog(@"3");
// [redShip runAction:[CCMoveTo actionWithDuration:0.2 position:ccp(redShip.position.x,redShip.position.y+2)]];
}
else if ((xx<xx1)&&(yy<yy1)) {
newY = oldY;
newX = oldX-2;
NSLog(@"4");
// [redShip runAction:[CCMoveTo actionWithDuration:0.2 position:ccp(redShip.position.x,redShip.position.y-2)]];
}
// NSLog(@"redhip x:@%d y:@%d",redShip.position.x,redShip.position.y);
}
Thank u .... | 0 | [
2,
184,
20,
2631,
21394,
17,
13925,
3506,
19,
22470,
18,
135,
43,
60,
800,
3726,
3726,
589,
749,
20,
477,
14,
13925,
17,
21394,
11643,
17,
30,
85,
13925,
8759,
9,
1544,
110,
589,
2631,
14,
11643,
128,
13925,
17,
21394,
19,
14,
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... |
How to run sonar analysis even if build failed on Jenkins
===
I have a jenkins job to build my project run tests and then run sonar with sonar jenkins-plugin.
but when tests failed sonar analysis skipped. | 0 | [
2,
184,
20,
485,
433,
512,
2495,
166,
100,
1895,
1702,
27,
11420,
800,
3726,
3726,
31,
57,
21,
11420,
1205,
20,
1895,
51,
669,
485,
4894,
17,
94,
485,
433,
512,
29,
433,
512,
11420,
8,
18527,
5831,
9,
47,
76,
4894,
1702,
433,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Bluetooth HDP demo can communicate only once
===
I user the HDP demo to connect HDP Device(HEM-7081-IT),I can communicate with a health device at first time, but next time it cann't work.report a error ,the error message is "07-04 17:17:49.220: E/InputQueue-JNI(13670): channel '4191f098 com.example.bluetooth.health/com.example.bluetooth.health.BluetoothHDPActivity (client)' ~ Publisher closed input channel or an error occurred. events=0x8
"
then my phone reboots.
Somebody can help me? Thanyk you. | 0 | [
2,
705,
15808,
8590,
306,
8376,
92,
8709,
104,
382,
800,
3726,
3726,
31,
4155,
14,
8590,
306,
8376,
20,
6379,
8590,
306,
3646,
5,
9763,
8,
3318,
3980,
8,
242,
6,
15,
49,
92,
8709,
29,
21,
853,
3646,
35,
64,
85,
15,
47,
328,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Manage persistent user's data across web request
===
I'm working in a WebSocket server with user authentication. I don't really now how to store this user among request. My WebSocket connection will probably stay open for hours and sometimes it will receive 100 request per minute and sometimes just 2 per hours (it's unpredictable). The user data may be changed by another application, this is not my question but it may be relevant. I'm using spring 3 and hibernate 3.6.9.
My question is : Should I use a specific transaction management and how do I manage these user data.
I've test 2 use case :
1.
Load my user entity at log in and merge() it in each request. I have to merge it because transaction are closed after each request. Merge is not a good solution because it do not load the database entity but persist the one merged. So if the data where update somewhere else it'll revert them and not load the updated one.
2.
At log in I only store the user ID and I find() my user at each request. To avoid database request flood I've set a second level cache but according to my sql server log hibernate still run a request per find().
Here is some concrete code and configuration :
persistence.xml
<persistence-unit name="greenpacs">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="hibernate.archive.autodetection" value="class"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.show_sql" value="true"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/db"/>
<property name="hibernate.connection.user" value="root"/>
<property name="hibernate.connection.password" value="password"/>
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
</properties>
</persistence-unit>
applicationContext.xml
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceUnitName" value="greenpacs" />
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:annotation-driven transaction-manager="transactionManager" />
User entity
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class User {
@Id
@Column(name = "userId", unique = true, nullable = false)
private Integer id;
private String pwd;
@ManyToMany(fetch = FetchType.EAGER)
@JoinTable(name = "User_Role", joinColumns = { @JoinColumn(name = "user_id", referencedColumnName = "userId") }, inverseJoinColumns = { @JoinColumn(name = "role_id", referencedColumnName = "id") })
private List<Role> roles;
@OneToOne(fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name="id")
private Person person;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.user", cascade = CascadeType.ALL)
private List<Pacs> pacs;
// getter&setter
WebSocket Listener
@Component
public class UserManager implements WampMessageHandler {
UserService userService;
//Autowired setter
User user;
@Override
public void onConnected(WampConnection connection) {
//loginmethod return userId
user = userService.find(userId);
}
@Transactional
@Override
public boolean onMessage(String sessionId, int messageType, Object[] msg)
throws BadMessageFormException {
user = userService.merge(user);
//or
user = userService.find(user.getId());
...
}
My UserService just redirect to EntityManager's methods. | 0 | [
2,
4705,
15348,
4155,
22,
18,
1054,
464,
2741,
3772,
800,
3726,
3726,
31,
22,
79,
638,
19,
21,
2741,
18,
5668,
1198,
8128,
29,
4155,
27963,
9,
31,
221,
22,
38,
510,
130,
184,
20,
1718,
48,
4155,
497,
3772,
9,
51,
2741,
18,
566... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
The purpose of Lisp syntax to model AST
===
Lisp syntax represents AST as far as I know, but in high level format to allow human to easily read and modify, at the same time make it easy for the machine to process the source code as well.
For this reason, in Lisp, it is said that code is data and data is code, since code (s-epxression) is just AST, in essence. We can plug in more ASTs (which is our data, which is just lisp code) into other ASTs (lisp code) or independently to extend its functionality and manipulate it on the fly (runtime) without having to recompile the whole OS to integrate new code.In other languages, we have to recompile from to turn the human-language source code into valid AST before it is compiled into code.
*Is this the reason for Lisp syntax to be designed like it is (represent an AST but is human readable, to satisfy both human and the machine) in the first place? To enable stronger (on the fly - runtime) as well as simpler (no recompile, faster) communication between man-machine?*
I heard that the Lisp machine only has a single address space which holds all data. In operating system like Linux, the programmers only have virtual address space and pretend it to be the real physical address space and can do whatever they want. Data and code in Linux are separated regions, because effectively, data is data and data is code. In normal OS written in C (or C like language), it would be very messy if we only operate a single address space for the whole system(physical memory) and mixing data with code would be very messy.
*In Lisp Machine, since code is data and data is code, is this the reason for this to have only a single address space (without the virtual layer)? Since we have GC and no pointer, should it be safe to operate on physical memory without breaking it (since having only 1 single space is a lot less complicated)?* | 0 | [
2,
14,
2131,
16,
2093,
3401,
22649,
20,
1061,
28,
38,
800,
3726,
3726,
2093,
3401,
22649,
4719,
28,
38,
28,
463,
28,
31,
143,
15,
47,
19,
183,
662,
2595,
20,
1655,
585,
20,
2351,
1302,
17,
17579,
15,
35,
14,
205,
85,
233,
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... |
How to disable fast view option in eclipse for a plugin?
===
I want to disable the fast view in my perspective.
http://help.eclipse.org/galileo/topic/org.eclipse.platform.doc.user/images/Image211_fastview.png
I tried
configurer.setShowFastViewBars(false);
But in vain.
What should disable this bar ? | 0 | [
2,
184,
20,
1460,
579,
1512,
1418,
4255,
19,
11652,
26,
21,
10922,
108,
60,
800,
3726,
3726,
31,
259,
20,
1460,
579,
14,
1512,
1418,
19,
51,
6531,
9,
7775,
6903,
14593,
9,
3319,
6013,
870,
9,
5583,
118,
18014,
413,
111,
118,
388... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 insert two model item with one editorfor?
===
I have 2 field in my table : Name , Family . I want to insert both of these items with one editor . In asp.net webforms we insert it like this :
> sqlcommand1.parameters.addwithvalue("Field", txtName.text +
> txtFamily.text);
I do this in MVC :
> @Html.EditorFor((model => model.Name) && (model => model.Family))
Now I want to know how can I do this ? | 0 | [
2,
184,
20,
14692,
81,
1061,
9101,
29,
53,
1835,
1106,
60,
800,
3726,
3726,
31,
57,
172,
575,
19,
51,
859,
13,
45,
204,
13,
15,
190,
13,
9,
31,
259,
20,
14692,
156,
16,
158,
3755,
29,
53,
1835,
13,
9,
19,
28,
306,
9,
2328,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
detect the name of the page that the user came from
===
I am redirecting the pages to 404.php if the page is not found from IIS settings.
My problem is that I would like to detect the LINK that they were looking for.
For example:
if some one access to http://www.site.com/nosuchpage it will redirect to 404.php but using $_SERVER["HTTP_REFERER"] I am not getting url where the user came from.
Please help.
| 0 | [
2,
9092,
14,
204,
16,
14,
2478,
30,
14,
4155,
281,
37,
800,
3726,
3726,
31,
589,
302,
14706,
68,
14,
4434,
20,
13,
23397,
9,
26120,
100,
14,
2478,
25,
52,
216,
37,
595,
18,
12410,
9,
51,
1448,
25,
30,
31,
83,
101,
20,
9092,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Add Multiple Instances
===
So I have this code that detects what page the user is on and then spits out a class of "active" if necessary.
<li <?php if (stripos($_SERVER['REQUEST_URI'],'index.php') {echo 'class="active"';} ?>>
So just to clarify, this code checks if the url has index.php in it, and if it does, it spits out the "active" class. What I need to do and don't know how to is add multiple instances to this code. So instead of just detecting index.php it needs to be able to detect other pages like about.php for example.
Sorry if this comes a very simple question to most of you but I am new to PHP. | 0 | [
2,
3547,
1886,
13946,
800,
3726,
3726,
86,
31,
57,
48,
1797,
30,
9092,
18,
98,
2478,
14,
4155,
25,
27,
17,
94,
9286,
18,
70,
21,
718,
16,
13,
7,
7889,
7,
100,
2378,
9,
13,
1,
1210,
13,
1,
60,
26120,
100,
13,
5,
19992,
759,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Missing bundles in osgi framework
===
I'm trying to run the region digraph bundle of Equinox in Eclipse IDE. When I run the relevant bundle using start <bundle id> command in OSGi command prompt, I'm getting an error saying
**The bundle could not be resolved. Reason: Missing Constraint: Import-Package: org.osgi.framework.hooks.bundle; version="1.0.0"**. To find out the existing version in the framework, I tried the command **p org.osgi.framework.hooks.bundle**. The result shows all the bundles in the framework. In that list **org.osgi.framework.hooks.bundle** is not there. This is the same case for few other bundles such as
**org.osgi.framework.hooks.resolver**. Any helps about how to fix this issue??
| 0 | [
2,
2863,
10194,
18,
19,
13,
759,
2234,
6596,
800,
3726,
3726,
31,
22,
79,
749,
20,
485,
14,
632,
926,
9614,
10194,
16,
13,
9629,
251,
396,
19,
11652,
13,
3448,
9,
76,
31,
485,
14,
7480,
10194,
568,
799,
13,
1,
9930,
413,
4924,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
phonegap app doesn't work
===
I'm newbie with phonegap. I'm creating an app which gets the location of the device...I have tested with samsung galaxy tab and htc, but doesn't do anything...I try to get the speed of the device, and display it in a div in screen. This is my code:
**GEOLOCATION:**
// Phonegap loads
document.addEventListener("deviceready", onDeviceReady, false);
var watchIDgeolocation = null;
var watchIDaccelerometer = null;
// PhoneGap has loaded
function onDeviceReady() {
var options = { frequency: 1000 }; // I want obtain data each 1 s
watchIDgeolocation = navigator.geolocation.watchPosition(onSuccessGeolocation, onErrorGeolocation, options);
startWatch();
}
// Success
var onSuccessGeolocation = function(position) {
// These are functions that displays data in screen
cambioMarchas(position.coords.speed);
excesoVelocidad(position.coords.speed);
paradaProlongada(position.coords.speed);
aceleracionBrusca(position.coords.speed);
deceleracionBrusca(position.coords.speed);
accidenteDeTrafico(position.coords.speed);
// ERROR
function onErrorGeolocation(error) {
alert('code: ' + error.code + '\n' +
'message: ' + error.message + '\n');
}
I have tested in Ripple, the extension of Chrome, and it works fine, changing values of the speed, and it works fine...but with device, I don't know why not.
Why can be?
Regards, Daniel
I have read that maybe is needed to add { enableHighAccuracy: true } in var options...but I don't understand this... | 0 | [
2,
1132,
1136,
306,
4865,
1437,
22,
38,
170,
800,
3726,
3726,
31,
22,
79,
78,
5893,
29,
1132,
1136,
306,
9,
31,
22,
79,
2936,
40,
4865,
56,
3049,
14,
1474,
16,
14,
3646,
9,
9,
9,
49,
57,
7631,
29,
22981,
9358,
6523,
17,
746,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 bones and connect them between to shapes in the code(Actionscript)
===
graphics.drawCircle(20, 20, 10);
graphics.drawCircle(40, 40, 20);
so lets say i've been created two circles in the stage, now i want to create a bone object to connect the first circle to another and then try to move them in the code, because i've readed that the bones can only be created by the BONE tool in adobe flash is that true?
can you give me a little example on how to create a bone object in the code? | 0 | [
2,
184,
20,
1600,
4915,
17,
6379,
105,
128,
20,
12129,
19,
14,
1797,
5,
8645,
8741,
6,
800,
3726,
3726,
8351,
9,
43,
12404,
24195,
5,
1323,
15,
434,
15,
332,
6,
73,
8351,
9,
43,
12404,
24195,
5,
2602,
15,
1417,
15,
434,
6,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Always call method of current class
===
@interface A : NSObject
- (void) tmp;
- (void) foo;
@end
@implementation A
- (void) tmp {
[self foo];
}
- (void) foo {
NSLog(@"A");
}
@end
derived class
@interface B : A
- (void) foo;
@end
@implementation B
- (void) foo {
NSLog(@"B");
}
@end
code
B * b = [[B alloc] init];
[b tmp]; // -> writes out B
is there a way to implement A, so a call to [self foo] inside [self tmp] in class A would result in calling A:foo not B:foo
**(so the output after calling [b foo] == @"B" and after calling [b tmp] == @"A")**
smth like
@implementation A
- (void) tmp {
[ALWAYS_CALL_ON_A foo];
}
| 0 | [
2,
550,
645,
2109,
16,
866,
718,
800,
3726,
3726,
13,
1,
6280,
6413,
21,
13,
45,
13,
2172,
23793,
13,
8,
13,
5,
2625,
1340,
6,
13,
38,
2554,
73,
13,
8,
13,
5,
2625,
1340,
6,
4310,
111,
73,
13,
1,
2451,
13,
1,
8983,
413,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UnsupportedCommOperationException in parameterized junit testing
===
I've got UnsupportedCommOperationException while executing below code. Protocol and transport class works good, because the same basic junit tests works, but not parametrized. Transport uses rxtxserial to connect with com port. The connection works properly in basic junit tests. Now I've got gnu/io/UnsupportedCommOperationException at line:
trans = new TransportCOM();
Does anyone know the solution to this problem? This is the code of parametrized test:
@RunWith(Parameterized.class)
public class ParametrTest {
private int i;
Convert conv;
Transport trans;
Protocol protoc;
Image img = null;
private Properties props;
public ParametrTest(int i) {
this.i = i;
props = new Properties();
trans = new Transport();
protoc = new Protocol(trans);
protoc.open();
}
@Parameters
public static Collection data() {
Object[][] data = new Object[][] {{1},{2},{3}};
return Arrays.asList(data);
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
protoc.close();
}
@Test
public void pt01cmdGetString() {
byte[] response = {(byte) 0x50, (byte) 0x00};
byte[] command = new byte[]{(byte) 0x21, (byte) 0x01, (byte) 0x01};
protoc.cmdGetString(command, response);
}
} | 0 | [
2,
367,
24909,
960,
79,
11377,
10066,
872,
19,
18906,
1333,
7446,
242,
4431,
800,
3726,
3726,
31,
22,
195,
330,
367,
24909,
960,
79,
11377,
10066,
872,
133,
25836,
1021,
1797,
9,
8494,
17,
1739,
718,
693,
254,
15,
185,
14,
205,
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... |
Array of images into table- javascript
===
I am trying to create a table of 6 images, 2 rows and 3 columns large. I have created an array for all of them in the head of the program. Should it be in the body?
The images within the table will later need to be clickable, directing to the same page (ie. google.com). I don't know how to put the images individually into the table that I have created.
`<head><script>var img=new Array(6);
img[0]=new (400,200)
img[0].src"image1.jpg"</script</head>`
and so on for all the rest of the images
`<body>
<table border ="0">
<tr>
<td>document.write(img[0]) </td>
</tr>
</table>
</body>` and so on for the rest of the images | 0 | [
2,
7718,
16,
3502,
77,
859,
8,
8247,
8741,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
859,
16,
400,
3502,
15,
172,
11295,
17,
203,
7498,
370,
9,
31,
57,
679,
40,
7718,
26,
65,
16,
105,
19,
14,
157,
16,
14,
625,
9,
378,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cassandra: Column Family vs Super Column Family
===
I have a requirement where i need my database to store the following data:
- For each build, store the results of 3 performance runs. The result includes tps and latency.
Reading up on cassandra data model, this directly maps to a super column family of the following format:
BenchmarkSuperColumnFamily= {
build_1: {
Run1: {1000K, 0.5ms}
Run2: {1000K, 0.5ms}
Run3: {1000K, 0.5ms}
}
build_2: {
Run1: {1000K, 0.5ms}
Run2: {1000K, 0.5ms}
Run3: {1000K, 0.5ms}
}
...
}
But, i read in the following [answer][1] that the use of Super Column family is discouraged. I wanted to know if there is a better way of creating a model for my requirement.
PS, I borrowed the JSONish notation from the following [article][2]
[1]: http://stackoverflow.com/questions/7440705/standard-column-family-vs-super-column-family
[2]: http://arin.me/blog/wtf-is-a-supercolumn-cassandra-data-model | 0 | [
2,
17825,
45,
4698,
190,
4611,
1026,
4698,
190,
800,
3726,
3726,
31,
57,
21,
8981,
113,
31,
376,
51,
6018,
20,
1718,
14,
249,
1054,
45,
13,
8,
26,
206,
1895,
15,
1718,
14,
1736,
16,
203,
956,
1461,
9,
14,
829,
1103,
13,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.