unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Best Software for Document Database
===
I want to document my database in below subject :
1. Description of each table
2. Description of each column table (Consideration Column Type, Default value, Formula if is Calculate field, ...)
3. Relate between tables and business
4. Description of tables relations
5. How Analyzed each table
6. Description tables triggers if exists
7. Description all stored procedure and view that use each table
8. Description of redundancy column and cause of exists.
9. Description Indexes and purpose of each index (Consideration Uniqe, Cluster, Include column, Filter conditions, ...)
10. Description each view and relate this view by business and where this view use in interface
11. Description jobs of this database
12. Description of setting options of this database
13. Description of backup database method.
14. Description tables statistics
15. Description why use specify method for solution (If exists multi method for a stored procedure or view)
...
What's best software for document database.
| 0 | [
2,
246,
2306,
26,
4492,
6018,
800,
3726,
3726,
31,
259,
20,
4492,
51,
6018,
19,
1021,
1550,
13,
45,
137,
9,
5318,
16,
206,
859,
172,
9,
5318,
16,
206,
4698,
859,
13,
5,
23275,
857,
4698,
1001,
15,
12838,
1923,
15,
3729,
100,
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 can I perform different actions for different template parameters in a template class?
===
If I want to make a template class, and depending on the typeid of the template parameter perform different actions, then how do I code this?
For instance, I have the following template class, in which I want to initialize the member field data depending on whether it is an int or a string.
#include <string>
template <class T>
class A
{
private:
T data;
public:
A();
};
// Implementation of constructor
template <class T>
A<T>::A()
{
if (typeid(T) == typeid(int))
{
data = 1;
}
else if (typeid(T) == typeid(std::string))
{
data = "one";
}
else
{
throw runtime_error("Choose type int or string");
}
}
This code would not compile however, with the following main file.
#include "stdafx.h"
#include "A.h"
#include <string>
int _tmain(int argc, _TCHAR* argv[])
{
A<int> one;
return 0;
}
The error is: error C2440: '=' : cannot convert from 'const char [2]' to 'int', which means the code is actually checking the else-if statement for an int, even though it will never be able to reach that part of the code.
Next, following this example (<http://stackoverflow.com/questions/11021267/perform-different-methods-based-on-template-variable-type>), I tried the following A.h file, but I got several linker errors mentioning that A<int>(void) is already defined in A.obj.
#include <string>
template <class T>
class A
{
private:
T data;
public:
A();
~A();
};
// Implementation of constructor
template <>
A<int>::A()
{
data = 1;
}
template <>
A<std::string>::A()
{
data = "one";
}
Does anybody know how to get this code up and running? I also realize that using such an if-else statement in a template class might remove the power from a template. Is there a better way to code this?
| 0 | [
2,
184,
92,
31,
2985,
421,
3078,
26,
421,
22894,
12905,
19,
21,
22894,
718,
60,
800,
3726,
3726,
100,
31,
259,
20,
233,
21,
22894,
718,
15,
17,
4758,
27,
14,
1001,
1340,
16,
14,
22894,
18906,
2985,
421,
3078,
15,
94,
184,
107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get Image upload file type in Java
===
After uploading a file it gets stored as a .tmp file in a temp directory.
How can one get the actual file type of the file that was uploaded? I need to know if it's a bmp, jpeg, png, etc. from server side.
**Note:** I'm also using Struts 2 version 2.1.8.1 | 0 | [
2,
164,
1961,
71,
8294,
3893,
1001,
19,
8247,
800,
3726,
3726,
75,
71,
16866,
21,
3893,
32,
3049,
8214,
28,
21,
13,
9,
38,
2554,
3893,
19,
21,
13,
9577,
16755,
9,
184,
92,
53,
164,
14,
3463,
3893,
1001,
16,
14,
3893,
30,
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... |
What is the name of the effect used in "Latte Art - iPhone app"? And how can be done for iphone application?
===
First of all i will give the application video [link][1].
What are the name of effects used in this application? How can i do this effects in iPhone application?
Thanks for your answer.
[1]: http://www.youtube.com/watch?v=GK94HSM2AD8 | 0 | [
2,
98,
25,
14,
204,
16,
14,
1590,
147,
19,
13,
7,
531,
4676,
415,
13,
8,
21024,
4865,
7,
60,
17,
184,
92,
44,
677,
26,
21024,
3010,
60,
800,
3726,
3726,
64,
16,
65,
31,
129,
590,
14,
3010,
763,
636,
6258,
500,
2558,
165,
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... |
Update multiple MySQL rows with one PHP submit button
===
I am having the hardest time figuring out something that I think should be simple. I need to update multiple rows in my database with one submit button. I have it working with a submit for each row now, but I need to combine it. Here's what I'm trying. Where have I gone wrong? (I've been going off of multiple tutorials I found online and I think I have things all mixed up).
Here's the form:
<?php foreach ($teams as $team):
$id[]=$team['id'];?>
<form action="?update" method="post">
<div class="team-box">
<h2><?php echo $team['name'] ?></h2>
<label for="name">Name:</label>
<input type="text" name="name" value="<?php echo $team['name'] ?>" />
<label for="name">Match Wins:</label>
<input type="text" name="mwins" value="<?php echo $team['mwins'] ?>" />
<label for="name">Match Losses:</label>
<input type="text" name="mlosses" value="<?php echo $team['mlosses'] ?>" />
<label for="name">Match Ties:</label>
<input type="text" name="mties" value="<?php echo $team['mties'] ?>" />
<label for="name">Game Wins:</label>
<input type="text" name="gwins" value="<?php echo $team['gwins'] ?>" />
<label for="name">Game Losses:</label>
<input type="text" name="glosses" value="<?php echo $team['glosses'] ?>" />
<input type="hidden" name="id" value="<?php echo $team['id'] ?>" />
</div>
<?php endforeach; ?>
<div><input type="submit" value="Update" /></div> </form>
Here's the PHP to handle the UPDATE:
try
{
foreach($_POST['id'] as $id) {
$sql = 'UPDATE teams SET
name = "' . $_POST['name'.$id] . '",
mwins = "' . $_POST['mwins'.$id] . '",
mlosses = "' . $_POST['mlosses'.$id] . '",
mties = "' . $_POST['mties'.$id] . '",
gwins = "' . $_POST['gwins'.$id] . '",
glosses = "' . $_POST['glosses'.$id] . '"
WHERE id = "' . $_POST['id'.$id] . '"';
$pdo->exec($sql);
}
}
catch (PDOException $e)
{
$error = 'Error adding submitted team: ' . $e->getMessage();
include 'error.html.php';
exit();
}
header('Location: .');
exit();
Thanks in advance! | 0 | [
2,
11100,
1886,
51,
18,
22402,
11295,
29,
53,
13,
26120,
12298,
5167,
800,
3726,
3726,
31,
589,
452,
14,
20766,
85,
25379,
70,
301,
30,
31,
277,
378,
44,
1935,
9,
31,
376,
20,
11100,
1886,
11295,
19,
51,
6018,
29,
53,
12298,
516... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
"No suitable applications were found" when trying to submit update to the app store
===
I looked through the other questions for this, but they didn't answer my question. I'm trying to submit an update for my application, so in the iTunes Connect I clicked add a version and updated the version to 1.01. I then went into the info.plist and updated the bundle version to 1.01. I get the above error though when I try to submit it to the app store. In my Manage applications it says version 1.01 prepare for upload. | 0 | [
2,
13,
7,
251,
6445,
3767,
46,
216,
7,
76,
749,
20,
12298,
11100,
20,
14,
4865,
1718,
800,
3726,
3726,
31,
292,
120,
14,
89,
2346,
26,
48,
15,
47,
59,
223,
22,
38,
1623,
51,
1301,
9,
31,
22,
79,
749,
20,
12298,
40,
11100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Facebook iOS integration - authenticate with custom dialog
===
Is there a way to integrate login with Facebook in an app with custom login dialog instead of using what Facebook SDK provides? | 1 | [
2,
9090,
13,
7760,
8078,
13,
8,
14351,
1373,
29,
5816,
28223,
800,
3726,
3726,
25,
80,
21,
161,
20,
18399,
6738,
108,
29,
9090,
19,
40,
4865,
29,
5816,
6738,
108,
28223,
700,
16,
568,
98,
9090,
13,
18,
43,
197,
1927,
60,
3,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Background Image doesn't show on Windows 7 Browsers
===
I've developed a really basic site for a friend of the family. It's very nearly ready to go bar one small issue on Windows 7 browsers.
I'm not very experienced designing for the Windows 7 platform and have struck a blank. I've also not got my own Windows 7 machine and have to check at work, making it tricky to debug.
Here's the URL-
pipecoproducts.com
The issue is with the background images, they show on all other platforms I test, but not Windows 7. The image was created in photoshop adding a white wash over it to let the content show over the top. It been saved as a png file.
Here's the CSS used to bring up the background-image, but I don't see why Windows 7 browsers don't like it-
#main {
background-image:url("/img/backgrounds/pipeco.png");
background-repeat:no-repeat;
}
Does anyone have any way of resolving this?
Thanks in advance.
Nick | 0 | [
2,
2395,
1961,
1437,
22,
38,
298,
27,
1936,
453,
16495,
18,
800,
3726,
3726,
31,
22,
195,
885,
21,
510,
2125,
689,
26,
21,
860,
16,
14,
190,
9,
32,
22,
18,
253,
1212,
1451,
20,
162,
748,
53,
284,
1513,
27,
1936,
453,
16495,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
issues with laggy c# code in xna game studio
===
My code seems to compile okay, but when I try to run it, it hangs very badly.
I've been following along with Riemers XNA tutorial [here](http://www.riemers.net/eng/Tutorials/XNA/Csharp/Series2D/Manual_texture_creation.php).
I'm pretty familiar with C#, but an expert by no means. I've had no problems getting any of this to work up to this point, and there are no errors or exceptions being thrown... it just hangs up. I've read on his related forum, where users discussed having other problems, usually relating to typos or code errors, but there's nothing like this in there... everyone seems to be able to run it fine.
Is there something I've done wrong perhaps? The nested for-loop at the bottom seems a bit heavy-handed to me. screenWidth and screenHeight are 500 and 500.
BTW: this is run from the LoadContent override method, so it should only run once as far as I know.
private void GenerateTerrainContour()
{
terrainContour = new int[screenWidth];
for (int x = 0; x < screenWidth; x++)
terrainContour[x] = screenHeight / 2;
}
private void CreateForeground()
{
Color[] foregroundColors = new Color[screenWidth * screenHeight];
for (int x = 0; x < screenWidth; x++)
{
for (int y = 0; y < screenHeight; y++)
{
if (y > terrainContour[x])
foregroundColors[x + y * screenWidth] = Color.Green;
else
foregroundColors[x + y * screenWidth] = Color.Transparent;
fgTexture = new Texture2D(device, screenWidth, screenHeight, false, SurfaceFormat.Color);
fgTexture.SetData(foregroundColors);
}
}
} | 0 | [
2,
1549,
29,
13,
6828,
2687,
272,
5910,
1797,
19,
993,
325,
250,
1120,
800,
3726,
3726,
51,
1797,
2206,
20,
26561,
1705,
15,
47,
76,
31,
1131,
20,
485,
32,
15,
32,
4546,
18,
253,
5730,
9,
31,
22,
195,
74,
249,
303,
29,
13,
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... |
can one use getPackageManager in a function which doesn't have a context?
===
This question is a little bit hard to ask:
With a Timer, a method is started each 5 seconds, and inside this function I need to know what activities are actually running so I write :
public class ProcessesCheck extends TimerTask {
@Override
public void run() {
Log.w("hello", "my name is Nicolas".concat( String.valueOf( SystemClock.uptimeMillis() )));
Context.getPackageManager();
etc.....
}
}
the run method is run each 5 seconds.
But the problem is that I don't have Context, and I even can't instantiate a my_context object, in order to get the method getPackageManager.
So the line :'Context.getPackageManager();' have an error!
Does someone know how to launch getPackageManager in the method "run"?
Thanks for your help
| 0 | [
2,
92,
53,
275,
164,
8573,
1303,
22256,
19,
21,
1990,
56,
1437,
22,
38,
57,
21,
4141,
60,
800,
3726,
3726,
48,
1301,
25,
21,
265,
1142,
552,
20,
1349,
45,
29,
21,
85,
139,
15,
21,
2109,
25,
373,
206,
331,
2582,
15,
17,
572,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
image_graph primer
===
Anyone know of a good primer for Pear's image_graph libraries? I have Jesper Veggerby's sample code but I need something more detailed that gives syntax and usage rules. I am having problems generating a matrix of graphs - I either get the same data replicated on all graphs in the matrix or I only the leftmost column of graphs. | 0 | [
2,
1961,
1,
9614,
1621,
139,
800,
3726,
3726,
1276,
143,
16,
21,
254,
1621,
139,
26,
16619,
22,
18,
1961,
1,
9614,
8649,
60,
31,
57,
487,
15920,
13,
195,
11356,
779,
22,
18,
5717,
1797,
47,
31,
376,
301,
91,
6036,
30,
2352,
22... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reading database and writing into multi record Flat files
===
Hi I am doing POC/base for design on reading database and writing into flat files. I am struggling on couple of issues here but first I will tell you the output format of flat file
"FV", 1.0 File Version
"FH",.... File Header
"BH",.... Batch Header#1
.
.
"TXN type 1" Txns type with diff fields
"TXN type 1" Txns type with diff fields
.
.
"BF",.count txn Batch Footer#1
"BH",.... Batch Header#2
.
.
"TXN type 1" Txns type with diff fields
"TXN type 1" Txns type with diff fields
.
.
"BF",.count txn Batch Footer#2
.
.
.
"FF",.... File Footer, other summary
"CS",.... CheckSum has fields like total amount, etc
Please let me know how do design the input writer where I need to read the transactions from different tables, process records , figure out the summary fields and then how should I design the Item Writer which has such a complex design. Please advice. I am successfully able to read from single table and write to file but the above task looks complex. | 0 | [
2,
1876,
6018,
17,
1174,
77,
1889,
571,
1844,
6488,
800,
3726,
3726,
4148,
31,
589,
845,
13,
23093,
118,
8436,
26,
704,
27,
1876,
6018,
17,
1174,
77,
1844,
6488,
9,
31,
589,
7587,
27,
1335,
16,
1549,
235,
47,
64,
31,
129,
494,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Removing timestamp and source code information from static library built with visual c++
===
I've build a static library with visual c++ 2008. This static library must be used by a third party so I'd like to hide all function and variables names from the lib file. I read and tried all compiler options but I can't find any that solve my problem.
Besides I need to calculate a hash on the lib file but every time I compile it I got different hashes because it seems the compiler insert several timestamp and information about target machine.
Is there a way to avoid all this kind of informations in the lib (or object) files ?
Thanks in advance for all replies,
Danny | 0 | [
2,
9096,
436,
38,
10158,
17,
1267,
1797,
676,
37,
12038,
1248,
392,
29,
3458,
272,
20512,
800,
3726,
3726,
31,
22,
195,
1895,
21,
12038,
1248,
29,
3458,
272,
20512,
570,
9,
48,
12038,
1248,
491,
44,
147,
34,
21,
422,
346,
86,
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 remove custom ticket fields inherited from a global config in Trac?
===
I have a few custom ticket fields defined in a global config inherited by all our Trac environments. Now I'd like to remove a few of them only for a single environment (but without having to un-inherit the global config which sets a lot more than just the custom fields). The perhaps obvious way
[ticket-custom]
mycustomfield =
did not work. Is there any way? | 0 | [
2,
184,
20,
4681,
5816,
6133,
2861,
7179,
37,
21,
2062,
13,
14093,
2816,
19,
13,
38,
5797,
60,
800,
3726,
3726,
31,
57,
21,
310,
5816,
6133,
2861,
2811,
19,
21,
2062,
13,
14093,
2816,
7179,
34,
65,
318,
13,
38,
5797,
11246,
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... |
Selenium RC - Getting Null Pointer Exception after exceuting my test script
===
I am Using a assertTrue statement in the web app testing,even the text is present in the web its returning false ,How can i fix this ??
public void Test1() throws Exception {
Selenium selenium = new DefaultSelenium("localhost",1777,"*chrome","http://www.mortgagecalculator.org/");
selenium.start();
try {
selenium.open("/");
Thread.sleep(3000);
selenium.windowMaximize();
selenium.type("name=param[homevalue]", "400000");
selenium.type("name=param[principal]", "7888800");
selenium.select("name=param[rp]", "label=New Purchase");
selenium.type("name=param[interest_rate]", "8");
selenium.type("name=param[term]", "35");
selenium.select("name=param[start_month]", "label=May");
selenium.select("name=param[start_year]", "label=2006");
selenium.type("name=param[property_tax]", "7.5");
selenium.type("name=param[pmi]", "0.8");
selenium.click("css=input[type=\"submit\"]");
assertTrue(selenium.isTextPresent("$58,531.06"));
System.out.println("Assert Statement executed");
selenium.stop();
}
catch (Exception e) {
System.out.println("In Mortgage Calculator App exception Happened");
}
} | 0 | [
2,
23027,
14311,
16462,
13,
8,
1017,
16203,
454,
106,
5391,
75,
1396,
1105,
1982,
68,
51,
1289,
3884,
800,
3726,
3726,
31,
589,
568,
21,
10908,
13398,
3331,
19,
14,
2741,
4865,
4431,
15,
4943,
14,
1854,
25,
734,
19,
14,
2741,
82,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to print word document from java?
===
I have to print a word document from java. I could just open it. But how will I print it?
public static void main(String args[]) throws IOException {
Desktop desktop = Desktop.getDesktop();
File f = new File("C:\\Users\\asa\\Desktop\\resume.doc");
desktop.open(f);
} | 0 | [
2,
25,
32,
938,
20,
4793,
833,
4492,
37,
8247,
60,
800,
3726,
3726,
31,
57,
20,
4793,
21,
833,
4492,
37,
8247,
9,
31,
110,
114,
368,
32,
9,
47,
184,
129,
31,
4793,
32,
60,
317,
12038,
11364,
407,
5,
11130,
13,
10663,
18,
255... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
is it possible to use view instead of UI Thread?
===
I m new in android.
i have a little bit confusion in SurfaceView and View......
According to my knowledge..
Views are all drawn on the same GUI thread which is also used for all user interaction.
I want to knw is it possible to create separate thread for the handling | 0 | [
2,
25,
32,
938,
20,
275,
1418,
700,
16,
13,
5661,
9322,
60,
800,
3726,
3726,
31,
307,
78,
19,
13005,
9,
31,
57,
21,
265,
1142,
5677,
19,
1490,
4725,
17,
1418,
9,
9,
9,
9,
9,
9,
496,
20,
51,
1918,
9,
9,
4146,
50,
65,
3160... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Practical applications of data structures
===
The question [What is the most common use of the “trie” data structure?][1] made me wonder if anyone has compiled a directory of practical applications of data structures? I think every description of a data structure should begin with a list of compelling practical applications...
[1]: http://stackoverflow.com/questions/296618/what-is-the-most-common-use-of-the-trie-data-structure | 0 | [
2,
5713,
3767,
16,
1054,
3815,
800,
3726,
3726,
14,
1301,
636,
608,
25,
14,
127,
757,
275,
16,
14,
13,
1,
38,
3272,
1,
1054,
1411,
60,
500,
2558,
165,
500,
117,
55,
2666,
100,
1276,
63,
9316,
21,
16755,
16,
5713,
3767,
16,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 detect a Home Key Press from a Service class (Android)?
===
public void displayQuickSettingsDialog() {
if(quickSettingsDialog == null) {
quickSettingsDialog = new Dialog(mContext);
quickSettingsDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
Window win = quickSettingsDialog.getWindow();
WindowManager.LayoutParams lp = quickSettingsDialog.getWindow().getAttributes();
lp.token = mKptAdaptxtIME.mInputView.getWindowToken();
lp.type = WindowManager.LayoutParams.TYPE_APPLICATION_ATTACHED_DIALOG;
lp.dimAmount = 0.5f;
lp.y = lp.y + 150;
win.setAttributes(lp);
win.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
win.addFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND);
win.addFlags(WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM);
win.addFlags(WindowManager.LayoutParams.TYPE_CHANGED);
quickSettingsDialog.setContentView(R.layout.quicksettings);
quickSettingsDialog.setCanceledOnTouchOutside(true);
//listeners for dialog options
quickSettingsDialog.findViewById(R.id.quick_sett_lang).setOnClickListener(this);
quickSettingsDialog.findViewById(R.id.quick_sett_keyboard_type).setOnClickListener(this);
quickSettingsDialog.findViewById(R.id.quick_sett_sugg_control).setOnClickListener(this);
quickSettingsDialog.findViewById(R.id.quick_sett_settings).setOnClickListener(this);
}
quickSettingsDialog.show();
}
The above is my code, It displays the alret dialog and every thing works fine, after displaying the dialog, when I go to recent activities (4.0) then the dialog is not dismissed, This method I am calling from a service...In a service which call back will be called when I pressed the recent activities button? Help needed quickly...Thanks in advance androidians.. | 0 | [
2,
184,
20,
9092,
21,
213,
1246,
901,
37,
21,
365,
718,
13,
5,
290,
18524,
6,
60,
800,
3726,
3726,
317,
11364,
3042,
25865,
19831,
18,
4286,
5567,
5,
6,
13,
1,
100,
5,
25865,
19831,
18,
4286,
5567,
800,
3726,
16203,
6,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Styling the AsyncFileUpload control
===
I have been trying to format the AsyncFileUpload control for a while now and i just can´t figure out a way of how to do it. I tried some method that are efective when styling the common input type and the ASP.NET Web Forms FileUpload control, like setting opacity to 0 and hiding the browse button on top of some other element, but none of those techniques seem to be working effectively on the AsyncFileUpload. Does any one have some kind of method to apply some styling to this control? Thanks. | 0 | [
2,
23020,
14,
21,
9507,
150,
16877,
576,
8294,
569,
800,
3726,
3726,
31,
57,
74,
749,
20,
2595,
14,
21,
9507,
150,
16877,
576,
8294,
569,
26,
21,
133,
130,
17,
31,
114,
92,
13,
38,
1465,
70,
21,
161,
16,
184,
20,
107,
32,
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... |
Payment Gateway supports prepaid charging card
===
I need help to get the right orientation by which and how can i start
So this question isn't about integrating an existing payment gateway into my site. This is more of a architectural question.
I want to build my own payment gateway system to integrate it in my online shop and it must works similar to Paypal.
so each user must having one account in my payment gateway which based on prepaid charging principle (like prepaid phone cards"closes loop cards") and other account in my shop so he/she can pays through his/her credit account from the gateway
thanks for answers in advance
| 1 | [
2,
7582,
12171,
6747,
782,
19731,
14346,
2056,
800,
3726,
3726,
31,
376,
448,
20,
164,
14,
193,
10245,
34,
56,
17,
184,
92,
31,
799,
86,
48,
1301,
2532,
22,
38,
88,
24529,
40,
3149,
7582,
12171,
77,
51,
689,
9,
48,
25,
91,
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... |
Is it possible to "like" an OpenGraph Object?
===
I am having problems to link the Facebook Like buttons in my website with its OpenGraph Objects.
Since a couple of days, I have updated the metadata of my website declaring specific sites as different OG Objects. This is working fine, since
- the Facebook Debugger is accepting the URLs and recognizing them as OG Object with no errors
- the insights of my App shows me a very big increment of the Object Lifecycle from the moment these changes became live
At this point, I would have expected that every like button pressed in each of these sites would publishsomething similar to
"User1 likes a ObjectTitle on App"
but the message generated is still "User1 likes a link" or "User1 likes a page"
Is it really not possible to connect the original Facebook Like Button with an OpenGraph Object?
Do I need to create a "Built-In Like" to publish such a Story in a User's Timeline?
Do I miss something here? or is anyone having the same problem?
Thanks! I appreciate any kind of help. | 0 | [
2,
25,
32,
938,
20,
13,
7,
1403,
7,
40,
368,
9614,
3095,
60,
800,
3726,
3726,
31,
589,
452,
1716,
20,
3508,
14,
9090,
101,
12861,
19,
51,
2271,
29,
82,
368,
9614,
3916,
9,
179,
21,
1335,
16,
509,
15,
31,
57,
6372,
14,
28057,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a way to get around the inconsistent TOUCHSTART event in Android 4.0 "Ice Cream Sandwich"?
===
I've noticed that `BUTTON` elements receive `TOUCHSTART` events very inconsistently in Android 4.0. I added event listeners on a particular `BUTTON` for the `TOUCHSTART`, `MOUSEDOWN` and `CLICK` events and on all of our Ice Cream Sandwich test devices the `TOUCHSTART` event fires infrequently and inconsistently whereas the `MOUSEDOWN` and `CLICK` events fire every time.
Normally I would just rely on the other two events and be done with it, but the lead on the particular project I'm working on right now is pretty adamant about using the `TOUCHSTART` event on mobile devices.
Any thoughts on how I can get around this issue with Android? | 0 | [
2,
25,
80,
21,
161,
20,
164,
140,
14,
22380,
1723,
13680,
807,
19,
13005,
268,
9,
387,
13,
7,
3568,
5262,
11484,
7,
60,
800,
3726,
3726,
31,
22,
195,
2711,
30,
13,
1,
811,
444,
1,
2065,
2588,
13,
1,
15725,
13680,
1,
963,
253... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Magento reset product list view all
===
Magento Version 1.7.0.0
right i'm trying to reset the product list count to the default value when customer changes category.
e.g.
Customer visits - Category A
Default products shown - 16
Selects View All
Views all products
Navigates to - Category B
Shows All not 16.
I know there is a way to change this in toolbar.php but this is modifying a core file that i'm trying to avoid. Any way i can do this without editing a core file?
cheers
Andy. | 0 | [
2,
4723,
17050,
23422,
2374,
968,
1418,
65,
800,
3726,
3726,
4723,
17050,
615,
137,
9,
465,
9,
387,
9,
387,
193,
31,
22,
79,
749,
20,
23422,
14,
2374,
968,
2468,
20,
14,
12838,
1923,
76,
7705,
1693,
3230,
9,
13,
62,
9,
263,
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... |
Jersey multipart streaming without disk buffering
===
I'm trying to stream (large) files over HTTP into a database. I'm using Tomcat and Jersey as Webframework. I noticed, that if I POST a file to my resource the file is first buffered on disk (in temp\MIME*.tmp} before it is handled in my doPOST method.
This is really an undesired behaviour since it doubles disk I/O and also leads to a somewhat bad UX, because if the browser is already done with uploading the user needs to wait a few minutes (depending on file size of course) until he gets the HTTP response.
I know that it's probably not the best implementation of a large file upload (since you don't even have any resume capabilities) but so are the requirements. :/
So my questions is, if there is any way to disable (disk) buffering for MULTIPART POSTs. Mem buffering is obviously too expensive, but I don't really see the need for disk buffering anyway? (Explain please) How do large sites like YouTube handle this situation? Or is there at least a chance to give the user immediate feedback if the file is sent? (Should be bad, since there could be still something like SQLException) | 0 | [
2,
2134,
1889,
3091,
11920,
366,
8582,
17497,
68,
800,
3726,
3726,
31,
22,
79,
749,
20,
3766,
13,
5,
11312,
6,
6488,
84,
7775,
77,
21,
6018,
9,
31,
22,
79,
568,
2067,
5782,
17,
2134,
28,
2741,
8361,
3783,
9,
31,
2711,
15,
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... |
FireFox not displaying CSS/Scripts/Images (anything from subfolders really) basic HTML site, IIS7
===
Locally (outside IIS): Everything works fine across IE/FireFox/Chrome
IIS: Everything works fine except in FireFox. It doesn't want to load any of my subfolder content.
I've Googled the problem to death, thus...
1. Permissions are set adequately, (after all, it works in other browsers fine.)
2. The paths to the file are fine also. (Again, just FireFox.)
3. .css MIME Type in IIS is "text/css".
4. Static Content is checked under IIS features.
5. According to Notepad++, (Which is what the site was made with.), it is encoded in ANSI. (Tried others, no change.)
In FireBug > Net > All: It shows all but the page and a Google hosted script as "loading". In other words, anything local fails to load. (Which are all stored in subfolders in the root.)
DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
< head>
<title>My Website</title>
<meta charset="ISO-8859-1" http-equiv="X-UA-Compatible" value="IE=9" />
<link rel="stylesheet" type="text/css" href="styles/clean.css" />
<link rel="stylesheet" type="text/css" href="styles/style.css" />
<noscript><link rel="stylesheet" type="text/css" href="styles/noscript.css" /></noscript>
<script type="text/javascript" src="scripts/jquery-1.7.1.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript" src="scripts/script.js"></script>
<!--[if lt IE 10]>
<script type="text/javascript" src="scripts/pie.js"></script>
<script type="text/javascript" src="scripts/html5shiv.js"></script>
<script type="text/javascript" src="scripts/selectivizr.js"></script>
<![endif]-->
Please, anything you can think of, I'd appreciate it. Thanks. | 0 | [
2,
535,
18219,
52,
17418,
272,
18,
18,
118,
8741,
18,
118,
22039,
18,
13,
5,
20938,
37,
972,
8814,
445,
510,
6,
2125,
13,
15895,
689,
15,
595,
18,
465,
800,
3726,
3726,
6680,
13,
5,
1320,
1416,
595,
18,
6,
45,
796,
693,
1123,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
BASH, cat Buffer
===
cat report.txt | sed 's/<\/li>/<\/li> \n/g' > report.txt
This obviously results in an empty file.
Is there a mechanism that allows you to store the data before processing it or store the output until the command has finished executing and then write the file?
[http://en.wikipedia.org/wiki/Pipeline_(Unix)#Implementation][1]:
"...a receiving program may only be able to accept 100 bytes per second, but no data is lost. Instead, the output of the sending program is held in a queue. When the receiving program is ready to read data, the operating system sends its data from the queue, then removes that data from the queue."
Sounds like there should be a simple trick to load this into a queue instead of writing it immediately to file, then unload it after the command has finished?
Thanks much!
[1]: http://en.wikipedia.org/wiki/Pipeline_%28Unix%29#Implementation | 0 | [
2,
13158,
15,
2008,
17497,
800,
3726,
3726,
2008,
1330,
9,
38,
396,
38,
13,
1,
13924,
13,
22,
18,
118,
1,
118,
1210,
1,
118,
1,
118,
1210,
1,
13,
1,
103,
118,
263,
22,
13,
1,
1330,
9,
38,
396,
38,
48,
4409,
1736,
19,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Insert new lines after a line into the last paragraph which in a file using batch file
===
I want to insert a line to the end of paragraph in file using a batch
script. In my file the line last of paragraph is not clear. It is
variable which has form "LoadModule name moduleName ".
new line: "LoadModule new_module module/mod_newmod.so"
my file input.conf
abc def xyz
LoadModule foo_module libexec/mod_fooa.so
LoadModule proxy_module libexec/mod_proxy.so
LoadModule lmn_module libexec/mod_abc.so
LoadModule xyz_module libexec/mod_def.so
ExtendedStatus controls whether Apache will generate "full" status
and result:
abc def xyz
LoadModule foo_module libexec/mod_fooa.so
LoadModule proxy_module libexec/mod_proxy.so
LoadModule lmn_module libexec/mod_abc.so
LoadModule xyz_module libexec/mod_def.so
LoadModule new_module module/mod_newmod.so
ExtendedStatus controls whether Apache will generate "full" status
A new line "LoadModule new_module module/mod_newmod.so" get inserted at last of LoadModule paragraph.
Please suggest a solution for this. Thank so much.
| 0 | [
2,
14692,
78,
1560,
75,
21,
293,
77,
14,
236,
20599,
56,
19,
21,
3893,
568,
13064,
3893,
800,
3726,
3726,
31,
259,
20,
14692,
21,
293,
20,
14,
241,
16,
20599,
19,
3893,
568,
21,
13064,
3884,
9,
19,
51,
3893,
14,
293,
236,
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... |
Ordered item selection in a ListView on Android
===
I'm not sure if this can be implemented, but I'll just put a question here and hope somebody can help.
I have a `ListView` in a `ListFragment`. I want to create some code such that when the user long-clicks a list item, an `ActionMode` is created. Then the user clicks another item and all items in within are selected for copying.
Is that possible?
If so, thanks in advance!
I would try to come up with other designs if that is impossible. | 0 | [
2,
1905,
9101,
3155,
19,
21,
968,
4725,
27,
13005,
800,
3726,
3726,
31,
22,
79,
52,
562,
100,
48,
92,
44,
6807,
15,
47,
31,
22,
211,
114,
442,
21,
1301,
235,
17,
1376,
8861,
92,
448,
9,
31,
57,
21,
13,
1,
5739,
4725,
1,
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... |
reading only first node from xml file with php
===
I am trying to read the xml data in to php. I managed to read all "title" data with this scipt. Problem is that I only need first "title" element from xml! In moment I get unfortunatly all of them.
How to read only first "title" node?
<?php
$filename = $_SERVER['DOCUMENT_ROOT'].'images/albums/album.xml';
if (file_exists($filename)) {
$doc = new DOMDocument();
$doc->load($filename);
$destinations = $doc->getElementsByTagName("title");
foreach ($destinations as $destination) {
foreach($destination->childNodes as $child) {
if ($child->nodeType == XML_CDATA_SECTION_NODE) {
echo ('<br/><strong>Värskemad pildid:</strong><br/><a href="/images/albums/index.html" src=""/>' . $child->textContent . '</a>');
}
}
}
} else {
die(nothing);
}
?>
My xml looks something like this:
<album version="v6">
<title><![CDATA[2012-06-06 NK maakondlik laager]]></title>
<slide>
<title><![CDATA[2012 NK maakondlik laager 003]]></title>
<description><![CDATA[text here]]></description>
<date>05.06.2012 19:12</date>
<image width="1069" height="813">slides/2012 NK maakondlik laager 003.JPG</image>
<thumb width="240" height="180">thumbs/2012 NK maakondlik laager 003.JPG</thumb>
<info filesize="3.84 MB" date="05.06.2012 19:12" resolution="3456 x 2592 px" flash="Flash did not fire, auto" focus="5.0mm"
exposure="1/320s" aperture="3.4" distance="" metering="Center weighted average"
cameramake="Panasonic" cameramodel="DMC-TZ5" camera="DMC-TZ5" sensor="OneChipColorArea" iso="100"/>
</slide>
<slide>
<title><![CDATA[2012 NK maakondlik laager 004]]></title>
<description><![CDATA[text here]]></description>
<date>05.06.2012 19:22</date>
<image width="1069" height="813">slides/2012 NK maakondlik laager 004.JPG</image>
<thumb width="240" height="180">thumbs/2012 NK maakondlik laager 004.JPG</thumb>
<info filesize="4.07 MB" date="05.06.2012 19:22" resolution="3456 x 2592 px" flash="Flash did not fire, auto" focus="5.0mm"
exposure="1/250s" aperture="3.4" distance="" metering="Center weighted average"
cameramake="Panasonic" cameramodel="DMC-TZ5" camera="DMC-TZ5" sensor="OneChipColorArea" iso="100"/>
</slide>
| 1 | [
2,
1876,
104,
64,
15421,
37,
23504,
3893,
29,
13,
26120,
800,
3726,
3726,
31,
589,
749,
20,
1302,
14,
23504,
1054,
19,
20,
13,
26120,
9,
31,
1471,
20,
1302,
65,
13,
7,
22235,
7,
1054,
29,
48,
9569,
4417,
9,
1448,
25,
30,
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... |
Trying to disable a device in the windows environment
===
By coming back home this WE I went to a problem concerning a steam video game : I got regular lags, and by searching the web I found that this came from some control devices, as my WE keyboard.
The solution is to deactivate some HID devices in the device manager (human interface devices section) with the standard right-click => disable operation. So I started to code a small utility to disable these devices while launching the game, and re-enable them after exiting.
Using SetupDI API functions, I managed to isolate the devices I wanted to disable, but when I disable them by applying the DICS_DISABLE operation, instead of acting as if I disabled them with the right mouse button method, the devices become "unkown devices" in the device manager. I have to update the devices's drivers to get them back in the device manager. I also tried the DICS_STOP operation, but with this one the devices simply disappear from the DM...
Is there something I am missing in this operation ?
Here is my prototype code :
(console application, x64) => the system is x64, and if my application is 32 bits, all device operations simply fail.
#include <stdio.h>
#include <Windows.h>
#include <setupapi.h>
#include <devguid.h>
#include <regstr.h>
#pragma comment (lib, "Newdev.lib")
#pragma comment (lib, "Setupapi.lib")
int main(int argc, void * argv[])
{
HDEVINFO hDevInfo;
SP_DEVINFO_DATA DeviceInfoData;
DWORD i;
SP_PROPCHANGE_PARAMS params; // params to set in order to enable/disable the device
// Create a HDEVINFO with all present devices.
hDevInfo = SetupDiGetClassDevs(NULL,
0, // Enumerator
0,
DIGCF_PRESENT | DIGCF_ALLCLASSES );
if (hDevInfo == INVALID_HANDLE_VALUE)
{
// Insert error handling here.
return 1;
}
// Enumerate through all devices in Set.
DeviceInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
for (i=0;SetupDiEnumDeviceInfo(hDevInfo,i,
&DeviceInfoData);i++)
{
DWORD DataT;
LPTSTR buffer = NULL;
LPTSTR servBuffer = NULL;
DWORD buffersize = 0;
DWORD servBufferSize = 0;
//
// Call function with null to begin with,
// then use the returned buffer size (doubled)
// to Alloc the buffer. Keep calling until
// success or an unknown failure.
//
// Double the returned buffersize to correct
// for underlying legacy CM functions that
// return an incorrect buffersize value on
// DBCS/MBCS systems.
//
while (!SetupDiGetDeviceRegistryProperty(
hDevInfo,
&DeviceInfoData,
SPDRP_DEVICEDESC,
&DataT,
(PBYTE)buffer,
buffersize,
&buffersize))
{
if (GetLastError() ==
ERROR_INSUFFICIENT_BUFFER)
{
// Change the buffer size.
if (buffer) LocalFree(buffer);
// Double the size to avoid problems on
// W2k MBCS systems per KB 888609.
buffer = (LPTSTR)LocalAlloc(LPTR,buffersize * 2);
}
else
{
// Insert error handling here.
break;
}
}
while (!SetupDiGetDeviceRegistryProperty(
hDevInfo,
&DeviceInfoData,
SPDRP_SERVICE,
&DataT,
(PBYTE)servBuffer,
servBufferSize,
&servBufferSize))
{
if (GetLastError() ==
ERROR_INSUFFICIENT_BUFFER)
{
// Change the buffer size.
if (servBuffer) LocalFree(servBuffer);
// Double the size to avoid problems on
// W2k MBCS systems per KB 888609.
servBuffer = (LPTSTR)LocalAlloc(LPTR,servBufferSize * 2);
}
else
{
// Insert error handling here.
break;
}
}
if (strstr((char *)buffer, "(HID)") && NULL == servBuffer)
{
printf("New device found : %s\n", buffer);
printf("disabling...\n");
// init the structure
params.ClassInstallHeader.cbSize = sizeof(SP_CLASSINSTALL_HEADER);
params.ClassInstallHeader.InstallFunction = DIF_PROPERTYCHANGE;
params.HwProfile = 0;
params.Scope = DICS_FLAG_CONFIGSPECIFIC;
params.StateChange = DICS_DISABLE;
// prepare operation
if (!SetupDiSetClassInstallParams(hDevInfo, &DeviceInfoData, ¶ms.ClassInstallHeader, sizeof(params)))
{
printf("Error while preparing params !\n");
break;
}
// launch op
if (!SetupDiCallClassInstaller(DICS_DISABLE, hDevInfo, &DeviceInfoData))
{
printf("Error while calling OP ! Return code is %x\n", GetLastError());
continue;
}
printf("done.\n\n");
}
if (buffer) LocalFree(buffer);
}
if ( GetLastError()!=NO_ERROR &&
GetLastError()!=ERROR_NO_MORE_ITEMS )
{
// Insert error handling here.
return 1;
}
// Cleanup
SetupDiDestroyDeviceInfoList(hDevInfo);
return 0;
}
Thanks for your help :) | 0 | [
2,
749,
20,
1460,
579,
21,
3646,
19,
14,
1936,
2307,
800,
3726,
3726,
34,
880,
97,
213,
48,
95,
31,
296,
20,
21,
1448,
6477,
21,
3960,
763,
250,
13,
45,
31,
330,
1290,
13,
6828,
18,
15,
17,
34,
5792,
14,
2741,
31,
216,
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... |
How to create a default association in an ActiveRecord model?
===
In Rails 3.2 I'm trying to set a default `OdontologicUnity` instace when a `User` is created.
User:
require "odontological_unity"
class User < ActiveRecord::Base
attr_accessible :odontologic_unity, ...
...
belongs_to :odontologic_unity
after_create :associate_default_unity
private
def associate_default_unity
ou = OdontologicUnity::DEFAULT
ou.save!
self.update_attribute :odontologic_unity, ou
end
end
OdontologicUnity:
# encoding: UTF-8
class OdontologicUnity < ActiveRecord::Base
...
DEFAULT = OdontologicUnity.new(
name: 'Actualiza el nombre',
address: 'Actualiza la dirección',
nit: 'Actualiza el NIT',
mission: "Actualiza la misión",
vision: "Actualiza la visión"
)
end
The code works without raising exceptions but when I see to my DB I got this (`odontological_unity_id: nil`):
`User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", 9]]
=> #<User id: 9, email: "user2@example.com", password_digest: "$2a$10$BPDmM6stW0sO6tQbwwJCxuWO4hvWIAeSzogEl2GGiqmo...", remember_token: "ltU5RBcifDsr9uPIci9z_A", names: "Example User", lastnames: "Some Lastnames", identity_document_number: "1515", odontological_unity_id: nil, created_at: "2012-06-24 15:00:17", updated_at: "2012-06-24 15:02:05"> `
The weird thing about it is the `OdontologicUnity` record is actually created, but doesn't get associated with the user. | 0 | [
2,
184,
20,
1600,
21,
12838,
607,
19,
40,
1348,
14953,
1061,
60,
800,
3726,
3726,
19,
2240,
18,
203,
9,
135,
31,
22,
79,
749,
20,
309,
21,
12838,
13,
1,
15809,
20369,
1020,
856,
1,
19,
384,
6174,
76,
21,
13,
1,
16704,
1,
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... |
wordpress exclude directory
===
I have a simple problem but that i not found a solution online: i need to exclude fisical directory from a test webserver on my pc called "stopdebiti2012b" that contain wordpress core,in the wp-content/themes/ i have the theme "stopdebiti" and i have created a directory named "blog/" i need to exclude that from mod_rewrite but nothing is happened.
I have used all of common solution explains on internet..but nothing it happened?
How can i solve this?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /stopdebiti2012b/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /stopdebiti2012b/index.php [L]
</IfModule>
# END WordPress
thanks! | 0 | [
2,
833,
5890,
21077,
16755,
800,
3726,
3726,
31,
57,
21,
1935,
1448,
47,
30,
31,
52,
216,
21,
4295,
2087,
45,
31,
376,
20,
21077,
6028,
18,
4272,
16755,
37,
21,
1289,
2741,
10321,
106,
27,
51,
5168,
227,
13,
7,
7318,
546,
3326,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 strand executorservice
===
My program flow is like this:<br>
I need to sequential processing per user's request<br>
In C++ I will use boost asio and one strand per user but I had to code in java<br>
So I intend to create one SingleThreadExecutor per user and post user's task into it's executor <br>
But if user num get big I think this approach will slow because of the big number of thread<br>
So I looking for alternative solution, the other approach in my head is one queue per user and some how tosh that queue to a fixed thread pool, need advise here, thanks. | 0 | [
2,
184,
20,
11785,
1396,
17194,
2153,
11449,
800,
3726,
3726,
51,
625,
3312,
25,
101,
48,
45,
1,
5145,
1,
31,
376,
20,
1353,
5495,
10107,
5511,
416,
4155,
22,
18,
3772,
1,
5145,
1,
19,
272,
20512,
31,
129,
275,
10419,
28,
1963,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I use javascript and jquery to change a text value when next and previous buttons are pressed?
===
I have the following HTML with a value of "1-99" visible:
<ul class="controls-buttons question-controls">
<li>
<a href="#" title="Previous" id="orderPrevious><img src="/Images/control-double-180.png"></a>
</li>
<li>
<a id="orderRange">1 - 99</a>
</li>
<li>
<a href="#" title="Next" id="orderNext"><img src="/Images/control-double.png"></a>
</li>
</ul>
Is there a way that I can have the orderRange change so it changes like this when the previous and next links are clicked? Ideally I would like some way that doesn't mean I have to hardcode a lot of if and else statements.
1-99 > 100-199
1-99 < 100-199 > 200-299
100-199 < 200-299 > 300-399
200-299 < 300-399
etc ..
Once changed I would like to store the value using local storage like below:
var store = window.localStorage;
store.setItem('Range', xxx)
I hope someone can help me. | 0 | [
2,
184,
92,
31,
275,
8247,
8741,
17,
487,
8190,
93,
20,
753,
21,
1854,
1923,
76,
328,
17,
1158,
12861,
50,
2931,
60,
800,
3726,
3726,
31,
57,
14,
249,
13,
15895,
29,
21,
1923,
16,
13,
7,
165,
8,
3483,
7,
4560,
45,
13,
1,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Format web links in a UITextView
===
I know that I can put a link in a UITextView such as "http://stackoverflow.com/" and have it auto detected. I want to know if there is a way to set the UITextView so that the link appears as "Visit StackOverflow" in the UITextView, or if I have to use a UIWebView to do that. I'm fairly sure that I have to use a UIWebView, but I want to make sure. | 0 | [
2,
2595,
2741,
6271,
19,
21,
13,
5661,
11969,
4725,
800,
3726,
3726,
31,
143,
30,
31,
92,
442,
21,
3508,
19,
21,
13,
5661,
11969,
4725,
145,
28,
13,
7,
21127,
6903,
25325,
2549,
9990,
9,
960,
118,
7,
17,
57,
32,
3108,
11968,
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... |
Castle dynamic proxy don't write custom attributes to proxy
===
I have simple unit test to reproduce situation:
[Test]
public void Castle_Writes_Attribute_To_Proxy()
{
var generator = new ProxyGenerator();
var customItem = generator.CreateClassProxy<MyType>();
var type = customItem.GetType();
var prop = type.GetProperty("SomeProp");
var attrs = prop.GetCustomAttributes(typeof(DescriptionAttribute), true);
Assert.That(attrs.Length, Is.Not.EqualTo(0));
}
public class MyType
{
[Description("some description here")]
public string SomeProp { get; set; }
}
Test fails because Castle dynamic proxy don't writes custom attributes,
It is possible to write parent attributes to generated proxies? | 0 | [
2,
1339,
7782,
27188,
221,
22,
38,
2757,
5816,
13422,
20,
27188,
800,
3726,
3726,
31,
57,
1935,
1237,
1289,
20,
21509,
1858,
45,
636,
10543,
500,
317,
11364,
1339,
1,
23716,
18,
1,
721,
14755,
1,
262,
1,
4899,
9229,
5,
6,
13,
1,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sockets on Ubuntu (operation not permitted)
===
I'm newbee and just making my first steps in c++ under linux.
So I have some task about sockets. I'm following guides, especially [this][1] one. And code examples are not working. I started with this:
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#define SOCK_PATH "echo_socket"
int main(void)
{
int s, s2, t, len;
struct sockaddr_un local, remote;
char str[100];
if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
perror("socket");
exit(1);
}
local.sun_family = AF_UNIX;
strcpy(local.sun_path, SOCK_PATH);
unlink(local.sun_path);
len = strlen(local.sun_path) + sizeof(local.sun_family);
if (bind(s, (struct sockaddr *)&local, len) == -1) {
perror("bind");
exit(1);
}
return 0;
}
I've figured out that to compile it (Code::Blocks) there must be one more include:
#include <unistd.h>
But after successful run I'm getting message "Bind: Operation not permitted". What is wrong? I've tried to run it under root and still it is not working.
[1]: http://beej.us/guide/bgipc/output/html/multipage/unixsock.html | 0 | [
2,
18482,
18,
27,
287,
12968,
2473,
13,
5,
11377,
52,
7387,
6,
800,
3726,
3726,
31,
22,
79,
78,
8506,
17,
114,
544,
51,
64,
2382,
19,
272,
20512,
131,
13024,
9,
86,
31,
57,
109,
3005,
88,
18482,
18,
9,
31,
22,
79,
249,
14838... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use Android annotation to load image in background?
===
How to use Android annotation to load image in background?
Specifically for images in listview. | 0 | [
2,
275,
13005,
40,
1270,
857,
20,
6305,
1961,
19,
2395,
60,
800,
3726,
3726,
184,
20,
275,
13005,
40,
1270,
857,
20,
6305,
1961,
19,
2395,
60,
3524,
26,
3502,
19,
968,
4725,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Sticky Header(which has to stick to the top - always ) and body position relative to the header length(Dynamic)
===
Trying to get the header to stick to the top of the page - `postion:fixed` - works
But on doing this the body cannot be placed relative to the header - which is possible if `position:relative` [Demo](http://jsfiddle.net/waBxU/2/)
What i'm trying to achieve -
* A Sticky header which moves along with scroll
* A body which is at relative height from the above header( who's height is dynamic )
What I have done so far : [__DEMO__](http://jsfiddle.net/BGr97/1/)
I'm a trying to find a __Pure CSS__( is it even possible? ) solution,but have been unsuccessful at it - any help is appreciated
| 0 | [
2,
19087,
157,
106,
5,
2140,
63,
20,
5258,
20,
14,
371,
13,
8,
550,
13,
6,
17,
358,
649,
4543,
20,
14,
157,
106,
1476,
5,
20985,
6,
800,
3726,
3726,
749,
20,
164,
14,
157,
106,
20,
5258,
20,
14,
371,
16,
14,
2478,
13,
8,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I pass a value from my page to the controller?
===
I'm using MVC with Razor and C#. I would like to update an element... a counter with ajax. Here is my code:
@model Domain.CounterObject
@using (Ajax.BeginForm("Count", "CounterObject", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "my-control" }))
{
<div id="my-control" class="bid-object">
<div>
<span class="title">@Html.Encode(Model.Title)</span>
</div>
<div>
<span class="display function">@Html.Encode(Model.GetFinalDate())</span>
</div>
<div>
<span class="display tel">@Html.Encode(Model.GetValue())</span>
</div>
<div>
<input type="submit" value="Count" />
</div>
</div>
}
In my controller I have this code:
[HttpPost]
public PartialViewResult Count(CounterObject counter)
{
// Special work here
return PartialView(counter);
}
The problem is that my CounterObject counter I receive in my Count method is always null. How can I pass a value from my page to the controller? | 0 | [
2,
184,
92,
31,
1477,
21,
1923,
37,
51,
2478,
20,
14,
9919,
60,
800,
3726,
3726,
31,
22,
79,
568,
307,
8990,
29,
14282,
17,
272,
5910,
9,
31,
83,
101,
20,
11100,
40,
4520,
9,
9,
9,
21,
2105,
29,
20624,
9,
235,
25,
51,
1797... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Facebook Application not loading
===
I've a facebook application that sometimes loads and sometimes it doesn't. I don't know whats the problem. I've me and some my friends being able to load it. I've tried from a different account but its not loading.
I've tried something, when i click on the application from facebook sometimes it doesn't loads, when i type the original app url, where there is a redirect based on a referer, it loads.
The application launches from index.php
The application is here,
http://apps.facebook.com/moribay/?fb_source=bookmark_apps&ref=bookmarks&count=0&fb_bmpos=1_0
Can someone help?? | 0 | [
2,
9090,
3010,
52,
12797,
800,
3726,
3726,
31,
22,
195,
21,
9090,
3010,
30,
1030,
19069,
17,
1030,
32,
1437,
22,
38,
9,
31,
221,
22,
38,
143,
98,
18,
14,
1448,
9,
31,
22,
195,
55,
17,
109,
51,
954,
142,
777,
20,
6305,
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... |
QML Splash Screen Not Working
===
My app used to work before the latest belle update but doesnt anymore. The splash screen only works when i downgrade com.nokia.symbian 1.1 to 1.0 on both the init.qml file and the splashcreen.qml file but then doesnt display the main.qml file. When I instruct main.cpp to directly load main.qml the app does work…. Im lost! Here is the code I have for main.cpp:
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QScopedPointer<QApplication> app(createApplication(argc, argv));
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
viewer.setSource(QUrl("qrc:/qml/SmartFlyer/init.qml"));
//viewer.setMainQmlFile(QLatin1String("qrc:qml/SmartFlyer/main.qml"));
viewer.showExpanded();
return app->exec();
}
For init.qml:
import QtQuick 1.1
import com.nokia.symbian 1.1
Item {
id: init
SplashScreen {
id: splash
show: true // show splash
minTimeout: 3000 // show splash at least for 3 sec
image: "data/splash_screen.png" // path to splash image
canFinish: false // change to true when main QML will be loaded
z: 100 // highest page.
}
Loader { // this component performs deferred loading.
id: mainLoader
onStatusChanged: {
if( mainLoader.status == Loader.Ready )
{
// main page is loaded
// time to hide splash
splash.canFinish = true
}
}
}
Component.onCompleted: {
// splash is already rendered on the screen
// user is looking on splash
// now we can start loader to load main page
mainLoader.source = "main.qml"
}
}
And for splashscreen.qml :
import QtQuick 1.1
import com.nokia.symbian 1.1
Rectangle {
id: splash
anchors.fill: parent
color: "black"
property int minTimeout: 3000 // 3s by default.
property string image; // path to splash image
property bool show: false // if show is true then image opacity is 1.0, else 0.0
property bool canFinish: false // if true then we can hide spash after timeout
state: show ? "showingSplash" : ""
onStateChanged: {
if( state == "showingSplash" )
splashTimer.start();
}
opacity: 0.0
Image {
source: image
fillMode: Image.PreserveAspectFit
anchors.fill: parent
smooth: true
}
Timer {
id: splashTimer
interval: minTimeout
running: false
repeat: true
onTriggered: {
if( splash.canFinish )
{
// finally we can stop timer and hide splash
splash.show = false
splashTimer.repeat = false
}
else
{
// canFinish is false, but main.qml is not loaded yet
// we should run timer again and again
splashTimer.interval = 1000 // 1 sec
splashTimer.repeat = true
}
}
}
states: [
State {
name: "showingSplash"
PropertyChanges { target: splash; opacity: 1.0 }
}
]
// hide splash using animation
transitions: [
Transition {
from: ""; to: "showingSplash"
reversible: true
PropertyAnimation { property: "opacity"; duration: 500; }
}
]
} | 0 | [
2,
2593,
8184,
13873,
2324,
52,
638,
800,
3726,
3726,
51,
4865,
147,
20,
170,
115,
14,
5736,
7240,
11100,
47,
5886,
3375,
9,
14,
13873,
2324,
104,
693,
76,
31,
125,
8031,
13,
960,
9,
251,
13017,
9,
7261,
10035,
137,
9,
165,
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... |
Android rotate bitmap around center without resizing
===
I'm struggling to draw a rotating bitmap around its center and do the rotating without resizing the bitmap. I'm drawing all my sprites to the screen via a game thread, so I'm looking for a solution that incorporates the original bitmap and not the canvas.
Thanks in advance.
This is my code so far, it turns a bitmap around its center, yet resizes it.
i = i + 2;
transform.postRotate(i, Assets.scoresScreen_LevelStar.getWidth()/2, Assets.scoresScreen_LevelStar.getHeight()/2);
Bitmap resizedBitmap = Bitmap.createBitmap(Assets.scoresScreen_LevelStar, 0, 0, Assets.scoresScreen_LevelStar.getWidth(), Assets.scoresScreen_LevelStar.getHeight(), transform, true);
game.getGraphics().getCanvasGameScreen().drawBitmap(resizedBitmap, null, this.levelStar.getHolderPolygons().get(0), null); | 0 | [
2,
13005,
21448,
1142,
15022,
140,
459,
366,
10719,
3335,
800,
3726,
3726,
31,
22,
79,
7587,
20,
2003,
21,
16164,
1142,
15022,
140,
82,
459,
17,
107,
14,
16164,
366,
10719,
3335,
14,
1142,
15022,
9,
31,
22,
79,
3533,
65,
51,
27902... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make android device as FAT16 U-Disk?
===
Many nc machines without network.
For work, We need move some files from the design computers to these machines by u-disk whose format is fat16.
Now, I want to add network function to those nc machines through android pads.
The android pad connect the nc machine by USB. And andoid pad connect design computer by WIFI.
So, there is a stone in my road.
How can I make the android be u-disk(fat16), and **at the same time**, the android pad can process the files in this u-disk?
Is there any solution or philosophy?
Should I modify the android runtimes ?
----------
| 0 | [
2,
184,
20,
233,
13005,
3646,
28,
4211,
1091,
287,
8,
2906,
197,
60,
800,
3726,
3726,
151,
9276,
6035,
366,
982,
9,
26,
170,
15,
95,
376,
780,
109,
6488,
37,
14,
704,
7774,
20,
158,
6035,
34,
287,
8,
2906,
197,
1196,
2595,
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... |
How do I get .net 3.5 to automatically generate JSON data based on an RSS feed?
===
At the moment, I am generating xml and json data using the following code:
public class App
{
public string app_name;
public string app_path;
public App(string m_app_name, string m_app_path)
{
app_name = m_app_name;
app_path = m_app_path;
}
public App() { }
}
[ScriptService]
public class Apps : WebService {
List<App> App = new List<App>();
SqlConnection connection;
SqlCommand command;
SqlDataReader reader;
[WebMethod()]
public List<App> GetUserApps()
{
var apps = new List<App>();
using (connection = new SqlConnection(ConfigurationManager.AppSettings["connString"]))
{
using (command = new SqlCommand(@"some query here", connection))
{
connection.Open();
using (reader = command.ExecuteReader())
{
int AppNameIndex = reader.GetOrdinal("application_name");
int AppPathIndex = reader.GetOrdinal("application_path");
while (reader.Read())
{
apps.Add(new App(reader.GetString(AppNameIndex), reader.GetString(AppPathIndex)));
}
}
}
}
return apps;
}
}
If I then request this in javascript using `application/json; charset=utf-8`, I automatically get json data.
My problem is that I need to get data from an external RSS feed, instead of a local database, and convert that to json data so I can call it the same way using javascript.
Anyone know how I can capture the RSS feed `http://www.hotukdeals.com/rss/hot` using similar code as above? | 0 | [
2,
184,
107,
31,
164,
13,
9,
2328,
203,
9,
264,
20,
7499,
7920,
487,
528,
1054,
432,
27,
40,
13,
1224,
18,
4063,
60,
800,
3726,
3726,
35,
14,
688,
15,
31,
589,
13500,
23504,
17,
487,
528,
1054,
568,
14,
249,
1797,
45,
317,
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... |
Widget markup with custom plugin - Wordpress
===
I just created a plugin and i need to put it in a sidebar widget with a shortcode.
But for some reason the widget title is shown below the widget content.
Anyone got a clue about what am i missing ? | 0 | [
2,
4807,
43,
3060,
943,
576,
29,
5816,
10922,
108,
13,
8,
833,
5890,
800,
3726,
3726,
31,
114,
679,
21,
10922,
108,
17,
31,
376,
20,
442,
32,
19,
21,
270,
1850,
4807,
43,
3060,
29,
21,
502,
9375,
9,
47,
26,
109,
1215,
14,
48... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
find which method was called on an object
===
**Is it possible to find which method was called on an object without having it in body of the object?**
I mean :
function foo() {
if(! (this instanceof foo) ) return new foo();
alert(this.find_which_method_was_called()); // output 'myMethod'
}
foo().myMethod(); | 0 | [
2,
477,
56,
2109,
23,
227,
27,
40,
3095,
800,
3726,
3726,
13,
1409,
403,
32,
938,
20,
477,
56,
2109,
23,
227,
27,
40,
3095,
366,
452,
32,
19,
358,
16,
14,
3095,
60,
1409,
31,
884,
13,
45,
1990,
4310,
111,
5,
6,
13,
1,
100,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Tkinter.Tk() and threading
===
There is an interesting issue with Tkinter and threading: I have a Tkinter based GUI and some code executed alongside mainloop. It works like charm if I only do it once. But if i do it twice Tkinter.Tk() blocks BOTH threads: GUI and MainThread.
here is the code (inspired by [another Tkinter vs threading topic](http://stackoverflow.com/questions/459083/how-do-you-run-your-own-code-alongside-tkinters-event-loop)):
import Tkinter
import threading
import logging
logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s: %(message)s")
def gui():
logging.info("Starting GUI")
root = Tkinter.Tk()
logging.info("Setup GUI")
root.after(500, root.destroy)
root.mainloop()
logging.info("Mainloop is over")
def start_gui_thread():
gui_thread = threading.Thread(None, gui, None)
gui_thread.setDaemon(True)
gui_thread.start()
return gui_thread
def test():
gui_thread = start_gui_thread()
logging.info("Do something alongside gui")
logging.info("Wait for gui to terminate")
gui_thread.join()
logging.info("thread terminated")
logging.info("--------- 1 ---------")
test()
logging.info("--------- 2 ---------")
test()
result:
INFO: --------- 1 ---------
INFO: Do something alongside gui
INFO: Starting GUI
INFO: Wait for gui to terminate
INFO: Setup GUI
INFO: Mainloop is over
INFO: thread terminated
INFO: --------- 2 ---------
INFO: Starting GUI
INFO: Do something alongside gui
| 0 | [
2,
13,
38,
1767,
815,
9,
38,
197,
5,
6,
17,
9322,
68,
800,
3726,
3726,
80,
25,
40,
4883,
1513,
29,
13,
38,
1767,
815,
17,
9322,
68,
45,
31,
57,
21,
13,
38,
1767,
815,
432,
9457,
17,
109,
1797,
5557,
2387,
407,
18786,
9,
32... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
"Security settings for this service require Windows Authentication" IIS error for client certificates WCF project
===
I've scoured the internet (and SO) for solutions to this. None of the questions that will appear in the RHS as of today solve my problem, so here goes.
**TLDR:** I'm trying to build a WCF service that requires client certificates, and I'm running into this error:
> Security settings for this service require Windows Authentication but
> it is not enabled for the IIS application that hosts this service.
I had several problems getting the service to identify the self-signed certificate I generated for testing. It seems to be working now, because clients that don't have the certificate show me an IIS error of 403 (forbidden) instead of this exception.
Relevant snippets of my service web.config:
<wsHttpBinding>
<binding name="clientCertificateBinding">
<security mode="Message">
<message clientCredentialType="Certificate" />
</security>
</binding>
</wsHttpBinding>
I have two end-points defined: one for "mex" (tried removing it, doesn't solve my problem) and one for the actual service. The service binding uses `binding="wsHttpBinding" bindingConfiguration="clientCertificateBinding"` as the specification.
Later, I tell my behaviour to use the service certificate:
<behavior name="AwesomeBehaviour">
<serviceMetadata httpsGetEnabled="true"/>
<serviceCredentials>
<serviceCertificate
storeLocation="LocalMachine"
storeName="My"
findValue = 'CN=...' />
</serviceCredentials>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
Also, IIS is set to **Rquire SSL and require client certificates.** Not just accept them, but require them.
I've tried (as some suggest) changing the security mode from `Transport` to `Message` and `TransportWithMessageCredential`; this doesn't do anything.
There's also [this thread][1] which talks about NTLM and Negotiate as a transport credential type. This does not fix my problem.
There's also [this KB article][2] which talks about `cscript.exe`. For IIS7, I get an error when it's trying to `GET` the values from the website.
I'm not sure what I'm missing.
[1]: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/021babc6-2009-4ed9-81f4-ac48cc300c94/
[2]: http://support.microsoft.com/kb/215383 | 0 | [
2,
13,
7,
17749,
12410,
26,
48,
365,
4077,
1936,
27963,
7,
595,
18,
7019,
26,
6819,
6259,
18,
11801,
410,
669,
800,
3726,
3726,
31,
22,
195,
13,
18,
9598,
69,
14,
2620,
13,
5,
290,
86,
6,
26,
6776,
20,
48,
9,
2369,
16,
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 do I make a dialogue box similar to this in CSS3?
===
I want to make a dialogue box that looks similar to this in css3 (minus text boxes and buttons, and forgot password link):
![enter image description here][1]
[1]: http://i.stack.imgur.com/NNPes.png
I think I can do something like:
<div id="mydialoguebox">
<h1>Authorization Required</h1>
<div id="text">
Please review your account before continuing.
<div>
</div>
The problem I am having is there always seems to be a gap in between the top of the div and the h1 tag. I am also unsure how to add the "close" image with the x. Is it better to shove the authorization required and the image into its own div? Im looking for the best way to do this without JQuery UI or any javascript. | 0 | [
2,
184,
107,
31,
233,
21,
6402,
1649,
835,
20,
48,
19,
272,
18,
18,
240,
60,
800,
3726,
3726,
31,
259,
20,
233,
21,
6402,
1649,
30,
1879,
835,
20,
48,
19,
272,
18,
18,
240,
13,
5,
15495,
1854,
8120,
17,
12861,
15,
17,
9564,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are some approaches to outputting a Python data structure to reStructuredText
===
I have a list of tuples in Python that I would like to output to a table in reStructuredText.
The docutils library has great support for converting reStructuredText to other formats, but I want to write directly from a data structure in memory to reStructuredText.
| 0 | [
2,
98,
50,
109,
7501,
20,
5196,
1203,
21,
20059,
1054,
1411,
20,
302,
13971,
43,
11969,
800,
3726,
3726,
31,
57,
21,
968,
16,
2289,
18534,
19,
20059,
30,
31,
83,
101,
20,
5196,
20,
21,
859,
19,
302,
13971,
43,
11969,
9,
14,
97... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rails with mongoid nested attributes with validation presence of associated record
===
I have strange problem with mongoid, nested attributes and validations.
In my application I have the following two models:
class User
has_and_belongs_to_many :companies
validates :companies, presence: true, associated: true
accepts_nested_attributes_for :companies
end
class Company
has_and_belongs_to_many :users
validates :companies, presence: true, associated: true
end
When I try to create a new user along with associated company, for example with following params:
`{"companies_attributes"=>{"0"=>{"name"=>"Company name"}}, "email"=>"test@email.com", "password"=>"xxx", "password_confirmation"=>"xxx"}`
I get the following validation error on company model `user.companies.first.errors`: `:users=>["can't be blank"]` and User record cannot be saved.
So far I've found two workarounds for this problem:
Disable `validates :users, presence: true` on Company model, which is not satisfactory solution
..or create before validation on create callback on User model, iterate through companies and assign missing user:
class User
before_validation :assign_self_to_companies, on: :create
def assign_self_to_companies
companies.each do |company|
company.users.push(self)
end
end
end
The second solutions seems to me like strange hack. Did I miss something? Is it possible to implement this feature in more clean way? | 0 | [
2,
2240,
18,
29,
21028,
6516,
5618,
69,
13422,
29,
27999,
1970,
16,
1598,
571,
800,
3726,
3726,
31,
57,
2578,
1448,
29,
21028,
6516,
15,
5618,
69,
13422,
17,
27999,
18,
9,
19,
51,
3010,
31,
57,
14,
249,
81,
2761,
45,
718,
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... |
PayPal Permissions API GetAccessToken API call not working
===
Error back from API call is below:
{error(0).message=Internal+Error, error(0).errorId=520002, error(0).subdomain=Application, error(0).category=Application, responseEnvelope.correlationId=46cac792dc1a4, error(0).domain=PLATFORM, responseEnvelope.ack=Failure, error(0).severity=Error}
How do I even debug this? Nothing in the error to help me debug this, everything seems fine code is all against a sandbox and nothing seems suspicious. Any suggestion on debugging this would be great!
Thanks | 0 | [
2,
1372,
6720,
5572,
18,
21,
2159,
164,
20604,
262,
2853,
21,
2159,
645,
52,
638,
800,
3726,
3726,
7019,
97,
37,
21,
2159,
645,
25,
1021,
45,
13,
1,
29992,
5,
387,
6,
9,
3845,
18,
1303,
3726,
6280,
5025,
2430,
29992,
15,
7019,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use PHP Document as ErrorDocument
===
Tired of banging my head on this one. What I want to do is relatively simple. I set up my .htaccess like such:
ErrorDocument 400 /errorcode.php
ErrorDocument 401 /errorcode.php
ErrorDocument 402 /errorcode.php
ErrorDocument 403 /errorcode.php
ErrorDocument 404 /errorcode.php
ErrorDocument 405 /errorcode.php
ErrorDocument 406 /errorcode.php
ErrorDocument 407 /errorcode.php
ErrorDocument 408 /errorcode.php
ErrorDocument 409 /errorcode.php
ErrorDocument 410 /errorcode.php
ErrorDocument 411 /errorcode.php
ErrorDocument 412 /errorcode.php
ErrorDocument 413 /errorcode.php
ErrorDocument 414 /errorcode.php
ErrorDocument 500 /errorcode.php
ErrorDocument 501 /errorcode.php
ErrorDocument 502 /errorcode.php
ErrorDocument 503 /errorcode.php
ErrorDocument 504 /errorcode.php
ErrorDocument 505 /errorcode.php
The idea is that all errors get redirected to errorcode.php.
Errorcode is set up to interpret the incoming traffic:
<?php
echo "Error Code Page";
$HttpStatus = $_SERVER["REDIRECT_STATUS"] ;
if($HttpStatus==200) {print "Welcome Robots!";}
if($HttpStatus==400) {print "Bad HTTP request ";}
if($HttpStatus==401) {print "Unauthorized - Iinvalid password";}
if($HttpStatus==402) {print "We are not equipped to handle this error yet!";}
if($HttpStatus==403) {print "Forbidden";}
etc etc
My issue is that I do not know the directory the app will be installed. So since the .htaccess and errorcode.php are in the same folder, I figured I could use relative links.
But right now, with the code displayed above, I get this:
Not Found
The requested URL /master/errorcode2 was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Is there a way to handle what I am doing above without using absolute .htaccess links?
I was looking at [this](http://stackoverflow.com/questions/1668889/how-to-use-errordocument-to-redirect-to-a-php-file-in-the-same-folder) and was wondering if there is a way to change the code of my .htaccess by adding the rewrite rules, and somehow edit my errorcode.php so that I can "interpret" the incoming traffic like I am already doing. | 0 | [
2,
275,
13,
26120,
4492,
28,
7019,
28132,
800,
3726,
3726,
4117,
16,
24472,
51,
157,
27,
48,
53,
9,
98,
31,
259,
20,
107,
25,
3109,
1935,
9,
31,
309,
71,
51,
13,
9,
9020,
20604,
101,
145,
45,
7019,
28132,
4353,
13,
118,
29992,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 keep DialogFragment visible after onClick on its adapter?
===
I have a `DialogFragment` with associated `SimpleAdapter` which listen for clicks. When I click on any item within a `ListView` the `DialogFragment` dismiss itself. How to keep it visible?
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
builder.setTitle(getResources().getString(R.string.choose_file_for_import));
mAdapter = new MAdapter(getActivity(), R.id.file_explorer_tv_filename, itemsList);
builder.setAdapter(mAdapter, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int position) {
File file = new File(pathList.get(position));
getDir(pathList.get(position));
mAdapter.notifyDataSetChanged();
}
return builder.create();
} | 0 | [
2,
184,
20,
643,
28223,
22133,
1130,
4560,
75,
27,
150,
10129,
27,
82,
9924,
106,
60,
800,
3726,
3726,
31,
57,
21,
13,
1,
4286,
5567,
22133,
1130,
1,
29,
1598,
13,
1,
24629,
27576,
106,
1,
56,
3834,
26,
10840,
18,
9,
76,
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... |
Download images through php scripts results in format error
===
I have created a database where you can store files in BLOB format using the details provided in http://mirificampress.com/permalink/saving_a_file_into_mysql site, I have not encountered any errors while storing files , but when i try to retrieve the data stored i didnt encounter any errors for txt files , but encountered error in case of pdf and images, so what i did was remove header("Content-length: ".$size.""); and was able to download pdf without any errors but incase of images am still getting format error .
I have included header("Pragma: public"); and header('Content-Transfer-Encoding: binary'); but still error in terms of format persists incase of images .
| 0 | [
2,
7121,
3502,
120,
13,
26120,
17505,
1736,
19,
2595,
7019,
800,
3726,
3726,
31,
57,
679,
21,
6018,
113,
42,
92,
1718,
6488,
19,
334,
10904,
2595,
568,
14,
3289,
1173,
19,
7775,
6903,
8635,
24831,
79,
5890,
9,
960,
118,
1432,
540,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
xxx.exe has encountered a proble m and needs to close
===
i am converting programs from vb6 to vb.net with VS2005 then to VS2010 .
xxx.exe has encountered a proble m and needs to close occur when i was running a report function in a application and this error make it terminate. i read message from event view.
it said that source:.NET Runtime 4.0 Error Reporting, event ID: 1000
desc:Faulting application tpatoprt.exe, version 2.0.4574.21092, stamp 4ffbaa28, faulting module clr.dll, version 4.0.30319.269, stamp 4ee9ae83, debug? 0, fault address 0x0019b930.
also
.NET Runtime, event ID :1023
desc:
Application: TPATOPrt.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an internal error in the .NET Runtime at IP 792DB930 (79140000) with exit code 80131506.
the following link just like my problem: http://4.bp.blogspot.com/_681goxWLnCg/S99AQRndqII/AAAAAAAAAfA/KQBnplFJ5-Y/fake_svchost_popup.jpg
i tried to correct in many way..but sad it still happen..
can someone help me ?Please. | 0 | [
2,
13,
13290,
9,
1706,
62,
63,
8208,
21,
895,
2854,
307,
17,
2274,
20,
543,
800,
3726,
3726,
31,
589,
19583,
1726,
37,
13,
20468,
379,
20,
13,
20468,
9,
2328,
29,
4611,
2835,
94,
20,
4611,
2751,
13,
9,
13,
13290,
9,
1706,
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... |
Adding Splash in Wiengine
===
I have implemented my game using the life cycle of a wiengine game. I want to add splash screen in my game.
here is my on create method
super.onCreate(savedInstanceState);
getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);
requestWindowFeature(Window.FEATURE_NO_TITLE);
mStarted = false;
mGLView = new WYGLSurfaceView(this, isTransparent());
setContentView(mGLView);
Director.getInstance().getContext();
setVolumeControlStream(AudioManager.STREAM_MUSIC);
Director.getInstance().setDisplayFPS(true);
Director.getInstance().addLifecycleListener(this);
Director.getInstance().setScaleMode(Director.SCALE_MODE_BASE_SIZE_FIT_XY);
Director.getInstance().setBaseSize(480, 800);
and the scene is created in on the surface view method , here is the code of the surface view method
if (!mStarted) {
mStarted = true;
MainScene sc = new MainScene();
sc.init();
Director.getInstance().runWithScene(sc);
// sc.autoRelease();
} | 0 | [
2,
4721,
13873,
19,
4807,
16847,
800,
3726,
3726,
31,
57,
6807,
51,
250,
568,
14,
201,
4150,
16,
21,
4807,
16847,
250,
9,
31,
259,
20,
3547,
13873,
2324,
19,
51,
250,
9,
235,
25,
51,
27,
1600,
2109,
1026,
9,
218,
6037,
1373,
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... |
Bash function fails when it's part of a pipe
===
This is an attempt to simplify a problem I'm having.
I define a function which sets a variable and this works in this scenario:
$ function myfunc { res="ABC" ; }
$ res="XYZ"
$ myfunc
$ echo $res
ABC
So res has been changed by the call to myfunc. But:
$ res="XYZ"
$ myfunc | echo
$ echo $res
XYZ
So when myfunc is part of a pipe the value doesn't change.
How can I make myfunc work the way I desire even when a pipe is involved?
(In the real script "myfunc" does something more elaborate of course and the other side of the pipe has a zenity progress dialogue rather than a pointless echo)
Thanks | 0 | [
2,
13158,
1990,
13614,
76,
32,
22,
18,
141,
16,
21,
7642,
800,
3726,
3726,
48,
25,
40,
1735,
20,
28257,
21,
1448,
31,
22,
79,
452,
9,
31,
9267,
21,
1990,
56,
3415,
21,
7612,
17,
48,
693,
19,
48,
12705,
45,
5579,
1990,
51,
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... |
external css discrepancies
===
I have this in an external css file, but its not working at all. I would assume I'd written it wrong, but when placed internally, it works fine. Any ideas as to what might be going on?
html
{
background-image:url(images/background-grid.jpg);
background-repeat:repeat;
} | 0 | [
2,
4886,
272,
18,
18,
3626,
99,
3206,
10807,
800,
3726,
3726,
31,
57,
48,
19,
40,
4886,
272,
18,
18,
3893,
15,
47,
82,
52,
638,
35,
65,
9,
31,
83,
7158,
31,
22,
43,
642,
32,
1389,
15,
47,
76,
1037,
17739,
15,
32,
693,
1123... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Overlaying and Aligning Divisions
===
Greetings Overflowers,
I was wondering if there is a CSS way to overlay divisions that are horizontally/vertically aligned to the center of their shared parent division?
Kind regards | 0 | [
2,
84,
4414,
68,
17,
23389,
68,
5519,
800,
3726,
3726,
13769,
18,
20285,
445,
15,
31,
23,
5712,
100,
80,
25,
21,
272,
18,
18,
161,
20,
84,
4414,
5519,
30,
50,
25658,
118,
8122,
8438,
13,
12740,
20,
14,
459,
16,
66,
2592,
4766,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
exposing sql server data from an asp.net webapp to silverlight and win forms via linq
===
I have an asp.net web app which holds its data in an sql server 08 r2 db.
I have a silverlight admin interface on the same web app, and I will have a win forms app which will need to add/retrieve data from the sql db. Is there a way I can use linq in both clients?
I mean something like linq2twitter, where in the silverlight or in winforms app I can use linq to query and update the data.
Currently Im thinking of just using web services, but the data objects are complicated and they're connected to so many other data objects, it would be very convenient to work with them in linq, especially because the asp.net app itself uses a linq data context for its operations. Is there a way to expose this context over http or something?
Thanks
| 0 | [
2,
17302,
4444,
255,
8128,
1054,
37,
40,
28,
306,
9,
2328,
2741,
7753,
20,
1172,
3130,
17,
628,
1997,
1197,
6294,
1251,
800,
3726,
3726,
31,
57,
40,
28,
306,
9,
2328,
2741,
4865,
56,
2763,
82,
1054,
19,
40,
4444,
255,
8128,
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... |
RelayCommand in Silverlight (CanExecute issue)
===
I've started to use MVVM Light Toolkit for Silverlight and faced with a major issue. It really bothers me because it's obvious problem from my perspective but I I didn't find any solution yet.
Before I start using MVVM Light Toolkit, I used my own ViewModelBase class + RelayCommand and so on.
In order to raise CanExecuteChanged event automatically (smth like in WPF) I created static CommandBindingManager class. It does following work:
1) Every time RelayCommand created, in the constructor of RelayCommand CommandBindingManager.Register(RelayCommand command) is called.
As a result, all commands created in the app, store in the CommandBindingManager
2)In ViewModelBase.RaisePropertyChanged() method I called CommandBindingManager.UpdateCanExecute().
What this method does is call RaiseCanExecute() method on every command that CommandBindingManager stores(on every command in the application)
As a result, if smth is changed in the application -> all commands CanExecute properties are updated too.
Now, I'm using RelayCommand and ViewModelBase from MVVM Light Toolkit. And wondering how you handle CanExecute issue?
Because in real applications situations happen like this:
GetDataCommand = new RelayCommand(GetData, () => SelectedAccounts != null && SelectedAccounts.Any() && SelectedAccounts.All(entity => entity.Id != Guid.Empty) && SelectedDisplayMode != Mode.None && SelectedPhase != null);
In this case RaiseCanExecute() should be called several times in different properties. It's dublication of code.
What if else one condition will be added to CanExecute and developer forget to add GetDataCommand.RaiseCanExecute() call to this new property?
or like this:
UndoCommand = new RelayCommand(ManagersHolder.UndoRedoManager.Undo, () => ManagersHolder.UndoRedoManager.CanUndo);
In this case the class where CanUndo method placed even don't know anything about UndoCommand and can't call RaiseCanExecute() method | 0 | [
2,
6953,
16239,
19,
1172,
3130,
13,
5,
1245,
1706,
17194,
591,
1513,
6,
800,
3726,
3726,
31,
22,
195,
373,
20,
275,
17967,
20147,
471,
5607,
13703,
26,
1172,
3130,
17,
3110,
29,
21,
394,
1513,
9,
32,
510,
8006,
18,
55,
185,
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... |
Applying Shadowbox.js on dynamically generated content
===
I m using shadowbox.js for image gallery display.
for this we have to generate html like this
<a href="images/Ganesha3602.jpg" rel="shadowbox[my]"><img src="images/thumb.jpg" alt="First" title="First image" /></a>
<a href="images/original.jpg" rel="shadow[my]"><img src="images/thumb.jpg" alt="Second" title="Second image" /></a>
<a href="images/original.jpg" rel="shadowbox[my]"><img src="images/thumb.jpg" alt="First" title="First image" /></a>
and then apply <code>Shadowbox.init()</code> on body load. Its wporking like a charm when the above html is static. But when i generate it dynamically using <code>$.ajax</code> and call
<code>Shadowbox.init()</code> on success; shadowbox does not work. I also tried calling <code>Shadowbox.init()</code> on complete
my code is something like this
<code> $(document).on('click','#load_posts_comments',function(){
$.ajax({
url:"post_comment_json.php",
type: "POST",
dataType: "json",
data:{user_id:"123"},
success: function(data){
load_posts_comments(data);
},
complete:function(){
Shadowbox.init();
}
});
});
</code>
where am I going wrong. I looked the shadowbox website but there was no documentation regarding dynamically loaded content. Help would be appreciated. | 0 | [
2,
11989,
3118,
5309,
9,
728,
18,
27,
7782,
1326,
6756,
2331,
800,
3726,
3726,
31,
307,
568,
3118,
5309,
9,
728,
18,
26,
1961,
2246,
3042,
9,
26,
48,
95,
57,
20,
7920,
13,
15895,
101,
48,
13,
1,
58,
746,
14057,
3726,
7,
22039,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to read multiple com ports from a single port in java?
===
I want to read multiple serial ports (in which multiple devices are connected) from a single USB serial port.
How is it possible? Anybody tell me how to fix this problem. pls refer some tutorials or websites.
Thanks in advance.. | 0 | [
2,
184,
20,
1302,
1886,
13,
960,
9551,
37,
21,
345,
1295,
19,
8247,
60,
800,
3726,
3726,
31,
259,
20,
1302,
1886,
5956,
9551,
13,
5,
108,
56,
1886,
4690,
50,
2587,
6,
37,
21,
345,
182,
220,
5956,
1295,
9,
184,
25,
32,
938,
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... |
cron.xml - validating error
===
My cron.xml:
<br/>
<?xml version="1.0" encoding="UTF-8"?>
<cronentries>
<cron>
<url>/myURL</url>
<description>Backup data 02 times per day</description>
<schedule>every 12 hours</schedule>
<timezone>America/New_York</timezone>
<target>ah-builtin-python-bundle</target>
</cron>
</cronentries>
When I upload my application to gae, I get an error message
<br/>"An internal error occurred during: "Deploying App to Google".
XML error validating /Users/Aptos/Documents/workspace/App/war/WEB-INF/cron.xml against /Users/Aptos/appengine-java-sdk-1.7.0/docs/cron.xsd"
<br/>
Can somebody show me what wrong with this file?As I see, it looks exactly the same to google's example.
<br/> Thank you very much | 0 | [
2,
13,
19587,
9,
396,
8184,
13,
8,
7394,
1880,
7019,
800,
3726,
3726,
51,
13,
19587,
9,
396,
8184,
45,
13,
1,
5145,
118,
1,
13,
1,
60,
396,
8184,
615,
3726,
7,
165,
9,
387,
7,
19608,
3726,
7,
1982,
410,
8,
457,
7,
60,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
is there a blob data type for a list property?
===
Does anyone know if there is a blob data type I can use for GAE's datastore list property?
I want to create the following entry that contains a list of blobs in the datastore, but I get errors.
class DataRecord(db.Model)
data = db.ListProperty(blob)
| 0 | [
2,
25,
80,
21,
334,
10904,
1054,
1001,
26,
21,
968,
1354,
60,
800,
3726,
3726,
630,
1276,
143,
100,
80,
25,
21,
334,
10904,
1054,
1001,
31,
92,
275,
26,
13,
17721,
22,
18,
1054,
16828,
968,
1354,
60,
31,
259,
20,
1600,
14,
249... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I look for objects with missing value or None as key?
===
I would like to perform a search on the zope catalog of the objects with missing index key values. Is it possible?
For example consider the subsequent code lines:
from Products.CMFCore.utils import getToolByName
catalog = getToolByName(context, 'portal_catalog')
results = catalog.searchResults({'portal_type': 'Event', 'review_state': 'pending'})
what to do if I'm interested in objects in which a certain item, instead of portal_type or review_state, has not be inserted? | 0 | [
2,
184,
92,
31,
361,
26,
3916,
29,
2863,
1923,
54,
2369,
28,
1246,
60,
800,
3726,
3726,
31,
83,
101,
20,
2985,
21,
2122,
27,
14,
9017,
1664,
10594,
16,
14,
3916,
29,
2863,
4348,
1246,
4070,
9,
25,
32,
938,
60,
26,
823,
3563,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Python Packaging?
===
I heard the term Python Packaging and got interested in learning it, since it was something I've never heard of. I tried to search the internet but couldn't find anything to learn on. Are there tutorial websites or books on this topic to learn from? Also Python Packaging is about server automation.
Sorry for sounding a newbie, just curious to learn new stuff. | 1 | [
2,
20059,
16850,
60,
800,
3726,
3726,
31,
752,
14,
981,
20059,
16850,
17,
330,
3158,
19,
2477,
32,
15,
179,
32,
23,
301,
31,
22,
195,
243,
752,
16,
9,
31,
794,
20,
2122,
14,
2620,
47,
711,
22,
38,
477,
602,
20,
2484,
27,
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... |
jQuery JSON Response
===
I'm having problems with jQuery JSON Response.. I'm passing the information, and getting back the headers, but i don't get the HTML.
I've been trying to solve this with JSONP too but still with no results.
<script type='text/javascript'>
$(document).ready(function(){
$("input.senddata").click(function() {
var ipForm = $('input[name="ip_submit"]').val();
var gameForm = $( 'select[name="game_submit"]' ).val()
$.getJSON("http://gamepwn.net/serversdotee/add-server.php",
{
ip: ipForm,
game: gameForm
},
function(data) {
$('#result').html(data);
});
});
});
</script>
the php file:
$data = array('items'=>array('serverip'=>'localhost', 'game'=>'cs','protocol'=>'48'));
echo $data;
the headers im recieving:
Response Headers
Cache-Control no-cache, must-revalidate
Connection Keep-Alive
Content-Type application/json
Date Tue, 26 Jun 2012 21:49:01 GMT
Expires Mon, 26 Jul 1997 05:00:00 GMT
Keep-Alive timeout=5, max=100
Server Apache/2.2.19 (Unix) mod_ssl/2.2.19 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_perl/2.0.4 Perl/v5.8.8
Transfer-Encoding chunked
X-Powered-By PHP/5.3.6
Request Headers
Accept application/json, text/javascript, */*; q=0.01
Accept-Encoding gzip, deflate
Accept-Language et,et-ee;q=0.8,en-us;q=0.5,en;q=0.3
Connection keep-alive
Host gamepwn.net
Origin http://servers.kdfx.eu
User-Agent Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0 FirePHP/0.7.1
x-insight activate | 0 | [
2,
487,
8190,
93,
487,
528,
1627,
800,
3726,
3726,
31,
22,
79,
452,
1716,
29,
487,
8190,
93,
487,
528,
1627,
9,
9,
31,
22,
79,
2848,
14,
676,
15,
17,
1017,
97,
14,
157,
445,
15,
47,
31,
221,
22,
38,
164,
14,
13,
15895,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to set a Viewmodel property when a listbox item is selected
===
I'm creating a spline designer which requires multiple spline parts.
It contains 2 views (2 UserControls).
The left one is an ItemsControl templated as a Canvas displaying the splines to edit.
The splines parts are UserControls as well.
The right one is a simple ListBox used to select a Spline part.
These two item container are bound to the same ObservableCollection<SplinePartVM> in a ViewModel.
For now, I have a dependencyProperty in the SplinePartVM named IsSelected
What I exactly want to achieve is to modify the DependencyProperty of the SplinePartVM when the SelectedItem is set in the ListBox.
for example, i'd like to do something like this:
<Trigger Property="IsSelected" Value="True">
<Setter Property="{Binding IsSelected}"/>
</Trigger>
because a simple
<ListBox IsSelected="{Binding SelectedItem, Path=IsSelected, Mode=TwoWay}"/>
doesn't work.
I'm a bit lost here... | 0 | [
2,
184,
20,
309,
21,
1418,
13998,
1354,
76,
21,
968,
5309,
9101,
25,
1704,
800,
3726,
3726,
31,
22,
79,
2936,
21,
3782,
1143,
4742,
56,
4781,
1886,
3782,
1143,
1341,
9,
32,
1588,
172,
4146,
13,
5,
135,
4155,
12898,
18,
6,
9,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery tooltip thrwing error function not defined
===
I am trying to get custom tooltip over image. but during run time it says "method or property tooltip not defined"
here is my code
<script src="/full/jquery.tools.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#content img[title]").tooltip();
});
</script>
<style type="text/css" >
.tooltip
{
display:none;
background:transparent url(Images/blackarrow.png);
font-size:12px;
height:70px;
width:160px;
padding:25px;
color:#eee;
}</style>
</asp:Content>
<div id="content"> <img alt="" src="Images/help1.png" title="Your help comes here" /></div>
| 0 | [
2,
487,
8190,
93,
5607,
10169,
13,
96,
139,
3546,
7019,
1990,
52,
2811,
800,
3726,
3726,
31,
589,
749,
20,
164,
5816,
5607,
10169,
84,
1961,
9,
47,
112,
485,
85,
32,
898,
13,
7,
5909,
1807,
43,
54,
1354,
5607,
10169,
52,
2811,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Query AND IN (select.... - Need assistance in clarifying and is it a Sub Routine
===
Can you let me know if my interpretation is correct (the last AND part)?
$q = "select title,name,company,address1,address2 from registrations where title != 0 AND id IN (select registrar_id from registrations_industry where industry_id='$industryid')";
Below was really where I am not sure:
... AND id IN (select registrar_id from registrations_industry where industry_id='$industryid')
**Interpretation:** Get any match on id(registrations id field) equals registrar_id(field) from the join table registrations_industry where industry_id equals the set $industryid
**Is this select statement considered a sub routine since it's a query within the main query?**
So an example would be with the register table id search to 23 would look like:
**registrations**(table)
id=23,title=owner,name=mike,company=nono,address1=1234 s walker lane,address2
**registrations_industry**(table)
id=256, registrar_id=23, industry_id=400<br>
id=159, registrar_id=23, industry_id=284<br>
id=227, registrar_id=23, industry_id=357
I assume this would return 3 records with the same registration table data And of course varying registrations_industry returns. | 0 | [
2,
51,
18,
22402,
25597,
17,
19,
13,
5,
18,
16964,
9,
9,
9,
9,
13,
8,
376,
4067,
19,
23116,
68,
17,
25,
32,
21,
972,
8275,
800,
3726,
3726,
92,
42,
408,
55,
143,
100,
51,
6973,
25,
4456,
13,
5,
124,
236,
17,
141,
6,
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... |
buddypress get link from wordpress
===
got Worpdress 3.4 multisite and buddypress installed on a secondary blog.
There are: example.com and example.com/community.
Users can create their own site via example.com (example.com/usersname) and socialise in example.com/community.
I have noticed that if a user (example.com/usersname) tries to view another user site (example.com/usersname1) from buddypress then example.com/usersname1 is not opened. Instead example.com/community/usersname1 is visible in buddypress
How do I enable users to view their sites from buddypress?
thank you for your support and/or steer in the right direction.
A. | 0 | [
2,
9065,
5890,
164,
3508,
37,
833,
5890,
800,
3726,
3726,
330,
13,
10041,
9251,
9058,
203,
9,
300,
1889,
9097,
17,
9065,
5890,
4066,
27,
21,
2277,
8146,
9,
80,
50,
45,
823,
9,
960,
17,
823,
9,
960,
118,
28360,
9,
3878,
92,
160... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Stop touch moves if counter reaches 3
===
I have an application with drag and drop a UIView feature. I should only let 3 drags and not more than that. How do i keep track of the number of drags? I tried incrementing a counter in touches began, but the counter got incremented on clicking the view also. I want it to be increased only when i drag the view. Also can u provide a snippet for dragging and dropping a small UIView into another view on the top. I dont know if I have used the right method.
Thanks in advance | 0 | [
2,
747,
1723,
4927,
100,
2105,
5539,
203,
800,
3726,
3726,
31,
57,
40,
3010,
29,
5501,
17,
2804,
21,
13,
5661,
4725,
1580,
9,
31,
378,
104,
408,
203,
5501,
18,
17,
52,
91,
119,
30,
9,
184,
107,
31,
643,
792,
16,
14,
234,
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... |
Converting color bmp to grayscale bmp?
===
I am trying to convert a colored BMP file to gray-scale BMP. The i/p bmp is a 24 bit and I am producing same 24 bit bmp at the output only this time in gray-scale.
The code I am using is
for(int x = 0; x < max; x++)
{
int lum;
lum = (r[x]*0.30) + (g[x]*0.59) + (b[x]*0.11);
r[x] = lum;
g[x] = lum;
b[x] = lum;
}
r,g,b arrays are the RGB color components and I have them in a char *r,*g,*b.
For some reasons I am not getting a clean output. I am attaching the o/p I am getting with this question, its patchy and contains white and black areas at palces. So whatt am I doing wrong here??
1)Is it due to data loss in calculationg of lum or is there something wrong in storing int as a char?
2) can gray-scale bmp not be 24 bit? or is it something wrong in the way I am storing rgb values after conversion?
Anyhelp in this will be much appriciated. thanks.
| 0 | [
2,
19583,
1665,
334,
2554,
20,
2030,
5093,
334,
2554,
60,
800,
3726,
3726,
31,
589,
749,
20,
8406,
21,
10133,
334,
2554,
3893,
20,
2030,
8,
5093,
334,
2554,
9,
14,
31,
118,
306,
334,
2554,
25,
21,
937,
1142,
17,
31,
589,
4081,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
External image link containing malware
===
My website allows users to attach external image to their post. Sometimes when the host server of the image has malware.
My website will have this google malware warning
http://media.photobucket.com/image/google%20malware%20warning/unfuccwittable/MalwareWarning.jpg
Is there anything i can do on my end to prevent this? Like a php code to check the image before allowing displaying of the image on my website? | 0 | [
2,
4886,
1961,
3508,
3503,
2814,
5011,
800,
3726,
3726,
51,
2271,
2965,
3878,
20,
19514,
4886,
1961,
20,
66,
678,
9,
1030,
76,
14,
2015,
8128,
16,
14,
1961,
63,
2814,
5011,
9,
51,
2271,
129,
57,
48,
8144,
2814,
5011,
3590,
7775,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Zend Framework dynamic ACL with special privileges depending on DB entries
===
I need to implement ACL in a ZF application (with Doctrine 2).
The goal is:
When a user logs in, all his privileges should be determined an saved to memcache, to be accessible quickly throughout the session.
The problem is that there a special privileges the can't be described via module > controller > action.
e.g.
table 'user'
id name
1 Admin
2 Peter
…
table 'role'
id name
1 admin
2 user
…
table 'user_role'
id user_id role_id
1 1 1
2 2 2
…
table 'item'
id owner
1 1
2 4
…
We have items, which only should be editable by the admin or the user who has created the item (owner).
How could this be described in a privileges table ?
table 'privilege'
id role_id …
1 2
| 0 | [
2,
10526,
43,
6596,
7782,
21,
5316,
29,
621,
15977,
4758,
27,
13,
9007,
11399,
800,
3726,
3726,
31,
376,
20,
8713,
21,
5316,
19,
21,
2052,
410,
3010,
13,
5,
1410,
7521,
172,
6,
9,
14,
1195,
25,
45,
76,
21,
4155,
18893,
19,
15,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I effectively nest a GridbagLayout managed pane, and get it to resize correctly?
===
I'm trying to set up my panels in my program, and I'm not getting what I think is the expected behaviour of my GridBagLayout (of course *it is* correct, GIGO). I'd like some of the components on the page to resize.
The way I have it set up is in two parts:
### 1. The Content Pane, inside the Manager Pane:
myPlayerContentPane =
new PlayerContentPane(myEventListener);
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.BOTH;
c.weightx = 1;
c.weighty =1;
this.add(myPlayerContentPane,c);
myPlayerContentPane.setBorder(BorderFactory.createLineBorder(Color.black));
This sub-pane should expand as I resize my frame, correct? This is because of the weight and fill commands.
###2. The contents of the content pane:
setLayout(new GridBagLayout());
c.insets = new Insets(1, 1, 1, 1);
c.gridx = 0;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
this.add(newCharacterButton,c);
newCharacterButton.addActionListener(new ActionListener(){
...
});
c.gridx = 1;
c.gridy = 0;
c.gridheight = 1;
c.fill = GridBagConstraints.HORIZONTAL;
this.add(newCharacterName,c);
c.gridx = 0;
c.gridy = 1;
c.fill = GridBagConstraints.HORIZONTAL;
this.add(loadCharacterButton,c);
loadCharacterButton.addActionListener(new ActionListener() {
...
});
c.gridx = 2;
c.gridy = 0;
c.fill = GridBagConstraints.HORIZONTAL;
this.add(editCharacterButton,c);
c.gridx = 2;
c.gridy = 1;
c.fill = GridBagConstraints.HORIZONTAL;
this.add(deleteCharacterButton,c);
deleteCharacterButton.addActionListener(new ActionListener(){
...
});
c.gridx = 2;
c.gridy = 2;
c.fill = GridBagConstraints.BOTH;
c.gridheight = 3;
c.ipady = 200;
c.weighty = 1;
this.add(characterListScroller,c);
c.gridx = 0;
c.gridy = 4;
c.fill = GridBagConstraints.BOTH;
c.gridwidth = 2;
c.ipady = 200;
c.weighty =1;
this.add(characterSummaryScroller,c);
Now, when the program loads it looks fine, and I expect on resizing that the two JScrollPanes would resize. However, even when I've removed all instances of setting a preferred size in my code (even for the frame itself) I don't see *any* resizing behaviour.
Here is the setup when the program first loads, snapped to the minimum size:
![enter image description here][1]
And here is when I've resized the frame, and the panels don't follow suit.
![enter image description here][2]
Now my Manager pane *is* inside a frame with a CardLayout, and I've just checked and that doesn't resize with the frame. And that's the top level pane (that I set up). How can I make it all resize?
[1]: http://i.stack.imgur.com/EeiTD.png
[2]: http://i.stack.imgur.com/btcUz.png | 0 | [
2,
184,
92,
31,
5463,
5618,
21,
7354,
8632,
4414,
1320,
1471,
13,
16660,
15,
17,
164,
32,
20,
302,
10454,
12044,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
309,
71,
51,
9449,
19,
51,
625,
15,
17,
31,
22,
79,
52,
1017,
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... |
PHP MVC - Template / Loading variables Issue
===
I am creating a basic MVC structured CMS in PHP as a means to learn how MVC works (thus the reason I am not using a true prebuilt engine). I have a basic version working that is in structure very similar to this tutorial [here][1]. I'd like however for the views to be loaded automatically, bypassing the need for a template class. If this is strongly recommended I'll stick with the template concept (if someone could explain WHY it's so necessary I would greatly appreciate it.) Anyways, below is my router class which I have modified to automatically load the view files along the controller.
public function loader() {
/*** check the route ***/
$this->getPath();
/*** if the file is not there diaf ***/
if (is_readable($this->controller_path) == false) {
$this->controller_path = $this->path.'/controller/error404.php';
$this->action_path = $this->path.'/view/error404.php';
}
/*** include the path files ***/
include $this->controller_path;
include $this->action_path;
/*** a new controller class instance ***/
$class = $this->controller . 'Controller';
$controller = new $class($this->registry);
/*** check if the action is callable ***/
if (is_callable(array($controller, $this->action)) == false) {
$action = 'index';
} else {
$action = $this->action;
}
$controller->$action();
}
/**
*
* @get the controller
*
* @access private
*
* @return void
*
*/
private function getPath() {
/*** get the route from the url ***/
$route = (empty($_GET['rt'])) ? '' : $_GET['rt'];
if (empty($route)) {
$route = 'index';
} else {
/*** get the parts of the route ***/
// mywebsite.com/controller/action
// mywebsite.com/blog/hello
$parts = explode('/', $route);
$this->controller = $parts[0];
if(isset( $parts[1])) {
$this->action = $parts[1];
}
}
if( ! $this->controller ) { $this->controller = 'index'; }
if( ! $this->action ) { $this->action = 'index'; }
/*** set the file path ***/
$this->controller_path = $this->path .'/controller/'. $this->controller . '.php';
$this->action_path = $this->path .'/view/'. $this->controller . '/'. $this->action . '.php';
}
This is preventing my view files from loading the variables given by the controller (the tutorial website has a better demonstration of this) but when setting `$this->registry->template->blog_heading = 'This is the blog Index';` the view doesn't load it because the template.class is bypassed. Basically what I'm asking is how do shift the template.class over into the loading functions?
[1]: http://www.markisgood.com/blog/php/create-your-own-lightweight-php-mvc-framework | 0 | [
2,
13,
26120,
307,
8990,
13,
8,
22894,
13,
118,
12797,
12157,
1513,
800,
3726,
3726,
31,
589,
2936,
21,
2125,
307,
8990,
17784,
2390,
18,
19,
13,
26120,
28,
21,
1108,
20,
2484,
184,
307,
8990,
693,
13,
5,
11782,
14,
1215,
31,
58... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ember-data and how to trigger commit when all bindings and observers have updated?
===
I have a Item model that has many Sections. Each Item is stored in mongodb and the sections are embedded documents, so i when i get an item the json contains the sections.
When i change a property in a section, a number of other sections can also change as they are bound to that property.
How do i save this change to the server after all bindings and observers have been comleted ?
I don't really want my users to have to click a save button but i also don't want to save after each change as i will be saving after the change and also after the bound sections changes as well!!
Hope this makes sense.
If anyone can show me an example of how to do this it would be great!
thanks a lot
Rick | 0 | [
2,
13,
19603,
8,
18768,
17,
184,
20,
7286,
9686,
76,
65,
8728,
18,
17,
16635,
57,
6372,
60,
800,
3726,
3726,
31,
57,
21,
9101,
1061,
30,
63,
151,
4501,
9,
206,
9101,
25,
8214,
19,
3521,
5474,
220,
17,
14,
4501,
50,
12138,
4374... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Difference between RASPHONE.exe and RASDIAL.exe
===
I try to make a dial-up connection programatically. I tried with RASdial.exe and RASPhone.exe, Both does the same except RasDial.exe display the errors in console where as RasPhone.exe gives in user Interface.
Can Someone explain me the difference between Rasdial and Rasphone and also which is right one to make a dial-up connection. And I want the error messages in User Interface and not in console.
Please explain me in detail. | 0 | [
2,
2841,
128,
7172,
7709,
9,
1706,
62,
17,
7172,
43,
2815,
9,
1706,
62,
800,
3726,
3726,
31,
1131,
20,
233,
21,
11601,
8,
576,
2760,
625,
721,
8438,
9,
31,
794,
29,
7172,
43,
2815,
9,
1706,
62,
17,
7172,
7709,
9,
1706,
62,
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... |
Call javascript function form jquery
===
I've got a problem with using javascript function inside Jquery.
I want to get max and min value to the jquery SLIDER.
Please help.
Here is the markup.
$(document).ready(function() {
Here is the function MAX
function getMax()
{
var options = document.getElementById('.price_range').childNodes;
var min = 999999999;
for(var i = 0; i < options.length; i++) {
if(options[i].value > max) max = options[i].value;
}
return max;
}
Here is the function MIN
function getMin()
{ var options =document.getElementById('.price_range').childNodes;
var min = 999999999;
for(var i = 0; i < options.length; i++) {
if(options[i].value < min) min = options[i].value;
}
return min;
}
Here comes the slider function, it has to get min and max values from javascript functions
// Slider
$('#slider').slider({
range: true,
min: getMin(),
max: getMax(),
step: 10, // Use this determine the amount of each interval
values: [ 20, 40 ], // The default range
slide: function( event, ui ) {
$( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] ); // for input text box
$( "#my_min" ).val(ui.values[ 0 ]); // Display and selected the min Price
$( "#my_max" ).val(ui.values[ 1 ]); // Display and selected the max Price
}
});
//For dropdown box
$( "#my_min" ).val($( "#slider" ).slider( "values", 0 ));
$( "#my_max" ).val($( "#slider" ).slider( "values", 1 ));
$("select.price_range").change(function () {
$myMinValue = $("#my_min option:selected").val();
$myMaxValue = $("#my_max option:selected").val();
//Make changes on the slider itself
if($myMinValue <= $myMaxValue) {
$( "#slider" ).slider({
values: [$myMinValue, $myMaxValue]
});
} else {
alert("Invalid Input");
}
});
});
and here is the index.html
<body>
<select id="my_min" class="price_range">
<option value="0">0</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select>
<select id="my_max" class="price_range">
<option value="0">0</option>
<option value="10">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
</select
><!-- Slider -->
<h2 class="demoHeaders">Slider</h2>
<label for="amount">Price range:</label>
<input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;"> | 0 | [
2,
645,
8247,
8741,
1990,
505,
487,
8190,
93,
800,
3726,
3726,
31,
22,
195,
330,
21,
1448,
29,
568,
8247,
8741,
1990,
572,
487,
8190,
93,
9,
31,
259,
20,
164,
2049,
17,
4232,
1923,
20,
14,
487,
8190,
93,
3295,
106,
9,
2247,
44... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
text mining/analyse user commands/questions algorithm or library
===
I got a financial application and I wish to add to it the ability to get user command or input in textbox and then take the right action. for example, wish the user to write "show the revenue in the last 10 days" and it'll show the revenue to him/her - the point is that I wish it to really understand the meaning of the question, so the previus statement will bring the same results as "do I got any revenue in the last 10 days" or something like that - BI (something like the Wolfram|Alpha engine).
I wonder if there's any opensource library or algorithm books or whatever that I can use to learn the subject. Regards to opensource libraries - I don't mind which language it'll be written in.
I've read about this subject and saw many engines and services (OpenNLP, Apache UIMA, CoreNLP etc.) but did not figure out if they're right for my needs.
Any answer or suggestion is welcome.
Many thanks! | 0 | [
2,
1854,
4243,
118,
21702,
4155,
14294,
118,
24652,
18,
9083,
54,
1248,
800,
3726,
3726,
31,
330,
21,
1553,
3010,
17,
31,
2536,
20,
3547,
20,
32,
14,
2165,
20,
164,
4155,
1202,
54,
6367,
19,
1854,
5309,
17,
94,
247,
14,
193,
102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to show email sent notification ipad
===
I've a mail controller which successfully sends email.
But I want to show a notification of "Email Sent Successfully" as the email is sent. Is there a way to do that?
Thanks. | 0 | [
2,
184,
20,
298,
8517,
795,
52,
4634,
31,
8240,
800,
3726,
3726,
31,
22,
195,
21,
4216,
9919,
56,
3673,
11350,
8517,
9,
47,
31,
259,
20,
298,
21,
52,
4634,
16,
13,
7,
62,
8079,
795,
3673,
7,
28,
14,
8517,
25,
795,
9,
25,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... |
How to save changes to WPF datagrid wich showing data form 2 joined table?
===
I have 2 table:
**Person**:
p_id
p_name
c_id
**Car**:
c_id
c_name
Here is my XAML tag:
<DataGrid Name="dataGrid1"
ItemsSource="{Binding Path=myPath}"
AutoGenerateColumns="True" />
And here is the C#:
a = new SqlDataAdapter("SELECT p.p_name AS Person, c.c_name AS Car FROM Person AS p, Car AS c WHERE p.c_id = c.c_id", c);
d = new DataSet();
a.Fill(d, "myPath");
dataGrid.DataContext = d;
Sure I can view but I cannot edit the data. I hope by some "Magic" I can turn the Car-TextColumn into a ComboBox with the Item list from the Car table.
Sory if this question was asked, this is the first time I try C# and WPF, not sure what keywords to search! | 0 | [
2,
184,
20,
2079,
1693,
20,
619,
7721,
1054,
16375,
13,
13583,
3187,
1054,
505,
172,
670,
859,
60,
800,
3726,
3726,
31,
57,
172,
859,
45,
13,
1409,
7276,
1409,
45,
351,
1,
1340,
351,
1,
7259,
272,
1,
1340,
13,
1409,
1367,
1409,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
gmap3 show address in infowindow
===
I have a click event on my map markers to create an infowindow, i am trying to geocode the address to show inside the infowindow.
click: function(marker) {
pantoUser(lati,longi,i);
addInfoWindow(lati,longi,name,datestring);
}
I nearly have it working like so:
function addInfoWindow(lati,longi,name,datestring)
{
// get address
getAddress(lati,longi);
// create infowindow
$('#dispatcher').gmap3(
{ action: 'addInfoWindow',
latLng: [lati, longi],
infowindow:{
options:{
content: name
},
events:{
closeclick: function(infowindow, event){
//alert('closing : ' + $(this).attr('id') + ' : ' + infowindow.getContent());
}
},
apply:[
{ action:'setContent',
args:[
'<span class="infowindow">' + name + '<br />' + content + '<br />' + datestring + '<span>'
]
}
]
}
}
);
}
and then the get address part:
function getAddress(lati,longi)
{
$("#dispatcher").gmap3({
action:'getAddress',
latLng: [lati, longi],
callback:function(results){
content = results && results[1] ? results && results[1].formatted_address : 'No Address';
return content;
}
});
}
The problem is that the geocoded address is always one marker click behind. For example i may click on a marker in london and nothing happens. So i click it again and i get the infowindow with the address. Then i click on a marker in Manchester and i still see the london address, then i click on a marker in Liverpool and i get the Manchester address. and so on.
Can anyone spot the bug? | 0 | [
2,
489,
15022,
240,
298,
3218,
19,
15404,
27508,
800,
3726,
3726,
31,
57,
21,
10840,
807,
27,
51,
2942,
19482,
20,
1600,
40,
15404,
27508,
15,
31,
589,
749,
20,
6389,
9375,
14,
3218,
20,
298,
572,
14,
15404,
27508,
9,
10840,
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... |
How do I let multiple Threads paint onto an AWT component?
===
first of all, this is my very first question here, so if I make any mistakes, please tell me.
I am trying to write a Mandelbrot Fractal Program in Java, for training purposes. The ideal for all the functionality I want to have is the Fractalizer (<http://www.fractalizer.de/en/>), but for now, I will be happy with a program that draws the Mandelbrot Set on the screen (instead of, for example, writing it to an image file). Of course, I want the program to be fast, so I thought that I could split the calculation into multiple threads to utilize my multi-core processor; for example, on a quad-core system, the image would be divided into 2x2=4 images, each to be calculated by a separate thread. All these threads get a Graphics object passed on which they draw the pixels as they are calculated.
My first attempt to get this working was to have the threads draw on a BufferedImage.getGraphics() and to have the paint() method constantly call repaint() as long as the image isn't finished:
g.drawImage(tempImg, 0, 0, null);
if (waiterThread.isAlive())
{
try
{
Thread.sleep(10);
} catch (InterruptedException e)
{
// do nothing
}
repaint(10);
}
(waiterThread joins all calculating threads one after another, so as long as the waiterThread is alive, at least one calculating thread is not yet finished.)
This works, but causes ugly flickering on the canvas because of the frequent repainting.
Then, by means of a small test program, I found out that Graphics.draw*anything* draws on the screen instantly, before the paint method returns, so my current approach is the following:
- One Panel with a GridLayout that contains 2x2 (on a <4-core system, 1x1) MandelbrotCanvas objects
- Each MandelbrotCanvas object will, on the first paint() call, initialize a calculating Thread, pass its own Graphics object to it (actually, I'm using a custom GroupGraphics class that passes one Graphics call to several graphics, to "backup" the image into a BufferedImage.getGraphics(), but that's not important), and start the calculating thread.
- The panel will in its paint() method fetch the calculating threads from each of the MandelbrotCanvases and join() them.
Unfortunately, this creates only a black screen. Only when calculation is finished, the image is displayed.
What is the right way to have several threads paint onto one component? | 0 | [
2,
184,
107,
31,
408,
1886,
20396,
5107,
1204,
40,
13,
3885,
38,
5912,
60,
800,
3726,
3726,
64,
16,
65,
15,
48,
25,
51,
253,
64,
1301,
235,
15,
86,
100,
31,
233,
186,
13623,
15,
2247,
494,
55,
9,
31,
589,
749,
20,
2757,
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... |
Missing Local DTC in MSDTC
===
First i couldn't start MSDTC service.I tried following link and solve that problem. link : http://social.technet.microsoft.com/Forums/en-ZA/winserverhyperv/thread/d3de5460-fb42-4af0-ac75-27c22741c7e9 .Now I'm having problem with missing Local DTC in MSDTC.(I checked with component services).I'm using windows 7(64bit).Any tips on how i can resolve this? | 0 | [
2,
2863,
375,
13,
43,
6668,
19,
4235,
43,
6668,
800,
3726,
3726,
64,
31,
711,
22,
38,
799,
4235,
43,
6668,
365,
9,
49,
794,
249,
3508,
17,
8402,
30,
1448,
9,
3508,
13,
45,
7775,
6903,
11559,
9,
6524,
2328,
9,
22019,
12980,
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... |
Thrift -- Socket closed prematurely
===
I am using thrift client-server communication for a webapp.
I have got two services A and B
Service A is in **Java** and runs **TthreadPoolServer**
Service B is **python** and runs **TThreadedServer**
Problem occurs when:
1. Webapp calls Service A.
2. Service A in turn calls few other services and then at the end calls Service B.
3. Service B in turn calls Service A for some other data.
4. While Service B is still doing work, exception comes midway in **A-->B thrift call** with following StackTrace.
org.apache.thrift.transport.TTransportException: java.net.SocketException: Socket closed
at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:129)
at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101)
at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378)
at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297)
at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
at in.shop2020.model.v1.user.PromotionService$Client.recv_applyCoupon(PromotionService.java:235)
Some points regarding this problem that I have noted are following:
1. This issue occurs on one server and not on other.
2. All sockets are created successfully as Service B actually does all work that it is supposed to do. In fact it even calls service A again to get some data.
3. Time between service B call and exception is generally very less. It almost always stays less than 100 ms.
4. I have tried increasing timeouts for all sockets(Service A client, Service A server, Service B client, Service B server).
5. I have also tried increasing number of workerthreads in TthreadPoolServer in Service A
6. I have also tried setting soLinger true for TScocket
7. I saw that sockets were getting created for call from Service A to Service B.
8. The positioning of this method call is irrelevant for the problem in Service A method.
9. If I remove the call to Service A from Service B I don't get the exception | 0 | [
2,
13,
96,
9807,
38,
13,
8,
8,
18482,
827,
17769,
102,
800,
3726,
3726,
31,
589,
568,
13,
96,
9807,
38,
6819,
8,
10321,
106,
3291,
26,
21,
2741,
7753,
9,
31,
57,
330,
81,
687,
21,
17,
334,
365,
21,
25,
19,
13,
1409,
1004,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 quotes to a number in a string
===
I have the following **almost** JSON string:
<?php
$string = "{0:{"id":1,"name":"Antiek en Kunst","subs":[{"id":2,"name":"Antiek | Bestek"},{"id":3,"name":"Antiek | Boeken en Bijbels"},{"id":1100,"name":"Antiek | Emaille"},{"id":1501,"name":"Antiek | Gereedschap en Instrumenten"},{"id":1648,"name":"Antiek | Glas en Kristal"},{"id":2614,"name":"Antiek | Goud en Zilver"},{"id":2661,"name":"Antiek | Kandelaars"},{"id":1841,"name":"Antiek | Kantoor en Zakelijk"},{"id":1502,"name":"Antiek | Keramiek en Aardewerk"},{"id":1842,"name":"Antiek | Keukenbenodigdheden"},{"id":2118,"name":"Antiek | Kleden en Textiel"},{"id":1503,"name":"Antiek | Kleding en Accessoires"},{"id":6,"name":"Antiek | Klokken"},{"id":1647,"name":"Antiek | Koper en Brons"},{"id":7,"name":"Antiek | Lampen"},{"id":1504,"name":"Antiek | Meubels | Bedden"},{"id":5,"name":"Antiek | Meubels | Kasten"},{"id":1505,"name":"Antiek | Meubels | Stoelen en Banken"},{"id":1506,"name":"Antiek | Meubels | Tafels"},{"id":1101,"name":"Antiek | Naaimachines"},{"id":10,"name":"Antiek | Porselein"},{"id":1102,"name":"Antiek | Religie"},{"id":1103,"name":"Antiek | Schalen"},{"id":2662,"name":"Antiek | Schoolplaten"},{"id":1843,"name":"Antiek | Servies compleet"},{"id":12,"name":"Antiek | Servies los"},{"id":1507,"name":"Antiek | Speelgoed"},{"id":2663,"name":"Antiek | Spiegels"},{"id":2664,"name":"Antiek | Tin"},{"id":11,"name":"Antiek | Tv's en Audio"},{"id":14,"name":"Antiek | Vazen"},{"id":1104,"name":"Antiek | Wandborden en Tegels"},{"id":1500,"name":"Antiek | Woonaccessoires"},{"id":9,"name":"Antiek | Overige"},{"id":15,"name":"Curiosa en Brocante"},{"id":1423,"name":"Diensten | Kunstenaars en Portretschilders"},{"id":2610,"name":"Diensten | Reparatie en Onderhoud"},{"id":23,"name":"Kunst | Beelden en Houtsnijwerken"},{"id":1508,"name":"Kunst | Designobjecten"},{"id":1105,"name":"Kunst | Etsen en Gravures"},{"id":27,"name":"Kunst | Litho's en Zeefdrukken"},{"id":1844,"name":"Kunst | Niet-Westerse kunst"},{"id":1846,"name":"Kunst | Schilderijen | Abstract"},{"id":25,"name":"Kunst | Schilderijen | Klassiek"},{"id":1845,"name":"Kunst | Schilderijen | Modern"},{"id":26,"name":"Kunst | Tekeningen en Foto's"},{"id":24,"name":"Kunst | Overige"}]},1:{"id":31,"name":"Audio, Tv en Foto","subs":[{"id":2035,"name":"Accu's en Batterijen"},{"id":2617,"name":"Afstandsbedieningen"},{"id":32,"name":"Bandrecorders"},{"id":1132,"name":"Beamers"},{"id":2665,"name":"Blu-ray-spelers en Blu-ray-recorders"},{"id":33,"name":"Buizenversterkers"},{"id":2036,"name":"Cassettedecks"},{"id":35,"name":"Cd-spelers"},{"id":2666,"name":"Diaprojectors"},{"id":2042,"name":"Diensten | Film- en Videobewerking"},{"id":1199,"name":"Diensten | Fotografen"},{"id":1219,"name":"Diensten | Reparaties"},{"id":1114,"name":"Dvd-spelers en Dvd-recorders"},{"id":1115,"name":"Films 8mm, 16mm en 35mm"},{"id":1360,"name":"Fotografie | Accu's en Batterijen"},{"id":480,"name":"Fotografie | Camera's | Analoog"},{"id":487,"name":"Fotografie | Camera's | Digitaal"},{"id":2667,"name":"Fotografie | Digitale fotolijstjes"},{"id":488,"name":"Fotografie | Doka Toebehoren"},{"id":1720,"name":"Fotografie | Filters"},{"id":489,"name":"Fotografie | Flitsers"},{"id":1483,"name":"Fotografie | Fotolijsten en Fotoalbums"},{"id":1721,"name":"Fotografie | Fotoprinters en Fotopapier"},{"id":1400,"name":"Fotografie | Fotostudio en Toebehoren"},{"id":1484,"name":"Fotografie | Fototassen"},{"id":493,"name":"Fotografie | Geheugenkaarten"},{"id":495,"name":"Fotografie | Lenzen en Objectieven"},{"id":497,"name":"Fotografie | Onderwatercamera's"},{"id":501,"name":"Fotografie | Professionele apparatuur"},{"id":500,"name":"Fotografie | Statieven en Balhoofden"},{"id":1722,"name":"Harddiskrecorders"},{"id":1116,"name":"Home Cinema-sets"},{"id":1106,"name":"Kabels"},{"id":37,"name":"Koptelefoons en Headsets"},{"id":38,"name":"Luidsprekers"},{"id":2668,"name":"Mediaspelers"},{"id":40,"name":"Mp3-spelers | Apple iPod"},{"id":1649,"name":"Mp3-spelers | Overige merken"},{"id":1723,"name":"Mp3-spelers | Accessoires | Apple iPod"},{"id":1452,"name":"Mp3-spelers | Accessoires | Overige merken"},{"id":2615,"name":"Mp4-spelers"},{"id":1724,"name":"Opladers"},{"id":496,"name":"Optische apparatuur | Microscopen"},{"id":502,"name":"Optische apparatuur | Telescopen"},{"id":503,"name":"Optische apparatuur | Verrekijkers"},{"id":42,"name":"Platenspelers en Pick-ups"},{"id":1117,"name":"Professionele Audio-, Tv- en Video-apparatuur"},{"id":43,"name":"Radio's"},{"id":36,"name":"Stereo-sets"},{"id":45,"name":"Tuners"},{"id":1118,"name":"Tv-decoders en Schotelantennes"},{"id":1120,"name":"Tv's | Plasma, Lcd en Led"},{"id":1121,"name":"Tv's | Overige Tv's"},{"id":1453,"name":"Tv's | Accessoires"},{"id":46,"name":"Versterkers en Receivers"},{"id":1129,"name":"Videobewakingsapparatuur"},{"id":1130,"name":"Videocamera's | Analoog"},{"id":1131,"name":"Videocamera's | Digitaal"},{"id":1133,"name":"Videospelers en Videorecorders"},{"id":47,"name":"Walkmans, Discmans en Minidiscspelers"},{"id":1725,"name":"Weerstations en Barometers"},{"id":41,"name":"Overige Audio, Tv en Foto"}]}}";
?>
I need to convert all the integers to strings, this can be done with adding double quotes (`"`) to them. However, how would the be done? It doesn't need to be PHP specific, notepad++ is able to use regexes to search and replace but I'm not sure if this is the right method to do this. Any help is appreciated. | 0 | [
2,
4721,
18901,
20,
21,
234,
19,
21,
3724,
800,
3726,
3726,
31,
57,
14,
249,
13,
1409,
18135,
1409,
487,
528,
3724,
45,
13,
1,
60,
26120,
5579,
11130,
800,
13,
7,
1,
387,
45,
1,
7,
1340,
7,
45,
165,
15,
7,
7259,
7,
45,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i obtain one row in excel for very long words?
===
Excel 2007 split very long words in many row..This is a problem for me because i want one row. the problem is that it should determine the length of each line and break it by inserting a TAB. Only in this way puts me excel on neighboring cells
Look here:
http://img594.imageshack.us/img594/6712/veylongwordsproblem.png | 0 | [
2,
184,
92,
31,
5545,
53,
3131,
19,
20700,
26,
253,
175,
715,
60,
800,
3726,
3726,
20700,
624,
2132,
253,
175,
715,
19,
151,
3131,
9,
9,
1565,
25,
21,
1448,
26,
55,
185,
31,
259,
53,
3131,
9,
14,
1448,
25,
30,
32,
378,
3746,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
REGEX - Having trouble getting the basics
===
I am very new to Regular expression so I apologise for the 'noobyness' of the question...
I need to match a pattern for an ID we use at work.
So far the only specification for the pattern is that it will be 9 characters long, and comprised of Capital letters and digits. The ID can contain 1 or any number of Capital letters or digits, so long as the total length of the string is 9 characters long.
So far i have the following... [A-Z][0-9]{9}
this does not makes sure the string has atleast one letter or digit (so a 9 character long string would pass)... Alos, Im sure it matched a 9 letter word made of non capitals.
I have done a fair bit of googling, but i have not found anything dumbed down enough for me to understand.
Any help very apppreciated :)
Thanks | 0 | [
2,
7953,
1706,
13,
8,
452,
2572,
1017,
14,
2125,
18,
800,
3726,
3726,
31,
589,
253,
78,
20,
1290,
1803,
86,
31,
26645,
26,
14,
13,
22,
251,
111,
779,
720,
22,
16,
14,
1301,
9,
9,
9,
31,
376,
20,
730,
21,
3732,
26,
40,
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... |
String in Java - Replacing character in a String
===
I have a String that stored in the following format. It represents a time value.
1:31:25
I would like to show to replace the colons and change the format to:
1h 31m 25s
What function in Java will let me replace the first two colons with "h ' and 'm ', and the end of the string with 's'.
I need some help coding this. | 0 | [
2,
3724,
19,
8247,
13,
8,
5496,
925,
19,
21,
3724,
800,
3726,
3726,
31,
57,
21,
3724,
30,
8214,
19,
14,
249,
2595,
9,
32,
4719,
21,
85,
1923,
9,
137,
23659,
45,
1811,
31,
83,
101,
20,
298,
20,
3934,
14,
10766,
18,
17,
753,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Common footer is not display in second.html
===
Hi I have one separate page for footer as footer.html & I want to use that in all other html files,But it is displays only in index.html (Main file or starting page of my application in phonegap project), And in other pages it is not display. My footer.html is as:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" charset="utf-8" src="js/main.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
</head>
<body>
<div data-role="navbar" data-iconpos="top">
<ul>
<li><a class="ui-btn-active" href="#page1" data-theme="a"
data-icon="home"> Home </a></li>
<li><a href="#page3" data-theme="a" data-icon="plus"> Feeds </a>
</li>
<li><a href="#page7" data-theme="a" data-icon="grid"> Gadgets
</a></li>
<li><a href="#page9" data-theme="a" data-icon="info"> Profile
</a></li>
<li><a href="#page14" data-theme="a" data-icon="gear">
Settings </a></li>
</ul>
</div>
</body>
</html>
My index.html is as:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile: Demos and Documentation</title>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
<!-- Uncomment following line to access PhoneGap APIs (not necessary to use PhoneGap to package web app) -->
<!-- <script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>-->
<script type="text/javascript">
$('[data-role=page]').live('pageshow', function (event, ui)
{
$("#" + event.target.id).find("[data-role=footer]").load("footer.html", function()
{
$("#" + event.target.id).find("[data-role=navbar]").navbar();
});
});
</script>
</head>
<body>
<div data-role="page" id="jqm-home" class="type-home">
<div data-role="content">
<div class="content-secondary">
<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="f">
<li data-role="list-divider">Overview</li>
<li><a href="second.html" >First</a></li>
<li><a href="#">Features</a></li>
<li><a href="#">Accessibility</a></li>
<li><a href="#">Supported platforms</a></li>
</ul>
</div><!--/content-primary-->
</div>
<div data-role="footer" data-theme="d" data-position="fixed">
</div>
</div>
</body>
</html>
And second.html is as:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery Mobile: Demos and Documentation</title>
<link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.1.0.css" />
<link rel="stylesheet" href="docs/assets/css/jqm-docs.css" />
<link rel="stylesheet" href="docsdemos-style-override.css" />
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.0.js"></script>
<!-- Uncomment following line to access PhoneGap APIs (not necessary to use PhoneGap to package web app) -->
<!-- <script type="text/javascript" charset="utf-8" src="cordova-1.6.1.js"></script>-->
<script type="text/javascript">
$('[data-role=page]').live('pageshow', function (event, ui)
{
$("#" + event.target.id).find("[data-role=footer]").load("footer.html", function()
{
$("#" + event.target.id).find("[data-role=navbar]").navbar();
});
});
</script>
</head>
<body>
<div data-role="page" id="jqm-home" class="type-home">
<div data-role="content">
<div class="content-secondary">
<ul data-role="listview" data-inset="true" data-theme="c" data-dividertheme="f">
<li data-role="list-divider">2nd page</li>
<li><a href="index.html" >Second</a></li>
<li><a href="#">Features</a></li>
<li><a href="#">Accessibility</a></li>
<li><a href="#">Supported platforms</a></li>
</ul>
</div><!--/content-primary-->
</div>
<div data-role="footer" data-theme="d" data-position="fixed">
</div>
</div>
</body>
</html>
Here in second.html footer is not display. And one more query when I click on First list control goes to second.html file but sometimes it does not go and sometimes only black screen appears. Why is it so?
Thanks in advance. Any help will be appreciated.
| 0 | [
2,
757,
1749,
106,
25,
52,
3042,
19,
153,
9,
15895,
800,
3726,
3726,
4148,
31,
57,
53,
1725,
2478,
26,
1749,
106,
28,
1749,
106,
9,
15895,
279,
31,
259,
20,
275,
30,
19,
65,
89,
13,
15895,
6488,
15,
811,
32,
25,
9412,
104,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mongodb geospatial index error when using $near
===
I'm receiving an error when attempting to use $near instead of geoNear. The error doesn't give any reason:
{$err: "use geoNear command rather than $near query", "code": 13501}
geoNear works if I use that instead but I'd like to know why $near doesn't... | 0 | [
2,
3521,
5474,
220,
6389,
18,
10563,
192,
4348,
7019,
76,
568,
5579,
14114,
800,
3726,
3726,
31,
22,
79,
3396,
40,
7019,
76,
6314,
20,
275,
5579,
14114,
700,
16,
6389,
14114,
9,
14,
7019,
1437,
22,
38,
590,
186,
1215,
45,
13,
1,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Debug gcc code using cmake
===
I have an c++ application developed using gcc(4.1) and compiled with CMAKE MakeFiles . The Code is large in size and debugging it is tough. I dont know how to debug the code line by line using cmake Utility. Any idea how to do it?
Thanks in advance :) .
| 0 | [
2,
184,
20,
121,
16254,
489,
3384,
1797,
568,
272,
11115,
800,
3726,
3726,
31,
57,
40,
272,
20512,
3010,
885,
568,
489,
3384,
5,
300,
9,
165,
6,
17,
9316,
29,
272,
11115,
233,
16877,
18,
13,
9,
14,
1797,
25,
370,
19,
1072,
17,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Rails 3 rendering partial with javascript from remote: true call
===
I have a `remote: true` call in my Rails 3 app controller `HotelsController`, which executes `show_map` action. Pretty simple.
<%= link_to "Map", show_hotel_map_path(@hotel.id), remote: true %>
<div id="hotel_map"></div>
`show_hotel_map` action is pretty basic
def show_hotel_map
@hotel = Hotel.find(params[:id])
respond_to do |format|
format.html
format.js
end
end
`show_hotel_map.js.erb` is meant to render a partial `map` within JQuery-UI dialog with rendered Google Maps map
$("#hotel_map").dialog({
autoOpen: true,
height: 'auto',
width: 'auto',
modal: true,
closeOnEscape: true,
position: 'center',
resizable: false,
title: "Map",
open: function(){
$("#hotel_map").html("<%= escape_javascript(render partial: "map") %>")
}
});
`_map.html.erb` partial does nothing but executes `render_map` helper
<%= render_map %>
`render_map` helper does all the stuff with rendering a map with `Gmaps4Rails` gem
module HotelsHelper
def render_map
if @hotel.address.latitude && @hotel.address.longitude
map = @hotel.address.to_gmaps4rails
else
geo = Gmaps4rails.geocode("#{@hotel.continent.name}, #{@hotel.country.name}, #{@hotel.location.name}")[0]
map = [{lat: geo[:lat], lng: geo[:lng]}].to_json
end
gmaps(:markers => { :data => map, :options => { :draggable => true } })
end
end
The problem is that `Gmaps4Rails` gem renders some javascript for proper Google Maps handling, but apparently this javascript is being truncated by `escape_javascript` call from `show_map.js.erb` view. So when I click `"Map"` link, JQuery-UI dialog is being rendered, but it does not have any payload, since no Javascript was executed. `render_map` helper works perfectly by itself, so I guess that's not a problem with `Gmaps4Rails` gem. Is there any workarounds so I can execute that javascript? I can think of few hacks, but maybe there is more Rail-ish way to do it?
Thank you!
| 0 | [
2,
2240,
18,
203,
15307,
7284,
29,
8247,
8741,
37,
5388,
45,
1151,
645,
800,
3726,
3726,
31,
57,
21,
13,
1,
99,
20209,
45,
1151,
1,
645,
19,
51,
2240,
18,
203,
4865,
9919,
13,
1,
7010,
6798,
12898,
1252,
1,
15,
56,
15644,
18,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to configure url mapping in web.xml?
===
I have few pages in following structure.
--Project<br> |---WebContect<br> |----Admin/ *<br> |----Author/ *
<br> |----Readonly/ *
<br> |----Index.jsp
I want to restrict the user from accessing Pages under `Admin,Author and Readonly`. I DONT WANT ANY BODY TO ACCESS THESE PAGES.And if somebody tries to do so, should be redirected to `index.jsp`
<BR><BR>
The easiest solution that come in my mind is implementation of **`Filters`**, but I am trying to find if its possible to to using **`Web.xml`** | 0 | [
2,
184,
20,
1065,
15951,
287,
6362,
13305,
19,
2741,
9,
396,
8184,
60,
800,
3726,
3726,
31,
57,
310,
4434,
19,
249,
1411,
9,
13,
8,
8,
21011,
1,
5145,
1,
279,
13502,
3401,
73,
1569,
13502,
3401,
73,
1,
8,
8,
8,
14113,
1126,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.