unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Destroying the caller
===
A `v8::Handle<v8::Object>` packs a native class with some of its members. This is how its meant to work:
someobj = window.createNewWrappedClassObject();
[object Object] { fn1:[function], fn2:[function] .... destroy:[function] };
someobj.fn1(); [...] // do something with someobj
someobj.destroy(); // when done, call destroy(). now someobj not only would be
// inoperable, it would also get set to {} or null or etc.
With `someobj.fn1()`, `someobj.fn2()`, `someobj.destroy()` being the wrapped functions. Initialization logic in constructor looks like this:
WrappedClass::GetWrappedObject(){
Local<ObjectTemplate> objectTemplate = ObjectTemplate::New();
objectTemplate->SetInternalFieldCount(1);
this->instance = objectTemplate->NewInstance();
this->instance->SetPointerInInternalField(0, this);
this->instance->Set(String::New("fn1"),
FunctionTemplate::New(Fn1)->GetFunction());
[...] // so on
}
Now the thing is, when calling `destroy()` what I wanted to do basically was to force all references to that object to become `null`. So here's what I thought:
Handle<Value> WrappedClass::Fn1(const Arguments& args){
WrappedClass * CurrentInstance =
static_cast<WrappedClass *>(args.This()->GetPointerFromInternalField(0));
CurrentInstance->~WrappedClass();
CurrentInstance->instance->Clear(); // tricky part right here and
args.This()->Clear(); // also here on these two lines
return v8::Null();
}
What happens? Nothing happens, the function never actually returns. I fixed this by not calling `->Clear()` and instead do `someobj = someobj.destroy(); ` in JS.
But here's the funny part. After running it multiple times, the whole computer was gone crazy. Explorer windows losing fonts, losing window decorations, system time in taskbar disappearing, start menu showing dark rectangles instead of icons. You name it.
Why did this happen? And how was I supposed to set the calling object to null instead? | 0 | [
2,
10498,
14,
21326,
800,
3726,
3726,
21,
13,
1,
710,
457,
45,
45,
3203,
413,
1,
710,
457,
45,
45,
23793,
1,
18936,
21,
1275,
718,
29,
109,
16,
82,
443,
9,
48,
25,
184,
82,
1380,
20,
170,
45,
109,
111,
11741,
800,
1463,
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... |
Javascript download link
===
Is there any way to create a link that downloads a file without the user having to right-click and choose "save linked file as"? Do you need PHP to do this or can it be executed with Javascript only? | 0 | [
2,
8247,
8741,
7121,
3508,
800,
3726,
3726,
25,
80,
186,
161,
20,
1600,
21,
3508,
30,
7121,
18,
21,
3893,
366,
14,
4155,
452,
20,
193,
8,
150,
10129,
17,
3538,
13,
7,
19863,
4727,
3893,
28,
7,
60,
107,
42,
376,
13,
26120,
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,
0,
0,
0,
0,
0... |
Fast loading stream - HTML/HTML5/Javascript
===
I have access to some live stream URLs, so I'm making an HTML5 app so I can watch them, and switch the URLs when I want. The only problem I'm having is that the stream is loading very slowly (more than 10-12 seconds before it's playing).. Once they get played they never stops or lags, so the server that's serving do have a good bandwidth. I know that it is possible to load them in like 2 seconds, but the video tag in HTML5 does not do that..
I could load 3 video tags (one for the next stream, one for previous, and one that's already playing , but that's just not too handy, and it can slow down the internet connection with 3 streams that's running at the same time).
Does anyone know how to load a stream pretty quickly, so it doesn't buffer that much before playing (it is not needed to buffer more than it needs, it will not be possible to go fast forward on the stream as it is live)? Maybe start the stream with low quality so it can start playing instantly and then turn up the quality as it gets buffered?
I don't want any flash scripts, I only want HTML/Javascript.
It would be amazing if you could help!
Thank you! | 0 | [
2,
1512,
12797,
3766,
13,
8,
13,
15895,
118,
15895,
10551,
1004,
1385,
8741,
800,
3726,
3726,
31,
57,
1381,
20,
109,
515,
3766,
13,
911,
7532,
15,
86,
31,
22,
79,
544,
40,
13,
15895,
264,
4865,
86,
31,
92,
1455,
105,
15,
17,
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... |
Display front-end part in the controller in Joomla
===
I am developing a Joomla component and I have may tasks to be performed in the components. What I am doing presently is Having a single view and the controller corresponding it. Now if a user requests some task, I simply call corresponding method in the controller. In this method itself I have written all the HTML code which is display to the user. Everything is working properly.
My only doubt is, am I still following MVC model and will my component be accepted by Joomla community? | 0 | [
2,
3042,
431,
8,
2451,
141,
19,
14,
9919,
19,
2640,
2636,
531,
800,
3726,
3726,
31,
589,
3561,
21,
2640,
2636,
531,
5912,
17,
31,
57,
123,
8674,
20,
44,
986,
19,
14,
5090,
9,
98,
31,
589,
845,
14431,
25,
452,
21,
345,
1418,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C# listview imagelist fast add many items
===
I have a ListView and ImageList in C# on my form and read a directory with about 1000 files maximum.
I pre-populate the ListView and ImageList with the count of the fileItems DummyItems with the AddRange methods to avoid the flickering and scolling ListView.
Now in the second step I just wanted to assign the right item information to the dummy items while I read the real items from file system.
Item text is sofar no problem, but I can't replace the dummy images. It throws always an invalid argument exception if I try to do so. To delete the image with RemoveAtIndex or RemoveAtKey and then re-add would take me ages to iterate through 1000 files. 1000 files take 8 minutes with "RemoveAtKey" in ImageList. "RemoveAtKey" is the bottleneck which I found out.
If I try to clear all Images before and re-populate with AddRange again my Item Images go blank or a exception occurs.
Does someone know how I get 1000 different thumbnails from 1000 files with the file name fast into a listview control with another methods than I use? | 0 | [
2,
272,
5910,
968,
4725,
1961,
5739,
1512,
3547,
151,
3755,
800,
3726,
3726,
31,
57,
21,
968,
4725,
17,
1961,
5739,
19,
272,
5910,
27,
51,
505,
17,
1302,
21,
16755,
29,
88,
6150,
6488,
2979,
9,
31,
782,
8,
6057,
12383,
14,
968,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bring model to front?
===
I have a cloud model and it continues to go behind the background scene (sky scene). How do i bring the cloud model to the front so that it never goes behind?
Code is as follows:
public class RocketBlast extends DemoWrapper implements InputProcessor, ApplicationListener {
private static final Vector2 GRIDSIZE = new Vector2(16, 16);
FloorGrid floor;
private DecalBatch decalBatch;
private SpriteBatch spriteBatch2d;
private GroupStrategy strategy;
// private DecalSprite[] walls = new DecalSprite[5];
private DecalSprite wall;
private ArrayList<DecalSprite> walls = new ArrayList<DecalSprite>();
private MeshHelper cloud;
private DecalSprite shadow;
// camera
private Camera cam;
private GuOrthoCam oCam;
private GuPerspCam pCam;
private String camType = "ortho";
private boolean debugRender = true;
private Vector2 screenSize;
private Vector2 last = new Vector2(0, 0);
private Builder builder;
@Override
public void create() {
Gdx.gl.glEnable(GL10.GL_DEPTH_TEST);
Gdx.gl10.glDepthFunc(GL10.GL_LESS);
builder = new Builder();
builder.addIslands();
screenSize = new Vector2(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
oCam = new GuOrthoCam(screenSize.x, screenSize.y, GRIDSIZE);
oCam.position.set(8, 1, -17);
oCam.setTargetObj(builder.target);
pCam = new GuPerspCam(50, 50, 50);
cam = oCam;
floor = new FloorGrid(GRIDSIZE);
String objfile = "data/volumetric_cloud_tutorial.obj";
cloud = new MeshHelper(objfile);
cloud.scale(0.5f, 0.5f, 0.5f);
cloud.setPos(1, 1f, 5);
cloud.setColor(1, 1, 0);
cloud.setMotion(1,0, 0, 0.02f);
cloud.setTexture();
addWalls();
// batches
strategy = new CameraGroupStrategy(cam);
decalBatch = new DecalBatch(strategy);
spriteBatch2d = new SpriteBatch();
spriteBatch2d.enableBlending();
Gdx.input.setInputProcessor(this);
}
private ArrayList<DecalSprite> addWalls() {
wall = new DecalSprite().build("data/i.png");
wall.sprite.rotateY(90);
wall.sprite.setPosition(GRIDSIZE.x, 1, 8);
wall.sprite.setDimensions(17, 2);
walls.add(wall);
return walls;
}
@Override
public void render() {
GL10 gl = Gdx.app.getGraphics().getGL10();
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
float delta = Gdx.graphics.getDeltaTime();
cam.update();
cam.apply(gl);
setUpLighting(gl);
gl.glColor4f(0, 1, 0, 1f);
floor.render(gl, GL10.GL_LINE_STRIP);
gl.glColor4f(1, 0, 0, 1f);
for (DecalSprite oneWall : walls) {
decalBatch.add(oneWall.sprite);
}
cloud.update(delta);
cloud.render(gl, GL10.GL_TRIANGLES);
//decalBatch.add(shadow.sprite);
decalBatch.flush();
cam.update();
cam.apply(gl);
// decalBatch.add(player.sprite);
decalBatch.flush();
cam.update();
cam.apply(gl);
// turn off lighting for 2d sprites
gl.glDisable(GL10.GL_LIGHTING);
gl.glPopMatrix();
oCam.handleKeys();
}
} | 0 | [
2,
1499,
1061,
20,
431,
60,
800,
3726,
3726,
31,
57,
21,
4005,
1061,
17,
32,
2622,
20,
162,
439,
14,
2395,
1691,
13,
5,
2397,
1691,
6,
9,
184,
107,
31,
1499,
14,
4005,
1061,
20,
14,
431,
86,
30,
32,
243,
1852,
439,
60,
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... |
Cannot figure out the error in simple PHP/MySQL "Q&A" DB
===
I'm creating a simple questions DB, here are some details to start:
1st off, I am not using PDO - it's an old webapp, and this question is not about upgrading to PDO.
**The DB**
CREATE TABLE IF NOT EXISTS `questions` (
`id` int(11) unsigned NOT NULL auto_increment,
`question` varchar(255) NOT NULL,
`userID` int(11) unsigned NOT NULL,
`active` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
**Already inside the DB:**
INSERT INTO `apl_questions` (`id`, `question`, `userID`, `active`) VALUES
(1, 'Do you have a dog?', 1, 1),
(2, 'Have you ever been arrested?', 1, 1),
(3, 'Pick yes or no...', 1, 1);
**The PHP**
$questionsResult = mysql_query("select * from questions where userID = 1 AND active = 1"); // Get all activated questions
if(mysql_num_rows($questionsResult) > 0){
$questions = mysql_fetch_assoc($questionsResult);
var_dump($questions);
}
**The RESULT (of the PHP)**
array(4) { ["id"]=> string(1) "1" ["question"]=> string(18) "Do you have a dog?" ["userID"]=> string(1) "1" ["active"]=> string(1) "1" }
As you can see, this is only grabbing the first row - when it **should** be grabbing all rows since the userID and "active" column of all 3 rows are 1. Anyone see anything here that could be causing this problem? If I put the query into PHP MyAdmin, the query works correctly - so I have to assume at this point that it's the PHP... This is blowing my mind!
Thanks. | 0 | [
2,
1967,
1465,
70,
14,
7019,
19,
1935,
13,
26120,
118,
915,
18,
22402,
13,
7,
1251,
1569,
58,
7,
13,
9007,
800,
3726,
3726,
31,
22,
79,
2936,
21,
1935,
2346,
13,
9007,
15,
235,
50,
109,
3289,
20,
799,
45,
137,
384,
168,
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... |
ruby on rails css
===
I'm trying to color my view using css. The controller is workflows_controller. Hence i added the following code to the workflows.css.scss:
.folder_section {
text-align:center;
color: #244;
}
My view is
<div class="folder_section" id="folder_section">
<%= form_for :folder_name, :remote => true, :method => "get", :url => {:action => "show"} do |f| %>
<%= f.select :foldernames, options_for_select(@folders, @folders.first)%>
<%= f.submit "Submit folder"%>
<% end%>
</div>
The select box is aligned to the center but i could not see any color. I copy pasted the same code in the view itself. But still i could not see any color. Please let me know why the select box is aligned to the center but not colored. I looked into the web and some pdf documents. Everyone says that the controller.css.scss will take care of styling when you add the css code to it.
Thanks | 0 | [
2,
10811,
27,
2240,
18,
272,
18,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
1665,
51,
1418,
568,
272,
18,
18,
9,
14,
9919,
25,
170,
9990,
18,
1,
12898,
1252,
9,
5796,
31,
905,
14,
249,
1797,
20,
14,
170,
9990,
18,
9,
6824,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Objective-C: Comparing an image against another image that has been previously saved
===
I have a question about comparing UIImages in Objective-C when one image has already been through a save and load process using the NSSearchPathForDirectoriesInDomains method.
The aim of what I want is to direct the user to a new screen upon a click depending on what the image displays.
For simplicity let's say that there are two possibilities - a black image and a green image. Clicking on the black image takes you to xib1 and clicking the green image takes you to xib2.
This is simple enough and has been working until I have implemented a save and load system.
To save I do the following:
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];
pngFilePath = [NSString stringWithFormat:@"%@/test.png",documentsDirectory];
data1 = [NSData dataWithData:UIImagePNGRepresentation([level1part1 objectAtIndex:0])];
[data1 writeToFile:pngFilePath atomically:YES];
and to load I do the following:
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];
pngFilePath = [NSString stringWithFormat:@"%@/test.png",documentsDirectory];
UIImage *image = [UIImage imageWithContentsOfFile:pngFilePath];
[button1 setImage:image forState:UIControlStateNormal];
This is fine and when I quit the program and restart it the image is retained on the screen as I wish it to be. Hypothetically let's say that image now appearing on button1 is the green image.
When I call the following code after clicking on the button with id of sender (this is button1):
if(sender.currentImage == [UIImage imageNamed:self.greenImage])
{
VisitAlreadyCorrectScreen *screen = [[VisitAlreadyCorrectScreen alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:screen animated:YES];
}
even though the currentImage is the green image and is the same picture as the green image I am comparing it to, I think because I saved the green image into memory in the save process the comparison doesn't work as they are held in different places in the memory - verified by the following NSLog:
Current Image: <UIImage: 0x95614c0>, and Yes Image: <UIImage: 0xde748f0>
I cannot work out how to compare the two images so that in this case they match (they both relate to the same image I have in the resource folder). Does anyone have any suggestions at all?
Please let me know if I have not explained well enough what the problem is!
Thanks in advance! | 0 | [
2,
7038,
8,
150,
45,
15047,
40,
1961,
149,
226,
1961,
30,
63,
74,
1343,
4377,
800,
3726,
3726,
31,
57,
21,
1301,
88,
15047,
13,
5661,
22039,
18,
19,
7038,
8,
150,
76,
53,
1961,
63,
614,
74,
120,
21,
2079,
17,
6305,
953,
568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
handshake error in connecting SQL server 2008 r2
===
I got this error while connecting to local DB
A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.) (.Net SqlClient Data Provider)
Halp | 0 | [
2,
224,
17248,
7019,
19,
6440,
4444,
255,
8128,
570,
761,
135,
800,
3726,
3726,
31,
330,
48,
7019,
133,
6440,
20,
375,
13,
9007,
21,
2760,
23,
3673,
613,
29,
14,
8128,
15,
47,
94,
40,
7019,
2437,
112,
14,
782,
8,
5567,
108,
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... |
Nested resources create Couldn't find Topic without an ID
===
I wanna make an application which User can create a topic and others can make posts after that. I nested my resources in my routes.rb:
MyPedia2::Application.routes.draw do
resources :users
resources :sessions, only: [:new, :create, :destroy]
resources :topics, only: [:show, :create, :destroy]
resources :posts
resources :topics do
resources :posts, only: [:create, :show, :new]
end
In my topic show page , I want to show topic.title and sended Posts and post.form.html.erb.
Everything works accept when i create a post , I get mistake
ActiveRecord::RecordNotFound in PostsController#create
Couldn't find Topic without an ID..
This is my posts_controller.rb:
class PostsController < ApplicationController
before_filter :signed_in_user, only: [:create, :destroy]
before_filter :correct_user, only: :destroy
def new
@topic= Topic.find_by_id(params[:id])
@post = @topic.posts.build(params[:post])
end
def show
@topic = Topic.find(params[:id])
@posts = @topic.posts.paginate(page: params[:page])
end
def create
@topic = Topic.find(params[:id])
@post = @topic.posts.build(params[:post])
@post.topic = @topic
if @post.save
flash[:success] = "Konu oluşturuldu!"
redirect_to :back
else
render 'static_pages/home'
end
end
def destroy
@post.destroy
redirect_to root_path
end
private
def correct_user
@post = current_user.posts.find_by_id(params[:id])
redirect_to root_path if @post.nil?
end
end
and _post_form.html.erb:
<%= form_for @new_post do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<div class="field">
<%= f.text_area :content, placeholder: "yorumunuzu girin..." %>
</div>
<%= f.submit "Gönder", class: "btn btn-large btn-primary" %>
<% end %>
| 0 | [
2,
5618,
69,
2566,
1600,
711,
22,
38,
477,
8303,
366,
40,
4924,
800,
3726,
3726,
31,
11024,
233,
40,
3010,
56,
4155,
92,
1600,
21,
8303,
17,
654,
92,
233,
9868,
75,
30,
9,
31,
5618,
69,
51,
2566,
19,
51,
5050,
9,
7549,
45,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How could this be rewritten using ninject?
===
What would the following example look like re-written to use Ninject?
(From https://github.com/ninject/ninject/wiki/Dependency-Injection-By-Hand)
interface IWeapon
{
void Hit(string target);
}
class Sword : IWeapon
{
public void Hit(string target)
{
Console.WriteLine("Chopped {0} clean in half", target);
}
}
class Shuriken : IWeapon
{
public void Hit(string target)
{
Console.WriteLine("Pierced {0}'s armor", target);
}
}
class Program
{
public static void Main()
{
var warrior1 = new Samurai(new Shuriken());
var warrior2 = new Samurai(new Sword());
warrior1.Attack("the evildoers");
warrior2.Attack("the evildoers");
/* Output...
* Piereced the evildoers armor.
* Chopped the evildoers clean in half.
*/
}
}
| 0 | [
2,
184,
110,
48,
44,
302,
6390,
568,
13,
5703,
17759,
60,
800,
3726,
3726,
98,
83,
14,
249,
823,
361,
101,
302,
8,
6390,
20,
275,
13,
5703,
17759,
60,
13,
5,
2665,
7775,
18,
6903,
10404,
20926,
9,
960,
118,
5703,
17759,
118,
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... |
Android:How can i know my location is accurate
===
I like to find current location.I also know how to find the location from `GPS` and `Network`. `GPS` is more accurate than `Network`. But when `GPS` signal is poor i like to use `Network` to get accurate location.
My question is that how can i determine which one is giving me best accurate location and my location is accurate? I have to find out correct location.
You may suggest `location.getAccuracy()`.But i don't know details about it.
Thanks in advance. | 0 | [
2,
13005,
45,
1544,
92,
31,
143,
51,
1474,
25,
8137,
800,
3726,
3726,
31,
101,
20,
477,
866,
1474,
9,
49,
67,
143,
184,
20,
477,
14,
1474,
37,
13,
1,
13321,
18,
1,
17,
13,
1,
24106,
1,
9,
13,
1,
13321,
18,
1,
25,
91,
813... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MkMapView shows a blue screen
===
I am able to successfully show the user their current location on a MapView. However when I go to another view controller and come back to my mapview, I see a blue screen. Why?
This is my code:
- (void)viewWillAppear:(BOOL)animated {
MyManager * myManager = [MyManager sharedInstance];
//if coming back from another screen, lets load the coordinates
if (myManager.centerOfMap) {
NSLog(@"myManager.centerOfMap has a value:");
self.centerOfMap = myManager.centerOfMap;
}
CLLocationCoordinate2D zoomLocation;
zoomLocation = *(self.centerOfMap);
MKCoordinateRegion viewRegion = MKCoordinateRegionMakeWithDistance(zoomLocation, 0.5*METERS_PER_MILE, 0.5*METERS_PER_MILE);
MKCoordinateRegion adjustedRegion = [_mapView regionThatFits:viewRegion];
[_mapView setRegion:adjustedRegion animated:YES];
} | 0 | [
2,
10804,
15022,
4725,
1285,
21,
705,
2324,
800,
3726,
3726,
31,
589,
777,
20,
3673,
298,
14,
4155,
66,
866,
1474,
27,
21,
2942,
4725,
9,
207,
76,
31,
162,
20,
226,
1418,
9919,
17,
340,
97,
20,
51,
2942,
4725,
15,
31,
196,
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... |
Apple Script is undeleting files (Lion) and the OS keeps asking for a password. Is there a way around this.
===
So a funny thing happened to me last night. I was trying to clean files off my Macbook Pro.
I just purchased a new Macbook Retina and it has a smaller hard drive than my old Macbook Pro (I know cry me a river).
Anyway I was in Finder and I found a whole bunch of files and I selected them all and hit the good old delete key.
And gosh darn if my Mac didn’t immediately got to working whacking my files. What I didn’t realize that I had a view of my entire network of files including my Dropbox documents, family pictures and even some naughty images from my college years (don’t tell my wonderful wife).
The total number of deleted files was over 4,000. I almost cried.
No big deal I just go to the Trash and undelete right? Not so fast Tonto!
I want to have the files moved back to their original location. While the Lion supports this feature, it will only allow you do restore one file at a time.
With 4,000+ files my eyeballs would fall out by the time I finished.
Fortunately someone at Apple invented Apple Script.
And someone else wrote a script that will undelete files one file at a time.
I ran the script went to bed and found that it worked!!!!
Of the 4,000 file only 1,700 remained in my trash (Woo Hoo!!!).
The problem is the remaining files require me to enter a password before the restore can take place. I believe these files were created under a different owner.
My question is how can I get around this?
Is there a way to enter a super duper user mode that eliminates me having to enter a password for every file I want to undelete?
Any help is greatly appreciated.
Here is the Apple Scrpt:
repeat 4173 times --or as many files you have
tell application "Finder" to open trash --open the trash folder
tell application "Finder" to activate
tell application "System Events"
tell process "Finder"
delay 0.2 -- adjust delay as needed
key code 125 --move down to get focus on a file
key down command --hold command key
delay 0.2 -- adjust delay as needed
key code 51 --hit delete
key up command --release command
end tell
end tell
delay 0.2 -- adjust delay as needed
tell application "Finder" to close every window --close everything for the next cycle
end repeat
| 0 | [
2,
4037,
3884,
25,
13,
12239,
1336,
68,
6488,
13,
5,
14891,
6,
17,
14,
13,
759,
8968,
3379,
26,
21,
20884,
9,
25,
80,
21,
161,
140,
48,
9,
800,
3726,
3726,
86,
21,
5066,
584,
1190,
20,
55,
236,
343,
9,
31,
23,
749,
20,
274... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Editar linha do grid ExtJs
===
Olá, estou desenvolvendo um projeto utilizando Ext Js que precisa editar a linha de um grid, estou tentando utilizar um plugin que encontrei na própria documentação do Ext, 'plugins : [ Ext.create('Ext.grid.plugin.RowEditing') ]', contudo quando eu clico na linha as opções de update e cancel aparecem no grid, mas a célula não fica editável, será que alguém sabe o que está acontecendo !?
O exemplo na documentação com o plugin é este: http://docs.sencha.com/ext-js/4-0/#!/example/restful/restful.html
Obrigado!
Segue meu código abaixo:
Ext.define('GridEditavel',{
extend : 'Ext.grid.Panel',
title: 'Grid Editavel',
store: 'GridStore',
dockedItems : [ {
xtype : 'toolbar',
items : [ {
xtype: 'button',
text : i18n['vds.botao.nova.coluna'],
icon : Webapp.icon('add1.png'),
iconAlign : 'top',
handler : function() {
var gridView = Ext.ComponentQuery.query("gridpanel")[1];
Ext.Msg.prompt('Aviso', 'Insira um número para a coluna:', function(
btn, text) {
if (btn == 'ok' && text != null) {
var column = Ext.create('Ext.grid.column.Column', {
text : text
});
gridView.headerCt.insert(gridView.columns.length,
column);
gridView.getView().refresh();
} else {
Ext.Msg.alert('Alerta', 'Informe o número da coluna!');
}
});
}
} ]
} ],
columns: [{
header : 'Nome',
dataIndex : 'nome',
flex : 0.8
}],
plugins : [ Ext.create('Ext.grid.plugin.RowEditing') ]
}); | 0 | [
2,
9392,
512,
6294,
994,
107,
7354,
1396,
38,
728,
18,
800,
3726,
3726,
13,
2268,
15,
11186,
2655,
121,
1264,
5847,
3124,
537,
13,
723,
895,
1969,
262,
13,
14255,
3186,
13869,
1396,
38,
487,
18,
9386,
782,
7654,
58,
9392,
512,
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... |
Enter more that one credit into Java game
===
I've looking to find the best way to allow the player to insert 1 to 4 coins into my slot machine. I have the main function of the slot machine in the main class with player balance in a seperate class. to give the option of playing more than one coin I have created a coin class each coin is worth .25 cent with the option of playing 4.
this is my main class important bits and the coin class code.
at the moment I have it set for 1 coin 1 play.
main class:
enter code here import java.util.Random;
import java.util.Scanner;
public class SlotMain{
public static void main(String[] args){
String answer = "s";
//keyboard input
Scanner scan = new Scanner (System.in); // scanner class
// start game message
System.out.println(" Spin and Win (S to Spin 0 to Exit): ");
answer = scan.nextLine();
//creating a player object
Player player = new Player();
while(answer.equalsIgnoreCase("s") ){
//drops the value by one on each play
double balance = player.getBalance() - player.getCoin();
// stop playing method from player.java
player.stopPlay();
//set the balance in player.java
player.setBalance(balance);
// deswitch is assigned a variable a b c
Random generator = new Random();
int a = generator.nextInt(5);
int b = generator.nextInt(5);
int c = generator.nextInt(5);
String rollOne = null;
switch(a){
case 1: rollOne = " Bell";
break;
case 2: rollOne = " Grape";
break;
case 3: rollOne = " Cherry";
break;
default: rollOne = " xxx";
break;
}
String rollTwo = null;
switch(b){
case 1: rollTwo = " Bell";
break;
case 2: rollTwo = " Grape";
break;
case 3: rollTwo = " Cherry";
break;
default: rollTwo = " xxx";
break;
}
String rollThree = null;
switch(c){
case 1: rollThree = " Bell";
break;
case 2: rollThree = " Grape";
break;
case 3: rollThree = " Cherry";
break;
default: rollThree = " xxx";
break;
}
System.out.println(" Your Spin Result: " +rollOne +rollTwo +rollThree);
// switch case = sting variable to give jackpot
if (a == 1 && b == 1 && c == 1) {
//int balance is = getBalance + getCoin and multiply it
double Balance = player.getBalance() + player.getCoin() * 10;
// uses the setBalance method to change balance in player.java
player.setBalance(Balance);
// prints win result + current balance
System.out.println("JACKPOT! You win 10 Balance: " +Balance);
} else if (a == 2 && b == 2 && c == 2) {
//int balance is = getBalance + the money won
double Balance = player.getBalance() + player.getCoin() * 7;
// uses the setBalance method to change balance in player.java
player.setBalance(Balance);
// prints win result + current balance
System.out.println("3 Grapes ! You win 7 Balance: " +Balance);
enter code herepublic class Coin{
private double oneCoin;
private double twoCoin;
private double threeCoin;
private double fourCoin;
//default constructor
public Coin() {
this.oneCoin = .25;
this.twoCoin = .50;
this.threeCoin = .75;
this.fourCoin = 1;
}
//overloaded constructor
public Coin(double oneCoin,double twoCoin,double threeCoin,double fourCoin) {
this.oneCoin = oneCoin;
this.twoCoin = twoCoin;
this.threeCoin = threeCoin;
this.fourCoin = fourCoin;
//oneCoin
public double getOneCoin() {
return oneCoin;
}
public void setOneCoin(double oneCoin) {
this.oneCoin = oneCoin;
}
//twoCoin
public double getTwoCoin() {
return twoCoin;
}
public void setTwoCoin(double twoCoin) {
this.twoCoin = twoCoin;
}
//threeCoin
public double getThreeCoin() {
return threeCoin;
}
public void setThreeCoin(double threeCoin) {
this.threeCoin = threeCoin;
}
//fourCoin
public double getFourCoin() {
return fourCoin;
}
public void setFourCoin(double fourCoin) {
this.fourCoin = fourCoin;
} | 1 | [
2,
2830,
91,
30,
53,
3251,
77,
8247,
250,
800,
3726,
3726,
31,
22,
195,
699,
20,
477,
14,
246,
161,
20,
1655,
14,
517,
20,
14692,
137,
20,
268,
7146,
77,
51,
7958,
1940,
9,
31,
57,
14,
407,
1990,
16,
14,
7958,
1940,
19,
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... |
Why my page is not centered?
===
I know that it's a newbie question, but if you could give me a hand and tell me what I'm doing wrong I'd really appreciate that:
While I was experimenting with HTML and CSS I decided to create a page with a fixed size that should be centered on the screen. To do so I decided to place the [body] tag by making its position relative and move it by writing:
position: absolute;
width: 960px;
height: 600px;
left: 50%;
top: 50%;
margin-left: -480px;
margin-top: -300px;
Hovever it didn't worked quite as expected, and this is the result I'm getting:
![Screenshot taken from the page][1]
I was expecting to see the yellow box perfectly centered both horizontally and vertically, but instead I see that it's slightly off-center.
I tried to load the page on Safari, Firefox and Chrome and I'm getting the same results so as I already suspected I know that it's my fault :-)
Could you help me by explaining what I did wrong ?
Thank you very much
This is the complete HTML+CSS code of the page I have written:
<!DOCTYPE html>
<html>
<head>
<title>Test 1</title>
<meta charset="utf-8">
<style>
html, body {
padding: 0;
margin: 0;
}
html {
background-color: red;
width: 100%;
min-height: 100%;
font-family: Helvetica, Arial, sans-serif;
font-size: 16px;
}
body {
padding: 1em;
background-color: yellow;
width: 960px;
height: 600px;
position: absolute;
left: 50%;
top: 50%;
margin-left: -480px;
margin-top: -300px;
}
</style>
</head>
<body>
This is my website
</body>
</html>
[1]: http://i.stack.imgur.com/RzlYY.png | 0 | [
2,
483,
51,
2478,
25,
52,
10583,
60,
800,
3726,
3726,
31,
143,
30,
32,
22,
18,
21,
78,
5893,
1301,
15,
47,
100,
42,
110,
590,
55,
21,
224,
17,
494,
55,
98,
31,
22,
79,
845,
1389,
31,
22,
43,
510,
8831,
30,
45,
133,
31,
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 do I access the WF Receive activity from WcfTestClient
===
My workflow needs to wait for either an email approval via Bookmark or a WCF approval via Receive, so I used a Parallel activity. The email approval works just fine but I am trying to test the WCF and cant figure out what URL to use in WCF test client to access the Workflow.
I would be grateful for any leads because I am very new to WCF and am not very sure how to go about solving this problem.
![The parallel part of my workflow][1]
![enter image description here][2]
[1]: http://i.stack.imgur.com/bOk5c.png
[2]: http://i.stack.imgur.com/LUxPv.png | 0 | [
2,
184,
107,
31,
1381,
14,
13,
15263,
2588,
2358,
37,
11801,
3072,
1430,
150,
18513,
38,
800,
3726,
3726,
51,
170,
9990,
2274,
20,
1760,
26,
694,
40,
8517,
4988,
1197,
360,
4527,
54,
21,
11801,
410,
4988,
1197,
2588,
15,
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... |
Run my rules through a macro: not able to select the SENT ITEMS FOLDER
===
I have rules in Outlook for income emails and for posted one.
I found in the web the following routine whihc works for the emails which are in the 'INBOX' but I am not able to use the GetRootFolder to select the 'SENT' Items folder when I need to.
The routine is the following:
Sub RunRules()
Dim st As Outlook.Store
Dim myRules As Outlook.rules
Dim rl As Outlook.Rule
Dim count As Integer
Dim k As Long
Dim fname As String
Dim currentcount As Integer
Dim prova As String
Dim numero As Integer
Dim prova1 As String
Dim Nrules As Integer
Dim objFolder, objNamespace, objOutlook, objFile
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
objNamespace.Logon "Default Outlook Profile", , False, False
numero = 1
' this is for the SENT Items
fname = "I"
count = 1
k = 1
Set rl = Nothing
Set st = Nothing
Set myRules = Nothing
'On Error Resume Next
' get default store (where rules live)
Set st = Application.Session.DefaultStore
Application.Session.DefaultStore.GetRootFolder (olFolderSentMail)
' get rules
Set myRules = st.GetRules
For k = 1 To myRules.count ' might be 0-based, didnt check
On Error Resume Next
Set rl = Nothing
Set rl = myRules(k)
If rl.RuleType = olRuleReceive Then 'determine if it’s an Inbox rule, if so, run it
' I selecto just the rules that are for the sent ITEMS
prova = rl.Name
prova1 = Left(prova, 1)
If prova1 = fname Then
rl.Execute ShowProgress:=True
objFile.WriteLine rl.Name
count = count + 1
prova = ""
prova1 = ""
End If
End If
Next
Set rl(count) = Nothing
Set st = Nothing
Set myRules = Nothing
Set objFolder = Nothing
End Sub
Pleae HELP.....
thanks
| 0 | [
2,
485,
51,
1761,
120,
21,
9069,
45,
52,
777,
20,
5407,
14,
795,
3755,
19294,
800,
3726,
3726,
31,
57,
1761,
19,
19837,
26,
1587,
8517,
18,
17,
26,
6054,
53,
9,
31,
216,
19,
14,
2741,
14,
249,
8275,
13,
9373,
9469,
693,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mail.app plugins & Mac App Store
===
anyone knows if App Store is allowing third party plugins for Mail.app? With the new release of Mountain Lion the security architecture will sandbox every signed application (and thus Mail) so that the process of installing a plugin is very limited.
The question is: since a plugin must use private API (Mail.app doesn't expose APIs) and access private data of another application, how can this be accomplished with Mac App Store rules? Is it possible at all?
Thanks in advance for any hints on this!
Luca | 0 | [
2,
4216,
9,
7753,
10922,
108,
18,
279,
1572,
4865,
1718,
800,
3726,
3726,
1276,
3620,
100,
4865,
1718,
25,
2719,
422,
346,
10922,
108,
18,
26,
4216,
9,
7753,
60,
29,
14,
78,
830,
16,
1286,
6023,
14,
1221,
2607,
129,
1965,
5309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Comparing two SQL scripts and getting alter script
===
I have two different Database (say source and target) consisting of 1 Table (Customer, Columns - ID/Name) in both. Suppose I modify the table in source table and get the updated script and do a comparison with the target table, how can I get the alter script out of them using SMO object.
Is there any way of comparing two script and get the alter script. | 0 | [
2,
15047,
81,
4444,
255,
17505,
17,
1017,
7835,
3884,
800,
3726,
3726,
31,
57,
81,
421,
6018,
13,
5,
6366,
1267,
17,
2935,
6,
4160,
16,
137,
859,
13,
5,
4636,
262,
1263,
15,
7498,
13,
8,
4924,
118,
7259,
6,
19,
156,
9,
5787,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mutually Exclusive Checkbox using dat.GUI.js API
===
I would like to know how to create mutually exclusive checkboxes using dat.GUI.js. API Link: http://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage | 0 | [
2,
23180,
6753,
2631,
5309,
568,
1331,
38,
9,
7215,
9,
728,
18,
21,
2159,
800,
3726,
3726,
31,
83,
101,
20,
143,
184,
20,
1600,
23180,
6753,
2631,
5309,
160,
568,
1331,
38,
9,
7215,
9,
728,
18,
9,
21,
2159,
3508,
45,
7775,
690... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 grid stretch across whole html page in twitter bootstrap.
===
Building a home page and I want the grid to stretch across the whole page. I tried setting the containers width at 100 percent but it seems not to be working. I am working with a the default grid system. An example of what i am looking for is www.rdio.com. | 0 | [
2,
184,
20,
233,
7354,
6363,
464,
979,
13,
15895,
2478,
19,
10623,
5894,
16514,
9,
800,
3726,
3726,
353,
21,
213,
2478,
17,
31,
259,
14,
7354,
20,
6363,
464,
14,
979,
2478,
9,
31,
794,
2697,
14,
18988,
9456,
35,
808,
2091,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 my custom analyzer to Luke (Lucene)
===
this question was already asked [here][1] on StackOverflow, BTW even after reading the answer provided, i do not manage to add *MyOwnAnalyzer*, so that i can use it directly from [Luke][2].
please can someone help me on the right way to do, that is how and what to do so that *MyOwnAnalyzer* can be usable directly from Luke ?
can I do this (it did not work, may be my included jar are incomplete?):
java -cp .;d:\java\mylibs\MyOwnAnalyzer.jar -jar lukeall-3.5.0.jar
(*MyOwnAnalyzer.jar* was built from Eclipse and contains : *MyOwnAnalyzer.java, MyOwnTokenizer.java, and MyOwnToken.java* inside a subdirectory *com.MyCompany*... Eclipse added *META-INF* and *manifest.mf* for me)
may be i am wrong in adding classpath and MyOwnAnalyzer.jar with my command line?
or must I build Luke from source including MyOwnAnalyzer somewhere in its directory?
or is there something else to include/write so that my analyzer can be usable and imported from Luke? (looks like there is a mechanism to detect all classes that subclasses Analyzer - MyOwnAnalyzer is already declared as "`extends Analyzer`" )
best regards,
thx
[1]: http://stackoverflow.com/questions/1945294/adding-custom-analyzers-to-luke
[2]: http://code.google.com/p/luke/ | 0 | [
2,
4721,
51,
5816,
16051,
139,
20,
3881,
13,
5,
2377,
13739,
6,
800,
3726,
3726,
48,
1301,
23,
614,
411,
636,
6836,
500,
2558,
165,
500,
27,
7566,
2549,
9990,
15,
334,
38,
499,
166,
75,
1876,
14,
1623,
1173,
15,
31,
107,
52,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Show specific TabBarItem after view is removed from SuperView
===
HomeViewController - View has 2 image buttons called 'New' & 'Old'. This is the starting view that I show before a TabBarController kicks into picture.
When 'New' is tapped, I go to TabBarItem 1. OK, no problem.
**When 'Old' is tapped, I want to go to TabBarItem 4.**But it still goes to TabBarItem 1.
This is what my code looks like:
In HomeViewController, I have the following method:
- (void) oldButtonPressed:(id)sender{
TabBarAppDelegate *allRootValues = [[UIApplication sharedApplication] delegate];
allRootValues.seeExistingClients = @"Y";
NSLog(@"old button pressed: see old clients: %@", allRootValues.seeExistingClients);
[self.view removeFromSuperview];
[self.tabBarController setSelectedIndex:4];
}
AppDelegate:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions
{
// Override point for customization after application launch.
HomeViewController *homeVC = [[HomeViewController alloc]initWithNibName:@"HomeViewController" bundle:nil];
[self.window addSubview:homeVC.view];
[self.window makeKeyAndVisible];
seeExistingClients = @"N"; //Assigning to 'N' initially
return YES;
}
| 0 | [
2,
298,
1903,
6523,
1850,
2119,
79,
75,
1418,
25,
1974,
37,
1026,
4725,
800,
3726,
3726,
213,
4725,
12898,
1252,
13,
8,
1418,
63,
172,
1961,
12861,
227,
13,
22,
2681,
22,
279,
13,
22,
1218,
22,
9,
48,
25,
14,
1422,
1418,
30,
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... |
Active record find_by where attribute in collection?
===
Sorry if this is a newbie question, searching google and SO turns up nothing, I am probably not using the right terms, but here goes ....
If I have a User model with a name, and I want to find a 'john' I know I can do
User.find_by_name 'john'.
Great.
But suppose I have a list of names that I want to retrieve. I could do a find_by for each name in the list - resulting in multiple sql queries. Or I could do User.all and filter the result in memory against my list.
Both seem like they could be quite expensive and not very scalable, when in raw sql I could just write:
select * from users where name in ('john', 'peter', 'susan', ... );
And get the whole lot in one query.
Am I missing a trick or can active record do this too? If not then what is the recommended best way to do this from within a rails 3 application? | 0 | [
2,
1348,
571,
477,
1,
779,
113,
35,
14755,
19,
1206,
60,
800,
3726,
3726,
1875,
100,
48,
25,
21,
78,
5893,
1301,
15,
5792,
8144,
17,
86,
2844,
71,
626,
15,
31,
589,
910,
52,
568,
14,
193,
1663,
15,
47,
235,
1852,
13,
9,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Full JSON render of object with nested object
===
I have a grails application with mongodb plugin.
All my domain objects are:
class Person {
ObjectId id
String name
}
and
class Like {
ObjectId id
Person from
Person to
Date createdAt
}
My controller should give a full data according to some `Like` by id:
class MyController {
def like() {
def like = Like.findById(new ObjectId("someIdHere"));
render(like as grails.converters.JSON)
}
}
I wish to receive a full JSON-object of like:
{
"class":"Like",
"id":{
"class":"org.bson.types.ObjectId",
"inc":1483542456,
"machine":805594765,
"new":false,
"time":1340363115000,
"timeSecond":1340363115
},
"createdAt":"2012-06-22T11:05:15Z",
"from":{
"class":"Person",
"id":{ ... },
"name":"Some name here"
},
"to":{
"class":"Person",
"id":{ ... },
"name":"Some name here"
}
}
but I've receive first-level properties of object:
{
"class":"Like",
"id":{
"class":"org.bson.types.ObjectId",
"inc":1483542456,
"machine":805594765,
"new":false,
"time":1340363115000,
"timeSecond":1340363115
},
"createdAt":"2012-06-22T11:05:15Z",
"from":{
"class":"Person",
"id":"4fd31d453004dc0f010aca51"
},
"to":{
"class":"Person",
"id":"4fd31d463004dc0f010aca89"
}
}
My question is: is there any way to construct full (with referenced objects) JSON of mongo db (DBObject) data object? I've found out this [solution with JSONBuiled](http://stackoverflow.com/a/5543915) with escaped fields 'class', metaClass' and 'dbo'. But I think it can be done with Expando classes but I cann't find the right way...
Thanks any way,
Maksim | 0 | [
2,
503,
487,
528,
16535,
16,
3095,
29,
5618,
69,
3095,
800,
3726,
3726,
31,
57,
21,
489,
7301,
18,
3010,
29,
3521,
5474,
220,
10922,
108,
9,
65,
51,
4603,
3916,
50,
45,
718,
840,
13,
1,
3095,
1340,
4924,
3724,
204,
13,
1,
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... |
Java: Convert String to org.eclipse.uml2.uml.Type
===
Is it possible to convert a String to a type, which is definied by org.eclipse.uml2.uml.Type? We need this information to generate a uml file with emf and ecore, but we only get the type information as a String.
Thank you! | 0 | [
2,
8247,
45,
8406,
3724,
20,
13,
5583,
9,
3319,
6013,
870,
9,
723,
255,
135,
9,
723,
255,
9,
4474,
800,
3726,
3726,
25,
32,
938,
20,
8406,
21,
3724,
20,
21,
1001,
15,
56,
25,
6312,
2651,
69,
34,
13,
5583,
9,
3319,
6013,
870,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uncaught TypeError: Object #<Object> has no method 'newsticker'
===
<br/>
I've done a search, and I've found a few results, but none that seem to work - hoping someone can help me or point me in the right direction.<br/><br/>
I have a web page with jQuery loaded and a 3rd party script, News Ticker. I have an existing site with this working fine with no problems, however, when I copy the code to another side, I keep getting:<br/>
`Uncaught TypeError: Object #<Object> has no method 'newsticker'`<br/><br/>
The code causing this error is the following:<br/>
`$(document).ready(function() {`<br/>
` $("#guestbook").newsticker();`<br/>
`});`
The News Ticker script details can be seen at their site - http://www.texotela.co.uk/code/jquery/newsticker/.
Thanks in advance! | 0 | [
2,
16061,
12647,
1001,
29992,
45,
3095,
6926,
1,
23793,
1,
63,
90,
2109,
13,
22,
2681,
10277,
106,
22,
800,
3726,
3726,
13,
1,
5145,
118,
1,
31,
22,
195,
677,
21,
2122,
15,
17,
31,
22,
195,
216,
21,
310,
1736,
15,
47,
2369,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
pecl installing extension on production server troubles
===
So I installed the pecl oauth module locally, and it all works perfectly. I then tried to do this for the production server but ran into some problems.
If I say sudo pecl install oauth, I get this error:
No releases available for package "pecl.php.net/oauth"
install failed
So I figure I have to update pecl.php.net, so I try the command sudo pecl channel-update pecl.php.net, but then I get this output:
Updating channel "pecl.php.net"
Channel "pecl.php.net" is not responding over http://, failed with message:
Connection to 'pecl.php.net:80' failed: Connection refused
Trying channel "pecl.php.net" over https:// instead
Cannot retrieve channel.xml for channel "pecl.php.net" (Connection to `pecl.php.net:443' failed: Connection refused)
Any ideas? | 0 | [
2,
15439,
255,
25429,
3896,
27,
637,
8128,
16615,
800,
3726,
3726,
86,
31,
4066,
14,
15439,
255,
635,
1346,
96,
12613,
6680,
15,
17,
32,
65,
693,
5759,
9,
31,
94,
794,
20,
107,
48,
26,
14,
637,
8128,
47,
717,
77,
109,
1716,
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... |
Feedback on practical limitations for JSON?
===
I'm at a critical decision point in my application design. It's an ASP.NET web application that uses REST to request information about various products. Some products have varying ProductIDs depending on their attributes/variations. For example, a user might be interested in Rogaine. A REST request about Rogain might return a response containing several variations - a 1 month supply, a 3 month supply or a 4 month supply. Each of these variations have a different ProductID, a different regular price, different sale price and a multitude of different attributes. Each one has a different set of 'features', different images, etc. The amount of attributes for each product can be quite a lot.
In most instances there are only a couple of product variations. Sometimes a half dozen, sometimes a dozen or two. In these instances, JSON can handle my requirements easily.
But take, for example, a dress. It might be available in a couple of dozen colors. It's also available in 6 different sizes. You wouldn't want to display each of these on their own page. It's much more user friendly to display this product on a single page and present these size and color options for the user to select. Perhaps they want to order a small size in a red color.
In the example above, where there are almost 100 combinations of options. At this point, I think JSON becomes an impractical choice for me. For each unique combination, there are several links to images (each image displays the product in a different color). Each product has a list price, a regular price and a sale price, amount saved. Each has shipping attributes. Each has its own list of features which can be paragraphs of text for each product.
Ok, my point is made - this is a lot of data to be stuffing in a JSON string and there will be a delay to lookup details when a color or size is changed.
I like the way Amazon presents choices. Here is a link of such a situation:
http://www.amazon.com/American-Apparel-Jersey-Chemise-Small-Navy/dp/B003ILSHQ2/
I've looked in the source page and don't see where they are storing each product's details on the client side. If you hover each color swatch you'll see that all the details change on the page. Price, shipping, large image, features. Virtually everything changes.
I see the "Loading..." indicators once in a while, but in most cases it's so fast that you don't see any signs of client/server communication.
How are they doing this without reloading the page entirely and without storing this information on the client? What technology are they using, does anyone know?
Trust me, a round trip to send another REST request each time a product variation is changed would be way too expensive. And I already have *ALL* of the data for every product in my first REST response. The data is not on my server or in my control and I really don't want to save it on my server.
Since I already have all of the data, I'd like to store it so it can be used like Amazon does, but I'd like to hand it off to the client. It would be perfect to use a JSON string and in most cases, I can... but not effectively/efficiently in all.
Is there a way to index a JSON string to make it quicker for large amounts of data? Is it just too much for JSON? What other options might I have to use with JQuery/Javascript?
| 0 | [
2,
13111,
27,
5713,
14070,
26,
487,
528,
60,
800,
3726,
3726,
31,
22,
79,
35,
21,
2507,
1401,
454,
19,
51,
3010,
704,
9,
32,
22,
18,
40,
28,
306,
9,
2328,
2741,
3010,
30,
2027,
760,
20,
3772,
676,
88,
617,
1985,
9,
109,
1985... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 NMock FileStream?
===
I have this code in my unit test:
var file = m_Mockery.NewMock<IFile>();
Stream s = new MemoryStream();
Expect.Once.On( file ).Method( "OpenRead" )
.With( "someFile.mdb")
.Will( Return.Value( s ) );
...
...
...
// this runs the real code that contains the OpenRead call
productionCodeObj.DoIt("someFile.mdb");
m_Mockery.VerifyAllExpectationsHaveBeenMet();
The problem is when I call DoIt (which calls OpenRead), I get an exception saying the file cannot be found. Am I misunderstanding what nmock does? I don't want my unit test to hit the real filesystem... | 0 | [
2,
184,
20,
9384,
5668,
3893,
11260,
60,
800,
3726,
3726,
31,
57,
48,
1797,
19,
51,
1237,
1289,
45,
4033,
3893,
800,
307,
1,
79,
5668,
3849,
9,
2681,
79,
5668,
1,
49,
16877,
1,
5,
6,
73,
3766,
13,
18,
800,
78,
1912,
11260,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to put limit on GMaps and avoid repeating the map?
===
I'm trying to use GMaps but I want to avoid this behaviour:
![enter image description here][1]
[1]: http://i.stack.imgur.com/PulIc.jpg
I not want to limit the zoom. I want to limit the repetition of the world map.
Is there a way to do this? | 0 | [
2,
184,
20,
442,
4496,
27,
13,
14336,
1919,
17,
2658,
17389,
14,
2942,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
13,
14336,
1919,
47,
31,
259,
20,
2658,
48,
7727,
45,
13,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
165,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
TypeError occurring while using Celery 2.6.0rc5
===
I am using [Celery 2.6.0rc5][1], and getting the following error:
[2012-06-22 23:01:42,016: ERROR/MainProcess] Unrecoverable error: TypeError('handle_event() takes exactly 3 arguments (1 given)',)
Traceback (most recent call last):
File "/home/bmh/celery/celery/worker/__init__.py", line 350, in start
component.start()
File "/home/bmh/celery/celery/worker/consumer.py", line 369, in start
self.consume_messages()
File "/home/bmh/celery/celery/worker/consumer.py", line 435, in consume_messages
readers[fileno](fileno, event)
File "/home/bmh/kombu/kombu/transport/redis.py", line 636, in handle_event
self._callbacks[queue](message)
File "/home/bmh/kombu/kombu/transport/virtual/__init__.py", line 461, in _callback
return callback(message)
File "/home/bmh/kombu/kombu/messaging.py", line 482, in _receive_callback
self.receive(decoded, message)
File "/home/bmh/kombu/kombu/messaging.py", line 454, in receive
[callback(body, message) for callback in callbacks]
File "/home/bmh/celery/celery/worker/consumer.py", line 397, in on_task_received
[callback() for callback in on_task_callbacks]
TypeError: handle_event() takes exactly 3 arguments (1 given)
I [pulled both kombu and celery from git just moments ago][2], and am trying this on Ubuntu 12.04 LTS with `redis-server` (2:2.2.12-1build1) installed as the broker.
My config (`celeryconfig.py`) is:
BROKER_URL = "redis://localhost:6379/0"
BACKEND_URL = BROKER_URL
CELERY_RESULT_BACKEND = "redis"
CELERY_REDIS_HOST = "localhost"
CELERY_REDIS_PORT = 6379
CELERY_REDIS_DB = 0
My worker (`worker.py`) is:
#!/usr/bin/python2.7
from celery import Celery
celery = Celery()
celery.config_from_object('celeryconfig')
@celery.task(ignore_result=True)
def atest(data):
print "Got data: %s" % data
if __name__ == "__main__":
celery.start()
When I run the worker with `$ ./worker.py worker`, and I call the worker as follows from a python shell:
import worker
worker.atest("abc")
The worker reports the above error, reports a longer error that ultimately ends with the worker quitting on the following:
[2012-06-22 23:01:43,025: WARNING/MainProcess] File "/home/bmh/kombu/kombu/utils/eventio.py", line 95, in unregister
[2012-06-22 23:01:43,025: WARNING/MainProcess] self._epoll.unregister(fd)
[2012-06-22 23:01:43,025: WARNING/MainProcess] ValueError
[2012-06-22 23:01:43,025: WARNING/MainProcess] :
[2012-06-22 23:01:43,026: WARNING/MainProcess] I/O operation on closed epoll fd
Incidentally, when I run `$ ./worker.py shell` and run "import kombu; kombu.__version__" it reports 2.2.2, which I understand to be the latest version. It may also be worth noting that [someone else encountered this][3], but seemed to have solved it by updating kombu.
As this is really the simplest celery project I can imagine, I am completely new to celery, and this is a development version, I am a bit stumped on where to go from here and would be grateful for any assistance.
Thank you for reading.
[1]: https://github.com/celery/celery
[2]: https://github.com/celery/celery#using-the-development-version
[3]: https://github.com/celery/celery/issues/808 | 0 | [
2,
1001,
29992,
10428,
133,
568,
11692,
3849,
172,
9,
379,
9,
387,
5453,
264,
800,
3726,
3726,
31,
589,
568,
636,
19537,
622,
172,
9,
379,
9,
387,
5453,
264,
500,
2558,
165,
500,
15,
17,
1017,
14,
249,
7019,
45,
636,
3212,
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... |
Why is my python function not defined, when it exists in the same file?
===
I have a simple function, which I shall call myFunction. It takes two parameters, performs some calculations on them, and returns the result.
I also have a class, MyClass, which has a constructor that has a header like this:
`__init__(self, bar, fun=myFunction):`
When I try to run anything in this class, I get the following error:
MyClass
def __init__(self, bar, fun=myFunction):
NameError: name 'myFunction' is not defined
If I remove this class, I can use myFun in the Python Shell, so what's the deal? | 0 | [
2,
483,
25,
51,
20059,
1990,
52,
2811,
15,
76,
32,
5636,
19,
14,
205,
3893,
60,
800,
3726,
3726,
31,
57,
21,
1935,
1990,
15,
56,
31,
3004,
645,
51,
22359,
9,
32,
1384,
81,
12905,
15,
11563,
109,
19186,
27,
105,
15,
17,
4815,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error using lambda sort
===
I'm relatively new to web2py, and having problems with this sort function:
sorted_rows = day_rows.sort(lambda r: r.inspection)
This results in the error:
<type 'exceptions.TypeError'> <lambda>() takes exactly 1 argument (2 given)
day_rows is the result from a database select, and has, in this case, about 20 rows in it.
I clearly am missing something elementary, but I can't figure it out. I will greatly appreciate any help.
Thanks,
John
| 0 | [
2,
7019,
568,
13,
24187,
2058,
800,
3726,
3726,
31,
22,
79,
3109,
78,
20,
2741,
135,
6448,
15,
17,
452,
1716,
29,
48,
2058,
1990,
45,
22554,
1,
5417,
18,
800,
208,
1,
5417,
18,
9,
22843,
5,
24187,
761,
45,
761,
9,
108,
7350,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
calling instance methods statically from within the class
===
According to one of the man pages http://www.php.net/manual/en/language.oop5.static.php :
> Calling non-static methods statically generates an E_STRICT level warning.
But, this doesn't seem to be the case when the call is made from *inside* the class:
error_reporting(-1);
class Test {
private $id;
function __construct($id) { $this->id = $id; }
function id() { return $this->id; }
function __toString() {
return Test::id()
. self::id()
. static::id()
. static::id()
. call_user_func('Test::id')
. call_user_func(array('Test', 'id'));
}
}
$a = new Test('a');
$b = new Test('b');
echo "$a $b $a"; # aaaaaa bbbbbb aaaaaa
var_dump(error_get_last()); # NULL
Testing with php 5.4
**DEMO:** http://codepad.viper-7.com/IKp9iX
I believe I've demonstrated:
- No E_STRICT warning is generated
- That php magically corrects the static method call to an instance method call(accessing the instance variable `id` proves this).
Is this a bug, or a documented feature? | 0 | [
2,
2555,
4851,
3195,
12038,
1326,
37,
363,
14,
718,
800,
3726,
3726,
496,
20,
53,
16,
14,
169,
4434,
7775,
6903,
6483,
9,
26120,
9,
2328,
118,
177,
6948,
118,
219,
118,
7020,
9,
21709,
264,
9,
18077,
9,
26120,
13,
45,
13,
1,
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... |
php security function to filter our malicious code is stripping out legit characters
===
I have a security function which is part of a script. It's supposed to filter out malicious code from being executed in an input form. It works without a problem with normal characters from A-Z, but it rejects inputs with characters such as á, ñ, ö, etc.
What can I do so that form inputs with these characters are not rejected? Here is the function:
function add_special_chars($string, $no_quotes = FALSE)
{
$patterns = array(
"/(?i)javascript:.+>/",
"/(?i)vbscript:.+>/",
"/(?i)<img.+onload.+>/",
"/(?i)<body.+onload.+>/",
"/(?i)<layer.+src.+>/",
"/(?i)<meta.+>/",
"/(?i)<style.+import.+>/",
"/(?i)<style.+url.+>/"
);
$string = str_ireplace("&","&",$string);
if (!$no_quotes) $string = str_ireplace("'","'",$string);
$string = str_ireplace('"','"',$string);
$string = str_ireplace('<','<',$string);
$string = str_ireplace('>','>',$string);
$string = str_ireplace(' ',' ',$string);
foreach ($patterns as $pattern)
{
if(preg_match($pattern, $string))
{
$string = strip_tags($string);
}
}
$string = preg_replace('#(&\#*\w+)[\x00-\x20]+;#u', "$1;", $string);
$string = preg_replace('#(&\#x*)([0-9A-F]+);*#iu', "$1$2;", $string);
$string = html_entity_decode($string, ENT_COMPAT, LANG_CODEPAGE);
$string = preg_replace('#(<[^>]+[\x00-\x20\"\'\/])(on|xmlns)[^>]*>#iUu', "$1>", $string);
$string = preg_replace('#([a-z]*)[\x00-\x20\/]*=[\x00-\x20\/]*([\`\'\"]*)[\x00-\x20\/]*j[\x00-\x20]*a[\x00-\x20]*v[\x00-\x20]*a[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu', '$1=$2nojavascript...', $string);
$string = preg_replace('#([a-z]*)[\x00-\x20\/]*=[\x00-\x20\/]*([\`\'\"]*)[\x00-\x20\/]*v[\x00-\x20]*b[\x00-\x20]*s[\x00-\x20]*c[\x00-\x20]*r[\x00-\x20]*i[\x00-\x20]*p[\x00-\x20]*t[\x00-\x20]*:#iUu', '$1=$2novbscript...', $string);
$string = preg_replace('#([a-z]*)[\x00-\x20\/]*=[\x00-\x20\/]*([\`\'\"]*)[\x00-\x20\/]*-moz-binding[\x00-\x20]*:#Uu', '$1=$2nomozbinding...', $string);
$string = preg_replace('#([a-z]*)[\x00-\x20\/]*=[\x00-\x20\/]*([\`\'\"]*)[\x00-\x20\/]*data[\x00-\x20]*:#Uu', '$1=$2nodata...', $string);
$string = preg_replace('#(<[^>]+[\x00-\x20\"\'\/])style[^>]*>#iUu', "$1>", $string);
$string = preg_replace('#</*\w+:\w[^>]*>#i', "", $string);
do
{
$original_string = $string;
$string = preg_replace('#</*(applet|meta|xml|blink|link|embed|object|iframe|frame|frameset|ilayer|layer|bgsound|title|base)[^>]*>#i', "", $string);
}
while ($original_string != $string);
return $string;
} | 0 | [
2,
13,
26120,
1221,
1990,
20,
11945,
318,
24231,
1797,
25,
25105,
70,
1860,
242,
1766,
800,
3726,
3726,
31,
57,
21,
1221,
1990,
56,
25,
141,
16,
21,
3884,
9,
32,
22,
18,
2293,
20,
11945,
70,
24231,
1797,
37,
142,
5557,
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... |
Batch Script to run for months with various options
===
I want to run a batch script that runs for month. The code is below. It processes loads of videos and sends their various outputs to various folders.
The problem is if its running for a month unattended, the disk might be full. I want it to check if the disk is full and ontinue writing to another disk. It would be nice to have a log as well
`@echo off
setlocal enabledelayedexpansion
set EXE_FILE=E:\opencv\build\bin\Release\blobtrack_sample.exe
set INPUT_PATH=E:\Glasgow\Test\
set TRACKS_PATH=E:\Glasgow\Tracks\
set OUTPUT_PATH=E:\Glasgow\Result\
set COUNT=0
pushd %INPUT_PATH%
for %%f in (*) do if %%f neq %~nx0 (
set /a COUNT+=1
echo Processing %%f, track=%%~nf.txt, btavi=test!COUNT!%%~xf
%EXE_FILE% fg=FG_0S bd=BD_CC bt=CCMSPF btpp=None bta=Kalman btgen=RawTracks track=%TRACKS_PATH%\%%~nf.txt FGTrainFrames=125 btavi=%OUTPUT_PATH%\%%~nf.avi %%f
)
popd`
| 0 | [
2,
13064,
3884,
20,
485,
26,
818,
29,
617,
6368,
800,
3726,
3726,
31,
259,
20,
485,
21,
13064,
3884,
30,
1461,
26,
1617,
9,
14,
1797,
25,
1021,
9,
32,
5102,
19069,
16,
6610,
17,
11350,
66,
617,
5196,
18,
20,
617,
19294,
18,
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... |
Bar charts using JS Charts
===
bar charts for JS Charts I can draw only bar chart by using JSCharts. I nedd two barcharts in one charts. Please help me. Thanks in advance | 0 | [
2,
748,
5158,
568,
487,
18,
5158,
800,
3726,
3726,
748,
5158,
26,
487,
18,
5158,
31,
92,
2003,
104,
748,
1795,
34,
568,
487,
2992,
13448,
9,
31,
12266,
43,
81,
748,
5433,
38,
18,
19,
53,
5158,
9,
2247,
448,
55,
9,
3669,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
XCODE - REDEFINE MACRO
===
Small problem I'm having where i have an amount of objects (enemies) on the screen at one particular time and cannot redefine their value. I set my enemies to begin with 3 on the screen.
My objective is to change the amount of enemies based on the current score.
I've attached snippets of the code below.
#define kEnemies 3
- (void) EnemyIncrease
{
if (self.score>=100) {
#define kEnemies 4
}
}
// I've also tried amongst other things
#define kEnemies 3
- (void) EnemyIncrease
{
if (self.score >=100) {
#undef kEnemies
#define kEnemies 6
}
}
Would really appreciate some assistance.
Thanks in advance
| 0 | [
2,
993,
9375,
13,
8,
402,
62,
7509,
9069,
800,
3726,
3726,
284,
1448,
31,
22,
79,
452,
113,
31,
57,
40,
2006,
16,
3916,
13,
5,
4622,
18978,
6,
27,
14,
2324,
35,
53,
1498,
85,
17,
1967,
402,
62,
7509,
66,
1923,
9,
31,
309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
strange ' C4267' warning when compiling google mocks
===
Visual C++ 2005 complains with:
"warning C4267: 'argument' : conversion from 'size_t' to 'unsigned int', possible loss of data" when compiling the code below.
class C1 {
virtual void M11(size_t p1, int p2) = 0;
};
class C2 {
virtual void M21(unsigned int p1) = 0;
};
class C1Mock: public C1 {
MOCK_METHOD2(M11, void(size_t p1, int p2));
};
class C2Mock: public C2 {
MOCK_METHOD1(M21, void(unsigned int p1)); //<- warning C4267
};
Any idea what this might be?
PS: The warning goes away if I remove the second parameter (p2) from the M11's signature!?!?
| 0 | [
2,
2578,
13,
22,
272,
300,
24370,
22,
3590,
76,
24378,
8144,
10506,
18,
800,
3726,
3726,
3458,
272,
20512,
812,
15310,
18,
29,
45,
13,
7,
1885,
2981,
272,
300,
24370,
45,
13,
22,
512,
3073,
1130,
22,
13,
45,
6263,
37,
13,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Z3 theory plug-in error
===
I have created a custom theory plugin, which does nothing at the moment. The callbacks are all implemented and registered, but they simply return. Then, I read in a bunch of declare-consts, declare-funs, and asserts using Z3_parse_smtlib2_string, and pass the resulting ast to Z3_assert_cnstr. A subsequent call to Z3_check_and_get_model fails with the following error:
> The mk_fresh_ext_data callback was not set for user theory, you must use Z3_theory_set_mk_fresh_ext_data_callback
As far as I can tell, Z3_theory_set_mk_fresh_ext_data_callback does not exist.
Using the same string, but without registering the theory plugin, Z3_check_and_get_model returns sat and gives a model as expected.
I am using version 4 and the Linux 64 bit libraries.
The full example is here: <http://pastebin.com/hLJ8hFf1> | 0 | [
2,
2052,
240,
1639,
10922,
8,
108,
7019,
800,
3726,
3726,
31,
57,
679,
21,
5816,
1639,
10922,
108,
15,
56,
630,
626,
35,
14,
688,
9,
14,
645,
1958,
18,
50,
65,
6807,
17,
3801,
15,
47,
59,
1659,
788,
9,
94,
15,
31,
1302,
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... |
How to delete ALL Cookies from windows phone WebBrowser control. (WP7)
===
In my app I use WebBrowser control. User can visit http://mail.google.com then without logging out from google.com he visits http://twitter.com then http://abcd.com etc.
Now my requirement is to do the fresh start of the WebBrowser control and revisit those website and force the user to login again on those sites.
How can I **clear ALL Cookies** from windows phone WebBrowser control in WP7? I tried few JavaScript examples available in net. Nothing worked. Can you anybody help me on this? | 0 | [
2,
184,
20,
27448,
65,
19396,
37,
1936,
1132,
10192,
5417,
4104,
569,
9,
13,
5,
13790,
465,
6,
800,
3726,
3726,
19,
51,
4865,
31,
275,
10192,
5417,
4104,
569,
9,
4155,
92,
2139,
7775,
6903,
8079,
9,
16111,
4875,
9,
960,
94,
366,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
database to store a huge tree
===
the problem I need to solve is storing the equivalent of a file sytem tree into a database (in order to speed up search operations). The tree contains +400.000.000 inodes and for each inode I need to store some meta information (the average file path is 100 bytes, and the meta information is ~50 bytes).
Following operations will be made, from a C++ program:
1. SELECT (with expected results: ~200.000)
2. INSERT ~20.000 records at once
3. DELETE ~20.000 records at once.
Until now, I considered only relational databases: MySQL, MariaDB, PostgresSQL (I haven't done any testing so far, I'm still in "information gathering" phase) and I read some documentation about storing trees in such a DB.
**First option**
- The Adjacency List Model: each item in the table contains a pointer to its parent.
http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
**Second option**
- store all directories in a separate table
- have a separate table for rest of the files, with pointers to the directory they belong to
so the tables will look like this:
DirTable:
/home
/home/test/
FileTable:
file1
file2
My questions:
1. do you know another model suitable for storing a huge tree in a relational database?
2. if I'd search for a NoSQL DB, where should I start?
Many thanks.
| 0 | [
2,
6018,
20,
1718,
21,
2329,
1541,
800,
3726,
3726,
14,
1448,
31,
376,
20,
8402,
25,
25615,
14,
4602,
16,
21,
3893,
10315,
38,
1503,
1541,
77,
21,
6018,
13,
5,
108,
389,
20,
1362,
71,
2122,
1311,
6,
9,
14,
1541,
1588,
2754,
71... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sending data in order with SocketAsyncEventArgs
===
I originally had a race condition when sending data, the issue was that I was allowing multiple SocketAsyncEventArgs to be used to send data, but the first packet didn't send fully before the 2nd packet, this is because I have it so if the data doesn't fit in the buffer it loops until all the data is sent, and the first packet was larger than the second packet which is tiny, so the second packet was being sent and reached to the client before the first packet.
I have solved this by assigning 1 SocketAyncEventArgs to an open connection to be used for sending data and used a Semaphore to limit the access to it, and make the SocketAsyncEventArgs call back once it completed.
Now this works fine because all data is sent, calls back when its complete ready for the next send. The issue with this is, its causing blocking when I want to send data randomly to the open connection, and when there is a lot of data sending its going to block my threads.
I am looking for a work around to this, I thought of having a Queue which when data is requested to be sent, it simply adds the packet to the Queue and then 1 SocketAsyncEventArgs simply loops to send that data.
But how can I do this efficiently whilst still being scalable? I want to avoid blocking as much as I can whilst sending my packets in the order they are requested to be sent in.
Appreciate any help! | 0 | [
2,
4907,
1054,
19,
389,
29,
18482,
472,
93,
6175,
6645,
10663,
18,
800,
3726,
3726,
31,
912,
41,
21,
764,
2874,
76,
4907,
1054,
15,
14,
1513,
23,
30,
31,
23,
2719,
1886,
18482,
472,
93,
6175,
6645,
10663,
18,
20,
44,
147,
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... |
How to send a message in php with paragraphs
===
I'm using the php code below to send a message
<?php
$newline = $_GET['message'];
$newline = str_replace("[N]","\n","$newline");
$newline = str_replace("[n]","\n","$newline");
mail($_GET['to'],$_GET['subject'],$newline,"From: ".$_GET['from']);
header( 'Location: http://my_site.com/POMPC/report.html' ) ;
?>
sadly, when I send the message, it appears but everything appears in a straignt line, messing up the message.
Example:
Hello,
This is a message.
Reply.
Appears as
>Hello,This is a message. Reply.
Everything is in a straignt line and messes up stuff. How do I mantain the formatting. The message I'm sending is from my desktop application and sends user defined data to me. | 0 | [
2,
184,
20,
2660,
21,
2802,
19,
13,
26120,
29,
20599,
18,
800,
3726,
3726,
31,
22,
79,
568,
14,
13,
26120,
1797,
1021,
20,
2660,
21,
2802,
13,
1,
60,
26120,
5579,
2681,
1143,
800,
5579,
1,
3060,
2558,
22,
3845,
18,
1303,
22,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Xdocument amend all attributes that match
===
This is driving me mad, I've been trying this for 2 days now.
I basically want to substitute values based on name.
I have xml as follows:
<session>
<immediate>
<diff name="TEST_DIFF">
<pivot name="(Original)">
<grid-processor name="mdStoredShape"/>
<axes>
<axis position="SLICERS">
<attribute name="Result Namespace" mode="INCLUSIVE">
<selection value="$NAMESPACE$"/>
</attribute>
<attribute name="Date" mode="INCLUSIVE">
<selection value="$DATEFROM$"/>
</attribute>
<attribute name="Book" mode="INCLUSIVE">
<selection value="$BOOK_NAME$" type="Book Hierarchy"/>
</attribute>
<attribute name="Measure" mode="INCLUSIVE">
<exclude value="PV"/>
</attribute>
<attribute name="Risk Source System" mode="INCLUSIVE">
<selection value="gdsldn"/>
</attribute>
<attribute name="Is Error">
<selection value="false"/>
</attribute>
</axis>
<axis position="DISCRIMINATOR">
<attribute name="Book" mode="ALL"/>
<attribute name="Book" mode="ALL"/>
<attribute name="Measure" mode="ALL"/>
</axis>
<axis position="RESULT">
<attribute name="SUM(Money Value In(GBP))"/>
<attribute name="COUNT_DISTINCT(Book)"/>
</axis>
</axes>
</pivot>
<pivot name="(New)">
<grid-processor name="mdStoredShape"/>
<axes>
<axis position="SLICERS">
<attribute name="Result Namespace" mode="INCLUSIVE">
<selection ref="$NAMESPACE$"/>
</attribute>
<attribute name="Date" mode="INCLUSIVE">
<selection ref="$DATETO$"/>
</attribute>
<attribute name="Book" mode="INCLUSIVE">
<selection value="$BOOK_NAME$" type="Book Hierarchy"/>
</attribute>
<attribute name="Measure" mode="INCLUSIVE">
<exclude ref="PV"/>
</attribute>
<attribute name="Risk Source System" mode="INCLUSIVE">
<selection value="gdsldn"/>
</attribute>
<attribute name="Is Error">
<selection value="false"/>
</attribute>
</axis>
<axis position="DISCRIMINATOR">
<attribute name="Book" mode="ALL"/>
<attribute name="Book" mode="ALL"/>
<attribute name="Measure" mode="ALL"/>
</axis>
<axis position="RESULT">
<attribute name="SUM(Money Value In(GBP))"/>
<attribute name="COUNT_DISTINCT(Book)"/>
</axis>
</axes>
<source name="risk"/>
</pivot>
</diff>
</immediate>
</session>
and I want to replace all $NAMESPACE$ values with an actual value.
Can someone help?
| 0 | [
2,
993,
28132,
19247,
65,
13422,
30,
730,
800,
3726,
3726,
48,
25,
2891,
55,
2073,
15,
31,
22,
195,
74,
749,
48,
26,
172,
509,
130,
9,
31,
11374,
259,
20,
6558,
4070,
432,
27,
204,
9,
31,
57,
23504,
28,
2415,
45,
13,
1,
7202... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 expression in sql
===
I have the following query which is giving me an ORA-00935 missing expression error, but I can't figure out what I've messed up for the life of me. I've tried running just about every part of the query separately, and they all work apart, but together I get only errors. I've read that SQL is buggy around missing expression errors, but there has to be some better way to write this query so that it actually works.
Insert into V1144ENGINE.T_EDGES (EDGE_ID, VERSION, NODE1_ID, NODE2_ID, EDGE_TYPE_ID, CREATED_AT, WEIGHT, DELETED_AT)
VALUES(V1144ENGINE.S_PK_EDGES.NEXTVAL,0,
select NODE_ID from V1144ENGINE.T_NODES where NODE_NAME = 'Understand composition of an element',
select NODE_ID from V1144ENGINE.T_NODES where NODE_NAME = 'Understand atoms as smallest units of matter', 3, SYSDATE, 1, NULL);
The parts of the query I've attempted apart from each other are as follows, all of which returned the result I wanted:
select V1144ENGINE.S_PK_EDGES.NEXTVAL from dual;
select NODE_ID from V1144ENGINE.T_NODES where NODE_NAME = 'Understand composition of an element'
Ideas? I am using Oracle 11g if that makes a difference.
| 0 | [
2,
2863,
1803,
19,
4444,
255,
800,
3726,
3726,
31,
57,
14,
249,
25597,
56,
25,
1438,
55,
40,
54,
58,
8,
2032,
4069,
264,
2863,
1803,
7019,
15,
47,
31,
92,
22,
38,
1465,
70,
98,
31,
22,
195,
21537,
71,
26,
14,
201,
16,
55,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQL in Java. Cannot receive the result set
===
I hope that you can correct me if my syntax is wrong. I could check on Google only if the SELECT...WHERE clause is correct.
I want to retrieve the **student_id** for using it in another query, but seems that all I get from this is a "0".
in java file:
rst = stmt.executeQuery("SELECT student_id FROM students WHERE name= 'to_delete'");
sid = rst.getInt("student_id");
**to_delete** is a String which this java file receives as a parameter to the method which must return **student_id**. It really contains the correct string(I checked it).
Table "students" contains the fileds: student_id, name, year. I need to have returned the student_id for the name "to_delete".
I have no errors/exceptions, just that when I display the result, I see id: 0 no matter what name I type. Maybe rst.getString("column_name") is correct only for executeUpdate(...)?
Thank you in advance! | 0 | [
2,
4444,
255,
19,
8247,
9,
1967,
2588,
14,
829,
309,
800,
3726,
3726,
31,
1376,
30,
42,
92,
4456,
55,
100,
51,
22649,
25,
1389,
9,
31,
110,
2631,
27,
8144,
104,
100,
14,
5407,
9,
9,
9,
2798,
9040,
25,
4456,
9,
31,
259,
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... |
Telerik RadGrid MultiRow Edit - Issue with Popup
===
My project uses Telerik RadGrid to hold the Rows.
Pagesize Combo is set with the options to display 30, 40, 50 & "Show ALL" rows.
For example:-
Say my grid has 60 rows with the use of Show ALL option.
If I select upto 57 rows and edit them using "MultiEdit" option, there will be a Popup-window and it opens up with dropdowns to select new values.
If I select 58 rows or more than that and try edit them, the pop-up window opens as a blank window.
is there any limitation on the rows edited in telerik RadGrid using the MultiEdit option.
Thanks
Gomathi | 0 | [
2,
4338,
6639,
4944,
16375,
1889,
5417,
9392,
13,
8,
1513,
29,
1675,
576,
800,
3726,
3726,
51,
669,
2027,
4338,
6639,
4944,
16375,
20,
1027,
14,
11295,
9,
4434,
2952,
22621,
25,
309,
29,
14,
6368,
20,
3042,
712,
15,
1417,
15,
1222... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Telerik RadDatePicker Control
===
I am using Telerik's RadDatePicker control which i think is essentially a DateTime control and i would like to extract the selected date and string it to a variable. Would be great if someone could help me on this. | 0 | [
2,
4338,
6639,
4944,
8209,
16855,
106,
569,
800,
3726,
3726,
31,
589,
568,
4338,
6639,
22,
18,
4944,
8209,
16855,
106,
569,
56,
31,
277,
25,
7398,
21,
1231,
891,
569,
17,
31,
83,
101,
20,
10962,
14,
1704,
1231,
17,
3724,
32,
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,
0,
0,
0,
0... |
Histogram Intersect Delphi
===
I want to measure color similarity between image using RGB feature, e.g from one image to another training image using histogram intersect, so, how do I save the training histogram value, is it I must save the image so that when I want to measure, then I read one by one of the training image again and again or maybe I must save the histogram value data first to db like H={255,200,50,255,...}? if I must save all the histogram value and I've 320x240 px resolution then it must waste my db space which is 320x240 = 76800 record and this is just for the red component, if I add the green and blue it must be 76800x3 = 230400 records, this is not efficent I think because it waste lots of record just for one image, how about the training image which is hundred of image? thanks before... | 0 | [
2,
33,
38,
20476,
17822,
23030,
800,
3726,
3726,
31,
259,
20,
4058,
1665,
17204,
128,
1961,
568,
761,
11400,
1580,
15,
13,
62,
9,
263,
37,
53,
1961,
20,
226,
838,
1961,
568,
33,
38,
20476,
17822,
15,
86,
15,
184,
107,
31,
2079,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
register_chrdev function arguments in linux device driver
===
Why pointer to file_operation structure is required in funcion **register_chrdev** as argument?How is the structure used by this function? | 0 | [
2,
2243,
1,
673,
897,
2443,
1990,
10553,
19,
13024,
3646,
2425,
800,
3726,
3726,
483,
454,
106,
20,
3893,
1,
11377,
1411,
25,
1390,
19,
2414,
10934,
13,
1409,
12463,
9959,
1,
673,
897,
2443,
1409,
28,
5476,
60,
1544,
25,
14,
1411,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Move SharePoint 2010 Virtual Machine
===
I developed a website in a virtual server for SharePoint 2010....It's ok.
Can I get this server, with website ready, and provides it in production?
I won't change the virtual server name, but the IP server will change...
Is it possível ? or I'll able to get problems? | 0 | [
2,
780,
1891,
3132,
498,
6599,
1940,
800,
3726,
3726,
31,
885,
21,
2271,
19,
21,
6599,
8128,
26,
1891,
3132,
498,
9,
9,
9,
9,
242,
22,
18,
5854,
9,
92,
31,
164,
48,
8128,
15,
29,
2271,
1451,
15,
17,
1927,
32,
19,
637,
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... |
Primefaces rowEditor just active row validation
===
In my application, I have some dialogs with dataTables that user can edit values, so I'm using primefaces rowEditor... Sometimes I have required fields in dataTable as you can see in this screen:
![dataTable with required fields][1]
In this screen, the user isn't required to fill all rows, so, if I put required=true, all fields including the ones that are deactive, show required validation message. This way if the user clicks on OK button, he can't close the popup cause there is a lot of required fields validation error.
I tried use a parameter in required attribute this way:
<f:facet name="input">
<h:selectOneMenu value="#{cfop.idTipoTributacao}" required="#{param['EDITAVEL']}"
style="width: 100px;">
<f:selectItems value="#{selectTipoTributacao.itens}"/>
</h:selectOneMenu>
</f:facet>
but unfortunately I didn't found a way to pass this parameter when user clicks on save button of p:rowEditor.
Is there a way I can make these fields required only when they are in edit mode?? I'm usgin primefaces 2.2.1 with MyFaces
[1]: http://i.stack.imgur.com/JUhKW.png | 0 | [
2,
1621,
6413,
18,
3131,
13401,
114,
1348,
3131,
27999,
800,
3726,
3726,
19,
51,
3010,
15,
31,
57,
109,
28223,
18,
29,
1054,
5924,
18,
30,
4155,
92,
9392,
4070,
15,
86,
31,
22,
79,
568,
1621,
6413,
18,
3131,
13401,
9,
9,
9,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using Base66 for encryption and decryption and where exactly we need to do that exactly
===
I am doing a application that deals with where Users can login and see all the GIS Data (Global Information Systems )related to a particular Network .
This is of a normal domain ( I mean which doesn't involve money)
My question is , when a user logins for at the Login Page ( I am planning to use base64.encode to make the password protected )
I have 3 questions with respect to the above
1. Does using base64.encode is suitable here ??
2. When the User submits the User name and Password at the Login page , i am planning to use encrypt at the Servlet level (That is aftre reciving the password using `req.getparameter("password")`
static public char[] encode(byte[] data)
{
}
Please tell me if this is right ??
3. And where exactly i need to decrypt the password ?? ( That is do i need to store it in the database with the encrypted value and decrypt it in DAO Layer ??
Please tell me if this is right ??
| 0 | [
2,
568,
1000,
3526,
26,
24420,
17,
121,
11435,
872,
17,
113,
1890,
95,
376,
20,
107,
30,
1890,
800,
3726,
3726,
31,
589,
845,
21,
3010,
30,
10342,
29,
113,
3878,
92,
6738,
108,
17,
196,
65,
14,
16004,
1054,
13,
5,
26763,
676,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hot to make a normal map in THREE.js correctly?
===
I just tried to apply the Normal map Ninja demo (http://mrdoob.github.com/three.js/examples/webgl_materials_normalmap.html) to a cube in my scene with the following code - using new latest Three.js version from dev branch:
// common material parameters
var ambient = 0x050505, diffuse = 0x331100, specular = 0xffffff, shininess = 10, scale = 23;
// normal map shader
var shader = THREE.ShaderUtils.lib[ "normal" ];
var uniforms = THREE.UniformsUtils.clone( shader.uniforms );
uniforms[ "enableAO" ].value = true;
uniforms[ "enableDiffuse" ].value = false;
uniforms[ "enableSpecular" ].value = false;
uniforms[ "enableReflection" ].value = true;
uniforms[ "tNormal" ].texture = THREE.ImageUtils.loadTexture( "normal.jpg" );
uniforms[ "tAO" ].texture = THREE.ImageUtils.loadTexture( "ao.jpg" );
uniforms[ "tDisplacement" ].texture = THREE.ImageUtils.loadTexture( "displacement.jpg" );
uniforms[ "uDisplacementBias" ].value = - 0.428408 * scale;
uniforms[ "uDisplacementScale" ].value = 2.436143 * scale;
uniforms[ "uDiffuseColor" ].value.setHex( diffuse );
uniforms[ "uSpecularColor" ].value.setHex( specular );
uniforms[ "uAmbientColor" ].value.setHex( ambient );
uniforms[ "uShininess" ].value = shininess;
uniforms[ "tCube" ].texture = reflectionCube;
uniforms[ "uReflectivity" ].value = 0.1;
uniforms[ "uDiffuseColor" ].value.convertGammaToLinear();
uniforms[ "uSpecularColor" ].value.convertGammaToLinear();
uniforms[ "uAmbientColor" ].value.convertGammaToLinear();
var parameters = { fragmentShader: shader.fragmentShader, vertexShader: shader.vertexShader, uniforms: uniforms, lights: true, fog: false };
var displacementMaterial = new THREE.ShaderMaterial( parameters );
/*
var diamond = new THREE.Diamond({
material: bumpmapMaterial
});
*/
var diamond = new THREE.Mesh(
new THREE.CubeGeometry(50, 50, 50),
displacementMaterial
);
I am, however, getting the following WebGL error in Chrome:
GL_INVALID_OPERATION : glDrawXXX: attempt to access out of range vertices
In Firefox, I am not getting an error like this, but the cube wouldn't show up either.
Using a standard colored MeshLambertMaterial, everything's working fine. So, there needs to be a conflict with the ShaderMaterial. If I use the latest Three.js version from MASTER branch, it doesn't improve the situation - same error occurs.
Any idea why this may be the case and what I need to change to get it working?
Thanks in advance!
| 0 | [
2,
1047,
20,
233,
21,
1826,
2942,
19,
132,
9,
728,
18,
12044,
60,
800,
3726,
3726,
31,
114,
794,
20,
5645,
14,
1826,
2942,
14727,
8376,
13,
5,
21127,
6903,
5189,
537,
4995,
9,
10404,
20926,
9,
960,
118,
5642,
9,
728,
18,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Resize Image and overlay inside a picturebox
===
I have 2 images one inside picturebox1 and the other one as a path, i want to resize the path one to be as big as the one in picturebox1 and then i want to overlay these images and display the result inside of picturebox1! (kryptonlabel4 contains the path tzo the picturebox1 image) [c#]
System.Drawing.Image canvas = Bitmap.FromFile(kryptonLabel4.Text);
Graphics gra = Graphics.FromImage(canvas);
Bitmap smallImg = new Bitmap("iGlowBlack.png");
Bitmap result = new Bitmap(pictureBox1.Image.Width, pictureBox1.Image.Height);
using (Graphics g = Graphics.FromImage((Image)result))
g.DrawImage(smallImg, 0, 0, pictureBox1.Image.Width, pictureBox1.Image.Height);
gra.DrawImage(smallImg, new Point(0, 0));
pictureBox1.Image = canvas;
whats wrong? | 0 | [
2,
302,
10454,
1961,
17,
84,
4414,
572,
21,
2151,
5309,
800,
3726,
3726,
31,
57,
172,
3502,
53,
572,
2151,
5309,
165,
17,
14,
89,
53,
28,
21,
2013,
15,
31,
259,
20,
302,
10454,
14,
2013,
53,
20,
44,
28,
580,
28,
14,
53,
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... |
Redirect_to calling controller's action
===
I have a rail3.0.14 app and I noticed some odd behavior on a redirect_to in a before filter.
The controller has an action called status and it's getting called in the redirect_to and clobbering the code execution.
Here:
https://github.com/rails/rails/blob/master/actionpack/lib/action_controller/metal/instrumentation.rb
def redirect_to(*args)
ActiveSupport::Notifications.instrument("redirect_to.action_controller") do |payload|
result = super
payload[:status] = response.status
payload[:location] = response.location
result
end
end
Is status simply a hands off keyword for controller actions? Or is this a bug? | 0 | [
2,
302,
14706,
1,
262,
2555,
9919,
22,
18,
1028,
800,
3726,
3726,
31,
57,
21,
2240,
240,
9,
387,
9,
1419,
4865,
17,
31,
2711,
109,
4210,
3257,
27,
21,
302,
14706,
1,
262,
19,
21,
115,
11945,
9,
14,
9919,
63,
40,
1028,
227,
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... |
Can I make several company id as a team and publish APPs with their own seller name?
===
Sorry for my poor English first.
Here is my question.
There is several companies which have their own App service in App store and also they have a company developer id for their own.
I want to make them as a team to share team id or bundle seed id and share key-value data in icloud between each Apps.
Assume that all company agreed to become a team member.
I guess if one of them become a team agent then the team agent can publish App for their team's App.
I wonder the team agent can publish APPS with their own company name.
For example.
(A) company has a company id which is 'aaa' with seller name 'AAA co,LTD'
(B) company has a company id which is 'bbb' with seller name 'BBB co,LTD'
(C) company has a company id which is 'ccc' with seller name 'CCC co,LTD'
company ID 'aaa' from AAA co, LTD made a team inviting 'bbb' and 'ccc'
then 'aaa' become a team agent.
If 'bbb' asks for publish (B) company's APP to the team agent, then can the team agent 'aaa' publish (B) company's APP with seller name 'BBB co, LTD' in App Store?
sorry for my poor English again.
I wish I can get an answer here.
Thanks! | 0 | [
2,
92,
31,
233,
238,
237,
4924,
28,
21,
173,
17,
10824,
4865,
18,
29,
66,
258,
3344,
106,
204,
60,
800,
3726,
3726,
1875,
26,
51,
1696,
486,
64,
9,
235,
25,
51,
1301,
9,
80,
25,
238,
1532,
56,
57,
66,
258,
4865,
365,
19,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I disable "Verify file exists" in IIS 6 aspx Handler programmatically?
===
I need to install an MVC 2 Application automatically on a series of servers. To make MVC 2 work with IIS 6 out of the box I have changed the routing to route urls with .aspx extensions as described in an article by Phil Haacked. This works fine only if the "Verify file exists" option on the aspx handler is disabled.
This prevents IIS from checking for the aspx file(which does not exist) and throwing a 404 error.
My question is how do I disable this in the handler in my installer? | 0 | [
2,
184,
107,
31,
1460,
579,
13,
7,
2304,
8612,
3893,
5636,
7,
19,
595,
18,
400,
28,
306,
396,
24641,
625,
6732,
1326,
60,
800,
3726,
3726,
31,
376,
20,
16146,
40,
307,
8990,
172,
3010,
7499,
27,
21,
231,
16,
17595,
9,
20,
233,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Remove xsi:type, xmlns:xs, and xmlns:xsi from JAXB Generics
===
When using JAXB, I'd like to remove the excess namespaces/types from my XML elements when using Generics. How can I do this or what am I doing wrong? I'd like to use Generics so that I only have to write a block of code once.
Example code:
public static void main(String[] args) {
try {
TestRoot root = new TestRoot();
root.name.value = "bobby";
root.age.value = 102;
root.color.value = "blue";
JAXBContext context = JAXBContext.newInstance(root.getClass());
Marshaller marsh = context.createMarshaller();
marsh.setProperty(Marshaller.JAXB_ENCODING,"UTF-8");
marsh.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
marsh.marshal(root,pw);
System.out.println(sw.toString());
}
catch(Throwable t) {
t.printStackTrace();
}
}
@XmlRootElement
static class TestRoot {
@XmlElement public TestGeneric<String> name = new TestGeneric<String>(true);
@XmlElement public TestGeneric<Integer> age = new TestGeneric<Integer>(true);
@XmlElement public TestWhatIWouldLike color = new TestWhatIWouldLike(true);
}
@XmlAccessorType(XmlAccessType.NONE)
static class TestGeneric<T> {
@XmlAttribute public boolean isRequired;
@XmlElement public T value;
public TestGeneric() {
}
public TestGeneric(boolean isRequired) {
this.isRequired = isRequired;
}
}
@XmlAccessorType(XmlAccessType.NONE)
static class TestWhatIWouldLike {
@XmlAttribute public boolean isRequired;
@XmlElement public String value;
public TestWhatIWouldLike() {
}
public TestWhatIWouldLike(boolean isRequired) {
this.isRequired = isRequired;
}
}
Output:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<testRoot>
<name isRequired="true">
<value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">bobby</value>
</name>
<age isRequired="true">
<value xsi:type="xs:int" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">102</value>
</age>
<color isRequired="true">
<value>blue</value>
</color>
</testRoot>
| 0 | [
2,
4681,
993,
18,
49,
45,
4474,
15,
23504,
2172,
45,
396,
18,
15,
17,
23504,
2172,
45,
396,
18,
49,
37,
11712,
220,
12733,
18,
800,
3726,
3726,
76,
568,
11712,
220,
15,
31,
22,
43,
101,
20,
4681,
14,
9521,
204,
5582,
18,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I run code from a different directory with a bash script
===
I have been putting my code on github, but I've run into an implementation snag. I run the same code on many computers (including a computer that I do not have root access on).
One piece of code (a bash script) calls some python code like:
python somecode.py
The shell will run the correct version of python, but it won't find somecode.py.
What I've tried:
Fail #1: I tried to add both the directory which contains somecode.py and the full path to the file to the PATH; to no avail. [Errno 2] No such file or directory
Fail #2: I can make it work for one computer ONLY if I add the full path to the correct version of python in the top line:
#!/usr/local/cool/python/version/location
However this breaks it running on any other computer.
Fail #3: I can also make it work if I make the bash script say:
python /full/path/to/github/place/somecode.py
but again, this only works for ONE computer because the paths are different for different computers.
**What I really want to do**: I want to be able to use the same code (both bash script and somecode.py) on multiple computers.
Any suggestions about how to do this properly is welcome. Thanks! | 0 | [
2,
184,
107,
31,
485,
1797,
37,
21,
421,
16755,
29,
21,
13158,
3884,
800,
3726,
3726,
31,
57,
74,
3873,
51,
1797,
27,
13,
10404,
20926,
15,
47,
31,
22,
195,
485,
77,
40,
6123,
28755,
9,
31,
485,
14,
205,
1797,
27,
151,
7774,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 formatted rich text to iTextsharp PDF
===
I am creating a PDF document using iTextSharp and would like to add formatted rich text to the document.
The rich text includes bold/italic/underline formatting along with /tabs and /pars.
Below is a sample of what the rich text looks like:
{\rtf1\ansi\deff0\deflang1033 {\fonttbl{\f0\fmodern COURIER NEW;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss Arial;}{\f3\froman Times New Roman;}}{\colortbl\red0\green0\blue0;}\f3\fs12\cf0 {\tx3500\par\par\par \i1\ul1\b1 SITE INFORMATION\i0\ul0\b0 \par \b1 OWNER NAME:\b0\tab OWNER COMPANY LLC\par \b1 OWNER TYPE:\b0\tab P-PRIVATE\par
Ideally, I would like to add this to a PdfPCell object. I have tried formatting the data using the Windows.RichTextBox. I've also downloaded a RtfToHtmlConverter tool and converted the data to HTML, then used the iTextSharp HTMLWorker to parse and add the HTML to the cell with no luck.
Has anyone else attempted to add formatted rich text data to an iTextSharp document? I have gotten close trying several work-arounds, but it always seems to miss some formatting (tabs, pars, etc). If anyone has any suggestions that would be great. Thanks!
Rick | 0 | [
2,
4721,
13,
29850,
2042,
1854,
20,
31,
11969,
23646,
13,
11124,
800,
3726,
3726,
31,
589,
2936,
21,
13,
11124,
4492,
568,
31,
11969,
23646,
17,
83,
101,
20,
3547,
13,
29850,
2042,
1854,
20,
14,
4492,
9,
14,
2042,
1854,
1103,
5657... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: unpacking a string to a list
===
The answer to [a question on multiple-value elements in a config file][1] (which exactly fits my needs) suggests to "unpack the string from the config". I read the doc for [unpacking arguments lists][2] suggested in several places but I fail to understand how this relates to my problem.
I am sure this must be obvious: having a string `str = "123,456"`, how can I transform it into the list `[123,456]` (the number of elements separated by a comma in the string may vary)
Thank you.
[1]: http://stackoverflow.com/questions/335695/lists-in-configparser
[2]: http://docs.python.org/tutorial/controlflow.html#unpacking-argument-lists | 0 | [
2,
20059,
45,
367,
8573,
68,
21,
3724,
20,
21,
968,
800,
3726,
3726,
14,
1623,
20,
636,
58,
1301,
27,
1886,
8,
15165,
2065,
19,
21,
13,
14093,
2816,
3893,
500,
2558,
165,
500,
13,
5,
2140,
1890,
2742,
18,
51,
2274,
6,
5049,
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... |
`plus` in email to have unique versions of same email how does it work? Managing production and test environment
===
I am having a web application with a production with hundreds of real users..
I needed to have one test environment with the state of production, as the application is data-driven, states of application change from data, things can-not be tested, if no real user data exists...
But as it has real emails its risk in testing, as testing emails cana go to real users..
So I needed a mechanism to change the emails to something not real, but as email field is unique, how do I change all of them with one query..
My colleague suggested that **a email with +any_number ex. `rajat@gmail.com` and `rajat+27@gmail.com` will send the emails to same email..**
So I wrote a some query
update users set email = CONCAT(CONCAT('rajat+',id),'@gmail.com')
and it solved the problem..Now I can operate in testing enviornment with production data..
**My Questions:**
1) How does it work??
2) Is it a right approach?? How do people manage test and production environments??
| 0 | [
2,
13,
1,
13349,
1,
19,
8517,
20,
57,
2619,
3281,
16,
205,
8517,
184,
630,
32,
170,
60,
5616,
637,
17,
1289,
2307,
800,
3726,
3726,
31,
589,
452,
21,
2741,
3010,
29,
21,
637,
29,
4541,
16,
683,
3878,
9,
9,
31,
851,
20,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
String manipulation Ruby patterns
===
If I have a string: string = <.one><.two>three<.four>[:five] , how can I manipulate this string to remove everything inside the pattern "<..>". I would like my output to return; string = three[:five]
Thanks | 0 | [
2,
3724,
17561,
10811,
6282,
800,
3726,
3726,
100,
31,
57,
21,
3724,
45,
3724,
800,
13,
1,
9,
849,
1,
9,
3734,
1,
5642,
1,
9,
4882,
1,
2558,
45,
4709,
500,
13,
15,
184,
92,
31,
18468,
48,
3724,
20,
4681,
796,
572,
14,
3732,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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, jquery mobile: param lost in ajax call (remote => true)
===
In a rails3 application with jquery mobile I am having a problem when using a link_to with :remote => true because the parameters passed in the link are ignored. I have been looking around in the several posts discussing problems between remote => true and jquery mobile but they don't seem to be exactly the same problem.
Here the code:
<%= link_to _('mobile|contacts|Show next'), mobile_contacts_path(:page => @my_relations.next.number),
:data => { :role => 'button', :remote => true}, :class => compact' %>
When clicking the link in the phone the call is actually working fine and the view is rendered, only thing is that the :page parameter is not passed (so the "page" one is rendered again and again).
Started GET "/de_de/mobile/contacts" for 10.0.173.62 at Tue Jul 10 09:13:00 +0200 2012
2012.07.10 09:13:00 - INFO - #14570: Processing by Mobile::ContactsController#index as JS
2012.07.10 09:13:00 - INFO - #14570: Parameters: {"locale"=>"de_de"}
On the other hand the link is working fine when trying it in the desktop computer browser:
Started GET "/de_de/mobile/contacts?page=3" for 127.0.0.1 at Tue Jul 10 09:12:03 +0200 2012
2012.07.10 09:12:03 - INFO - #14570: Processing by Mobile::ContactsController#index as JS
2012.07.10 09:12:03 - INFO - #14570: Parameters: {"page"=>"3", "locale"=>"de_de"}
The parameter is also passed when removing :remote => true from the link_to.
Any ideas? Thanks! | 0 | [
2,
2240,
18,
203,
15,
487,
8190,
93,
3241,
45,
2258,
79,
529,
19,
20624,
645,
13,
5,
99,
20209,
800,
1,
1151,
6,
800,
3726,
3726,
19,
21,
2240,
18,
240,
3010,
29,
487,
8190,
93,
3241,
31,
589,
452,
21,
1448,
76,
568,
21,
350... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Telerik for WinForms gridview slow rendering
===
we are testing Telerik radcontrols for a desktop application development. Until now we are very satisfied with the product but there is one issue that is driving us nuts.
We have a gridview with 3 levels of hierarchy and 3 child gridviews on the 1st level. Something like this:
![enter image description here][1]
The main grid has 28 visible columns, with lot of customization and validating rules inside. There are 6 columns with a button inside to trigger different actions. There are 4 columns with images on them and several others just different colors with different meanings for the users. Child gridviews each one has around 5 visible columns, also with customization, buttons, images, etc.
Initially we detected that loading of the data was way to slow. So now we load first level at first and the lower hierarchy data is loaded on demand, when the user wants to see what's inside each row. By doing this the loading speed of the grid improved.
Now the bottleneck is on the gridview rendering. I have asked already on Telerik forums but the answers given does not help too much. I found some users asking about the same but none with a 100% satisfactory answer. As for example: [Self referencing grid][2]
So my question is: does anyone has faced similar problem? How it was solved, if there is a solution? Nevermind how complicated it is, we need to drop the loading times, right now around 10-15 seconds on each grid click, wich is unbearable.
[1]: http://i.stack.imgur.com/TOH5y.png
[2]: http://www.telerik.com/community/forums/winforms/gridview/self-referencing-grid.aspx | 0 | [
2,
4338,
6639,
26,
628,
4190,
18,
7354,
4725,
2276,
15307,
800,
3726,
3726,
95,
50,
4431,
4338,
6639,
4944,
12898,
18,
26,
21,
17404,
3010,
522,
9,
163,
130,
95,
50,
253,
8315,
29,
14,
2374,
47,
80,
25,
53,
1513,
30,
25,
2891,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 method is submitting the task to the Executor framework in the code below?
===
Please refer to the following code of [from the Javadoc of Future][1] class:
FutureTask<String> future =
new FutureTask<String>(new Callable<String>() {
public String call() {
return searcher.search(target);
}});
executor.execute(future);
P.S: I am not doing any exclusive `executor.submit(future)` call here .
So I am trying to execute the future task here by calling `executor.execute()` method. But how is the task getting submitted to the executor framework in the first place? Which line of code above is actually submitting the task to the executor ?
[1]:http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/concurrent/Future.java#Future | 0 | [
2,
98,
2109,
25,
28848,
14,
3005,
20,
14,
1396,
17194,
2153,
6596,
19,
14,
1797,
1021,
60,
800,
3726,
3726,
2247,
5017,
20,
14,
249,
1797,
16,
636,
2665,
14,
8247,
13799,
16,
1022,
500,
2558,
165,
500,
718,
45,
1022,
38,
20310,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Database reterival in android
===
In my application i have to retrieve data from database.My requirement is i have to retrieve data by satisfying the condition that i have to sum the total column where group column should be household.I written the query.
My query is as follows:
public String addhousehold()
{
long sum=0;
Cursor cursor1 = db.rawQuery(
"SELECT SUM("+(KEY_TOTAL)+") FROM incomexpense WHERE groups=Income",null);
if(cursor1.moveToFirst())
{
sum = cursor1.getLong(0);
}
cursor1.close();
String housetotal=String.valueOf((long)sum);
System.out.println("house="+housetotal);
return housetotal;
}
But showing error:
: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.budget1/com.budget1.Report}: android.database.sqlite.SQLiteException: no such column: Income: , while compiling: SELECT SUM(total) FROM incomexpense WHERE groups=Income.
As i am new to this please help me.Thanks in advance | 0 | [
2,
6018,
302,
591,
25109,
19,
13005,
800,
3726,
3726,
19,
51,
3010,
31,
57,
20,
11917,
1054,
37,
6018,
9,
915,
8981,
25,
31,
57,
20,
11917,
1054,
34,
19617,
14,
2874,
30,
31,
57,
20,
3907,
14,
600,
4698,
113,
214,
4698,
378,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Recursive SUM Sql Server
===
i need to do a recursive sum in SQL Server. I want a stored procedure where i can pass in a parent Id, then return a total for all the children(and children's children) linked to that parent id.
Here is what i have so far
IF object_id('tempdb..#Averages') IS NOT NULL
BEGIN
DROP TABLE #Averages
END
CREATE TABLE #Averages
(
ID INT PRIMARY KEY CLUSTERED IDENTITY(1,1),
Name VARCHAR(255),
ParentID int,
Value INT
)
INSERT INTO #Averages(Name,ParentID,Value)VALUES('Fred',NULL,1)
INSERT INTO #Averages(Name,ParentID,Value)VALUES('Bets',NULL,1)
INSERT INTO #Averages(Name,ParentID,Value)(SELECT 'Wynand',ID,21 FROM #Averages WHERE Name = 'Fred' )
INSERT INTO #Averages(Name,ParentID,Value)(SELECT 'Dewald',ID,27 FROM #Averages WHERE Name = 'Fred' )
INSERT INTO #Averages(Name,ParentID,Value)(SELECT 'Katelynn',ID,1 FROM #Averages WHERE Name = 'Dewald' )
INSERT INTO #Averages(Name,ParentID,Value)(SELECT 'Jacques',ID,28 FROM #Averages WHERE Name = 'Bets' )
INSERT INTO #Averages(Name,ParentID,Value)(SELECT 'Luan',ID,4 FROM #Averages WHERE Name = 'Jacques' )
INSERT INTO #Averages(Name,ParentID,Value)(SELECT 'Ruben',ID,2 FROM #Averages WHERE Name = 'Jacques' )
;WITH Personal AS
(
SELECT N=1, ID,Name,ParentID,Value
FROM #Averages
WHERE ParentID IS NULL
UNION ALL
SELECT N+1, Av.ID,Av.Name,Av.ParentID,Av.Value
FROM #Averages Av
INNER JOIN Personal P ON P.ID = Av.ParentID
)
SELECT Name,
SUM(Value) as Total
FROM Personal
WHERE N<=3
GROUP BY Name | 0 | [
2,
302,
24244,
3907,
4444,
255,
8128,
800,
3726,
3726,
31,
376,
20,
107,
21,
302,
24244,
3907,
19,
4444,
255,
8128,
9,
31,
259,
21,
8214,
7004,
113,
31,
92,
1477,
19,
21,
4766,
4924,
15,
94,
788,
21,
600,
26,
65,
14,
391,
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... |
particles in particle systems behaves weird
===
i have a node (named 'terrain') that i offset so that my main game object (my character) stays in the center of the screen. i do this like this:
[_terrain setOffsetX:offsetX andOffsetY:offsetY*4/3];
the thing is that on my terrain, i have a particle system. When moving my character (and thus offsetting the terrain) the particles emitted are not mentaining their up-word trajectory. It looks like the particles emitted are dephased. Here is my particle system code that i include in my terrain class (i.e. self refers to the terrain itself) :
emitterSnow = [CCParticleSnow node];
emitterSnow.position = startPoint;
[emitterSnow setAnchorPoint:CGPointZero];
[self addChild:emitterSnow z:0 tag:windIndicatorTag];
CGPoint p = emitterSnow.position;
emitterSnow.position = ccp( p.x + width/2 , p.y);
emitterSnow.life = 1;
emitterSnow.lifeVar = .3f;
[emitterSnow setIsRelativeAnchorPoint:YES];
emitterSnow.posVar = CGPointMake(width/2,0);
// gravity
emitterSnow.gravity = ccp(0,1000);
// speed of particles
emitterSnow.speed = 140;
emitterSnow.speedVar = 20;
ccColor4F startColor = emitterSnow.startColor;
startColor.r = 0.9f;
startColor.g = 0.9f;
startColor.b = 0.9f;
emitterSnow.startColor = startColor;
ccColor4F startColorVar = emitterSnow.startColorVar;
startColorVar.b = 0.1f;
emitterSnow.startColorVar = startColorVar;
emitterSnow.emissionRate = 30;
emitterSnow.texture = [[CCTextureCache sharedTextureCache] addImage: @"bubble2.png"];
How can i have my particles move up from my particle system source?
| 0 | [
2,
9497,
19,
11534,
1242,
14149,
18,
5455,
800,
3726,
3726,
31,
57,
21,
15421,
13,
5,
11482,
13,
22,
815,
8664,
22,
6,
30,
31,
17493,
86,
30,
51,
407,
250,
3095,
13,
5,
915,
925,
6,
16192,
19,
14,
459,
16,
14,
2324,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to create a Dot Net Nuke partial view for an MVC site?
===
I am looking at the posibility of integrating a third party component into our MVC-based site. The reason is that we want document handling and search features without taking the full job of implementing it from scratch.
I'm unsure about the way to proceed and I am wondering if any of you have any experience with Dot Net Nuke. Is it possible to run an instance of Dot Net Nuke in the cloud and create a partial view providing a document module(cms-like) and a search module?
Is there any other third party systems that are cloud compatible and provide an API for handling documents, security and full text search? | 0 | [
2,
25,
32,
938,
20,
1600,
21,
14123,
4275,
3152,
1048,
7284,
1418,
26,
40,
307,
8990,
689,
60,
800,
3726,
3726,
31,
589,
699,
35,
14,
12928,
14264,
16,
24529,
21,
422,
346,
5912,
77,
318,
307,
8990,
8,
1281,
689,
9,
14,
1215,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
IE9 SCRIPT87: Invalid argument on XDomainRequest
===
I'm testing my app on Internet Explorer 9, the app works fine on Chrome, Firefox, Opera and Safari, but in IE....
Well, in this code:
this.xhr.open("PUT",url,true);
The IE says 'SCRIPT87: Invalid argument.' i attach an image:
![enter image description here][1]
The xhr element is a XDomainRequest() object, the url attribute is a correct url. Anybody knows what are IE9 talking about?
[1]: http://i.stack.imgur.com/3ZK4l.png | 0 | [
2,
13,
660,
518,
3884,
3730,
45,
16671,
5476,
27,
993,
537,
6232,
99,
10351,
800,
3726,
3726,
31,
22,
79,
4431,
51,
4865,
27,
2620,
8520,
561,
15,
14,
4865,
693,
1123,
27,
13,
12985,
15,
535,
18219,
15,
1877,
17,
25055,
15,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.html file > HTMLAgilityPack > TreeView Hierarchy
===
Using HTMLAgilityPack + TreeView to create a hierarchy GUI of an HTML file. The HTML file is CMS-generated, and not very well generated at that.
Needs to do the following:
1. Read each *Outline Level 0* node into the TreeView.
HtmlNodeCollection ZeroLevelNodes = doc.DocumentNode.SelectNodes("//body/object[@type='text/sitemap']|//body/ul/object[@type='text/sitemap']|//body/ul/li/object[@type='text/sitemap']");
2. Read the Outline Level 1 nodes as children of their respective Outline Level 0 nodes
**Note:** Each Outline Level 0 node (minus a few that aren't important for this question) are layed out as `<li><object><param /></object>` (notice the lack of a closing `</li>` tag). The nodes that need to appear as children in the TreeView will be in an unordered list `<ul>` that is the next sibling of a level 0 node's `<li>` tag, for example:
<ul>
<li>
<object>
<param name="**exampleLevel0**" value="**example.htm**" /> //value example.htm as the text in the level 0 node.
</object>
<ul>
<li>
<object>
<param name="**ExampleLevel1**" value="childnode.htm" /> //childnode.htm as the text in the level 1 child node.
</object>
<li>
<object>
<param name="**ExampleLevel1_2**" value="childnode2.htm" /> //childnode2.htm as the text in the level 1 child node.
</object>
</ul>
</ul>
Here is my current code to generate the top-level of hierarchy
HtmlNodeCollection tocNodes = doc.DocumentNode.SelectNodes("//body/object[@type='text/sitemap']|//body/ul/object[@type='text/sitemap']|//body/ul/li/object[@type='text/sitemap']");
foreach (HtmlNode zeroLevelNode in zeroLevelNodes)
{
TreeNode tNode = new TreeNode();
HtmlNode paramNode = zeroLevelNode.SelectSingleNode("param[@name]");
string paramName = paramNode.GetAttributeValue("name", null);
string paramValue = paramNode.GetAttributeValue("value", null);
TreeView.Nodes.Add(new TreeNode(paramValue));
tNode = TreeView.Nodes[i];
AddNode(zeroLevelNode, tNode);
i += 1;
}
Could anyone give me a hand with the code needed to load the "children" (outline level 1) nodes into the TreeView? (AddNode(zeroLevelNode, tNode) | 0 | [
2,
13,
9,
15895,
3893,
13,
1,
13,
15895,
3302,
20901,
8573,
13,
1,
1541,
4725,
14417,
800,
3726,
3726,
568,
13,
15895,
3302,
20901,
8573,
2754,
1541,
4725,
20,
1600,
21,
14417,
9457,
16,
40,
13,
15895,
3893,
9,
14,
13,
15895,
3893... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF REST service to GZIP compress responses and accept requests on IIS
===
.NET 4.0 and IIS 7.5
I'm totally lost on this one. Compression enabled both static and dynamic on IIS. Config looks like this:
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme doDynamicCompression="true" name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll"/>
<dynamicTypes>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/json" enabled="true"/>
<add mimeType="application/json; charset=utf-8" enabled="true"/>
<add mimeType="*/*" enabled="true"/>
</dynamicTypes>
<staticTypes>
<add mimeType="image/png" enabled="true"/>
<add mimeType="text/*" enabled="true"/>
<add mimeType="message/*" enabled="true"/>
<add mimeType="application/javascript" enabled="true"/>
<add mimeType="application/json" enabled="true"/>
<add mimeType="*/*" enabled="true"/>
</staticTypes>
</httpCompression>
<urlCompression doStaticCompression="true" doDynamicCompression="true"/>
</system.webServer>
Yet when I'm monitoring traffic in Figgler server won't compress my requests. How do I enable it with my services? | 0 | [
2,
11801,
410,
760,
365,
20,
489,
2553,
306,
26060,
13231,
17,
3440,
12279,
27,
595,
18,
800,
3726,
3726,
13,
9,
2328,
268,
9,
387,
17,
595,
18,
453,
9,
264,
31,
22,
79,
5139,
529,
27,
48,
53,
9,
14864,
9338,
156,
12038,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to increase memory size to the heap of java
===
I want to increase heap java to avoid this error message
I have windows 7 64bit with java version
C:\Users\Rasha>java -version
java version "1.5.0_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_15-b04)
Java HotSpot(TM) Client VM (build 1.5.0_15-b04, mixed mode)
java -Xms1024m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m
Error occurred during initialization of VM
Could not reserve enough space for object
Could not create the Java virtual machine.
Although I have already 6 Gigabyte memory, how to made the system to recognize them?
any suggestions for this problem?
| 0 | [
2,
184,
20,
1839,
1912,
1072,
20,
14,
15414,
16,
8247,
800,
3726,
3726,
31,
259,
20,
1839,
15414,
8247,
20,
2658,
48,
7019,
2802,
31,
57,
1936,
453,
4384,
3326,
29,
8247,
615,
272,
45,
1,
16704,
18,
1,
15469,
58,
1,
1004,
1385,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
STDIN.gets produces nil when file is attained with curl and piped to ruby
===
So if I download and run the following code using curl, gets produces nil and doesn't prompt anything.
str=gets
unless str.nil?
puts str
else
puts "gets produced nil"
end
Command being used (you can try it yourself)
`curl https://raw.github.com/gist/3077534/06ea1c27f7bed38408d2662671f29ea758e2e54b/gets_test.rb | ruby`
Is there a better/more common practice of doing this? | 0 | [
2,
354,
3653,
9,
3060,
18,
6700,
1781,
255,
76,
3893,
25,
14354,
29,
14320,
17,
7642,
43,
20,
10811,
800,
3726,
3726,
86,
100,
31,
7121,
17,
485,
14,
249,
1797,
568,
14320,
15,
3049,
6700,
1781,
255,
17,
1437,
22,
38,
11443,
441... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Refreshing display of a text panel in a GUI, java
===
I'm having more "I'm hopeless at programming" problems.
I have a piece of code which uses StringBuilder to display elements of an array in a text panel of a GUI when the program starts. Here's the StringBuilder code:
// memory tab
StringBuilder mList = new StringBuilder();
memLocList = new Memory[MEM_LOCATIONS];
mem = new Memory();
for (int i = 0; i < memLocList.length; i++) {
memLocList[i] = mem;
memLocList[i].setOpCode(00);
mList.append(String.format("%10s %04x %10s %6s", "Address: ", i,
"Value: ", memLocList[i].getOpCode()));
mList.append("\n");
}
JComponent memTab = makeTextPanel(mList.toString());
tabs.addTab("Memory", new JScrollPane(memTab));
}
protected JComponent makeTextPanel(String t) {
text = t;
JPanel panel = new JPanel(false);
JTextPane filler = new JTextPane();
filler.setFont(new Font("Courier", Font.PLAIN, 14));
filler.setText(text);
filler.setAlignmentX(LEFT_ALIGNMENT);
panel.setLayout(new GridLayout(1, 1));
panel.add(filler);
return panel;
}
The GUI also has a text entry panel where a String of hex values can be entered.
On clicking a button, the user is prompted for another value, which corresponds to the position in the array where the first hex value should be inserted.
Once these values have been entered, I'd like the display to be updated / refreshed to reflect this but am unsure of how to go about it.
I found this question here, which is similar but I'm not sure if implementing Observer/Observable pattern is the right way to proceed, and even if it is, how I'd go about it:
http://stackoverflow.com/questions/539076/best-way-to-constantly-update-gui-elements
My initial approach was to add an "updateDisplay()" method, which I could call after processing the button click and re-call the makeTextPanel method:
public void updateDisplay() {
makeTextPanel(text);
}
I thought this might refresh it but it has no effect of the display.
Any help appreciated.
| 0 | [
2,
27134,
3042,
16,
21,
1854,
4113,
19,
21,
9457,
15,
8247,
800,
3726,
3726,
31,
22,
79,
452,
91,
13,
7,
49,
22,
79,
18846,
35,
3143,
7,
1716,
9,
31,
57,
21,
1855,
16,
1797,
56,
2027,
3724,
20904,
20,
3042,
2065,
16,
40,
771... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GenericApplicationContext vs. ClassPathXmlApplicationContext Spring Beans instantiation
===
I have the following **admin.xml** file that defines a set of Spring beans I want to load at startup in a web app:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
<bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
<property name="customEditors">
<map>
<entry key="java.net.SocketAddress">
<bean class="org.apache.mina.integration.beans.InetSocketAddressEditor" />
</entry>
</map>
</property>
</bean>
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>classpath:admin.properties</value>
</property>
</bean>
<bean id="sourcePool" class="org.apache.mina.core.service.SimpleIoProcessorPool" destroy-method="dispose">
<constructor-arg value="org.apache.mina.transport.socket.nio.NioProcessor" />
<constructor-arg value="1" />
</bean>
<bean id="textCodecFactory" class="org.apache.mina.filter.codec.textline.TextLineCodecFactory" />
<bean id="textCodecFilter" class="org.apache.mina.filter.codec.ProtocolCodecFilter">
<constructor-arg ref="textCodecFactory" />
</bean>
<bean id="adminManager" class="com.schonfeld.mps.admin.AdminManager" destroy-method="cleanup"/>
<bean id="adminFilterChainBuilder" class="org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder" destroy-method="clear">
<property name="filters">
<map>
<entry key="textCodecFilter" value-ref="textCodecFilter" />
<entry key="adminManager" value-ref="adminManager" />
</map>
</property>
</bean>
<bean id="adminHandler" class="com.schonfeld.calypso.core.admin.AdminHandler" />
<bean id="adminAcceptor" class="org.apache.mina.transport.socket.nio.NioSocketAcceptor" init-method="bind" destroy-method="unbind">
<constructor-arg ref="sourcePool" />
<property name="defaultLocalAddress" value="${admin.host}:${admin.port}" />
<property name="handler" ref="adminHandler" />
<property name="reuseAddress" value="true" />
<property name="filterChainBuilder" ref="adminFilterChainBuilder" />
<property name="sessionConfig.readBufferSize" value="1024" />
<property name="sessionConfig.maxReadBufferSize" value="1024" />
<property name="sessionConfig.minReadBufferSize" value="1024" />
<property name="sessionConfig.bothIdleTime" value="120" />
</bean>
</beans>
Note that all the beans defined in that configuration file are singletons.
When I use the following code snippet, all the beans get instantiated. However, sometimes the "adminAcceptor" bean does not get instantiated.
GenericApplicationContext adminCtx = new GenericApplicationContext(ctx);
XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(adminCtx);
Resource adminDef = new ClassPathResource("admin.xml");
xmlReader.loadBeanDefinitions(adminDef);
With the following code, all the beans get instantiated all the time, without any problem.
ClassPathXmlApplicationContext adminCtx = new ClassPathXmlApplicationContext(new String[] {"admin.xml"}, ctx);
Any idea what the difference might be under the hood i.e. what additional things are done in a ClassPathXmlApplicationContext during beans instantiation that a GenericApplicationContext may not do ? | 0 | [
2,
12733,
2552,
20669,
1126,
11969,
4611,
9,
718,
8353,
396,
79,
11873,
20669,
1126,
11969,
1573,
14685,
6322,
49,
857,
800,
3726,
3726,
31,
57,
14,
249,
13,
1409,
1283,
2160,
9,
396,
8184,
1409,
3893,
30,
13110,
21,
309,
16,
1573,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 PHPUnit Mock Object to Replace one Created in Class?
===
I've been trying to get the PHPUnit mock objects working for some legacy code I'm working on, but I'm having issues getting it to sub in for the object I'm after and I'm pretty sure it must be because I'm using it wrong.
Currently we have a class which is used purely for creating queries, when another class wants to make a query it creates an object of this class and passes it the sql and database details. What I want to do is have PHPUnit replace this object with a mock version which I can test.
What I've been finding though is, if I create the mock object in the test script, the method being tested just bypasses it. I'm guessing this is because the method is creating and then using the object locally rather than it being passed as a parameter (in which case I could just reference the method with the mock object passed as a parameter). Below is an example of what the code might look like:
class SampleClass{
function loadData(){
$sql = "SELECT * FROM users";
$query = new Query();
$query->query($sql);
while($row = $query->get_row()){
$result[] = $query->get_row();
}
$this->users = $result;
}
}
class Query{
function query($sql){
$this->result = mysql_query($sql);
}
function get_row(){
return mysql_fetch_assoc($this->result);
}
}
Is there a way to create a mock object in the PHPUnit test file which will replace the $query object in SampleClass with a mock object which I can use to test the parameters being passed to and control the response of? I won't be able to replace the query class or change how it's referenced, as it's used extensively throughout our application, but I would like to at least be able to create some form of test framework for it. Would appreciate any help you can give | 0 | [
2,
25,
32,
938,
20,
13,
26120,
15464,
10506,
3095,
20,
3934,
53,
679,
19,
718,
60,
800,
3726,
3726,
31,
22,
195,
74,
749,
20,
164,
14,
13,
26120,
15464,
10506,
3916,
638,
26,
109,
7780,
1797,
31,
22,
79,
638,
27,
15,
47,
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... |
jquery: slide left button and slide right button
===
I have 10 pages of contents with the pagination object on each page done using php. This allows the user to view contents of any page he/she wishes to see by clicking the page number.
Now I want to add a left and right button that will allow the user to click to the left or to the right to view the next or previous page.
How can I do that using jquery? I am familiar with slide up, slide down and slide toogle. However, i have no idea on how to do slide left and slide right. | 0 | [
2,
487,
8190,
93,
45,
6464,
225,
5167,
17,
6464,
193,
5167,
800,
3726,
3726,
31,
57,
332,
4434,
16,
8478,
29,
14,
19006,
108,
857,
3095,
27,
206,
2478,
677,
568,
13,
26120,
9,
48,
2965,
14,
4155,
20,
1418,
8478,
16,
186,
2478,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Git windows server with Github
===
I'm fairly new to Git and was hoping someone can help me. We are working with an external provider and there code is on github which has a couple of branches (say branch1 and branch2). We plan on having a local Windows git server just using a bare repo and devs will be able to access this by just file share for now where they will clone, push, pull. Reason behind a local server is due to size.
What would be the best way to go about implementing, using this ? For example:
1. create a bare repo on our server - git init --bare
2. Add a remote to github name github
3. Fetch remote repo(from github)
4. User clones our local repo...
5. push/pull to our local...
6. how would you now merge our code into a branch on github?
Thanks | 0 | [
2,
13,
10404,
1936,
8128,
29,
13,
10404,
20926,
800,
3726,
3726,
31,
22,
79,
6647,
78,
20,
13,
10404,
17,
23,
3935,
737,
92,
448,
55,
9,
95,
50,
638,
29,
40,
4886,
11747,
17,
80,
1797,
25,
27,
13,
10404,
20926,
56,
63,
21,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Socket.io application in practice
===
Are there any socket.io projects/applications used in production?
I just wonder because I want to use it for a huge project, and I did not find any articles about companies/projects using socket.io. | 0 | [
2,
18482,
9,
1963,
3010,
19,
1345,
800,
3726,
3726,
50,
80,
186,
18482,
9,
1963,
2314,
118,
2552,
20669,
18,
147,
19,
637,
60,
31,
114,
2666,
185,
31,
259,
20,
275,
32,
26,
21,
2329,
669,
15,
17,
31,
144,
52,
477,
186,
3376,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
AndroidHttpClient.execute(httpPost, localContext); cookieStore.getCookies() is null
===
AndroidHttpClient httpClient=AndroidHttpClient.newInstance("myagent)");
HttpContext localContext = new BasicHttpContext();
CookieStore cookieStore = new BasicCookieStore();
cookieStore.addCookie(new BasicClientCookie("xxx", "sss"));
localContext.setAttribute(ClientContext.COOKIE_STORE, cookieStore);
response =httpClient.execute(httpPost2, localContext);
List<Cookie> cookies = cookieStore.getCookies();
I am in the server set up a new cookie, why won't find it here? | 0 | [
2,
13005,
21127,
150,
18513,
38,
9,
1706,
17194,
591,
5,
21127,
6962,
15,
375,
1126,
11969,
6,
73,
19980,
16828,
9,
3060,
20840,
1596,
5,
6,
25,
16203,
800,
3726,
3726,
13005,
21127,
150,
18513,
38,
7775,
150,
18513,
38,
3726,
290,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Strategies for handling IsSelected and IsExpanded on objects in a TreeView
===
Imagine a set of contacts and contact groups which are to be displayed in lists and trees. Initially, I just added IsSelected and IsExpanded properties to the common base class and this works well as far as the TreeView goes.
The problem I have is that the objects can appear in different places in the tree (imagine people allocated to more than one group). The result is that when I select an individual person that person is selected everywhere - in every group. This looks a bit unusual but works ok. It gets tricky when the person appears in a separate list and is selected. As the object is the same, the selection appears everywhere in all lists.
How do you manage selection? Is is better to put the objects in temporary selection containers? Is there a good strategy for this?
Thanks | 0 | [
2,
10272,
26,
7988,
25,
18,
7138,
17,
25,
6899,
290,
69,
27,
3916,
19,
21,
1541,
4725,
800,
3726,
3726,
4382,
21,
309,
16,
11894,
17,
2203,
1170,
56,
50,
20,
44,
6115,
19,
7227,
17,
1913,
9,
1537,
15,
31,
114,
905,
25,
18,
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... |
Checking same condition in different tables in a query
===
I want to add up inventory movements made before a date grouped by product. I have to check the date from different tables depending on the document type.
Basically I have 3 type of movements: invoices, nulled invoices and other types of documents. The information of those documents are in 3 tables:
INVOICES(DOC, DATE, ...)
NULLED_INV(DOC, DATE, ...)
OTHERS(DOC, DATE, ...)
Then I have all the movements in another table:
MOVEMENTS(PRODUCT_ID, DOC, DOC_TYPE, QUANTITY...)
So I need to check the dates in the corresponding table depending on DOC_TYPE in order to add up the QUANTITY of a movement. For instance if DOC_TYPE=1 then check the date of the DOC in INVOICES, if DOC_TYPE=2 then check the date in NULLED_INV and if DOC_TYPE=3 then check the date in OTHERS, and add up all the movements grouped by product:
PRODUCT_ID TOTAL_MOVEMENTS_BEFORE_XXXX
1001 10
1002 25
...
Any idea in how to make such query?
I tried using an IF in the WHERE clause but it didn't work. | 0 | [
2,
9886,
205,
2874,
19,
421,
7484,
19,
21,
25597,
800,
3726,
3726,
31,
259,
20,
3547,
71,
13875,
4889,
117,
115,
21,
1231,
19511,
34,
2374,
9,
31,
57,
20,
2631,
14,
1231,
37,
421,
7484,
4758,
27,
14,
4492,
1001,
9,
11374,
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... |
Return url in PayPal without parameters
===
I have connected PayPal with my eshop and I want to redirect after successfull payment back to my eshop to specific page without payment variables.
In manual is written to use parameter
rm=1
My schema looks like this:
$this->form = array('cmd' => '_xclick',
'business' => 'bis@email.tld',
'cert_id' => 'ABCDEFGDe',
'lc' => 'EN',
'custom' => 'test',
'invoice' => $orderId,
'currency_code' => 'EUR',
'no_shipping' => '1',
'no_note'=>'1',
'item_name' => 'bought item',
'item_number' => '1',
'rm'=>'1',
'amount' => $price,
'return'=> $returnURL,
'notify_url'=>$notifyURL,
);
But even though rm is set to 1 and return is set, PayPal stil redirects back to my page with all parameters with GET method (like rm=0)
Is there way to set rm=1 properly? I also tried without quotes
| 0 | [
2,
788,
287,
6362,
19,
1372,
6720,
366,
12905,
800,
3726,
3726,
31,
57,
2587,
1372,
6720,
29,
51,
13,
160,
5347,
17,
31,
259,
20,
302,
14706,
75,
1300,
255,
7582,
97,
20,
51,
13,
160,
5347,
20,
1903,
2478,
366,
7582,
12157,
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... |
convert system._comobject to .net string
===
I'm having some trouble trying to get the values of a class's property. The implementation structure is as follows:
1. A COM object written in C# has a COM visible wrapper class that makes use of two classes with ComVisible(false) attribute.
2. COM object is called from classic ASP page to perform some work.
The non-COM visible classes have some properties of .NET types (mostly string types). The problem is that when accessing these properties in various methods in the classes the properties return System._ComObject as their value rather than their actual content. I have tried using ToString(), explicitly casting them to their .NET types, and also using InvokeMember() after getting the type of the property. But nothing seems to give the actual content value of the properties expect when InvokeMember is used which gives the actual content for some properties. All I'm getting is System._ComObject.
So my question is how do I get the actual value of these properties instead of just getting System._ComObject?
Thanks, | 0 | [
2,
8406,
329,
9,
1,
960,
23793,
20,
13,
9,
2328,
3724,
800,
3726,
3726,
31,
22,
79,
452,
109,
2572,
749,
20,
164,
14,
4070,
16,
21,
718,
22,
18,
1354,
9,
14,
6123,
1411,
25,
28,
2415,
45,
137,
9,
21,
13,
960,
3095,
642,
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... |
Render different partials with ajax - rails 3
===
I am trying to get a link_to to display different partial via jquery ajax, for every nav tab link.
But can't seem to get it to work, it redirect every link to the root index.
I would like to click the links in my nav menu and display the partials: `_grundskola.html.erb` , `_gymnasium.html.erb`, `_universitet.html.erb` for that link in the profile-data div.
**Example:**
I understand that for example nav link "universitet" should call the action def universitet wich calls `universitet.js.erb` wich renders the partial `_universitet.html.erb` in the div.
**The nav-menu - in the show.html.erb**
<ul class="nav nav-tabs">
<li><%= link_to "Grundskola", :action => 'grundskola', :remote => true %></li>
<li class="active"><%= link_to "Gymnasium", :action => 'gymnasium', :remote => true %></li>
<li><%= link_to "Universitet & Högskola", :action => 'universitet', :remote => true %></li>
</ul>
**user_controller.rb**
def universitet
respond_to do |format|
format.js
end
end
**universitet.js.rb**
$("profile-data").html("<%= escape_javascript(render(:partial => 'universitet')) %>");
**_universitet.html.erb**
<% groups = @user.friends.group_by(&:college_name) %>
<% sorted_groups = groups.sort_by{|key, values| values.count}.reverse %>
<% sorted_groups.each do |collegename, friends| %>
<% next if collegename.blank? %>
<div class="contentbox">
<div class="box-header">
<h3><%= collegename %></h3>
<div class="meta-info">
<p><i class="icon-map-marker"></i> Malmö</p>
<p><i class="icon-user"></i><span class="count"> <%= friends.count %></span> vänner</p>
</div>
</div>
<ul class="friends-list">
<% friends.map do |friend| %>
<li><%= image_tag(friend.image) %>
<% end %>
</ul>
</div>
<% end %>
I get the wrong link structure to, the html output:
<li><a href="/auth/failure?action=universitet&controller=users&remote=true">Universitet & Högskola</a></li>
Any help would be appreciated. | 0 | [
2,
16535,
421,
7284,
18,
29,
20624,
13,
8,
2240,
18,
203,
800,
3726,
3726,
31,
589,
749,
20,
164,
21,
3508,
1,
262,
20,
3042,
421,
7284,
1197,
487,
8190,
93,
20624,
15,
26,
352,
16048,
6523,
3508,
9,
47,
92,
22,
38,
2260,
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... |
Animation in viewWillAppear interferes with launch rotation
===
I have a simple animation in viewWillAppear that vertically positions some elements in my view - it makes some elements slide down into place. It all works well, except when the application is launched in landscape orientation. Then my animations start before the view has been rotated, so the animated elements are starting from their portrait position instead of their landscape position. So, instead of the animation showing the vertical sliding, it is also animating the horizontal scaling. Meanwhile, the other elements on screen have already be repositioned from the rotation, so it looks strange.
I would like to start the viewWillAppear animations only after the initial rotation from portrait to landscape has been completed, but haven't been able to figure out where to trigger this. Is there a way to recognize a rotation due to app launch?
Thanks! | 0 | [
2,
6236,
19,
1418,
5580,
22306,
512,
12668,
18,
29,
3394,
9431,
800,
3726,
3726,
31,
57,
21,
1935,
6236,
19,
1418,
5580,
22306,
512,
30,
23300,
3062,
109,
2065,
19,
51,
1418,
13,
8,
32,
1364,
109,
2065,
6464,
125,
77,
209,
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... |
android activities being launched repeatedly unexpectedly
===
In my app I have a simple button that launches a second activity, starts a spinner (If that's relevant) and does some http connection work. This second activity can also be launched by a service that runs and listens to a bluetooth connection.
The problem is not happening on my milestone (2.1-update1) phone but on a colleagues phone who is running 2.3 I believe. When they press the button to launch the second activity (Ignoring the service portion completely) it will launch the activity multiple times, when they press back on that second screen they land on another instance of that second screen instead of being back on the first activity.
I mention the service part of this for two reason, the first being that this problem started happening when I implemented the service, and the second being because I had a separate problem where the clients weren't being managed correctly on the service side so that when the second activity was being launched through the service instead of the button I would see exactly this behavior. Since the message was being sent to all clients (There should only be one) I was seeing the service spawn multiple launches of this second activity. But again by pressing the button this service problem which has been fixed shouldn't be responsible.
Now, I have put two things in place to prevent this from happening anymore. I have flagged the second activity as singleTask (android:launchMode="singleTask") and noticed that I had been launching the second activity as startActivityForResult, but wasn't setting or using that when it came back. This wasn't causing any errors or anything, but I changed it to a plain startActivity.
I do not have physical access to the other phone so I can't hook it up to logcat or anything, as it is in another office elsewhere.
The other phone isn't seeing the problem anymore but I am worried that I have hidden the problem rather than really fixing it, and was wondering if anyone could provide some insight? | 0 | [
2,
13005,
1648,
142,
1601,
8081,
16044,
800,
3726,
3726,
19,
51,
4865,
31,
57,
21,
1935,
5167,
30,
22933,
21,
153,
2358,
15,
3244,
21,
3310,
1031,
13,
5,
821,
30,
22,
18,
7480,
6,
17,
630,
109,
7775,
2760,
170,
9,
48,
153,
235... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Access Database Item Delete and short vb .net 10
===
**I have a access database**. I want to remove some row with condition & short the database with a coloumn. With shorted database i want to copy about 15+- coloumns data to a new database. That database show data as this database as short. Can any one help me.
| 1 | [
2,
1381,
6018,
9101,
27448,
17,
502,
13,
20468,
13,
9,
2328,
332,
800,
3726,
3726,
13,
1409,
49,
57,
21,
1381,
6018,
1409,
9,
31,
259,
20,
4681,
109,
3131,
29,
2874,
279,
502,
14,
6018,
29,
21,
13,
12805,
723,
103,
9,
29,
502,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 install the generated Maven RPM artifact to local m2 repo with the correct rpm name?
===
So I can use the maven RPM plugin successfully to generate the RPM artifact as expected.
I use the attached-rpm goal in a pom.xml (packaged as a pom) so that the RPM plugin installs the artifact into the local m2 repository (as it is bound to the package phase).
Problem: The RPM generated name is great and is as follows : code-module-1.0.3-SNAPSHOT20120727095507.amd64.rpm
However when maven installs this to my local repo I end up with:
code-module-rpm-1.0.3-SNAPSHOT-rpm.rpm
I lose the the full name, the architecture part of the RPM and instead Maven is appending rpm to the end of the name before the .rpm extension (the classifier that I havent defined) and is using my pom artifact id as the rpm name instead of the rpm name itself.
I tried using the build-helper plugin to point to the generated RPM in the target directory but this doesnt work as the rpm name is dynamically generated and the build-helper plugin only accepts full file name no wildcards etc.
I dont want to change the final name of the artifact as I'd be breaking maven convention.
Here is the maven output:
[INFO] Installing /home/xzcx/Development/repository/svn/source/parent-project
/code-module-rpm/target/rpm/code-module/RPMS/amd64/code-module-1.0.3-
SNAPSHOT20120727145507.amd64.rpm to
/home/xzcx/.m2/repository/com/xpackage/ypackage/codepackage/code-module-rpm/1.0.3-
SNAPSHOT/code-module-rpm-1.0.3-SNAPSHOT-rpm.rpm
Any thoughts please?
| 0 | [
2,
184,
107,
16146,
14,
6756,
1216,
3124,
12936,
22929,
20,
375,
307,
135,
302,
1638,
29,
14,
4456,
12936,
204,
60,
800,
3726,
3726,
86,
31,
92,
275,
14,
1216,
3124,
12936,
10922,
108,
3673,
20,
7920,
14,
12936,
22929,
28,
1727,
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... |
Android : xml pasing working fine with android 2.2, 2.3 but not with ICS
===
I am fetching the some data from the server using `xml parsing` that not working with ICS version of android.here is my plz tell me what correction do i make so that i should also run on ICS...(It's working fine with lower versions). here is my code
try {
URL url = new URL(
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.parse(new InputSource(url.openStream()));
doc.getDocumentElement().normalize();
NodeList nodeList = doc.getElementsByTagName("file");
namephoto = new String[nodeList.getLength()];
for (int i = 0; i < nodeList.getLength(); i++) {
Node node = nodeList.item(i);
Element fstElmnt = (Element) node;
NodeList nameList = fstElmnt.getElementsByTagName("file");
Element nameElement = (Element) nameList.item(0);
nameList = nameElement.getChildNodes();
namephoto[i] = ((Node) nameList.item(0)).getNodeValue();
}
} catch (Exception e) {
Log.e("name", "" + e);
}
photobitmap = new Bitmap[namephoto.length];
setPhotoBackground(namephoto[index_photo]);
| 0 | [
2,
13005,
13,
45,
23504,
5750,
68,
638,
1123,
29,
13005,
172,
9,
135,
15,
172,
9,
240,
47,
52,
29,
13,
8354,
800,
3726,
3726,
31,
589,
18312,
68,
14,
109,
1054,
37,
14,
8128,
568,
13,
1,
396,
8184,
2017,
18,
68,
1,
30,
52,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Values of <td></td> is not returned using HtmlUnit
===
I am having a table structure in a web page as below
In this i am trying to get all the values in the tr using the HtmlUnit code as below.
<tr class="odd" id="rawmeta-123">
<td class="rowid">1</td>
<td>Arun</td>
<td class="date">2006-04-13</td>
<td></td>
<td class="date"></td>
<td></td>
<td></td>
</tr>
List<?> byXPath = page2.getByXPath("//tr[@class='odd']/td/text()");
It returns the first three and fifth td values. But the values for the for the other are not returned.(
<td></td>). How to get this value as null using HtmlUnit?
I highly appreciate your comments. | 0 | [
2,
4070,
16,
13,
1,
38,
43,
1,
118,
38,
43,
1,
25,
52,
587,
568,
13,
15895,
15464,
800,
3726,
3726,
31,
589,
452,
21,
859,
1411,
19,
21,
2741,
2478,
28,
1021,
19,
48,
31,
589,
749,
20,
164,
65,
14,
4070,
19,
14,
9235,
568,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASP.NET web form Routing issue via UNC Path
===
I create a IIS 7.0 website via UNC path to load .aspx to dynamic compile files and runs. however, it's running perfect.
I always use IIS URL Rewrite module 2 to rewrite my site URL n' its perfect, too.
Today, I wanna use System.Web.Routing to implement url rewrite but I encountered difficulties...
When I wrote code in Global.asax:
System.Web.Routing.RouteTable.Routes.MapPageRoute("TEST", "AAA/{prop}", "~/BBB/CCC.aspx");
And it just CANNOT reDirect to /BBB/CCC.aspx
When I type the URL(like: xx.xx.xx.xx/BBB/CCC.aspx) in browser directly, it runs normally that I want. (so it proof CCC.aspx is in right path.)
***
thus, I copy all of the code and open VS2010 running with IIS 7.5 Express locally, it works perfect!
e.g:
in browser URL I type xx.xx.xx.xx/AAA/1234, it will turn to page xx.xx.xx.xx/BBB/CCC.aspx (Works perfect!)
Why??? help me plz. thanks. | 0 | [
2,
28,
306,
9,
2328,
2741,
505,
19880,
1513,
1197,
16061,
2013,
800,
3726,
3726,
31,
1600,
21,
595,
18,
453,
9,
387,
2271,
1197,
16061,
2013,
20,
6305,
13,
9,
472,
306,
396,
20,
7782,
26561,
6488,
17,
1461,
9,
207,
15,
32,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.