unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
What to do about a 11000 lines C++ source file?
===
So we have this huge (is 11000 lines huge?) mainmodule.cpp source file in our project and every time I have to touch it I cringe :-)
As this file is so central and large, it keeps accumulating more and more code and I can't think of a good way to make it actually start to shrink.
The file is used and actively changed in several (> 10) maintenance versions of our product and so it is really hard to refactor it. If I were to "simply" split it up, say for a start, into 3 files, then merging back changes from maintenance versions will become a nightmare. And also if you split up a file with such a long and rich history, tracking and checking old changes in the SCC history suddenly becomes a lot harder.
The file basically contains the "main class" (main internal work dispatching and coordination) of our program, so every time a feature is added, it also affects this file and every time it grows. :-(
What would you do in this situation? Any ideas on how to move new features to a separate source file without messing up the SCC workflow?
(Note on the tools: We use C++ with Visual Studio; We use AccuRev as SCC but I think the type of SCC doesn't really matter here; We use Araxis Merge to do actual comparison and merging of files) | 0 | [
2,
98,
20,
107,
88,
21,
547,
3993,
1560,
272,
20512,
1267,
3893,
60,
800,
3726,
3726,
86,
95,
57,
48,
2329,
13,
5,
403,
547,
3993,
1560,
2329,
60,
6,
407,
19673,
62,
9,
150,
3421,
1267,
3893,
19,
318,
669,
17,
352,
85,
31,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Does it matter if you turn off the monitor while timing graphics code?
===
I'm fairly certain that it shouldn't matter since the graphics card is still executing the commands given by the CPU and sending the framebuffer to a monitor that is simply not listening. However, I'm not sure if the graphics card doesn't detect this. | 0 | [
2,
630,
32,
1161,
100,
42,
805,
168,
14,
7626,
133,
11812,
8351,
1797,
60,
800,
3726,
3726,
31,
22,
79,
6647,
1200,
30,
32,
5714,
22,
38,
1161,
179,
14,
8351,
2056,
25,
174,
25836,
14,
14294,
504,
34,
14,
17578,
17,
4907,
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... |
Consecutive number generator program on each execution
===
I would like to write a program that generates the consecutive number starting from 1 every time it is *executed*.
It will print 1 at the first execution, then it will print 2 at the next execution, and so on.
What is the shortest way to do this in Java? | 1 | [
2,
4195,
234,
15286,
625,
27,
206,
5769,
800,
3726,
3726,
31,
83,
101,
20,
2757,
21,
625,
30,
7920,
18,
14,
4195,
234,
1422,
37,
137,
352,
85,
32,
25,
1637,
1706,
17194,
1427,
2483,
9,
32,
129,
4793,
137,
35,
14,
64,
5769,
15,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Audio processing in C#
===
I'm about to start a project where I need to manipulate audio data on bit level; muxing, appending audio, applying various filters to the data and performing Fourier transforms.
Does anyone have a book, reference or guide where I can get everything I need? I'm not looking for libraries, I need to do this myself to get a deeper understanding of frequencies, logarithmics, dB, fourier, samplerates etc...
It does not have to be for C# specifically; I'm looking for algorithms, not necessarily code. | 1 | [
2,
4023,
5511,
19,
272,
5910,
800,
3726,
3726,
31,
22,
79,
88,
20,
799,
21,
669,
113,
31,
376,
20,
18468,
4023,
1054,
27,
1142,
662,
73,
2832,
18222,
15,
4865,
7601,
4023,
15,
11989,
617,
21062,
20,
14,
1054,
17,
2955,
222,
1944... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 find out which of your facebook friends are also using your mobile app?
===
We are building mobile app that uses Facebook for registration (know how to do this).
We would like to have a screen, where all your friends would be listed with indication, if they also use our app.
How should we save data (client, server) that one facebook user is also our app user? | 0 | [
2,
184,
20,
477,
70,
56,
16,
154,
9090,
954,
50,
67,
568,
154,
3241,
4865,
60,
800,
3726,
3726,
95,
50,
353,
3241,
4865,
30,
2027,
9090,
26,
8587,
13,
5,
17806,
184,
20,
107,
48,
6,
9,
95,
83,
101,
20,
57,
21,
2324,
15,
11... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you cleanly abort JQuery events?
===
I am working on a project that uses Flowplayer's Tooltip plugin for JQuery. However, it looks like its onBeforeShow events are not triggering under certain circumstances. Particularly if the previous hide event was cancelled by returning false from onBeforeHide. Is there a way to ensure that the onBeforeShow callback is run EVERY time the target gets the mouseover event, while still preserving the Tooltip functionality?
These are my handler functions:
onBeforeShow: function(evt,position)
{
debugPrint( "Showing "+tile.name );
// suppress hide event if the tooltip is still showing from last time
if( $("#propcard").css("display") == "block" ){
ignoreHide = true;
debugPrint("Ignoring next hide");
}
},
onBeforeHide: function(evt,position){
debugPrint( "hide" );
if( ignoreHide ){
ignoreHide = false;
return false;
}
}
The output is as follows:
// mouse over 1
Showing 1
// mouse over 2
Showing 2
Ignoring next hide
hide
// mouse directly back over 1
hide
I'm pretty sure that there is some issue with the aborted hide also aborting the show somehow, but I'm new to JQuery and can't be sure. How can I guarantee that the handler is always called? | 0 | [
2,
184,
107,
42,
2745,
102,
21557,
487,
8190,
93,
963,
60,
800,
3726,
3726,
31,
589,
638,
27,
21,
669,
30,
2027,
3312,
14049,
22,
18,
5607,
10169,
10922,
108,
26,
487,
8190,
93,
9,
207,
15,
32,
1879,
101,
82,
27,
12750,
9303,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Magento Custom Shipping Module multiple rates not working
===
I created a custom shipping module in Magento for UPS Freight shipping. I needed options for Freight + Lift Gate, Freight + Residential, and Freight + Lift Gate & Residential. Per a response on another board, instead of having a checkbox for each of these options I just create separate methods.
![shipping options][1]
As you can see from the image, Magento is calculating the prices correctly. The issue I have is that when I select one of the options and hit "update total", it reverts back to the first option with the lowest price. After inspecting the inputs on the radio buttons, I found that they all have the same value.
<ul>
<li>
<input name="estimate_method[2]" type="radio" value="excellence_excellence" id="s_method_excellence_excellence_2" class="radio">
<label for="s_method_excellence_excellence_2">Freight<span class="price">$678.88</span></label>
</li>
<li>
<input name="estimate_method[2]" type="radio" value="excellence_excellence" id="s_method_excellence_excellence_2" class="radio">
<label for="s_method_excellence_excellence_2">Freight (Residential)<span class="price">$744.66</span></label>
</li>
.
. and so on.
.
</ul>
Since all of the inputs have the same value "excellence_excellence", it makes sense that the price would just default back to the first one. Unfortunately, I have no idea how to fix this.
Below are links to my Model class, config.xml, and system.xml files. Any help, thoughts, or resources provided would be greatly appreciated.
[Model][2]
[Config][3]
[System][4]
[1]: http://i.stack.imgur.com/ZjLsh.png
[2]: http://pastebin.com/kgvpScHF
[3]: http://pastebin.com/afH1Usjf
[4]: http://pastebin.com/b6HVyUKx | 0 | [
2,
4723,
17050,
5816,
7405,
12613,
1886,
5332,
52,
638,
800,
3726,
3726,
31,
679,
21,
5816,
7405,
12613,
19,
4723,
17050,
26,
71,
18,
7728,
7405,
9,
31,
851,
6368,
26,
7728,
2754,
5360,
3315,
15,
7728,
2754,
4332,
15,
17,
7728,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is there a table to query for Oracle Reserved Words?
===
Is there a table i can query all of Oracle Reserved Words?
Example, i can query `user_tab_cols` or `all_tab_cols` for handy to-date table information. | 0 | [
2,
25,
80,
21,
859,
20,
25597,
26,
15759,
9430,
715,
60,
800,
3726,
3726,
25,
80,
21,
859,
31,
92,
25597,
65,
16,
15759,
9430,
715,
60,
823,
15,
31,
92,
25597,
13,
1,
16704,
1,
15783,
1,
7771,
18,
1,
54,
13,
1,
1233,
1,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... |
Android: wrap_content is not working with ListView
===
I am working on android. I want my list view to wrap its content horizontally and not to fill all the width. The wrap_content properties is not working. What to do? | 0 | [
2,
13005,
45,
8118,
1,
25424,
25,
52,
638,
29,
968,
4725,
800,
3726,
3726,
31,
589,
638,
27,
13005,
9,
31,
259,
51,
968,
1418,
20,
8118,
82,
2331,
25658,
17,
52,
20,
3509,
65,
14,
9456,
9,
14,
8118,
1,
25424,
3704,
25,
52,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Ajax Accordion Panes: separate required field validators only triggered by a button in its pane
===
I have an Ajax accordion, using c# asp.net, with a few panels. In my first panel I have two required fields and have validation when a user clicks a button. Now I want more in another pane, but if I make them a required field, the button click that causes validation for them shows the message for the first panel as well.
Is there away to separate out the validators in each panel? Am I missing something completely obvious?
If any code could be helpful I will edit and include the requested code. Thank you to any advice you are able to provide. | 0 | [
2,
20624,
20753,
1809,
160,
45,
1725,
1390,
575,
7394,
9922,
104,
15164,
34,
21,
5167,
19,
82,
13,
16660,
800,
3726,
3726,
31,
57,
40,
20624,
20753,
15,
568,
272,
5910,
28,
306,
9,
2328,
15,
29,
21,
310,
9449,
9,
19,
51,
64,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Datasource in Repeater in Sitecore
===
I have the following inside a repeater;
<sc:Link runat="server" DataSource='<%# (Container.DataItem as Item).Paths.Path %>' TextField="Title" LinkField="Title" />
This however fails. I have also tried with
<sc:Link runat="server" DataSource='<%# Container.DataItem %>' TextField="Title" LinkField="Title" />
Which also fails. What am i missing? | 0 | [
2,
1054,
12097,
19,
6830,
106,
19,
689,
10375,
800,
3726,
3726,
31,
57,
14,
249,
572,
21,
6830,
106,
73,
13,
1,
3862,
45,
6258,
485,
721,
3726,
7,
10321,
106,
7,
1054,
12097,
3726,
22,
1,
11881,
5910,
13,
5,
1126,
5851,
106,
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... |
Unit Testing when using Input Iterators
===
Lets pretend that the class C below is very slow and that I don't want it in my unit tests. So I create a MockC which will eventually implement the same interface as the C class.
class IC
{
public:
};
class C: public IC
{
public:
C(){}
C(int c) : _c(c){}
int _c;
};
class MockC: public IC
{
public:
MockC(){}
MockC(int c) : _c(c){}
int _c;
};
I also have a stripped down input iterator which creates an object of type Value (could be C or MockC) when dereferenced:
template<class Value>
class GetNextIterator
{
public:
typedef int (*GetNext)();
GetNextIterator(GetNext getNext): _getNext(getNext)
{
_current = _getNext();
}
const Value* operator->() const
{
return new Value(_current);
}
protected:
int _current;
GetNext _getNext;
};
int count = 0;
int getNext()
{
return count++;
}
And then I have a container for C objects, as follows:
class IContainer
{
public:
};
class Container: public IContainer
{
public:
typedef GetNextIterator<C> Iterator;
virtual Iterator begin() const
{
return Iterator(getNext);
}
};
Now how do I go about testing the following function, just as an example:
int f(Container* c)
{
Container::Iterator i = c->begin();
return i->_c;
}
Remember, I don't wish to use the concrete class C and would prefer not to use the concrete Container class either. What should I do to fully unit test f() and functions that make use of IC implementations and the iterator above? My inclination would be to pass an IContainer pointer to f() instead of a Container pointer, but the interface wouldn't be the same since begin() returns: `GetNextIterator<C>`
in the case of Container. | 0 | [
2,
1237,
4431,
76,
568,
6367,
32,
106,
9922,
800,
3726,
3726,
6884,
8019,
30,
14,
718,
272,
1021,
25,
253,
2276,
17,
30,
31,
221,
22,
38,
259,
32,
19,
51,
1237,
4894,
9,
86,
31,
1600,
21,
10506,
150,
56,
129,
878,
8713,
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... |
Import Google Speadsheet into a Google Spreadsheet
===
I'm trying to import the url with query of a Google Spreadsheet into another Google Spreadsheet.
So on my webpage I use a url like this: https://docs.google.com/a/chiseledimages.com/spreadsheet/tq?tqx=out:html&tq=select%20C,D,E,F,G,H,I%20where%20%28A%20contains%20301%29&key=0AuOQkU9HTNwVdG5
to create a table referenceing the specified Doc and Selecting certain columns where Column A equals my clients account number, in this case 301.
What I want to do is have another spreadsheet that will automatically fill with the data from that URL. I tired =importdata("https://docs.google.com/a/chiseledimages.com/spreadsheet/tq?tqx=out:html&tq=select%20C,D,E,F,G,H,I%20where%20%28A%20contains%20301%29&key=0AuOQkU9HTNwVdG5")
but that just seemed to import html and not fill the sheet with data. I want to be able to do this so that my client can have a Google Spreadsheet that is auto filled with their data at all times, while not having direct access to the original spreadsheet with all my clients data.
thanks. | 0 | [
2,
9010,
8144,
9882,
1283,
17627,
77,
21,
8144,
1789,
17627,
800,
3726,
3726,
31,
22,
79,
749,
20,
9010,
14,
287,
6362,
29,
25597,
16,
21,
8144,
1789,
17627,
77,
226,
8144,
1789,
17627,
9,
86,
27,
51,
2741,
6486,
31,
275,
21,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Concatenate File name, remove leading and trailing whitespaces from strings in Batch?
===
I'm trying to concatenate file name (fileName) behind a directory path (C:\ExecutionSDKTest_10.2.2\Logs\) and before a file extension(.log) in batch, but I think because my fileName contains leading and trailing whitespaces, the cmd.exe does not recognize the concatenated path (logPath). Any ideas?
FOR %%G IN (C:\ExecutionSDKTest_10.2.2\*.properties) DO (
Set fileName= %%~nxG
REM echo !fileName!
REM java -jar Test.jar %%~nxG > Logs\%%~nxG.log
set logPath=%C:\ExecutionSDKTest_10.2.2\Logs\%%!fileName!%%.log%
Echo !logPath!
REM print each line in each of the log files
REM FOR /F "tokens=*" %%g in (!logPath!) DO (
REM echo %%g
REM )
pause
) | 0 | [
2,
1065,
9530,
8820,
3893,
204,
15,
4681,
1005,
17,
14323,
359,
5582,
18,
37,
7887,
19,
13064,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
1065,
9530,
8820,
3893,
204,
13,
5,
16877,
7259,
6,
439,
21,
16755,
2013,
13,
5,
150,
45,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
category check list for Wordpress e-commerce site
===
basically, i've searched and searched and can't find any thing conclusive to create a check list of categories to filter down the products on the products page. I'm using the wp e-commerce plugin. An example of what i need is like the side bar on http://www.asos.com/Women/Accessories/Cat/pgecategory.aspx?cid=4174&via=lhn . I assume thats most likely built on Magento which probably makes it harder. Any help would be nice because i'm pulling my hair out over this. | 0 | [
2,
3230,
2631,
968,
26,
833,
5890,
13,
62,
8,
26470,
689,
800,
3726,
3726,
11374,
15,
31,
22,
195,
9036,
17,
9036,
17,
92,
22,
38,
477,
186,
584,
28384,
20,
1600,
21,
2631,
968,
16,
6422,
20,
11945,
125,
14,
1985,
27,
14,
1985... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to tell if reads are being redirect to MySQL slave on Rails3
===
I just setup a master/slave setup on Rails3 using [seamless_database_pool][1], but am not sure if the reads are being redirected to the slave.
How can I check this at the MySQL level?
I was hoping `show processlist` would do this, but I'm not seeing any processes.
Thanks
[1]: http://github.com/wbharding/seamless_database_pool | 0 | [
2,
184,
20,
494,
100,
11137,
50,
142,
302,
14706,
20,
51,
18,
22402,
5217,
27,
2240,
18,
240,
800,
3726,
3726,
31,
114,
18161,
21,
1129,
118,
6151,
62,
18161,
27,
2240,
18,
240,
568,
636,
6858,
79,
923,
1,
18768,
8436,
1,
13378,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
this that pass inside object as parameter to Backbone View : "window" or "backbone view" object?
===
The code:
var Appointment = Backbone.Model.extend({});
var appointment = new Appointment();
appointment.set('title', 'My knee hurts');
var AppointmentView = Backbone.View.extend({
render: function(){
$(this.el).html('<li>' + this.model.get('title') + '</li>');
}
});
Question about that: $(this.el)...
looks like "this" is "window" object and not event object?
Please if you can expain deeply how it working.
Thanks,
Yosef
| 0 | [
2,
48,
30,
1477,
572,
3095,
28,
18906,
20,
24036,
1418,
13,
45,
13,
7,
27508,
7,
54,
13,
7,
1958,
8640,
1418,
7,
3095,
60,
800,
3726,
3726,
14,
1797,
45,
4033,
4905,
800,
24036,
9,
13998,
9,
1706,
1316,
43,
5,
1,
6,
73,
4033... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PECL Solr: SolrQuery Override addField function fails to match signature
===
Error: Query::addField() should be compatible with that of SolrQuery::addField()
my call
public function addField($field)
definition from manual
public SolrQuery SolrQuery::addField ( string $field )
Is there something I am missing? | 0 | [
2,
15439,
255,
7176,
139,
45,
7176,
139,
8190,
93,
84,
11891,
3547,
1109,
1990,
13614,
20,
730,
7810,
800,
3726,
3726,
7019,
45,
25597,
45,
45,
14854,
1109,
5,
6,
378,
44,
14961,
29,
30,
16,
7176,
139,
8190,
93,
45,
45,
14854,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery slideshow
===
I think this might be a CSS related issue: I have the following slider http://jsfiddle.net/asWeb/49CAu/1/ when the img (3 circles in a png file 960 X 200) slides it looks like it touches one of the arrows giving the impression that the arrow and the slider img are both jpg and not transparent as I want... I found it difficult to explain so sorry if it is confusing but let me know and I will try to be more clear on this...
The idea is that the final design should look like this: http://webterminator.deviantart.com/#/d57y3rs where the 3 circles will slide without having no borders around simply by being transparent on the top of everything.
Thank you | 0 | [
2,
487,
8190,
93,
18066,
1544,
800,
3726,
3726,
31,
277,
48,
530,
44,
21,
272,
18,
18,
1597,
1513,
45,
31,
57,
14,
249,
3295,
106,
7775,
6903,
728,
18,
1707,
12312,
9,
2328,
118,
472,
14113,
118,
3624,
19433,
118,
8197,
76,
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... |
DateTime.ParseExact throws FormatException for sv-SE culture when time is in the afternoon
===
I am observing some strange behavior in case of `DateTime.ParseExact` method with the Swedish (`sv-SE`) culture.
My computer's culture is `en-US` but the business logic demands the `sv-SE` culture. So I set it on the current thread first.
Thread.CurrentThread.CurrentUICulture = new CultureInfo("sv-SE");
Then I do the following to parse the `DateTime` value. The datetime I am trying to parse here is **11:57 AM on 27th May 2012**.
DateTime.ParseExact("270512T11:57", "ddMMyyThh:mm", Thread.CurrentThread.CurrentUICulture);
This works just fine.
But I get the exception when the time is from the night. When I try to parse the datetime stamp of value **11:57 PM on 27th May 2012**.
DateTime.ParseExact("270512T23:57", "ddMMyyThh:mm", Thread.CurrentThread.CurrentUICulture);
The above line gives the `FormatException` with the message **String was not recognized as a valid DateTime.**.
What is really wrong here?
| 0 | [
2,
1231,
891,
9,
3574,
1798,
396,
5183,
13566,
2595,
10066,
872,
26,
11209,
8,
870,
1365,
76,
85,
25,
19,
14,
3435,
800,
3726,
3726,
31,
589,
16987,
109,
2578,
3257,
19,
610,
16,
13,
1,
8209,
891,
9,
3574,
1798,
396,
5183,
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... |
Better way to work on a Rails gem
===
Hi guys sometimes I work a gem and sometimes to develop this gem I need a Rails application.
Actually when I do this I make my gem in the __vendor/plugins/my_gem/__ directory and I do all work in this directory.
May be there is other way to do this, more cleaner (plugin like this won't work in rails 4.0). | 0 | [
2,
574,
161,
20,
170,
27,
21,
2240,
18,
8551,
800,
3726,
3726,
4148,
2776,
1030,
31,
170,
21,
8551,
17,
1030,
20,
2803,
48,
8551,
31,
376,
21,
2240,
18,
3010,
9,
1121,
76,
31,
107,
48,
31,
233,
51,
8551,
19,
14,
13,
1,
3124,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mono for Android: Displaying a file chooser?
===
I am trying to port code from [this tutorial][1] to C# using [Mono for Android][2]. Here is my code:
FileLayout.axml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_width="fill_parent">
<TextView
android:text="@+id/TextView01"
android:id="@+id/TextView01"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip" />
<TextView
android:text="@+id/TextView02"
android:id="@+id/TextView02"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dip" />
</LinearLayout>
FileArrayAdapter.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
namespace FileChooser
{
public class FileArrayAdapter : ArrayAdapter<Option>
{
private Context c;
private int id;
private List<Option> items;
public FileArrayAdapter(Context context, int textViewResourceId,
List<Option> objects)
: base(context, textViewResourceId, objects)
{
c = context;
id = textViewResourceId;
items = objects;
}
public Option getItem(int i)
{
return items[i];
}
public View getView(int position, View convertView, ViewGroup parent)
{
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)c.GetSystemService(Context.LayoutInflaterService);
v = vi.Inflate(id, null);
}
Option o = items[position];
if (o != null)
{
TextView t1 = (TextView)v.FindViewById(Resource.Id.TextView01);
TextView t2 = (TextView)v.FindViewById(Resource.Id.TextView02);
if (t1 != null)
t1.Text = o.getName().ToString();
if (t2 != null)
t2.Text = o.getData().ToString();
}
return v;
}
}
}
Activity1.cs:
using System;
using System.Collections;
using System.Collections.Generic;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Util;
using Android.Views;
using Android.Widget;
using Android.OS;
using Java.IO;
using Environment = Android.OS.Environment;
namespace FileChooser
{
[Activity(Label = "FileChooser", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : ListActivity
{
private File currentDir;
private FileArrayAdapter adapter;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
currentDir = new File(Environment.RootDirectory.AbsolutePath);
fill(currentDir);
}
private void fill(File f)
{
File[] dirs = f.ListFiles();
Title = ("Current Dir: " + f.Name);
List<Option> dir = new List<Option>();
List<Option> fls = new List<Option>();
try
{
foreach (var ff in dirs)
if (ff.IsDirectory)
dir.Add(new Option(ff.Name, "Folder", ff.AbsolutePath));
else
fls.Add(new Option(ff.Name, "File Size: " + ff.Length(), ff.AbsolutePath));
dir.AddRange(fls);
if (!String.Equals(f.Name, "sdcard", comparisonType: StringComparison.InvariantCultureIgnoreCase))
dir.Insert(0, new Option("..", "Parent Directory", f.Parent));
adapter = new FileArrayAdapter(this, Resource.Layout.FileLayout, dir);
this.ListAdapter = adapter;
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine("Error: ", e.Message);
}
}
}
}
I get the following error:
The program 'Mono' has exited with code 255 (0xff).
I put a breakpoint after the last statement. Here is a sceenshot of my local variables:![enter image description here][3]
[1]: http://www.dreamincode.net/forums/topic/190013-creating-simple-file-chooser/
[2]: http://xamarin.com/monoforandroid
[3]: http://i.stack.imgur.com/bjicA.png | 0 | [
2,
4129,
26,
13005,
45,
17418,
21,
3893,
3538,
139,
60,
800,
3726,
3726,
31,
589,
749,
20,
1295,
1797,
37,
636,
1565,
29724,
500,
2558,
165,
500,
20,
272,
5910,
568,
636,
20027,
26,
13005,
500,
2558,
135,
500,
9,
235,
25,
51,
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... |
Move to start and end of search lookup in Emacs
===
How can you have the point at the beginning or end of the search string when accepting a search ?
So say you do C-s "foobar", I would like to have my cursor at the end of the found string when I press RET and at the beginning if I press C-RET.
Thanks | 0 | [
2,
780,
20,
799,
17,
241,
16,
2122,
361,
576,
19,
13,
62,
6893,
18,
800,
3726,
3726,
184,
92,
42,
57,
14,
454,
35,
14,
997,
54,
241,
16,
14,
2122,
3724,
76,
10894,
21,
2122,
13,
60,
86,
395,
42,
107,
272,
8,
18,
13,
7,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ORMLite display accents accents and other unicode symbols
===
I have seen in [ORMLite documentation][1] that stored strings with unicode symbols you have to use `String (DataType.STRING_BYTES)`. But Have I to change the String attribute for a ArrayBytes too?
Until now I have used @DatabaseField(dataType = DataType.STRING_BYTES) above my String attribute, but this not work.
**Model**
@DatabaseTable(tableName="Messages")
public class Message {
@DatabaseField(dataType = DataType.STRING_BYTES)
private String message;
get and set methods...
...
}
**Activity**
...
TextView message = new TextView(this);
message.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,LayoutParams.WRAP_CONTENT));
message.setText(m.getMessage());
linearLayout.addView(message);
...
[1]: http://ormlite.com/javadoc/ormlite-core/doc-files/ormlite_2.html#IDX106 | 0 | [
2,
54,
79,
10601,
3042,
7980,
18,
7980,
18,
17,
89,
28010,
9794,
800,
3726,
3726,
31,
57,
541,
19,
636,
248,
79,
10601,
13945,
500,
2558,
165,
500,
30,
8214,
7887,
29,
28010,
9794,
42,
57,
20,
275,
13,
1,
11130,
13,
5,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android listview selected checkbox delete from database
===
I'm using a custom list adapter for my listview. How can I get the database rowid/_id from the checked checkbox so that I can multiple delete the data from my database?
here' my activity:
import android.app.ListActivity;
import java.text.DecimalFormat;
import org.yhw.PlanWithMe.R;
import android.content.*;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.*;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.database.Cursor;
public class Finance_delete extends ListActivity {
Cursor cursor;
private TextView dateText;
private Button btnCancel;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.finance_delete);
registerForContextMenu(this.getListView());
DBAdapter dbHelper = new DBAdapter(this);
dbHelper.open();
// Get a Cursor for the list items
Intent intent = getIntent();
String date = intent.getStringExtra("date");
Cursor listCursor = dbHelper.getAllFinance(date);
startManagingCursor(listCursor);
// set the custom list adapter
setListAdapter(new MyListAdapter(this, listCursor));
dateText = (TextView) findViewById(R.id.lblDate);
dateText.setText("Delete Spending: " + date);
btnCancel = (Button) findViewById(R.id.btnCancel);
btnCancel.setOnClickListener(click_listener);
}
private class MyListAdapter extends ResourceCursorAdapter {
public MyListAdapter(Context context, Cursor cursor) {
super(context, R.layout.list_item_with_description_delete, cursor);
}
@Override
public void bindView(View view, Context context, Cursor cursor) {
CheckBox cbListCheck = (CheckBox) view
.findViewById(R.id.list_checkbox);
cbListCheck.setChecked(false);
cbListCheck
.setOnCheckedChangeListener(new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton cb,
boolean isChecked) {
if (cb.isChecked()) {
// action
} else if (isChecked == false) {
// action
}
}
});
TextView title = (TextView) view.findViewById(R.id.list_category);
title.setText(cursor.getString(cursor
.getColumnIndex(DBAdapter.KEY_Category)));
TextView details = (TextView) view.findViewById(R.id.list_desc);
StringBuffer detailsText = new StringBuffer();
String description = cursor.getString(cursor
.getColumnIndex(DBAdapter.KEY_Desc));
TextView spendings = (TextView) view
.findViewById(R.id.list_spending);
String spending = cursor.getString(cursor
.getColumnIndex(DBAdapter.KEY_Spending));
double tgtspend = Double.parseDouble(spending);
DecimalFormat dFormat = new DecimalFormat("0.00");
String formatSpend = dFormat.format(tgtspend);
spendings.setText("$" + formatSpend);
if (description != null && description.length() > 0) {
detailsText.append(description);
} else {
detailsText.append("-");
}
details.setText(detailsText.toString());
}
}
private OnClickListener click_listener = new OnClickListener() {
public void onClick(View view) {
// Intent intent = null;
switch (view.getId()) {
case R.id.btnCancel:
finish();
break;
}
}
};
}
my activity layout:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/finance_top" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="45dp"
android:src="@drawable/navbar" />
<TextView
android:id="@+id/lblDate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginTop="57dp"
android:layout_alignParentLeft="true"
android:textColor="#ffffff"
android:textSize="16dp" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="240dp"
android:layout_marginTop="48dp"
android:src="@drawable/divider" />
<Button
android:id="@+id/btnTick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="45dp"
android:layout_marginTop="56dp"
android:background="@drawable/btn_tick" />
<Button
android:id="@+id/btnCancel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginRight="6dp"
android:layout_marginTop="56dp"
android:background="@drawable/btn_cancel" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="282dp"
android:layout_marginTop="48dp"
android:src="@drawable/divider" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_marginTop="92dp"
android:orientation="vertical" >
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:id="@android:id/empty"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="106dp"
android:layout_marginTop="180dp"
android:text="@string/finance_note"
android:textColor="#ffffff"
android:textSize="18dp" />
</LinearLayout>
</RelativeLayout>
my listview layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeight" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:layout_weight="1"
android:duplicateParentState="true" >
<TextView
android:id="@+id/list_category"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:gravity="center_vertical"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/list_desc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@id/list_category"
android:singleLine="true"
android:textAppearance="?android:attr/textAppearanceSmall" />
<TextView
android:id="@+id/list_spending"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:gravity="center"
android:paddingBottom="10dip"
android:paddingTop="10dip"
android:textAppearance="?android:attr/textAppearanceLarge" />
<CheckBox
android:id="@+id/list_checkbox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="false"
android:text="" >
</CheckBox>
</RelativeLayout>
</LinearLayout>
| 0 | [
2,
13005,
968,
4725,
1704,
2631,
5309,
27448,
37,
6018,
800,
3726,
3726,
31,
22,
79,
568,
21,
5816,
968,
9924,
106,
26,
51,
968,
4725,
9,
184,
92,
31,
164,
14,
6018,
3131,
1340,
118,
1,
1340,
37,
14,
6505,
2631,
5309,
86,
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... |
Coq - Extract witness from Proposition
===
I'm trying to extract a witness from a coq proposition (or something like that...).
I have something that goes like
Parameter atom_fresh_for_list :
forall (xs : list atom), {x : atom | ~ List.In x xs}.
(Which is proven afterward, with an explicit type for `atom` :
Lemma atom_fresh_for_list :
forall (xs : list nat), { n : nat | ~ List.In n xs }.
How do I extract such an `x` ?
[The Documentation][1] says
>From such a (exist x p) we may in turn extract its witness x:A (using an elimination construct such as match)
but i don't get how this works....
It also says
> Given A:Type and P:A->Prop, the construct {x:A | P x} is a Type
But if i try something like `Parameter C : {x : atom | x \notin xs}`, it gives
Error: The term "C" has type "{x : atom | x \notin xs}" which should be Set, Prop or Type.
[1]: http://coq.inria.fr/refman/Reference-Manual005.html#@default211 "The ducomentattion" | 0 | [
2,
326,
1251,
13,
8,
10962,
6165,
37,
12566,
800,
3726,
3726,
31,
22,
79,
749,
20,
10962,
21,
6165,
37,
21,
326,
1251,
12566,
13,
5,
248,
301,
101,
30,
9,
9,
9,
6,
9,
31,
57,
301,
30,
1852,
101,
18906,
14571,
1,
22373,
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... |
Need of advice about MVC
===
I'm still a beginner in MVC, so I have problems in Conception. I have many catagories C1, C2, C3. Every category has her special structure. So **every category** should be presented in a **Model Class**. I also have for **every category** its own **table in the database**, mapped to eachother by **Hibernate**. I need in my application, to get the data from an Excel File ( I succeeded the upload and getting data from excel file ). But the excel file should respect the structure of the category chosen in the form. So it means, if I choose in the select of the form C1, then I upload an excel file with a different structure, that file should be rejected... **So how can I do for conception of Excel file processing for every category**??
**P.S:** I have 5 packages, one for the Actions in Struts, another for DAO ( defining functions for accessing my databases tables and do operations such as Select, Update and Delete), one for Mapping ( xxx.hbm.xml files for mapping the tables and the models), the other for the Model classes, anf finally Services, for any other processes on my data to call in my action classes. For the jsp pages ( View ) I have them in Webcontent directory or in one of its subdirectories. | 0 | [
2,
376,
16,
4978,
88,
307,
8990,
800,
3726,
3726,
31,
22,
79,
174,
21,
26931,
19,
307,
8990,
15,
86,
31,
57,
1716,
19,
13315,
9,
31,
57,
151,
2008,
9668,
2829,
272,
165,
15,
272,
135,
15,
272,
240,
9,
352,
3230,
63,
36,
621,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setting up USSD development environment for testing and developing a USSD based service before deployment
===
I have looked over the internet fro a long time but failed to filed the exact information required to set up a development environment for developing and testing USSD services developed on my PC.
Please someone out there provide me with the steps I have to take, what is required for my PC to start developing this service that.
All i understand is that i need a web-base app that uses the RESP API for the requests and responses but these RE come and go to the ussd server which forward them to the GSM phone, but how can i start developing this...
Please help me on this...thank you inadvance. | 0 | [
2,
2697,
71,
10973,
43,
522,
2307,
26,
4431,
17,
3561,
21,
10973,
43,
432,
365,
115,
10475,
800,
3726,
3726,
31,
57,
292,
84,
14,
2620,
8467,
21,
175,
85,
47,
1702,
20,
5263,
14,
5340,
676,
1390,
20,
309,
71,
21,
522,
2307,
26... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Keeping unwanted file or functions in Android consume memory
===
Keeping waste file or functions in code increases memory consumption?. Will it impact on application or its performance? | 0 | [
2,
2882,
21095,
3893,
54,
3719,
19,
13005,
16447,
1912,
800,
3726,
3726,
2882,
4600,
3893,
54,
3719,
19,
1797,
7104,
1912,
8330,
60,
9,
129,
32,
2261,
27,
3010,
54,
82,
956,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Lazy match {x,y} ? y meaningless?
===
What is the significance of 5 in {2,5}? it matches 2 to 5 of the preceeding token. This is a lazy match, and will match as few characters as possible before satisfying the next token.
I took example `abcccccabccc` and don't see any use of 5 in {2,5}? it matches only 2 consecutive a.
Can someone give any example where second parameter plays any role? ( 5 in this case {2,5}?)
abc{2,5} is greedy match
First match: abccccc
Second match: abccc
abc{2,5}? is lazy match
First match: abcc
Second match: abcc
<a href="http://gskinner.com/RegExr/">reference</a> | 0 | [
2,
16792,
730,
13,
1,
396,
15,
93,
1,
13,
60,
13,
93,
27095,
60,
800,
3726,
3726,
98,
25,
14,
7294,
16,
331,
19,
13,
1,
135,
15,
264,
1,
60,
32,
1717,
172,
20,
331,
16,
14,
782,
1105,
69,
68,
20,
2853,
9,
48,
25,
21,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
c# wp7: Start an eventhandler when my timer value reaches 0
===
This is my code for a timer, I want to load my gameover.xaml once my timer reaches 0. How do I connect the event.
public void StartTimer(object o, RoutedEventArgs sender)
{
myDispatcherTimer = new DispatcherTimer();
myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 1000); // 1000 Milliseconds
myDispatcherTimer.Tick += new EventHandler(Each_Tick);
myDispatcherTimer.Start();
}
// counter
int i = 60;
public void Each_Tick(object o, EventArgs sender)
{
timerBlock.Text = "Time: " + i--.ToString() + "s";
}
And here is my event method
private void gameOverEvent(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/gameOver.xaml", UriKind.Relative));
}
how can I do this -
if (i <= 0)
something += new EventHandler(gameOverEvent);
What shall I put in something. | 0 | [
2,
272,
5910,
13,
13790,
465,
45,
799,
40,
807,
3203,
1252,
76,
51,
85,
139,
1923,
5539,
713,
800,
3726,
3726,
48,
25,
51,
1797,
26,
21,
85,
139,
15,
31,
259,
20,
6305,
51,
250,
2549,
9,
6791,
8184,
382,
51,
85,
139,
5539,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Perform segue from button in XIB
===
I'm using storyboards for the most of my project, but i have one UIScrollView that consists of multiple views that are loaded from XIB
I'm stuck on how to perform a segue when a button is clicked in the XIB
What i've done already.
* Added the views to a scroll view
* Added a custom button
* added an IBAcion on the custom button
MainViewController
NSString *nibName = @"coverArticleView";
NSArray *nibObjects = [NSBundle.mainBundle loadNibNamed:nibName owner:self options:nil];
coverArticle *pageView = [nibObjects objectAtIndex:0];
pageView.articleTitle.text = ob.Title;
pageView.articleTitle.numberOfLines =0;
// updating some more properties here & designing the scroll view
[coverArticlesScrollView addSubview:pageView];
coverArticle.m (class of the XIB)
- (IBAction)buttonPressed:(id)sender {
NSLog(@"button pressed");
}
When the log 'button pressed' is printed so that's working.
But how do i perform a segue when the button is pressed ?
thnx
| 0 | [
2,
2985,
1353,
3982,
37,
5167,
19,
5641,
220,
800,
3726,
3726,
31,
22,
79,
568,
609,
2806,
18,
26,
14,
127,
16,
51,
669,
15,
47,
31,
57,
53,
13,
5661,
3862,
8694,
4725,
30,
2043,
16,
1886,
4146,
30,
50,
8572,
37,
5641,
220,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery animate wont work
===
jQuery-newbie here.
I want to do a simple horizontal scroll function with two buttons. I want to do it with animate. But when I click on one of the buttons, nothing happens...
Heres the jQuery Code:
<script type="text/javascript">
$(document).ready(function() {
$('#right-button').click(function {
$('#box').animate({
left: +="200px"
}, "fast");
});
$('#left-button').click(function {
$('#box').animate({
left: -="200px"
}, "fast");
});
});
</script>
This is the HTML code:
<section id="main">
<span class="scrollbutton left" id="left-button">(</span>
<span class="scrollbutton right" id="right-button">)</span>
<div id="box">
<div class="column"></div>
...
</div>
</section>
(I've also tried it with an a-Tag)
Aaaaand here's the css:
#main {
border: solid 1px #fff;
max-height: 480px;
width: auto;
display: block;
overflow: hidden;
background: #ddd;
}
#main #box {
width: 2250px;
display: inline;
float: left;
position: relative;
}
#main .column {
float: left;
display: inline;
padding: 10px;
width: 429px;
border-left: solid 1px #333;
height: 460px;
}
.scrollbutton {
font-family: "WebSymbolsRegular";
font-size: 30px;
color: #000;
text-decoration: none;
cursor: pointer;
}
.left {
float: left;
}
.right {
float: right;
}
It's probably a very naive error, but I just have no idea what it is... I hope you can help me :) | 0 | [
2,
487,
8190,
93,
14487,
591,
7290,
170,
800,
3726,
3726,
487,
8190,
93,
8,
2681,
5893,
235,
9,
31,
259,
20,
107,
21,
1935,
10095,
12159,
1990,
29,
81,
12861,
9,
31,
259,
20,
107,
32,
29,
14487,
591,
9,
47,
76,
31,
10840,
27,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to acess same sqllite database from phonegap and android?
===
I am trying to build a game in android most of the part of the game is written in HTML5 a sqllite database is also created for the same. I want to access the sqllite database created in HTML5 from java to add or remove values?
Any phonegap plugin for that? | 0 | [
2,
184,
20,
21,
5052,
18,
205,
4444,
211,
2119,
6018,
37,
1132,
1136,
306,
17,
13005,
60,
800,
3726,
3726,
31,
589,
749,
20,
1895,
21,
250,
19,
13005,
127,
16,
14,
141,
16,
14,
250,
25,
642,
19,
13,
15895,
264,
21,
4444,
211,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to solve this error when using Hybridauth "An error occurred with <app name>. Please try again later."
===
I use hybridauth to connect with facebook, when i try to connect with face book i get the following error.
An error occurred with <app name>. Please try again later.
API Error Code: 191
API Error Description: The specified URL is not owned by the application
Error Message: redirect_uri is not owned by the application.
How to solve this?
also now it is getting called directly when i call the page but i want to give a link where the user can click and once the user clicks only the facebook login can be called in a separate popup window and making the parent page shade.
i am aksing this question here since i a new guy to PHP and only started to work on this three days.
thanks in advance
Regards
Tony | 0 | [
2,
184,
20,
8402,
48,
7019,
76,
568,
6957,
1346,
96,
13,
7,
210,
7019,
2437,
29,
13,
1,
7753,
204,
1,
9,
2247,
1131,
188,
138,
9,
7,
800,
3726,
3726,
31,
275,
6957,
1346,
96,
20,
6379,
29,
9090,
15,
76,
31,
1131,
20,
6379,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GWT-PhoneGap integeration
===
I am looking for integrating gwt with phonegap , i grabbed one from [Phonegap Jar available for GWT][1] , but i could not find any resource how to implement phonegap with GWT, i.e i could not find a way how to associate gwt objects like buttons,textarea,events with phone gap. I did look at [Getting started with gwt and phonegap][2] ,but the resources only provide details about available methods with phonegap(events,loctaions,timers etc..). Could anyone please provide me any example(#hello world#) how to integrate gwt and phonegap or any resource which gives a simple example.
[1]: http://code.google.com/p/gwt-phonegap/
[2]: http://code.google.com/p/gwt-phonegap/wiki/GettingStarted | 0 | [
2,
14094,
38,
8,
7709,
1136,
306,
13820,
857,
800,
3726,
3726,
31,
589,
699,
26,
24529,
14094,
38,
29,
1132,
1136,
306,
13,
15,
31,
2338,
53,
37,
636,
7709,
1136,
306,
5112,
904,
26,
14094,
38,
500,
2558,
165,
500,
13,
15,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Animating reorganisation of elements with CSS3/Webkit
===
I've got a div, which has a number of child divs with `float: left;`. Depending on the size of the screen, the parent div will change shape, causing the child divs to wrap into different positions.
Is there a way to make the child divs transition to their new positions using CSS3 animation? I've tried the following on the child elements:
-webkit-transition: top, left;
-webkit-transition-timing-function: linear;
-webkit-transition-duration: 150ms;
But it doesn't work, I assume because I'm not setting the `left` and `right` properties explicitly when the children are reorganised.
Any help with this would be greatly appreciated!
Cheers. | 0 | [
2,
14487,
1203,
25770,
16,
2065,
29,
272,
18,
18,
9280,
14113,
13703,
800,
3726,
3726,
31,
22,
195,
330,
21,
13,
12916,
15,
56,
63,
21,
234,
16,
850,
13,
12916,
18,
29,
13,
1,
14712,
721,
45,
225,
73,
1,
9,
4758,
27,
14,
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... |
Does WP complete the rendering of the page on server side before showing the page?
===
All static html pages of my project are rendered very fast on my local drive, so the FOUC (Flicker of Unstyled Content) is not obvious.
However, after the project has been integrated with WordPress and put onto remote server, the page rendering becomes a bit slower, so the FOUC becomes a bit more obvious.
When I click on a hyperlink to request viewing a page, I would like WordPress to complete the redering of the page on server side and then show me the page. Waiting 1 or 2 seconds is okay. Can WP do that? | 0 | [
2,
630,
13,
13790,
1279,
14,
15307,
16,
14,
2478,
27,
8128,
270,
115,
3187,
14,
2478,
60,
800,
3726,
3726,
65,
12038,
13,
15895,
4434,
16,
51,
669,
50,
10877,
253,
1512,
27,
51,
375,
1493,
15,
86,
14,
4310,
6335,
13,
5,
410,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery Not working in Fire Fox but works in IE
===
I use the following function for decimal validation it was work fine in IE and Chrome.But not working in Fire Fox.If I run this code in fire fox i Cant enter any character.How to solve this?
$('.decimalValidate').live('keypress', function (event) {
var decimalid = $(this).attr("id");
var decimalval = $('#' + decimalid).val();
if ((event.which > 47 && event.which < 58)) {
return true;
}
if ((event.which == 8 || event.which == 46) && decimalval.indexOf('.') == -1) {
return true;
}
return false;
});
this condition is not working in FF
if ((event.which == 8 || event.which == 46) && decimalval.indexOf('.') == -1) {
return true;
} | 0 | [
2,
487,
8190,
93,
52,
638,
19,
535,
2385,
47,
693,
19,
13,
660,
800,
3726,
3726,
31,
275,
14,
249,
1990,
26,
26380,
27999,
32,
23,
170,
1123,
19,
13,
660,
17,
13,
12985,
9,
811,
52,
638,
19,
535,
2385,
9,
821,
31,
485,
48,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Remove the language tag from bottom panel in inno set up
===
I want to remove the Language tag from the bottom panel..Like in below screen it shows NORSK..as i have Norwegian as my selected language for installation..
![enter image description here][1]
[1]: http://i.stack.imgur.com/cEnxb.png | 0 | [
2,
4681,
14,
816,
3383,
37,
2129,
4113,
19,
19,
251,
309,
71,
800,
3726,
3726,
31,
259,
20,
4681,
14,
816,
3383,
37,
14,
2129,
4113,
9,
9,
1403,
19,
1021,
2324,
32,
1285,
90,
22418,
9,
9,
472,
31,
57,
3780,
28,
51,
1704,
816... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Set encoding when loading local html files from IsolatedStorage to WebBrowser control?
===
I needed to load local html files from the phone, and these files included references to imag files.
Following [this][0] article, I managed to get the images to display. However, encoding was messed up.
When using NavigateToString encoding seemed fine.
Is there a way to fix this issue? I presume setting the correct encoding would work,
however, when using Navigate, the browser seems to ignore the meta tag defining charset.
[0]: http://msdn.microsoft.com/en-us/library/ff431811%28v=VS.92%29.aspx#Y122 | 0 | [
2,
309,
19608,
76,
12797,
375,
13,
15895,
6488,
37,
6331,
18,
2153,
1303,
20,
10192,
5417,
4104,
569,
60,
800,
3726,
3726,
31,
851,
20,
6305,
375,
13,
15895,
6488,
37,
14,
1132,
15,
17,
158,
6488,
506,
7231,
20,
31,
9473,
6488,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
file does not strore in document directory
===
I am storing an audio file with extension .m4a at document directory
first time my file store perfectly at the document directory path but
after that my file does not store at document directory path.
In console it shows me the entire path but in the document directory
does not exist. My code is as follows:
NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [path objectAtIndex:0];
originalFilePath = [documentsDirectory stringByAppendingPathComponent:audioname];
NSLog(@"Audioname:::: %@",audioname);
NSLog(@"originalpath=%@",originalFilePath);
if you have any idea then share it with me. | 0 | [
2,
3893,
630,
52,
12160,
99,
19,
4492,
16755,
800,
3726,
3726,
31,
589,
25615,
40,
4023,
3893,
29,
3896,
13,
9,
79,
300,
58,
35,
4492,
16755,
64,
85,
51,
3893,
1718,
5759,
35,
14,
4492,
16755,
2013,
47,
75,
30,
51,
3893,
630,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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's the maximum size of web.config?
===
When I tried to open my SharePoint extended site, I received error 500. The error message was:
>Cannot read configuration file because it exceeds the maximum file size
My `web.config` file was just about 260 KB, because it had so many `<SafeControl>` entries in it. After removing some of the old entries, and getting the file down to 186 KB, my site started to load correctly.
My question: <br/>What is the maximum size of web.config? <br/>
What can be done to avoid such problems in the future? | 0 | [
2,
98,
22,
18,
14,
2979,
1072,
16,
2741,
9,
14093,
2816,
60,
800,
3726,
3726,
76,
31,
794,
20,
368,
51,
1891,
3132,
1984,
689,
15,
31,
420,
7019,
3033,
9,
14,
7019,
2802,
23,
45,
13,
1,
1245,
1270,
1302,
8091,
3893,
185,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Regular expression in Python 2.7
===
Another question :
I'm trying to search for a specific pattern in a fiel , but I have to deal with the following case :
This line returns a correct interpretation
f27 = re.findall( b'\x03\x00\x00\x27''(.*?)''\xF7\x00\xF0', s)
but this one got badly interpreted as x28 is related to the '()' parenthesis
f28 = re.findall( b'\x03\x00\x00\x28''(.*?)''\xF7\x00\xF0', s)
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "D:\Portable Python 2.7.2.1\App\lib\re.py", line 177, in findall
return _compile(pattern, flags).findall(string)
File "D:\Portable Python 2.7.2.1\App\lib\re.py", line 244, in _compile
raise error, v # invalid expression
error: unbalanced parenthesis
I tried with several escapes '\' and '/' but no way !
Any solution ?
Thx | 0 | [
2,
1290,
1803,
19,
20059,
172,
9,
465,
800,
3726,
3726,
226,
1301,
13,
45,
31,
22,
79,
749,
20,
2122,
26,
21,
1903,
3732,
19,
21,
6028,
532,
13,
15,
47,
31,
57,
20,
1183,
29,
14,
249,
610,
13,
45,
48,
293,
4815,
21,
4456,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pluggable switch statements
===
I have the following switch statement:
switch($post->post_type) {
default:
echo 'default';
<?php }
which in essence is about as basic as you can get. The `post->post_type` is simply a variable that will return a string depending on the post type of an item (WordPress).
What I'd like to be able to do is plug into the switch statement very similarly as someone would an array - like so:
function add_extra_fruits($fruits) {
$extra_fruits = array(
'plums',
'kiwis',
'tangerines',
'pepino melons'
);
// combine the two arrays
$fruits = array_merge($extra_fruits, $fruits);
return $fruits;
}
add_filter('add_fruits', 'add_extra_fruits');
using the `array_merge()` function.
I was given the following example to try:
switch ( true /* we're comparing a boolean, not the post type! */ ) {
case has_action( "basey_loop_single_$post->post_type" ) :
do_action( "basey_loop_single_$post->post_type" );
break;
default :
// default post layout
}
but I'm not sure if this accomplishes what I'm after as passing an example action, like so:
function basey_loop_single_page_output() {
echo 'test';
}
add_action('basey_loop_single_page', 'basey_loop_single_page_output');
does not return anything when the `$post->post_type` condition is met as it is specified. Anyone have an idea of how this could be approached? At its simplest, this is a core PHP question (about plugging into a switch statement), but obviously some of the lingo here is more geared towards WordPress.
Thanks! | 0 | [
2,
10922,
263,
579,
5521,
9015,
800,
3726,
3726,
31,
57,
14,
249,
5521,
3331,
45,
5521,
5,
4403,
6962,
8,
1,
6962,
1,
4474,
6,
13,
1,
12838,
45,
8117,
13,
22,
13862,
9708,
22,
73,
13,
1,
60,
26120,
13,
1,
56,
19,
11887,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can't use composite component on same page with a ui:include that relies on ui:params
===
I have a base page that uses a ui:include to include another page. The ui:include uses a ui:param to pass a parameter to the included page. The param is read in the PostConstruct method of the included page's controller.
This design works fine until I add a composite component to the base page; once added, the included page controller reports that the ui:param's value is null. Once I remove the composite component from the page, the ui:param is able to be read (i.e. is not null) by the included page's controller. Please help!
**myPage.xhtml**
<html xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:mycomponents="http://java.sun.com/jsf/composite/mycomponents">
<ui:include src="includePage.xhtml">
<ui:param name="myParam" value="myValue"/>
</ui:include>
<p/>
<mycomponents:myComponent/>
</html>
**myIncludedPage.xhtml**
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets">
The value of the param is: #{includedPageController.myParam}
</ui:composition>
**myComponent.xhtml** (placed in "resources/mycomponents")
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:composite="http://java.sun.com/jsf/composite">
<composite:interface/>
<composite:implementation>
I am the composite component
</composite:implementation>
</html>
**IncludedPageController.java**
@ManagedBean
public class IncludePageController
{
String myParam;
@PostConstruct
private void init()
{
FaceletContext faceletContext = (FaceletContext)FacesContext.getCurrentInstance().
getAttributes().get(FaceletContext.FACELET_CONTEXT_KEY);
myParam = (String)faceletContext.getAttribute("myParam");
}
public String getMyParam()
{
return myParam;
}
public void setMyParam(String myParam)
{
this.myParam = myParam;
}
}
**Output when the composite component IS NOT included on myPage.xhtml**
The value of the param is: myValue
**Output when the composite component IS included on myPage.xhtml**
The value of the param is:
I am the composite component
| 0 | [
2,
92,
22,
38,
275,
12639,
5912,
27,
205,
2478,
29,
21,
13,
5661,
45,
22640,
30,
19272,
27,
13,
5661,
45,
6351,
79,
18,
800,
3726,
3726,
31,
57,
21,
1000,
2478,
30,
2027,
21,
13,
5661,
45,
22640,
20,
468,
226,
2478,
9,
14,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Nesting arbitrary objects in Java
===
I am having trouble solving a particular problem in Java (which I did not find by search). I do not know how to create a nested lists of objects - with a different type of object/primitive type at the end. For example:
**Note: only an example. I am actually doing this below with something other than Employee, but it serves as simple example.*
I have an array of an object Employee. It contains information on the Employee.
public class Employee {
int age
int salary
int yearsWorking
public Employee () {
// constructor...
}
// Accessors
}
What I need to do is organize the Employees by quantiles/percentiles. I have done so by the following:
import org.apache.commons.math.stat.descriptive.rank.Percentile;
public class EmployeeSort {
public void main(String args[]) {
Percentile p = new Percentile();
Employee[] employeeArray = new Employee(100);
// filled employeeArray
double[] ageArray new double[100];
// filled ageArray with ages from employeeArray
int q = 25; // Percentile cutoff
for (int i = 1; i*q < 100; i++) {
// assign percentile cutoff to some array to contain the values
}
}
}
Now, the problem I have is that I need to organize the Employees first by the percentiles of age, then percentiles of yearsWorking, and finally by percentiles of salary. My Java knowledge is inadequate right now to solve this problem, but the project I was handed was in Java. I am primarily a python guy, so this problem would have been a lot easier in that language. No such luck. | 0 | [
2,
24338,
17237,
3916,
19,
8247,
800,
3726,
3726,
31,
589,
452,
2572,
17533,
21,
1498,
1448,
19,
8247,
13,
5,
2140,
31,
144,
52,
477,
34,
2122,
6,
9,
31,
107,
52,
143,
184,
20,
1600,
21,
5618,
69,
7227,
16,
3916,
13,
8,
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... |
__iter__() implemented as a generator
===
I have an object subclass which implements a dynamic dispatch __ iter __ using a caching generator (I also have a method for invalidating the iter cache) like so:
def __iter__(self):
print("iter called")
if self.__iter_cache is None:
iter_seen = {}
iter_cache = []
for name in self.__slots:
value = self.__slots[name]
iter_seen[name] = True
item = (name, value)
iter_cache.append(item)
yield item
for d in self.__dc_list:
for name, value in iter(d):
if name not in iter_seen:
iter_seen[name] = True
item = (name, value)
iter_cache.append(item)
yield item
self.__iter_cache = iter_cache
else:
print("iter cache hit")
for item in self.__iter_cache:
yield item
It seems to be working... Are there any gotchas I may not be aware of? Am I doing something ridiculous? | 0 | [
2,
13,
1,
242,
106,
1,
5,
6,
6807,
28,
21,
15286,
800,
3726,
3726,
31,
57,
40,
3095,
972,
1898,
56,
8713,
18,
21,
7782,
14226,
13,
1,
32,
106,
13,
1,
568,
21,
1658,
7192,
15286,
13,
5,
49,
67,
57,
21,
2109,
26,
16671,
1880... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
xml2struct with missing/optional values
===
I am using xml2struct to transform a xml file to a struct. It can be the case that certain optional nodes do not exist in the xml file. I would like to detect this and insert 'NULL' fields into the struct. I understand that there is no NULL in MATLAB. So I wonder what experienced users tend to use to represent missing/optional values. | 0 | [
2,
23504,
135,
10346,
29,
2863,
118,
2594,
3309,
192,
4070,
800,
3726,
3726,
31,
589,
568,
23504,
135,
10346,
20,
8007,
21,
23504,
3893,
20,
21,
13,
10346,
9,
32,
92,
44,
14,
610,
30,
1200,
12832,
16272,
107,
52,
3182,
19,
14,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setting max. upload size for Archetypes FileField
===
How one can limit the size of a file uploaded to Archetypes FileField?
| 0 | [
2,
2697,
2049,
9,
71,
8294,
1072,
26,
13,
21943,
4474,
18,
3893,
1109,
800,
3726,
3726,
184,
53,
92,
4496,
14,
1072,
16,
21,
3893,
23782,
20,
13,
21943,
4474,
18,
3893,
1109,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
ios changing navigation bar height causes leftBarButtonItem not to be centered
===
I'm working on a project that needs to have the navigation bar height bigger than the default.
This is how i set the nav bar height:
- (CGSize)sizeThatFits:(CGSize)size {
if (iPad) {
CGSize newSize = CGSizeMake(768,86);
return newSize;
}
return CGSizeMake(320, 44);}
I set an bg image for the navigation bar and that's working ok.
The problem is that the back button and the right button item are not centered.
Does anyone know how to center them?
Thanks | 0 | [
2,
13,
7760,
4226,
8368,
748,
2947,
4047,
225,
1850,
811,
444,
2119,
79,
52,
20,
44,
10583,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
669,
30,
2274,
20,
57,
14,
8368,
748,
2947,
6197,
119,
14,
12838,
9,
48,
25,
184,
31,
309,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript property from variable
===
I have a problem with my JavaScript code. I'm starting with some more complex things right now, seemed to find some answers on the net, but unfortunately I can't get it fixed. The problem is:
I want the variables sGetMobileField and ValMob to get in the parameters, but like this it isn't working:
var oFieldValues = { sGetMobileField:) { Value: ValMob } };
Variables don't seem to work as a object property. Anybody can help me fix it?
Thanks and best regards,
Dane | 0 | [
2,
8247,
8741,
1354,
37,
7612,
800,
3726,
3726,
31,
57,
21,
1448,
29,
51,
8247,
8741,
1797,
9,
31,
22,
79,
1422,
29,
109,
91,
1502,
564,
193,
130,
15,
890,
20,
477,
109,
6709,
27,
14,
4275,
15,
47,
6200,
31,
92,
22,
38,
164,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
R comparing columns of a row keeping other row values same and proceed to next in iteration
===
I have 9 parameters and 3 columns of each parameter in a single dataframe. there are around 15000 such frames. For each parameter, I have to compare the values in columns (low,high,orig) keeping values of other 8 params orig and generating a mean and then if that value is bigger then I substitute that value for orig for that param1. Now next param2 again I compare columns generate mean keeping orig value of other 8 params (param1 will now have my original substituted value) and so on till all optimized values of 9 params. Once these values are obtained, i store it then proceed to next frame and so on till 15000 such frames. My question is how do I iterate through 15000 frames keeping 9 params iterating till optimization is achieved..Can I do list of frame then iterate through 15000 lists? | 0 | [
2,
761,
15047,
7498,
16,
21,
3131,
2882,
89,
3131,
4070,
205,
17,
11158,
20,
328,
19,
23534,
800,
3726,
3726,
31,
57,
561,
12905,
17,
203,
7498,
16,
206,
18906,
19,
21,
345,
1054,
8361,
9,
80,
50,
140,
357,
3993,
145,
12809,
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... |
Combining data from two SQL queries
===
I'm porting my app from Django to ASP.NET Webforms (against my will, but what can we do with the corporate world..), and I'm used to Django generating all my SQL queries so now I need help.
I have 3 tables: `proceso`,`marcador`,`marcador_progreso`
Every `proceso` has many `marcador_progreso`, which in turn is the foreign key table to `marcador`.
So basically the tables look like:
proceso
id
marcador
id
text
marcador_progreso
id
marcador_id
proceso_id
state
For all the `marcador_progreso` where its `proceso_id` is the current proceso (from a QueryField in the URL), I need to list its `state` and it's respective `marcador.text`.
I've been working with EntityFramework but this is like a double query so I'm not sure how to do it.
I guess it is something that combines the following two statements, but I'm not sure how to do it.
SELECT [state] FROM [marcador_progreso]
SELECT [text] FROM [marcador] WHERE ([id] = marcador_id)
| 0 | [
2,
12803,
1054,
37,
81,
4444,
255,
9386,
2829,
800,
3726,
3726,
31,
22,
79,
1295,
68,
51,
4865,
37,
3857,
14541,
20,
28,
306,
9,
2328,
2741,
4190,
18,
13,
5,
24559,
51,
129,
15,
47,
98,
92,
95,
107,
29,
14,
4871,
126,
9,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where can I find the Android source code for the Vigenere cipher?
===
in my app I wanted to implement some enciphering. Therefore I need the code for the Vigenere cipher. Does anyone know where I can find that source code for Android? | 0 | [
2,
113,
92,
31,
477,
14,
13005,
1267,
1797,
26,
14,
1790,
9181,
99,
23525,
60,
800,
3726,
3726,
19,
51,
4865,
31,
417,
20,
8713,
109,
1957,
11526,
1694,
68,
9,
1793,
31,
376,
14,
1797,
26,
14,
1790,
9181,
99,
23525,
9,
630,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... |
Get the start position of selected text in html editor of ext.net
===
How will i get the start and position of the selected text in HtmlEditor of Ext.net.
Right now i am using
editor.el.dom.selectionStart
and
editor.el.dom.selectionEnd. But it is giving me undefined value | 0 | [
2,
164,
14,
799,
649,
16,
1704,
1854,
19,
13,
15895,
1835,
16,
1396,
38,
9,
2328,
800,
3726,
3726,
184,
129,
31,
164,
14,
799,
17,
649,
16,
14,
1704,
1854,
19,
13,
15895,
13401,
16,
1396,
38,
9,
2328,
9,
193,
130,
31,
589,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Is it possible to introspect actual attributes/methods of an object which overrides `__dir__` and `__getattribute__`?
===
Some answers from [this question][1] bring very silly ways to cripple the ability to access methods and attributes for instances of objects overriding `__dir__` and `__getattribute__`.
The attributes and methods are still there, but are they really inaccessible?
For example, `type(x)` still returns the correct answer even if `x.__class__` raises AttributeError.
Is there any way to access the hidden methods and attributes?
[1]: http://stackoverflow.com/questions/11536961/python-object-atributes-and-methods/11537394#comment15254706_11537394 | 0 | [
2,
25,
32,
938,
20,
17386,
7350,
3463,
13422,
118,
5909,
1807,
43,
18,
16,
40,
3095,
56,
84,
11891,
18,
13,
1,
9035,
1,
17,
13,
1,
3060,
721,
14755,
1,
60,
800,
3726,
3726,
109,
6709,
37,
636,
1565,
1301,
500,
2558,
165,
500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
FB Wall Posting with Link from FB IFrame App
===
I am doing the FB Wall post with a link says http://www.rewardtv.com. When i post it from my standalone website (using spring social) the link on the wall is working fine. It goes to the google.com
But when i use the same code from FB app and post it to the wall, even though the wall post looks correct. But when i click on the link it is getting redirected to
http://www.facebook.com/connect/uiserver.php?app_id=172622806174327&method=permissions.request&redirect_uri=http%3A%2F%2Fwww.rewardtv.com%2F&response_type=code&display=page&auth_referral=1
and then getting a error page that my "An error occured with <app>. Please try again.
Any help please... My intention even if the wall is posted from FB app (iframe), it should be directed to www.google.com instead of going to my app connect
Constructing link like below
FacebookLink link = new FacebookLink("http://www.rewardtv.com",
rtvLinkTitle, rtvLinkHeading,
rtvLinkMessage);
and doing the post like
facebook.feedOperations().postLink(message, facebookLink);
| 0 | [
2,
13,
13478,
769,
15669,
29,
3508,
37,
13,
13478,
31,
8361,
4865,
800,
3726,
3726,
31,
589,
845,
14,
13,
13478,
769,
678,
29,
21,
3508,
898,
7775,
6903,
6483,
9,
99,
2826,
1709,
9,
960,
9,
76,
31,
678,
32,
37,
51,
26986,
2271... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 store CFBitVector in CFData/NSData?
===
I have limited experience working with the Core Foundation types & collections, so apologies if this is obvious.
I'm using the CFBitVector type to store some bit sequences, and I need to store it in a binary data format (so that it can be added to a Core Data store). The most sensible thing seems to be to store this in a `CFData` type, which can be toll-free bridged with an `NSData` and added to the store, but I am unsure of how to do this.
Can anybody help me out with a simple example of storing CFTypes in CF/NSData? | 0 | [
2,
184,
20,
1718,
10084,
3326,
28033,
19,
10084,
18768,
118,
2172,
18768,
60,
800,
3726,
3726,
31,
57,
1317,
1496,
638,
29,
14,
2884,
1304,
2551,
279,
5721,
15,
86,
27101,
100,
48,
25,
4674,
9,
31,
22,
79,
568,
14,
10084,
3326,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Eclipse CDT hangs / CPU hog for 5 seconds after save
===
I save a file in Eclipse CDT, do a build, run the program and go back to editing. Then Eclipse grabs the CPU for some 3 - 5 seconds completely, producing an irritating delay in keyboard latency. after some 2, 3 minutes the same issue shows up.
Eclipse Indigo is running on Debian Squeeze inside of a VirtualBox which may use 6 out of 8 processors of a iCore7 8-hyperthread machine. Interesting enough, on the host OS, I see all 8 hyperthreads busy.
This is getting annoying since after every build it stops me 5 seconds from continuing my work. It looks liek it is connected with the indexer, since turnign off the indexer removes the problem (but then the IDE is a btit useless).
I have ample of memory for eclipse, for the Debian guest and for the Java VM.
Any ideads what I can do?
| 0 | [
2,
11652,
1745,
38,
4546,
18,
13,
118,
17578,
13716,
26,
331,
2582,
75,
2079,
800,
3726,
3726,
31,
2079,
21,
3893,
19,
11652,
1745,
38,
15,
107,
21,
1895,
15,
485,
14,
625,
17,
162,
97,
20,
9510,
9,
94,
11652,
15555,
14,
17578,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can i overwrite dir method on module?
===
>>> import module1
>>> dir(module1)
['__builtins__', '__doc__', '__file__', '__name__', '__package__']
I try some like this:
def __dir__(self):
return 'ok'
def __dir__():
return 'ok'
def __dir__(self):
print 'ok'
def __dir__():
print 'ok'
... but nothing of those works. How good writen overwriting dir function should look?
| 0 | [
2,
184,
92,
31,
84,
23716,
13,
9035,
2109,
27,
12613,
60,
800,
3726,
3726,
13,
1,
9010,
12613,
165,
13,
1,
13,
9035,
5,
19673,
62,
165,
6,
636,
22,
1,
8607,
108,
18,
1,
22,
15,
13,
22,
1,
13799,
1,
22,
15,
13,
22,
1,
168... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get the values of different SQL access records into 1
===
I'm new here and I wanted to get some help solving an Access SQL data merging problem.
Actually I would like to turn this
Customer Comment
James Good
James Bad
James Good
James Ugly
into this :
Customer Comments
James Good, Bad, Good, Ugly
I need To concatenate all the comments of the same customer into one field without VBA because I'm executing the query with PHP
Thanks | 0 | [
2,
164,
14,
4070,
16,
421,
4444,
255,
1381,
742,
77,
137,
800,
3726,
3726,
31,
22,
79,
78,
235,
17,
31,
417,
20,
164,
109,
448,
17533,
40,
1381,
4444,
255,
1054,
18842,
1448,
9,
1121,
31,
83,
101,
20,
805,
48,
7705,
6484,
586,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Could not make working ui.notify. What would you suggest to check out?
===
I try to implement js notifications for a rails project with **erichynds**' [A jQuery UI Growl/Ubuntu-like Notification Widget][1]. Haven't succeed yet.
I included in haml view that snippet:
#notice
#notice-basic-template
%a.ui-notify-cross.ui-notify-close{ :href => "#" } x
%h1 \#{title}
%p \#{text}
:javascript
$(document).ready(function() {
var instance = $("#notice").notify("create",{
title: 'test title',
text: 'test text'
});
alert("before open!");
instance.open();
alert("after open!");
});
and I get "before open!" message, but not "after open!".
When execution stops at a breakpoint at `instance.open()` and I do *step in*, execution doesn't stop. What does that mean?
What else could I do to find out broken thing?
[1]: http://www.erichynds.com/jquery/a-jquery-ui-growl-ubuntu-notification-widget/ | 0 | [
2,
110,
52,
233,
638,
13,
5661,
9,
1270,
8612,
9,
98,
83,
42,
5601,
20,
2631,
70,
60,
800,
3726,
3726,
31,
1131,
20,
8713,
487,
18,
52,
4634,
18,
26,
21,
2240,
18,
669,
29,
13,
1409,
6137,
5864,
706,
18,
1409,
22,
636,
58,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Stpwatch glithces
===
i made a stopwatch application recently and it had a few glitches. if i hit the stop button twice in a row, the entire app would crash. if i hit the start button twice in a row, the timer would run twice as fast and the stop button would stop working. how do i fix this problem?
here is the code in my .h file:
IBOutlet UILabel *time;
IBOutlet UILabel *time1;
IBOutlet UILabel *time2;
NSTimer *myTicker;
NSTimer *myTicker2;
NSTimer *myTicker3;
}
- (IBAction)start;
- (IBAction)stop;
- (IBAction)reset;
- (void)showActivity;
- (void)showActivity1;
- (void)showActivity2;
@end
and here is my code in the .m file:
- (IBAction)start{
myTicker = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(showActivity) userInfo:nil repeats:YES];
myTicker2 = [NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(showActivity1) userInfo:nil repeats:YES];
myTicker3 = [NSTimer scheduledTimerWithTimeInterval:60 target:self selector:@selector(showActivity2) userInfo:nil repeats:YES];
}
- (IBAction)stop{
[myTicker invalidate];
[myTicker2 invalidate];
[myTicker3 invalidate];
}
- (IBAction)reset{
time.text = @"00";
time1.text = @"00";
time2.text = @"00";
}
- (void)showActivity{
int currentTime = [time.text intValue];
int newTime = currentTime + 1;
if (newTime == 60) {
newTime = 0;
}
time.text = [NSString stringWithFormat:@"%d", newTime];
}
- (void)showActivity1{
int currentTime1 = [time1.text intValue];
int newTime1 = currentTime1 + 1;
if (newTime1 == 10) {
newTime1 = 0;
}
time1.text = [NSString stringWithFormat:@"%d", newTime1];
}
- (void)showActivity2{
int currentTime2 = [time2.text intValue];
int newTime2 = currentTime2 + 1;
time2.text = [NSString stringWithFormat:@"%d", newTime2];
}
all feed back is apprecitiated. thanks! | 0 | [
2,
354,
306,
9054,
13,
6441,
96,
5052,
800,
3726,
3726,
31,
117,
21,
747,
9054,
3010,
1989,
17,
32,
41,
21,
310,
13,
6441,
38,
5370,
9,
100,
31,
770,
14,
747,
5167,
2088,
19,
21,
3131,
15,
14,
1078,
4865,
83,
4597,
9,
100,
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... |
which is more memory efficient in perl?
===
So this may seem like a silly question, but I'm building an application where memory is a very limited resource so I need to be as cautious about memory usage as I can. So my question is, which of the following is more memory efficient?
while(<LINKS_FILE>) {
my $extor = HTML::SimpleLinkExtor->new($resp->base); #$resp from above somewhere
$extor->parse($_);
my @links = $extor->links;
for my $link (@links) { print "$link\n" }
}
or
my $extor = HTML::SimpleLinkExtor->new($resp->base); #$resp from above somewhere
while(<LINKS_FILE>) {
$extor->parse($_);
my @links = $extor->links;
for my $link (@links) { print "$link\n" }
$extor->clear_links;
}
So in the first it creates a new HTML::SimleLinkExtor object every time, whereas in the second it just kind of resets the same one for use again. So it seems to me like the second one would be more memory efficient, but to be honest I don't really know how good perl is about releasing memory back to the os, or if it's gonna hold on to the memory for some of the HTML::SimpleLinkExtor objects even after they're out of scope. Thanks for the help! | 0 | [
2,
56,
25,
91,
1912,
8243,
19,
416,
255,
60,
800,
3726,
3726,
86,
48,
123,
2260,
101,
21,
10752,
1301,
15,
47,
31,
22,
79,
353,
40,
3010,
113,
1912,
25,
21,
253,
1317,
6577,
86,
31,
376,
20,
44,
28,
19747,
88,
1912,
7514,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Painting outside Paintcomponent?
===
I am developing a game using Java. Currently I am painting all of my graphics in my paintcomponent class. But this means that everytime I want to repaint small details (like move a cloud or swap out a picture). I have to repaint the entire screen. This takes up a lot of memory. Is there some way that I can paint outside of my paint component to make my game more efficient? | 0 | [
2,
2469,
719,
5107,
11103,
218,
2291,
60,
800,
3726,
3726,
31,
589,
3561,
21,
250,
568,
8247,
9,
871,
31,
589,
2469,
65,
16,
51,
8351,
19,
51,
5107,
11103,
218,
2291,
718,
9,
47,
48,
1108,
30,
352,
891,
31,
259,
20,
302,
20578... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 enable drag and drop for an elevated MFC application using COleDropTarget
===
I see there is a way to the enable drag and drop for elevatd MFC application using WM_DROPFILES, but need guidance on application that uses COleDropTarget.
| 0 | [
2,
184,
20,
9240,
5501,
17,
2804,
26,
40,
8052,
307,
7061,
3010,
568,
3438,
12361,
3958,
3060,
800,
3726,
3726,
31,
196,
80,
25,
21,
161,
20,
14,
9240,
5501,
17,
2804,
26,
13,
5535,
8112,
43,
307,
7061,
3010,
568,
19312,
1,
1236... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
How to transfer control from one Project to another project in a Singe Solution ASP.net?
===
I have two projects.One project is build in MVC asp.net and the other project is simple a Form Based Asp.net website.
Now I want when i click on a link in Form Based Asp.net Website it should transfer the control from that website to MVC asp.net website and also i want to share sessions which are genrated in Form Based Asp.net Website.
Please Help.....thanx in advance | 0 | [
2,
184,
20,
2617,
569,
37,
53,
669,
20,
226,
669,
19,
21,
4481,
62,
4295,
28,
306,
9,
2328,
60,
800,
3726,
3726,
31,
57,
81,
2314,
9,
849,
669,
25,
1895,
19,
307,
8990,
28,
306,
9,
2328,
17,
14,
89,
669,
25,
1935,
21,
505,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Combining contents of a docx to a single sheet
===
I want to add the contents of the docx xml files into a single xml sheet. That is, I want to save a document in ".docx" format and then have single xml file from the contents of the xml files which I get by unzipping the docx. Can someone please suggest me a way? I tried simply adding them to a single document but it did not work. | 0 | [
2,
12803,
8478,
16,
21,
9765,
396,
20,
21,
345,
6125,
800,
3726,
3726,
31,
259,
20,
3547,
14,
8478,
16,
14,
9765,
396,
23504,
6488,
77,
21,
345,
23504,
6125,
9,
30,
25,
15,
31,
259,
20,
2079,
21,
4492,
19,
13,
7,
9,
13799,
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... |
C# SQL Update on Godaddy
===
I have a very, very simple table in a SQL database hosted on GoDaddy. It looks a bit like this:
__________________
|UPTIME || USERS|
|----------------|
|HKDAY || 123456|
|HKALL || 234567|
------------------
I am trying to update the USERS column of the table from a C# application that reads serial input from an Arduino, which is then read by some PHP. I can log in via phpMyAdmin, and I can read the Database with PHP, but when it comes to updating the table via C Sharp, I am stuck.
On GoDaddy, it makes it plain enough that when you create a new database, you must then specify whether or not to enable remote access. I have remote access enabled on this database, and even went as far to create another database to make sure I hadn't forgotten to do it. I hadn't, so that option is definitely enabled, and again, access from PHP and phpMyAdmin works, though these are both local connections.
This leads me to believe that either that there is something wrong with my code in C# or that GoDaddy is throwing the connection. Below is my code:
private void DisplayText(object sender, EventArgs e)
{
textBox1.AppendText(RxString);
// Get unsaved input from text box
string input = textBox1.Text;
string[] inputLines = input.Split('\n');
// Find and process relevant input
foreach (string line in inputLines)
{
if (line.EndsWith("\r")) // Make sure line is complete
{
//SQL Connection
SqlConnection myConnection = new SqlConnection("User ID=yourmum; Password=opensesame; Server=xxxxxxx.db.9506323.hostedresource.com; Trusted_Connection=False; Database=xxxxxxx");
try
{
myConnection.Open();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
if (line.StartsWith("Today's total users: "))
{
string dayUsers = line.Substring(20).Trim();
textDU.Text = dayUsers.ToString();
//SQL Parameter
SqlParameter myParam1 = new SqlParameter("@dayUsers", SqlDbType.VarChar, 6);
myParam1.Value = dayUsers;
// SQL query...
SqlCommand hkdayCommand = new SqlCommand(
"UPDATE HK SET USERS=@dayUsers WHERE UPTIME='HKDAY'", myConnection);
hkdayCommand.ExecuteNonQuery();
}
else if (line.StartsWith("All-time total users: "))
{
string allUsers = line.Substring(21).Trim();
textAU.Text = allUsers.ToString();
//SQL Parameter
SqlParameter myParam2 = new SqlParameter("@allUsers", SqlDbType.VarChar, 6);
myParam2.Value = allUsers;
// SQL query...
SqlCommand hkallCommand = new SqlCommand(
"UPDATE HK SET USERS=@allUsers WHERE UPTIME='HKALL'", myConnection);
hkallCommand.ExecuteNonQuery();
}
//Close SQL
try
{
myConnection.Close();
}
catch (Exception exc)
{
Console.WriteLine(exc.ToString());
}
}
}
The exception that gets thrown is this one:
> A network-related or instance-specific error occurred while
> establishing a connection to SQL Server. The server was not found or
> was not accessible. Verify that the instance name is correct and that
> SQL Server is configured to allow remote connections. (provider: Named
> Pipes Provider, error: 40 – Could not open a connection to SQL
> Server).
Which means the application hangs whilst it waits for the connection to time out and then throws an exception at
hkdayCommand.ExecuteNonQuery();
Can anyone spot anything wrong with the code, or does it seem likely that I'm not being allowed to make this outgoing connection for some reason (firewall/GoDaddy limitation)? | 0 | [
2,
272,
5910,
4444,
255,
11100,
27,
162,
25078,
800,
3726,
3726,
31,
57,
21,
253,
15,
253,
1935,
859,
19,
21,
4444,
255,
6018,
2812,
27,
162,
25078,
9,
32,
1879,
21,
1142,
101,
48,
45,
13,
1,
13,
1,
576,
891,
13,
1,
3878,
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... |
Lucene search in CMS and in parallel in external file system
===
I'm trying to index then search content coming from a CMS on one hand (OpenCms) and from an external file system from the other hand.
Is there a way to plug a lucene in parallel to these 2 type of container.
The reason is that we haven't built this external file system ourself and we would like to get the result of the search coming from the entire content (CMS + file system included).
| 0 | [
2,
18515,
556,
2122,
19,
2390,
18,
17,
19,
3821,
19,
4886,
3893,
329,
800,
3726,
3726,
31,
22,
79,
749,
20,
4348,
94,
2122,
2331,
880,
37,
21,
2390,
18,
27,
53,
224,
13,
5,
10157,
9095,
18,
6,
17,
37,
40,
4886,
3893,
329,
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... |
Query regarding jQuery datagrids
===
I have been looking at this [question][1]
[1]: http://stackoverflow.com/questions/159025/jquery-grid-recommendations
I am looking for a datagrid jQuery plugin that will allow for the ability to edit a table of data by column.
For example each row in the table might need to contain the same specific string of data in one column. Instead of activley going one by one down the rows adding it in. Do any of the datagrid that you have used to allow this to happen in one go, such as a "Copy to all rows" function?
Thanks | 0 | [
2,
25597,
3467,
487,
8190,
93,
1054,
16375,
18,
800,
3726,
3726,
31,
57,
74,
699,
35,
48,
636,
24652,
500,
2558,
165,
500,
636,
165,
500,
45,
7775,
6903,
25325,
2549,
9990,
9,
960,
118,
24652,
18,
118,
13854,
3564,
10551,
728,
819... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Guid should contain 32 digits with 4 dashes
===
I had a website which contains a createuserwizard control. And upon creating an account, verification email along with its verify URL would be send to the user's email address.
However, when i have a test-run, upon clicking the URL in the email, this error appear:
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
Source Error:
Line 17: {
Line 18: //store the user id
*Line 19: Guid userId = new Guid(Request.QueryString["ID"]);*
Line 20:
Error appeared on LINE 19.
Another funny thing is, the verification URL in my test-run look weird :
http://localhost:4635/WebSite2/Verify.aspx?ID=System.Security.Principal.GenericPrincipal
Normally, the URL should like this(which is a whole lot of characters at the end of the URL:
http://localhost:2180/LoginPage/EmailConfirmation.aspx?ID=204696d6-0255-41a7-bb0f-4d7851bf7200
I was actually thinking that, it there a connection with the end of the URL with my problem of the error (Guid should contain 32 digits with 4 dashes)..
Please give me suggestions and what I should do to solve this problems.
Thanks in advance. | 0 | [
2,
9457,
43,
378,
3717,
2512,
19076,
29,
268,
8405,
160,
800,
3726,
3726,
31,
41,
21,
2271,
56,
1588,
21,
1600,
16704,
23527,
1514,
569,
9,
17,
685,
2936,
40,
2176,
15,
25056,
8517,
303,
29,
82,
21012,
287,
6362,
83,
44,
2660,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to customize the Daskboard in Allfresco?
===
I have created a user,as an admin. And when I login as the created user, I tried to customise the Dashboard i.e deleted some of the Dashlets like My Site, My Activities etc and when I clik on ok Button, it shows a message saying "Saving Configuration". But the Dashboard stuffs does not get changed. Can Anyone help me in this? | 0 | [
2,
184,
20,
5816,
2952,
14,
6804,
197,
2806,
19,
65,
10185,
8328,
60,
800,
3726,
3726,
31,
57,
679,
21,
4155,
15,
472,
40,
21,
43,
2160,
9,
17,
76,
31,
6738,
108,
28,
14,
679,
4155,
15,
31,
794,
20,
5816,
2628,
14,
26478,
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... |
Upload file from my machine to HTTPS server
===
I Want to upload file from my machine to https server.
I have written below code. but its giving error to me.
public void uploadFile(string FTPAddress, string filename, string username, string password,string filepath)
{
try
{
WebClient client = new WebClient();
NetworkCredential nc = new NetworkCredential(username, password);
Uri addy = new Uri(@"https://us.itranscript.net:444/upload/test.txt");
client.Credentials = nc;
byte[] arrReturn = client.UploadFile(addy, filepath);
Console.WriteLine(arrReturn.ToString());
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Error : [System.Net.WebException] = {"The underlying connection was closed: The connection was closed unexpectedly."}
StackTrace of the error is below :
at System.Net.WebClient.UploadFile(Uri address, String method, String fileName)
at System.Net.WebClient.UploadFile(Uri address, String fileName)
at ConvertToHL7.Download.uploadFile(String FTPAddress, String filename, String username, String password, String filepath) in D:\ECW HL7\ConvertToHL7\ConvertToHL7\Download.cs:line 77
help to solve this error | 0 | [
2,
71,
8294,
3893,
37,
51,
1940,
20,
7775,
18,
8128,
800,
3726,
3726,
31,
259,
20,
71,
8294,
3893,
37,
51,
1940,
20,
7775,
18,
8128,
9,
31,
57,
642,
1021,
1797,
9,
47,
82,
1438,
7019,
20,
55,
9,
317,
11364,
71,
8294,
16877,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
restrictions on php file upload not working
===
I want to allow user to upload a file of txt ,doc or pdf format. I have written following code for it.
if ((($_FILES["uploaded"]["type"] == "text/plain")
|| ($_FILES["uploaded"]["type"] == "application/pdf")
|| ($_FILES["uploaded"]["type"] == "application/doc"))
&& ($_FILES["uploaded"]["size"] < 50000))
{
if ($_FILES["uploaded"]["error"] > 0)
{
echo "Error: " . $_FILES["uploaded"]["error"] . "<br />";
}
else
{
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
}
}
else
{
echo "Invalid file";
}
But this code is not working. Whatever be the case it always shows invalid file. What might be the problem? | 0 | [
2,
9245,
27,
13,
26120,
3893,
71,
8294,
52,
638,
800,
3726,
3726,
31,
259,
20,
1655,
4155,
20,
71,
8294,
21,
3893,
16,
20225,
38,
13,
15,
13799,
54,
13,
11124,
2595,
9,
31,
57,
642,
249,
1797,
26,
32,
9,
100,
13,
5,
5,
5,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
why i am not able to draw image from bitmap in my custom class?
===
I have refer original source code of android ImageView.class for making custom class from it .
Here is code i refer for making my class [ImageView Source][1].
Now here is my class source code below.
public class ImageViewHigh extends View{
// settable by the client
private int mResource = 0;
private Matrix mMatrix;
private ScaleType mScaleType;
private boolean mHaveFrame = false;
private boolean mAdjustViewBounds = false;
private int mMaxWidth = Integer.MAX_VALUE;
private int mMaxHeight = Integer.MAX_VALUE;
// these are applied to the drawable
private ColorFilter mColorFilter;
private int mAlpha = 255;
private int mViewAlphaScale = 256;
private boolean mColorMod = false;
private Drawable mDrawable = null;
private int[] mState = null;
private boolean mMergeState = false;
private int mLevel = 0;
private int mDrawableWidth;
private int mDrawableHeight;
private Matrix mDrawMatrix = null;
// Avoid allocations...
private RectF mTempSrc = new RectF();
private RectF mTempDst = new RectF();
private boolean mCropToPadding;
private boolean mBaselineAligned = false;
private Context mContext;
public ImageViewHigh(Context context) {
super(context);
mContext=context;
initImageView();
}
public ImageViewHigh(Context context, AttributeSet attrs) {
this(context, attrs, 0);
// TODO Auto-generated constructor stub
}
public ImageViewHigh(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
initImageView();
TypedArray a = context.obtainStyledAttributes(attrs,
R.styleable.ImageViewVeo, defStyle, 0);
Drawable d = a.getDrawable(R.styleable.ImageViewVeo_src);
if (d != null) {
setImageDrawable(d);
}
mBaselineAligned = a.getBoolean(
R.styleable.ImageViewVeo_baselineAlignBottom, false);
setAdjustViewBounds(
a.getBoolean(R.styleable.ImageViewVeo_adjustViewBounds,
false));
setMaxWidth(a.getDimensionPixelSize(
R.styleable.ImageViewVeo_maxWidth, Integer.MAX_VALUE));
setMaxHeight(a.getDimensionPixelSize(
R.styleable.ImageViewVeo_maxHeight, Integer.MAX_VALUE));
int index = a.getInt(R.styleable.ImageViewVeo_scaleType, -1);
if (index >= 0) {
setScaleType(sScaleTypeArray[index]);
}
int tint = a.getInt(R.styleable.ImageViewVeo_tint, 0);
if (tint != 0) {
setColorFilter(tint);
}
mCropToPadding = a.getBoolean(
R.styleable.ImageViewVeo_cropToPadding, false);
a.recycle();
//need inflate syntax/reader for matrix
}
private void initImageView() {
mMatrix = new Matrix();
mScaleType = ScaleType.FIT_CENTER;
}
private static final ScaleType[] sScaleTypeArray = {
ScaleType.MATRIX,
ScaleType.FIT_XY,
ScaleType.FIT_START,
ScaleType.FIT_CENTER,
ScaleType.FIT_END,
ScaleType.CENTER,
ScaleType.CENTER_CROP,
ScaleType.CENTER_INSIDE
};
/**
* An optional argument to supply a maximum width for this view. Only valid if
* {@link #setAdjustViewBounds} has been set to true. To set an image to be a maximum of 100 x
* 100 while preserving the original aspect ratio, do the following: 1) set adjustViewBounds to
* true 2) set maxWidth and maxHeight to 100 3) set the height and width layout params to
* WRAP_CONTENT.
*
* <p>
* Note that this view could be still smaller than 100 x 100 using this approach if the original
* image is small. To set an image to a fixed size, specify that size in the layout params and
* then use {@link #setScaleType} to determine how to fit the image within the bounds.
* </p>
*
* @param maxWidth maximum width for this view
*
* @attr ref android.R.styleable#ImageView_maxWidth
*/
// @android.view.RemotableViewMethod
public void setMaxWidth(int maxWidth) {
mMaxWidth = maxWidth;
}
/**
* An optional argument to supply a maximum height for this view. Only valid if
* {@link #setAdjustViewBounds} has been set to true. To set an image to be a maximum of 100 x
* 100 while preserving the original aspect ratio, do the following: 1) set adjustViewBounds to
* true 2) set maxWidth and maxHeight to 100 3) set the height and width layout params to
* WRAP_CONTENT.
*
* <p>
* Note that this view could be still smaller than 100 x 100 using this approach if the original
* image is small. To set an image to a fixed size, specify that size in the layout params and
* then use {@link #setScaleType} to determine how to fit the image within the bounds.
* </p>
*
* @param maxHeight maximum height for this view
*
* @attr ref android.R.styleable#ImageView_maxHeight
*/
// @android.view.RemotableViewMethod
public void setMaxHeight(int maxHeight) {
mMaxHeight = maxHeight;
}
/**
* Sets a drawable as the content of this ImageView.
*
* @param drawable The drawable to set
*/
public void setImageDrawable(Drawable drawable) {
if (mDrawable != drawable) {
mResource = 0;
// mUri = null;
updateDrawable(drawable);
requestLayout();
invalidate();
}
}
/**
* Set this to true if you want the ImageView to adjust its bounds
* to preserve the aspect ratio of its drawable.
* @param adjustViewBounds Whether to adjust the bounds of this view
* to presrve the original aspect ratio of the drawable
*
* @attr ref android.R.styleable#ImageView_adjustViewBounds
*/
//@android.view.RemotableViewMethod
public void setAdjustViewBounds(boolean adjustViewBounds) {
mAdjustViewBounds = adjustViewBounds;
if (adjustViewBounds) {
setScaleType(ScaleType.FIT_CENTER);
}
}
public void setContext(Context paramContext){
this.mContext=paramContext;
}
/**
* Sets a Bitmap as the content of this ImageView.
*
* @param bm The bitmap to set
*/
// @android.view.RemotableViewMethod
public void setImageBitmap(Bitmap bm) {
// if this is used frequently, may handle bitmaps explicitly
// to reduce the intermediate drawable object
setImageDrawable(new BitmapDrawable(mContext.getResources(), bm));
}
/**
* Controls how the image should be resized or moved to match the size
* of this ImageView.
*
* @param scaleType The desired scaling mode.
*
* @attr ref android.R.styleable#ImageView_scaleType
*/
public void setScaleType(ScaleType scaleType) {
if (scaleType == null) {
throw new NullPointerException();
}
if (mScaleType != scaleType) {
mScaleType = scaleType;
setWillNotCacheDrawing(mScaleType == ScaleType.CENTER);
requestLayout();
invalidate();
}
}
/**
* Options for scaling the bounds of an image to the bounds of this view.
*/
public enum ScaleType {
/**
* Scale using the image matrix when drawing. The image matrix can be set using
* {@link ImageView#setImageMatrix(Matrix)}. From XML, use this syntax:
* <code>android:scaleType="matrix"</code>.
*/
MATRIX (0),
/**
* Scale the image using {@link Matrix.ScaleToFit#FILL}.
* From XML, use this syntax: <code>android:scaleType="fitXY"</code>.
*/
FIT_XY (1),
/**
* Scale the image using {@link Matrix.ScaleToFit#START}.
* From XML, use this syntax: <code>android:scaleType="fitStart"</code>.
*/
FIT_START (2),
/**
* Scale the image using {@link Matrix.ScaleToFit#CENTER}.
* From XML, use this syntax:
* <code>android:scaleType="fitCenter"</code>.
*/
FIT_CENTER (3),
/**
* Scale the image using {@link Matrix.ScaleToFit#END}.
* From XML, use this syntax: <code>android:scaleType="fitEnd"</code>.
*/
FIT_END (4),
/**
* Center the image in the view, but perform no scaling.
* From XML, use this syntax: <code>android:scaleType="center"</code>.
*/
CENTER (5),
/**
* Scale the image uniformly (maintain the image's aspect ratio) so
* that both dimensions (width and height) of the image will be equal
* to or larger than the corresponding dimension of the view
* (minus padding). The image is then centered in the view.
* From XML, use this syntax: <code>android:scaleType="centerCrop"</code>.
*/
CENTER_CROP (6),
/**
* Scale the image uniformly (maintain the image's aspect ratio) so
* that both dimensions (width and height) of the image will be equal
* to or less than the corresponding dimension of the view
* (minus padding). The image is then centered in the view.
* From XML, use this syntax: <code>android:scaleType="centerInside"</code>.
*/
CENTER_INSIDE (7);
ScaleType(int ni) {
nativeInt = ni;
}
final int nativeInt;
}
private void updateDrawable(Drawable d) {
if (mDrawable != null) {
mDrawable.setCallback(null);
unscheduleDrawable(mDrawable);
}
mDrawable = d;
if (d != null) {
d.setCallback(this);
if (d.isStateful()) {
d.setState(getDrawableState());
}
d.setLevel(mLevel);
mDrawableWidth = d.getIntrinsicWidth();
mDrawableHeight = d.getIntrinsicHeight();
applyColorMod();
configureBounds();
}
}
private static final Matrix.ScaleToFit[] sS2FArray = {
Matrix.ScaleToFit.FILL,
Matrix.ScaleToFit.START,
Matrix.ScaleToFit.CENTER,
Matrix.ScaleToFit.END
};
private static Matrix.ScaleToFit scaleTypeToScaleToFit(ScaleType st) {
// ScaleToFit enum to their corresponding Matrix.ScaleToFit values
return sS2FArray[st.nativeInt - 1];
}
private void configureBounds() {
if (mDrawable == null ) {
return;
}
int dwidth = mDrawableWidth;
int dheight = mDrawableHeight;
int vwidth = getWidth() - getPaddingLeft() - getPaddingRight();
int vheight = getHeight() - getPaddingTop() - getPaddingBottom();
boolean fits = (dwidth < 0 || vwidth == dwidth) &&
(dheight < 0 || vheight == dheight);
if (dwidth <= 0 || dheight <= 0 || ScaleType.FIT_XY == mScaleType) {
/* If the drawable has no intrinsic size, or we're told to
scaletofit, then we just fill our entire view.
*/
mDrawable.setBounds(0, 0, vwidth, vheight);
mDrawMatrix = null;
} else {
// We need to do the scaling ourself, so have the drawable
// use its native size.
mDrawable.setBounds(0, 0, dwidth, dheight);
if (ScaleType.MATRIX == mScaleType) {
// Use the specified matrix as-is.
if (mMatrix.isIdentity()) {
mDrawMatrix = null;
} else {
mDrawMatrix = mMatrix;
}
} else if (fits) {
// The bitmap fits exactly, no transform needed.
mDrawMatrix = null;
} else if (ScaleType.CENTER == mScaleType) {
// Center bitmap in view, no scaling.
mDrawMatrix = mMatrix;
mDrawMatrix.setTranslate((int) ((vwidth - dwidth) * 0.5f + 0.5f),
(int) ((vheight - dheight) * 0.5f + 0.5f));
} else if (ScaleType.CENTER_CROP == mScaleType) {
mDrawMatrix = mMatrix;
float scale;
float dx = 0, dy = 0;
if (dwidth * vheight > vwidth * dheight) {
scale = (float) vheight / (float) dheight;
dx = (vwidth - dwidth * scale) * 0.5f;
} else {
scale = (float) vwidth / (float) dwidth;
dy = (vheight - dheight * scale) * 0.5f;
}
mDrawMatrix.setScale(scale, scale);
mDrawMatrix.postTranslate((int) (dx + 0.5f), (int) (dy + 0.5f));
} else if (ScaleType.CENTER_INSIDE == mScaleType) {
mDrawMatrix = mMatrix;
float scale;
float dx;
float dy;
if (dwidth <= vwidth && dheight <= vheight) {
scale = 1.0f;
} else {
scale = Math.min((float) vwidth / (float) dwidth,
(float) vheight / (float) dheight);
}
dx = (int) ((vwidth - dwidth * scale) * 0.5f + 0.5f);
dy = (int) ((vheight - dheight * scale) * 0.5f + 0.5f);
mDrawMatrix.setScale(scale, scale);
mDrawMatrix.postTranslate(dx, dy);
} else {
// Generate the required transform.
mTempSrc.set(0, 0, dwidth, dheight);
mTempDst.set(0, 0, vwidth, vheight);
mDrawMatrix = mMatrix;
mDrawMatrix.setRectToRect(mTempSrc, mTempDst,
scaleTypeToScaleToFit(mScaleType));
}
}
}
@Override
protected void drawableStateChanged() {
// TODO Auto-generated method stub
super.drawableStateChanged();
Drawable d = mDrawable;
if (d != null && d.isStateful()) {
d.setState(getDrawableState());
}
}
@Override
protected void onDraw(Canvas canvas) {
// TODO Auto-generated method stub
super.onDraw(canvas);
if (mDrawable == null) {
return; // couldn't resolve the URI
}
if (mDrawableWidth == 0 || mDrawableHeight == 0) {
return; // nothing to draw (empty bounds)
}
if (mDrawMatrix == null && getPaddingTop() == 0 && getPaddingLeft() == 0) {
mDrawable.draw(canvas);
} else {
int saveCount = canvas.getSaveCount();
canvas.save();
if (mCropToPadding) {
final int scrollX = getScrollX();
final int scrollY = getScrollY();
canvas.clipRect(scrollX + getPaddingLeft(), scrollY + getPaddingTop(),
scrollX + getRight() - getLeft() - getPaddingRight(),
scrollY + getBottom() - getTop() - getPaddingBottom());
}
canvas.translate(getPaddingLeft(), getPaddingTop());
if (mDrawMatrix != null) {
canvas.concat(mDrawMatrix);
}
mDrawable.draw(canvas);
canvas.restoreToCount(saveCount);
}
}
/**
* Set a tinting option for the image.
*
* @param color Color tint to apply.
* @param mode How to apply the color. The standard mode is
* {@link PorterDuff.Mode#SRC_ATOP}
*
* @attr ref android.R.styleable#ImageView_tint
*/
public final void setColorFilter(int color, PorterDuff.Mode mode) {
setColorFilter(new PorterDuffColorFilter(color, mode));
}
/**
* Set a tinting option for the image. Assumes
* {@link PorterDuff.Mode#SRC_ATOP} blending mode.
*
* @param color Color tint to apply.
* @attr ref android.R.styleable#ImageView_tint
*/
// @RemotableViewMethod
public final void setColorFilter(int color) {
setColorFilter(color, PorterDuff.Mode.SRC_ATOP);
}
/**
* Apply an arbitrary colorfilter to the image.
*
* @param cf the colorfilter to apply (may be null)
*/
public void setColorFilter(ColorFilter cf) {
if (mColorFilter != cf) {
mColorFilter = cf;
mColorMod = true;
applyColorMod();
invalidate();
}
}
private void applyColorMod() {
// Only mutate and apply when modifications have occurred. This should
// not reset the mColorMod flag, since these filters need to be
// re-applied if the Drawable is changed.
if (mDrawable != null && mColorMod) {
mDrawable = mDrawable.mutate();
mDrawable.setColorFilter(mColorFilter);
mDrawable.setAlpha(mAlpha * mViewAlphaScale >> 8);
}
}
}
i have to use this code of android imageView because i only required to set image from bitmap ,now when i setBitmap in this class it show me black blank screen it draw nothing .
Can any one have idea what missing in my code.
[1]: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/widget/ImageView.java?av=f | 0 | [
2,
483,
31,
589,
52,
777,
20,
2003,
1961,
37,
1142,
15022,
19,
51,
5816,
718,
60,
800,
3726,
3726,
31,
57,
5017,
501,
1267,
1797,
16,
13005,
1961,
4725,
9,
1898,
26,
544,
5816,
718,
37,
32,
13,
9,
235,
25,
1797,
31,
5017,
26,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
cezPDF in Codeigniter 2
===
I am using cezPDF library in CodeIgniter 2
But it seems it can't print the table or ezTable isn't working properly
Anyone faced this before? or any solution on that?
take a look at my code here:
$db_data [] = array ('name' => 'x' );
$db_data [] = array ('name' => 'y' );
$db_data [] = array ('name' => 'z' );
$col_names = array ('name' => 'col' );
$this->cezpdf->ezTable ( $db_data, $col_names, '', array ('width' => 180, 'xPos' => 140 ) ); | 0 | [
2,
272,
2819,
11124,
19,
1797,
9693,
242,
106,
172,
800,
3726,
3726,
31,
589,
568,
272,
2819,
11124,
1248,
19,
1797,
9693,
242,
106,
172,
47,
32,
2206,
32,
92,
22,
38,
4793,
14,
859,
54,
13,
2819,
5924,
2532,
22,
38,
638,
7428,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery hover seems erratic
===
I would like to have a twitter bootstrap style popover appear next to a div whenever the mouse enters the div and disappear whenever the mouse exits the div.
I have the following in my <script> section:
$('#bizhover').hover(
function() {
$(this).popover({ html: true, placement: "right" });
},
function() {
$(this).popover('hide');
}
);
I believe things may be complicated somewhat by my use of a "chosen" (jquery plugin) style dropdown menu placed into the div as below:
![enter image description here][1]
The code to create that is something like:
<div id = 'bizhover', style = 'margin-right:85px;', class = 'pop_html', title = 'Instructions', data-content = "blah blah blah"> CHOSEN DROP DOWN </div>
I notice that if my mouse exits to the top of the drop down the pop-over remains. If I move my mouse below or out to the sides the pop-over disappears, as intended.
Any advice would be greatly appreciated.
[1]: http://i.stack.imgur.com/kbTjF.png | 0 | [
2,
487,
8190,
93,
21350,
2206,
23187,
800,
3726,
3726,
31,
83,
101,
20,
57,
21,
10623,
5894,
16514,
1034,
1675,
2549,
1893,
328,
20,
21,
13,
12916,
6634,
14,
7567,
8104,
14,
13,
12916,
17,
10866,
6634,
14,
7567,
4350,
18,
14,
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... |
How to pass value from controller to view in sencha touch 1.1?
===
**Can anybody tell me the exact syntax to pass value in controller n as well as how to read in view also ?**
**Thanks in advanced !!!!** | 0 | [
2,
184,
20,
1477,
1923,
37,
9919,
20,
1418,
19,
8252,
1651,
1723,
137,
9,
165,
60,
800,
3726,
3726,
13,
1409,
1245,
11181,
494,
55,
14,
5340,
22649,
20,
1477,
1923,
19,
9919,
13,
103,
28,
134,
28,
184,
20,
1302,
19,
1418,
67,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... |
It's possible to make the Panorama control on WP7 non-circularly?
===
first, thanks to all who spend some time helping me.
I'm using a Panorama control on a WP7 design, and I want to know if there's some way to deactivate the circular (or round) navigation on it?
Basically what I would is to end the horizontal scrolling to right on the last item and viceversa. | 0 | [
2,
32,
22,
18,
938,
20,
233,
14,
24805,
569,
27,
13,
13790,
465,
538,
8,
25166,
102,
60,
800,
3726,
3726,
64,
15,
3669,
20,
65,
72,
3256,
109,
85,
3713,
55,
9,
31,
22,
79,
568,
21,
24805,
569,
27,
21,
13,
13790,
465,
704,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 an attached-property to change a resource's property?
===
I have a `DrawingBrush` as a resource like this:
<DrawingBrush x:Key="Calendar" Stretch="Uniform">
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Geometry="F1 M 28.0917,2.13333C 42.4005,2.13333 54,13.7329 54,28.0417C 54,42.3504 42.4004,53.95 28.0917,53.95C 13.7829,53.95 2.18334,42.3504 2.18334,28.0417C 2.18334,13.7329 13.7829,2.13333 28.0917,2.13333 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="4" LineJoin="Round" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="F1 M 16.9667,16.7083L 39.7167,16.7083L 39.7167,41.625L 16.9667,41.625L 16.9667,16.7083 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="2.66667" StartLineCap="Square" EndLineCap="Square" MiterLimit="2.75" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF000000" Geometry="F1 M 15.6333,15.9583L 40.7167,15.9583L 40.7167,25.2917L 15.6333,25.2917L 15.6333,15.9583 Z "/>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 18.2167,11.9583L 22.9667,11.9583L 22.9667,20.875L 18.2167,20.875L 18.2167,11.9583 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="1.33333" StartLineCap="Square" EndLineCap="Square" MiterLimit="2.75" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 33.7167,11.925L 38.4667,11.925L 38.4667,20.8417L 33.7167,20.8417L 33.7167,11.925 Z ">
<GeometryDrawing.Pen>
<Pen Thickness="1.33333" StartLineCap="Square" EndLineCap="Square" MiterLimit="2.75" Brush="#FF000000"/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Brush="#FF000000" Geometry="F1 M 28.0154,36.2658L 28.0154,37.4894L 21.6254,37.4894C 21.6169,37.1934 21.6615,36.908 21.7592,36.6333C 21.915,36.1815 22.165,35.7425 22.5091,35.3162C 22.8533,34.8899 23.3617,34.4091 24.0344,33.8738C 25.0782,32.983 25.776,32.295 26.1279,31.81C 26.4799,31.3249 26.6558,30.8551 26.6558,30.4005C 26.6558,29.9473 26.4894,29.5653 26.1566,29.2544C 25.8238,28.9435 25.3904,28.7881 24.8565,28.7881C 24.2915,28.7881 23.8393,28.9442 23.5001,29.2565C 23.161,29.5688 22.9892,30.0018 22.985,30.5556L 21.7614,30.4196C 21.8449,29.5345 22.1576,28.86 22.6993,28.3962C 23.241,27.9323 23.9686,27.7004 24.882,27.7004C 25.8054,27.7004 26.5358,27.9596 27.0733,28.4779C 27.6107,28.9963 27.8795,29.6385 27.8795,30.4047C 27.8795,30.7942 27.8065,31.1769 27.6607,31.5529C 27.5148,31.9289 27.2726,32.3251 26.9341,32.7415C 26.5957,33.1579 26.0115,33.7215 25.1816,34.4325C 24.4692,35.0216 24.0008,35.4214 23.7763,35.6317C 23.5518,35.842 23.3667,36.0533 23.2208,36.2658L 28.0154,36.2658 Z "/>
<GeometryDrawing Brush="#FF000000" Geometry="F1 M 33.3178,37.4894L 33.3178,35.1781L 28.9671,35.1781L 28.9671,33.9545L 33.5897,27.8364L 34.5414,27.8364L 34.5414,33.9545L 35.765,33.9545L 35.765,35.1781L 34.5414,35.1781L 34.5414,37.4894L 33.3178,37.4894 Z M 33.3178,33.9545L 33.3178,30.1774L 30.4648,33.9545L 33.3178,33.9545 Z "/>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
And I can use it like this:
<Rectangle Fill="{DynamicResource Calender}" />
Now, my question is: how can I create an attached-property to change all brushes on my resource? e.g. I be able to create this:
<Rectangle Fill="{DynamicResource Calendar}" attached:IconHelper.Foreground="Blue" />
on my `Rectangle` and in my resource, I can get:
<DrawingBrush x:Key="Calendar" Stretch="Uniform">
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Geometry="blah blah">
<GeometryDrawing.Pen>
<Pen Brush={attached:ReadItFromAboveRectangle}/>
</GeometryDrawing.Pen>
</GeometryDrawing>
<GeometryDrawing Geometry="blah blah">
<GeometryDrawing.Pen>
<Pen Brush={attached:ReadItFromAboveRectangle}/>
</GeometryDrawing.Pen>
<!-- etc... -->
Is there any way to read an attached-property on `Rectangle` in `Calendar` resource? Or is there any other way to do this? Thanks in advance.
| 0 | [
2,
184,
20,
1600,
40,
3638,
8,
10890,
106,
1084,
20,
753,
21,
6577,
22,
18,
1354,
60,
800,
3726,
3726,
31,
57,
21,
13,
1,
3030,
3546,
20632,
1,
28,
21,
6577,
101,
48,
45,
13,
1,
3030,
3546,
20632,
993,
45,
4237,
3726,
7,
343... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
get a recursive file list sorted alphabetically by subdirs and filenames
===
i tried to get a file list sorted, without sucess.
it gets the files recursively but without any order.
here's the code:
private void Step2_Load(object sender, EventArgs e)
{
foreach (string file in GetFiles(PathClient))
{
string flist = "";
if (file.Contains(PathClient + "\\"))
flist = file.Replace(PathClient + "\\", "");
else
flist = file.Replace(PathClient, "");
LB_FULL.Items.Add(flist);
}
.
.
.
static IEnumerable<string> GetFiles(string path)
{
Queue<string> queue = new Queue<string>();
queue.Enqueue(path);
while (queue.Count > 0)
{
path = queue.Dequeue();
try
{
foreach (string subDir in Directory.GetDirectories(path))
queue.Enqueue(subDir);
}
catch (Exception ex)
{
//ex
}
string[] files = null;
try
{
files = Directory.GetFiles(path);
}
catch (Exception ex)
{
//ex
}
if (files != null)
{
for (int i = 0; i < files.Length; i++)
{
yield return files[i];
}
}
}
}
i've tried with OrderBy, but it only sorts by filename, regardless of the subfolder.
i want to sort it by subfolder first, then by filename.
for ex.
/
/file_a.bla
/file_b.bla
/file_c.bla
/sub1/file_a.bla
/sub1/file_b.bla
/sub2/_file_x.bla
/testsub/a.bla
...
and so on.
any ideas how to manage it? | 0 | [
2,
164,
21,
302,
24244,
3893,
968,
22554,
27169,
102,
34,
972,
9035,
18,
17,
3893,
7259,
18,
800,
3726,
3726,
31,
794,
20,
164,
21,
3893,
968,
22554,
15,
366,
21792,
160,
18,
9,
32,
3049,
14,
6488,
302,
24244,
102,
47,
366,
186,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 this possible to convert a million digit number to 1000 digit number by a certain mathematical operation in C++ or C#?
===
I am working on project and ran into an issue.
Now I want to know is there anyway to reduce digits of a big number? For example convert a million digit number to 1000 digit number. | 1 | [
2,
25,
48,
938,
20,
8406,
21,
507,
15611,
234,
20,
6150,
15611,
234,
34,
21,
1200,
7046,
1453,
19,
272,
20512,
54,
272,
5910,
60,
800,
3726,
3726,
31,
589,
638,
27,
669,
17,
717,
77,
40,
1513,
9,
130,
31,
259,
20,
143,
25,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105)
===
I have a database file `.mdf` from MS SQL EXPRESS in folder:
C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA
I would like to attach it to **MS 2008 R2** (MSSQL10_50.MSSQLSERVER) but using Server Management Studio I receive the following error:
`CREATE FILE encountered operating system error 5(failed to retrieve text for this error. Reason: 15105) while attempting to open or create the physical fil`e
any idea how to solve it? | 0 | [
2,
1600,
3893,
8208,
2455,
329,
7019,
331,
5,
24910,
69,
20,
11917,
1854,
26,
48,
7019,
9,
1215,
45,
357,
16242,
6,
800,
3726,
3726,
31,
57,
21,
6018,
3893,
13,
1,
9,
79,
8736,
1,
37,
4235,
4444,
255,
2999,
19,
19294,
45,
272,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Database structure for storing Bank-like accounts and transactions
===
We're in the process of adding a bank-like sub-system to our own shop.
We already have customers, so each will be given a sort of account and transactions of some kind will be possible (adding to the account or subtracting from it).
So we at least need the **account** entity, the **transaction** one and operations will then have to recalculate overall balances.
How would you structure your database to handle this?
Is there any standard bank system have to use that I could mock?
By the way, we're on mysql but will also look at some nosql solution for performance boost. | 0 | [
2,
6018,
1411,
26,
25615,
965,
8,
1403,
5310,
17,
13147,
800,
3726,
3726,
95,
22,
99,
19,
14,
953,
16,
4721,
21,
965,
8,
1403,
972,
8,
10724,
20,
318,
258,
2546,
9,
95,
614,
57,
5279,
15,
86,
206,
129,
44,
504,
21,
2058,
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... |
twitter bootstrap typeahead 2.0.4 ajax error
===
I have the following code which definitely returns a proper data result if I use the 2.0.0 version, but for some reason bootstrap's typeahead plugin is giving me an error. I pasted it below the code sample:
<input id="test" type="text" />
$('#test').typeahead({
source: function(typeahead, query) {
return $.post('/Profile/searchFor', { query: query }, function(data) {
return typeahead.process(data);
});
}
});
When I run this example I'm getting a jQuery bug that says the following:<br/>
**Error line 104: return item.toLowerCase().indexOf(this.query.toLowerCase())**
Any thoughts? ... The same code works in the 2.0.0 version of the plugin. | 0 | [
2,
10623,
5894,
16514,
1001,
58,
1743,
172,
9,
387,
9,
300,
20624,
7019,
800,
3726,
3726,
31,
57,
14,
249,
1797,
56,
4939,
4815,
21,
4119,
1054,
829,
100,
31,
275,
14,
172,
9,
387,
9,
387,
615,
15,
47,
26,
109,
1215,
5894,
165... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Google Closure Compiler, how to handle JSC_INEXISTENT_PROPERTY gracefully?
===
I'm using a design pattern that uses the return statement to expose public class methods.
Problem is: I'm getting a **lot** of `JSC_INEXISTENT_PROPERTY` warnings in Closure Compiler's Advanced mode, which makes it difficult to check the warnings that actually matter.
Example of the pattern I use:
// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// ==/ClosureCompiler==
/**
* @constructor
*/
var MyClass = function() {
var someFunc = function(myString) {
console.log(myString);
}
return {
myPublicFunc: someFunc
};
}
var myClassInstance = new MyClass();
myClassInstance.myPublicFunc('Hello World');
Warnings:
JSC_INEXISTENT_PROPERTY: Property myPublicFunc never defined on MyClass \
at line 16 character 0
myClassInstance.myPublicFunc('Hello World');
Output (formatted):
(new function() {
return {
a: function(a) {
console.log(a)
}
}
}).a("Hello World");
Which is weird, because Closure understood what the code was doing and compiled the code correctly, renaming `myPublicFunc` consistently to `a`. So why did I get this warning? Am I doing something wrong?
Note: I do not want to turn off these warnings because it would also hide warnings I actually care about. I also do not want to use quoted strings or exports because I do want Closure to compress these. | 0 | [
2,
8144,
7790,
21486,
15,
184,
20,
3053,
487,
3862,
1,
108,
20788,
1,
10890,
106,
1084,
28138,
60,
800,
3726,
3726,
31,
22,
79,
568,
21,
704,
3732,
30,
2027,
14,
788,
3331,
20,
13833,
317,
718,
3195,
9,
1448,
25,
45,
31,
22,
7... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Assembly/C/GDB: code to hexadecimal
===
how can I view the hexadecimal representation of some assembler commands?
this is from gdb:
0x8048395 <simple+1> mov %esp,%ebp
0x8048397 <simple+3> mov $0x1,%eax
0x804839c <simple+8> pop %ebp
0x804839d <simple+9> ret
"simple" is the c function of this program. I tried
dump ihex value dump.hex simple
which results in
:020000040804EE
:0183940000E8
:00000001FF
and
dump ihex memory dump.hex 0x8048394 0x804839d
which results in something different
:020000040804EE
:098394005589E5B8010000005D07
:00000001FF
why are they different? is one of them correct? | 0 | [
2,
1475,
118,
150,
118,
263,
9007,
45,
1797,
20,
24,
6791,
9522,
49,
3482,
800,
3726,
3726,
184,
92,
31,
1418,
14,
24,
6791,
9522,
49,
3482,
5442,
16,
109,
13,
13736,
139,
14294,
60,
48,
25,
37,
489,
9007,
45,
713,
396,
2887,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Models in One View, Validate only one of them
===
I have a View that contains a ParentModel, which contains 2 Models.
I only want to validate the fields of one or the other. Not both.
Let´s say I have:
public ParentModel{
public BlueUser BlueUser {get; set;}
public GreenUser GreenUser {get; set;}
}
So the user selects either he is a GreenUser or a BlueUser. Each type of user has different fields, and depending which type of User the user selects, I want to only validate the fields on that specific type of user.
How can this be achieved? | 0 | [
2,
81,
2761,
19,
53,
1418,
15,
7394,
1373,
104,
53,
16,
105,
800,
3726,
3726,
31,
57,
21,
1418,
30,
1588,
21,
4766,
13998,
15,
56,
1588,
172,
2761,
9,
31,
104,
259,
20,
7394,
1373,
14,
2861,
16,
53,
54,
14,
89,
9,
52,
156,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 - The Most Efficient Way to Load Text From Website?
===
I have a question for you all. I am going for speed, and I need to use this method a lot, so the more efficient this method is, the better.
My code:
final URL url = new URL("http://www.somewebsite.com/with/a/unique/variable/" + name);
final BufferedReader in = new BufferedReader(new InputStreamReader(url.openConnection().getInputStream()));
String inputLine;
String totalText = "";
while ((inputLine = in.readLine()) != null) {
totalText += inputLine;
}
in.close();
I then go on to use `totalText` for a bit. This method **works**, but I am asking if there is a more efficient way for this to work.
Important Notes Concerning the code I am reading:
- The **entire** source code from the website is only **one** line long.
- There are **no** HTML tags with the website code. It is all **raw** text. | 0 | [
2,
8247,
13,
8,
14,
127,
8243,
161,
20,
6305,
1854,
37,
2271,
60,
800,
3726,
3726,
31,
57,
21,
1301,
26,
42,
65,
9,
31,
589,
228,
26,
1362,
15,
17,
31,
376,
20,
275,
48,
2109,
21,
865,
15,
86,
14,
91,
8243,
48,
2109,
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... |
Float percentage producing wrong answer
===
System.out.println("Percentage (90): " + (_leftBranch.getHeight() / 100) * 90 + " Height: " + _leftBranch.getHeight());
Gives the output:
Percentage (90): 270 Height: 359
When infact it should be 323.1.
Can anyone tell me what's going on here? | 0 | [
2,
11510,
5780,
4081,
1389,
1623,
800,
3726,
3726,
329,
9,
1320,
9,
10299,
16600,
5,
7,
1432,
5089,
1303,
13,
5,
3165,
6,
45,
13,
7,
2754,
13,
5,
1,
9742,
23014,
9,
834,
96,
7748,
5,
6,
13,
118,
808,
6,
1637,
3151,
2754,
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... |
wpf how to display an image brush in the background of a border
===
i'm trying to display an image as the background of a border element
<Border>
<Border.Background>
<ImageBrush Stretch="Fill">
<ImageBrush.ImageSource>
<BitmapImage UriSource="http://10.218.23.10/myPic.jpg" />
</ImageBrush.ImageSource>
</ImageBrush>
</Border.Background>
</Border>
i was told should use an ImageBrush instaed of an Image
(1) what benefits does using an ImageBrush Have over an Image ?
(2) if i display my picture using an Image , it does infect show the image
<Border>
<Image Source="http://10.218.23.10/myPic.jpg"/>
</Border>
can this kind of scenario only be done with an image ?
enter code here
| 0 | [
2,
619,
7721,
184,
20,
3042,
40,
1961,
7588,
19,
14,
2395,
16,
21,
1862,
800,
3726,
3726,
31,
22,
79,
749,
20,
3042,
40,
1961,
28,
14,
2395,
16,
21,
1862,
4520,
13,
1,
24389,
1,
13,
1,
24389,
9,
1958,
8810,
1,
13,
1,
22039,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Chess progam OO design
===
<p>Hi!</p>
<p>In my chess program, i have a class called Move. It stores where the piece was taken and put. What was the piece and what was the piece captured.</p>
<p>The problem is though, in order to get the piece that was moved and captured, i pass the whole Board object to the __init__ method. And so IMO it seems like i should store all the Move class methods to the Board class instead, which too has a method that get's the piece on a given square.</p>
<p>I'm just beginning to learn OO, so some advice regarding this, and maybe some more general design decision is much appreciated.</p>
<p>Here's the Move class that I feel might better be omitted?</p>
class Move(object):
def __init__(self, from_square, to_square, board):
""" Set up some move infromation variables. """
self.from_square = from_square
self.to_square = to_square
self.moved = board.getPiece(from_square)
self.captured = board.getPiece(to_square)
def getFromSquare(self):
""" Returns the square the piece is taken from. """
return self.from_square
def getToSquare(self):
""" Returns the square the piece is put. """
return self.to_square
def getMovedPiece(self):
""" Returns the piece that is moved. """
return self.moved
def getCapturedPiece(self):
""" Returns the piece that is captured. """
return self.captured | 0 | [
2,
6168,
895,
7253,
13,
4328,
704,
800,
3726,
3726,
13,
1,
306,
1,
1822,
187,
1,
118,
306,
1,
13,
1,
306,
1,
108,
51,
6168,
625,
15,
31,
57,
21,
718,
227,
780,
9,
32,
4134,
113,
14,
1855,
23,
658,
17,
442,
9,
98,
23,
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... |
Installing an app calling Google Play
===
Does anyone know how to call google play from web to install an app on an android device?
I have the package name, the app name, the version name, the google account, the device id and the device model :)
| 0 | [
2,
25429,
40,
4865,
2555,
8144,
418,
800,
3726,
3726,
630,
1276,
143,
184,
20,
645,
8144,
418,
37,
2741,
20,
16146,
40,
4865,
27,
40,
13005,
3646,
60,
31,
57,
14,
6030,
204,
15,
14,
4865,
204,
15,
14,
615,
204,
15,
14,
8144,
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,
0,
0,
0,
0,
0,
0... |
R.java doesn't update
===
I have problem when programming android application,
when I make any change the R.java file doesn't update
I tried to change it manually but it isn't work
I deleted project an create a new one but still have a problem
what should I do ? | 0 | [
2,
761,
9,
1004,
1385,
1437,
22,
38,
11100,
800,
3726,
3726,
31,
57,
1448,
76,
3143,
13005,
3010,
15,
76,
31,
233,
186,
753,
14,
761,
9,
1004,
1385,
3893,
1437,
22,
38,
11100,
31,
794,
20,
753,
32,
23671,
47,
32,
2532,
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,
1,
1,
1,
1,
1,
1,
1,
1... |
MYSQL X locks with transactions
===
Quick question,
I want to exclusive lock a row for a transaction eg:
`SELECT.....FROM.....FOR UPDATE`
my question is do I need to do this before doing `PDO::beginTransaction` -
Do the `UPDATE` inside the transaction and then manually unlock if an exception is thrown?
Or can I just have it inside the transaction?
Thanks in advance. | 0 | [
2,
51,
18,
22402,
993,
12941,
29,
13147,
800,
3726,
3726,
2231,
1301,
15,
31,
259,
20,
6753,
3991,
21,
3131,
26,
21,
12799,
12369,
45,
13,
1,
18,
16964,
9,
9,
9,
9,
9,
2665,
9,
9,
9,
9,
9,
1106,
11100,
1,
51,
1301,
25,
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... |
Select item from spinner, filter/sort results from JSON in ListView
===
I have a listview from json which is the following:
{
"GetPOIByTypeResult": [
{
"ID": 1,
"Name": "Spitalul Judetean",
"Phone": "085228291",
"Rating": 44,
"Schedule": {
"ClosingHour": 16,
"ID": 1,
"IsNonStop": false,
"IsOpenOnFriday": true,
"IsOpenOnMonday": true,
"IsOpenOnSaturday": false,
"IsOpenOnSunday": false,
"IsOpenOnThursday": true,
"IsOpenOnTuesday": true,
"IsOpenOnWednesday": true,
"Name": "Monday to Friday",
"OpenHour": 8
},
"Specialities": [
{
"ID": 1,
"Name": "Stomatologie"
},
{
"ID": 2,
"Name": "Radiologie"
},
{
"ID": 3,
"Name": "Cardiologie"
},
{
"ID": 4,
"Name": "Ginecologie"
},
{
"ID": 5,
"Name": "Pediatrie"
},
{
"ID": 6,
"Name": "Patologie"
},
{
"ID": 7,
"Name": "Oncologie"
},
{
"ID": 8,
"Name": "Macelarie"
},
{
"ID": 9,
"Name": "Oftalmologie"
},
{
"ID": 10,
"Name": "Ghipsologie"
}
],
"Type": "Hospital"
},
]
}
In my listview, there are results from the field: "Name".
I want to filter my list by Specialities which is not displayed in the list, only returns the value.
I have actually no idea how to make this work, this is what I have done so far:
package com.example.medical.map;
import java.util.ArrayList;
public class SearchActivityHospitals extends ListActivity {
Button searchButton;
Button closeButton;
public Spinner spinner1;
private String poiType[];
private boolean isSearch = false;
EditText editText, editText2;
JsonArrayAdapterHospitals adapter;
ArrayList<Hospitals> tempName = new ArrayList<Hospitals>();
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.search_activity_layout_actionbar_hospitals);
adapter = new JsonArrayAdapterHospitals(this, tempName);
setListAdapter(adapter);
poiType = new String[] {"", "Stomatologie", "Radiologie", "Cardiologie", "Ginecologie", "Pediatrie", "Patologie", "Oncologie", "Macelarie", "Oftalmologie", "Ghipsologie"};
//this is my spinner
ArrayAdapter<String> adapter0 = new ArrayAdapter<String>(SearchActivityHospitals.this, android.R.layout.simple_spinner_item, poiType);
adapter0.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
spinner1.findViewById(R.id.spinnerSpecialityHospitals);
spinner1.setAdapter(adapter0);
spinner1.setOnItemSelectedListener(new MyOnItemSelectedListener()
);
WebService.setOnFinishAllHospitals(new OnFinishAllHospitals() {
public void onFinishAllHospitals(ArrayList<Hospitals> hospitals) {
if (hospitals != null) {
if (hospitals.size() > 0) {
tempName.clear();
tempName.addAll(hospitals);
adapter.notifyDataSetChanged();
}
}
}
});
WebService
.GetPOIByType("http://82.77.55.81:9090/MedicalMap/MedicalMap.svc/Getpoibytype/hospital");
final ListView lv = getListView();
lv.setTextFilterEnabled(true);
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,
int position, long id) {
Intent intent = new Intent(SearchActivityHospitals.this, DetailsHospitals.class);
intent.putExtra("Value", tempName.get(position));
startActivity(intent);
}
});
editText = (EditText) findViewById(R.id.editNameTextHospitals);
editText.addTextChangedListener(new TextWatcher() {
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
public void onTextChanged(CharSequence s, int start, int before,
int count) {
adapter.getFilter().filter(s); // Filter from my adapter
adapter.notifyDataSetChanged(); // Update my view
}
public void afterTextChanged(Editable s) {
}
});
editText2 = (EditText) findViewById(R.id.editAddressTextHospitals);
editText2.addTextChangedListener(new TextWatcher() {
public void beforeTextChanged(CharSequence s, int start, int count,
int after) {
}
public void onTextChanged(CharSequence s, int start, int before,
int count) {
adapter.getFilter().filter(s); // Filter from my adapter
adapter.notifyDataSetChanged(); // Update my view
}
public void afterTextChanged(Editable s) {
}
});
}
//and here is my onitem click listener which I have no idea how to do, please help
public class MyOnItemSelectedListener implements OnItemSelectedListener{
public void onItemSelected(AdapterView<?> parent, View v, int position,
long id) {
if(spinner1.getSelectedItem().equals("Stomatologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Radiologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Cardiologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Ginecologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Pediatrie")){
}else{
}
if(spinner1.getSelectedItem().equals("Patologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Oncologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Macelarie")){
}else{
}
if(spinner1.getSelectedItem().equals("Oftalmologie")){
}else{
}
if(spinner1.getSelectedItem().equals("Ghipsologie")){
}else{
}
}
public void onNothingSelected(AdapterView<?> arg0) {
spinner1.getSelectedItem().equals("");
{
}
}
public void handleClick_search(View v) {
ImageView searchButton = (ImageView) findViewById(R.id.searchButton);
searchButton.setVisibility(View.INVISIBLE);
LinearLayout layout = (LinearLayout) findViewById(R.id.searchFieldLayout);
layout.setVisibility(View.VISIBLE);
}
public void handleClick_closeSearch(View v) {
ImageView searchButton = (ImageView) findViewById(R.id.searchButton);
searchButton.setVisibility(View.VISIBLE);
LinearLayout layout = (LinearLayout) findViewById(R.id.searchFieldLayout);
layout.setVisibility(View.GONE);
}
public void showSearch() {
if (isSearch != true) {
isSearch = true;
searchButton.setVisibility(View.INVISIBLE);
closeButton.setVisibility(View.VISIBLE);
findViewById(R.layout.search_activity_layout_doctors).setVisibility(View.VISIBLE);
}
}
public void hideSearch() {
if (isSearch != false) {
isSearch = false;
searchButton.setVisibility(View.VISIBLE);
closeButton.setVisibility(View.GONE);
findViewById(R.layout.search_activity_layout_doctors).setVisibility(View.GONE);
}
}
}
}
So my question is, how to make the following:
Select item from spinner -> filter/sort list by selected criteria
Criteria is parsed but not shown in list so the data is there but how to do it? | 0 | [
2,
5407,
9101,
37,
3310,
1031,
15,
11945,
118,
22843,
1736,
37,
487,
528,
19,
968,
4725,
800,
3726,
3726,
31,
57,
21,
968,
4725,
37,
487,
528,
56,
25,
14,
249,
45,
13,
1,
13,
7,
3060,
1638,
49,
779,
4474,
29955,
7,
45,
636,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a cross browser icon webfont
===
I have been making my own webfont taking as a starting point articles from [web designer depot][1] and [intridea][2].
I know different engines render fonts differently and but the issue I'm having is that firefox renders the font higher than chrome - at the size I am displaying the font this is very noticeable (3 or 4 px - which on a button means they're totally misaligned).
I have also referenced [Github's octicon documentation][3] - when checking out how octicons compare browser they look great! No noticeable difference as far as I can see. **How did they achieve this?**
I am using inkscape and have tried a couple of different svg starter templates. Setup is `Set width: 1024` and have tried the icons at various sizes with no different outcome. i.e. 512pt square and aligned just under the baseline.
**My question is what rules do I need to impliment when creating a webfont to get the smallest difference between browser rendering of the font?**
[1]: http://www.webdesignerdepot.com/2012/01/how-to-make-your-own-icon-webfont/
[2]: http://www.intridea.com/blog/2012/4/24/symbol-font
[3]: https://github.com/blog/1135-the-making-of-octicons | 0 | [
2,
2936,
21,
919,
16495,
9801,
2741,
21931,
800,
3726,
3726,
31,
57,
74,
544,
51,
258,
2741,
21931,
741,
28,
21,
1422,
454,
3376,
37,
636,
14113,
4742,
7382,
500,
2558,
165,
500,
17,
636,
6391,
11891,
58,
500,
2558,
135,
500,
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... |
in jQuery, how to select by class child elements inside a tag with id attribute?
===
I have the following code
<tr id="myid">
<td>
<div>
...
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
...
</div>
</td>
</tr>
<tr id="anotherid">
<td>
<div>
...
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
<a href="" class="myclass"></a>
...
</div>
</td>
</tr>
and I'm trying to select A tags inside tag TR with ID "myid" attribute however the following code doesn't works:
$('#myid.myclass')
How can I select the A tags, using the TR ID?
Thank You in advance
| 0 | [
2,
19,
487,
8190,
93,
15,
184,
20,
5407,
34,
718,
850,
2065,
572,
21,
3383,
29,
4924,
35,
14755,
60,
800,
3726,
3726,
31,
57,
14,
249,
1797,
13,
1,
6384,
4924,
3726,
7,
915,
1340,
7,
1,
13,
1,
38,
43,
1,
13,
1,
12916,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.