unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
android ringtonepreference theme change
===
How to change the theme for ringtone preference.
Let's say when clicked on ringtone preferences, ringtone preference screen open which has black background but I need to change that to white or a custom image as background in addition to that need change font color matching to bg.
Thanks in advace | 0 | [
2,
13005,
13,
20944,
3492,
28018,
3184,
753,
800,
3726,
3726,
184,
20,
753,
14,
3184,
26,
1765,
7117,
9808,
9,
408,
22,
18,
395,
76,
15802,
27,
1765,
7117,
9808,
18,
15,
1765,
7117,
9808,
2324,
368,
56,
63,
319,
2395,
47,
31,
37... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Weird LoadError on custom ruby gem
===
I have a custom gem and am encountering a really weird LoadError when I install it as a gem and attempt to require it in irb.
Everything works fine with my rspec tests inside the project folder. This only occurs when using it as an actual gem in irb.
The file it throws a LoadError exception at (`/lib/mws/api/order_response.rb`) does in fact exist. I've tried renaming the file and updating the file that requires it (`/lib/mws.rb`). I've tried recreating the file thinking maybe there was a permissions issue. Nothing works.
If I comment out the require line for that specific file, everything works. There's nothing special about the file. There's 4 other files nearly identical to it (`*_response.rb`).
I feel like I'm taking crazy pills. I must being overlooking something but I sure don't see it.
**Trace:**
chris@Samus:~$ irb
1.9.3p194 :001 > require 'mws'
LoadError: cannot load such file -- mws/api/order_response
from /Users/chris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/chris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/chris/.rvm/gems/ruby-1.9.3-p194/gems/mws-0.1.18/lib/mws.rb:14:in `<top (required)>'
from /Users/chris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
from /Users/chris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
from /Users/chris/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from (irb):1
from /Users/chris/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
**File with the requires (`/lib/mws.rb`)**
require 'mws/base'
require 'mws/connection'
require 'mws/utility'
require 'mws/api/seller'
require 'mws/api/product'
require 'mws/api/order'
require 'mws/api/report'
require 'mws/api/general_response'
require 'mws/api/product_response'
require 'mws/api/report_response'
require 'mws/api/seller_response'
require 'mws/api/order_response' # <--- the offending line
module MWS
# @see Base#initialize MWS::Base for instantiation details.
# @return [Base] returns MWS::Base object.
def self.new(merchant_id, access_key, secret_key)
MWS::Base.new(merchant_id, access_key, secret_key)
end
end
# The below is for documentation generation purposes.
# MWS is a wrapper for the Amazon Marketplace Web Service (MWS) API.
module MWS
# API handles all the Amazon MWS API specific stuff.
module API
end
# Utilities contains various functions needed throughout MWS. Utilities is a mixin to multiple classes.
module Utilities
end
end
**File I'm requiring (`/lib/mws/api/order_response.rb`):**
module MWS
module API
# Class for parsing Amazon's XML responses into managable objects.
class OrderResponse
# Include GeneralResponse instance methods as class methods
extend GeneralResponse
end
end
end
**And my file structure**
![enter image description here][1]
[1]: http://i.stack.imgur.com/muYJH.png | 0 | [
2,
5455,
6305,
29992,
27,
5816,
10811,
8551,
800,
3726,
3726,
31,
57,
21,
5816,
8551,
17,
589,
7007,
68,
21,
510,
5455,
6305,
29992,
76,
31,
16146,
32,
28,
21,
8551,
17,
1735,
20,
4077,
32,
19,
31,
7549,
9,
796,
693,
1123,
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... |
ARM Instruction Decoding
===
I need to decode ARM(ARM926EJ) instructions in C. I have the 32 bit instruction in hex. I want to decode and get the opcode operands. Anyone know any good material for this.
N.B. I looked into QEMU translate.c file. But its so complex and doesn't even tell why is doing what. | 0 | [
2,
813,
7304,
121,
15458,
800,
3726,
3726,
31,
376,
20,
121,
9375,
813,
5,
5828,
518,
2409,
10022,
6,
7650,
19,
272,
9,
31,
57,
14,
2512,
1142,
7304,
19,
24,
396,
9,
31,
259,
20,
121,
9375,
17,
164,
14,
3088,
9375,
1877,
706,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 value from timepicker in android?
===
i have multiple timepickers in my application , i need to get time picker value how to get those value to store it in SQlitdatabase , | 0 | [
2,
184,
20,
164,
1923,
37,
85,
16855,
106,
19,
13005,
60,
800,
3726,
3726,
31,
57,
1886,
85,
16855,
445,
19,
51,
3010,
13,
15,
31,
376,
20,
164,
85,
2036,
106,
1923,
184,
20,
164,
273,
1923,
20,
1718,
32,
19,
4444,
6864,
18768... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
TextView showing HexValue (0x0d0a) for CR LF in Android
===
While saving data from textview, CR LF is storing like hex value 0x0d0a. But while showing same data in another text view **which is inside list view**, not showing return space for 0x0d0a. Instead of that it is directly printing /0x0d0a. Any help here.
Thanks in advance. -- Raghav | 0 | [
2,
1854,
4725,
3187,
24,
396,
15165,
13,
5,
387,
396,
387,
43,
387,
58,
6,
26,
6186,
13,
9641,
19,
13005,
800,
3726,
3726,
133,
7599,
1054,
37,
1854,
4725,
15,
6186,
13,
9641,
25,
25615,
101,
24,
396,
1923,
713,
396,
387,
43,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
php command line doesn't send to the script proper prompted input from user
===
php command line doesn't send to the script proper prompted input from user. his is an example of the issue
`is_dir("C:/");` return 1 but `is_dir(fgets(STDIN))` return null after user input `"C:/"` | 0 | [
2,
13,
26120,
1202,
293,
1437,
22,
38,
2660,
20,
14,
3884,
4119,
9491,
6367,
37,
4155,
800,
3726,
3726,
13,
26120,
1202,
293,
1437,
22,
38,
2660,
20,
14,
3884,
4119,
9491,
6367,
37,
4155,
9,
33,
25,
40,
823,
16,
14,
1513,
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... |
Symfony2 Forms and Polymorphic collections
===
Im playing around with Symfony2 and Im abit unsure how Symfony2 handles Polymorphic collections in the View component. It seems that i can create an entity with a collection of AbstractChildren, but not sure how to what to do with it inside a Form Type class.
For example, I have the following entity relationship.
/**
* @ORM\Entity
*/
class Order {
/**
* @ORM\OneToMany(targetEntity="AbstractOrderItem", mappedBy="order", cascade={"all"}, orphanRemoval=true)
*
* @var AbstractOrderItem $items;
*/
$orderItems;
...
}
/**
* Base class for order items to be added to an Order
*
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap({"ProductOrderItem" = "ProductOrderItem", "SubscriptionOrderItem " = "SubscriptionOrderItem "})
*/
class AbstractOrderItem {
$id;
...
}
/**
* @ORM\Entity
*/
class ProductOrderItem extends AbstractOrderItem {
$productName;
}
/**
* @ORM\Entity
*/
class SubscriptionOrderItem extends AbstractOrderItem {
$duration;
$startDate;
...
}
Simple enough, but when im create a form for my order class
class OrderType extends AbstractType {
public function buildForm(FormBuilder $builder, array $options) {
$builder->add('items', 'collection', array('type' => AbstracOrderItemType() ));
}
}
I am unsure how to handle this situation where you effectively need a different Form Type for each class of item in the collection? | 0 | [
2,
13,
7261,
10229,
93,
135,
1997,
17,
3446,
12498,
596,
5721,
800,
3726,
3726,
797,
791,
140,
29,
13,
7261,
10229,
93,
135,
17,
797,
21,
3326,
13815,
184,
13,
7261,
10229,
93,
135,
3053,
18,
3446,
12498,
596,
5721,
19,
14,
1418,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ruby:: How to search hidden elements with mechanize
===
I am trying to get hidden field with mechanize in ruby and trying to click on it.
agent = Mechanize.new
agent.get('http://www.example.com/')
agent.page.link_with(:text => "More Links...")
But this gives me
=> nil
Actually, I want to click on it
agent.page.link_with(:text => "More Links...").click
But this is an error::
undefined method `click' for nil:NilClass
And here is an HTML code
<div id="rld-4" class="results_links_more highlight_d links_deep" style="display: none;">
<a class="large" href="javascript:;">More Links...</a>
</div> | 0 | [
2,
10811,
45,
45,
184,
20,
2122,
3689,
2065,
29,
55,
3606,
2952,
800,
3726,
3726,
31,
589,
749,
20,
164,
3689,
575,
29,
55,
3606,
2952,
19,
10811,
17,
749,
20,
10840,
27,
32,
9,
2267,
800,
55,
3606,
2952,
9,
2681,
2267,
9,
306... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Problems filtering with a "NOT IN" query
===
Hello y'all night owls (like me)
I'm working on a little project, is sort like a agenda for technicians, each technician is assigned on a daily agenda.
I'm looking for a query that shows me only the technicians that hasn't been assigned on a day in a branch (the company has two branches: East and West)
The query I've tried is:
SELECT *
FROM technicians
WHERE id_tech NOT
IN (
SELECT id_tech
FROM hours
)
AND branch = 'West'
This query returns me what I want, but I don't know how to filter this with a date, I've tried many queries, and return me all the colums with duplicate results.
My tables are, the hours table where each tech has a task:
CREATE TABLE IF NOT EXISTS `hours` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_tech` int(11) NOT NULL,
`9_30` varchar(140) DEFAULT NULL,
`10_30` varchar(50) DEFAULT NULL,
`11_30` varchar(50) DEFAULT NULL,
`12_30` varchar(50) DEFAULT NULL,
`1_30` varchar(50) DEFAULT NULL,
`2_30` varchar(50) DEFAULT NULL,
`3_30` varchar(50) DEFAULT NULL,
`4_30` varchar(50) DEFAULT NULL,
`5_30` varchar(50) DEFAULT NULL,
`6_30` varchar(50) DEFAULT NULL,
`comments` varchar(50) DEFAULT NULL,
`date` text NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM ROW_FORMAT=DYNAMIC AUTO_INCREMENT=14 ;
INSERT INTO `hours` (`id`, `id_tech`, `9_30`, `10_30`, `11_30`, `12_30`, `1_30`, `2_30`, `3_30`, `4_30`, `5_30`, `6_30`, `comments`, `date`) VALUES
(1, 1, 'Router with problems, Customer ID 111', 'Router with problems, Customer ID 111', 'Router with problems, Customer ID 111', 'Router with problems, Customer ID 111', 'Router with problems, Customer ID 111', 'Desktop with problems, Customer ID 121', NULL, NULL, NULL, 'Network problems, Customer ID 121', 'Router with problems, Customer ID 111', '16-07-2012'),
(3, 3, 'Network with problems, Customer ID 111', 'Network with problems, Customer ID 111', NULL, NULL, NULL, NULL, NULL, NULL, 'Network with problems, Customer ID 111', '', 'Didn''t came to work today', '16-07-2012');
And the technicians table:
CREATE TABLE IF NOT EXISTS `technicians` (
`id_tech` int(11) NOT NULL,
`name` varchar(50) COLLATE utf8_spanish_ci NOT NULL,
`branch` varchar(50) COLLATE utf8_spanish_ci NOT NULL,
PRIMARY KEY (`id_tech`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_spanish_ci ROW_FORMAT=DYNAMIC;
INSERT INTO `technicians` (`id_tech`, `name`, `branch`) VALUES
(1, 'Peter', 'East'),
(2, 'Juan', 'East'),
(3, 'Rick', 'West'),
(4, 'Mario', 'West');
Thanks a lot for the help, I know any of you will help me to get back on track on this small project
| 0 | [
2,
1716,
25272,
29,
21,
13,
7,
1270,
19,
7,
25597,
800,
3726,
3726,
10975,
13,
93,
22,
1233,
343,
11170,
18,
13,
5,
1403,
55,
6,
31,
22,
79,
638,
27,
21,
265,
669,
15,
25,
2058,
101,
21,
11277,
26,
12664,
18,
15,
206,
12664,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 for each of jsf is not working . JSF
===
i am trying to use **c foreach with hashmap or table in jsf 2.0** but it is not working so i wrote one simple code like this still this one is not working .... please help where i am missing...
<body>
<f:view>
<c:forEach var="i" begin="1" end="20" step="1" varStatus ="status">
<c:out value="#{i}" />
</c:forEach>
</f:view>
</body>
and output for this i am getting like this ..
#{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i} #{i}
| 0 | [
2,
272,
26,
206,
16,
487,
18,
410,
25,
52,
638,
13,
9,
487,
18,
410,
800,
3726,
3726,
31,
589,
749,
20,
275,
13,
1409,
150,
26,
14322,
29,
19170,
15022,
54,
859,
19,
487,
18,
410,
172,
9,
387,
1409,
47,
32,
25,
52,
638,
86... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 a line between two points android & google maps
===
I am working in a google maps and I want to draw a line between two points I used the following code from a user question in this site but it didn't work with me I have a force close when I remove this function in the inner class the application works
but I need it because I have to draw lines
The code I used is the following:
class MyOverlay extends com.google.android.maps.Overlay {
GeoPoint [] geoPointsArray ;
// constructor
public MyOverlay(){
}
@Override
public void draw(Canvas canvas, MapView mapv, boolean shadow){
super.draw(canvas, mapv, shadow);
Paint mPaint = new Paint();
mPaint.setDither(true);
mPaint.setColor(Color.RED);
mPaint.setStyle(Paint.Style.FILL_AND_STROKE);
mPaint.setStrokeJoin(Paint.Join.ROUND);
mPaint.setStrokeCap(Paint.Cap.ROUND);
mPaint.setStrokeWidth(2);
GeoPoint gP1 = new GeoPoint(19240000,-99120000);
GeoPoint gP2 = new GeoPoint(37423157, -122085008);
Point p1 = new Point();
Point p2 = new Point();
Path path = new Path();
projection.toPixels(gP1, p1);
projection.toPixels(gP2, p2);
path.moveTo(p2.x, p2.y);
path.lineTo(p1.x,p1.y);
canvas.drawPath(path, mPaint);
}
}// end of the inner class
I really need help, when I just add this thing I got a force close :S
| 0 | [
2,
3533,
21,
293,
128,
81,
819,
13005,
279,
8144,
6867,
800,
3726,
3726,
31,
589,
638,
19,
21,
8144,
6867,
17,
31,
259,
20,
2003,
21,
293,
128,
81,
819,
31,
147,
14,
249,
1797,
37,
21,
4155,
1301,
19,
48,
689,
47,
32,
223,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Number of pairs that share atleast one digit
===
You are given **n** numbers and you have to find the **number of pairs** such that atleast one digit is common in between them.
Eg. For **5** numbers :
2837 2818 654 35 931
Answer : 6 as **(2837,2818),(2837,35),(2837,931),(2818,931),(654,35),(35,931)**
**My Attempt** : I took a structure which stores **the number in decimal, the number in form of its digits in array and number of digits in that number**.
Now for each number I **hashed** that number in array conatining index **0-9** and the checked with all following numbers wether any of their digit is already present.
My attempt was O(n^2) and it was slow and I want to know some efficent algorithm which is in in O(n). | 0 | [
2,
234,
16,
7473,
30,
1891,
35,
255,
2857,
53,
15611,
800,
3726,
3726,
42,
50,
504,
13,
1409,
103,
1409,
2116,
17,
42,
57,
20,
477,
14,
13,
1409,
16299,
16,
7473,
1409,
145,
30,
35,
255,
2857,
53,
15611,
25,
757,
19,
128,
105,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to extract number form string c#
===
I have a string
"transform(23, 45)"
from this srting i have to extract 23 and 45, i did
var xy = "transform(23,45)".Substring("transform(23,45)".indexOf('(') + 1).TrimEnd(')');
var num = xy.Split(',');
I am using c#. Is there any better method to do this in c#? | 0 | [
2,
184,
20,
10962,
234,
505,
3724,
272,
5910,
800,
3726,
3726,
31,
57,
21,
3724,
13,
7,
7028,
4190,
5,
2001,
15,
2487,
6,
7,
37,
48,
3441,
1203,
31,
57,
20,
10962,
1137,
17,
2487,
15,
31,
144,
4033,
13,
15161,
800,
13,
7,
70... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Dismiss Modalview after imagePickerController:didFinishPickingMediaWithInfo:
===
I have a ViewController (VC1) that opens another ViewController (VC2) modally that is embedded in a NavigationController (NavC1). VC2 is used as a source selection view for the user to select different sources, such as the built-in photo library. When the user selects the photo library in VC2 I am opening Apple's imagePicker.
`VC1 --(modal)--> NavC1 ----> VC2`
In the imagePickerdidFinish I would like to close the before modally presented VC2.
Actually this method looks as follows.
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage* image = [info objectForKey:UIImagePickerControllerOriginalImage];
...
NSError* error;
if([UIImageJPEGRepresentation(image, 0.5) writeToFile:path options:NSDataWritingFileProtectionComplete error:&error] == NO)
{
NSLog(@"Saving image to file failed with error %@",[error localizedDescription]);
}
picker.delegate = nil;
[self dismissModalViewControllerAnimated:YES];
...
}
What I have tried so far:
- I have tried to dismiss it using the parent navigation controller
- I have stored a reference to VC2 in `prepareForSegue:` of VC1 and
passed a delegate back to VC1 from VC2 when the imagePicker did
finish. In this method I have tried to simply dimiss the modal view
manually (`[self.myModalView
dismissModalViewControllerAnimated:YES]`)
Does anyone have a suggestion for me? Thanks in advance! | 0 | [
2,
14372,
13,
20756,
4725,
75,
1961,
16855,
106,
12898,
1252,
45,
3052,
23858,
16855,
68,
8260,
1410,
108,
4120,
45,
800,
3726,
3726,
31,
57,
21,
1418,
12898,
1252,
13,
5,
8990,
165,
6,
30,
8965,
226,
1418,
12898,
1252,
13,
5,
899... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Azure - IISConfigurator.exe has stopped working
===
I've installed Windows Azure SDK for .NET June 2012 and when I try to run a project with a web role locally, I get the following error message:
"IISConfigurator.exe has stopped working"
In the event viewer I've found the following message:
Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0
Problem signature:
P1: iisconfigurator.exe
P2: 1.7.0.0
P3: 4fcaabb8
P4: System.Management
P5: 2.0.0.0
P6: 4ca2baf0
P7: 32f
P8: 12b
P9: System.IO.FileNotFoundException
P10:
Attached files:
C:\Users\gert.vanmeerbergen\AppData\Local\Temp\WERB2EA.tmp.WERInternalMetadata.xml
These files may be available here:
C:\Users\gert.vanmeerbergen\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_iisconfigurator._26305d6c2cb0448de956b81b6cbdbc2cdc9158f9_2000b8e3
Analysis symbol:
Rechecking for solution: 0
Report Id: aeff36bf-cf0f-11e1-b2df-74de2b9a4969
I've already tried to re-installing the Windows Azure SDK but that doesn't help.
An idea on how to fix this?
Thanks.
Gert | 0 | [
2,
25715,
13,
8,
595,
18,
1126,
13549,
3457,
9,
1706,
62,
63,
1175,
638,
800,
3726,
3726,
31,
22,
195,
4066,
1936,
25715,
13,
18,
43,
197,
26,
13,
9,
2328,
295,
563,
17,
76,
31,
1131,
20,
485,
21,
669,
29,
21,
2741,
597,
668... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Need a C++ library for Https Serving with NAT Traversal?
===
I'm working on a project in C++, and basically, I need to be able to briefly (like 1 time use) host a single file over https (or possibly sftp) across different platforms (Win, Mac, Linux, as many as possible). The library needs to be compatible with my LGPL license and preferably needs to work with a Wide Area Network from behind a router. If not, I'm going to have to ask my users to port forward manually.
I realize this is a sort of strange idea, NAT Traversal + HTTP, but I was just wondering if anyone knew of a good library or set of libraries that could do this? If not, I'm probably going to have to write it myself. | 0 | [
2,
376,
21,
272,
20512,
1248,
26,
7775,
18,
1799,
29,
6285,
19501,
192,
60,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
669,
19,
272,
20512,
15,
17,
11374,
15,
31,
376,
20,
44,
777,
20,
3224,
13,
5,
1403,
137,
85,
275,
6,
2015... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Two ListBoxes that allows the user to select one value from each or default if not chosen
===
I am very new and extremely confused as to how I can accomplish this project. I need to have two ListBoxes in a C# Windows Visual Studio 2010 form that has the first item as the default value if the user doesn't make a selection. The list contains font names in one listbox and sizes in the other. I have just a basic code written to start me off which includes the following:
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//populate listbox1
listBox1.Items.Add("Arial");
listBox1.Items.Add("Calibri");
listBox1.Items.Add("Times New Roman");
listBox1.Items.Add("Verdana");
//populate listbox2
listBox2.Items.Add("8");
listBox2.Items.Add("10");
listBox2.Items.Add("12");
listBox2.Items.Add("14");
this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged);
}
private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = listBox1.SelectedItem.ToString();
}
private void listBox2_SelectedIndexChanged(object sender, EventArgs e)
{
textBox1.Text = listBox2.SelectedItem.ToString();
}
}
}
Since this is the beginning of this project, the font name and size that the user selects will eventually produce a message in that chosen font name and size. Any suggestions would be greatly appreaciated
| 0 | [
2,
81,
968,
5309,
160,
30,
2965,
14,
4155,
20,
5407,
53,
1923,
37,
206,
54,
12838,
100,
52,
2519,
800,
3726,
3726,
31,
589,
253,
78,
17,
3898,
4230,
28,
20,
184,
31,
92,
14570,
48,
669,
9,
31,
376,
20,
57,
81,
968,
5309,
160... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Serialize an object with DataContractJsonSerializer
===
I have a class which contains some items. I want to serialize an instance of this class to json using the DataContractJsonSerializer :
[DataContract]
public class Policy
{
private string expiration { get; set; }
private List<List<string>> conditions { get; set; }
public Policy(){}
public Policy(string expiration, List<List<string>> conditions){
this.expiration = expiration;
this.conditions = conditions;
}
[DataMember]
public string DateExpiration
{
get{ return expiration;}
set{expiration = value;}
}
[DataMember]
public List<List<string>> Conditions
{
get{return conditions;}
set{conditions = value;}
}
}
When serialized to json it should be like this :
{
"expiration": "2011-04-20T11:54:21.032Z",
"conditions": [
["eq", "acl", "private"],
["eq", "bucket": "myas3bucket"],
["eq", "$key", "myfilename.jpg"],
["content-length-range", 0, 20971520],
["eq", "$redirect", "myredirecturl"],
]
}
I tried like this but nothing :
string expiration = "2012-12-01T12:00:00.000Z";
List<List<string>> conditions = new List<List<string>>()
{
new List<string>(){ "[ eq", "acl", "private ]" },
new List<string>(){ "[ eq", "bucket", "myas3bucket]" },
new List<string>(){ "[ eq", "$key", "myfilename.jpg ]" },
new List<string>(){ "[ content-length-range", "0", "20971520]" },
new List<string>(){ "[ eq", "$redirect", "myredirecturl]" }
};
Policy myPolicy = new Policy(expiration,conditions);
string policy = JSONHelper.Serialize<Policy>(myPolicy);
thanks | 0 | [
2,
5956,
2952,
40,
3095,
29,
1054,
23311,
728,
528,
4104,
2815,
11907,
800,
3726,
3726,
31,
57,
21,
718,
56,
1588,
109,
3755,
9,
31,
259,
20,
5956,
2952,
40,
4851,
16,
48,
718,
20,
487,
528,
568,
14,
1054,
23311,
728,
528,
4104,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
mvc3 session data from one layout to another
===
i have my mvc3 aplication with its principal menu in Shared/_layout.cshtml, and i've created another layout with a different menu (a basic menu, and the login option) , when i login in this layout i go to my principal menu, but there i can not see my login data, i see the "log on" thing again, if i update the page in the browser it sends the data from the first layout to the actual layout and shows me the "welcome..." but that's not the idea, im login two times XD!
i want to pass the session data from the layout1 to my layout2.
| 1 | [
2,
307,
8990,
240,
3723,
1054,
37,
53,
9106,
20,
226,
800,
3726,
3726,
31,
57,
51,
307,
8990,
240,
21,
20669,
29,
82,
2279,
11379,
19,
2592,
118,
1,
4414,
1320,
9,
6824,
15895,
15,
17,
31,
22,
195,
679,
226,
9106,
29,
21,
421,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
BufferedImage Server Client Faillure
===
I'm trying to create a simple screen share app but i can not get it to work:
basically 1 client is sending a picture (derezzed) to the server, the server reads it, and sends it to all the clients watching. but the clients watching only receive the image 1 time
Sender:
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
BufferedImage img = new BufferedImage(image.getWidth() / 2, image.getHeight() / 2, BufferedImage.TYPE_INT_RGB);
img.createGraphics().drawImage(image,0,0,image.getWidth() / 2, image.getHeight() / 2,null);
ImageIO.write(img, "GIF", socket.getOutputStream());
Server:
BufferedImage imagein = ImageIO.read(socket.getInputStream());
RenderedImage im = imagein;
for(int a = 0; a < Server.Viewers.size(); a++) {
Socket TEMPsock = (Socket)Server.Viewers.get(a);
ImageIO.write(im, "GIF", TEMPsock.getOutputStream());
}
Receiver:
BufferedImage imagein = ImageIO.read(socket.getInputStream());
ImageIcon icon = new ImageIcon(imagein.getScaledInstance(900,500, 20));
Viewer.label.setIcon(icon); | 0 | [
2,
17497,
69,
22039,
8128,
6819,
7476,
2377,
99,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
1935,
2324,
1891,
4865,
47,
31,
92,
52,
164,
32,
20,
170,
45,
11374,
137,
6819,
25,
4907,
21,
2151,
13,
5,
1157,
2819,
10590,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
error: insufficient permission for adding an object to repository database ./objects
===
Yeah, I know, this thing has been on here before, I've seen the questions.
error: insufficient permission for adding an object to repository database ./objects
I have just one question: Is this error regarding the local or the server-side repository database?
And why am I the only one getting this error among the developers?
(I'm asking this question because my server guy doesn't want to believe me that this is a server-side problem) | 0 | [
2,
7019,
45,
14748,
5572,
26,
4721,
40,
3095,
20,
24869,
6018,
13,
9,
118,
23793,
18,
800,
3726,
3726,
3979,
15,
31,
143,
15,
48,
584,
63,
74,
27,
235,
115,
15,
31,
22,
195,
541,
14,
2346,
9,
7019,
45,
14748,
5572,
26,
4721,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Which is the easiest functional programming language for someone who has background in imperative languages?
===
I would like to learn a functional language in order to broaden my horizon. I have knowledge of Python and C/C++ and I want a language to be easy to learn from someone who comes from the imperative domain of languages. I don't care if the language is powerful enough. I just want a language in order to learn the basic of functional programming and then I will try for a more difficult (and powerful language).
Thanks
| 0 | [
2,
56,
25,
14,
27237,
7652,
3143,
816,
26,
737,
72,
63,
2395,
19,
25186,
2556,
60,
800,
3726,
3726,
31,
83,
101,
20,
2484,
21,
7652,
816,
19,
389,
20,
23356,
51,
7530,
9,
31,
57,
1918,
16,
20059,
17,
272,
118,
150,
20512,
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 delete saved data in Shared Preferences in android?
===
I am using facebook api in my app. Its working fine i can login and post on wall. But i couldn't delete the login information.
This is the code
public boolean saveCredentials(Facebook facebook) {
Editor editor = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE).edit();
editor.putString(TOKEN, facebook.getAccessToken());
editor.putLong(EXPIRES, facebook.getAccessExpires());
return editor.commit();
}
public boolean restoreCredentials(Facebook facebook) {
SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE);
facebook.setAccessToken(sharedPreferences.getString(TOKEN, null));
facebook.setAccessExpires(sharedPreferences.getLong(EXPIRES, 0));
return facebook.isSessionValid();
}
public boolean removeCredentials()
{
SharedPreferences prefs = getApplicationContext().getSharedPreferences(KEY, Context.MODE_PRIVATE);
Editor editor = prefs.edit();
editor.clear();
editor.commit();
return true;
}
The Shared preferences details hasn't deleted by calling `removeCredentials()` method. It just post the message on facebook wall.
I just want to delete the saved details and if again user requests to posting the message on wall then i need to popup the login screen.
Thanks for your Help guys | 0 | [
2,
184,
20,
27448,
4377,
1054,
19,
2592,
9808,
18,
19,
13005,
60,
800,
3726,
3726,
31,
589,
568,
9090,
21,
2159,
19,
51,
4865,
9,
82,
638,
1123,
31,
92,
6738,
108,
17,
678,
27,
769,
9,
47,
31,
711,
22,
38,
27448,
14,
6738,
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... |
flexcroll not working in firefox
===
i have flexcroll problem in dynamic loading iframes, i have four iframes, it works for first iframe which has foucs but it doesn't work for other iframes, help me if you know, I will wait.
Thanks. | 0 | [
2,
14409,
150,
8694,
52,
638,
19,
535,
18219,
800,
3726,
3726,
31,
57,
14409,
150,
8694,
1448,
19,
7782,
12797,
31,
8361,
18,
15,
31,
57,
222,
31,
8361,
18,
15,
32,
693,
26,
64,
31,
8361,
56,
63,
4310,
6335,
18,
47,
32,
1437,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Prevent jQuery autocomplete from filtering data
===
I've got a jQuery control derived from [this example][1] but with a remote data source returning a JSON object. The server method that filters the results is somewhat advanced, searching within the second line of description text as well as the main one. I want all the data returned displayed, regardless of whether the typed search term appears in the main label. Can I force jQuery to not filter the results and to rely on my server method to return only the relevant ones?
[1]: http://jqueryui.com/demos/autocomplete/#custom-data | 0 | [
2,
2501,
487,
8190,
93,
3108,
15990,
37,
25272,
1054,
800,
3726,
3726,
31,
22,
195,
330,
21,
487,
8190,
93,
569,
3981,
37,
636,
1565,
823,
500,
2558,
165,
500,
47,
29,
21,
5388,
1054,
1267,
2485,
21,
487,
528,
3095,
9,
14,
8128,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Compile OpenCV 2.4.2 for Debian Lenny
===
To keep the Q&A aspect:
**Problem:**
I got a strange problem with the latest (v.2.4.2) OpenCV version, which failed to install with the following error:
> In file included from /OpenCV-2.4.2/modules/core/src/system.cpp:460:
> /OpenCV-2.4.2/release/modules/core/version_string.inc:37:1:
> warning: missing terminating " character In file included from
> /OpenCV-2.4.2/modules/core/src/system.cpp:460:
> /OpenCV-2.4.2/release/modules/core/version_string.inc:37: error:
> missing terminating " character
So what went wrong? Take a look at my answer. | 0 | [
2,
26561,
368,
12732,
172,
9,
300,
9,
135,
26,
121,
10035,
23364,
800,
3726,
3726,
20,
643,
14,
2593,
1569,
58,
7289,
45,
13,
1409,
2740,
2854,
79,
45,
1409,
31,
330,
21,
2578,
1448,
29,
14,
5736,
13,
5,
710,
9,
135,
9,
300,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to disable a thickbox after first click?
===
I have a *a href* tag with css class thickbox I need to disable the link after first click. how I can do this?
Aspx code
<a href="SomePage.aspx?FDID=11&KeepThis=true&TB_iframe=true&height=150&width=400"
onclick="return DoSomething(this)" class="thickbox" id="AnchorID">
<img id="MyImageButton" alt="Image" src="SiteImages/image.png" runat="server" />
</a>
My JavaScript Method
function DoSomething(element) {
return true;
}
| 0 | [
2,
184,
20,
1460,
579,
21,
2318,
5309,
75,
64,
10840,
60,
800,
3726,
3726,
31,
57,
21,
1637,
58,
746,
14057,
2483,
3383,
29,
272,
18,
18,
718,
2318,
5309,
31,
376,
20,
1460,
579,
14,
3508,
75,
64,
10840,
9,
184,
31,
92,
107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MSSQL 2008 R2 looking for a way to get the night hours for an employee
===
Using MSSQL 2008 R2 we are looking for a way to select the shift hours that an employee has that are during the night which in the this case 22.00 and 6.00 +1. Our problem becomes how to get the hours when the shift crosses midnight or how we get the overlap when a shift begins 05.30 to 22.30 and has an overlap in both the beginning and end of the shift.
Here is an example, theses are the data available in the database and the result we are looking for:
startDateTime: 2012-07-04 05:00:00.000, endDateTime: 2012-07-11 23:00:00.000, nightHours: 2
startDateTime: 2012-07-04 18:00:00.000, endDateTime: 2012-07-12 05:00:00.000, nightHours: 7
Does anyone have an example or a few good pointer that we can use. | 0 | [
2,
4235,
18,
22402,
570,
761,
135,
699,
26,
21,
161,
20,
164,
14,
343,
974,
26,
40,
7362,
800,
3726,
3726,
568,
4235,
18,
22402,
570,
761,
135,
95,
50,
699,
26,
21,
161,
20,
5407,
14,
4471,
974,
30,
40,
7362,
63,
30,
50,
112... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 possible to get auto-discovered or self-registered services with Apache CXF JAX-RS?
===
I got a sample application in order to test REST services with Apache CXF. This is my sample service:
@Named('sampleService')
@Path("/test")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class SampleService {
@GET
public List<Product> getProducts() {
...
}
}
On the other hand in my web.xml is cofiguraed Spring and Apache CXF
<wep-app ...>
<display-name>sample</display-name>
<!-- spring configuration -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Apache CXF configuration -->
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
And my applicationContext.xml
<?xml version="1.0" encoding="ÜTF-8"?>
<beans ...>
<import resource="classpath:META-INF/cxf/cxf.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<context:annotation-config/>
<context:component-scan base-package="com.test.sample"/>
<jaxrs:server id="api" address="/">
<jaxrs:providers>
<bean class="org.codehaus.jackson.jaxrws.JacksonJsonProvider"/>
</jaxrs:providers>
<jaxrs:serviceBeans>
<ref bean="sampleService"/>
</jaxrs:serviceBeans>
</jaxrs:server>
</beans>
In order to make that all works fine I need to reference each service inside jaxrs:serviceBeans. It could be possible to avoid this manual service registration and do it automatically through @Path annotations (or any other mechanism)? | 0 | [
2,
25,
938,
20,
164,
3108,
8,
28682,
54,
1119,
8,
24911,
687,
29,
17140,
272,
396,
410,
11712,
8,
1224,
60,
800,
3726,
3726,
31,
330,
21,
5717,
3010,
19,
389,
20,
1289,
760,
687,
29,
17140,
272,
396,
410,
9,
48,
25,
51,
5717,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Ranking with mysql: update vs select
===
I am developing a web game with a lot of users. On the main screen there will be a map with many markers. Each marker is linked to an user and each user has a position in a ranking (calculated with their points) that I want to show.
To dynamically calculate the position of the ranking have found the following from [here][1]:
SET @rownum := 0;
SELECT rank, points FROM (
SELECT @rownum := @rownum + 1 AS rank, points, uid
FROM landings ORDER BY points DESC
) as result WHERE uid=xxxxxxxx
But this query will be fired for every new marker loaded to the map, every time a player moves the map to an unexplored zone.
On the other hand, what if every time a player finish a game I update a rank field for every user on the database? This sounds huge, of course, but this scenario is less frequent than the other. What do you think? An update is much less efficient than a select? How much?
Thank you for your help!
[1]: http://thinkdiff.net/mysql/how-to-get-rank-using-mysql-query/ | 0 | [
2,
4992,
29,
51,
18,
22402,
45,
11100,
4611,
5407,
800,
3726,
3726,
31,
589,
3561,
21,
2741,
250,
29,
21,
865,
16,
3878,
9,
27,
14,
407,
2324,
80,
129,
44,
21,
2942,
29,
151,
19482,
9,
206,
13289,
25,
4727,
20,
40,
4155,
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... |
I need assistance with an Auto Alert View with actions
===
Okay so when a user first launches my app I want an Alert View that will pop up with 2 choices. Im using this method below:
- (void) displayWelcomeScreen
{
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *alreadyRun = @"already-run";
if ([prefs boolForKey:alreadyRun])
return;
[prefs setBool:YES forKey:alreadyRun];
UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"…"
message:@"…"
delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
}
When I first launch the app no Alert View pops up. Am I doing something wrong? BTW I want it to display only on the first launch of the app. It must not display any other time. Thanks in advance. | 0 | [
2,
31,
376,
4067,
29,
40,
3108,
7863,
1418,
29,
3078,
800,
3726,
3726,
1705,
86,
76,
21,
4155,
64,
22933,
51,
4865,
31,
259,
40,
7863,
1418,
30,
129,
1675,
71,
29,
172,
10978,
9,
797,
568,
48,
2109,
1021,
45,
13,
8,
13,
5,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Chart.Chartdata for updating chart data on pwerpoint is giving error
===
I am trying to update 50 slides on Powerpoint through Excel VBA and each slide has a Graph.
I want to open the data for that graph and edit it.
as of now, the code is working fine for opening the file and selecting slide and then the respective chart but I am not able open the Chart source data.
Chart.ChartData is giving and error:
Compile Error:User-defined type not defined
Can someone please help me out with this problem? | 0 | [
2,
1795,
9,
5433,
38,
18768,
26,
71,
43,
1880,
1795,
1054,
27,
351,
4662,
3132,
25,
1438,
7019,
800,
3726,
3726,
31,
589,
749,
20,
11100,
1222,
18066,
27,
414,
3132,
120,
20700,
566,
969,
17,
206,
6464,
63,
21,
7210,
9,
31,
259,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why are some programs writing on stderr instead of stdout their output?
===
I've recently added to my .bashrc file an ssh-add command. I found that
`ssh-add $HOME/.ssh/id_rsa_github > /dev/null`
results on a message "identity added and something else" every time I open a shell.
While
`ssh-add $HOME/.ssh/id_rsa_github > /dev/null 2>&1`
did the trick and my shell is now 'clean'.
Reading on internet, I found that other command do it, (for example `time`). Could you please explain why it's done? | 0 | [
2,
483,
50,
109,
1726,
1174,
27,
354,
1157,
139,
700,
16,
354,
43,
1320,
66,
5196,
60,
800,
3726,
3726,
31,
22,
195,
1989,
905,
20,
51,
13,
9,
6093,
3112,
150,
3893,
40,
13,
18,
1635,
8,
14854,
1202,
9,
31,
216,
30,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javafx How to display custom font in webview?
===
The web page uses a custom font which is not installed on my PC. In such case, WebView seems to use the default font of the operation system.
But I have the font file "xx.ttf". How can I embed the font into my application and tell WebView to use it to identify the font on the page? | 0 | [
2,
8247,
16488,
184,
20,
3042,
5816,
9978,
19,
2741,
4725,
60,
800,
3726,
3726,
14,
2741,
2478,
2027,
21,
5816,
9978,
56,
25,
52,
4066,
27,
51,
5168,
9,
19,
145,
610,
15,
2741,
4725,
2206,
20,
275,
14,
12838,
9978,
16,
14,
1453,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cutting large XML file into smaller pieces in C#
===
I have a problem that I'm working on for quite some time now. I have an XML file with over 50000 records (one record has 3 levels). This file is used by one of my applications to control document sending (the record holds, among other informations, the type of document that has to be sent to a certain person). So in my application I load the XML file into a XmlDocument, and then by using SelectNodes method, I create a XmlNodeList from which I read the data I want. The process is like this - our worker takes the persons ID card (simple eith barcode) and reads it with barcode reader. When the barcode value has been read, my application finds the person with that ID in the XML file, and stores the type of the document into a string variable. Then the worker takes the document and reads its barcode, and if the value of documents barcode and the value in the value in the string variable match, the application makes a record that document of type xxxxxxxx will be sent to the person with ID yyyyyyyyy. This is very simple code, it works perfectly for now, and this is how it looks:
On textBox1_TextChanged event (worker read persons ID):
foreach(XmlNode node in NodeList){
if(String.Compare(node.Attributes.GetNamedItem("ID").Value.ToString(),textBox1.Text)==0)
{
ControlString = node.ChildNode[3].FirstChild.Attributes.GetNamedItem("doctype").Value.ToString();
break;
}
}
textBox2.Focus();
And on textBox2_TextChanged event (worker read the documents barcode):
if(String.Compare(textBox2.Text,ControlString)==0)
{
//Create a record and insert it into a SQL database
}
My question is - how will my application perform with larger XML files (I was told that the XML file might be up to 500,000 records large), will this approach be valid, or will I need to cut the file into smaller files. If I have to cut it, please give me an idea with some code samples, I've tried to do it like this:
Reading entire record and storing it into a string:
private void WriteXml(XmlNode record)
{
tempXML = record.InnerXml;
temp = "<" + record.Name + " code=\"" + record.Attributes.GetNamedItem("code").Value + "\">" + Environment.NewLine;
temp += tempXML + Environment.NewLine;
temp += "</" + record.Name + ">";
SmallerXMLDocument += temp + Environment.NewLine;
temp = "";
i++;
}
tempXML, temp and SmallerXMLDocument are all string variables.
And then in button_Click method I load the XML file into a XmlNodeList (again by using XmlDocument.SelectNodes method) and I try to create one big string value that would hold all records like this:
foreach(XmlNode node in nodes)
{
if(String.Compare(node.ChildNode[3].FirstChild.Attributes.GetNamedItem("doctype").Value.ToString(),doctype1)==0)
{
WriteXML(node);
}
}
My idea was to create a string value (in this case called SmallerXmlDocument), and when I pass trough the entire XML file, to simply copy the value of that string into a new file. This works, but only for files that have up to 2000 records (and my has way more than that). So, if I need to cut the file into smaller pieces, what would be the best way to do it (keep in mind that there could be up to half a million records in a XML file)?
Thanks
| 0 | [
2,
5378,
370,
23504,
3893,
77,
2012,
2491,
19,
272,
5910,
800,
3726,
3726,
31,
57,
21,
1448,
30,
31,
22,
79,
638,
27,
26,
1450,
109,
85,
130,
9,
31,
57,
40,
23504,
3893,
29,
84,
1222,
3993,
742,
13,
5,
849,
571,
63,
203,
221... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
TileGroup does not fill the container
===
I put a TileGroup in a BorderContainer and set the width to 100%, but the content in the TileGroup did not fill the parent container, it leaves a big chunk of blank on the right part.
The code is:
<s:BorderContainer width="100%" height="100%">
<s:TileGroup width="100%" requestedColumnCount="2">
<s:Button>
button1
</s:Button>
<s:Button>
button2
</s:Button>
<s:Button>
button3
</s:Button>
</s:TileGroup>
</s:BorderContainer>
and the result is like this:
http://i.minus.com/iN39P7Us4cBm1.png
The width is already set to 100% but it does not work.
Is there any way to make the TileGroup fill the container like GridLayout does in Java swing?
http://www.java2s.com/Code/JavaImages/GridLayoutPane.PNG
Thank you very much.
[1]: http://i.stack.imgur.com/jWqHy.png
[2]: http://i.stack.imgur.com/6I3hf.png | 0 | [
2,
13,
9802,
8024,
630,
52,
3509,
14,
12147,
800,
3726,
3726,
31,
442,
21,
13,
9802,
8024,
19,
21,
1862,
1126,
5851,
106,
17,
309,
14,
9456,
20,
12849,
15,
47,
14,
2331,
19,
14,
13,
9802,
8024,
144,
52,
3509,
14,
4766,
12147,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Howto pass Java system properties to maven-cargo container
===
I'm preparing a maven2 web project for continuous integration. I use the [maven cargo plugin][1] to automatically deploy the WAR to Tomcat6x before running integration tests.
My code depends on some system properties which are set with `MAVEN_OPTS=-Dfoo=bar`. Unfortunately these properties are missing when the application is deployed to Tomcat:
System.getProperty("foo"); // null, when deployed to container by maven-cargo
How can I pass these properties to Tomcat?
[1]: http://cargo.codehaus.org/Maven2+plugin | 0 | [
2,
184,
262,
1477,
8247,
329,
3704,
20,
1216,
3124,
8,
1367,
839,
12147,
800,
3726,
3726,
31,
22,
79,
7575,
21,
1216,
3124,
135,
2741,
669,
26,
6357,
8078,
9,
31,
275,
14,
636,
540,
3124,
5570,
10922,
108,
500,
2558,
165,
500,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Arduino : how read string from Serial?
===
I have to manage my servos from computer. So i have to send manage messages from computer to arduino. I need manage the number of servo and the corner. I think of , for example, send something like this : "1;130" (first servo and corner 130, delimeter ";"). I dont know is it the best decision, if you know something better, please tell me!
so i try this code :
String foo = "";
void setup(){
Serial.begin(9600);
}
void loop(){
readSignalFromComp();
}
void readSignalFromComp() {
if (Serial.available() > 0)
foo = '';
while (Serial.available() > 0){
foo += Serial.read();
}
if (!foo.equals(""))
Serial.print(foo);
}
but it doesn't work? what's the problem? | 0 | [
2,
13,
1514,
291,
3252,
13,
45,
184,
1302,
3724,
37,
5956,
60,
800,
3726,
3726,
31,
57,
20,
4705,
51,
13,
10321,
759,
37,
1428,
9,
86,
31,
57,
20,
2660,
4705,
7561,
37,
1428,
20,
13,
1514,
291,
3252,
9,
31,
376,
4705,
14,
23... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create own snmp simulator using snmp4j agent?
===
As per title, I want to create a snmp device agent simulator. Now, in my hand, I have a text file containing a bunch of oids and its value (via snmp walk).
I would like to add all this into the simulator as statics oids. I did create one simple function to test whether it register this oid (I think its correct). But so far, I can't get the result that I've wanted.
I copy and paste the TestAgent code.
public class AgentUtil extends BaseAgent {
static {
LogFactory.setLogFactory(new Log4jLogFactory());
}
private String address;
public static boolean STOP=false;
private Hashtable oid_values = new Hashtable();
public AgentUtil(String address,Hashtable oid_values) throws IOException {
super(new File("conf.agent"), new File("bootCounter.agent"),
new CommandProcessor(new OctetString(MPv3.createLocalEngineID())));
this.address = address;
this.oid_values = oid_values;
agent.setWorkerPool(ThreadPool.create("RequestPool", 4));
}
@Override
protected void registerManagedObjects() {
}
public void registerManagedObject(ManagedObject mo) {
try {
server.register(mo, null);
} catch (DuplicateRegistrationException ex) {
throw new RuntimeException(ex);
}
}
public void registerCustomMO() {
// String key = "";
try {
// Iterator iterator = oid_values.keySet().iterator();
// while(iterator.hasNext()) {
// key = (String) iterator.next();
server.register(createManagedObject(),null);
// }
} catch (DuplicateRegistrationException e) {
e.printStackTrace();
}
}
private ManagedObject createManagedObject() {
VariableBinding vb = new VariableBinding(new OID("0"),new OctetString("WinsXP"));
StaticMOGroup group = new StaticMOGroup(new OID("1.2.3.4.5.6.7"),new VariableBinding[]{vb});
return group;
}
public void unregisterManagedObject(MOGroup moGroup) {
moGroup.unregisterMOs(server, getContext(moGroup));
}
/*
* Empty implementation
*/
@Override
protected void addNotificationTargets(SnmpTargetMIB targetMIB,
SnmpNotificationMIB notificationMIB) {
targetMIB.addDefaultTDomains();
}
/**
* Minimal View based Access Control
*
* http://www.faqs.org/rfcs/rfc2575.html
*/
@Override
protected void addViews(VacmMIB vacm) {
vacm.addGroup(SecurityModel.SECURITY_MODEL_SNMPv2c, new OctetString(
"cpublic"), new OctetString("v1v2group"),
StorageType.nonVolatile);
vacm.addAccess(new OctetString("v1v2group"), new OctetString("public"),
SecurityModel.SECURITY_MODEL_ANY, SecurityLevel.NOAUTH_NOPRIV,
MutableVACM.VACM_MATCH_EXACT, new OctetString("fullReadView"),
new OctetString("fullWriteView"), new OctetString(
"fullNotifyView"), StorageType.nonVolatile);
vacm.addViewTreeFamily(new OctetString("fullReadView"), new OID("1.3"),
new OctetString(), VacmMIB.vacmViewIncluded,
StorageType.nonVolatile);
}
/**
* User based Security Model, only applicable to
* SNMP v.3
*
*/
protected void addUsmUser(USM usm) {
}
protected void initTransportMappings() throws IOException {
transportMappings = new TransportMapping[1];
Address addr = GenericAddress.parse(address);
TransportMapping tm = TransportMappings.getInstance()
.createTransportMapping(addr);
transportMappings[0] = tm;
}
/**
* Start method invokes some initialization methods needed to
* start the agent
* @throws IOException
*/
public void start() throws IOException {
init();
loadConfig(ImportModes.REPLACE_CREATE);
addShutdownHook();
getServer().addContext(new OctetString("public"));
finishInit();
registerCustomMO();
run();
sendColdStartNotification();
}
protected void unregisterManagedObjects() {
// here we should unregister those objects previously registered...
}
/**
* The table of community strings configured in the SNMP
* engine's Local Configuration Datastore (LCD).
*
* We only configure one, "public".
*/
protected void addCommunities(SnmpCommunityMIB communityMIB) {
Variable[] com2sec = new Variable[] {
new OctetString("public"), // community name
new OctetString("cpublic"), // security name
getAgent().getContextEngineID(), // local engine ID
new OctetString("public"), // default context name
new OctetString(), // transport tag
new Integer32(StorageType.nonVolatile), // storage type
new Integer32(RowStatus.active) // row status
};
MOTableRow row = communityMIB.getSnmpCommunityEntry().createRow(
new OctetString("public2public").toSubIndex(true), com2sec);
communityMIB.getSnmpCommunityEntry().addRow(row);
}
public void runAgent() throws IOException, InterruptedException {
while(!STOP) {
System.out.println("Agent running...");
Thread.sleep(5000);
}
}
}
Here's my snmp tester print outs
[Client] Target address : udp:127.0.0.1/162
[Client] Send PDU : GET[requestID=1075357385, errorStatus=Success(0), errorIndex=0, VBS[1.2.3.4.5.6.7 = Null]]
[Client] RESPONSE from 127.0.0.1/162 : noSuchObject
Here's some printout on the agent side
WARN : org.snmp4j.agent.io.MOServerPersistence - Context 'public' is no longer supported by agent
INFO : org.snmp4j.agent.DefaultMOServer - Registered MO StaticMOGroup[root=1.2.3.4.5.6.7,vbs={}] in default context with scope org.snmp4j.agent.DefaultMOScope[lowerBound=1.2.3.4.5.6.7,lowerIncluded=true,upperBound=1.2.3.4.5.6.8,upperIncluded=false]
INFO : org.snmp4j.agent.mo.snmp.NotificationOriginatorImpl - Notification 1.3.6.1.6.3.1.1.5.1 reported with [] for context
Agent running...
Agent running...
Agent running...
Agent running...
Agent running...
Agent running...
Am I doing it correctly?
Regards,
Simon
| 0 | [
2,
184,
20,
1600,
258,
8912,
2554,
24565,
568,
8912,
2554,
300,
728,
2267,
60,
800,
3726,
3726,
28,
416,
581,
15,
31,
259,
20,
1600,
21,
8912,
2554,
3646,
2267,
24565,
9,
130,
15,
19,
51,
224,
15,
31,
57,
21,
1854,
3893,
3503,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
OpenERP model tracking external resource, hooking into parent's copy() or copy_data()
===
I have added a new model (call it crm_lead_external) that is linked via a new one2many on crm_lead.
Thus, my module has two models defined: an updated crm_lead (with _name=crm_lead) and a new crm_lead_external.
This external model tracks a file and as such has a 'filename' field.
I also created a unique SQL index on this filename field.
This is part of my module:
def copy(self, cr, uid, id, default=None, context=None):
if not default:
default = {}
default.update({
'state': 'new',
'filename': '',
})
ret = super(crm_lead_external, self).copy(cr, uid, id, default, context=context)
#do file copy
return ret
The intent here is to allow an external entity to be duplicated, but to retarget the file path.
Now, if I click duplicate on the Lead, I get an IntegrityError on my unique constraint. Is there a particular reason why copy() isn't being called?
Should I add this logic to copy_data()? Myst I really override copy() for the lead?
Thanks in advance. | 0 | [
2,
19597,
306,
1061,
10353,
4886,
6577,
15,
5559,
68,
77,
4766,
22,
18,
4344,
5,
6,
54,
4344,
1,
18768,
5,
6,
800,
3726,
3726,
31,
57,
905,
21,
78,
1061,
13,
5,
9200,
32,
6186,
79,
1,
11846,
1,
1706,
8766,
192,
6,
30,
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... |
c# string replace with backslash buggy?
===
I have the following string:
"\\\\AAA.AA.A.AA\\d$\\ivr\\vm\\2012May\\29\\10231_1723221348.vox"
I would like it to look like:
"\\AAA.AA.A.AA\d$\ivr\vm\2012May\29\10231_1723221348.vox"
I have tried
fileToConvert.Replace(@"\\",@"\")
This produces:
"\\AAA.AA.A.AA\\d$\\ivr\\vm\\2012May\\29\\10231_1723221348.vox"
Why?!?
Thanks all! | 0 | [
2,
272,
5910,
3724,
3934,
29,
97,
18,
9545,
6256,
2687,
60,
800,
3726,
3726,
31,
57,
14,
249,
3724,
45,
13,
7,
1,
22160,
9,
6887,
9,
58,
9,
6887,
1,
43,
4403,
1,
49,
6938,
1,
20147,
1,
3212,
3904,
1,
2738,
1,
1036,
19903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does a stray closing </p> tag generate an empty paragraph?
===
Apparently, if you have a closing `</p>` tag with no matching opening tag within the `body` element, most if not all browsers will generate an empty paragraph in its place:
<!DOCTYPE html>
<title></title>
<body>
</p>
</body>
If any text exists around the closing tag, none of it is wrapped in the `p` element — it is always empty and the text nodes will exist on their own:
<!DOCTYPE html>
<title></title>
<body>
some text</p>more text
</body>
If the above contents of `body` are wrapped in `<p></p>` tags... I'll leave you to guess what happens:
<!DOCTYPE html>
<title></title>
<body>
<p>some text</p>more text</p>
</body>
I can't find any references stipulating that a closing tag with no corresponding opening tag should generate an empty element, but that shouldn't come across as surprising considering that it's not even valid HTML in the first place. Indeed, I've only found browsers to do this with the `p` element (and to some extent the `br` element as well!), but not any explanation as to why.
It is rather consistent across browsers, though, and it applies both in quirks mode and in standards mode. So, it's probably fair to deduce that this is for backward compatibility with early specifications.
In fact, I did find [this comment](http://stackoverflow.com/posts/comments/5830613) on an answer to [a somewhat related question](http://stackoverflow.com/questions/5187113/why-the-html-paragraph-p-behaves-so-oddly-on-my-chrome), which basically confirms it:
> The reason why <p> tags are valid unclosed is that originally <p> was defined as a "new paragraph" marker, rather than p being a container element. Equivalent to <br> being a "new line" marker. You can see so defined in this document from 1992:<http://www.w3.org/History/19921103-hypertext/hypertext/WWW/MarkUp/Tags.html> and this one from 1993: http://www.w3.org/MarkUp/draft-ietf-iiir-html-01.txt Because there were web pages pre-dating the change and browser parsers have always been as backward compatible as possible with existing web content, it's always stayed possible to use <p> that way.
But it doesn't quite explain why parsers treat an explicit closing `</p>` tag (with the slash) as simply... a tag, and generate an empty element in the DOM. Is this part of some parser error handling from way back when the syntax wasn't as strictly defined as it was [more](http://www.w3.org/TR/REC-html32#para) [recently](http://www.w3.org/TR/html401/struct/text.html#edef-P) or something? If so, is it documented anywhere at all? | 0 | [
2,
483,
630,
21,
13545,
4239,
13,
1,
118,
306,
1,
3383,
7920,
40,
2424,
20599,
60,
800,
3726,
3726,
3083,
15,
100,
42,
57,
21,
4239,
13,
1,
118,
306,
1,
3383,
29,
90,
10120,
1214,
3383,
363,
14,
13,
1,
9760,
1,
4520,
15,
127... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Simple and intuitive way to make visual query
===
This question is for UX/UI/GUI... Is there a simple and visual way to make querys?? im looking for a simple and intuitive way... I suppose that the user wish select all fields of a table, but i don't find the way to make simple the filters for this. my boss don't wish a classic query builder, example http://tinypic.com/r/2j2z6et/6
i would appreciate your help. | 1 | [
2,
1935,
17,
13,
24392,
161,
20,
233,
3458,
25597,
800,
3726,
3726,
48,
1301,
25,
26,
13,
7147,
118,
5661,
118,
7215,
9,
9,
9,
25,
80,
21,
1935,
17,
3458,
161,
20,
233,
25597,
18,
60,
60,
797,
699,
26,
21,
1935,
17,
13,
2439... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WinRT serializing a DateTimeOffset
===
I'm working on a Windows 8 Metro application that references a c# WinRT project. Among other things, the c# project makes web requests to an Azure service to perform CRUD operations against a SQL Azure database.
When performing a POST operation on the service, I'm serializing an instance of a class and putting it in the body of the request.
public sealed class Foo
{
int FooId { get; set; }
DateTimeOffset FooDate { get; set; }
}
When this is serialized using the `DataContractJSONSerializer`, the result is something like this:
{"FooId":1,"FooDate":{"DateTime":"/Date(1342732970000)/","OffsetMinutes":-420}}
FYI that this is 7/19/2012 2:22:50PM -07:00.
OK great ... Only problem is that the Azure service is expecting just a `DateTime`, not a `DateTimeOffset`. I don't own the Azure service so I can't change its behavior.
So (ignoring that I'm losing the offset) what I need is this to serialize into:
{"FooId":1,"FooDate":"/Date(1342732970)/"}
My first approach was to add a new aliased `DateTime` property/datamember to the class with a getter that returns the `DateTime` portion of the `DateTimeOffset`. However, WinRT doesn't support the DateTime type.
There are a couple of hacky ways to get around this, but I wanted to see if there's an elegant way to do this before resorting to one of these:
- Regex on the serialization result before the POST
- String property on the class that returns a JSON formatted date
Thanks | 0 | [
2,
628,
5256,
5956,
3335,
21,
1231,
891,
1299,
3554,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
1936,
469,
3986,
3010,
30,
7231,
21,
272,
5910,
628,
5256,
669,
9,
497,
89,
564,
15,
14,
272,
5910,
669,
1364,
2741,
12279,
20,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Vb6 component on Windows 2003 R2 won't register
===
I'm trying to deploy some Vb6 components on a Windows Server 2003 Standard x64 R2. I normally run these in a com+ application and I went through the normal routine of creating the COM+ application and adding all the components. Everything seemed to work fine until I actually tried to use any of the components. I would some kind of "ActiveX component can't create object" or "Application-defined or object-defined error" or something similar to that.
To remove as many variables a possible I created a very simple VB form to consume the simpliest of the components and tried that. Nope. So I created a simple install to install the component, and whooo hoooo it worked. So I tried one of the more envolved components with high hopes ... but no after the install I still can't call the component successfully. Using Dependency Walker I discovered that for some reason the msvbvm60.dll is not properly registerd.
I've downloaded VBRUN60.exe and VBRUN60SP6.exe and tried installing them. Even going so far as to do a run as with the administrator account and removing the check box for "Run this program with restricted access". I've tried to manually register the msvbvm60.dll in the SysWow64 directory.
Nothing seems to work. It just won't register. Does anybody have any suggestions? At this point I'll try just about anything.
Thanks
dbl | 0 | [
2,
13,
20468,
379,
5912,
27,
1936,
973,
761,
135,
230,
22,
38,
2243,
800,
3726,
3726,
31,
22,
79,
749,
20,
17617,
109,
13,
20468,
379,
5090,
27,
21,
1936,
8128,
973,
1236,
993,
3470,
761,
135,
9,
31,
4147,
485,
158,
19,
21,
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... |
Android X PC Controll and Access APP
===
I have a project and my idea was to make an android app that can access and somewhat control a computer through any wireless method but hoping it can access through internet. The idea is like an internet cafe client where you are block of using it unless you will be log in from a server or input an account. Instead of using a server to log in the client, I would like to log it in using android. I am totally new to android and I am willing to start form the basic to understand it fully. I just want to ask what method will I use soon to be able to make this kind of app so that I will be guided correctly . What programming language can I use in my PC based app to be able to communicate with android. I have only 1 month left for the 30% of my app and 5 months for the finish app.
Thank you | 0 | [
2,
13005,
993,
5168,
569,
255,
17,
1381,
4865,
800,
3726,
3726,
31,
57,
21,
669,
17,
51,
882,
23,
20,
233,
40,
13005,
4865,
30,
92,
1381,
17,
4131,
569,
21,
1428,
120,
186,
10149,
2109,
47,
3935,
32,
92,
1381,
120,
2620,
9,
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... |
Should I learn WPF 4 if my goal is to develop for WinRT?
===
I have recently been reading Adam Nathan's excellent [WPF 4 Unleashed][1] book. However, my goal is to be able to develop WinRT applications ( using C# ) and I have already noticed some differences between WinRT ( WPF 4.5? ) and WPF 4 which is discussed in the book, such as WinRT doesn't have a DockPanel or Label controls and there is a some code in App.xaml.cs that basic WPF4 applications doesn't have.
So, I am just wondering if there are some other major differences between WinRT and normal WPF4 applications and if I should find a tutorial or a book which is about WinRT specifically ( by the way, feel free to suggest one ).
[1]: http://www.amazon.com/WPF-4-Unleashed-Adam-Nathan/dp/0672331195/ref=sr_1_1?s=books&ie=UTF8&qid=1342740941&sr=1-1&keywords=wpf%204 | 4 | [
2,
378,
31,
2484,
619,
7721,
268,
100,
51,
1195,
25,
20,
2803,
26,
628,
5256,
60,
800,
3726,
3726,
31,
57,
1989,
74,
1876,
2406,
6222,
22,
18,
5977,
636,
499,
7721,
268,
25092,
500,
2558,
165,
500,
360,
9,
207,
15,
51,
1195,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Best way to promote android app?
===
I just released an android game (free and paid) but I want to know what's the best way to promote the game?
I've used the usual places to promote it, fb and twitter... but not much improvement so far.
the game's name is Baxal, it's a mayan tower defense game
thanks in advance for any help! :) | 4 | [
2,
246,
161,
20,
3947,
13005,
4865,
60,
800,
3726,
3726,
31,
114,
261,
40,
13005,
250,
13,
5,
4639,
17,
2192,
6,
47,
31,
259,
20,
143,
98,
22,
18,
14,
246,
161,
20,
3947,
14,
250,
60,
31,
22,
195,
147,
14,
3820,
1489,
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... |
as3 marquee select drag multiple child objects
===
Can anyone tell me how to achieve marquee selection effect with AS3 to select multiple movieclips by drawing a dynamic rectangle around them and then drag and drop them anywhere? | 0 | [
2,
28,
240,
1423,
2005,
62,
5407,
5501,
1886,
850,
3916,
800,
3726,
3726,
92,
1276,
494,
55,
184,
20,
4689,
1423,
2005,
62,
3155,
1590,
29,
28,
240,
20,
5407,
1886,
1308,
150,
6013,
18,
34,
3533,
21,
7782,
27181,
140,
105,
17,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Fastest Drawing Possible, Pen Assignment and if statement
===
Which is the most efficient & which is (subjectively) the most readable? (Another developer wrote the second option and I want to be sure I have a good reason for changing it to match the first option below)
Pen pen = Pens.Red;
if (highlight)
pen = new Pen(Color.Red, 3.0f);
or
Pen pen;
if (highlight)
pen = new Pen(Color.Red, 3.0f);
else
pen = Pens.Red;
I know that it makes a marginal difference, but I have a draw algorithm that needs to be literally as fast as possible! so every little bit helps. And no, using another language to handle the drawing is not an option at this point.
Thanks for the help! | 0 | [
2,
7518,
3533,
938,
15,
2402,
8427,
17,
100,
3331,
800,
3726,
3726,
56,
25,
14,
127,
8243,
279,
56,
25,
13,
5,
28743,
1284,
102,
6,
14,
127,
1302,
579,
60,
13,
5,
14945,
10058,
738,
14,
153,
4255,
17,
31,
259,
20,
44,
562,
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... |
Ruby evaluation order
===
print sentence.scan(/\[(\w+)\]/).all? do |word|
@words.keys.include? word[0].to_sym
end
I've printed the individual values of `@words.keys.include? word[0].to_sym` and they are not all true, yet it prints `true`. I think this might be because its evaluated like so:
(print sentence.scan(/\[(\w+)\]/).all?) do |word|
@words.keys.include? word[0].to_sym
end
but I want it to evaluate like
print (sentence.scan(/\[(\w+)\]/).all? do |word|
@words.keys.include? word[0].to_sym
end)
However, adding the parentheses results in
syntax error, unexpected keyword_do_block, expecting ')'
**How do I change the order in which the piece of code is evaluated?** | 0 | [
2,
10811,
8670,
389,
800,
3726,
3726,
4793,
5123,
9,
18,
1245,
5,
118,
1,
2558,
5,
1,
499,
2430,
6,
1,
500,
118,
6,
9,
1233,
60,
107,
13,
1,
9587,
1,
13,
1,
12827,
9,
4237,
18,
9,
22640,
60,
833,
2558,
387,
500,
9,
262,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.lang.NoClassDefFoundError: javax/persistence/Persistence... axis2 and eclipselink
===
I want to deploy axis2 web services in netbeans, i installed the plugin axis2 in netbeans. Also i use EclipseLink 2.0 to connect a db. My connection is successful when i use in a main class that i created. But when i try to test my web services in netbeans with right click on the services throw this exception:
[ERROR] javax/persistence/Persistence
java.lang.NoClassDefFoundError: javax/persistence/Persistence
at db.util.ManageConnection.getStatsEntityManagerFactory(ManageConnection.java:33)
at services.LoginService.loginService(LoginService.java:31)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:194)
at org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver.invokeBusinessLogic(RPCInOnlyMessageReceiver.java:63)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:114)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:173)
at org.apache.axis2.transport.http.util.RESTUtil.invokeAxisEngine(RESTUtil.java:135)
at org.apache.axis2.transport.http.util.RESTUtil.processURLRequest(RESTUtil.java:130)
at org.apache.axis2.transport.http.AxisServlet$RestRequestProcessor.processURLRequest(AxisServlet.java:825)
at org.apache.axis2.transport.http.AxisServlet.doGet(AxisServlet.java:271)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: Class Not found : javax.persistence.Persistence
at org.apache.axis2.deployment.DeploymentClassLoader.findClass(DeploymentClassLoader.java:92)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.apache.axis2.deployment.DeploymentClassLoader.loadClass(DeploymentClassLoader.java:273)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 31 more
[ERROR] org.apache.axis2.AxisFault: javax/persistence/Persistence
I can deploy others services that not contain connections with eclipselink (entityManager...)..
I found in others forum with the same problem but they're using hibernate, that the solution is add to classpath this: hibernate-jpa-2.0-api-1.0.0.Final.jar, in this link [http://www.coderanch.com/t/513512/ORM/databases/Error-java-lang-NoClassDefFoundError-javax][1]
But I dont Know what is the problem with EclipseLink i dont know if i add other library and where.. thank you very much...
This my service class
public class LoginService {
EntityManagerFactory emf = ManageConnection.
getStatsEntityManagerFactory(PersistenceConfiguration.
getPERSISTENCE_UNIT_NAME());
public String prubaServicioWeb(String nombre) {
return nombre + " Welcome";
}
public void loginService(String whatever) {
BankJpaController bankController = new
BankJpaController(emf);
Bank bank = new Bank();
bank.setId(null);
bank.setBankCode("BNSJ");
bank.setName("Bank of America");
bankController.create(bank);
}
}
[1]: http://www.coderanch.com/t/513512/ORM/databases/Error-java-lang-NoClassDefFoundError-javax | 0 | [
2,
8247,
9,
9949,
9,
251,
1898,
13862,
12235,
29992,
45,
8247,
396,
118,
7490,
702,
2940,
118,
7490,
702,
2940,
9,
9,
9,
8577,
135,
17,
11652,
6258,
800,
3726,
3726,
31,
259,
20,
17617,
8577,
135,
2741,
687,
19,
4275,
863,
5950,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Getting full model object from a combobox in ExtJs?
===
If I have a store backed combobox selection that fires an event under ExtJS 4, how do I go about getting the full object that is represented by that selection? | 0 | [
2,
1017,
503,
1061,
3095,
37,
21,
22621,
5309,
19,
1396,
38,
728,
18,
60,
800,
3726,
3726,
100,
31,
57,
21,
1718,
6334,
22621,
5309,
3155,
30,
11327,
40,
807,
131,
1396,
38,
728,
18,
268,
15,
184,
107,
31,
162,
88,
1017,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Google maps spiderfy function - more than one marker at the same point
===
I'm trying to use the Overlapping Marker Spiderfier for Google Maps API v3 found here. (my questions are at the bottom of this block of text/code)
https://github.com/jawj/OverlappingMarkerSpiderfier/blob/master/README.textile
The page I'm trying to implement it on is a bit different than the code they use on their source code page. They initialize their page and implement all of their function calls within the initialization function. My page initializes the map and loads one point, and then additional points are added later using a separate function (through geocoding).
So, essentially at this point the map has been initialized, now I call my database to get new locations to add.
var cityArray= <?php echo json_encode($cityArray); ?>; //get the city
var title = <?php echo json_encode($title); ?>; //and the title to go on it's infowindow
function plotMarkers(){
for(var i = 0; i < <?php echo json_encode($length); ?>; i++){
codeAddresses(cityArray[i],title[i]); //geocode the address
}
}
So, this snippet above gives me two arrays; one with a location, and one with the title to go in the info window. The
So, now here's the codeAddresses function that geocodes the address, and adds that marker to the map. As you can see from the plotMarkers function, the arrays are looped through and added to the codeAddresses funciton.
function codeAddresses(address,title){
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
google.maps.event.addListener(marker, 'click', (function(marker) {
return function() {
infowindow.setContent(title);
infowindow.open(map, marker);
}
})(marker));
}
});
}
My question is do I add the listeners (on the page linked above) to my first function that loads the first point, or should I add it to the codeAddresses function?
Also, should I include this in my codeAddresses function or somewhere else? If it does go in codeAddresses, does that mean I can get rid of the for loop because codeAddresses is triggered from a loop (and gets run during each iteration)?
for (var i = 0; i < window.mapData.length; i ++) {
var datum = window.mapData[i];
var loc = new gm.LatLng(datum.lat, datum.lon);
var marker = new gm.Marker({
position: loc,
title: datum.h,
map: map
});
marker.desc = datum.d;
oms.addMarker(marker); // <-- here
}
| 0 | [
2,
8144,
6867,
5650,
9596,
1990,
13,
8,
91,
119,
53,
13289,
35,
14,
205,
454,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
14,
23854,
13289,
5650,
1707,
106,
26,
8144,
6867,
21,
2159,
566,
240,
216,
235,
9,
13,
5,
915,
2346,
50,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 modifiers should I give a variable in this code example?
===
what modifiers should I give the variable, `label`, in this code example below?
I am new to Java, but the first thing I wanted to do was break out all the classes I can use in swing like JLabel and make it so I can call them dynamically. I hope I did that below. But yeah I was not sure about `private static JLabel label;` because ultimately I want to be able to declare all of the swing classes in a master file somewhere. Thanks.
package base;
import java.awt.Component;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class CreateLabel extends JLabel {
private static final long serialVersionUID = 1L;
private static JLabel label;
public Component createLabel(JFrame frame, String text) {
label = new JLabel(text);
return frame.getContentPane().add(label);
}
} | 0 | [
2,
98,
7226,
16292,
18,
378,
31,
590,
21,
7612,
19,
48,
1797,
823,
60,
800,
3726,
3726,
98,
7226,
16292,
18,
378,
31,
590,
14,
7612,
15,
13,
1,
21018,
1,
15,
19,
48,
1797,
823,
1021,
60,
31,
589,
78,
20,
8247,
15,
47,
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... |
Xpages web analytics that is not Google Analytics. Can it be installed locally on the server?
===
I have an Xpages website that is very secure and has a requirement to have comprehensive user tracking. Therefore the use of things like Google analytics is not viable as it sends user data out from the server (customer requirement that web tracking be loaded on server).
What web analytics software can I install on the server, that will give me feature rich tracking for (SSL delivered pages )so that I can see what each user is doing and perhaps where they are struggling or loosing interest etc.
In other words, everything google anaytics gives me, but one installed on the server.
Thanks
Damien | 2 | [
2,
993,
6486,
18,
2741,
26320,
30,
25,
52,
8144,
26320,
9,
92,
32,
44,
4066,
6680,
27,
14,
8128,
60,
800,
3726,
3726,
31,
57,
40,
993,
6486,
18,
2271,
30,
25,
253,
4315,
17,
63,
21,
8981,
20,
57,
7041,
4155,
10353,
9,
1793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
deleted object would be re-saved by cascade (remove deleted object from associations)
===
i have the following two entities:
**1- PlayList:**
@OneToMany(fetch = FetchType.EAGER, mappedBy = "playlist", orphanRemoval = true, cascade = CascadeType.ALL)
@OrderBy("adOrder")
private Set<PlaylistadMap> PlaylistadMaps = new HashSet<PlaylistadMap>(0);
- **CascadeType.ALL**: is needed for save and update on the PlaylistadMap collection when saving or updating the playlist entity.
- **orphanRemoval = true**: is needed when deleting the playlist entity, the PlaylistadMap references should be deleteed too.
**2- PlaylistadMap:**
@ManyToOne(fetch = FetchType.EAGER)
@JoinColumn(name = "fk_playlist", referencedColumnName = "pkid", nullable = false)
private Playlist playlist;
when deleting a playlist by using `getCurrentSession().delete();` i am getting the following exception:
org.springframework.dao.InvalidDataAccessApiUsageException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.xeno.advertisingsuite.web.domain.PlaylistadMap#6]; nested exception is org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.xeno.advertisingsuite.web.domain.PlaylistadMap#6]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:657)
at org.springframework.orm.hibernate3.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:793)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:664)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:393)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:120)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
at $Proxy54.deletePlayList(Unknown Source)
at com.xeno.advertisingsuite.web.beans.PlayListBean.deletePlaylist(PlayListBean.java:282)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.el.parser.AstValue.invoke(AstValue.java:262)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 103 more
Caused by: org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations): [com.xeno.advertisingsuite.web.domain.PlaylistadMap#6]
at org.hibernate.impl.SessionImpl.forceFlush(SessionImpl.java:1220)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:188)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:117)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:93)
at org.hibernate.impl.SessionImpl.fireSaveOrUpdate(SessionImpl.java:677)
at org.hibernate.impl.SessionImpl.saveOrUpdate(SessionImpl.java:669)
at org.hibernate.engine.CascadingAction$5.cascade(CascadingAction.java:252)
at org.hibernate.engine.Cascade.cascadeToOne(Cascade.java:392)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:335)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascadeCollectionElements(Cascade.java:425)
at org.hibernate.engine.Cascade.cascadeCollection(Cascade.java:362)
at org.hibernate.engine.Cascade.cascadeAssociation(Cascade.java:338)
at org.hibernate.engine.Cascade.cascadeProperty(Cascade.java:204)
at org.hibernate.engine.Cascade.cascade(Cascade.java:161)
at org.hibernate.event.def.AbstractFlushingEventListener.cascadeOnFlush(AbstractFlushingEventListener.java:154)
at org.hibernate.event.def.AbstractFlushingEventListener.prepareEntityFlushes(AbstractFlushingEventListener.java:145)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:88)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1206)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:375)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:137)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:656)
please advise how to fix this exception. | 0 | [
2,
19584,
3095,
83,
44,
302,
8,
19863,
43,
34,
13542,
13,
5,
99,
16598,
19584,
3095,
37,
10642,
6,
800,
3726,
3726,
31,
57,
14,
249,
81,
12549,
45,
13,
1409,
165,
8,
27063,
45,
1409,
13,
1,
849,
262,
14842,
5,
410,
19913,
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... |
Issues with backbone.js binding
===
i'm new to backbone and trying to get a model update to update my html through binding but having no luck. I'm using the jquery.window plugin to create the popup window. Check i press the change-title button and update my models title, the html doesn't get updated. Would really appreciate any help, Thanks
Eric
Here is my code
HTML:
<!DOCTYPE html>
<html>
<head>
<title>I have a back bone</title>
</head>
<body>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js"></script>
<script src="js/jquery.window.js"></script>
<script src="js/underscore.js"></script>
<script src="js/backbone.js"></script>
<script src="js/app.js"></script>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/jquery.window.css">
<button id="add-window">Add Window</button>
<button id="change-title">Change Title</button>
<script type="text/template" id="search_template">
<label><%= title %></label>
<input type="text" id="search_input" />
<input type="button" id="search_button" value="Search" />
</script>
</body>
</html>
Javascript:
(function($) {
AppWindow = Backbone.Model.extend({
title : "John",
window : null
});
AppWindows = Backbone.Collection.extend({
initialize : function(models, options) {
this.bind("add", options.view.addWindowView);
}
});
WindowView = Backbone.View.extend({
initialize : function(){
_.bindAll(this, "render");
this.model.bind("change:title");
this.template = _.template($("#search_template").html());
this.render().el;
},
render : function(){
var formString = this.template(this.model.toJSON());
var win = $.window({
icon : 'http://www.fstoke.me/favicon.ico',
title : this.model.get("title"),
content : formString,
x : 80,
y : 80,
resizable : true,
});
this.el = $("#" + win.getWindowId()+".window_frame");
this.delegateEvents(this.events);
return this;
}
});
AppView = Backbone.View.extend({
views: {},
el : $("body"),
initialize : function() {
this.appWindows = new AppWindows(null, {
view : this
});
},
events : {
"click #add-window" : "addWindow",
"click #change-title" : "changeTitle"
},
addWindow : function() {
var window_title = "Eric";
var window_model = new AppWindow({
title : window_title
});
// Add a new model to our friend collection
this.appWindows.add(window_model);
},
changeTitle : function(){
var win = this.appWindows.at(0);
win.set("title", "jamjamajm");
},
addWindowView : function(model) {
var view = new WindowView({
model : model
});
model.set("window", view);
},
deleteWindow : function(wnd){
console.log("deleteing");
}
});
var appview = new AppView;
})(jQuery);
| 0 | [
2,
1549,
29,
24036,
9,
728,
18,
8728,
800,
3726,
3726,
31,
22,
79,
78,
20,
24036,
17,
749,
20,
164,
21,
1061,
11100,
20,
11100,
51,
13,
15895,
120,
8728,
47,
452,
90,
5419,
9,
31,
22,
79,
568,
14,
487,
8190,
93,
9,
27508,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SQLCE Subquery for smart device application
===
I crate two tables name abc1 and xyz.
abc1 having column id, name and add. where xyz table having id, mob.
select name from abc1 where id =(select id from xyz)
getting an error There was an error parsing the query. [ Token line number = 1,Token line offset = 34,Token in error = select ]
please help me on this query. | 0 | [
2,
4444,
255,
1105,
972,
8190,
93,
26,
3978,
3646,
3010,
800,
3726,
3726,
31,
19904,
81,
7484,
204,
5079,
165,
17,
13,
15161,
380,
9,
5079,
165,
452,
4698,
4924,
15,
204,
17,
3547,
9,
113,
13,
15161,
380,
859,
452,
4924,
15,
732... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Mixed mode assembly when creating tables while running setup , Installer class
===
I have window application,have made some `custom action`, Edit `userinterface` retrieving values from user while installing application and further in installer class while creating tables am getting below error message
Mixed mode assembly is built against version 'v2.0.50727' of the runtime and cannot
be loaded in the 4.0 runtime without additional configuration information.
I google a lot and found that adding below will solve problem *(Not worked for me)*
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
<supportedRuntime version="v2.0.50727"/>
</startup>
previously my app.confg look like
<startup>
<supportedRuntime version="v2.0.50727"/>
</startup>
Code : Installer1.cs
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
string targetDirectory = Context.Parameters["targetdir"];
string servername = Context.Parameters["dbservername"];
string dbname = Context.Parameters["dbname"];
string strconnectionstring = "Data Source='" + servername + "';Initial Catalog='" + dbname + "';Integrated Security=True";
if (servername == "")
{
throw new InstallException("You did not Specify SQL Servername!");
}
else if (dbname == "")
{
throw new InstallException("You did not specify the database name!");
}
string exePath = string.Format("{0}abc..exe", targetDirectory);
System.Configuration.Configuration conf = ConfigurationManager.OpenExeConfiguration(exePath);
conf.ConnectionStrings.ConnectionStrings["abc"].ConnectionString = strconnectionstring;
conf.Save(ConfigurationSaveMode.Modified);
using (SqlConnection con1 = new SqlConnection(strconnectionstring))
{
System.Diagnostics.Debugger.Break();
string getScript = "Use " + dbname + "; CREATE TABLE supportContacts ( id int identity primary key, type varchar(20), details varchar(30) )";
string strscript = getScript;
Server server = new Server(new ServerConnection(con1));
server.ConnectionContext.ExecuteNonQuery(strupdatescript);
con1.Close();
}
}
While debugging i get to know error occur at
`server.ConnectionContext.ExecuteNonQuery(strupdatescript);` | 0 | [
2,
7019,
2198,
3740,
1475,
76,
2936,
7484,
133,
946,
18161,
13,
15,
16146,
106,
718,
800,
3726,
3726,
31,
57,
1463,
3010,
15,
5815,
117,
109,
13,
1,
4636,
6015,
1028,
1,
15,
9392,
13,
1,
16704,
6280,
6413,
1,
13,
6239,
3272,
839... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Slider option default value select while creating
===
I m using sliderUI and i modified it little bit.
I tried lot of javascript code, but didnt work. For example this ones;
var text1 = 'Two';
$("select option").filter(function() {
return $(this).text() == text1;
}).attr('selected', true);
$(document).ready(function() {
if (!$("#mySelect option:selected").length)
$("#mySelect option[value='3']").attr('selected', 'selected');});
My code is like this ;
<fieldset style="font-size:12px; font-family:Calibri;">
<select name="valueAA" id="valueAA" style="visibility:hidden;">
<option value="0">0</option>
<option value="5" selected="selected">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="100" >100</option>
<option value="250">250</option>
<option value="500">500</option>
<option value="750">750</option>
<option value="1000">1000</option>
</select>
<select name="valueBB" id="valueBB" style="visibility:hidden;">
<option value="0">0</option>
<option value="5">5</option>
<option value="10">10</option>
<option value="15">15</option>
<option value="25">25</option>
<option value="50">50</option>
<option value="75">75</option>
<option value="100">100</option>
<option value="250">250</option>
<option value="500">500</option>
<option value="750" selected="selected">750</option>
<option value="1000" >1000</option>
</select>
</fieldset>
$(function () {
$('select#valueAA, select#valueBB').selectToUISlider({
labels: 12
});
fixToolTipColor();
});
function fixToolTipColor() {
$('.ui-tooltip-pointer-down-inner').each(function () {
var bWidth = $('.ui-tooltip-pointer-down-inner').css('borderTopWidth');
var bColor = $(this).parents('.ui-slider-tooltip').css('backgroundColor')
$(this).css('border-top', bWidth + ' solid ' + bColor);
});
}
I am getting last position of slider from query like this;
var filtersValuesAndParametres = new Array();
var queryStrings = window.location.href.slice(window.location.href.indexOf('?') + 1);
filtersValuesAndParametres = queryStrings.split(/[=&]/);
And I want to chande default values to my values. I changed inside of select, but i couldnt move the bar.
[Here][1] its demo. I m using last one.
Do you have any advice for it ?
[1]: http://www.filamentgroup.com/examples/slider_v2/index.html | 1 | [
2,
3295,
106,
4255,
12838,
1923,
5407,
133,
2936,
800,
3726,
3726,
31,
307,
568,
6464,
1820,
49,
17,
31,
5372,
32,
265,
1142,
9,
31,
794,
865,
16,
8247,
8741,
1797,
15,
47,
1182,
170,
9,
26,
823,
48,
53,
18,
73,
4033,
1854,
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... |
Native calendar issue
===
How to fetch events from native calendar with minimum delay, i don't ask about the code of fetching events, i ask about the performance of fetching and best way to enhance it? | 0 | [
2,
1275,
7036,
1513,
800,
3726,
3726,
184,
20,
18312,
963,
37,
1275,
7036,
29,
5187,
7255,
15,
31,
221,
22,
38,
1349,
88,
14,
1797,
16,
18312,
68,
963,
15,
31,
1349,
88,
14,
956,
16,
18312,
68,
17,
246,
161,
20,
10734,
32,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to extend or override functionality/methods of a CakePHP Core Helper
===
This: http://stackoverflow.com/questions/5613899/cakephp-override-htmlhelperlink asks a very similar question, but there were no complete answers. Perhaps now, with Cake 2 out, there will be.
I want to create a custom helper that is a subclass of Cake's Paginator Helper. I want my new helper to override the 'numbers' method of Cake's Paginator helper, but I want it to inherit all other methods.
Is it possible to extend core helpers in this way? Obviously, I don't want to: modify the Cake Core; put unnecessary code in the AppHelper superclass; or duplicate the entire core Pagination Helper into my new helper. | 0 | [
2,
184,
20,
7206,
54,
84,
11891,
18548,
118,
5909,
1807,
43,
18,
16,
21,
8390,
26120,
2884,
448,
106,
800,
3726,
3726,
48,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
3776,
13993,
3483,
118,
17568,
26120,
8,
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... |
Formating HTML within jQuery
===
So guys, I just want to format a string with jQuery, the string can be with closed html tags `<div><h2></h2><span></span></div>` or without it such as `<div><h2></h2><span>`, or it may contains images such as `<img src=""/>`, but I need to format it to have as result only plain text, I suppose that this can be done with a regex, I googled it, but could not find such an example.
So if you could help me, I'll be very thankful for help. Thanks | 0 | [
2,
2595,
68,
13,
15895,
363,
487,
8190,
93,
800,
3726,
3726,
86,
2776,
15,
31,
114,
259,
20,
2595,
21,
3724,
29,
487,
8190,
93,
15,
14,
3724,
92,
44,
29,
827,
13,
15895,
3383,
18,
13,
1,
12916,
1,
252,
135,
1,
118,
252,
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... |
How to format negative numbers as red, with black for positive numbers
===
I am using the following code snippet to format numbers in an iPad project using UIKit.h, but I can't figure out how to make negative numbers show as red. What I've tried, based on the documentation, isn't working. Would appreciate some suggestions on this.
NSNumberFormatter *decimalStyle = [[[NSNumberFormatter alloc] init] autorelease];
[decimalStyle setFormatterBehavior:NSNumberFormatterBehavior10_4];
[decimalStyle setNumberStyle:NSNumberFormatterDecimalStyle];
[decimalStyle setPositiveFormat:@"###,###,##0"];
[decimalStyle setNegativeFormat:@"(###,##0)"];
| 0 | [
2,
184,
20,
2595,
3682,
2116,
28,
402,
15,
29,
319,
26,
2221,
2116,
800,
3726,
3726,
31,
589,
568,
14,
249,
1797,
13,
29061,
20,
2595,
2116,
19,
40,
31,
8240,
669,
568,
13,
5661,
13703,
9,
252,
15,
47,
31,
92,
22,
38,
1465,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS :: Custom base64 image cursor with Opera - possible?
===
I have the following Javascript:
document.getElementById("test").style.cursor =
"url('data:image/png;base64," +
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAdUlEQVR42qW" +
"TSw7AIAhEZ8XCA3AFlt7/dG3SxEatQ1FIjGDg8Yu4HAHwHNeHBfSB7X0FQ+" +
"/EMjM9BXjvuYWI3kOOAAPMGx7bzFQNtta22Bpohkgl2AmigBNICjDMLdP/B" +
"xCB1Fr5Z2qiqhRgZv8AEaGAUspg3wU3VkqQQyYrAAAAAElFTkSuQmCC'), default";
And it works with **Google Chrome**, but not with **Opera**. Any known reason or workaround possible?
Same style for background image works in Opera just fine >>
document.body.style.backgroundImage =
"url('data:image/png;base64," +
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAdUlEQVR42qW" +
"TSw7AIAhEZ8XCA3AFlt7/dG3SxEatQ1FIjGDg8Yu4HAHwHNeHBfSB7X0FQ+" +
"/EMjM9BXjvuYWI3kOOAAPMGx7bzFQNtta22Bpohkgl2AmigBNICjDMLdP/B" +
"xCB1Fr5Z2qiqhRgZv8AEaGAUspg3wU3VkqQQyYrAAAAAElFTkSuQmCC')";
| 0 | [
2,
272,
18,
18,
13,
45,
45,
5816,
1000,
3470,
1961,
29588,
29,
1877,
13,
8,
938,
60,
800,
3726,
3726,
31,
57,
14,
249,
8247,
8741,
45,
4492,
9,
3060,
27567,
779,
1340,
5,
7,
10543,
7,
6,
9,
4381,
9,
4734,
18,
248,
800,
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... |
MySQL CURRENT_TIMESTAMP as DEFAULT
===
While creating a table I am getting the following error:
ERROR 1293 (HY000): Incorrect table definition; there can be only one TIMESTAMP column with CURRENT_TIMESTAMP in DEFAULT or ON UPDATE clause
The problem is that I don't actually have two columns `TIMESTAMP` with `CURRENT_TIMESTAMP` as default, neither I am using `ON UPDATE` clause.
The DDL query I'm trying to execute is
CREATE TABLE user(
/* Basic Information */
id INT NOT NULL AUTO_INCREMENT,
firstname VARCHAR(255) NOT NULL,
surname VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
username VARCHAR(255) NOT NULL UNIQUE,
password CHAR(40) NOT NULL,
/* System status information */
active BOOL NOT NULL DEFAULT FALSE,
validated BOOL NOT NULL DEFAULT FALSE,
date_validated TIMESTAMP,
date_registered TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
/* Index */
PRIMARY KEY (id)
) Engine=InnoDB;
What's causing the issue? | 0 | [
2,
51,
18,
22402,
866,
1,
891,
384,
10158,
28,
12838,
800,
3726,
3726,
133,
2936,
21,
859,
31,
589,
1017,
14,
249,
7019,
45,
7019,
390,
4069,
13,
5,
5608,
3993,
6,
45,
18867,
859,
5465,
73,
80,
92,
44,
104,
53,
436,
38,
10158,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Method lookup for class singleton methods in Ruby
===
I was under the impression that `obj.method` caused ruby to look for `method` thusly:
1. Look in `obj`'s singleton class.
2. Look in the modules included by `obj`'s singleton class.
3. Look in `obj`'s class.
4. Look in the modules included by `obj`'s class
5. *repeat steps 3 and 4 on the class's superclass until found*
6. If never found, call `method_missing` on the original object, `obj`.
Under this model, the **only** singleton class searched for the method is the singleton class of the original receiver, `obj`. However, this model can't explain the fact that a subclass can access its superclass's singleton methods. For example
class Foo
def self.foo
"foo"
end
end
class Bar < Foo
end
Bar.foo #=> "foo"
I'm confused because I believe this means that `Foo`'s singleton class is at some point searched for the method `foo`. However, under the model above, I would expect that only `Bar`'s singleton class would be searched for `foo`. Failing that, I would expect ruby to look in `Bar`'s class, `Class`, and then continue crawling up the superclass chain (skipping `Foo` and its singleton class completely).
So my question: what is missing from my understanding of Ruby method lookup which explains the fact that a class can access its superclass's singleton methods?
| 0 | [
2,
2109,
361,
576,
26,
718,
345,
444,
3195,
19,
10811,
800,
3726,
3726,
31,
23,
131,
14,
6394,
30,
13,
1,
111,
11741,
9,
5909,
1807,
43,
1,
1497,
10811,
20,
361,
26,
13,
1,
5909,
1807,
43,
1,
1086,
102,
45,
137,
9,
361,
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... |
apply a function of package moonsun in R
===
I'm trying to apply a function to all the 334 rows of data frame M, which contains time and position data and get one value for each row. Instead, I get a list of 334 values for each row. How can I simply get one value per row calculated from the values of the variables of that same row?
These are the head and the tail of data frame M:
d mo y lat long
5 6 2007 NA NA
6 6 2007 NA NA
7 6 2007 NA NA
8 6 2007 26.89 15.53
9 6 2007 28.00 15.73
10 6 2007 22.41 14.93
...
26 4 2008 23.86 14.05
27 4 2008 24.12 14.34
28 4 2008 27.75 12.87
29 4 2008 27.28 10.91
30 4 2008 24.17 14.44
1 5 2008 NA NA
My code:
f1= function(x){options(latitude= M$lat, longitude= M$long); as.lt(moon.rst(jday = jd(M$y,M$mo,M$d)))}
M$rs<- apply(M, 1, f1).
Thank you very much for your help,
Santi | 0 | [
2,
5645,
21,
1990,
16,
6030,
2121,
7843,
19,
761,
800,
3726,
3726,
31,
22,
79,
749,
20,
5645,
21,
1990,
20,
65,
14,
13,
24606,
11295,
16,
1054,
3523,
307,
15,
56,
1588,
85,
17,
649,
1054,
17,
164,
53,
1923,
26,
206,
3131,
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... |
JMockit - possible to disable mocking of test method parameters?
===
When using the JMockit library with TestNG, JMockit automatically mocks out all of the parameters passed in to each test method. Unfortunately this conflicts with some annotations we have developed to help handle large amounts of data needed for tests. We annotate our methods with @TestData which takes the class name and the method name and looks for data files named appropriately. It then does some parsing of these files and passes the data into the method as parameters. It changes behavior based on what kind of file it is (CSV, XML, etc.) The code is complex, so I can't copy it here, but I hope you understand the idea.
However, I believe there should be a way to turn off the parameter mocking behavior of JMockit. But I just can't find it anywhere in the documentation. For instance, the following code works properly when JMockit is on the classpath. (This is taken directly from the TestNG Documentation)
//This method will provide data to any test method that declares that its Data Provider
//it named "test1"
@DataProvider(name = "test1")
public Object[][] createData1() {
return new Object[][] {
{ "Cedric", new Integer(36) },
{ "Anne", new Integer(37)},
};
}
//This test method declares that its data should be supplied by the Data Provider
//named "test1"
@Test(dataProvider = "test1")
public void verifyData1(String n1, Integer n2) {
System.out.println(n1 + " " + n2);
}
This just prints out:
Cedric 36
Anne 37
However, when using our own annotation, JMockit takes over and mocks out the parameters. How can we disable this behavior for methods that use our annotation? | 0 | [
2,
487,
79,
5668,
242,
13,
8,
938,
20,
1460,
579,
18446,
16,
1289,
2109,
12905,
60,
800,
3726,
3726,
76,
568,
14,
487,
79,
5668,
242,
1248,
29,
1289,
2723,
15,
487,
79,
5668,
242,
7499,
10506,
18,
70,
65,
16,
14,
12905,
1100,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cause for Inconsistent Extractions of PDF Annotations
===
### Scenario:
I have an application that makes use of iTextSharp to scourge PDF files for hyperlinks.
Hyperlinks in PDFs are a sub-type of an "annotation object" in the file structure, so my code essentially (1) reads a file, (2) loops through pages, (3) gets the annotations collection for the page, and (4) extracts the hyperlink annotations for the page.
### Issue
Sometimes the "pdf dictionary" object representing a given page does not have a collection of annotations (no `/ANNOTS`) key. Thus attempts at getting such a collection return `null`. This is an issue because it happens now and then when there are plainly visible and *clickable* links on the page in question.
Note that *clickable* is important here because I understand there may be URL addresses present in the plain text, but I do not care about those, only the actual true-to-life hyperlinks.
### Code
I found similar SO question (http://stackoverflow.com/questions/6959076/reading-hyperlinks-from-pdf-file) by the answer provided is almost exactly the code I'm already using. The key difference is this:
// My code
var pdfAnnotations = (PdfArray)PdfReader.GetPdfObject(pageDict.Get(PdfName.ANNOTS));
foreach (var annotation in pdfAnnotations.ArrayList) {}
{
// Chris' code
var annotsArray = pageDict.GetAsArray(PdfName.ANNOTS);
foreach(var annotation in annotsArray.ArrayList) { }
// My pageDict.Get() and Chris's pageDict.GetAsArray() methods both
// return null because there is no ANNOTS key present in pageDict.
### Question
Why the null value? How can a PDF document with plainly visible/clickable links have no annotations collection? Are there other `PdfObject` sub-types within the file structure that represent hyperlinks/URI?
Thanks
| 0 | [
2,
1679,
26,
22380,
16748,
18,
16,
13,
11124,
40,
1270,
7504,
800,
3726,
3726,
6926,
5910,
5910,
12705,
45,
31,
57,
40,
3010,
30,
1364,
275,
16,
31,
11969,
23646,
20,
11530,
16461,
13,
11124,
6488,
26,
5443,
6258,
18,
9,
5443,
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... |
Property Setter and Method DRY
===
When is it a good idea to make a Method wrappers for a Property Setters?
Example: Show and Hide are just wrappers for Visible = True and Visible = False, respectively. | 0 | [
2,
1354,
309,
815,
17,
2109,
2273,
800,
3726,
3726,
76,
25,
32,
21,
254,
882,
20,
233,
21,
2109,
28051,
18,
26,
21,
1354,
309,
6052,
60,
823,
45,
298,
17,
3077,
50,
114,
28051,
18,
26,
4560,
800,
1151,
17,
4560,
800,
4997,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Can I Backup an SQL 2005 Database using SQL Express 2008R2
===
My goal is to work with a client's 2005 database using SQL Express 2008R2. When I am finished I would like to restore the database in it's 2005 format. Could someone post the process for backing up a 2005 database in 2008R2 and or the link.
Thank you,
Mark | 0 | [
2,
92,
31,
10119,
40,
4444,
255,
812,
6018,
568,
4444,
255,
2999,
570,
139,
135,
800,
3726,
3726,
51,
1195,
25,
20,
170,
29,
21,
6819,
22,
18,
812,
6018,
568,
4444,
255,
2999,
570,
139,
135,
9,
76,
31,
589,
842,
31,
83,
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... |
C# - Remote Service shuts down once program closes
===
We have a service that we created (and runs on one of our servers) which I'd like to control via another program. I having some difficulty with the service though and hope someone can help.
If I try to control the service using the route below, it works only with users that are on the server as well:
ServiceController service = new ServiceController("MyService", "MyServer");
try
{
if (service.Status == ServiceControllerStatus.Running)
{
teServiceStatus.BackColor = Color.LightGreen;
teServiceStatus.Text = "Running";
sbStartService.Enabled = false;
sbStopService.Enabled = true;
}
else
{
teServiceStatus.BackColor = Color.Red;
teServiceStatus.Text = "Stopped";
sbStartService.Enabled = true;
sbStopService.Enabled = false;
}
}
catch (InvalidOperationException ioe)
{
if (System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Break();
else
{
teServiceStatus.Text = "Cannot Connect";
teServiceStatus.BackColor = Color.Red;
}
}
catch (Exception ex)
{
if (System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Break();
else
;
}
So as a Network User, I am also on the server as a user and when I run our program that wants to control this service, I can see the status and start and stop it, but no one else can (unless I add them to the Server, which I don't wish to do).
I can also use the route below and impersonate a user on the Server:
//Establish connection to the Publishing Server with application credentials.
ConnectionOptions connectionOptions = new ConnectionOptions();
connectionOptions.Impersonation = ImpersonationLevel.Impersonate;
connectionOptions.EnablePrivileges = true;
connectionOptions.Username = "UserOnServer";
connectionOptions.Password = "UserPassword";
ManagementScope managementScope = new ManagementScope(@"\\MyServer\root\cimv2", connectionOptions);
managementScope.Connect();
ManagementPath path = new ManagementPath("Win32_Service");
ManagementClass services = new ManagementClass(managementScope, path, null);
foreach (ManagementObject service in services.GetInstances())
{
try
{
if (service.GetPropertyValue("Name").ToString() == "MyService")
if (service.GetPropertyValue("State").ToString().ToLower().Equals("running"))
{
teServiceStatus.BackColor = Color.LightGreen;
teServiceStatus.Text = "Running";
sbStartService.Enabled = false;
sbStopService.Enabled = true;
}
else
{
teServiceStatus.BackColor = Color.Red;
teServiceStatus.Text = "Stopped";
sbStartService.Enabled = true;
sbStopService.Enabled = false;
}
}
catch (InvalidOperationException ioe)
{
if (System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Break();
else
{
teServiceStatus.Text = "Cannot Connect";
teServiceStatus.BackColor = Color.Red;
}
}
catch (Exception ex)
{
if (System.Diagnostics.Debugger.IsAttached)
System.Diagnostics.Debugger.Break();
else
{
teServiceStatus.Text = "Cannot Connect";
teServiceStatus.BackColor = Color.Red;
}
}
}
This works so that any user who uses the program can start/stop the service and see it's current status BUT, when the program closes, the Service stops (don't know if that's supposed to happen, but it is).
So how can I have my program start, stop, and read a service status by anyone who uses it? I feel I am close but apparently, missing something.
Thanks for any advice/tips. | 0 | [
2,
272,
5910,
13,
8,
5388,
365,
2218,
18,
125,
382,
625,
543,
18,
800,
3726,
3726,
95,
57,
21,
365,
30,
95,
679,
13,
5,
290,
1461,
27,
53,
16,
318,
17595,
6,
56,
31,
22,
43,
101,
20,
569,
1197,
226,
625,
9,
31,
452,
109,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Validation condition on friendships in Rails 3?
===
I am writing my social network. I use devise as an authentication system. I used Self-Referential Association in railscasts. I want to solve my little problem that, I let users see the others profile and use a link to add friend. But if you are friend add to friend does show again. I asked similar questions but since now i could not make it.
My Friendship model :
class Friendship < ActiveRecord::Base
attr_accessible :friend_id
belongs_to :user
belongs_to :friend, :class_name => "User"
validates :friend, :presence => true, :unless => :friend_is_self
validates_uniqueness_of :user_id, :scope => [:friend_id]
def friend_is_self
user_id == friend_id ? false : true
end
end
My Users model :
.... has_many :friendships
has_many :friends, :through => :friendships
has_many :inverse_friendships, :class_name => "Friendship", :foreign_key => "friend_id"
has_many :inverse_friends, :through => :inverse_friendships, :source => :user
end
This is my show.html.erb(user)
<section>
<h1><%= @user.username %> </h1>
<% unless current_user == @user %>
<%= link_to "Arkadaşlarıma Ekle", friendships_path(:friend_id => @user), :method => :post,class: "btn btn-large btn-primary" %>
<%end %>
</section>.
I am sorry for the similar question but i cant find the correct `if friend?` condition for the add friend link. | 0 | [
2,
27999,
2874,
27,
5683,
18,
19,
2240,
18,
203,
60,
800,
3726,
3726,
31,
589,
1174,
51,
668,
982,
9,
31,
275,
29276,
28,
40,
27963,
329,
9,
31,
147,
1119,
8,
99,
2407,
10107,
607,
19,
2240,
18,
6146,
18,
9,
31,
259,
20,
840... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 trying to understand what I should be testing
===
I have been doing Rails development for a short time now but have done pretty well picking it up fairly quickly. One area I've still been lost is with writing tests.
I understand how to write tests, but I never know what I should be testing for and has made it difficult for me to actually start writing my own tests.
I recently wrote a gem to use with an API for a project I'm working on and figured this would be the best time for me to write some tests. I'm still so lost on what I should be testing.
I was hoping if I posted one of my classes with a couple of the methods that someone might be able to give me some ideas on what I should be testing for.
The API I'm working with returns JSON objects so all of my methods are really just helpers to that make GET requests and return JSON back to the application I'm building.
I'm using the HTTParty gem to make the get requests.
The first method just lists some information about a particular advertiser:
module MyModule
class User < MyObject
# User
# This will list information about a specific user
# required parameter(s):
# user_id
# example:
# MyModule.connect("Your API Key")
# MyModule::User.list(5)
# returns:
# Returns a single result with the following properties:
# {
# "user_name":"blah",
# "user_id":253,
# "last_login":"2011-03-01"
# }
def list(user)
MyModule.get("/users/#{user}")
end
end
end
My initial guess is I would test to make sure this JSON object comes back with the correct properties but I'm not entirely sure.
Would I also need to test to make sure arguments being passed into the method are there or is that something I shouldn't worry about?
Thanks,
Ben | 0 | [
2,
10811,
27,
2240,
18,
749,
20,
1369,
98,
31,
378,
44,
4431,
800,
3726,
3726,
31,
57,
74,
845,
2240,
18,
522,
26,
21,
502,
85,
130,
47,
57,
677,
1772,
134,
7833,
32,
71,
6647,
976,
9,
53,
217,
31,
22,
195,
174,
74,
529,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WmiMonitorBrightnessMethods - Not Supported in Windows 7
===
WmiMonitorBrightnessMethods is not supported in Windows 7. What could be possible reasons. I'm trying to use WmiSetBrightness to get and set brightness levels and values in c# application. | 0 | [
2,
19312,
1660,
5995,
2153,
17069,
720,
5909,
1807,
43,
18,
13,
8,
52,
1827,
19,
1936,
453,
800,
3726,
3726,
19312,
1660,
5995,
2153,
17069,
720,
5909,
1807,
43,
18,
25,
52,
1827,
19,
1936,
453,
9,
98,
110,
44,
938,
2932,
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... |
Python List Indexing Efficiency
===
Quick question about the built in python list object. Say you have a list with the numbers 0 - 99. You are writing a program that takes the last item in the list and uses it for some other purpose. Is it more efficient to use list[-1] than to use list[99]? In other words, does python iterate through the whole list in either case?
Thanks for your help. | 0 | [
2,
20059,
968,
4348,
68,
7836,
800,
3726,
3726,
2231,
1301,
88,
14,
392,
19,
20059,
968,
3095,
9,
395,
42,
57,
21,
968,
29,
14,
2116,
713,
13,
8,
7787,
9,
42,
50,
1174,
21,
625,
30,
1384,
14,
236,
9101,
19,
14,
968,
17,
2027... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
I am a beginner in C# and need help creating a proper method
===
Ok, here is my assignment at school.
1. Create a console application named CreateVehicle.
2. Develop a Vehicle class that captures the following information:
a. Company
b. Model
c. MRSP
d. Number of vehicles created.
3. Your class should have a null constructor and at least one additional constructor to collect the full information on creation.
4. Have a method to buy the vehicle.
5. Create an efficient way to print out all of the information collected on a vehicle.
6. Develop a class to test your Vehicle class. In this class do the following:
a. Create the following vehicles from the information below:
Car: Model: MSRP:
Aston Martin Vantage $129,000
Ford Fusion $ 28,678.99
Honda Civic EX $ 18,713.27
b. Exercise your Buy method by buying the Honda Civic.
c. Use your print method to print out all relevant information on the vehicles above.
d. When you buy your Honda print out the fact that you bought the Honda.
7. Bonus points (10). Include a flag item in your class that tells the status of whether the created vehicle was bought or not and have that status print out in your overall Vehicle class print method.
Here is the code I've come up with so far, but I'm not sure where to go from here or how to fix the parts with syntax problems. I'm definitely not sure how my BuyVehicle method is supposed to work:
Program.cs
using System;
namespace CreateVehicle
{
class Program
{
static void Main(string[] args)
{
Vehicle firstVehicle = new Vehicle("Aston Martin", "Vantage", 129000);
Console.WriteLine(firstVehicle.ToString());
firstVehicle.BuyVehicle(true);
Console.WriteLine("You bought a {0}", firstVehicle.Model);
Vehicle secondVehicle = new Vehicle("Ford", "Fusion", 28678.99);
Console.WriteLine(secondVehicle.ToString());
Vehicle thirdVehicle = new Vehicle("Honda", "Civic EX", 18713.27);
Console.WriteLine(thirdVehicle.ToString());
}
}
}
Vehicle.cs
using System;
namespace CreateVehicle
{
class Vehicle
{
public string companyName;
private static int totalVehicles = 0;
private string mModel;
private string mMSRP;
public Vehicle()
{
companyName = "Not assigned";
mModel = "Not assigned";
mMSRP = 0;
totalVehicles++;
}
public Vehicle(string companyName, string model, double price)
{
this.companyName = companyName;
mModel = model;
mMSRP = price;
totalVehicles++;
}
public string Model
{
get
{
return mModel;
}
}
public decimal MSRP
{
get
{
return mMSRP;
}
set
{
if (value >= 0)
{
mMSRP = value;
}
else
{
mMSRP = 0;
}
}
}
public string BuyVehicle(Boolean buy)
{
if (buy == true)
{
return mModel;
}
else
{
return "";
}
public override string ToString()
{
return "Vehicle Data: \n\t" +
"Company Name: " + companyName + "\n\t" +
"Model: " + mModel + "\n\t" +
"MSRP: " + mMSRP.ToString("C") + "\n\t" +
"Total vehicles: " + totalVehicles + "\n";
}
}
}
| 1 | [
2,
31,
589,
21,
26931,
19,
272,
5910,
17,
376,
448,
2936,
21,
4119,
2109,
800,
3726,
3726,
5854,
15,
235,
25,
51,
8427,
35,
116,
9,
137,
9,
1600,
21,
8650,
3010,
377,
1600,
195,
252,
15653,
9,
172,
9,
2803,
21,
2664,
718,
30,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ORMLite Android - How can I "map" in ORMLite a base object that all Database entities extend
===
I am very new to ORMLite and I really need some help. I have an object that I call "BaseObject" which all classes that are persisted extend. This class has an "_id" field, a "dateCreated" field, a "dateModified" field, etc.... The database tables that correspond to all objects that extends this base object obviously have columns that store these values. How can I set up these fields using annotations so all these fields are persisted to the database. Can I do this or will I need to add these fields to the POJOs directly. I have included below my base object and one of the classes that extends it. I would appreciate any help.
package com.aaron.grocery.pojos;
public class BaseObject {
private int _id;
private String dateCreated;
private String dateModified;
private String createModule;
private String modifiedModule;
public int get_id() {
return _id;
}
public void set_id(int _id) {
this._id = _id;
}
public String getDateCreated() {
return dateCreated;
}
public void setDateCreated(String dateCreated) {
this.dateCreated = dateCreated;
}
public String getDateModified() {
return dateModified;
}
public void setDateModified(String dateModified) {
this.dateModified = dateModified;
}
public String getCreateModule() {
return createModule;
}
public void setCreateModule(String createModule) {
this.createModule = createModule;
}
public String getModifiedModule() {
return modifiedModule;
}
public void setModifiedModule(String modifiedModule) {
this.modifiedModule = modifiedModule;
}
}
</i>
<i>
package com.aaron.grocery.pojos;
import com.j256.ormlite.table.DatabaseTable;
@DatabaseTable(tableName = "FOOD")
public class Food extends BaseObject {
public Food(int foodGroupId, String longDescription) {
this.foodGroupId = foodGroupId;
this.longDescription = longDescription;
}
private Integer foodGroupId;
private String longDescription;
public Integer getFoodGroupId() {
return foodGroupId;
}
public void setFoodGroupId(Integer foodGroupId) {
this.foodGroupId = foodGroupId;
}
public String getLongDescription() {
return longDescription;
}
public void setLongDescription(String longDescription) {
this.longDescription = longDescription;
}
}
</i>
Any help would be appreciated. Thank you. | 0 | [
2,
54,
79,
10601,
13005,
13,
8,
184,
92,
31,
13,
7,
15022,
7,
19,
54,
79,
10601,
21,
1000,
3095,
30,
65,
6018,
12549,
7206,
800,
3726,
3726,
31,
589,
253,
78,
20,
54,
79,
10601,
17,
31,
510,
376,
109,
448,
9,
31,
57,
40,
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... |
google map not loading properly in magento tabs
===
I have found a issue with google map version3 with magento in tabs and I got a solution after doing many R&D on google. I want to share with you...here is solution:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script type="text/javascript">
var latLng;
function initialize() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 8,
center: new google.maps.LatLng(26.937201,75.785672),
scrollwheel: true,
disableDefaultUI: true,
navigationControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP,
});
var infoWindow = new google.maps.InfoWindow;
var onMarkerClick = function() {
var marker = this;
var latLng = marker.getPosition();
infoWindow.setContent("I'm here!!!!");
infoWindow.open(map, marker);
};
google.maps.event.addListener(map, 'click', function() {
infoWindow.close();
});
var marker1 = new google.maps.Marker({
map: map,
position: new google.maps.LatLng(26.937201,75.785672)
});
google.maps.event.addListener(marker1, 'click', onMarkerClick);
}
var GMaps = Class.create();
GMaps.prototype = { }
var gmaps = null;
function switchGMapsTab(tab){
if ( tab.tab.container.activeTab.id == 'googlemap_tabs_id'){
if (!gmaps){
initialize();
}
}
}
varienGlobalEvents.attachEventHandler('showTab', switchGMapsTab);
</script>
visit on link also, it may also help you [http://stackoverflow.com/questions/10786132/what-is-causing-gray-space-on-a-google-map-using-v3-api#answers-header][1]
Thanks
[1]: http://stackoverflow.com/questions/10786132/what-is-causing-gray-space-on-a-google-map-using-v3-api#answers-header | 0 | [
2,
8144,
2942,
52,
12797,
7428,
19,
4723,
17050,
6523,
18,
800,
3726,
3726,
31,
57,
216,
21,
1513,
29,
8144,
2942,
615,
240,
29,
4723,
17050,
19,
6523,
18,
17,
31,
330,
21,
4295,
75,
845,
151,
761,
1569,
43,
27,
8144,
9,
31,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Submit on select (Yii)
===
Trying to make a dropdown list, which should be submitted if any option is selected.
I followed the instructions from this [article][1], but no success — the page is not reloading, nothing happens at all.
Here's my code:
<?php echo CHtml::form('','get', array('class'=>'catalog-select')); ?>
<?php echo CHtml::dropDownList('the_cats','select_value',array(1=>'bla',2=>'blabla'),array('submit'=>'')
);?>
</form>
[1]: http://www.yiiframework.com/wiki/11/how-to-filter-data-using-a-dropdown-list | 0 | [
2,
12298,
27,
5407,
13,
5,
93,
2865,
6,
800,
3726,
3726,
749,
20,
233,
21,
2804,
2968,
968,
15,
56,
378,
44,
7368,
100,
186,
4255,
25,
1704,
9,
31,
709,
14,
7650,
37,
48,
636,
20360,
500,
2558,
165,
500,
15,
47,
90,
1280,
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... |
imported .swc movie clip not being displayed
===
I am trying to take an animation I made in flash professional, and use it inside of the Flash Builder IDE.
I have tried importing an image to the stage in flash, converting it to a movie clip and exporting it as a .swc. After adding the swc to a Flash builder project, I was able to create a class specified by the swc file, and by adding the object to the display tree I could see the image when I ran my project.
So I tried the next step which was to animate the image. I imported an image to the stage, inserted some frames and made a 1 second animation. I copied the frames, created a new movie clip and pasted the frames into the movie clip. I then exported it as a .swc.
The problem is that when I do the same thing as before (with the image), the animation is not being displayed at all. However, If I export as a .swf instead of a .swc, I can see my animation play correctly inside an instance of adobe flash player.
My AS3 code:
var testAnimation:MovieClip = new TestAnimation();
...
addchild(testAnimation);
| 0 | [
2,
11808,
13,
9,
18,
12354,
1308,
12229,
52,
142,
6115,
800,
3726,
3726,
31,
589,
749,
20,
247,
40,
6236,
31,
117,
19,
4433,
736,
15,
17,
275,
32,
572,
16,
14,
4433,
14960,
13,
3448,
9,
31,
57,
794,
9010,
68,
40,
1961,
20,
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... |
Which bitset implementation should I use for maximum performance?
===
I'm currently trying to implement various algorithms in a Just In Time (JIT) compiler. Many of the algorithms operates on bitmaps, more commonly known as bitsets.
In C++ there are various ways of implementing a bitset. As a true C++ developer, I would prefer to use something from the STL. The most important aspect is performance. I don't necessarily need a dynamically resizable bitset.
As I see it, there are three possible options.
I. One option would be to use `std::vector<bool>`, which has been optimized for space. This would also indicate that the data doesn't have to be contiguous in memory. I guess this could decrease performance. On the other hand, having one bit for each bool value could improve speed since it's very cache friendly.
II. Another option would be to instead use a `std::vector<char>`. It guarantees that the data is contiguous in memory and it's easier to access individual elements. However, it feels strange to use this option since it's not intended to be a bitset.
III. The third option would be to use the actual `std::bitset`. That fact that it's not dynamically resizable doesn't matter.
Which one should I choose for maximum performance? | 0 | [
2,
56,
1142,
3554,
6123,
378,
31,
275,
26,
2979,
956,
60,
800,
3726,
3726,
31,
22,
79,
871,
749,
20,
8713,
617,
15935,
19,
21,
114,
19,
85,
13,
5,
13803,
6,
21486,
9,
151,
16,
14,
15935,
4554,
27,
1142,
15022,
18,
15,
91,
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... |
More functional python
===
I'd like to write kind of CPS code higher functions. They should take a function code, encapsulate it in the object and add means for combining this objects.
Something like this:
myFunction=MyFunction(
a = b+c
print(c)
return a)
But there is only one pythonic expression for anonymous functions - lambda statement. It suits not too well.
Python is a powerful language, it has different expressions: decorators, eval, etc... Is there a good way to write anonymous functions like in the mentioned example?
Other way is to extend lambda expressions with special functions like monadic bind and return, and other higher-order functions for writing complex expressions single-lined. | 0 | [
2,
91,
7652,
20059,
800,
3726,
3726,
31,
22,
43,
101,
20,
2757,
825,
16,
9750,
18,
1797,
1184,
3719,
9,
59,
378,
247,
21,
1990,
1797,
15,
1957,
4666,
18,
12383,
32,
19,
14,
3095,
17,
3547,
1108,
26,
12803,
48,
3916,
9,
301,
10... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ServiceStack : How to catch errors before written to response
===
I develop a Rest Service by using ServiceStack.
My model contains a DateTime property and the problem start with it.If a client post/get wrong formatted date value as string , ServiceStack fires an exception "String was not recognized as a valid DateTime."
Stack Trace:
[FormatException: String was not recognized as a valid DateTime.]
System.DateTime.Parse(String s, IFormatProvider provider, DateTimeStyles styles) +6364458
ServiceStack.Text.Common.DeserializeBuiltin`1.<GetParseFn>b__b(String value) in C:\src\ServiceStack.Text\src\ServiceStack.Text\Common\DeserializeBuiltin.cs:58
ServiceStack.ServiceModel.Serialization.StringMapTypeDeserializer.PopulateFromMap(Object instance, IDictionary`2 keyValuePairs) in C:\src\ServiceStack\src\ServiceStack.Common\ServiceModel\Serialization\StringMapTypeDeserializer.cs:79
[SerializationException: KeyValueDataContractDeserializer: Error converting to type: String was not recognized as a valid DateTime.]
ServiceStack.ServiceModel.Serialization.StringMapTypeDeserializer.PopulateFromMap(Object instance, IDictionary`2 keyValuePairs) in C:\src\ServiceStack\src\ServiceStack.Common\ServiceModel\Serialization\StringMapTypeDeserializer.cs:95
ServiceStack.ServiceHost.RestPath.CreateRequest(String pathInfo, Dictionary`2 queryStringAndFormData, Object fromInstance) in C:\src\ServiceStack\src\ServiceStack\ServiceHost\RestPath.cs:319
ServiceStack.WebHost.Endpoints.RestHandler.GetRequest(IHttpRequest httpReq, IRestPath restPath) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\RestHandler.cs:104
ServiceStack.WebHost.Endpoints.RestHandler.ProcessRequest(IHttpRequest httpReq, IHttpResponse httpRes, String operationName) in C:\src\ServiceStack\src\ServiceStack\WebHost.Endpoints\RestHandler.cs:80
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +625
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +270
I know its an error and I know it must be catches but I want to implement it with my error codes and error descriptions(human friendly).
Any advice could be very helpful about how to catch an exception before its written to response itself on (DebeugMode=true) or the service fires an exception to client.
Thnx | 0 | [
2,
365,
25325,
13,
45,
184,
20,
2949,
11908,
115,
642,
20,
1627,
800,
3726,
3726,
31,
2803,
21,
760,
365,
34,
568,
365,
25325,
9,
51,
1061,
1588,
21,
1231,
891,
1354,
17,
14,
1448,
799,
29,
32,
9,
821,
21,
6819,
678,
118,
3060... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Symfony2 security component documentation
===
Good morning,
I was wondering if there was any improvement of the security component documentation ongoing or not? If true, when will it be released?
In any case, do you know any tutorials which explain in detail the functionning of every pieces of the security component?
| 1 | [
2,
13,
7261,
10229,
93,
135,
1221,
5912,
13945,
800,
3726,
3726,
254,
959,
15,
31,
23,
5712,
100,
80,
23,
186,
6984,
16,
14,
1221,
5912,
13945,
6748,
54,
52,
60,
100,
1151,
15,
76,
129,
32,
44,
261,
60,
19,
186,
610,
15,
107,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Display DropDownList User Selections on Screen with a Separator - append or Join?
===
This code will display the user selections from the dropDowList on screen as they are selected.
Now I need to place a separator after each selection so they don't run together. I have tried the append as well as join but without success.
Would someone please show me how to accomplish this simple task?
$("#ServiceRequest_select").change(function() {
var content = $("#ServiceRequest_select option:selected").text();
$("TD#displayitem").text(content);
}); | 0 | [
2,
3042,
2804,
2968,
5739,
4155,
3155,
18,
27,
2324,
29,
21,
1353,
3574,
3457,
13,
8,
4865,
2451,
54,
1865,
60,
800,
3726,
3726,
48,
1797,
129,
3042,
14,
4155,
3155,
18,
37,
14,
2804,
17779,
5739,
27,
2324,
28,
59,
50,
1704,
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... |
Performing an action on first install in codename one
===
I am building an app with [codename one][1]
[1]: http://www.codenameone.com
So, I basically want to send a SMS the first time a user installs the app.
SO i do it this way.
1)Check if a "firstRUN" storage file exists.
2)If it does not, create that file and send SMS. If it does, just start the app.
SO far, so good.
But now the dilemma is:
If the user already has my app installed, and he installs a newer version of my app,android asks if my app has to be upgraded. Now if the user says yes:
1)my application gets upgraded and then starts
2)It checks if the storage file "firstRUN" exists. In this case, it does exist because the application has been upgraded and existing storage files were not deleted.
What I wish to do is, incase my application is upgraded, I would like to delete the existing storage files for that application. How do i do this?
Ok, and is it right what I am doing here ? Is there a better way to do this ?
| 0 | [
2,
2955,
40,
1028,
27,
64,
16146,
19,
27100,
53,
800,
3726,
3726,
31,
589,
353,
40,
4865,
29,
636,
9375,
7259,
53,
500,
2558,
165,
500,
636,
165,
500,
45,
7775,
6903,
6483,
9,
9375,
7259,
849,
9,
960,
86,
15,
31,
11374,
259,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UIView is not showing up in UIScrollView
===
I am currently dynamically adding a UIImage to my UIScrollView object and everything is working as intended. I need to add extra functionality now (a UIActivityIndicator in the center of the image when it is loading from the internet, and a label underneath) so I thought why not create a custom View which has all of these laid out as I need them to be, and then just load it into the scrollView. I have encountered a problem though, when I add it to the scrollView, nothing shows up. Here is what I have:
NewsViewController.m:
imageScrollView.contentSize = CGSizeMake(320*numberOfPages, 303);
pageControl.numberOfPages = numberOfPages;
dispatch_queue_t imageDownload = dispatch_queue_create("imageDownload", NULL);
__block NSData *temp;
CustomImageView *customImageView = [[CustomImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 303)];
[imageScrollView addSubview:customImageView];
[[customImageView activityIndicator] startAnimating];
dispatch_async(imageDownload, ^{
temp = [[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://www.wlfarm.org/wp-content/uploads/2012/05/farm.jpg"]]retain];
dispatch_async(dispatch_get_main_queue(), ^{
customImageView.imageView.image = [[UIImage alloc] initWithData:temp];
[[customImageView activityIndicator] stopAnimating];
[customImageView setNeedsDisplay];
customImageView.caption.text = @"HAHAHAHAHHAHA";
[imageScrollView setNeedsDisplay];
[temp release];
});
});
dispatch_release(imageDownload);
CustomImageView.h:
#import <UIKit/UIKit.h>
@interface CustomImageView : UIView
{
IBOutlet UIImageView *imageView;
IBOutlet UILabel *caption;
IBOutlet UIActivityIndicatorView *activityIndicator;
}
@property (nonatomic, retain) IBOutlet UIImageView *imageView;
@property (nonatomic, retain) IBOutlet UILabel *caption;
@property (nonatomic, retain) IBOutlet UIActivityIndicatorView *activityIndicator;
@end
I am including a screenshot of my XIB file, and the program running on the simulator. The first picture shows nothing in the scrollView(the attempt made by using my custom class), and the second page of the scroll view is the attempt made by adding a UIImageView to the UIScrollView(which worked). Can anyone point out what I am doing wrong? Am I not allowed to load a custom view into a UIScrollView? Thanks for your help!
IB Screenshot - h ttp://i.stack.imgur.com/gz9UL.png
iOS Simulator No Image with CustomView Screenshot - h ttp://i.stack.imgur.com/zhswq.png
iOS Simulator Image with UIImageView Screenshot - h ttp://i.stack.imgur.com/97vmU.png
| 0 | [
2,
13,
5661,
4725,
25,
52,
3187,
71,
19,
13,
5661,
3862,
8694,
4725,
800,
3726,
3726,
31,
589,
871,
7782,
1326,
4721,
21,
13,
5661,
22039,
20,
51,
13,
5661,
3862,
8694,
4725,
3095,
17,
796,
25,
638,
28,
2081,
9,
31,
376,
20,
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... |
Correct way to profile a memory allocator
===
I have written a memory allocator that is (supposedly) faster than using malloc/free.
I have written a small amout of code to test this but I'm not sure if this is the correct way to profile a memory allocator, can anyone give me some advice?
The output of this code is:
Mem_Alloc: 0.020000s
malloc: 3.869000s
difference: 3.849000s
Mem_Alloc is 193.449997 times faster.
This is the code:
int i;
int mem_alloc_time, malloc_time;
float mem_alloc_time_float, malloc_time_float, times_faster;
unsigned prev;
// Test Mem_Alloc
timeBeginPeriod (1);
mem_alloc_time = timeGetTime ();
for (i = 0; i < 100000; i++) {
void *p = Mem_Alloc (100000);
Mem_Free (p);
}
// Get the duration
mem_alloc_time = timeGetTime () - mem_alloc_time;
// Test malloc
prev = mem_alloc_time; // For getting the difference between the two times
malloc_time = timeGetTime ();
for (i = 0; i < 100000; i++) {
void *p = malloc (100000);
free (p);
}
// Get the duration
malloc_time = timeGetTime() - malloc_time;
timeEndPeriod (1);
// Convert both times to seconds
mem_alloc_time_float = (float)mem_alloc_time / 1000.0f;
malloc_time_float = (float)malloc_time / 1000.0f;
// Print the results
printf ("Mem_Alloc: %fs\n", mem_alloc_time_float);
printf ("malloc: %fs\n", malloc_time_float);
if (mem_alloc_time_float > malloc_time_float) {
printf ("difference: %fs\n", mem_alloc_time_float - malloc_time_float);
} else {
printf ("difference: %fs\n", malloc_time_float - mem_alloc_time_float);
}
times_faster = (float)max(mem_alloc_time_float, malloc_time_float) /
(float)min(mem_alloc_time_float, malloc_time_float);
printf ("Mem_Alloc is %f times faster.\n", times_faster); | 0 | [
2,
4456,
161,
20,
5296,
21,
1912,
65,
2499,
3457,
800,
3726,
3726,
31,
57,
642,
21,
1912,
65,
2499,
3457,
30,
25,
13,
5,
18,
576,
15690,
43,
102,
6,
4233,
119,
568,
3668,
2499,
118,
4639,
9,
31,
57,
642,
21,
284,
589,
1320,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Keeping a collection of SWT Widget objects
===
I trying to use XML codes to create SWT Widgets.
I want to store these widgets first before adding it into the GUI component, so I created a List for storage of these widgets using
List<Widget> widgets = new ArrayList<Widget>();
However, how do I create this widget without specifying it's parent composite?
Widget newWidget = new Button(null,SWT.RADIO); // Argument cannot be null
In here, I do not want to add it to a parent composite yet, so I specify null, but I am not able to get through.
How can I create this Widget without adding to the parent composite (as I do not have a composite now)? | 0 | [
2,
2882,
21,
1206,
16,
8783,
38,
4807,
43,
3060,
3916,
800,
3726,
3726,
31,
749,
20,
275,
23504,
11358,
20,
1600,
8783,
38,
4807,
43,
3060,
18,
9,
31,
259,
20,
1718,
158,
4807,
43,
3060,
18,
64,
115,
4721,
32,
77,
14,
9457,
59... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 do not write log on release mode in iOS?
===
In my memory, there's some code that can let the `NSLog` not work when released.
I don't want to remove my `NSLog` in my code.It helps a lot on debug mode.
So I want to find a way that can leave them in my code, and also don't slow down the application when released.
Thanks for your help~~ | 0 | [
2,
184,
20,
107,
52,
2757,
6738,
27,
830,
3740,
19,
13,
7760,
60,
800,
3726,
3726,
19,
51,
1912,
15,
80,
22,
18,
109,
1797,
30,
92,
408,
14,
13,
1,
2172,
5567,
1,
52,
170,
76,
261,
9,
31,
221,
22,
38,
259,
20,
4681,
51,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why return wouldn't work in this Dynamic Querry? What is it I am missing?
===
set @SQLQ0='if exists(select * from '+@INTERID+'..TESTTABLE where testid='''+rtrim(@testid)+''') begin return end'
--print @SQLQ0
exec(@SQLQ0) | 1 | [
2,
483,
788,
1265,
22,
38,
170,
19,
48,
7782,
13,
8190,
622,
60,
98,
25,
32,
31,
589,
2863,
60,
800,
3726,
3726,
309,
13,
1,
18,
22402,
1251,
387,
3726,
22,
821,
5636,
5,
18,
16964,
1637,
37,
13,
22,
2430,
1,
6280,
1340,
243... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Arquillian and jboss-4.2.3.GA
===
i am workign on a jboss-4.2.3.GA project. Its a old project but we cant upgrade to new server.
I am trying to use Arquillian for JPA..
We are using folliwng entry in pom for JPA
<dependency>
<groupId>com.jboss</groupId>
<artifactId>ejb3-persistence.jar</artifactId>
<version>4.2.3</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>hibernate</groupId>
<artifactId>hibernate3</artifactId>
<version>3.2.4.SP1</version>
<scope>provided</scope>
</dependency>
I am trying to configure Arquillian but i am getting some issue like nosuchmethod found or some time no default container set.
Anyone help me what container i need to set and any dependency settings ? | 0 | [
2,
13,
512,
18504,
7757,
17,
487,
10349,
18,
8,
300,
9,
135,
9,
240,
9,
1136,
800,
3726,
3726,
31,
589,
170,
9693,
27,
21,
487,
10349,
18,
8,
300,
9,
135,
9,
240,
9,
1136,
669,
9,
82,
21,
315,
669,
47,
95,
2973,
9483,
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... |
Deploy asp.net website in IIS 7.5 locally
===
I get this error when deploying website in 11s 7.5 :
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 16: <compilation debug="true" targetFramework="4.0" />
Line 17:
Line 18: <authentication mode="Forms">
Line 19: <forms loginUrl="~/Account/Login.aspx" timeout="2880" />
Line 20: </authentication>
I am trying to deploy my website locally for testing. | 0 | [
2,
17617,
28,
306,
9,
2328,
2271,
19,
595,
18,
453,
9,
264,
6680,
800,
3726,
3726,
31,
164,
48,
7019,
76,
17617,
68,
2271,
19,
547,
18,
453,
9,
264,
13,
45,
8091,
7019,
5318,
45,
40,
7019,
2437,
112,
14,
5511,
16,
21,
8091,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Grphical Layout design rendering issue in SDK version 4
===
I updated my android SDK recently and now it is `Android SDK Tools-20 & Android SDK Platform-tools-12 `
I need to create my app to support for `minSdkVersion="4"` and finding the following difficulty while layout designing. but before I Update the SDK it was fine but now,
It loos as follows when I change the project's build target to SDK version 7 by changing the android properties.
![enter image description here][1]
But it looks terrible in the layout design as follows when the target SDK version is 4.
![enter image description here][2]
I did the followings but nothing worked out.
1. Re-started eclipse.
2. Right click xml layout -> Openwith -> Android Common Xml Editor.
3. Right click xml layout -> Openwith -> Legacy Android Layout editor.
4. Project -> Clean.
Would like to know if anyone else find this issue in the latest SDK tools. Any guidance to avoid this issue is really appreciated. Thanks inadvance...!!!!
[1]: http://i.stack.imgur.com/qKIt7.png
[2]: http://i.stack.imgur.com/Roj40.png | 0 | [
2,
13005,
7711,
3971,
4272,
9106,
704,
15307,
1513,
19,
13,
18,
43,
197,
615,
268,
800,
3726,
3726,
31,
6372,
51,
13005,
13,
18,
43,
197,
1989,
17,
130,
32,
25,
13,
1,
290,
18524,
13,
18,
43,
197,
4672,
8,
1323,
279,
13005,
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... |
do we need any .net framework to run al.exe and resgen.exe
===
I am creating the satellite assembly. I am just curious to know that to run the Assembly Linker exe and resource generator exe do we need to have any .Net framework installed or it can run without any .net framework?
Thanks a lot.. | 0 | [
2,
107,
95,
376,
186,
13,
9,
2328,
6596,
20,
485,
493,
9,
1706,
62,
17,
10719,
1863,
9,
1706,
62,
800,
3726,
3726,
31,
589,
2936,
14,
4958,
1475,
9,
31,
589,
114,
7686,
20,
143,
30,
20,
485,
14,
1475,
3508,
106,
1396,
62,
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... |
Issue with concealed symbols
===
I have `&concealcursor=nc` and this works fine except one thing: say, I have a following line: "`foo bar ~*baz*~ foo`", and the symbols `~` and `*` are concealed. I move cursor through this line, and cursor stuck on concealed symbols.
And this isn't worse thing: say, I want to select word `baz`. I put cursor on this word, start selecting, and now I see that cursor is NOT at letter `b`, but at symbol `~`.
I have to re-select it carefully, to make sure I select what I want. This is really annoying.
I believe Vim should handle this and jump over these consealed symbols, to make it clear. Is there a way to achieve this?
| 0 | [
2,
1513,
29,
16454,
9794,
800,
3726,
3726,
31,
57,
13,
1,
1569,
1126,
1105,
192,
4734,
18,
248,
3726,
6897,
1,
17,
48,
693,
1123,
1613,
53,
584,
45,
395,
15,
31,
57,
21,
249,
293,
45,
13,
7,
1,
4120,
111,
748,
13,
1,
2483,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 flip Imageview in Android?
===
I am working on an application I need to flip image view on touch and transfer control to the second activity. please help me. i tried a lot but i haven't succeed.
thank you all in advance. | 0 | [
2,
184,
20,
8805,
1961,
4725,
19,
13005,
60,
800,
3726,
3726,
31,
589,
638,
27,
40,
3010,
31,
376,
20,
8805,
1961,
1418,
27,
1723,
17,
2617,
569,
20,
14,
153,
2358,
9,
2247,
448,
55,
9,
31,
794,
21,
865,
47,
31,
2933,
22,
38... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.