unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
How to control pc from android phone?
===
I do not know where should I start to look and I don't know if I can use RemoteControlClient library for this, if yes how to use it,
if anybody know about that please help me, thanks for your helps... | 1 | [
2,
184,
20,
569,
5168,
37,
13005,
1132,
60,
800,
3726,
3726,
31,
107,
52,
143,
113,
378,
31,
799,
20,
361,
17,
31,
221,
22,
38,
143,
100,
31,
92,
275,
5388,
12898,
150,
18513,
38,
1248,
26,
48,
15,
100,
1643,
184,
20,
275,
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... |
Backbone, one field not set when calling view.render after model.save
===
I have the following problem. On a user-event (click on .twitterDefault) I call save event with
twitter : {
handle : handle,
ignore : false
}
Then the success function gets called and I set fields on the model (klout, twitter and tester). All fields are set (logging statements all print out appropiate objects.
However, then I call view.render() and here twitter is not set anymore. I have no idea why, there is no sync happening after the save so twitter does not get overwritten (additionally I made sure twitter is also saved on the server before the success method gets called).
Any help greatly appreciated!
Code as follows (stripped to improve readability)
> $(function() {
>
> var ContactModel,
> ContactModelCollection,
> ContactView,
> ContactCollectionView,
> contacts,
> contactCollectionView;
>
> //base model
> ContactModel = Backbone.Model.extend({
> defaults : {
> },
> initialize : function() {
> }
> });
>
> ContactModelCollection = Backbone.Collection.extend({
> model : ContactModel,
> url : '/api/contacts',
> comparator : function(contact) {
> return contact.get('strength_of_relationship');
> },
> initialize : function() {
> }
> });
>
> ContactView = Backbone.View.extend({
> tagName : 'li', //attempting to create a new element
> render: function() {
> var compiled_tmpl = _.template($('#contact-template').html());
> var html = compiled_tmpl(this.model.toJSON());
> console.log('model.get("twitter")=('+JSON.stringify(this.model.get('twitter)'))+')');
> console.log('model.get("klout")=('+JSON.stringify(this.model.get('klout'))+')');
> console.log('model.get("tester")=('+JSON.stringify(this.model.get('tester'))+')');
> this.$el.html(html);
> console.log('rendered view successfully)');
> return this;
> },
> initialize: function() {
> console.log('contactView initalized');
> this.model.bind('change', this.render, this);
> this.model.bind('destroy', this.remove, this);
> },
> events: {
> 'click .twitterDefault' : 'assignDefaultTwitterHandle',
> },
> assignDefaultTwitterHandle : function(event) {
> var handle = $(event.currentTarget).data('twitter');
> this.assignTwitterHandle(handle);
> },
> assignTwitterHandle : function(handle) {
> console.log('model assignTwitterHandle. handle='+handle+')');
> var view = this,
> model = view.model;
> model.save({
> twitter : {
> handle : handle,
> ignore : false
> },
> id : model.get('id')
> }, {
> error : function() {
> console.log('saving twitter handle failed');
> },
> success : function(model, response) {
> console.log('response=('+JSON.stringify(response)+')');
> if(response.error) {
> console.log('error on server ='+response.error);
> }
> if(response.twitter) {
> console.log('twitter is set');
> var twitter = {
> handle : handle,
> tweet : response.twitter,
> age : new Date()
> };
> console.log('setting twitter to '+JSON.stringify(twitter));
> model.set('twitter', twitter);
> model.set('tester', 'tester');
> console.log('twitter after setting it = '+JSON.stringify(model.get('twitter')));
> console.log('view\'s model twitter after setting it = '+JSON.stringify(view.model.get('twitter')));
> }
>
> if(response.klout) {
> console.log('klout is set');
> var klout = {
> topics : response.klout
> }
> console.log('setting klout to '+JSON.stringify(klout));
> model.set('klout', klout);
> }
> if(response.twitter || response.klout) {
> console.log('Rerendering view after setting klout/twitter');
> view.render();
> }
> }
> });
> }
> });
>
> contacts = new ContactModelCollection;
>
> ContactCollectionView = Backbone.View.extend({
> el : $('#suggestions-list'),
> initialize : function(){
> contacts.bind('add', this.addOne, this);
> contacts.bind('reset', this.addAll, this);
> contacts.bind('all', this.render, this);
> },
> render : function(){
> console.log('contactcollectionview render');
> },
> addOne : function(contact) {
> console.log('addOne');
> var view = new ContactView({model: contact});
> var el = view.render().el;
> console.log('el=('+el+')');
> $('#suggestions-list').append(el);
> },
> addAll : function() {
> console.log('addAll');
> contacts.each(this.addOne);
> }
> });
>
> contactCollectionView = new ContactCollectionView;
>
>
> App.contacts = contacts;
> App.contactCollectionView = contactCollectionView; }); | 0 | [
2,
24036,
15,
53,
575,
52,
309,
76,
2555,
1418,
9,
99,
16706,
75,
1061,
9,
19863,
800,
3726,
3726,
31,
57,
14,
249,
1448,
9,
27,
21,
4155,
8,
4943,
38,
13,
5,
150,
10129,
27,
13,
9,
38,
13098,
106,
13862,
9708,
6,
31,
645,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 – How to hide methods for a class that implements a protocol
===
Question is in title. Code example:
UIViewController <MyProtocol> *viewcontroller = ...;
[viewcontroller methodFromProtocol]; // I expect to be able to call all methods that the protocol defines
UIViewController *viewControllerWithoutMyProtocol = [[UIViewController alloc] init];
[viewControllerWithoutMyProtocol methodThatIsNotInTheInterfaceIsDisplayedHere]; // I only expect to be able to call the methods that are defined in this class' interface | 0 | [
2,
7038,
8,
150,
13,
10,
184,
20,
3077,
3195,
26,
21,
718,
30,
8713,
18,
21,
8494,
800,
3726,
3726,
1301,
25,
19,
581,
9,
1797,
823,
45,
13,
5661,
4725,
12898,
1252,
13,
1,
915,
2740,
262,
7771,
1,
1637,
4725,
12898,
1252,
800... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Gallery and fading edges
===
I have a gallery where I have a bitmaps. This is code:
// Bitmap snoop = BitmapFactory.decodeResource(mContext.getResources(), mImageIds[position]);
// i.setImageResource(mImageIds[position]);
// i.setScaleType(ImageView.ScaleType.FIT_XY);
BitmapFactory.Options options = new BitmapFactory.Options();
// will results in a much smaller image than the original
Bitmap b = BitmapFactory.decodeFile("/sdcard/DinEgen/"+name.get(position), options);
Bitmap img = Bitmap.createScaledBitmap( b, width, height, true );
b.recycle();
i.setImageBitmap(img);
//i.setBackgroundResource(mGalleryItemBackground);
i.setGallery(g);
i.setLayoutParams(new Gallery.LayoutParams(width, height));
return i;
When I start application everything looks ok. Like on the picture:
![enter image description here][1]
and when I go to next page everything looks bad:
![enter image description here][2]
Color is lighter and on left side is something like edge with good color. When I back color is lighter too and this edge is on right side. I used in gallery
android:fadingEdge="none"
android:fadingEdgeLength="0px"
but still doesn't work. Any idea why color is changing and why when I go to next page I see this edge?
[1]: http://i.stack.imgur.com/3V1yW.png
[2]: http://i.stack.imgur.com/hWL26.png
| 0 | [
2,
2246,
17,
16099,
7840,
800,
3726,
3726,
31,
57,
21,
2246,
113,
31,
57,
21,
1142,
15022,
18,
9,
48,
25,
1797,
45,
12894,
1142,
15022,
22562,
800,
1142,
15022,
17455,
93,
9,
546,
9375,
99,
12097,
5,
79,
1126,
11969,
9,
3060,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 link android library (as Angle) to my Eclipse project?
===
Nooby question, I guess, but.
I downloaded free android engine called Angle from [here][1].
There is a source and an example. I imported this project to Eclipse and now getting errors:
Project 'ANGLE' is missing required source folder: 'gen'
and there was no such directory in package, so, I guess, I need to create it? In my helloWorld created without any libraries I have `R.java` in this folder (gen/com/companyName/appName/R.java).
Also, there was another error - project was for "android-3", and I have sdk beginning with 2.2 (android-8). So I changed target to android 2.2 and got an error
Android requires compiler compliance level 5.0 or 6.0.
Found '1.7' instead. Please use Android Tools > Fix Project Properties.
So, what are "android tools"? Never seen this option.
Thanks for any help. New to Eclipse, new to Android, so need some advices.
[1]: http://code.google.com/p/angle/downloads/list | 0 | [
2,
184,
107,
31,
3508,
13005,
1248,
13,
5,
472,
5334,
6,
20,
51,
11652,
669,
60,
800,
3726,
3726,
90,
111,
779,
1301,
15,
31,
2321,
15,
47,
9,
31,
23887,
551,
13005,
1406,
227,
5334,
37,
636,
6836,
500,
2558,
165,
500,
9,
80,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Perl Slurp Regex Capture
===
>Using perl I have "slurped" in a large file that contains the text below and I am trying to capture all regex $1 matches within the file for my given regex. My regex is
`=~ /((GET|PUT|POST|CONNECT).*?(Content-Type: (image\/jpeg)))/sgm`
>Currently the text in bold is being captured, however, the last capture is treating the lines
>"GET /~sgtatham/putty/latest/x86/pscp.exe HTTP/1.1" to "Content-Type: text/html; charset=iso-8859-1"
>as part of the very last capture and it should not b/c "text/html" is not equal to my regex capture of (image\/jpeg). I want to be able to capture the last capture without the
>"GET /~sgtatham/putty/latest/x86/pscp.exe HTTP/1.1" to "Content-Type: text/html; charset=iso-8859-1" being included. Appreciate any help, thank you.
**GET /~sgtatham/putty/latest/x86/pscp.exe HTTP/1.1
Host: the.earth.li
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
Content-Type: text/html; charset=iso-8859-1
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
\.+"
GET /~sgtatham/putty/0.62/x86/pscp.exe HTTP/1.1
Host: the.earth.li
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:13.0) Gecko/20100101 Firefox/13.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Content-Length: 315392
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: image/jpeg**
Platform: Digital Engagement Platform; Version: 1.1.0.0
| 0 | [
2,
416,
255,
19665,
306,
7953,
1706,
3683,
800,
3726,
3726,
13,
1,
12655,
416,
255,
31,
57,
13,
7,
18,
14130,
3631,
7,
19,
21,
370,
3893,
30,
1588,
14,
1854,
1021,
17,
31,
589,
749,
20,
3683,
65,
7953,
1706,
3742,
1717,
363,
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... |
What is the use of cvGetRows() function in OpenCV?
===
When should i use this function. Can anybody explain me with an example? | 0 | [
2,
98,
25,
14,
275,
16,
13,
12732,
3060,
5417,
18,
5,
6,
1990,
19,
368,
12732,
60,
800,
3726,
3726,
76,
378,
31,
275,
48,
1990,
9,
92,
11181,
3271,
55,
29,
40,
823,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How can I create a method that gets called every time a public method gets called?
===
How can I create a method that gets called every time a public method gets called? You could also say that this is a post-method-call-hook.
My current code:
<?php
class Name {
public function foo() {
echo "Foo called\n";
}
public function bar() {
echo "Bar called\n";
}
protected function baz() {
echo "Baz called\n";
}
}
$name = new Name();
$name->foo();
$name->bar();
The current output in this code would be:
Foo called
Bar called
I would like the baz() method to get called every time another public method gets called. E.g.
Baz called
Foo called
Baz called
Bar called
I know that I could have done something like this:
public function foo() {
$this->baz();
echo "Foo called\n";
}
But that wouldn't really solve my problem because that's not really orthogonal and it's relatively painful to implement if I'd have 100 methods that need to have this other method called before them.
| 0 | [
2,
184,
92,
31,
1600,
21,
2109,
30,
3049,
227,
352,
85,
21,
317,
2109,
3049,
227,
60,
800,
3726,
3726,
184,
92,
31,
1600,
21,
2109,
30,
3049,
227,
352,
85,
21,
317,
2109,
3049,
227,
60,
42,
110,
67,
395,
30,
48,
25,
21,
678,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Inbreeding-immune database structure
===
I have an application that requires a "simple" family tree. I would like to be able to perform queries that will give me data for an entire family given one id from a member in the family. I say simple because it does not need to take into account adoption or any other obscurities. The requirements for the application are as follows:
- Any two people will not be able to breed if they're from the same genetic line
- Needs to allow for the addition of new family lines (new people with no previous family)
- Need to be able to pull siblings, parents separately through queries
I'm having trouble coming up with the proper structure for the database. So far I've come up with two solutions but they're not very reliable and will probably get out of hand quite quickly.
Solution 1 involves placing a family_ids field on the people table and storing a list of unique family ids. Each time two people breed the lists are checked against each other to make sure no ids match and if everything checks out will merge the two lists and set that as the child's family_ids field.
Example:
Father (family_ids: (null)) breeds with Mother (family_ids: (213, 519)) ->
Child (family_ids: (213, 519)) breeds with Random Person (family_ids: (813, 712, 122, 767)) ->
Grandchild (family_ids: (213, 519, 813, 712, 122, 767))
And so on and so forth... The problem I see with this is the lists becoming unreasonably large as time goes on.
Solution 2 uses cakephp's associations to declare:
public $belongsTo = array(
'Father' => array(
'className' => 'User',
'foreignKey' => 'father_id'
),
'Mother' => array(
'className' => 'User',
'foreignKey' => 'mother_id'
)
);
Now setting recursive to 2 will fetch the results of the mother and father, along with their mother and father, and so on and so forth all the way down the line. The problem with this route is that the data is in nested arrays and I'm unsure of how to efficiently work through the code.
If anyone would be able to steer me in the direction of the most efficient way to handle what I want to achieve that would be tremendously helpful. Any and all help is greatly appreciated and I'll gladly answer any questions anyone has. Thanks a lot. | 0 | [
2,
19,
3692,
69,
68,
8,
1660,
5619,
62,
6018,
1411,
800,
3726,
3726,
31,
57,
40,
3010,
30,
4781,
21,
13,
7,
24629,
7,
190,
1541,
9,
31,
83,
101,
20,
44,
777,
20,
2985,
9386,
2829,
30,
129,
590,
55,
1054,
26,
40,
1078,
190,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SMACSS based CSS Frameworks
===
The SMACSS framework introduces a consistent way to manage your CSS code so that it is reusable and maintainable, but it is more of a guideline of how to organize your CSS rather than an actual framework. It would be nice if there were any other frameworks that were based off of its philosophy, but I haven't come across any.
Does anyone know of any CSS frameworks that are based off of the SMACSS method of organizing CSS code? | 0 | [
2,
13,
18,
6893,
18,
18,
432,
272,
18,
18,
6596,
18,
800,
3726,
3726,
14,
13,
18,
6893,
18,
18,
6596,
16536,
21,
8224,
161,
20,
4705,
154,
272,
18,
18,
1797,
86,
30,
32,
25,
302,
267,
579,
17,
4027,
579,
15,
47,
32,
25,
91... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Add range to each item in select array?
===
I asked this over in the drupal forum a while ago, but I haven't been able to get any responses, so I'm hoping that somebody here can help me out. I have the following code in a module for a select array.
$options = array(
'' => 'Any',
'0' => 'None',
'1' => 'Drinks',
'2' => 'Food',
'3' => 'Both',
);
However, the problem is that each option is only related to a single value. Is there a way to instead assign a range to each option? The result would be that any value between 0 and 1 is assigned to None, any value between 1 and 2 is assigned to Drinks, etc.?
| 0 | [
2,
3547,
978,
20,
206,
9101,
19,
5407,
7718,
60,
800,
3726,
3726,
31,
411,
48,
84,
19,
14,
15708,
6720,
5691,
21,
133,
1464,
15,
47,
31,
2933,
22,
38,
74,
777,
20,
164,
186,
13231,
15,
86,
31,
22,
79,
3935,
30,
8861,
235,
92... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java. Praoblem with org.json
===
I have Json string, which contain "key" : "value" pairs and i need to know keys at this string using Java and importing org.json. I tried to use iterator, but first pair key prints in the end.
for example string:
{
"firstName": "sam",
"lastName": "Smith",
"address": {
"streetAddress": "somestreet",
"city": "somecity",
"postalCode": 101101
},
"phoneNumbers": [
"812 123-1234",
"916 123-4567"
]
}
I want to print:
"
firstName
lastName
address
phoneNumbers
".
But i have:
"lastName
address
phoneNumbers
firstName"
JSONObject JO = new JSONObject(JsonString);
Iterator<String> It = JO.keys();
while (It.hasNext()){
System.out.println(It.next());
} | 0 | [
2,
8247,
9,
3865,
4995,
10388,
29,
13,
5583,
9,
728,
528,
800,
3726,
3726,
31,
57,
487,
528,
3724,
15,
56,
3717,
13,
7,
4237,
7,
13,
45,
13,
7,
15165,
7,
7473,
17,
31,
376,
20,
143,
5534,
35,
48,
3724,
568,
8247,
17,
9010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 get page name from route
===
I have a users controller which is used for users profile
then i routed from
/users/{username}
to
/{username}
but now if i want to add pages like
- About Us
- Help
- Contact Us
- ToS
- Privacy
- etc...
i face a problem where i cant access which page i am at via the `params[]` code
my route looks like
match '/home' => 'home#index'
#change /users/{username} to /{username}
match '/:username' => 'users#show'
i need to know which page i am for my navigation menu so i can add an active class to highlight the page
is there any way i can do this? | 0 | [
2,
10811,
27,
2240,
18,
164,
2478,
204,
37,
858,
800,
3726,
3726,
31,
57,
21,
3878,
9919,
56,
25,
147,
26,
3878,
5296,
94,
31,
858,
43,
37,
13,
118,
16704,
18,
118,
1,
16704,
7259,
1,
20,
13,
118,
1,
16704,
7259,
1,
47,
130,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 search for a certain style in word 2010 and make it into a bookmark using vba
===
[Example to my Query with clarification](http://i.imgur.com/7EZxS.jpg)
| 0 | [
2,
184,
20,
2122,
26,
21,
1200,
1034,
19,
833,
498,
17,
233,
32,
77,
21,
360,
4527,
568,
566,
969,
800,
3726,
3726,
636,
29041,
20,
51,
25597,
29,
13,
12078,
4634,
500,
5,
21127,
6903,
49,
9,
1660,
11147,
9,
960,
118,
465,
281... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
two datatables export at two diferent excel csv files
===
you se finaly i have 2 datables fill with diferente data, now i have a button that allows me to send one datatable to an .CSV excel file like this:
string name="Dat_Agrup";
HttpContext context = HttpContext.Current;
context.Response.Clear();
foreach (System.Data.DataColumn column in _myDataTable.Columns)
{
context.Response.Write("name"+ ",");
}
context.Response.Write(Environment.NewLine);
foreach (System.Data.DataRow row in _myDataTable.Rows)
{
for (int i = 0; i < _myDataTable.Columns.Count; i++)
{
context.Response.Write(row[i].ToString().Replace(",", string.Empty) + ",");
}
context.Response.Write(Environment.NewLine);
}
context.Response.ContentType = "text/csv";
context.Response.AppendHeader("Content-Disposition", "attachment; filename=" + name + ".csv");
context.Response.End();
now this code works perfect it maybe mising some lines like where i declare the datatable but just trust me it works :D, now if i want to save a second datatable using the same code in the same action_button is those not work, i use this next code:
string name2="Centroids";
HttpContext context2 = HttpContext.Current;
context2.Response.Clear();
foreach (System.Data.DataRow row in _myDataTable2.Rows)
{
for (int i = 0; i < _myDataTable2.Columns.Count; i++)
{
context2.Response.Write(row[i].ToString().Replace(",", string.Empty) + ",");
}
context2.Response.Write(Environment.NewLine);
}
context2.Response.ContentType = "text2/csv";
context2.Response.AppendHeader("Content-Disposition", "attachment; filename=" + name2 + ".csv");
context2.Response.End();
it only save the first datatable and ignores the rest of the code can anyone explain the reazon or why this happends, much apreciated any kind of help.
| 0 | [
2,
81,
1054,
5924,
18,
7487,
35,
81,
926,
2407,
2291,
20700,
272,
18,
710,
6488,
800,
3726,
3726,
42,
1353,
426,
93,
31,
57,
172,
1054,
2854,
18,
3509,
29,
926,
2407,
7989,
1054,
15,
130,
31,
57,
21,
5167,
30,
2965,
55,
20,
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... |
JQM Changing and resetting Page Size
===
I am using JQM and I have a page with an iframe as the content. The Iframe width and height properties are both initially set to 95%. However, in iOS, when the Iframe loads its contents it (the iframe) is often larger than the JQM page. causing the Iframe to expand outside the boundries of the page.
So I adjust the individual page elements on the iframe load event:
iframe.load(function ()
{
var iframeHeight = iframe.height();
var iframeWidth = iframe.width();
if (iframeWidth > contentWidth)
{
header.width( iframeWidth + 50);
content.width( iframeWidth + 20);
}
if (iframeHeight > contentHeight)
{
content.height( iframeHeight + 10);
$page.height( headHeight + contentHeight + 20);
}
});
This works. But by manually changing the page,header and content size they remain at their new size when the page changes orientation. I also re-use this page and i would like the page to be its original size when it is first loaded.
| 0 | [
2,
487,
1251,
79,
4226,
17,
302,
19831,
2478,
1072,
800,
3726,
3726,
31,
589,
568,
487,
1251,
79,
17,
31,
57,
21,
2478,
29,
40,
31,
8361,
28,
14,
2331,
9,
14,
31,
8361,
9456,
17,
2947,
3704,
50,
156,
1537,
309,
20,
13,
20371,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get single row result with Doctrine NativeQuery
===
I'm trying to get a single row returned from a native query with Doctrine. Here's my code:
$rsm = new ResultSetMapping;
$rsm->addEntityResult('VNNCoreBundle:Player', 'p');
$rsm->addFieldResult('p', 'player_id', 'id');
$sql = "
SELECT player_id
FROM players p
WHERE CONCAT(p.first_name, ' ', p.last_name) = ?
";
$query = $this->getEntityManager()->createNativeQuery($sql, $rsm);
$query->setParameter(1, $name);
$players = $query->getResult();
That last line returns a list of players but I just want one result. How do I do that? | 0 | [
2,
164,
345,
3131,
829,
29,
7521,
1275,
8190,
93,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
21,
345,
3131,
587,
37,
21,
1275,
25597,
29,
7521,
9,
235,
22,
18,
51,
1797,
45,
5579,
1224,
79,
800,
78,
1736,
1198,
540,
5574,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Split string with powershell and do something with each token
===
I want to split each line of a pipe on spaces, and then print each token on it's own line.
I realise that I can get this result using:
(cat someFileInsteadOfAPipe).split(" ")
But I want more flexibility, I want to be able to do just about anything with each token. (I used to use `awk` on Unix and I'm trying to get the same functionality).
What I currently have is:
echo "Once upon a time there were three little pigs" | %{$data = $_.split(" "); Write-Output "$($data[0]) and whatever I want to output with it"}
Which, obviously, only prints the first token. Is there a way for me to for-each over the tokens, printing each in turn?
Also, the `%{$data = $_.split(" "); Write-Output "$($data[0])"}` part I got from a blog, and I really don't understand what I'm doing or how the syntax works. I want to google for it, but I don't know what to call it. Please help me out with a word or two to google, or a link explaining to me what the `%` and all the `$` symbols do, as well as the significance of the opening and closing brackets. | 0 | [
2,
2132,
3724,
29,
414,
15984,
17,
107,
301,
29,
206,
20,
2853,
800,
3726,
3726,
31,
259,
20,
2132,
206,
293,
16,
21,
7642,
27,
7644,
15,
17,
94,
4793,
206,
20,
2853,
27,
32,
22,
18,
258,
293,
9,
31,
16794,
30,
31,
92,
164,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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: Extending an abstract class to return two "Pair" structures in a 2-element array
===
**I have been working on this problem for 7 hours straight! I need some assistance.**
**Here's what I have to begin with:**
public abstract class StringAuditQuestion
{
public static class Pair
{
public char _char;
public int _occurances;
public Pair(char c)
{
_char = c;
_occurances = 0;
}
}
/**
* Breaks down a string into an array of pairs which report each character
* that appears in the string, along with the number of occurances for that character.
* This report is to be provided in order from most occuring character to least occurring
* character
*
* @param input Any non-null string
* @return returns the contents of the string
*/
public abstract Pair[] auditString(String input);
public void reportAudit(String input)
{
Pair[] pairs = auditString(input);
for (int i = 0; i < pairs.length; i++)
{
System.out.println(pairs[i]._char + "\t" + pairs[i]._occurances);
}
}
}
Does anyone have any hints as to what my subclass should be called? I am also very confused to what this subclass is suppose to return exactly. I need to provide a method auditString with the same signature as the abstract method of that name on StringAuditQuestion. | 1 | [
2,
8247,
45,
8176,
40,
8502,
718,
20,
788,
81,
13,
7,
306,
2642,
7,
3815,
19,
21,
172,
8,
27567,
7718,
800,
3726,
3726,
13,
1409,
49,
57,
74,
638,
27,
48,
1448,
26,
453,
974,
1599,
187,
31,
376,
109,
4067,
9,
1409,
13,
1409,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
onPostExecute method never get called in AsyncTask
===
I'm trying to fetch some data from db server. I understood I can't excute the network job on UI Main thread. the solution I found is AsyncTask. I override two method(onPostExecute, doInBackground), but
after doInBackground, onPostExecute never called, and my android phone(galaxy s2) force my app to stop. where is the wrong place?
public class MainActivity extends Activity {
EditText mResult;
private static final String TAG = "JSON";
String Json;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mResult = (EditText)findViewById(R.id.result);
Button btn = (Button)findViewById(R.id.parse);
btn.setOnClickListener(new Button.OnClickListener(){
@Override
public void onClick(View v){
getHtml("http://192.168.0.12/index.php");
//Json = getHtml("http://192.168.0.12/index.php");
Log.i(TAG, Integer.toString(5));
Log.i(TAG, Json);
Log.i(TAG, Integer.toString(6));
try{
String Result = "member list: \n";
JSONArray ja = new JSONArray(Json);
for(int j=0; j<ja.length(); j++)
{
JSONObject order = ja.getJSONObject(j);
Result +="ID : " + order.getInt("id") + " " +
"number : " + order.getInt("gisoo")+ " " +
"name : " + order.getString("name")+ " " +
"sex : " + order.getString("sex")+ " " +
"age : " + order.getInt("age")+ " " +
"school : " + order.getString("university")+ " " +
"phone : " + order.getString("phone")+ " " +
"no : " + order.getInt("numberOfVolunteer")+ " " +
"lastlogin : " + order.getString("lastLogin")+ " " +
"lastactivity : " + order.getString("lastVolunteer")+ " " +
"message : " + order.getString("message")+ "\n\n";
}
mResult.setText(Result);
} catch(JSONException e)
{
Toast.makeText(v.getContext(), e.getMessage(), Toast.LENGTH_LONG).show();
}
}
});
}
private void getHtml(String url)
{
new ProcessHtmlTask().execute(url);
}
private class ProcessHtmlTask extends AsyncTask<String, Void, String>{
@Override
protected void onPostExecute(String JSON){
Log.i(TAG, Integer.toString(8)); //I couldn't see number 8 in log.
Json = JSON;
return;
}
@Override
protected String doInBackground(String... addr){
StringBuilder jsonHtml = new StringBuilder();
HttpURLConnection conn;
try{
URL url = new URL(addr[0]);
conn = (HttpURLConnection)url.openConnection();
if(conn != null)
{
conn.setConnectTimeout(10000);
conn.setUseCaches(true);
int n = conn.getResponseCode();
Log.i(TAG, Integer.toString(n));
if(conn.getResponseCode() == HttpURLConnection.HTTP_OK){
BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream(), "EUC-KR"));
for(;;){
String line = br.readLine();
if(line == null) break;
jsonHtml.append(line + "\n");
}
Log.i(TAG, Integer.toString(3));
br.close();
}
Log.i(TAG, Integer.toString(4));
conn.disconnect();
}
} catch(Exception ex){
Log.i(TAG, ex.getMessage());
}
Log.i(TAG, jsonHtml.toString());
Log.i(TAG, Integer.toString(5)); //I checked html string and number 5 showed up in log.
return jsonHtml.toString();
}
} | 0 | [
2,
27,
6962,
1706,
17194,
591,
2109,
243,
164,
227,
19,
21,
9507,
20255,
3656,
800,
3726,
3726,
31,
22,
79,
749,
20,
18312,
109,
1054,
37,
13,
9007,
8128,
9,
31,
4014,
31,
92,
22,
38,
1396,
4118,
62,
14,
982,
1205,
27,
13,
566... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
HTML5 audio tag within an iframe
===
I am using Buzz library for my audio within an HTML5 game. To cross menus without the music stopping, I load each menu in an iframe and the music is launched from the main page:
<body style="overflow: hidden">
<iframe id="MainFrame" src="./mainmenu.html" frameborder=0 seamless="seamless" class="mainframe"></iframe>
<script>
window.onload = function() {
playLoop('audio/menumusic.mp3');
}
</script>
</body>
var playLoop = function(name)
{
sound = new buzz.sound(name, {preload: true, loop: true});
sound.play();
setInitialSoundState(sound);
loops.add(sound);
}
Thing is that I want to be able to toggle/change the music in the pages loaded within the iframe. But whenever I use
buzz.all().mute();
nothing happens. I'm guessing that the "buzz" variable in the iframe and the "buzz" variable from the main page are not the same. How can I access the main pages buzz so that all music is muted correctly?
I'll be happy to give out more details if needed.
| 0 | [
2,
13,
15895,
264,
4023,
3383,
363,
40,
31,
8361,
800,
3726,
3726,
31,
589,
568,
9122,
1248,
26,
51,
4023,
363,
40,
13,
15895,
264,
250,
9,
20,
919,
11379,
18,
366,
14,
232,
7048,
15,
31,
6305,
206,
11379,
19,
40,
31,
8361,
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 create Last login user details with time stamp in lwuit
===
Iam new to lwuit..I wanna create last user login details with timestamp..How can i write that code in lwuit.. | 0 | [
2,
184,
20,
1600,
236,
6738,
108,
4155,
3289,
29,
85,
10151,
19,
13,
23281,
11193,
800,
3726,
3726,
31,
765,
78,
20,
13,
23281,
11193,
9,
9,
49,
11024,
1600,
236,
4155,
6738,
108,
3289,
29,
436,
38,
10158,
9,
9,
1544,
92,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Django / WSGI - How to profile partial request? My profiling tools are per-request but app runs out of memory before then
===
How can I profile my python / django application which is crashing on a single request after 100 seconds of hogging more memory?
All I see in top is that the wsgi process is consuming memory slowly until it crashes.
The only profiling techniques I know run on a full request/response cycle but I'm not able to finish a request. What then?
I might even run the dev server and try to kill it mid-request and see where the stack is. | 0 | [
2,
3857,
14541,
13,
118,
619,
18,
2234,
13,
8,
184,
20,
5296,
7284,
3772,
60,
51,
8721,
49,
802,
4672,
50,
416,
8,
99,
10351,
47,
4865,
1461,
70,
16,
1912,
115,
94,
800,
3726,
3726,
184,
92,
31,
5296,
51,
20059,
13,
118,
3857,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to use bcrypt with php for password authentication?
===
I tried the top solution post from http://stackoverflow.com/questions/4795385/how-do-you-use-bcrypt-for-hashing-passwords-in-php
but can't seem to get an example working. I copied the Bcrypt class and added the following code at the bottom of it.
$bcrypt = new Bcrypt(15);
// pw on server. Used $pwHash = $bcrypt->hash($formPassword); to get the hash from 'qwerty'.
$serverPw = '$2a$15$Ty6hIEEWFpUFHoKujvdmw.9kmyrwYip2s8TLdjDfNoVJuQx/TGgwu';
// user enters plain text pw...
$passAttempt = 'qwerty';
// attempt to check the attempted password against the server hashed pasword.
$pwVerify = $bcrypt->verify($serverPw, $passAttempt);
if ( $pwVerify == 1 ) {echo "$pwVerify = true";} else {echo "$pwVerify = not true";}
// I also tried if ($pwVerify) and if ($bcrypt->verify($serverPw, $passAttempt))
// Output is "= not true"
What is wrong here? | 0 | [
2,
184,
20,
275,
334,
11435,
29,
13,
26120,
26,
20884,
27963,
60,
800,
3726,
3726,
31,
794,
14,
371,
4295,
678,
37,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
2918,
3836,
22952,
118,
1544,
8,
537,
8,
245,
8,
369... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JavaEE path to jsp page not working
===
Developing small sample BookStore application and have a problem.
In the screenshot I got WEB-INF/pages/book-form.jsp and when I use below line in
doGet servlet method like
getServletContext().getRequestDispatcher("/WEB-INF/pages/book-form.jsp").forward(req, res);
can not find the page BUT if I use
getServletContext().getRequestDispatcher("/book-form.jsp").forward(req, res);
which is working fine.
**Question:** How to resolve "/WEB-INF/pages/book-form.jsp"?
![BookStore Application][1]
[1]: http://i.stack.imgur.com/eOtu2.gif | 0 | [
2,
8247,
2851,
2013,
20,
487,
3401,
2478,
52,
638,
800,
3726,
3726,
3561,
284,
5717,
21899,
3010,
17,
57,
21,
1448,
9,
19,
14,
2324,
7868,
31,
330,
2741,
8,
108,
410,
118,
6486,
18,
118,
5199,
8,
4190,
9,
728,
3401,
17,
76,
31... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can't find org.zkoss.bind.BindComposer
===
I use Eclipse with ZK plugin. Project also was created using zk plugin.
Trying to get started with bindings stucked with error "java.lang.ClassNotFoundException: org.zkoss.bind.BindComposer"... I see that the library with this class is in the build path and web app libraries. I am going through tutorial http://books.zkoss.org/wiki/ZK%20Developer%27s%20Reference/MVVM/Data%20Binding/BindComposer | 0 | [
2,
92,
22,
38,
477,
13,
5583,
9,
380,
13900,
18,
9,
4772,
43,
9,
4772,
43,
29058,
800,
3726,
3726,
31,
275,
11652,
29,
2052,
197,
10922,
108,
9,
669,
67,
23,
679,
568,
2052,
197,
10922,
108,
9,
749,
20,
164,
373,
29,
8728,
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... |
Jasper Reports:-Resource net/sf/jasperreports/engine/export/ooxml/xlsx/_rels/xml.rels not found
===
I am using IReports 4.1.1 when i am exporting a report from my java code .I am getting this error.
I Checked the jasper jar the file is present in that jar .Still getting an error of resource not found.
Please advise | 0 | [
2,
16750,
2813,
45,
8,
99,
12097,
4275,
118,
18,
410,
118,
1004,
18,
1432,
17437,
18,
118,
16847,
118,
1706,
1993,
118,
111,
6326,
8184,
118,
396,
7532,
396,
118,
1,
7256,
18,
118,
396,
8184,
9,
7256,
18,
52,
216,
800,
3726,
372... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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]why hashmap's data come back after I add some data eventhough I hava already clear the hashmap
===
public class readBin {
public static void main(String[] args) throws IOException{
long time1 = System.currentTimeMillis();
File targetfile = new File("d:\\d2012.bin");
FileInputStream in = new FileInputStream(targetfile);
BufferedReader br = new BufferedReader(new InputStreamReader(in));
byte[] buffer = new byte[2097152];
int byteread = 0;
String bufferString = "";
ArrayList<HashMap> arr = new ArrayList<HashMap>();
ArrayList arrstr = new ArrayList();
HashMap hashmap = new HashMap();
ArrayList<String> cttarr = new ArrayList<String>();
String[] strarr = new String[2];
ArrayList<String> valarr = new ArrayList<>();
//It's all init above,below comes the file reading
bufferString = br.readLine();
while(bufferString != null){
//if data readed this line from the file is not "*newrecord" or ""
if(!bufferString.equals("*NEWRECORD")&&!bufferString.equals("")){
//according to the need,make use of these data
strarr = bufferString.split("=");
switch (strarr[0].trim()) {
case "UI":
hashmap.put(strarr[0].trim(), strarr[1].trim());
break;
case "MH":
hashmap.put(strarr[0].trim(), strarr[1].trim());
break;
case "AQ":
String[] valuearr = strarr[1].split(" ");
hashmap.put(strarr[0], valuearr);
break;
case "ENTRY":
bufferString = bufferString.split("\\|")[0].toString();
//if key named ENTRY has already existed,update the data
if (hashmap.containsKey(strarr[0].trim())) {
ArrayList<String> templist = ((ArrayList<String>)hashmap.get(strarr[0].trim()));
templist.add(bufferString.split("=")[1].trim());
hashmap.put(strarr[0].trim(), templist);
//or insert it
} else {
cttarr.add(bufferString);
hashmap.put(strarr[0].trim(),cttarr);
}
break;
case "MS":
hashmap.put(strarr[0].trim(), strarr[1].trim());
break;
case "MN":
//as ENTRY do
if (hashmap.containsKey(strarr[0].trim())) {
ArrayList<String> templist = ((ArrayList<String>)hashmap.get(strarr[0].trim()));
templist.add(strarr[1].trim());
hashmap.put(strarr[0].trim(), templist);
} else {
cttarr.add(strarr[1].trim());
hashmap.put(strarr[0].trim(),cttarr);
}
break;
default:
break;
}
} else if(hashmap.size() != 0) {
//if it equals to *newrecord or "",init the hashmap again
arr.add(hashmap);
hashmap = new HashMap();
}
bufferString = br.readLine();
if (bufferString == null) {
arr.add(hashmap);
}
}
ArrayList arrresult = arr;
long time2 = System.currentTimeMillis();
System.out.println(time2-time1);
String ui = (String) arr.get(0).get("MH");
ArrayList<String> entrys = (ArrayList<String>) arr.get(0).get("ENTRY");
int len = arr.size();
System.out.println(ui);
System.out.println(len);
}
public String getbs(){
return "";
}
}
I want to iterate the data from the file and add them to the hashmap,after updating the hashmap to the arrayList,init the hashmap again.but from the result ,it seems the data in the hashmap wont clear. | 0 | [
2,
636,
1004,
1385,
500,
2256,
19170,
15022,
22,
18,
1054,
340,
97,
75,
31,
3547,
109,
1054,
166,
9371,
31,
13,
20648,
614,
1207,
14,
19170,
15022,
800,
3726,
3726,
317,
718,
1302,
4772,
13,
1,
317,
12038,
11364,
407,
5,
11130,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
sbt playframework publish submodules
===
I have the following project structure:
myproject
|
+- app
|
+- conf
|
+- project
| |
| +- project
| |
| +- Build.scala (etc.)
|
+- modules
|
+- security
|
+- app
|
+- conf
Here is the snippet from my build file:
val security = PlayProject(
appName + "-security", appVersion, path = file("modules/security")
)
If I try to do a `sbt publish` with a non snapshot version, sbt exits with following error:
sbt.ResolveException: unresolved dependency: myproject-security#myproject-security_2.9.1;123
Of course it can't find the dependency in the repository. But how can I publish the submodules together with the main project?
Thank you in advance. | 0 | [
2,
13,
18,
220,
38,
418,
8361,
3783,
10824,
972,
19673,
160,
800,
3726,
3726,
31,
57,
14,
249,
669,
1411,
45,
51,
21011,
13,
1,
2754,
8,
4865,
13,
1,
2754,
8,
13,
14093,
13,
1,
2754,
8,
669,
13,
1,
13,
1,
13,
1,
2754,
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... |
Swiping betwiin webviews not possible (Windows 8)
===
Currently i'm developing a WinRT app and I want to implement a swipe between webpage. I used a FlipView for the swiping.
But apparently the WebView is capturing the swipes and doesn't pass those events to the FlipView.
<FlipView HorizontalAlignment="Left" Grid.Row="1" VerticalAlignment="Top" Margin="50,50,50,50">
<FlipViewItem>
<WebView HorizontalAlignment="Left" Height="600" VerticalAlignment="Top" Width="1200" Source="http://www.site1.com" ManipulationMode="None"/>
</FlipViewItem>
<FlipViewItem>
<WebView HorizontalAlignment="Left" Height="600" VerticalAlignment="Top" Width="1200" Source="http://www.site2.com"/>
</FlipViewItem>
</FlipView>
Is there a way to pass the swipe events to the FlipView? | 0 | [
2,
13,
18,
27803,
68,
5676,
3976,
108,
2741,
4725,
18,
52,
938,
13,
5,
27508,
18,
469,
6,
800,
3726,
3726,
871,
31,
22,
79,
3561,
21,
628,
5256,
4865,
17,
31,
259,
20,
8713,
21,
27246,
128,
2741,
6486,
9,
31,
147,
21,
8805,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Beam - activate programmatically
===
I try to activate or deactivate the Android Beam feature programmatically on ICS but I can't find any api for this. Is it possible ?
And I would know if Android Beam feature is enabled before initiate a push operation. Is it possible ? | 0 | [
2,
13005,
5581,
13,
8,
18163,
625,
6732,
1326,
800,
3726,
3726,
31,
1131,
20,
18163,
54,
121,
19516,
1373,
14,
13005,
5581,
1580,
625,
6732,
1326,
27,
13,
8354,
47,
31,
92,
22,
38,
477,
186,
21,
2159,
26,
48,
9,
25,
32,
938,
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... |
Initializing Hibernate takes lot of time in Sonar analysis
===
I am using Sonar for static code analysis in my project. The issue is Sonar is taking lot of time at the point **Initializing Hibernate**. Does anyone has any idea about how to speed up sonar analysis? | 0 | [
2,
2104,
3335,
4148,
2102,
8820,
1384,
865,
16,
85,
19,
433,
512,
2495,
800,
3726,
3726,
31,
589,
568,
433,
512,
26,
12038,
1797,
2495,
19,
51,
669,
9,
14,
1513,
25,
433,
512,
25,
741,
865,
16,
85,
35,
14,
454,
13,
1409,
27313... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Thumbnail generation with Ghostscript rotates my device size definition for landscape pdf pages
===
I want to use GS to generate thumbnails from pdf files.
- The thumbnail must fit a 90x120 pixel rectangle
- The image should not be rotated
- The image should be resized to fit the rectangle with keeping aspect ratio
**I use the following command:**
gswin32 -dPDFFitPage -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT
-dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0
-dDEVICEWIDTH=90 -dDEVICEHEIGHT=120 -dORIENT1=true
-sDEVICE=jpeg -dTextAlphaBits=4 -dGraphicsAlphaBits=4
-sOutputFile=output.%d.jpg input.pdf
**Result:**
If I use some PDF with **portrait pages** [like this example][1], which you can download, then the thumbnail is correct, as you can see here:
![enter image description here][2]
If I use it [for a PDF][3] with **landscape pages, the devicewidth is taken as height** somehow:
![enter image description here][4]
How can I prevent this behaviour? I want my Porsche to be 90x120 as well. I think maybe i need to provide some Postscript code for Ghostscript (with -c command line argument), but I have no experience with that. Could someone please help me?
[1]: http://www.sendspace.com/file/2p66gw
[2]: http://i.stack.imgur.com/vNz5B.jpg
[3]: http://www.sendspace.com/file/ht7ily
[4]: http://i.stack.imgur.com/16MFV.jpg | 0 | [
2,
5078,
325,
947,
2782,
29,
3995,
8741,
21448,
18,
51,
3646,
1072,
5465,
26,
4453,
13,
11124,
4434,
800,
3726,
3726,
31,
259,
20,
275,
489,
18,
20,
7920,
5078,
325,
947,
18,
37,
13,
11124,
6488,
9,
13,
8,
14,
5078,
325,
947,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extracting data from NSF database file - Domino
===
I have an nsf database file from a domino web application based on Lotus Domino version 6.5.
Any ideas on how I can extract the data? The data contains word,pdf and html documents.
Thanks | 0 | [
2,
10962,
68,
1054,
37,
13,
2172,
410,
6018,
3893,
13,
8,
23320,
800,
3726,
3726,
31,
57,
40,
13,
2172,
410,
6018,
3893,
37,
21,
23320,
2741,
3010,
432,
27,
15175,
23320,
615,
400,
9,
264,
9,
186,
3478,
27,
184,
31,
92,
10962,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Passing variables from one class to another wiithout using the intent get extra
===
I'm doing some android code today and now the problem is I need to get the variables passed. The scene is that I need to login first to facebook then fetch my information. afterwards here comes a splash screen where it will display my name, etc info using the intent. afterwards the main screen will now appear and all of the data from the splash screen will now be passed to the main screen using also an intent but the problem is that this main screen is just a container for my tabViews wherein I can navigate anytime from one page to another and I think there is no need for me to use the intent again in this part. Now I need to get all the passed data from which is passed to the main screen down to one of my tab and display it on a TextView. | 0 | [
2,
2848,
12157,
37,
53,
718,
20,
226,
18238,
96,
1320,
568,
14,
6936,
164,
2230,
800,
3726,
3726,
31,
22,
79,
845,
109,
13005,
1797,
786,
17,
130,
14,
1448,
25,
31,
376,
20,
164,
14,
12157,
1100,
9,
14,
1691,
25,
30,
31,
376,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
error with modifying the project file with console application
===
I am using the following code snippet in a console application to modify the project files of mvc project to add new assembly reference.
var newReference = @"System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL";
var profiles = Directory.GetFiles(path, "*.csproj", SearchOption.AllDirectories);
var ns = XNamespace.Get("http://schemas.microsoft.com/developer/msbuild/2003");
foreach (var profile in profiles)
{
var doc = XDocument.Load(profile);
var parentElement = doc.Descendants(ns + "ItemGroup").FirstOrDefault();
if (parentElement != null)
{
var newNode = new XElement("Reference", new XAttribute("Include", newReference));
parentElement.Add(newNode);
}
doc.Save(profile);
}
its modifying the project file successfully, but the project is not getting loaded in visual studio, showing error "Unable to read the project file 'MvcSampleApplication_2010.csproj'. The element <Reference> beneath element <ItemGroup> may not have a custom XML namespace."
i checked the project file with edit option, its modified as
<Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL xmlns="">
i.e. xmlns="" is added extra. how to avoid this error?
| 0 | [
2,
7019,
29,
17579,
68,
14,
669,
3893,
29,
8650,
3010,
800,
3726,
3726,
31,
589,
568,
14,
249,
1797,
13,
29061,
19,
21,
8650,
3010,
20,
17579,
14,
669,
6488,
16,
307,
8990,
669,
20,
3547,
78,
1475,
2801,
9,
4033,
78,
28018,
800,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Print jvm property name if property not found in property file
===
JVM properties `app.property` is set in IBM Websphere. This is a property file having properties.
How can I print `app.property` if I got null while getting any property
findNonNullableProperty(String aPropertyName){
properties.getProperty(aPropertyName);
//print app.property here. There may be more than one JVM properties
}
from this property file. | 0 | [
2,
4793,
487,
20147,
1354,
204,
100,
1354,
52,
216,
19,
1354,
3893,
800,
3726,
3726,
487,
20147,
3704,
13,
1,
7753,
9,
10890,
106,
1084,
1,
25,
309,
19,
10233,
2741,
14079,
9,
48,
25,
21,
1354,
3893,
452,
3704,
9,
184,
92,
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... |
drawing line graph with primary and secondary y axis c#
===
I have been researching ways of drawing charts in c#. I have a specific requirement of drawing a chart with a y axis and x axis and a seconday y axis.I have tried using excel Interop but have not found a solution.I have started working on MSChart component but not reached anything yet the data i am working with is
index lines branches
1 20 5,
2 30 8,
3 34 6,
i want to plot the indexies on the x-axis and scale for lines on the left y axis and a scale for branches on the right y axis.
I am using .net versions 2.0 and 3.5 if that helps | 0 | [
2,
3533,
293,
7210,
29,
1256,
17,
2277,
13,
93,
8577,
272,
5910,
800,
3726,
3726,
31,
57,
74,
527,
68,
2847,
16,
3533,
5158,
19,
272,
5910,
9,
31,
57,
21,
1903,
8981,
16,
3533,
21,
1795,
29,
21,
13,
93,
8577,
17,
993,
8577,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 match an image within a bigger image with Html5 canvas and javascript?
===
[IM.js][1] seems to be a relevant library for my purposes, is it possible to use IM.js for finding a smaller image within a bigger image? It only has compare functions but shouldn't it be possible to use it exactly to pixel by pixel discover the position of an image within a bigger image?
Essentially a template matching in html5 canvas and curious to know if it's possible with IM.js or any other libraries out there? I found a similar question at http://stackoverflow.com/questions/9136524/are-there-any-javascript-libs-to-pixel-compare-images-using-html5-canvas-or-any but the answers there are not complete, what is IM.js doing that makes pixel by pixel matching so fast?
I also discovered that [face recognition is possible with jquery][2]! There must be a way to do a simple image template matching as well.
[1]: http://tcorral.github.com/IM.js/
[2]: http://facedetection.jaysalvat.com/ | 0 | [
2,
184,
20,
730,
40,
1961,
363,
21,
6197,
1961,
29,
13,
15895,
264,
9696,
17,
8247,
8741,
60,
800,
3726,
3726,
636,
1660,
9,
728,
18,
500,
2558,
165,
500,
2206,
20,
44,
21,
7480,
1248,
26,
51,
4612,
15,
25,
32,
938,
20,
275,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 OpenGL mag filter on GL_NEAREST, small texture still blurry
===
I am using a power of two sized texture (128x128) and I am drawing small portions of it onto polygons. I have set the following:
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_NEAREST);
gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MAG_FILTER, GL10.GL_NEAREST);
However the result is a texture that is still blurred together. It looks like it's using GL_LINEAR instead.
Any ideas why the texture would still be coming out blurry instead of pixelated? | 0 | [
2,
13005,
368,
8430,
4723,
11945,
27,
13,
8430,
1,
14114,
1430,
15,
284,
12714,
174,
10330,
622,
800,
3726,
3726,
31,
589,
568,
21,
414,
16,
81,
13,
6560,
12714,
13,
5,
22545,
396,
22545,
6,
17,
31,
589,
3533,
284,
9125,
16,
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... |
creating window.customizedobject?
===
I found out that some js sources uses its own customized objects.
For example, Jquery uses $, and android can use javascript interface.
So... what I wonder is how can I make my customized object? what do I need to add
my customized object to window object? (like window.myCustomizedObject)
thanks in advance. | 0 | [
2,
2936,
1463,
9,
4636,
6015,
1333,
23793,
60,
800,
3726,
3726,
31,
216,
70,
30,
109,
487,
18,
2662,
2027,
82,
258,
28779,
3916,
9,
26,
823,
15,
487,
8190,
93,
2027,
5579,
15,
17,
13005,
92,
275,
8247,
8741,
6573,
9,
86,
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... |
Kohana 3.2 AJAX form token keeps chaning
===
I want to use a token in my ajax form. The form is loaded from an ajax controller that generates a unique token. Then the form posts to the same controller.
But I cant get it right! When the form is loaded and then posted, the session is empty or a new token is created! This is I guess because the form and token are created when the ajax call is made.
Here is what I did :
I placed the create the token function at before() in the ajax controller , everytime ajax loads the page it creates a new token which will never validate because it is always changing.
So then I moved the token function to the main controller and it creates the token there, the ajax controller does not extend the main controller, its separate. because I thought now the ajax call wont load the token function. Instead the ajax controller will just get the token created at main. but......its empty
I tried Session::instance()->get('securitytoken') It is supposed to access all sessions across the application right?
Does any one know how I can get this right? or why I cant access a session created in another controller?
This test function gets the token through ajax
class Controller_Ajax extends Controller_Temp{
public function action_test(){
$user2 = Session::instance()->get('securitytoken');
echo $user2; }
}
In my Main controller :
$token = md5(uniqid(microtime(), true));
Session::instance()->set('securitytoken', $token);
Thank you
| 0 | [
2,
1584,
7285,
203,
9,
135,
20624,
505,
20,
2853,
8968,
6122,
68,
800,
3726,
3726,
31,
259,
20,
275,
21,
20,
2853,
19,
51,
20624,
505,
9,
14,
505,
25,
8572,
37,
40,
20624,
9919,
30,
7920,
18,
21,
2619,
20,
2853,
9,
94,
14,
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... |
CoreData rename relationship in mapping model
===
I have this coredata model in two different versions. All I changed is the name of a relationship.
But it seems insanely impossible to rename it using a simple mapping model!
Lets say I have the entity Foo and Bar, and a to-many relationship from Foo to Bar called "mane" and a reverse relationship from Bar to Foo called "padme". I want to change "padme" to "hum".
In the **mapping model inspector** I have:
Key Path: $source.padme
Mapping Name: FooToFoo
In the **relationship mappings** I have:
Destination Relationship: hum
Value expression:
FUNCTION(
$manager,
"destinationInstancesForEntityMappingNamed:sourceInstances:" ,
"FooToFoo",
$source.padme
)
Any thoughts?
Thanks! | 0 | [
2,
2884,
18768,
302,
7259,
1429,
19,
13305,
1061,
800,
3726,
3726,
31,
57,
48,
2884,
18768,
1061,
19,
81,
421,
3281,
9,
65,
31,
1015,
25,
14,
204,
16,
21,
1429,
9,
47,
32,
2206,
9405,
102,
3992,
20,
302,
7259,
32,
568,
21,
193... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Parsing XML with Ruby
===
I'm way new to working with XML but just had a need dropped in my lap. I have been given an usual (to me) XML format. There are colons within the tags.
<THING1:things>type="Container">
<PART1:Id type="Property">1234</PART1:Id>
<PART1:Name type="Property">The Name</PART1:Name>
</THING1:things>
It is a large file and there is much more to it than this but I hope this format will be familiar to someone. Does anyone know a way to approach an XML document of this sort?
I'd rather not just write a brute-force way of parsing the text but I can't seem to make any headway with REXML or Hpricot and I suspect it is due to these unusual tags. | 0 | [
2,
2017,
18,
68,
23504,
29,
10811,
800,
3726,
3726,
31,
22,
79,
161,
78,
20,
638,
29,
23504,
47,
114,
41,
21,
376,
1539,
19,
51,
2630,
9,
31,
57,
74,
504,
40,
3820,
13,
5,
262,
55,
6,
23504,
2595,
9,
80,
50,
10766,
18,
363... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 use a SMS Gateway
===
I need to put in my android applicazion a tool that uses the free service for sending free sms through internet...
I saw that many apps are able to integrate these sevices..
I tried a lot but I have not found anything useful..
So I ask you ... how can I use the gateway of `uthsms.net` (for example) for send SMS with my Android application?
Sorry for the generic question..but I not found any starting point for resolve this question.
Thanks in advance | 0 | [
2,
13005,
275,
21,
7613,
18,
12171,
800,
3726,
3726,
31,
376,
20,
442,
19,
51,
13005,
4865,
16904,
11196,
21,
5607,
30,
2027,
14,
551,
365,
26,
4907,
551,
7613,
18,
120,
2620,
9,
9,
9,
31,
441,
30,
151,
4865,
18,
50,
777,
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 expect an exception and still pass the test?
===
I have this:
Expect.Once.On( someObj ).Method( "SomeMethod" )
.With(1) // correct value is 2, I want this to fail
.Will( Throw.Exception( new Exception() ) );
An exception is thrown by nmock when it detects that I put 1 instead of 2. However, the test is failing (red) instead of passing. How to make this test pass, even though I'm expecting an exception? | 0 | [
2,
184,
20,
4186,
40,
5391,
17,
174,
1477,
14,
1289,
60,
800,
3726,
3726,
31,
57,
48,
45,
4186,
9,
13120,
9,
218,
5,
109,
111,
11741,
13,
6,
9,
5909,
1807,
43,
5,
13,
7,
3220,
5909,
1807,
43,
7,
13,
6,
13,
9,
1410,
5,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MSBuild task with AfterTargets to encrypt web.config after transform
===
I'm new to MSBuild and I'm trying to set up a single MSBuildSettings.xml file in my project, called via the "Post-build event command line" option in the Project Preferences, that does 3 particular tasks.
$(MSBuildBinPath)\msbuild.exe "$(ProjectDir)MSBuild\MSBuildSettings.xml"
The MSBuildSettings does 3 particular tasks. My first 2 tasks ("YUI" and "LESS", below) are working perfectly. The new task I'm trying to add ("Encrypt") is to encrypt the web.config AFTER transformation has occurred.
I'm using a single xml file structured as follows:
<Project DefaultTargets="YUI;LESS;Encrypt;">
...
<Target Name="YUI">...</Target>
<Target Name="LESS" DependsOnTargets="YUI">...</Target>
<Target Name="Encrypt" AfterTargets="TransformWebConfigCore">
<Exec Command="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -pef "connectionStrings" $(MSBuildProjectDirectory)\..\obj\Release\Package\PackageTmp -prov "MyProtectedDataProvider"" />
</Target>
</Project
I've basically trying to encrypt the connectionStrings section using the aspnet_regiis via commandline. (I also have my own Provider defined and working.) I do find it a little strange that I'm trying to modify the web.config in the PackageTmp folder, but as far as I can tell that's the final location before the transformed web.config is deployed (I obviously don't want to update the original web.config file in the project). I don't think there's anything wrong with the command/execution so much as it is the timing of it. I simply can't figure out how to make this third step execute only AFTER transformation has occurred.
I've enabled the Detail view option of the build output as well as dug through the Microsoft.Web.Publishing.targets file trying to come up with a target that I can use as to only invoke my web.config encryption step AFTER the transformation has occurred, but regardless of what AfterTargets I try, I seem to always get:
The target "whatever" does not exist in the project.
I've tried PipelinePreDeployCopyAllFilesToOneFolder, TransformWebConfig, PipelineTransformPhase, CopyAllFilesToSingleFolderForPackage, etc..
Additional notes: I understand that the web.config is only transformed upon Publish (and I am publishing using the File System option).
Also this is plain MSBuild (no TFS team build or anything like that).
Any additional or alternative options on a post-transform step to encrypt sections of the web.config would also be greatly appreciated.
| 0 | [
2,
4235,
29361,
3005,
29,
75,
3958,
3060,
18,
20,
1957,
11435,
2741,
9,
14093,
2816,
75,
8007,
800,
3726,
3726,
31,
22,
79,
78,
20,
4235,
29361,
17,
31,
22,
79,
749,
20,
309,
71,
21,
345,
4235,
29361,
19831,
18,
9,
396,
8184,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Change IP Address using Visual Basic
===
How can you change your IP Address using visual basic please? I havnt been able to find anything useful anywhere so i was just wondering if I could get some help on here?
Thanks
Chris | 0 | [
2,
753,
15735,
3218,
568,
3458,
2125,
800,
3726,
3726,
184,
92,
42,
753,
154,
15735,
3218,
568,
3458,
2125,
2247,
60,
31,
13,
28507,
38,
74,
777,
20,
477,
602,
4811,
4922,
86,
31,
23,
114,
5712,
100,
31,
110,
164,
109,
448,
27,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
how to write install script for my website that configures virtual hosts, sets up a database etc on apache2, mysql, debian
===
How to write install script for my website that configures virtual hosts, sets up a database etc on apache2, mysql, & debian?
I see a lot of tutorials about how to set these environments up but nothing about automating the process. I basically want to write an install script that:
- Goes checks all the products the solution needs are there, if not downloads and installs them with a basic configuration.
- Gets the appropriate version of the software from a git repo builds it then installs it on the website
- Makes final adjustments to the site like permissions links to make sites-enabled etc.
Is there a tool that will help me do this? or a tutorial somewhere that will help me tick all the boxes?
Is there a best practice or book of knowledge I can read on the subject of *nix website deployment? | 2 | [
2,
184,
20,
2757,
16146,
3884,
26,
51,
2271,
30,
1065,
15951,
18,
6599,
5397,
15,
3415,
71,
21,
6018,
2722,
27,
17140,
135,
15,
51,
18,
22402,
15,
121,
10035,
800,
3726,
3726,
184,
20,
2757,
16146,
3884,
26,
51,
2271,
30,
1065,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 know which host are trying to connect to mysql server
===
I need some utility which monitors which host are trying to connect my mysql server. Bascially i want all details of the users/host which are connected to mysql server OR even attempted to connect.
Thanks | 2 | [
2,
184,
20,
143,
56,
2015,
50,
749,
20,
6379,
20,
51,
18,
22402,
8128,
800,
3726,
3726,
31,
376,
109,
10082,
56,
18521,
56,
2015,
50,
749,
20,
6379,
51,
51,
18,
22402,
8128,
9,
5952,
1892,
1326,
31,
259,
65,
3289,
16,
14,
3878... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to configure my server for socket
===
on local machine this code working but when i use for other machine it does not work.
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
IPEndPoint localendpoint = new IPEndPoint(IPAddress.Parse("192.168.254.55"), 1234);
socket.Connect(localendpoint);
my server side:
socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socket.Bind(new IPEndPoint(IPAddress.Parse("192.168.254.55"),1234));
socket.Listen(100);
Socket acepted = socket.Accept();
my other machine IP is 192.168.0.102 how to configure that is located in other place ?
| 0 | [
2,
184,
20,
1065,
15951,
51,
8128,
26,
18482,
800,
3726,
3726,
27,
375,
1940,
48,
1797,
638,
47,
76,
31,
275,
26,
89,
1940,
32,
630,
52,
170,
9,
18482,
800,
78,
18482,
5,
27950,
13819,
9,
6280,
24106,
15,
18482,
4474,
9,
11260,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 compress response in Webservices in C#?
===
I am want to compress the response of a webmethod call. This compressed data should be decompressed by different mobile platform like iPhone, Android, Windows Phone 7 and Blackberry. I have checked different solution but did not find any proper solution. Actually we have a webmethod which gives data of around 20,000 records (which is in size around 2 MB). And we would like to to compress data to transfer over HTTP.
Can anyone help me out? Thanks in advance.
| 0 | [
2,
184,
20,
26060,
1627,
19,
2741,
11449,
18,
19,
272,
5910,
60,
800,
3726,
3726,
31,
589,
259,
20,
26060,
14,
1627,
16,
21,
2741,
5909,
1807,
43,
645,
9,
48,
18472,
1054,
378,
44,
121,
960,
5890,
69,
34,
421,
3241,
2452,
101,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 get name of the application from the external class?
===
I have library project which referred by many applications. Now I got a new requirement in which I need to change the function in this library project. I need to pass a variable to my web service depending on by which application this function has been called. So need to know the name of the current application in that library project. I know I can do it by passing Context but I am looking for the option without passing Context. Because otherwise I dont know how many applications I will have to change.
| 0 | [
2,
25,
32,
938,
20,
164,
204,
16,
14,
3010,
37,
14,
4886,
718,
60,
800,
3726,
3726,
31,
57,
1248,
669,
56,
1870,
34,
151,
3767,
9,
130,
31,
330,
21,
78,
8981,
19,
56,
31,
376,
20,
753,
14,
1990,
19,
48,
1248,
669,
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... |
Make final a variable in a given moment (after initialization and eventual code)
===
Is that possible?
I would like to decide when its immutable, not just after first assignment | 0 | [
2,
233,
426,
21,
7612,
19,
21,
504,
688,
13,
5,
5162,
2104,
1829,
17,
9314,
1797,
6,
800,
3726,
3726,
25,
30,
938,
60,
31,
83,
101,
20,
4073,
76,
82,
797,
7903,
579,
15,
52,
114,
75,
64,
8427,
3,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
File upload in CouchDB using couch.js and jquery.form.js
===
I am trying to develop a CouchApp. I know how to create and save docs using the couch.js API. But my question is how do I upload attachment using the couch.js and the jquery form plugin | 0 | [
2,
3893,
71,
8294,
19,
4914,
9007,
568,
4914,
9,
728,
18,
17,
487,
8190,
93,
9,
4190,
9,
728,
18,
800,
3726,
3726,
31,
589,
749,
20,
2803,
21,
4914,
7753,
9,
31,
143,
184,
20,
1600,
17,
2079,
9765,
18,
568,
14,
4914,
9,
728,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
scroll bar not visible in jquery tabs
===
First up, I know this question is probably asked several times, but everyone's layout is different!
I have a mapping application and with a left side tool bar. This tool bar has jquery tabs. I cant get a scroll bar on these tabs. even after overloading `.ui-tabs-panel`. I know just by adding a `height:somepx` here gives me scroll bars, but thats not what i want. I want the height to be always till all the way down. I have tried several things but nothing works :(
I suspect its because of my other layout properties which are there to keep the layout liquid (make map adjust to screen sizes and keep left side bar constant).
Here is the stripped down version in Jsbin:
[http://jsbin.com/exeguw/edit#source][1]
Can some one please help me get the vertical scroll bar?
Thanks!
[1]: http://jsbin.com/exeguw/edit#source | 0 | [
2,
12159,
748,
52,
4560,
19,
487,
8190,
93,
6523,
18,
800,
3726,
3726,
64,
71,
15,
31,
143,
48,
1301,
25,
910,
411,
238,
436,
15,
47,
1266,
22,
18,
9106,
25,
421,
187,
31,
57,
21,
13305,
3010,
17,
29,
21,
225,
270,
5607,
748... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
EF query to select available association entities
===
I am sure I could google this if I knew what to search for, if that makes sense.
I'm trying to get the hang of entity framwork, and considering how i would implement some real-world scenarios in it.
Imagine a simple data model with a Person entity, and a Color entity, and an association called ColorsLiked.
I want to use Color a bit like an enum; there will only be 3 defined (red, green, blue).
I want a drop-down to allow the used to add Colors to their list of colors they like - which is all easy enough. But, what query can I use to select only the colors the person doesn't already like? i.e so that as they pick a color, it is no longer available for selection in the list.
In SQL, it's a simple query with a left outer join. But I don't understand how to do something like this in EF.
any guidance would be appreciated
slip | 0 | [
2,
11599,
25597,
20,
5407,
904,
607,
12549,
800,
3726,
3726,
31,
589,
562,
31,
110,
8144,
48,
100,
31,
404,
98,
20,
2122,
26,
15,
100,
30,
1364,
1259,
9,
31,
22,
79,
749,
20,
164,
14,
4546,
16,
9252,
8345,
79,
3783,
15,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using a DatePart inside a switch case statement
===
I'm a beginner to SQL making a stored procedure with the goal of taking a specified time range and interval, and returning data within that time range grouped by the interval. For example, an input of a two week time range and 2 day interval will give 7 data points of performance.
In order to make the groupings I'm using a switch case for the interval unit and datepart to extract it for grouping. However, my procedure won't compile. Here is my code:
declare @interval int
declare @unit varchar(6)
set @interval=1
set @unit='year'
select
case @unit
when 'year' then datepart(year, CreateDate)/@interval*@interval
when 'month' then datepart(month, CreateDate)/@interval*@interval
when 'week' then datepart(week, CreateDate)/@interval*@interval
when 'day' then datepart(day, CreateDate)/@interval*@interval
when 'hour' then datepart(hour, CreateDate)/@interval*@interval
when 'minute' then datepart(minute, CreateDate)/@interval*@interval
when 'second' then datepart(second, CreateDate)/@interval*@interval
end
from OrderInfoCustom
group by
case @unit
when 'year' then datepart(year, CreateDate)/@interval
when 'month' then datepart(month, CreateDate)/@interval
when 'week' then datepart(week, CreateDate)/@interval
when 'day' then datepart(day, CreateDate)/@interval
when 'hour' then datepart(hour, CreateDate)/@interval
when 'minute' then datepart(minute, CreateDate)/@interval
when 'second' then datepart(second, CreateDate)/@interval
end
This refuses to compile, giving this error (multiple times):
> Msg 8120, Level 16, State 1, Line 7 Column
> 'OrderInfoCustom.CreateDate' is invalid in the select list because it
> is not contained in either an aggregate function or the GROUP BY
> clause.
It seems the compiler does not recognize that CreateDate is part of the aggregate function, since it is within a switch-case? I'm not sure.
| 0 | [
2,
568,
21,
1231,
3091,
572,
21,
5521,
610,
3331,
800,
3726,
3726,
31,
22,
79,
21,
26931,
20,
4444,
255,
544,
21,
8214,
7004,
29,
14,
1195,
16,
741,
21,
9931,
85,
978,
17,
14422,
15,
17,
2485,
1054,
363,
30,
85,
978,
19511,
34... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
bash script parameters problem
===
i can't figure out, where is the problem
if [ $# -eq 1 ]; then
if [ "$1"=="-h" ]; then
help
else
echo "bad parameter, if you put only one parameter, you can choose only -h"
fi
no matter what i give it as first parameter, script never gets to the else part and every time it is displaying help | 0 | [
2,
13158,
3884,
12905,
1448,
800,
3726,
3726,
31,
92,
22,
38,
1465,
70,
15,
113,
25,
14,
1448,
100,
636,
5579,
5910,
13,
8,
18550,
137,
13,
12660,
94,
100,
636,
13,
7,
11019,
7,
3726,
3726,
7,
8,
252,
7,
13,
12660,
94,
448,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
In Rails, how can I only use validates_inclusion_of when the model is created, NOT every time it is updated?
===
I have an object, called Account, and there is a campaign source associated with every account. Currently, if the Account is updated, and there is no campaign source, you have to update the campaign source (the possible values of which are in a selectlist).
I know that validates_presence_of has an :on option, which allows you to specify :create, :update or :save, but validates_inclusion_of does not have this option, unfortunately. How can I get around this? Thanks.
Here is my code:
class Account < ActiveRecord::Base
validates_inclusion_of :campaign_source, :in => CampaignSource.list, :message => "^Please let us know how you heard about us"
| 0 | [
2,
19,
2240,
18,
15,
184,
92,
31,
104,
275,
7394,
7759,
1,
108,
10301,
5991,
1,
1041,
76,
14,
1061,
25,
679,
15,
52,
352,
85,
32,
25,
6372,
60,
800,
3726,
3726,
31,
57,
40,
3095,
15,
227,
2176,
15,
17,
80,
25,
21,
1150,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Check if current cursor position is on Excel Spreadsheet
===
I want to determine if my current mouse cursor position is on Excel Spreadsheet in C# or VC++.
I want to automate some click events on Excel Spreadsheet. Before that I want to make sure that my current cursor position is on excel spreadsheet.
Is there any solution for that? | 1 | [
2,
2631,
100,
866,
29588,
649,
25,
27,
20700,
1789,
17627,
800,
3726,
3726,
31,
259,
20,
3746,
100,
51,
866,
7567,
29588,
649,
25,
27,
20700,
1789,
17627,
19,
272,
5910,
54,
13,
8990,
20512,
9,
31,
259,
20,
3108,
5281,
109,
10840,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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# Vector3 non floating point?
===
Is it possible to change C#'s built-in Vector3 struct to not use floating point Singles and instead use ints or bytes for performance reasons? | 0 | [
2,
272,
5910,
7497,
240,
538,
8319,
454,
60,
800,
3726,
3726,
25,
32,
938,
20,
753,
272,
5910,
22,
18,
392,
8,
108,
7497,
240,
13,
10346,
20,
52,
275,
8319,
454,
2391,
17,
700,
275,
19,
38,
18,
54,
34,
3231,
26,
956,
2932,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
PHP compare date in mysql to sendmail
===
I am fairly new to php and mysql but I have created a small site that users log into and create tasks to be sent to specified email on certain days
The days are stored in the database as mon tue wed, etc.
The script is will send the information to all the emails in the database when the script is manually.
Using cron jobs I will schedule the script to run two times a day to send out each users data to their emails.
but I dont know how to tell the script to compare the days the users have specified in the database with the current day to see if it needs to send the email to the users email that day
Any help is appreciated.
Thanks | 0 | [
2,
13,
26120,
11590,
1231,
19,
51,
18,
22402,
20,
2660,
8079,
800,
3726,
3726,
31,
589,
6647,
78,
20,
13,
26120,
17,
51,
18,
22402,
47,
31,
57,
679,
21,
284,
689,
30,
3878,
6738,
77,
17,
1600,
8674,
20,
44,
795,
20,
9931,
8517... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jeditable addinputype with google-geocoder
===
I am trying to add my own input type to jeditable to edit address and validate them with google geocoder class
the problem is that geocodder is asynchronous and in "submitdata" it sends the result without waiting the geocoder to send the results so it is empty...
Thanks in advance for your help
My code is below
$.editable.addInputType('autoAddress', {
element : function(settings, original) {
var input = $('<input id="tempAddress" name="tempAddress" type="text">');
$(this).append(input);
return(input);
},
plugin : function(settings, original) {
var tempInput = document.getElementById('tempAddress');
var tempGoog = new google.maps.places.Autocomplete(tempInput);
},
});
$('.address').editable("edit_Address.php", {
type : "autoAddress",
"callback": function( sValue, y ) {
doing a few stuff);
},
"submitdata": function ( value, settings ) {
var geocoder = new google.maps.Geocoder();
var lat ="";
var lng ="";
value=$("input", this).val();
geocoder.geocode({ 'address': value }, function (results, status) {
if (status == google.maps.GeocoderStatus.OK ) {
lat=results[0].geometry.location.lat();
lng=results[0].geometry.location.lng();
alert ("geoCode"+lat+" "+lng);
} else {
alert("Geocoding failed modification: " + status);
}
});
alert ("return"+lat+" "+lng);
return {
"lat":lat,
"lng":lng,
};
},
"onblur" : "submit",
"height": "14px",
}); | 0 | [
2,
12671,
242,
579,
3547,
108,
4201,
4474,
29,
8144,
8,
834,
13707,
1157,
800,
3726,
3726,
31,
589,
749,
20,
3547,
51,
258,
6367,
1001,
20,
12671,
242,
579,
20,
9392,
3218,
17,
7394,
1373,
105,
29,
8144,
6389,
716,
1157,
718,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to catch exception in node.js?
===
I have a simple script and read-only database redis.
var redis = require('redis'),
client = redis.createClient(), multi
client.on('error', function(error) {
console.log('error')
})
tasks = []
tasks.push(['set', 'a', 1 ])
tasks.push(['set', 'b', 1 ])
client.multi(this.tasks).exec(function (err, replies) {
console.log(err)
tasks = []
tasks.push(['set', 'a', 1 ])
client.multi(tasks).exec(function (err, replies) {
console.log(err)
})
})
Result of this script:
null
null
/usr/local/lstat/lstat/node_modules/redis/index.js:468
throw callback_err;
^
Error: Error: Error: READONLY You can't write against a read only slave.
How to catch this exception ?
| 0 | [
2,
184,
20,
2949,
5391,
19,
15421,
9,
728,
18,
60,
800,
3726,
3726,
31,
57,
21,
1935,
3884,
17,
1302,
8,
4965,
6018,
402,
403,
9,
4033,
402,
403,
800,
4077,
5,
22,
99,
2906,
22,
6,
15,
6819,
800,
402,
403,
9,
14946,
9568,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Locking the jboss-cache nodes by MVCCLockManager
===
I'm trying to explicitly lock the jboss-cache node using MVCCLockManager but the test shows that the node does not become locked. Here is the code.
In the main thread:
MVCCLockManager lockManager;
InvocationContextContainer invocationContextContainer;
Cache<String, Object> jbBlockingCache;
private static final Fqn TESTNODE = Fqn.fromString("/testNode");
@Before
public void init() {
invocationContextContainer = new InvocationContextContainer();
invocationContextContainer.injectContextFactory(new MVCCContextFactory());
lockManager = new MVCCLockManager();
TransactionManager transactionManager = getTransactionManager();
lockManager.injectConfiguration(new Configuration());
lockManager.injectDependencies(null, null, transactionManager, invocationContextContainer);
lockManager.startLockManager();
Configuration config = new Configuration();
config.setTransactionManagerLookupClass(GenericTransactionManagerLookup.class.getName() );
config.setIsolationLevel(IsolationLevel.READ_COMMITTED);
config.setCacheMode(CacheMode.LOCAL);
config.setLockAcquisitionTimeout(15000);
jbBlockingCache = new DefaultCacheFactory().createCache(config);
jbBlockingCache.start();
}
@Test
public void TwoThreadTest2() {
try {
lockManager.lock(TESTNODE , LockType.WRITE, null);
System.out.println("Main thread - locked");
node.put("zzz", "test value");
System.out.println("Main thread - put");
node.remove("zzz");
System.out.println("Main thread - remove");
TestThread secondThread = new TestThread(jbBlockingCache, lockManager);
Thread t = new Thread(secondThread);
t.start();
Thread.sleep(5000);
lockManager.unlock(TESTNODE , null);
System.out.println("Main thread - unlocked");
Thread.sleep(500);
jbBlockingCache.stop();
jbBlockingCache.destroy();
} catch (Exception e) {
System.out.println("MAIN THREAD");
e.printStackTrace();
}
}
In the second thread:
public class TestThread implements Runnable {
private Cache<String, Object> cache;
MVCCLockManager lockManager;
private static final Fqn TESTNODE = Fqn.fromString("/testNode");
InvocationContextContainer invocationContextContainer;
public TestThread(Cache<String, Object> cache, MVCCLockManager lockManager) {
this.cache = cache;
this.lockManager = lockManager;
}
@Override
public void run() {
try {
Node<String, Object> node = cache.getNode(TESTNODE );
Object cachedavLue = node.get("zzz");
System.out.println("Second thread - read: " + cachedavLue);
System.out.println("Second thread is locked = " + lockManager.isLocked(TESTNODE));
lockManager.lock(TESTNODE , LockType.WRITE, null);
System.out.println("Second thread - locked");
node.put("zzz", "test value");
System.out.println("Second thread - put");
getTransactionManager().commit();
} catch (Exception e) {
System.out.println("SECOND THREAD");
e.printStackTrace();
}
}
}
The result I get is the the following:
Main thread - locked
Main thread - put
Main thread - remove
Second thread - read: null
Second thread is locked = true
Second thread - locked
Second thread - put`enter code here`
Main thread - unlocked
but the second thread writes to a node before it is unlocked by the first thread. The node is actually unlocked although `lockManager.isLocked(TESTNODE)) == true` in this moment.
Can, please, anyone tell me, what I'm doing wrong?
Thanks! | 0 | [
2,
17538,
14,
487,
10349,
18,
8,
793,
2569,
16272,
34,
307,
8990,
10790,
22256,
800,
3726,
3726,
31,
22,
79,
749,
20,
13108,
3991,
14,
487,
10349,
18,
8,
793,
2569,
15421,
568,
307,
8990,
10790,
22256,
47,
14,
1289,
1285,
30,
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... |
Local Coordinate to Geocentric
===
I've spent more than a week trying to research a solution for this and so far nothing.
Given an identity matrix as our starting position and orientation. Then using geotrans and the known lat, long, and height of the starting position I get an x,y,z geocentric coordinate. A normalized vector from the origin of (0,0,0) gives both the up and translation for the matrix. However, I need the forward and right so that I can pass a distance in meters from the origin into the transformation matrix and get a roughly accurate GCC. Do I have all of the inputs I need to calculate the right and forward?
Inputs<br>
Origin: 0, 0, 0<br>
Global: -1645380, -4885138, 3752889<br>
Up (Normalized): Global - Origin
Desired Outputs<br>
Right: ? ? ?<br>
Forward: ? ? ?<br>
| 0 | [
2,
375,
15154,
20,
6389,
20829,
800,
3726,
3726,
31,
22,
195,
1111,
91,
119,
21,
877,
749,
20,
527,
21,
4295,
26,
48,
17,
86,
463,
626,
9,
504,
40,
3270,
8187,
28,
318,
1422,
649,
17,
10245,
9,
94,
568,
6389,
7028,
17,
14,
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... |
File upload module for ZF2
===
I would like to integrate a file upload feature to an application coded with `ZF2`. I have found some material on the internet ([link1][1], [link2][2]) but every time the file upload is handled via a form within the current controller.
In my application, there are many controllers from which users can upload files, and I also do quite a bit of processing on every uploaded file (*e.g. authorization, creation of thumbails, gathering of information such as file size, image dimension, number of pages in document...*) and I would therefore like to centralize the code related to the uploading of files in one place.
I was thinking I could render file upload forms from different controllers, but have the `form` `action` always pointing to the same `URL` (e.g. `/uploads`) and have my routing send those files to an `Uploads` module for instance. I have been unsuccessfully looking for `ZF2` file upload modules on `google` and the [`ZF2 modules site`][3] so I'm thinking this may not be a very good idea, hence my question:
**What would be the limitations (*what useful features wouldn't I be able to use*) of generating the file upload form in one controller, and handling the uploading of files in a controller of a separate module?**
[1]: http://www.deanclatworthy.com/2012/07/unique-filenames-when-uploading-using-zend_filter_file_rename-zend-framework/
[2]: http://www.fgsoft.se/blog/26-upload-file-using-zend-framework
[3]: http://modules.zendframework.com/ | 0 | [
2,
3893,
71,
8294,
12613,
26,
2052,
410,
135,
800,
3726,
3726,
31,
83,
101,
20,
18399,
21,
3893,
71,
8294,
1580,
20,
40,
3010,
13,
22254,
29,
13,
1,
380,
410,
135,
1,
9,
31,
57,
216,
109,
1492,
27,
14,
2620,
13,
5,
2558,
625... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Responsive navbar Twitter Bootstrap
===
I am having some issues with my bootstrap navbar in responsive mode.
The site is located at
www.newbridges.co.uk
When the Navbar is in full screen mode I can navigate to 'News' for example, dropdown menu one and then access the sub menu by hovering over 'Ty Newydd'. However when the navbar is in responsive mode, when clicking on news the first set of dropdowns appear but I cannot click to reveal the sub menu?
I have been advised that I need to make the changes in my media queries, I have tried following the DOM to select sub-menu and display as block and a width of 100% like the normal navbar in the media query but as im pretty new to this Im not sure if im selecting the correct selectors to make the changes.
can anyone help? It would be much appreciated. I would like to know what is going on here so i can learn for future reference
| 3 | [
2,
13,
22153,
16048,
1850,
10623,
5894,
16514,
800,
3726,
3726,
31,
589,
452,
109,
1549,
29,
51,
5894,
16514,
16048,
1850,
19,
13,
22153,
3740,
9,
14,
689,
25,
335,
35,
13,
6483,
9,
2681,
4547,
18,
9,
716,
9,
2185,
76,
14,
16048... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cant logout of website with c# webbrowser
===
I am trying to use c# webbrowser control to view mobile version of twitter. I have a button in my windoes form which is meant to log me out of the site but i cannot get it to work.
here is the immediate html code:
span class="w-button-common w-button"> input name="commit" type="submit" value="Sign out" /
i have tried:
**webBrowser1.Document.Forms[0].InvokeMember("submit");**
but there are a few buttons with type="submit" on the page.
How do i get it to click the right one?
if you would like me to provide the full source of the page then please ask :) | 0 | [
2,
2973,
6738,
1320,
16,
2271,
29,
272,
5910,
10192,
5417,
4104,
800,
3726,
3726,
31,
589,
749,
20,
275,
272,
5910,
10192,
5417,
4104,
569,
20,
1418,
3241,
615,
16,
10623,
9,
31,
57,
21,
5167,
19,
51,
628,
10739,
505,
56,
25,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java project can't find file
===
I have a project that finds a text file and makes it into an array of characters. However, for some reason or another it isn't finding the file. This is all the code involving opening/reading the file:
public void initialize(){
try{
File file = new File(getClass().getResource("/worlds/world1.txt").toString());
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new FileInputStream(file),
Charset.forName("UTF-8")));
int c;
for(int i = 0; (c = reader.read()) != -1; i ++) {
for(int x = 0; x < 20; x++){
worlds[1][x][i] = (char) c;
c = reader.read();
}
}
}catch(IOException e){
e.printStackTrace();
}
}
When ran, it shows in the console that it is pointing to the correct file, but claims nothing exists there. I've checked, and the file is completely intact and in existence. What could be going wrong here? | 0 | [
2,
8247,
669,
92,
22,
38,
477,
3893,
800,
3726,
3726,
31,
57,
21,
669,
30,
3797,
21,
1854,
3893,
17,
1364,
32,
77,
40,
7718,
16,
1766,
9,
207,
15,
26,
109,
1215,
54,
226,
32,
2532,
22,
38,
3007,
14,
3893,
9,
48,
25,
65,
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... |
Is there a platform-independent way to programmatically remove a file from a zip / jar?
===
Hopefully without having to unpack and repack the archive. | 0 | [
2,
25,
80,
21,
2452,
8,
17390,
161,
20,
625,
6732,
1326,
4681,
21,
3893,
37,
21,
12133,
13,
118,
5112,
60,
800,
3726,
3726,
13416,
366,
452,
20,
367,
8573,
17,
302,
8573,
14,
9250,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to create editable table in JSF page
===
I'm trying to create JSF editable table for displaying account data and also to edit the data. But it turns out that this is not easy task. Some of the buttons are not working. I need help to solve the problem. This is the complete code:
import javax.inject.Named;
import javax.sql.DataSource;
import javax.annotation.Resource;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.persistence.criteria.Order;
import org.DX_57.osgi.CL_27.api.CryptoSHA;
import org.glassfish.osgicdi.OSGiService;
@Named("AccountProfileController")
@ViewScoped
public class AccountProfile implements Serializable
{
@Resource(name = "jdbc/Oracle")
private DataSource ds;
private int id;
// Flag for table edit
public boolean editable = false;
// Create List to store user data
public ArrayList<userdata> dataList = new ArrayList<>();
// Constructor
public AccountProfile()
{
// get the ID value
try
{
this.id = Integer.parseInt((String) FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("id"));
}
catch (Exception e)
{
this.id = 0;
}
}
// Get the editable flag
public boolean isEditable()
{
return editable;
}
public void editAccount(boolean flag)
{
// Set the editable flag to true
editable = flag;
}
public class userdata
{
int userid;
int groupid;
String specialnumber;
String username;
String passwd;
Date datetochangepasswd;
String address;
String stateregion;
String country;
String userstatus;
String telephone;
Date dateuseradded;
Date userexpiredate;
Date dateuserlocked;
String city;
String email;
String description;
public userdata(int userid, int groupid, String specialnumber, String username, String passwd, Date datetochangepasswd,
String address, String stateregion, String country, String userstatus, String telephone, Date dateuseradded,
Date userexpiredate, Date dateuserlocked, String city, String email, String description)
{
this.userid = userid;
this.groupid = groupid;
this.specialnumber = specialnumber;
this.username = username;
this.passwd = passwd;
this.datetochangepasswd = datetochangepasswd;
this.address = address;
this.stateregion = stateregion;
this.country = country;
this.userstatus = userstatus;
this.telephone = telephone;
this.dateuseradded = dateuseradded;
this.userexpiredate = userexpiredate;
this.dateuserlocked = dateuserlocked;
this.city = city;
this.email = email;
this.description = description;
}
public String getAddress()
{
return address;
}
public void setAddress(String address)
{
this.address = address;
}
public String getCity()
{
return city;
}
public void setCity(String city)
{
this.city = city;
}
public String getCountry()
{
return country;
}
public void setCountry(String country)
{
this.country = country;
}
public Date getDatetochangepasswd()
{
return datetochangepasswd;
}
public void setDatetochangepasswd(Date datetochangepasswd)
{
this.datetochangepasswd = datetochangepasswd;
}
public Date getDateuseradded()
{
return dateuseradded;
}
public void setDateuseradded(Date dateuseradded)
{
this.dateuseradded = dateuseradded;
}
public Date getDateuserlocked()
{
return dateuserlocked;
}
public void setDateuserlocked(Date dateuserlocked)
{
this.dateuserlocked = dateuserlocked;
}
public String getDescription()
{
return description;
}
public void setDescription(String description)
{
this.description = description;
}
public String getEmail()
{
return email;
}
public void setEmail(String email)
{
this.email = email;
}
public int getGroupid()
{
return groupid;
}
public void setGroupid(int groupid)
{
this.groupid = groupid;
}
public String getPasswd()
{
return passwd;
}
public void setPasswd(String passwd)
{
this.passwd = passwd;
}
public String getSpecialnumber()
{
return specialnumber;
}
public void setSpecialnumber(String specialnumber)
{
this.specialnumber = specialnumber;
}
public String getStateregion()
{
return stateregion;
}
public void setStateregion(String stateregion)
{
this.stateregion = stateregion;
}
public String getTelephone()
{
return telephone;
}
public void setTelephone(String telephone)
{
this.telephone = telephone;
}
public Date getUserexpiredate()
{
return userexpiredate;
}
public void setUserexpiredate(Date userexpiredate)
{
this.userexpiredate = userexpiredate;
}
public int getUserid()
{
return userid;
}
public void setUserid(int userid)
{
this.userid = userid;
}
public String getUsername()
{
return username;
}
public void setUsername(String username)
{
this.username = username;
}
public String getUserstatus()
{
return userstatus;
}
public void setUserstatus(String userstatus)
{
this.userstatus = userstatus;
}
}
// Getter for the data list
public ArrayList<userdata> getuserdata()
{
return dataList;
}
@PostConstruct
public void initData() throws SQLException
{
// settingsMap = new HashMap<String, String>();
if (ds == null)
{
throw new SQLException("Can't get data source");
}
// Initialize a connection to Oracle
Connection conn = ds.getConnection();
if (conn == null)
{
throw new SQLException("Can't get database connection");
}
// With SQL statement get all settings and values
PreparedStatement ps = conn.prepareStatement("SELECT * from USERS where USERID = ?");
ps.setInt(1, id);
try
{
//get data from database
ResultSet result = ps.executeQuery();
while (result.next())
{
// Put the the data from Oracle into Array List
dataList.add(new userdata(result.getInt("USERID"),
result.getInt("GROUPID"),
result.getString("SPECIALNUMBER"),
result.getString("USERNAME"),
result.getString("PASSWD"),
toDate(result.getString("DATETOCHANGEPASSWD")),
result.getString("ADDRESS"),
result.getString("STATEREGION"),
result.getString("COUNTRY"),
result.getString("USERSTATUS"),
result.getString("TELEPHONE"),
toDate(result.getString("DATEUSERADDED")),
toDate(result.getString("USEREXPIREDATE")),
toDate(result.getString("DATEUSERLOCKED")),
result.getString("CITY"),
result.getString("EMAIL"),
result.getString("DESCRIPTION")));
}
}
finally
{
ps.close();
conn.close();
}
}
// Call Crypto library for password convert into SHA hash
@Inject
@OSGiService(dynamic = true, waitTimeout = 5)
transient CryptoSHA SHA;
// Convert Password String into SHA hash
public String passwdConvert(String password) throws NoSuchAlgorithmException
{
return SHA.ShaEncryptHash(password);
}
// Insert the data into Oracle
public void saveData() throws SQLException, java.text.ParseException, NoSuchAlgorithmException
{
String SqlStatement = null;
if (ds == null)
{
throw new SQLException();
}
Connection conn = ds.getConnection();
if (conn == null)
{
throw new SQLException();
}
PreparedStatement ps = null;
try
{
conn.setAutoCommit(false);
boolean committed = false;
try
{ /*
* insert into Oracle the default system(Linux) time
*/
SqlStatement = "UPDATE USERS "
+ "SET "
+ "USERID = ?, "
+ "GROUPID = ?, "
+ "SPECIALNUMBER = ?, "
+ "USERNAME = ?, "
+ "PASSWD = ?, "
+ "DATETOCHANGEPASSWD = ?, "
+ "ADDRESS = ?, "
+ "STATEREGION = ?, "
+ "COUNTRY = ?, "
+ "USERSTATUS = ?, "
+ "TELEPHONE = ?, "
+ "DATEUSERADDED = ?, "
+ "USEREXPIREDATE = ?, "
+ "DATEUSERLOCKED = ?, "
+ "CITY = ?, "
+ "EMAIL = ?, "
+ "DESCRIPTION = ? "
+ "WHERE USERID = " + id;
ps = conn.prepareStatement(SqlStatement);
for (userdata data : dataList)
{
ps.setInt(1, data.userid);
ps.setInt(2, data.groupid);
ps.setString(3, data.specialnumber);
ps.setString(4, data.username);
ps.setString(5, passwdConvert(data.passwd));
ps.setDate(6, (data.datetochangepasswd)); /// toDate
ps.setString(7, data.address);
ps.setString(8, data.stateregion);
ps.setString(9, data.country);
ps.setString(10, data.userstatus);
ps.setString(11, data.telephone);
ps.setDate(12, (data.dateuseradded)); ////toDate
ps.setDate(13, (data.userexpiredate)); ////toDate
ps.setDate(14, (data.dateuserlocked)); ////toDate
ps.setString(15, data.city);
ps.setString(16, data.email);
ps.setString(17, data.description);
}
ps.executeUpdate();
conn.commit();
committed = true;
}
finally
{
if (!committed)
{
conn.rollback();
}
}
}
finally
{
/*
* Release the resources
*/
ps.close();
conn.close();
}
}
//!!!! http://stackoverflow.com/questions/11135675/unparseable-date-30-jun-12
// Convert the Date format
public Date toDate(String s)
{
Date d = null;
if (s == null || s.trim().isEmpty())
{
return d;
}
try
{
d = Date.valueOf(s);
}
catch (Exception x)
{
x.printStackTrace();
}
return d;
}
}
This is the JSF page:
<div id="mainpage" style="margin: 0 auto; width:1190px; height:500px; position:absolute; background-color:transparent; top:80px">
<div id="settingsdiva" style="width:850px; height:500px; position:absolute; background-color:transparent; top:20px; left:20px">
<h:form>
<table>
<ui:repeat var="elem" value="#{AccountProfileController.userdata}">
<tr>
<td>User ID</td>
<td>
<h:outputText value="#{elem.userid}"
rendered="#{not AccountProfileController.editable}" />
<h:inputText value="#{elem.userid}" rendered="#{AccountProfileController.editable}" />
</td>
</tr>
<tr>
<td>Group ID</td>
<td>
<h:outputText value="#{elem.groupid}"
rendered="#{not AccountProfileController.editable}" />
<h:inputText value="#{elem.groupid}" rendered="#{AccountProfileController.editable}" />
</td>
</tr>
..........
<tr>
<td>Description</td>
<td>
<h:outputText value="#{elem.description}"
rendered="#{not AccountProfileController.editable}" />
<h:inputText value="#{elem.description}" rendered="#{AccountProfileController.editable}" />
</td>
</tr>
</ui:repeat>
</table>
<h:commandButton value=" Edit Account " rendered="#{not AccountProfileController.editable}" action="#{AccountProfileController.editAccount(true)}" >
<f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>
<h:commandButton value=" Save Account " rendered="#{AccountProfileController.editable}" action="#{AccountProfileController.saveData}" >
<f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>
<h:commandButton value=" Cancel " rendered="#{AccountProfileController.editable}" action="#{AccountProfileController.editAccount(false)}" >
<f:ajax render="@form" execute="@form"></f:ajax>
</h:commandButton>
</h:form>
</div>
<div id="settingsdivb" style="width:450px; height:500px; position:absolute; background-color:transparent; top:20px; left:600px">
</div>
<script type="text/javascript" src="resources/js/tabs.js"></script>
</div>
First I decided to create different JSF pages and managed beans to display the account data and to edit the data but it turns out that I can save resources if I do the task in one JSF page. The problem is that now the JSF becomes too complicated for new JSF developer like me. The `Edit Account` button is working but the buttons `Save Account` and `Clear` are not working. And also is there a way to optimize the code?
Best wishes
| 0 | [
2,
184,
20,
1600,
9392,
579,
859,
19,
487,
18,
410,
2478,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
487,
18,
410,
9392,
579,
859,
26,
17418,
2176,
1054,
17,
67,
20,
9392,
14,
1054,
9,
47,
32,
2844,
70,
30,
48,
25,
52,
2010... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Load a PHP script into div Same Window in JQuery
===
I have error : data not define.
I'd like to refresh content into <div id="comparateur2"> from a php script who print html
My parent page :
<body>
variables ...
<div id="comparateur2">
....
</div>
Javascript :
<script type="application/javascript">
$(document).ready(function(){
$("form").submit(function(e){
var format = $("#format").val();
var qtephotos = $("#qtephotos").val();
var option1 = $('input[name=option1]:checked', '#formulaire').val();
var offre = $('input[name=offre]:checked', '#formulaire').val();
var val = [];
$(':checkbox:checked').each(function(i){
val[i] = $(this).val();
});
var dataString = 'format='+ format + '&qtephotos=' + qtephotos + '&option1=' + option1 + '&valoption=' + val;
$.ajax ({
type: "POST",
url: "scripts/ajax_comparateur.php",
data: dataString,
success: function(){
$('#comparateur2').html(data);
}
});
});
});
</script>
Regards | 0 | [
2,
184,
6305,
21,
13,
26120,
3884,
77,
13,
12916,
205,
1463,
19,
487,
8190,
93,
800,
3726,
3726,
31,
57,
7019,
13,
45,
1054,
52,
9267,
9,
31,
22,
43,
101,
20,
24905,
2331,
77,
13,
1,
12916,
4924,
3726,
7,
18415,
5487,
911,
135... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Android App automation testing be done using selenium webdriver and C#?
===
Can Android App automation testing be done using selenium webdriver and C#?
I am learning android automation testing. And from the data available on internet, i have installed Android SDK and Eclipse. I am just curious to know whether i can do the same using C# coding instead of Java? And if Yes where can i find more details to start with it.
Thanks. | 0 | [
2,
92,
13005,
4865,
23217,
4431,
44,
677,
568,
23027,
14311,
2741,
21752,
17,
272,
5910,
60,
800,
3726,
3726,
92,
13005,
4865,
23217,
4431,
44,
677,
568,
23027,
14311,
2741,
21752,
17,
272,
5910,
60,
31,
589,
2477,
13005,
23217,
4431,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
navigation using longlistselector in wp7
===
I've created a longlistselector using mvvm patter. i've created many city names under different headers. i want to know how to navigate to a specific page when user selects or taps a particular item | 0 | [
2,
8368,
568,
175,
5739,
3434,
19932,
19,
13,
13790,
465,
800,
3726,
3726,
31,
22,
195,
679,
21,
175,
5739,
3434,
19932,
568,
17967,
20147,
2678,
815,
9,
31,
22,
195,
679,
151,
136,
1817,
131,
421,
157,
445,
9,
31,
259,
20,
143,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Currency Conversion Web Service
===
I'm running a .Net MVC application. In reporting areas of the application, there is often a need for currency conversion. Up until now it was only 2 currencies, so we populated a db table with rates and wrote our own methods for converting.
More and more currencies are cropping up however so it would be good to have a more automatic solution.
[WebServiceX][1] offer a solution that I think would fit, but as I've never used/heard of it before I wanted to get some user feedback. I know that it's a great service for something that's provided free of charge, but from experience, how reliable is it? Also, does anyone know if it is a daily rate that is used?
Any previous experience, or advice would be appreciated!
[1]: http://www.webservicex.net/ws/wsdetails.aspx?wsid=10 | 1 | [
2,
10507,
6263,
2741,
365,
800,
3726,
3726,
31,
22,
79,
946,
21,
13,
9,
2328,
307,
8990,
3010,
9,
19,
6670,
924,
16,
14,
3010,
15,
80,
25,
478,
21,
376,
26,
10507,
6263,
9,
71,
163,
130,
32,
23,
104,
172,
5087,
139,
22851,
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... |
Add a column to any position in a file in unix [using awk or sed]
===
I'm looking for other alternatives/more intelligent 1 liner for following command, which should add a value to a requested column number.
I tried following following sed command works properly for adding value 4 to the 4th column.
[Need: As i have such file which contains 1000 records & many times i need to add a column in between at any position.]
My approch is sutaible for smaller scale only.
`$ cat 1.txt
1|2|3|5
1|2|3|5
1|2|3|5
1|2|3|5`
`$ sed -i 's/1|2|3|/1|2|3|4|/g' 1.txt`
`$ cat 1.txt
1|2|3|4|5
1|2|3|4|5
1|2|3|4|5
1|2|3|4|5`
thansk in advance. | 0 | [
2,
3547,
21,
4698,
20,
186,
649,
19,
21,
3893,
19,
22540,
636,
12655,
13,
3885,
197,
54,
13924,
500,
800,
3726,
3726,
31,
22,
79,
699,
26,
89,
2676,
18,
118,
1995,
9214,
137,
12588,
26,
249,
1202,
15,
56,
378,
3547,
21,
1923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SetDate in textBox?
===
I create widgets for date for my project.
n using the same widget for setProperty and getProperty of a object.
public TextBox getTimeTxtbx() {
// TODO Auto-generated method stub
timebx =new TextBox();
timebx.setReadOnly(true);
final PopupPanel popupPanel=new PopupPanel(true);
final DatePicker datePicker=new DatePicker();
datePicker.addValueChangeHandler(new ValueChangeHandler<Date>() {
public void onValueChange(ValueChangeEvent<Date> event) {
// TODO Auto-generated method stub
Date date=event.getValue();
timebx.setText(DateTimeFormat.getFormat("EEE MMM dd HH:mm:ss z yyyy").format(date));
popupPanel.hide();
}
});
popupPanel.setWidget(datePicker);
timebx.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
// TODO Auto-generated method stub
String strDate = timebx.getText();
System.out.println(" strDate " +strDate);
DateTimeFormat format = DateTimeFormat.getFormat("[EEE MMM dd HH:mm:ss z yyyy]");
try {
Date selDate = (Date)format.parse(strDate);
datePicker.setValue(selDate, true);
} catch(Exception pe){
// setting current date
System.out.println("error" +pe);
datePicker.setValue(new Date(), true);
}
int x=timebx.getAbsoluteLeft();
int y=timebx.getAbsoluteTop();
popupPanel.setPopupPosition(x, y+20);
popupPanel.show();
}
});
return timebx;
}
public void setTimebx(String string) {
// TODO Auto-generated method stub
timebx.setText(string);
}
I am adding this widgets in flexTable in different gui class
flexTable.setWidget(i, j,textBoxDisplay.getTimeTxtbx());
textBoxDisplay.setTimebx(customProperty.getValues().toString());
In a flexTable , this above code is inside a `iterator` and called **Twice**.
![enter image description here][1]
Like in Image : testDate an received on.
When i click on testDate the value of Received On is Changed
[1]: http://i.stack.imgur.com/VoEq6.png | 0 | [
2,
309,
8209,
19,
1854,
5309,
60,
800,
3726,
3726,
31,
1600,
4807,
43,
3060,
18,
26,
1231,
26,
51,
669,
9,
13,
103,
568,
14,
205,
4807,
43,
3060,
26,
309,
10890,
106,
1084,
17,
164,
10890,
106,
1084,
16,
21,
3095,
9,
317,
1854... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Communication between a desktop app and a browser
===
How can I implement a mechanism for communication between a desktop application and a browser, for example Firefox or Google Chrome.
Is there a platform independent solution or I need to implement it for each platform separately? | 0 | [
2,
3291,
128,
21,
17404,
4865,
17,
21,
16495,
800,
3726,
3726,
184,
92,
31,
8713,
21,
6534,
26,
3291,
128,
21,
17404,
3010,
17,
21,
16495,
15,
26,
823,
535,
18219,
54,
8144,
13,
12985,
9,
25,
80,
21,
2452,
1124,
4295,
54,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Difference between create data and create object
===
When do we use Create Data and when do we use Create Object? | 1 | [
2,
2841,
128,
1600,
1054,
17,
1600,
3095,
800,
3726,
3726,
76,
107,
95,
275,
1600,
1054,
17,
76,
107,
95,
275,
1600,
3095,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
DatabaseError no such table
===
So this is the situation: I'm adding a new column(presenters) to my Event table. I ran the `alter table` sql statements, ran `python manage.py syncdb`. I'm trying to be able to select many profiles and store them as presenters. Why is this happening?
Exception Type: DatabaseError
Exception Value: no such table: events_event_presenters
class Event(models.Model):
title = models.CharField(max_length=200)
presenters = models.ManyToManyField(Profile, null=True, blank=True) #new column
sub_heading = models.CharField(max_length=200)
description = models.TextField()
date = models.DateTimeField() | 0 | [
2,
6018,
29992,
90,
145,
859,
800,
3726,
3726,
86,
48,
25,
14,
1858,
45,
31,
22,
79,
4721,
21,
78,
4698,
5,
3914,
445,
6,
20,
51,
807,
859,
9,
31,
717,
14,
13,
1,
16201,
859,
1,
4444,
255,
9015,
15,
717,
13,
1,
6448,
11570... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get strings from server to android device via http request?
===
i'm trying to get some urls from a database on a server to an android device.
First i wanted to use tcp sockets, but then i thought it could be better if i could use a http request to get the strings. is that possible and if its possible can you give me some hints how to do it.
i'm sure there already is an answer to my question but im just too stupid to search the right terms...
thanks for your help,
Dominic | 0 | [
2,
184,
20,
164,
7887,
37,
8128,
20,
13005,
3646,
1197,
7775,
3772,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
164,
109,
13,
911,
7532,
37,
21,
6018,
27,
21,
8128,
20,
40,
13005,
3646,
9,
64,
31,
417,
20,
275,
13,
38,
7439,
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... |
AVAudioSessionCategoryPlayAndRecord with Airplay
===
My app uses the microphone and outputs audio, so I am setting my Audio Session to the Play and Record Category, but this seems to disable Airplay. If I set the category to Play, Airplay works fine with my output (but obviously the input doesn't work).
I've tried overriding the output route to speaker, in case it needed that to output over Airplay, but no joy.
Any ideas? | 0 | [
2,
13656,
6785,
6641,
18,
5991,
14375,
93,
5438,
290,
14953,
29,
17690,
800,
3726,
3726,
51,
4865,
2027,
14,
15403,
17,
5196,
18,
4023,
15,
86,
31,
589,
2697,
51,
4023,
3723,
20,
14,
418,
17,
571,
3230,
15,
47,
48,
2206,
20,
146... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 - creating concrete class instances from base class depending upon type
===
Just to give a real world example, say the base class is Vehicle and concrete classes are TwoWheeler and FourWheeler. Now the type of the vehicle - TwoWheeler or FourWheeler, is decided by the base class Vehicle. When I create an instance of TwoWheeler/FourWheeler using alloc-init method, it calls the super implementation like below to set the value of common properties defined in the Vehicle class and out of these properties one of them is type that actually decides if the type is TwoWheeler or FourWheeler.
if (self = [super initWithDictionary:dict]){
[self setOtherAttributes:dict];
return self;
}
Now when I get a collection of vehicles some of them could be TwoWheeler and others will be FourWheeler. Hence I cannot directly create an instance of TwoWheeler or FourWheeler like this
Vehicle *v = [[TwoWheeler alloc] initWithDictionary:dict];
Is there any way I can create an instance of base class and once I know the type, create an instance of child class depending upon type and return it. With the current implementation, it would result in infinite loop because I call super implementation from concrete class.
What would be the perfect design to handle this scenario when I don't know which concrete class should be instantiated beforehand?
| 0 | [
2,
7038,
272,
13,
8,
2936,
4105,
718,
13946,
37,
1000,
718,
4758,
685,
1001,
800,
3726,
3726,
114,
20,
590,
21,
683,
126,
823,
15,
395,
14,
1000,
718,
25,
2664,
17,
4105,
2684,
50,
81,
8229,
106,
17,
222,
8229,
106,
9,
130,
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... |
Fold and foldLeft method difference
===
I am not sure what is the difference between fold and foldLeft in scala.
This question
http://stackoverflow.com/questions/6253978/difference-between-fold-and-foldleft-or-foldright
has an answer that talks about order. That is understandable. But I still don't understand why following works (from REPL)
scala> Array("1","2","3").foldLeft(0)(_ + _.toInt)
res6: Int = 6
but following does not work
scala> Array("1","2","3").fold(0)(_ + _.toInt)
<console>:8: error: value toInt is not a member of Any
Array("1","2","3").fold(0)(_ + _.toInt)
^
"value toInt is not a member of Any"? What?
edit:
This line from the documentation is also confusing to me.
> **z** - a neutral element for the fold operation; may be added to the
> result an arbitrary number of times, and must not change the result
> (e.g., Nil for list concatenation, 0 for addition, or 1 for
> multiplication.)
Why will it be added *an arbitrary number of times*? I thought folding works differently. | 0 | [
2,
14629,
17,
14629,
9742,
2109,
2841,
800,
3726,
3726,
31,
589,
52,
562,
98,
25,
14,
2841,
128,
14629,
17,
14629,
9742,
19,
25975,
9,
48,
1301,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
21735,
3412,
4130,
118,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to install the Django plugin for the Eric IDE?
===
I can't believe I have to ask this, but I have spent almost three hours looking for the answer. Anyway, I have Eric IDE 4 installed on my linux distro. I can't seem to download any plugins to the plugins repository.
The only one I really want is the Django plugin so when I start a new project in Eric, the Django option shows. The plugin repository just shows me an empty folder for .eric4/eric4plugins and there's no follow up as to where I can get the plugins from somewhere else. Actually, there was a hinting at it on the Eric docs site, but what I ended up getting was the ENTIRE trunk for eric. And the plugins that came with the trunk are just the bare bones ones that ship with it. I didn't get the Django one and the documentation on the Eric site is seriously lacking and overly complex.
Anyone know how I can just get the Django snap in? | 0 | [
2,
184,
20,
16146,
14,
3857,
14541,
10922,
108,
26,
14,
2647,
13,
3448,
60,
800,
3726,
3726,
31,
92,
22,
38,
985,
31,
57,
20,
1349,
48,
15,
47,
31,
57,
1111,
557,
132,
974,
699,
26,
14,
1623,
9,
2774,
15,
31,
57,
2647,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Finding tap point while UITableView reorders
===
How to find out where the finger is when the user is reordering ?
I have a uitableview which covers 1/3 of the ipad screen.
When I start reordering the cell I am able to move the cells up and down even though my finger has panned out of the tableview.
Any solution ? | 0 | [
2,
3007,
5526,
454,
133,
13,
11193,
579,
4725,
302,
7861,
18,
800,
3726,
3726,
184,
20,
477,
70,
113,
14,
2363,
25,
76,
14,
4155,
25,
302,
7861,
68,
13,
60,
31,
57,
21,
13,
11193,
579,
4725,
56,
2937,
137,
16842,
16,
14,
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... |
Finding frame number of nested movieclip in as3
===
Really simple question--how do I get the frame number of a movieclip within a movieclip? Say I have mc2 nested within mc1. Whenever i try to say mc1.mc2.currentFrame, I get
TypeError: Error #1010: A term is undefined and has no properties.
at blobgame2_fla::MainTimeline/loop()
I would attach my fla if I could! | 0 | [
2,
3007,
3523,
234,
16,
5618,
69,
1308,
150,
6013,
19,
28,
240,
800,
3726,
3726,
510,
1935,
1301,
8,
8,
1544,
107,
31,
164,
14,
3523,
234,
16,
21,
1308,
150,
6013,
363,
21,
1308,
150,
6013,
60,
395,
31,
57,
1324,
135,
5618,
69... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
EDSDK callbacks not working after NSPrintPanel/NSPrintOperation Displayed
===
I am currently developing an application using the Canon EDSDK to access my DSLR that will directly print the shot images. The problem here is, that my code interfacing with the EDSDK works perfectly until my application displays either a NSPrintPanel or NSPrintOperation.
If one of these is displayed using either the "runModalX" or "beginSheetWith" functions, and quit again (either Cancel or Ok does not seem to make a difference), then the callbacks within EDSDK seem to stop working.
I can still interface with the camera, download live view images, shoot images, but no action relying on a callback works anymore. An example code, how I call my NSPrintPanel is here:
NSPrintInfo * printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintPanel * printPanel = [NSPrintPanel printPanel];
NSInteger result = [printPanel runModalWithPrintInfo: printInfo];
This is how I invoke the NSPrintOperation:
//view is a NSView with some data added, info is obtained as above
NSPrintOperation * printOp = [NSPrintOperation printOperationWithView: view printInfo: printInfo];
[printOp setShowsPrintPanel: NO];
[printOp runOperation];
My thought is that somehow displaying this panel messes with the messages sent around in the current application. The Cocoa application templates generated by Xcode already provide the print functionality to my Application via the "File->Print" Menu. If the print window is displayed this way, it causes the same errors, only if I display a print dialog outside my application (eg. from Safari) while my application runs, then it does not mess up the EDSDK.
Does anybody have an idea, what the problem here could be, or even how to solve it?
On a side-note: if I take Canons sample application "Camera Control" and add the above code, it ends up having the same problem: live view still works, any interaction with the camera works, but callbacks are not called (so sending the "take picture" command even works the shutter, but since the camera is waiting for the computer to download the shot image, no shutter release after that works).
| 0 | [
2,
13,
69,
18,
43,
197,
645,
1958,
18,
52,
638,
75,
13,
2172,
10299,
3206,
532,
118,
2172,
10299,
11377,
6115,
800,
3726,
3726,
31,
589,
871,
3561,
40,
3010,
568,
14,
5742,
13,
69,
18,
43,
197,
20,
1381,
51,
13,
43,
18,
12988,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to write c++ functions by returning parameters?
===
Need help in figuring out how to write function and returning parameters. Wrote the question below and answer from solution manual, not sure how to write the function though very confused :(
| 0 | [
2,
184,
20,
2757,
272,
20512,
3719,
34,
2485,
12905,
60,
800,
3726,
3726,
376,
448,
19,
25379,
70,
184,
20,
2757,
1990,
17,
2485,
12905,
9,
738,
14,
1301,
1021,
17,
1623,
37,
4295,
5132,
15,
52,
562,
184,
20,
2757,
14,
1990,
362... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How to block Specific outgoing calls
===
i want to block **Specific** phone number that in my database
I do a comparison between the number the user dialed, and the number in memory if they are equal I block the call.
my code:
public void onReceive(Context context, Intent intent) {
PlaceDataSQL placeDataSQL =new PlaceDataSQL(context);
ArrayList<String> getUsersPhoneNumbers= placeDataSQL.getUsersPhoneNumbers();
//TODO
//===========
//here i need to chack the number
Bundle b = intent.getExtras();
String incommingNumber = b.getString(TelephonyManager.EXTRA_INCOMING_NUMBER);
//String outGoingNumber = b.getString(TelephonyManager.);
Boolean find=false;
try{
for(int i=0;i<getUsersPhoneNumbers.size();i++)
{
if(incommingNumber.equals(getUsersPhoneNumbers.get(i)))
{
find=true;
break;
}
}
}catch (Exception e) {
incommingNumber="";
}
// ========================================
//here the problem
//=========================================
String phonenumber=b.getString(Intent.EXTRA_PHONE_NUMBER);
try{
for(int i=0;i<getUsersPhoneNumbers.size();i++)
{
if(phonenumber.equals(getUsersPhoneNumbers.get(i)))
{
find=true;
break;
}
}
if (!find)
return;
}catch (Exception e) {
phonenumber="";
}
if (!find)
return;
/* examine the state of the phone that caused this receiver to fire off */
String phone_state = intent.getStringExtra(TelephonyManager.EXTRA_STATE);
if (phone_state.equals(TelephonyManager.EXTRA_STATE_RINGING))
{
logMe("Phone Ringing: the phone is ringing, scheduling creation call answer screen activity");
Intent i = new Intent(context, CallAnswerIntentService.class);
i.putExtra("delay", 100L);
i.putExtra("number", incommingNumber);
context.startService(i);
logMe("Phone Ringing: started, time to go back to listening");
}
if (phone_state.equals(TelephonyManager.EXTRA_STATE_OFFHOOK))
{
Intent i = new Intent(context,InCallScreenGuardService.class);
i.putExtra("delay", 100L);
i.putExtra("number", phonenumber);
logMe("Phone Offhook: starting screen guard service");
context.startService(i);
}
if (phone_state.equals(TelephonyManager.EXTRA_STATE_IDLE))
{
Intent i = new Intent(context,InCallScreenGuardService.class);
logMe("Phone Idle: stopping screen guard service");
context.stopService(i);
}
return;
}
the problem:
i can get incoming numbers but i cant get outgoing numbers?
I would appreciate any help | 0 | [
2,
184,
20,
1921,
1903,
25193,
3029,
800,
3726,
3726,
31,
259,
20,
1921,
13,
1409,
9219,
1409,
1132,
234,
30,
19,
51,
6018,
31,
107,
21,
6050,
128,
14,
234,
14,
4155,
23868,
15,
17,
14,
234,
19,
1912,
100,
59,
50,
2747,
31,
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... |
jQuery Cookies Plugin doesn't save cookies
===
Hi i try to do this with the cookies plugin in jquery
$.cookie('XXX', 'the_value', 22);
alert($.cookie('XXX'));
But the alert output null (i tried this in local)
Why?
Plugin is there: https://github.com/carhartl/jquery-cookie/ | 0 | [
2,
487,
8190,
93,
19396,
10922,
108,
1437,
22,
38,
2079,
19396,
800,
3726,
3726,
4148,
31,
1131,
20,
107,
48,
29,
14,
19396,
10922,
108,
19,
487,
8190,
93,
5579,
9,
716,
17391,
5,
22,
13290,
22,
15,
13,
22,
124,
1,
15165,
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... |
WebObjects field validation
===
I'm trying to find a good way to do field validation in a WebObjects app. If I have a text field and I tie a number formatter to it, it seems that the default behavior is to parse out the number IF the user enters in a valid number, or, if the user enters an _invalid_ number, it seems to just ignore the value entered by the user. I can't do the validation in a save method or an action method because WO will have already ignored the non-number input by the time it reaches the action method. Is there a standard/recommended way, in a WebObjects app, of validating user input such that the user can be alerted of invalid input, rather than just ignoring the invalid input?
This page: http://en.wikibooks.org/wiki/WebObjects/EOF/Using_EOF/Validation claims that WO and EOF have "an incredible array of validation mechanisms" and even hints that there is a built-in way to _prevent_ the user from entering inappropriate data, but I haven't been able to find any documentation or examples of how to do that (if there is, in fact, a built-in way). Coming up with a custom javascript validator to prevent inappropriate data seems like it would be a nightmare - finding a way to make the JS recognize and handle all of the same edge cases that the backend formatters/parsers handle. It would be nice if WO really did have a built-in way to propagate the formatter edge cases over to JS validation.
The above link also says there is a validationFailedWithException method in WOComponent that gets called "when an EO or formatter failed validation during an assignment", but how can I make a _formatter_ fail validation in the non-number example case above? I've tried having the formatter throw an exception in the parse method if a non-number is entered, but that exception doesn't get passed to the validationFailedWithException method. Does anyone know how I can trigger an exception in a formatter that _will_ trigger a call to validationFailedWithException()? And is that even the best/recommended way? Does anyone know of a better way? | 0 | [
2,
2741,
23793,
18,
575,
27999,
800,
3726,
3726,
31,
22,
79,
749,
20,
477,
21,
254,
161,
20,
107,
575,
27999,
19,
21,
2741,
23793,
18,
4865,
9,
100,
31,
57,
21,
1854,
575,
17,
31,
3795,
21,
234,
26,
24700,
20,
32,
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... |
I have two tables, how can I group one tables by a column in the other, and then sort the groupings by size?
===
I have a table that looks like this:
table name: uno
str_id | title
----------
"a1" | "hi"
"b2" | "bye"
"c3" | "etc."
table name: dos
str_id | other_col_name
-------------------------
"b2" | 1
"b2" | 5
"a1" | 6
"b2" | 7
I would like my query to look at the values in `uno.str_id` and then figure out an ordering of str_ids that have the most values in `dos.str_id`. I think I will need to join them on str_id and then order by count, but I am unsure how to do this in SQL syntax. Thanks for your time and help. | 0 | [
2,
31,
57,
81,
7484,
15,
184,
92,
31,
214,
53,
7484,
34,
21,
4698,
19,
14,
89,
15,
17,
94,
2058,
14,
19288,
18,
34,
1072,
60,
800,
3726,
3726,
31,
57,
21,
859,
30,
1879,
101,
48,
45,
859,
204,
45,
13,
15762,
13,
9729,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you find a specific tag based on parents in capybara and rspec?
===
Currently I have two tests that each individually test for a button_click within a form on the same page with no `id`s but both have the same text `Go`. So what is happens is capybara/rspec only tests the first instance of the `Go` button for <b>both</b> tests. Is there a way to find something based on the parents? I don't want to have to modify my functional code by adding an id just for the sole purpose of testing. I was thinking of something like `test_form > input[type='submit']` but that doesn't work.
Current code:
let(:submit) {"Go"}
describe "with valid information" do
before do
fill_in "email", with: "stuff@example.com"
fill_in "password", with: "stuff"
end
it "should create a user" do
expect {click_button submit}.to change(User, :count).by(1)
end
end
| 0 | [
2,
184,
107,
42,
477,
21,
1903,
3383,
432,
27,
1144,
19,
2605,
93,
13259,
17,
13,
1224,
12610,
60,
800,
3726,
3726,
871,
31,
57,
81,
4894,
30,
206,
16579,
1289,
26,
21,
5167,
1,
150,
10129,
363,
21,
505,
27,
14,
205,
2478,
29,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Filtering observable collection
===
Im trying to filter a observable collection with a query like this
var IEquip = from eq in this.reportDocument.Document.InspectionData.Equipments where eq.PartData.ReportIncluded = true
orderby eq.PartData.Order ascending
select eq;
This seems to work , but when i try to iterate trough IEquip
foreach (EquipmentItem eq in IEquip)
{
....
}
all the ReportIncluded are set to true and i can see the setter on ReportIncluded being called. I have emptied the logic inside the loop with same results. All the ReportInclude are set on first iteration in the loop. What am i missing | 0 | [
2,
25272,
5122,
10321,
579,
1206,
800,
3726,
3726,
797,
749,
20,
11945,
21,
5122,
10321,
579,
1206,
29,
21,
25597,
101,
48,
4033,
31,
9629,
306,
800,
37,
13,
18550,
19,
48,
9,
17437,
28132,
9,
28132,
9,
108,
7350,
872,
18768,
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... |
Java - when to define system properties and for what reasons?
===
This is a simple question, but may be subjective, so I would like some opinions.
I am designing a plugin-oriented project and I have a plugin that requires its own configuration file. Without modifying the core API to accommodate for the third party configuration file, would it be acceptable for the user to provide a VM argument that points to the file, or is there a better way?
Example:
-Dcom.unidentified.project.plugin.MyPlugin.configFile="config/Config.xml"
Thanks! | 0 | [
2,
8247,
13,
8,
76,
20,
9267,
329,
3704,
17,
26,
98,
2932,
60,
800,
3726,
3726,
48,
25,
21,
1935,
1301,
15,
47,
123,
44,
22835,
15,
86,
31,
83,
101,
109,
11900,
9,
31,
589,
15026,
21,
10922,
108,
8,
6800,
669,
17,
31,
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... |
Unit test Custom Route in Web API (MVC 4)
===
I've spent already half day on this without any success, do you know how to unit test routes in Web API?
I mean
Given the following url
~/Test/Get/2
I want to unit test that the above url is captured by the controller Test action Get accepting parameter int
Thanks | 0 | [
2,
1237,
1289,
5816,
858,
19,
2741,
21,
2159,
13,
5,
79,
8990,
268,
6,
800,
3726,
3726,
31,
22,
195,
1111,
614,
519,
208,
27,
48,
366,
186,
1280,
15,
107,
42,
143,
184,
20,
1237,
1289,
5050,
19,
2741,
21,
2159,
60,
31,
884,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
R using estimated state space parameters to forecast
===
I have a time series (ts) and used the MARSS package to create a state space model
fit = MARSS(ts)
giving the parameter estimates,
the state estimates (fit$states) and their
standard errors (fit$states.se)
But these estimates are just for the historic data series.
How can I use this model output to forecast 1,2,3 periods into the future?
Thanks for your help.
| 0 | [
2,
761,
568,
2744,
146,
726,
12905,
20,
12718,
800,
3726,
3726,
31,
57,
21,
85,
231,
13,
5,
38,
18,
6,
17,
147,
14,
5291,
18,
6030,
20,
1600,
21,
146,
726,
1061,
2742,
800,
5291,
18,
5,
38,
18,
6,
1438,
14,
18906,
10527,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.