unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Drupal 7 Search Autocomplete
===
I am trying to setup Search Autocomplete module in Drupal 7 on my website (kooknet.be),
but it does not work. I use the ID selector below, but nothing happens
#search-block-form
However, when I look in the code with Firebug I see the following
<input id="edit-search-block-form--2" class="form-text search_autocomplete_processed ac_input" type="text" maxlength="128" size="15" value="" name="search_block_form" title="Geef de woorden op waarnaar u wilt zoeken." autocomplete="off">
Why is autocomplete="off"? Can this be the reason why it is not working?
| 0 | [
2,
15708,
6720,
453,
2122,
3108,
15990,
800,
3726,
3726,
31,
589,
749,
20,
18161,
2122,
3108,
15990,
12613,
19,
15708,
6720,
453,
27,
51,
2271,
13,
5,
921,
3085,
2328,
9,
863,
6,
15,
47,
32,
630,
52,
170,
9,
31,
275,
14,
4924,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Low performance of mpeg1 encoding using libavcodec
===
I'm using mpeg1 codec to create proxy videos of my HD and SD Content.
Mpeg1 resolution and bitrate is;
For HD video proxy: 704x576 4.5 Mbit
For SD video proxy: 352x288 1.5 Mbit
My video params like this;
How can get more performance to change any params...
Best Regards,
AVCodecContext *c = &m_OutputCodecCtxVideo;
avcodec_get_context_defaults2( c, AVMEDIA_TYPE_VIDEO );
c->codec_id = CODEC_ID_MPEG1VIDEO;
c->codec_type = AVMEDIA_TYPE_VIDEO;
c->pix_fmt = PIX_FMT_YUV420P;
if( bHD ){
c->width = 704;
c->height = 576;
c->sample_aspect_ratio.num = 16;
c->sample_aspect_ratio.den = 11;
c->bit_rate = 4500000;
}
else{
c->width = 352;
c->height = 288;
c->sample_aspect_ratio.num = 12;
c->sample_aspect_ratio.den = 11;
c->bit_rate = 1500000;
}
c->time_base.num = 1;
c->time_base.den = 25;
c->gop_size = 15;
c->max_b_frames = 2;
// Needed to avoid using macroblocks in which some coeffs overflow.
// This does not happen with normal video, it just happens here as
// the motion of the chroma plane does not match the luma plane.
c->mb_decision = 2;
// some formats want stream headers to be separate
if( m_pFormatCtxDst->oformat->flags & AVFMT_GLOBALHEADER )
c->flags |= CODEC_FLAG_GLOBAL_HEADER;
m_OutputCodecCtxVideo.thread_count = 0;
| 0 | [
2,
708,
956,
16,
307,
20427,
165,
19608,
568,
13,
8326,
5214,
9375,
150,
800,
3726,
3726,
31,
22,
79,
568,
307,
20427,
165,
1797,
150,
20,
1600,
27188,
6610,
16,
51,
8590,
17,
13,
18,
43,
2331,
9,
307,
20427,
165,
4302,
17,
1142... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
TextView.setMaxLines not working?
===
In my app I have a screen where I display some text and then a photo. The text is variable in length (sometimes none at all, sometimes a lot), so I wanted to have it set up so the text never takes up more than a few lines (but can be scrolled) leaving enough room for the image below.
My view component for this part is created programatically, and I've adjusted the code to have the following (currently in my text-setting method, but the same thing happens if it's in the initial view-create code)
public void SetDescription(String description)
{
mTxtDescription.setText(Html.fromHtml(description));
mTxtDescription.setClickable(true);
mTxtDescription.setMaxLines(5);
mTxtDescription.setLines(5); //this makes no difference either!
mTxtDescription.setSingleLine(false);
mTxtDescription.setScrollbarFadingEnabled(true);
mTxtDescription.setScrollBarStyle(VERTICAL);
mTxtDescription.setMovementMethod(ScrollingMovementMethod.getInstance());
mTxtDescription.invalidate(); //adding this made no difference...
}
However it doesn't work- long text still fills the whole screen and the image has vanished due to being pushed down to a height of 0. How can I get the text to never be more than 5 lines? | 0 | [
2,
1854,
4725,
9,
3554,
8304,
7939,
52,
638,
60,
800,
3726,
3726,
19,
51,
4865,
31,
57,
21,
2324,
113,
31,
3042,
109,
1854,
17,
94,
21,
3056,
9,
14,
1854,
25,
7612,
19,
1476,
13,
5,
9310,
2369,
35,
65,
15,
1030,
21,
865,
6,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Drawing hit map in WPF
===
I've got a task to draw a 3D model with colors like Hitmap-
![enter image description here][1]
I will get a file with points, and every point has a color, so I would like to know if there is a way to color each triangle in gradiant color that is combination of the three colors of the three points.
something like this -
![enter image description here][2]
[1]: http://i.stack.imgur.com/tvOZ4.jpg
[2]: http://i.stack.imgur.com/uZ75w.png
What I know right now is that I can define the color of a **MeshGeometry3D** but I don't know how to define gradient color for each triangle. | 0 | [
2,
3533,
770,
2942,
19,
619,
7721,
800,
3726,
3726,
31,
22,
195,
330,
21,
3005,
20,
2003,
21,
203,
43,
1061,
29,
5268,
101,
770,
15022,
8,
13,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
165,
500,
31,
129,
164,
21,
3893,
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... |
Using a std::tuple as key for std::unordered_map
===
With the code below, I get a very confusing error in MSVC that seems to suggest the key type (an std::tuple) is being converted to an std::string.
#include <iostream>
#include <string>
#include <tuple>
#include <utility>
#include <unordered_map>
typedef std::tuple<std::string,int,char> key_t;
struct key_hash : public std::unary_function<key_t, std::size_t>
{
std::size_t operator()(const key_t& k) const
{
return std::get<0>(k)[0] ^ std::get<1>(k) ^ std::get<2>(k);
}
};
struct key_equal : public std::binary_function<key_t, key_t, bool>
{
bool operator()(const key_t& v0, const key_t& v1) const
{
return (
std::get<0>(v0) == std::get<0>(v1) &&
std::get<1>(v0) == std::get<1>(v1) &&
std::get<2>(v0) == std::get<2>(v1)
);
}
};
struct data
{
std::string x;
};
typedef std::unordered_map<const key_t,data,key_hash,key_equal> map_t;
int main()
{
map_t m;
data d;
d.x = "test data";
m[std::make_tuple("abc",1,'X')] = d;
auto itr = m.find(std::make_tuple(std::string("abc"),1,'X'));
if (m.end() != itr)
{
std::cout << "x: " << itr->second.x;
}
return 0;
}
Error:
Error 1 error C2664: 'std::basic_string<_Elem,_Traits,_Ax>::basic_string(const std::basic_string<_Elem,_Traits,_Ax> &)' : cannot convert parameter 1 from 'const std::tr1::tuple<_Arg0,_Arg1,_Arg2>' to 'const std::basic_string<_Elem,_Traits,_Ax> &' c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\tuple 127 1
On ideone, I get the following even more convoluted error:
http://ideone.com/yEv2j
I can't seem to figure out where I've gone wrong.
| 0 | [
2,
568,
21,
354,
43,
45,
45,
2473,
5106,
28,
1246,
26,
354,
43,
45,
45,
1020,
7861,
69,
1,
15022,
800,
3726,
3726,
29,
14,
1797,
1021,
15,
31,
164,
21,
253,
18084,
7019,
19,
4235,
8990,
30,
2206,
20,
5601,
14,
1246,
1001,
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... |
unknown user name or bad password when I tried to connect to another server
===
I need to read the file of another server via vb.net application. For this case I tried to read destination file by FileSream.
The destination file in the another server is (\\dstServer\sheardFolder\dstFilename). for destination parent path I type \\dstServer\sharedFolder\Filename and this string is included in the FileSream Class. When I run this application I get the error of asp.net with this subject (Login failure: unknown user name or bad password)...!!!
I set the following permissions on the parent folder at the destination Server
1- users have a full permission
2- everyone have a full permission
3- asp.net have a full permission
Note: I searched in the internet and noticed that in the first step I should connect to the destination Server and my users should be authenticated by the destination Server.
After that I used .Net security classes and advapi32.dll , Kernel32.dll also impersonateValidUser.
I set the destination Server username and destination Server password and destination Server name or IP in the impersonateValidUser function but when I run the applciation, I get the response (failed) which means that connect to the destination Server is failed.
This application that is used to connect the users with destination server was in the following microsoft sample code: http://support.microsoft.com/kb/842789
Please give me tips.
Thanks in advance. | 0 | [
2,
2562,
4155,
204,
54,
896,
20884,
76,
31,
794,
20,
6379,
20,
226,
8128,
800,
3726,
3726,
31,
376,
20,
1302,
14,
3893,
16,
226,
8128,
1197,
13,
20468,
9,
2328,
3010,
9,
26,
48,
610,
31,
794,
20,
1302,
6970,
3893,
34,
6488,
99... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Building custom web control, How to check if resource file already added?
===
I'm building custom web control and I'm using js and css with it.
Js and Css files are embedded in control's dll.
The problem is when I'm adding this control to page more than one time the resources (js and css file) added again, is there a way to check if those files already added ?
Notice that this control can be added to any other container control (like div):
divId.Controls.Add(myCustomControl);
So I need a way to search for an ID in all sub controls in page
Thanx. | 0 | [
2,
353,
5816,
2741,
569,
15,
184,
20,
2631,
100,
6577,
3893,
614,
905,
60,
800,
3726,
3726,
31,
22,
79,
353,
5816,
2741,
569,
17,
31,
22,
79,
568,
487,
18,
17,
272,
18,
18,
29,
32,
9,
487,
18,
17,
272,
18,
18,
6488,
50,
12... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Should I ignore SCSS?
===
I consider myself and excellent CSS writer. Lately, I have had some requests to code in SCSS. However, I don't run Ruby in my environment and am weighing whether I should deal with that overhead. And yes, I know there are some work arounds to compile the SCSS.
So, should I go out of my way to learn and support SCSS, or should I consider it strictly a Ruby gem that has nothing to do with what I do? | 4 | [
2,
378,
31,
7174,
4729,
18,
18,
60,
800,
3726,
3726,
31,
3563,
992,
17,
5977,
272,
18,
18,
1462,
9,
10434,
15,
31,
57,
41,
109,
12279,
20,
1797,
19,
4729,
18,
18,
9,
207,
15,
31,
221,
22,
38,
485,
10811,
19,
51,
2307,
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... |
Error when booting Linux Mint 12
===
When I try to boot Linux Mint12 I had this error:
alloc magic point is broken . aborted. Press any key to exit
How can I repair it? | 2 | [
2,
7019,
76,
6801,
68,
13024,
9728,
390,
800,
3726,
3726,
76,
31,
1131,
20,
6801,
13024,
9728,
918,
31,
41,
48,
7019,
45,
65,
2499,
2154,
454,
25,
2023,
13,
9,
21557,
69,
9,
901,
186,
1246,
20,
4350,
184,
92,
31,
5612,
32,
60,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Search fileName and get full path based on a pattern in C#
===
How do I get the full path for a file based on first 6 letters in the filename in C#? Is there any Regex for this?
I have a folder with 500K+ images.
All the images are named as per the database column value.
I am querying the table and based on the column value I have to search the folder for the specific file.
If the column value is 209050 there will be one file in the folder like 209050.pdf or 209050_12345.pdf. There will always be one image for 209050.
Please help | 0 | [
2,
2122,
3893,
7259,
17,
164,
503,
2013,
432,
27,
21,
3732,
19,
272,
5910,
800,
3726,
3726,
184,
107,
31,
164,
14,
503,
2013,
26,
21,
3893,
432,
27,
64,
400,
2516,
19,
14,
3893,
7259,
19,
272,
5910,
60,
25,
80,
186,
7953,
1706... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Global style overrides specific compoment style
===
i have this problem i have a flex 4.1 project with a css file that contains follow components:
global {
color: #FFFFFF;
font-family: Verdana;
font-anti-alias-type: advanced;
modal-transparency-color:000000;
focusColor: #b3001e;
errorColor: #b3001e; }
and then i have the specific style for a textinput:
s|TextInput, s|NumericStepper, astra|IPv4AddressInput {
color: #000000;
disabledColor: #555;
contentBackgroundColor: #e5e5e8;
borderColor: #000000; }
but sometimes it happens that the s:textInput has a problem. the color of the characters you enter have sometimes the color of the Global style.
so you expected a black colored font but you see a white color font.
does anyone have a idea how to solve this or explain why this is happening? | 0 | [
2,
2062,
1034,
84,
11891,
18,
1903,
6479,
111,
1130,
1034,
800,
3726,
3726,
31,
57,
48,
1448,
31,
57,
21,
14409,
268,
9,
165,
669,
29,
21,
272,
18,
18,
3893,
30,
1588,
1740,
5090,
45,
2062,
13,
1,
1665,
45,
6926,
2460,
2460,
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... |
XHTML W3C Compliance, multiple information in src attribute
===
We are building an image carousel, it displays clickable thumbnails that when clicked, displays the actual image. We therefore need both url to appears in the Html. Since there is no "actualImageUrl" attribute defined in the img tag, we figured out that we could build the thumbnail url like this : /thumb.png?altUrl=actualImageUrl.png. The server does not care of the actualImageUrl querystring param and we can use javascript to parse the scr attribute and figure out the actualImage Url.
How W3C valid is this ? | 0 | [
2,
993,
15895,
619,
240,
150,
14969,
15,
1886,
676,
19,
13,
18,
5453,
35,
14755,
800,
3726,
3726,
95,
50,
353,
40,
1961,
27374,
15,
32,
9412,
10840,
579,
5078,
325,
947,
18,
30,
76,
15802,
15,
9412,
14,
3463,
1961,
9,
95,
1793,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery: How can I wrap an element with a table (consisting of multiple rows)?
===
The jQuery [.wrap()][1] function allows you to wrap any matched elements with some custom HTML. However, the function doesn't allow you to indicate where in the HTML you would like you matched element to be inserted -- ***it is always inserted into the inner most element***.
I need to wrap a div with a fairly basic table (in order to add rounded corners to it), but the only catch is that the table has two rows and I want my element to appear in the second row. For example:
$("#my-div").wrap('<table> \
<tr> \
<td class="corner-topleft" colspan="2"></td> \
<td class="corner-topright"></td> \
</tr> \
<tr> \
<td class="corner-bottomleft"></td> \
<td class="DIV-SHOULD-APPEAR-HERE"></td> \
<td class="corder-bottomright"></td> \
</tr> \
</table>');
If you try to execute this script, the wrap() function automatically places the matched element inside the **first table cell** (i.e. "corner-topleft") as this is the "first inner most element".
***How can I use jQuery to wrap my element with the multi-row table above?***
[1]: http://api.jquery.com/wrap/ | 0 | [
2,
487,
8190,
93,
45,
184,
92,
31,
8118,
40,
4520,
29,
21,
859,
13,
5,
12124,
702,
68,
16,
1886,
11295,
6,
60,
800,
3726,
3726,
14,
487,
8190,
93,
636,
9,
499,
10817,
5,
6,
500,
2558,
165,
500,
1990,
2965,
42,
20,
8118,
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... |
How can I implement Async Webservice call in .Net not only by one connection?
===
I have a .net Webservice. It has a method that does a task that takes 60 seconds and after that, returns the string result to client.
In some networks especially low band widths I get timeout error in 40 seconds before webservice method do its task in 60 second.
Now I want to implement webservice Async call to support low band width networks.
In Async webservice call an approach is using a thread that runs webservice method and returns webservice result to main thread that is shown in the following picture.
![enter image description here][2]
But my problem will not be solved in this approach because that thread uses one connection.
I need another approach. A thread in my client call webservice method and method starts its operation and when the task is done, **1) webservice sends a message that your response is ready** or, **2) client checks if the webservice response is ready** like the following picture.
![enter image description here][1]
How can I implement the second approach in .net? Is it possible?
Thanks.
[1]: http://i.stack.imgur.com/wgPJA.gif
[2]: http://i.stack.imgur.com/pnu8Q.gif | 0 | [
2,
184,
92,
31,
8713,
21,
9507,
150,
2741,
11449,
645,
19,
13,
9,
2328,
52,
104,
34,
53,
2760,
60,
800,
3726,
3726,
31,
57,
21,
13,
9,
2328,
2741,
11449,
9,
32,
63,
21,
2109,
30,
630,
21,
3005,
30,
1384,
2083,
2582,
17,
75,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Receive intent ACTION_USB_DEVICE_ATTACHED through code
===
I've run into a wall using the usb api. I am trying to use a broadcast receiver to receive the intent ACTION_USB_DEVICE_ATTACHED but it will not.
To clarify I had this working great through the manifest but that created a new activity (and added to the back stack). I found this undesirable, especially given the nature of my app (a terminal).
My guess is that the device-filter xml metadata needs adding to the intent filter but I have no idea how.
Any feedback is welcome! | 0 | [
2,
2588,
6936,
1028,
1,
267,
220,
1,
546,
18507,
1,
28484,
120,
1797,
800,
3726,
3726,
31,
22,
195,
485,
77,
21,
769,
568,
14,
182,
220,
21,
2159,
9,
31,
589,
749,
20,
275,
21,
1992,
6264,
20,
2588,
14,
6936,
1028,
1,
267,
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... |
Hooks for mouse - limitations and performance
===
I have some question about WH_MOUSE. From what I've read, by putting the hook into a DLL it injects processes. Does it mean that capturing the mouse will work on my desktop, menu start etc. too? And what about title bar of applications? I've seen some posts over the Internet with such problems, but don't know if they failed with something or there's some kind of limitation (or another approach).
I also have a question about performance between WH_MOUSE and WH_MOUSE_LL. I found somewhere that the WM_MOUSE is faster than WH_MOUSE_LL, but is it really noticeable? If so in what situations it can slow system that much that we can notice that? If I want to record only clicks of the mouse and keyboard would WH_MOUSE_LL be efficient?
Thanks! | 0 | [
2,
5559,
18,
26,
7567,
13,
8,
14070,
17,
956,
800,
3726,
3726,
31,
57,
109,
1301,
88,
11153,
1,
14002,
62,
9,
37,
98,
31,
22,
195,
1302,
15,
34,
3873,
14,
5559,
77,
21,
13,
43,
211,
32,
20316,
18,
5102,
9,
630,
32,
884,
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... |
Iterator is fail-fast and Enumeration is not. Is this the other difference among the both other than the points given by Java doc?
===
According to Javadoc,
New implementations should consider using Iterator in preference to Enumeration
If newer implementation should consider the Iterator why cannot the Enumeration usage is deprecated?
Iterator is fail-fast and Enumeration is not. Is this the other difference among the both other than the points given by Java doc?
Thanks | 0 | [
2,
32,
106,
3457,
25,
7476,
8,
13088,
17,
26940,
872,
25,
52,
9,
25,
48,
14,
89,
2841,
497,
14,
156,
89,
119,
14,
819,
504,
34,
8247,
9765,
60,
800,
3726,
3726,
496,
20,
8247,
13799,
15,
78,
6123,
18,
378,
3563,
568,
32,
106... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
determine the screen resolution & set the background image to center of the web page using the javascript
===
I want to determine the screen resolution of the client machine and the set the background image in the center using the javascript....
i have come so far..
function centerBackGroundImage()
{
var browserWidth = document.documentElement.clientWidth;
var browserHeight = document.documentElement.clientHeight;
$("#background").css({ "z-index": "-10", "margin:left": (browserWidth / 2) - (browserHeight/ 2) });
}
i have already added the div tag named "background" and the <img> tag with the location of the image file.
any help would be appreciated..
| 0 | [
2,
3746,
14,
2324,
4302,
279,
309,
14,
2395,
1961,
20,
459,
16,
14,
2741,
2478,
568,
14,
8247,
8741,
800,
3726,
3726,
31,
259,
20,
3746,
14,
2324,
4302,
16,
14,
6819,
1940,
17,
14,
309,
14,
2395,
1961,
19,
14,
459,
568,
14,
82... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jQuery Mobile + backbone.js: navbar issue
===
I load pages created from templates dynamically with a function from the Router (as seen on some tutorials):
changePage: function(page) { // page is a View object
$(page.el).attr('data-role', 'page');
page.render();
$('body').append($(page.el));
var transition = $.mobile.defaultPageTransition;
if (this.firstPage) {
transition = 'none';
this.firstPage = false;
}
$.mobile.changePage($(page.el), {changeHash:false, transition: transition});
}
The thing is when pages contain a JQ Mobile navbar, the active item is not highlighted. Actually it is, like 1 ms, then it's not, I feel like it's because the navbar is "reloaded".
When I click 2 times on the same item, it works the second time.
Is there anybody who is able to have working navbars with jQuery Mobile and backbone.js? | 0 | [
2,
487,
8190,
93,
3241,
2754,
24036,
9,
728,
18,
45,
16048,
1850,
1513,
800,
3726,
3726,
31,
6305,
4434,
679,
37,
22894,
18,
7782,
1326,
29,
21,
1990,
37,
14,
858,
139,
13,
5,
472,
541,
27,
109,
29724,
18,
6,
45,
753,
6486,
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... |
when to use duplex service?
===
Well, I know that in a duplex contract the service can send messages to the client, but I would like to know when that is really useful.
I have a common application that send request to the service to get data from the a database, insert data... etc. Also, I need to store files about 40MB in the database, so I need a good performance. For this reason, I would like to use the net.tcp binding with transfer mode streamed, but the problem is that a net.tcp duplex service can't use the streamed transfer mode.
So I think I have some options.
1.- study if I really need a duplex contract for this kind of application. Perhaps in a chat application, for example, it has more sense a duplex contract because the server perhaps need to notify to the client when a contact is connected... etc. But in a common client that access to a data base, is necessary a duple contract? what kind of operations would can need a duplex contract?
2.- Other option it's not to have a duplex contract, but implement a no duplex contract in the server and other single contract in the the client, so when a client connect to the service, the service receive the needed information to connect to the service of the client. But, is this a good way to avoid a duplex contract?
3.- Really for my application I need tcp instead of a duplex HTTP that allows a streamed transfer mode? What is the advantages of the tcp over the HTTP in terms of performance?
Thanks. | 0 | [
2,
76,
20,
275,
1052,
11326,
365,
60,
800,
3726,
3726,
134,
15,
31,
143,
30,
19,
21,
1052,
11326,
1305,
14,
365,
92,
2660,
7561,
20,
14,
6819,
15,
47,
31,
83,
101,
20,
143,
76,
30,
25,
510,
4811,
9,
31,
57,
21,
757,
3010,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Notice : unserialize() [function.unserialize] with my drupal 7 website
===
I have a little problem with my production installation on OVH. Indeed, all work in local, but it's not the same on OVH (hosting)
Here is my error :
Notice : unserialize() [function.unserialize]: Error at offset 367 of 532 bytes dans _ctools_export_unpack_object() (ligne 815 dans /var/www/sites/all/modules/ctools/includes/export.inc). | 0 | [
2,
3551,
13,
45,
367,
4104,
2815,
2952,
5,
6,
636,
22359,
9,
1020,
4104,
2815,
2952,
500,
29,
51,
15708,
6720,
453,
2271,
800,
3726,
3726,
31,
57,
21,
265,
1448,
29,
51,
637,
7758,
27,
13,
2026,
252,
9,
4057,
15,
65,
170,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS Rounded corner in Google Chrome
===
I wanted to make my top left hand corner of a table rounded in all browsers.
I tried this:
`-webkit-border-top-left-radius: 9px;`
`-moz-border-radius-topleft: 9px;`
`border-top-left-radius: 9px;`
But it doesn't seem to be working in Google chrome. Can anyone see the error? I'm also sure it used to work... | 3 | [
2,
272,
18,
18,
8472,
1531,
19,
8144,
13,
12985,
800,
3726,
3726,
31,
417,
20,
233,
51,
371,
225,
224,
1531,
16,
21,
859,
8472,
19,
65,
16495,
18,
9,
31,
794,
48,
45,
13,
1,
8,
14113,
13703,
8,
24389,
8,
3880,
8,
9742,
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... |
Nothing happen when adding Errors to error msg of LoginControl
===
I had a Login.aspx page. I want to replace the original error message so that user can know what they had wrongly input into the Login Control.
Despite adding all the related codes and checking through my Login.aspx.cs file, and test run it, the default message keep appearing instead of the code that I had added.
Default message:
"Your login attempt was not successful. Please try again"
Seems that the code that I wrote didn't executed. And I had not know what was wrong at it.
Here is my Login.aspx.cs code:
protected void Login1_LoginError(object sender, System.EventArgs e)
{
System.Web.UI.WebControls.Login Login1 = (System.Web.UI.WebControls.Login)LoginView1.FindControl("Login1");
TextBox UserName = (TextBox)Login1.FindControl("UserName");
Literal FailureText = (Literal)Login1.FindControl("FailureText");
//There was a problem logging in the user
//See if this user exists in the database
MembershipUser userInfo = Membership.GetUser(UserName.Text);
if (userInfo == null)
{
//The user entered an invalid username...
FailureText.Text = "There is no user in the database with the username " + UserName.Text;
}
else
{
//See if the user is locked out or not approved
if (!userInfo.IsApproved)
{
FailureText.Text = "When you created your account you were sent an email with steps to verify your account. You must follow these steps before you can log into the site.";
}
else if (userInfo.IsLockedOut)
{
FailureText.Text = "Your account has been locked out because of a maximum number of incorrect login attempts. You will NOT be able to login until you contact a site administrator and have your account unlocked.";
}
else
{
//The password was incorrect
FailureText.Text = "Invalid Password. Please try again." ;
}
}
}
Can anyone help me suggestions what was wrong with the code?
Thanks! | 0 | [
2,
626,
2384,
76,
4721,
11908,
20,
7019,
4235,
263,
16,
6738,
108,
12898,
800,
3726,
3726,
31,
41,
21,
6738,
108,
9,
472,
306,
396,
2478,
9,
31,
259,
20,
3934,
14,
501,
7019,
2802,
86,
30,
4155,
92,
143,
98,
59,
41,
1389,
102,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Using sublime to edit R installed on a linux server
===
I am on a windows machine using sublime text 2. I have installed R on my separate Cent Os box on my network. I have Sshfs manager I use to mount the R box's hard drive on my windows. I use that because it seemed easier to open the project by just adding it as a folder in sublime since I have that mounted as a hard drive.
I've installed sublimeREPL. When I try to configure it, I am having hard time correctly adjusting the default_extend_env variable.
My R is on a separate linux box on my network.
My sublime is on a windows machine that is on the same network as the R box.
What is my sublimeREPL default_extend_env value ?
I used "PATH": "{PATH}:/usr/local/bin" and been altering with it but no luck - assuming because it is on a different linux box.
Thanks | 0 | [
2,
568,
27644,
20,
9392,
761,
4066,
27,
21,
13024,
8128,
800,
3726,
3726,
31,
589,
27,
21,
1936,
1940,
568,
27644,
1854,
172,
9,
31,
57,
4066,
761,
27,
51,
1725,
5802,
13,
759,
1649,
27,
51,
982,
9,
31,
57,
13,
18,
18,
18526,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
http://xx.xx.xx.xx:9890/ubersvn is not responding
===
`http://127.0.0.1:9890/ubersvn` is not responding though i am able to commit the changes through RAD. I can access the repository pages through IE also. with same IP. `http://127.0.0.1:9890/reporitory`
2 weeks before i have installed the SVN in my machine. and created user and repositories. and i am able to commit the changes now also. But when i try to acces the server to add one more user `http://127.0.0.1:9890/ubersvn` using this url(2 weeks before also i used this) the page shows "Internet Explorer cannot display the webpage". message.
I don't know.. what to do? help me. i want to add the user. its urgent.
Regards,
Jothi.
[1]: http://127.0.0.1:9890/ubersvn | 0 | [
2,
7775,
6903,
8962,
9,
8962,
9,
8962,
9,
8962,
45,
3804,
3165,
118,
8866,
18,
16578,
25,
52,
15887,
800,
3726,
3726,
13,
1,
21127,
6903,
11595,
9,
387,
9,
387,
9,
165,
45,
3804,
3165,
118,
8866,
18,
16578,
1,
25,
52,
15887,
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... |
JSF Currency mapped as NUMBER on the database
===
I'm using Seam 2.2.2, JSF Mojarra 1.2_13-b01-FCS, JBoss 5.1.0 Server.
I have an Oracle table with three columns specified as type NUMBER. The generated hibernate mapping has mapped those columns in the entity class as java.math.BigDecimal. These are currency values, and BigDecimal seems to be the preferred way of storing and calculating those values in Java.
I'm trying to use the number converter to use the values on screen as currency in an h:inputText and h:outputText. Works fine until I try to update one of those values, when java throws an Exception:
EquipItemEdit.xhtml value="#{equipItemHome.instance.cost}": java.lang.IllegalArgumentException: argument type mismatch
My entity is mapped like:
@Entity
@Table(name = "EQUIP_ITEM")
public class EquipItem implements java.io.Serializable {
...
private BigDecimal cost;
...
@Column(name = "COST", precision = 22, scale = 0)
public BigDecimal getCost() {
return this.cost;
}
public void setCost(BigDecimal cost) {
this.cost = cost;
}
...
}
Table definition in the database
CREATE TABLE EQUIP_ITEM
(
EQUIP_ID NUMBER,
COUNTER NUMBER,
ITEM VARCHAR2(6 BYTE),
ACQADC VARCHAR2(1 BYTE),
COG VARCHAR2(2 BYTE),
COST NUMBER,
NOMENC VARCHAR2(40 BYTE),
QUA_AUTH NUMBER,
...
)
And how the field is mapped on the JSP:
...
<h:inputText id="cost"
styleClass="value"
value="#{equipItemHome.instance.cost}"
size="15">
<f:convertNumber type="currency" currencySymbol="$" locale="en_US"/>
</h:inputText>
...
Any suggestions, or can someone point me to the right way to handle this data type? | 0 | [
2,
487,
18,
410,
10507,
20877,
28,
234,
27,
14,
6018,
800,
3726,
3726,
31,
22,
79,
568,
13927,
172,
9,
135,
9,
135,
15,
487,
18,
410,
1873,
6300,
525,
137,
9,
135,
1,
1543,
8,
220,
3026,
8,
7061,
18,
15,
487,
10349,
18,
331,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 insert and relate records in one table to existing records in a second table?
===
I have two tables that share a one to one relationship (in truth its one to many but I use it as one to one). The table with the foreign key has existing records with the foreign key set to NULL. I want to write a TSQL script that will add one default record into the second table for each of the records in the first and update the foreign key of the first to relate to the new records? Any idea how I might do this?
I want to create a script so I can update not only my development database but the live as well, when the time comes to publish my new version.
Thanks. | 0 | [
2,
184,
92,
31,
14692,
17,
16464,
742,
19,
53,
859,
20,
3149,
742,
19,
21,
153,
859,
60,
800,
3726,
3726,
31,
57,
81,
7484,
30,
1891,
21,
53,
20,
53,
1429,
13,
5,
108,
1770,
82,
53,
20,
151,
47,
31,
275,
32,
28,
53,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
determine DB2 text string length
===
I am trying to find out how to write an SQL statement that will grab fields where the string is not 12 characters long. I only want to grab the string if they are 10 characters.
What function can do this in DB2?
I figured it would be something like this, but I can't find anything on it.
`select * from table where not length(fieldName, 12)` | 0 | [
2,
3746,
13,
9007,
135,
1854,
3724,
1476,
800,
3726,
3726,
31,
589,
749,
20,
477,
70,
184,
20,
2757,
40,
4444,
255,
3331,
30,
129,
4931,
2861,
113,
14,
3724,
25,
52,
390,
1766,
175,
9,
31,
104,
259,
20,
4931,
14,
3724,
100,
59... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Consistency of onTouch event.getX or Y on different screen sizes - Android
===
I'm implementing an `OnTouchListener` on a custom view. In this view I'm drawing an object that basically moves along x and y axis I get form `event.getX();` and `event.getY();` respectively.
I want to perform some `draw` changes when touch events happen at particular positions in screen. The problem is, the values are *different for different screen sizes*. For example value of **X** value of a point on a **WVGA** device is **60** and on **tablets** it is **100**. Since this is inconsistent i couldn't write a proper `if` condition.
Please can any one suggest a solution for this from your prior experience? | 0 | [
2,
22061,
16,
27,
15725,
807,
9,
3060,
396,
54,
13,
93,
27,
421,
2324,
13403,
13,
8,
13005,
800,
3726,
3726,
31,
22,
79,
17333,
40,
13,
1,
218,
15725,
13891,
106,
1,
27,
21,
5816,
1418,
9,
19,
48,
1418,
31,
22,
79,
3533,
40,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Switch View and Set Focus in Infopath
===
My InfoPath form is for filling out a government form (the SF182) and requires several code lookups (such as people reading descriptions of various types of education and picking the correct code). I have the descriptions on a seperate view. On that view I have a button to return them to the main view.
When they click that button I want it to not only change views, but instead of going to the top of the view go to the text box the code needs to go into.
ViewInfos.SwitchView("SF182")
Handles the view switching as best I can tell.
From here [Programmatically Selecting Controls in an Infopath View (Infopath 2007 Developer Resource)][1]
[1]: http://msdn.microsoft.com/en-us/library/bb251012%28v=office.12%29.aspx
I found that the correct code should take this form
var nodeSelText = XDocument.DOM.selectSingleNode("/my:myFields/my:field1")
> XDocument.View.SelectText(nodeSelText)
From my attempts at data validation the following code was generated
AddHandler EventManager.XmlEvents("/dfs:myFields/dfs:dataFields/d:tSF182/@EducLevel").Validating, AddressOf tSF182_EducLevel_attr_Validating
So I attempted to use this and created
Public Sub CTRL1_14_Clicked(ByVal sender As Object, ByVal e As ClickedEventArgs)
ViewInfos.SwitchView("SF182")
dim nodeSelText = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:tSF182/@EducLevel"))
XDocument.View.SelectText(nodeSelText)
End Sub
However, it is giving error 'Name XDocument is not declared' at present error, if I add
dim XDocument as a line before it says 'variable declaration without an 'As' clause; type of object assumed' and the last line (XDocument.View.SelectText(nodeSelText) says Name 'nodeSelText' is not declared.
My apologies for the likely painfully bad question, I attempted to follow the How to Ask a Question instruction and show my work, but this is my first attempt at asking an online question as well as first attempt at using Infopath
| 0 | [
2,
5521,
1418,
17,
309,
1776,
19,
15404,
8353,
800,
3726,
3726,
51,
15404,
8353,
505,
25,
26,
7702,
70,
21,
283,
505,
13,
5,
124,
15025,
11105,
6,
17,
4781,
238,
1797,
361,
15699,
13,
5,
4289,
28,
148,
1876,
15740,
16,
617,
2551... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
$.post data length limit and Oauth
===
I'm using ajax post call from my script, passing a long variable (more than 600 characters) to a php file, that is connecting with an API throw Oauth, and posting the long variable in my wall.
When I send messages less or equal than 512 chars, there is no problem. But when I esceed 512, Oauth fails throwing an error failing to "requestAccesToken".
I tried to ajax post the variable as empty string, and then in the php set the content manually. If I do that, everything works ok.
So, why if a string passed by post call to a php is greater than 512, breaks the authentication process in Oauth? Why if it's smaller than 512 goes ok? Why if I set the variable manually in the php, I can set it as large as I want and get no fail at all?
Makes no sense for me.
Thank you every one.
Luis. | 0 | [
2,
5579,
9,
6962,
1054,
1476,
4496,
17,
635,
1346,
96,
800,
3726,
3726,
31,
22,
79,
568,
20624,
678,
645,
37,
51,
3884,
15,
2848,
21,
175,
7612,
13,
5,
1995,
119,
7316,
1766,
6,
20,
21,
13,
26120,
3893,
15,
30,
25,
6440,
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... |
Connect to MSSQL DB from iOS
===
I know that directly connection DB is not good idea, but I need it(MS SQL). So the question is: is there some library, preferable written on Objective-C/C and compiled to a static lib, which give desired result?
I know about FreeTDS, but I don't know how to build it. Is there xcode project with it, or how can I make it?
Thanks a lot. | 0 | [
2,
6379,
20,
4235,
18,
22402,
13,
9007,
37,
13,
7760,
800,
3726,
3726,
31,
143,
30,
1703,
2760,
13,
9007,
25,
52,
254,
882,
15,
47,
31,
376,
32,
5,
79,
18,
4444,
255,
6,
9,
86,
14,
1301,
25,
45,
25,
80,
109,
1248,
15,
6369... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Difference failed tasks vs killed tasks
===
From Jobtracker web UI, I see this column called "Failed/Killed
Task Attempts".
I would like to know the distinction between them. I guess "Failed ones" mean tasks that really failed eventually after some retries (so no recovery was done at all?) while "Killed ones" mean tasks which are killed (due to timeout and so on) but they might be retried? | 0 | [
2,
2841,
1702,
8674,
4611,
841,
8674,
800,
3726,
3726,
37,
1205,
4792,
106,
2741,
13,
5661,
15,
31,
196,
48,
4698,
227,
13,
7,
24910,
69,
118,
7577,
69,
3005,
3265,
7,
9,
31,
83,
101,
20,
143,
14,
6519,
128,
105,
9,
31,
2321,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Merge sort implementation for counting Inversion of an array
===
Below is my implementation for Inversion of an array. For some inputs it produces the required result. For eg :
1 : 0,1,2,3,4,5,6,7,8,9 -> 0 inversion (Correct)
2 : 1000,999,998,997,.......3,2,1 -> 499500 inversion (Correct)
3 : 1,3,5,2,4,6 -> 3 inversion (Correct)
But for
4 : 9,10,8,1,4,7,6,2,5,3 -> 41 inversion (Incorrect). The correct answer is 33.
public class Assignment1 {
static int[] result = new int[10];
public static long divideW (int Arr[]) {
long countLeft ;
long countRight ;
long countMerge ;
int mid = (Arr.length)/2;
if (Arr.length <= 1)
return 0;
else
{
int leftArr[] = new int [mid];
int rightArr[] = new int [Arr.length - mid];
for (int i = 0; i < mid; i++){
leftArr[i] = Arr[i];
}
for (int j = 0; j < rightArr.length ; j++){
rightArr[j] = Arr[mid + j];
}
countLeft = divideW (leftArr);
countRight = divideW (rightArr);
//int[] result = new int[Arr.length];
countMerge = conquer(leftArr, rightArr, result);
return (countLeft + countRight + countMerge);
}
}
public static long conquer (int []l, int[]r, int[] result) {
int i = 0;
int j = 0;
int k = 0;
long count = 0;
while ((i < l.length) && (j < r.length)) {
if (l[i] <= r [j]) {
result[k] = l[i++];
}
else if (l[i] > r[j]) {
result[k] = r[j++];
count += l.length - i;
}
++k;
}
while ( i < l.length) {
result[k++] = l[i++];
}
while ( j < r.length) {
result[k++] = r[j++];
}
return count;
}
public static void main(String[] args) {
Assignment1 rs = new Assignment1();
int anArr[] = {9,10,8,1,4,7,6,2,5,3};
System.out.println (rs.divideW(anArr));
for (int i = 0 ; i < result.length; ++i) {
System.out.println (result[i]);
}
}
} | 0 | [
2,
12666,
2058,
6123,
26,
11195,
19,
10898,
16,
40,
7718,
800,
3726,
3726,
1021,
25,
51,
6123,
26,
19,
10898,
16,
40,
7718,
9,
26,
109,
6367,
18,
32,
6700,
14,
1390,
829,
9,
26,
12369,
13,
45,
137,
13,
45,
713,
15,
15793,
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... |
JS regex.exec() returning first find
===
I am trying to learn how to break up this string:
var str = 'red','blue','gree'
I have this working code:
var clean = str.replace(/\'/g, "");
var elements = clean.split(',');
which produces array ["red","blue","green"] which is what i want however. id like to learn how to do this using regex.exec() method.
here is what i got:
var patt = /([^']+)/g;
var elem= patt.exec(str);
but this returns array ["red","red"]
any ideas?
| 0 | [
2,
487,
18,
7953,
1706,
9,
1706,
3319,
5,
6,
2485,
64,
477,
800,
3726,
3726,
31,
589,
749,
20,
2484,
184,
20,
1442,
71,
48,
3724,
45,
4033,
13,
9729,
800,
13,
22,
2095,
22,
15,
22,
6997,
22,
15,
22,
6879,
62,
22,
31,
57,
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... |
logging warnings (not errors) in a rails application, and managing them
===
I'm looking for a good process to handle warnings/info type messages in Rails applications. For example, how many times users type in the wrong password, how many times validations for models fail, etc. Particularly, I'm looking for an efficient way to operationalize these metrics, since they aren't exceptions but could indicate potential bugs or issues in functionality.
Solutions I'm kicking around are:
- Logging WARNING or INFO messages and using Splunk to parse them (unfortunately Splunk is ver expensive)
- Sending Airbrake errors in a WARNING environment
| 0 | [
2,
13,
13919,
3590,
18,
13,
5,
1270,
11908,
6,
19,
21,
2240,
18,
3010,
15,
17,
5616,
105,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
254,
953,
20,
3053,
3590,
18,
118,
108,
4120,
1001,
7561,
19,
2240,
18,
3767,
9,
26,
823,
15... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to retrieve EditTexts Ids after dynamically assigning them earlier?
===
I am having problem retrieving edit text ids from previously initialized editTexts.
My example is:
for (int i=0; i<num; i++) {
temp_ll = new LinearLayout(this);
temp_ll.setOrientation(LinearLayout.HORIZONTAL);
temp1 = new EditText(this);
InputFilter[] FilterArray = new InputFilter[1];
FilterArray[0] = new InputFilter.LengthFilter(12);
temp1.setFilters(FilterArray);
temp1.setHint(" class name ");
temp1.setSingleLine(true);
g = new EditText(this);
g.setId(gradeID);
g.setHint("grade");
g.setInputType(InputType.TYPE_CLASS_NUMBER | InputType.TYPE_NUMBER_FLAG_DECIMAL);
gID++;
u = new EditText(this);
u.setId(unitID);
u.setHint("units");
u.setInputType(InputType.TYPE_CLASS_NUMBER);
uID++;
temp_ll.addView(temp1);
temp_ll.addView(u);
temp_ll.addView(g);
frame.addView(temp_ll);
}
ll.addView(frame);
This is the portion of my code that basically adds 3 EditTexts to my temp_ll linearlayout "num" times. Then the whole thing gets added to "ll" linearLayout.
If you can see, i set ids to "g" and "u" edittexts, but i am having trouble retrieving them later using the following code:
EditText gd, ut;
int unTemp = 300;
String st="", ut_s="";
for (int k=100; k<=gradeID; k++) {
gd = (EditText) findViewById(gID); // PROBLEM HERE
ut = (EditText) findViewById(unTemp); // PROBLEM HERE
st = gd.getText().toString();
ut_s = ut.getText().toString();
if (st.contentEquals("") || ut_s.contentEquals("")) {
continue;
}
// do something with st and ut_s later
gID is global and the value cames from the above code. If num = 10 then gID would be gID+=10... I checked it with Toast. So the gID is working properly. It seems like when i try to get findViewById(gID) this returns NULL
| 0 | [
2,
184,
20,
11917,
9392,
11969,
18,
13,
9178,
75,
7782,
1326,
13952,
68,
105,
1201,
60,
800,
3726,
3726,
31,
589,
452,
1448,
13,
6239,
3272,
8397,
9392,
1854,
13,
9178,
37,
1343,
2104,
1333,
9392,
11969,
18,
9,
51,
823,
25,
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... |
Dealing with NULL values in JSON
===
I have a stream of JSON coming back and am building a table dynamically with it's values. I'm having an issue where values which are "NULL" in the database are actually being returned in the JSON with a NULL value.
I'd rather my output to my users not display NULL.
Is there a more efficient way of handling this other than how I am doing it?
if(data[i][2] != null){
foo = '';
}else{
foo = data[i][2];
}
htmlString += '<td>' + foo+ '</td>'; | 0 | [
2,
5746,
29,
16203,
4070,
19,
487,
528,
800,
3726,
3726,
31,
57,
21,
3766,
16,
487,
528,
880,
97,
17,
589,
353,
21,
859,
7782,
1326,
29,
32,
22,
18,
4070,
9,
31,
22,
79,
452,
40,
1513,
113,
4070,
56,
50,
13,
7,
4215,
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... |
Unresolved externals error while calling static function
===
This is driving me absolutely nuts. I've tried everything I've found on other posts here, and nothing works... this should NOT be this complicated.
#include <iostream>
#include <iomanip>
using namespace std;
class SavingsAccount
{
private:
float savingsBalance;
static float annualInterestRate;
public:
static void modifyInterestRate(float interestRate)
{
annualInterestRate = interestRate;
}
};
int main()
{
SavingsAccount::modifyInterestRate(.03);
cout << endl;
system("pause");
return 0;
}
Getting an unresolved externals error. | 0 | [
2,
367,
99,
5594,
4763,
4886,
18,
7019,
133,
2555,
12038,
1990,
800,
3726,
3726,
48,
25,
2891,
55,
6916,
13771,
9,
31,
22,
195,
794,
796,
31,
22,
195,
216,
27,
89,
9868,
235,
15,
17,
626,
693,
9,
9,
9,
48,
378,
52,
44,
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... |
Uploadify completes but doesn't upload
===
I am trying to use Uploadify on my site and have it setup with the following uploadify.php:
<?php
// Define a destination
//$targetFolder = '/uploads'; // Relative to the root
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'];
$targetFile = rtrim($targetPath,'/') . '/' . $_FILES['Filedata']['name'];
// Validate the file type
$fileTypes = array('jpg','jpeg','gif','png'); // File extensions
$fileParts = pathinfo($_FILES['Filedata']['name']);
if (in_array($fileParts['extension'],$fileTypes)) {
move_uploaded_file($tempFile,$targetFile);
echo '1';
} else {
echo 'Invalid file type.';
}
}
?>
It wasn't uploading so I commented out $targetFolder and changed $targetPath so that it is just the document root. This results in $targetFile being /home/user/public_html/example.com/file.txt when I try to upload file.txt with Uploadify. The folder is set to 755. I'm at a loss as to what the problem could be. I am otherwise using a vanilla install of Uploadify and everything seems to work fine except that the file never actually goes where it should. | 0 | [
2,
71,
8294,
8612,
1279,
18,
47,
1437,
22,
38,
71,
8294,
800,
3726,
3726,
31,
589,
749,
20,
275,
71,
8294,
8612,
27,
51,
689,
17,
57,
32,
18161,
29,
14,
249,
71,
8294,
8612,
9,
26120,
45,
13,
1,
60,
26120,
12894,
9267,
21,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How does Android device when factory wiped still remember app activation code?
===
When a user has paid for a premium subscription app what happens to the activation code if that device is then factory wiped? It cannot be stored in SharedPreferences - what about Google Play? I've noticed some apps are able to recover the activation codes after factory wipes. How is this possible? | 0 | [
2,
184,
630,
13005,
3646,
76,
3129,
7891,
174,
1518,
4865,
15519,
1797,
60,
800,
3726,
3726,
76,
21,
4155,
63,
2192,
26,
21,
12934,
14213,
4865,
98,
5531,
20,
14,
15519,
1797,
100,
30,
3646,
25,
94,
3129,
7891,
60,
32,
1967,
44,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unix: why does reading wide characters in C stop after ASCII?
===
characters.txt has the content:
0000000 % ( ) * + , - . / 0 1 2 3 4 5 6
0000020 7 8 9 < = > ? [ ] \n A B C D E F
0000040 G H I J K L M N O P Q R S T U V
0000060 W X Y Z \n a b c d e f g h i j k
0000100 l m n o p q r s t u v w x y z \n
0000120 316 223 316 224 316 230 316 233 316 236 316 243 316 246 316 250
0000140 316 251 316 261 316 262 316 263 316 264 316 265 316 266 316 267
0000160 316 270 316 271 316 272 316 273 316 274 316 275 316 276 316 277
0000200 317 200 317 201 317 202 317 203 317 204 317 205 317 206 317 207
0000220 317 210 317 211 \n
that is, some ASCII followed by some Greek codepage UTF-8. I want to read these characters with
wint_t* read_characters()
{
char *filename = "characters.txt";
FILE *infile;
infile = fopen (filename, "rb");
printf ("File orientation: %d\n", fwide (infile,0));
static wint_t b[16384], c, *p;
p = b;
while ((p-b)<sizeof(b)-4 && (c = fgetwc (infile)) != WEOF)
*p++ = c;
*p++ = WEOF;
printf("\nRead %ld wint_t chars from characters.txt\n", p-b);
return b;
}
The output is
> File orientation: 0
> Read 81 wint_t chars from characters.txt
This means reading stopped with the first Greek character. Why? I'm using no signed variable that could fake a WEOF. Who can help? | 0 | [
2,
22540,
45,
483,
630,
1876,
1051,
1766,
19,
272,
747,
75,
28,
1892,
49,
60,
800,
3726,
3726,
1766,
9,
38,
396,
38,
63,
14,
2331,
45,
13,
3993,
21903,
13,
11881,
13,
5,
13,
6,
1637,
2754,
13,
15,
13,
8,
13,
9,
13,
118,
71... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SpecFlow Dependent Features
===
I have 2 Features 1. User Creation 2. User Enrollment both are separate and have multiple scenarios. 2nd Feature is dependent on 1st one, so when I run the 2nd Feature directly then how this feature checks the 1st Feature is already run and user created. I am using database in which creation status column (True/False) tells if user has been created or not. So, I want if i run the 2nd feature before that it runs the 1st feature for user creation. | 0 | [
2,
12737,
9990,
9063,
967,
800,
3726,
3726,
31,
57,
172,
967,
137,
9,
4155,
2502,
172,
9,
4155,
10239,
156,
50,
1725,
17,
57,
1886,
19611,
9,
172,
706,
1580,
25,
9063,
27,
137,
384,
53,
15,
86,
76,
31,
485,
14,
172,
706,
1580,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Symfony2 - Translate entity field type options
===
I'm using the FormBuilder to create my form. That works fine. The problem is my "Licence Object" which creates an select field with options. These options should be translated. But how to do that?
$form = $this ->createFormBuilder($request)
->add('title', 'text',
array( 'label' => $this->get('translator')->trans('form.title', array(), 'client_request_a_photo'))
)
->add('description', 'textarea',
array( 'label' => $this->get('translator')->trans('form.description', array(), 'client_request_a_photo'))
)
->add('licence','document',
array('class'=>'WunschbildBundle\Document\Licence', 'property'=>'options',
'label' => $this->get('translator')->trans('form.licence', array(), 'client_request_a_photo'))
)
->getForm(); | 0 | [
2,
13,
7261,
10229,
93,
135,
13,
8,
20628,
9252,
575,
1001,
6368,
800,
3726,
3726,
31,
22,
79,
568,
14,
505,
20904,
20,
1600,
51,
505,
9,
30,
693,
1123,
9,
14,
1448,
25,
51,
13,
7,
4663,
2940,
3095,
7,
56,
9695,
40,
5407,
57... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
lucene FrenchAnalyzer sometimes drops accents
===
Can anyone explain this strange behaviour of Lucene frenchAnalyzer. In some cases this analyzer drops accents
for (String string : tokenizeString(new FrenchAnalyzer(VERSION), word)) {
System.out.println(string);
}
when word=***écran*** it returns ***ecran*** (without the accent)
but
when word=***écr*** it returns ***écr*** (with the accent)
the tokenizeString() method used is...
public static List<String> tokenizeString(Analyzer analyzer, String string) throws IOException {
List<String> result = new ArrayList<String>();
TokenStream stream = analyzer.tokenStream(null, new StringReader(string));
while (stream.incrementToken()) {
result.add(stream.getAttribute(CharTermAttribute.class).toString());
}
return result;
}
| 0 | [
2,
18515,
556,
484,
1629,
102,
3592,
1030,
9458,
7980,
18,
800,
3726,
3726,
92,
1276,
3271,
48,
2578,
7727,
16,
18515,
556,
484,
1629,
102,
3592,
9,
19,
109,
1871,
48,
16051,
139,
9458,
7980,
18,
26,
13,
5,
11130,
3724,
13,
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... |
preview-latex generates .png files but does not place them in the buffer
===
When generating previews, I get an small, empty white box with a border around it. I looked inside the .prv folder and the .png files are indeed being created. emacs has support for .png and for rendering them.
MWE:
\documentclass{article}
\begin{document}
$3+4$
\end{document}
Running emacs 24.1.1 under X with ghostscript 9.05, texlive-2011, on OS X 10.7. I've tried both AUCTeX 11.86 (with the patch described here https://bugzilla.redhat.com/show_bug.cgi?id=646632 which fixes options that are passed to newer versions of gs) and the latest development version, which includes the patch.
Aquamacs, however, correctly generates previews. Perhaps this is a problem with OS X's X11? | 2 | [
2,
16121,
8,
6554,
396,
7920,
18,
13,
9,
306,
2723,
6488,
47,
630,
52,
209,
105,
19,
14,
17497,
800,
3726,
3726,
76,
13500,
16121,
18,
15,
31,
164,
40,
284,
15,
2424,
359,
1649,
29,
21,
1862,
140,
32,
9,
31,
292,
572,
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... |
PHP get value disappears
===
I have a html form that it's filled with the values I get from a MySQL Database which I query by an `id` that is sent via GET.
I send the id to the form with a button that is surrounded by an anchor `<a>` the code it's like this:
`<a href='editRQS.php?id=$row[0]'><button class='edit'>Edit</button></a>`
`$row[0]` its filled by the proper `id` and i'm sure it's working ok, when i click the button the url is sent carrying the `id`, it is then received at the other page like this:
<?php
$id = -1;
if(isset($_GET['id'])){
$id = $_GET['id'];
echo "<label class='exists' id='idRequest'> $id</label>";
}
if($id != -1 ){
echo '<form id="findRequest" class="hide" >';
} else {
echo '<form id="findRequest" class="show" >';
}
?>
The problem is that the `id` does arrive at the page but then it disappears, any help will be greatly appreciated. | 0 | [
2,
13,
26120,
164,
1923,
20341,
800,
3726,
3726,
31,
57,
21,
13,
15895,
505,
30,
32,
22,
18,
1943,
29,
14,
4070,
31,
164,
37,
21,
51,
18,
22402,
6018,
56,
31,
25597,
34,
40,
13,
1,
1340,
1,
30,
25,
795,
1197,
164,
9,
31,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
mysql auto save 10 digit unique number
===
I'm using rails web application with mysql database, I need to auto save 10 digit unique number/alphanumeric for each record in a table.
The table may contain more than millions of records(in future)
**Requirement**:
1. A 10 digit unique number should be generated only from mysql database and the generated number should not be less than 10 digit
2. I also refered the mysql's uuid() and uuid_short() methods which returns a universal unique id, but these returns more than 10 digit number.
3. If generated unique numbers are not in sequence then it will be much better (unpredictable to access other records such as next or previous reocrd).
**NOTE**:
- I don't think it is better to generate the unique id by manually(applying some logic like combination of timestamp, record_id, ...etc), because additional query is needed to check uniqueness in table. | 0 | [
2,
51,
18,
22402,
3108,
2079,
332,
15611,
2619,
234,
800,
3726,
3726,
31,
22,
79,
568,
2240,
18,
2741,
3010,
29,
51,
18,
22402,
6018,
15,
31,
376,
20,
3108,
2079,
332,
15611,
2619,
234,
118,
22480,
6336,
14744,
26,
206,
571,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple BackgroundWorkers do not start work immediately
===
I'm trying to use `BackgroundWorker` to load-test a web service,
Code is:
private void button1_Click(object sender, EventArgs e)
{
CheckWS("11111");
CheckWS("22222");
CheckWS("3344111");
// .. and some more of those, approx 1000
}
public void CheckWS(string sUser)
{
BackgroundWorker bgWork = new BackgroundWorker();
bgWork.DoWork += new DoWorkEventHandler(bgWork_DoWork);
sObject sData = new sObject();
sData.iNum = iCount++;
sData.sId = sUser;
bgWork.RunWorkerAsync(sData);
}
public void bgWork_DoWork(object sender, DoWorkEventArgs e)
{
// Update a textbox that this worker started
...
// Run a web service
...
// Update the textbox as worker ended
}
But according to the time taken for the job the get done, and according to the output of the workers (worker begin&end in the textbox), it takes way too long for each worker to start -
I would expect everything to run simultaneously, but instead, it executes only 2-3 background workers at a time...
Any ideas on this issue? | 0 | [
2,
1886,
2395,
16355,
107,
52,
799,
170,
1375,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
13,
1,
1958,
8810,
22560,
1,
20,
6305,
8,
10543,
21,
2741,
365,
15,
1797,
25,
45,
932,
11364,
5167,
165,
1,
150,
10129,
5,
23793,
2660,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Bootstrap Carousel v2.0.4 restarts on mouseleave event
===
jQuery v 1.7.2,
Bootstrap v 2.0.4 (downloaded standard file from homepage this morning)
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script>$('#myCarousel').carousel({interval: false})</script>
I've seen lots of questions about this but [according to the official Bootstrap blog][1] (items 5 and 10 under the heading 'Javascript'), this issue was supposed to be resolved in v2.0.3.
I've added an interval false to the call, since this is supposed to (according to the docs) prevent it from sliding unless the user clicks the prev/next links.
At first this works fine: page loads, no sliding, user clicks next link, transitions nicely to the next slide. But if the user moves the mouse away from the container #myCarousel, then the sliding action starts automating again.
What's going on? I would really like the slide action to be under user control.
[1]: http://blog.getbootstrap.com/2012/04/bootstrap-2-0-3-released/ | 0 | [
2,
5894,
16514,
27374,
566,
135,
9,
387,
9,
300,
22767,
18,
27,
7567,
14416,
807,
800,
3726,
3726,
487,
8190,
93,
566,
137,
9,
465,
9,
135,
15,
5894,
16514,
566,
172,
9,
387,
9,
300,
13,
5,
2968,
22546,
1236,
3893,
37,
213,
64... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Correctly decoding/encoding raw PCM data
===
I'm writing my WAVE decoder/encoder in C++. I've managed to correctly convert between different sample sizes (8, 16 and 32), but I need some help with the channels and the frequency.
**Channels:**
If I want to convert from stereo to mono:
1. do I just take the data from one channel (which one? 1 or 2?)?
2. or do I take the average from channel 1 and 2 for the mono channel.
If I want to convert from mono to stereo:
(I know this is not very scientific)
1. can I simply add the samples from the single channels into both the stereo channels?
2. is there a more scientific method to do this (eg: interpolation)?
**Sample rate:**
How do I change the sample rate (resample), eg: from 44100Hz to 22100Hz:
1. do I simply take the average of 2 sequential samples for the new (lower frequency) value?
2. Any more scientific algorithms for this? | 0 | [
2,
12044,
121,
15458,
118,
219,
15458,
4333,
5168,
79,
1054,
800,
3726,
3726,
31,
22,
79,
1174,
51,
2367,
12015,
1157,
118,
219,
716,
1157,
19,
272,
20512,
9,
31,
22,
195,
1471,
20,
12044,
8406,
128,
421,
5717,
13403,
13,
5,
457,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Load a div into a webview on Android
===
I have an android app, wich contains a WebView, and I would like to display in it not a webpage, but only a div from that webpage. I should mention that I do not have access to that page.
Thank you! | 0 | [
2,
6305,
21,
13,
12916,
77,
21,
2741,
4725,
27,
13005,
800,
3726,
3726,
31,
57,
40,
13005,
4865,
15,
13,
13583,
1588,
21,
2741,
4725,
15,
17,
31,
83,
101,
20,
3042,
19,
32,
52,
21,
2741,
6486,
15,
47,
104,
21,
13,
12916,
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... |
access iframe content from a chrome's extension content script
===
I'm doing a plugin to do some transformations to the interface. I keep getting "unsafe javascript attempt to access frame with url.... Domains, protocols and ports must match" (typical cross site issue)
But being an extension it should have access to the iframe's content http://code.google.com/chrome/extensions/content_scripts.html ...
Doesn anyone know how to access it's contents so they can be capturable? | 0 | [
2,
1381,
31,
8361,
2331,
37,
21,
13,
12985,
22,
18,
3896,
2331,
3884,
800,
3726,
3726,
31,
22,
79,
845,
21,
10922,
108,
20,
107,
109,
6978,
18,
20,
14,
6573,
9,
31,
643,
1017,
13,
7,
1020,
18166,
8247,
8741,
1735,
20,
1381,
35... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error using rake for rails 1.2.3 on rails 3.2
===
I am trying to install a rails 1.2.3 app on my machine. My machine is currently using rails 3.2.6 , ruby 1.9.3 and windows 7. While trying to use 'RAKE', I am getting the following error
WARNING: 'require 'rake/rdoctask'' is deprecated.
Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
How shall I figure out the problem in order to be able to use my application. | 0 | [
2,
7019,
568,
21009,
26,
2240,
18,
137,
9,
135,
9,
240,
27,
2240,
18,
203,
9,
135,
800,
3726,
3726,
31,
589,
749,
20,
16146,
21,
2240,
18,
137,
9,
135,
9,
240,
4865,
27,
51,
1940,
9,
51,
1940,
25,
871,
568,
2240,
18,
203,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 return sets of values based on condition in SQL Server 2005?
===
I am a beginner in SQL server 2005 stored procedure(sp). I can't seem to get it working as wanted.
I have a sp that takes in parameter @caseid from a table called "annot". @caseid is assigned to value of column "src_caseid" and can have multiple references ("ref_caseid") or none in table "annot". I want to set a condition and set proper shepardsflag depending on the column "court" from table "case" which I did using INNER JOIN.
Basically this is the scenario:
**Table "annot"** - ref_caseid, src_caseid, annotation
**Table "case"** - caseid, court
Example of set of results from the INNER JOIN on **ref_caseid = caseid** as below:
>>ref_caseid|src_caseid|annotation|court
>>17334|17338|Refd|high court
>>17600|17338|Foll|federal court
>>18271|17338|Foll|federal court
>>43220|17338|Not Foll|supreme court
**Condition to be set:**
From the recordset, if "federal court" exist, it should only take records of "federal court". If NO "federal court" is found, then it will take other cases with other court values.
To achieve this, I set a counter for "federal court" counts. But seems that SQL only reads the last record and set @courtFC value based on it. I've tried 'order by' but doesn't seem working as well.
From sample above, the final shepardsflag value of case 17338 should be = 3 (Foll) as it should take rows with "federal court" only AND ignore the rest of the rows.
But the current result is shepardsflag = 2 ; which is wrong
I hope I explain well.
Can someone please help me on the right logic? Should I create a temp table? Thanks in advance.
**Script:**
ALTER PROCEDURE [dbo].[spUpdateShepardsFlags] @caseid int = null AS
begin
declare @Shep int
declare @ref_caseid int
declare @court int
declare @courtFC int
declare @annot int
if @caseid is not null
begin
select @court = b.court, @ref_caseid = a.ref_caseid, @annot = a.annotation
from cba_annot a inner join cbm_case b on a.ref_caseid = b.caseid
where a.src_caseid = @caseid
if @court is not null
begin
if @court = 'MYFC'
set @courtFC = @courtFC + 1
if @court <> 'MYFC'
SET @courtFC = @courtFC + 0
PRINT 'The @courtFC counter : ' + CAST(@courtFC AS CHAR)
end
if @court is not NULL
begin
if @courtfc > 0
begin
if exists(select a.ref_caseid, b.court, a.annotation, a.src_caseid from
cba_annot a inner join cbm_case b on a.ref_caseid = b.caseid)
begin
if exists(select src_caseid from cba_annot where (annotation like '%Refd%'
or annotation like '%Comp%')
and src_caseid = @caseid)
set @Shep = 4
if exists(select src_caseid from cba_annot where (annotation like '%Foll%'
or annotation like '%Aff%')
and src_caseid = @caseid)
set @ShepFC = 3
update cbm_case
set shepardsflag = @shep
where caseid=@caseid
end
end
else -- if @courtFC = 0
begin --new
if exists(select a.ref_caseid, b.court, a.annotation, a.src_caseid from
cba_annot a inner join cbm_case b on a.ref_caseid = b.caseid)
begin
if exists(select src_caseid from cba_annot where (annotation like '%Refd%'
or annotation like '%Comp%')
and src_caseid = @caseid)
set @Shep = 4
if exists(select src_caseid from cba_annot where (annotation like '%Foll%'
or annotation like '%Aff%')
and src_caseid = @caseid)
set @Shep = 3
if exists(select src_caseid from cba_annot where (annotation like '%Not Foll%'
or annotation like '%Dist%')
and src_caseid = @caseid)
set @Shep = 2
update cbm_case
set shepardsflag = @shep
where caseid=@caseid
end
end -- new
end
else --- if court is NULL -- case not referred by any other case
update cbm_case
set shepardsflag = 5
where caseid=@caseid
end
else -- if caseid is null
-- other condition
| 0 | [
2,
184,
20,
788,
3415,
16,
4070,
432,
27,
2874,
19,
4444,
255,
8128,
812,
60,
800,
3726,
3726,
31,
589,
21,
26931,
19,
4444,
255,
8128,
812,
8214,
7004,
5,
3401,
6,
9,
31,
92,
22,
38,
2260,
20,
164,
32,
638,
28,
417,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CakePHP 2.1: Using Set to search for a value
===
If have a rather big multidimensional array of the following form (flickr EXIF data).
array(
(int) 81 => array(
'tagspace' => 'Nikon',
'tagspaceid' => (int) 0,
'tag' => 'ISOExpansion2',
'label' => 'ISOExpansion2',
'raw' => 'Off'
),
(int) 82 => array(
'tagspace' => 'Nikon',
'tagspaceid' => (int) 0,
'tag' => 'LensType',
'label' => 'Lens Type',
'raw' => 'G'
),
(int) 83 => array(
'tagspace' => 'Nikon',
'tagspaceid' => (int) 0,
'tag' => 'Lens',
'label' => 'Lens',
'raw' => '11-16mm f/2.8'
),...
)
Is there a fast and efficient way to extract arrays with certain values, i.e. I would be looking for the value 'Lens' of the key 'Tag' and get an array as return value:
array(
'tagspace' => 'Nikon',
'tagspaceid' => (int) 0,
'tag' => 'Lens',
'label' => 'Lens',
'raw' => '11-16mm f/2.8'
)
Also, can this be done using Set? I have only achieved the following by using `$extract = Set::classicExtract($exifarray, '{n}.tag')`:
array(
(int) 81 => 'ISOExpansion2',
(int) 82 => 'LensType',
(int) 83 => 'Lens',...
) | 0 | [
2,
8390,
26120,
172,
9,
165,
45,
568,
309,
20,
2122,
26,
21,
1923,
800,
3726,
3726,
100,
57,
21,
864,
580,
1889,
7865,
7718,
16,
14,
249,
505,
13,
5,
410,
10129,
139,
1396,
821,
1054,
6,
9,
7718,
5,
13,
5,
6391,
6,
9871,
800... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Maven runtime scope and cyclic dependency
===
I have two module A and B. Actualy B is plugin to A.
B depends on A in compile time. A NOT depend on B.
On A runtime I want to add B to classpath, so in A's pom.xml I add the following dependency
<dependency>
<groupId>my_group</groupId>
<artifactId>my_Plugin</artifactId>
<version>${project.version}</version>
<scope>runtime</scope>
</dependency>
Maven process fail with cyclic dependency error
[ERROR] The projects in the reactor contain a cyclic reference: Edge between 'Vertex{label='A'}' and 'Vertex{label='B'}' introduces to cycle in the graph B-->A-->B -> [Help 1]
[ERROR]
Why runtime dependency impact compile time ? | 0 | [
2,
1216,
3124,
485,
891,
9914,
17,
13,
15888,
26835,
800,
3726,
3726,
31,
57,
81,
12613,
21,
17,
334,
9,
3463,
93,
334,
25,
10922,
108,
20,
21,
9,
334,
9597,
27,
21,
19,
26561,
85,
9,
21,
52,
12547,
27,
334,
9,
27,
21,
485,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Trailing Slash in ASP.NET MVC 4 Route to Application Root
===
In my ASP.NET MVC 4 application's `RouteConfig` file, I have registered the following default route:
routes.MapRoute("Default", "{controller}/{action}/{id}",
new { controller = "home", action = "index", id = UrlParameter.Optional });
Now, in my Razor views, I want to generate a URL to my application's root like that:
<a href="@Url.Action("index", "home")">Home</a>
The generated URL includes a trailing slash; clicking the link thus opens the page *localhost/IISApplicationName*/. However, I want the URL not to contain the trailing slash so that the URL is *localhost/IISApplicationName*. Generating routes for other actions, such as */Account/Login*, does not create URLs with trailing slashes — it's just about the route linking to my application's root.
**Is there any way to prevent ASP.NET MVC routing from appending the trailing slash to the above route?**
(I know that I can redirect from the URL including the slash to the one without it, but I'd rather have routing generate the correct route URL in the first place.) | 0 | [
2,
4681,
14323,
14098,
19,
28,
306,
9,
2328,
307,
8990,
268,
858,
20,
3010,
5900,
800,
3726,
3726,
19,
51,
28,
306,
9,
2328,
307,
8990,
268,
3010,
22,
18,
13,
1,
20179,
14093,
2816,
1,
3893,
15,
31,
57,
3801,
14,
249,
12838,
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... |
perl Win32::OLE word - getting the ReadOnlyRecommended value of the opened word document
===
I am trying to get the ReadOnlyRecommended property of a opened word document. The reason I need this is, I am opening an already opened windows file (by someother client) on a remote share through OLE and expect the ReadOnlyRecommended to be set as True. Is it possible to achieve what I am trying to achieve? What would be the approach to get the value.
Can I use $word->ActiveDocument->ReadOnlyRecommended to get the value (which is not working by the way)
Regards,
Anand. | 0 | [
2,
416,
255,
628,
3125,
45,
45,
6069,
833,
13,
8,
1017,
14,
1302,
4965,
99,
960,
79,
10726,
1923,
16,
14,
520,
833,
4492,
800,
3726,
3726,
31,
589,
749,
20,
164,
14,
1302,
4965,
99,
960,
79,
10726,
1354,
16,
21,
520,
833,
4492... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Testing Android apk with JUnit on diffrent emulator
===
I would like to ask you: If there is a possibility to test your apk file with JUnit/Robotium on (example) 3 different OS emulators on the same time or serial testing (open emulator, do testing, close emulator, open different emulator, do testing ...) ?
I am developing on eclipse. I where trying: project properties -> Run/debug settings -> target ->Lunch on all compatible devies (is disable) how can I pick this option?
Thanks. | 0 | [
2,
4431,
13005,
21,
17244,
29,
7446,
242,
27,
20811,
8993,
3579,
14868,
800,
3726,
3726,
31,
83,
101,
20,
1349,
42,
45,
100,
80,
25,
21,
4813,
20,
1289,
154,
21,
17244,
3893,
29,
7446,
242,
118,
661,
6813,
2187,
27,
13,
5,
29041... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Facebook App Canvas Resize
===
Im trying to resize the canvas app iFrame size - it lets me adjust the height but not the width, the width is always set to 520px and height to 900px;
The documentation shows how you can set the canvas app settings through the developer apps but the settings are not there for me, how weird. I've tried autoResize, autoGrow and other options, running out of ideas here now.
This is the code that i am using;
<div id="fb-root"></div>
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script>
FB.init({
appId: 'my_app_id',
status: true, // check login status
cookie: true, // enable cookies to allow the server to access the session
xfbml: true // parse XFBML
});
</script>
<script type="text/javascript">
window.fbAsyncInit = function () {
FB.Canvas.setAutoResize(true);
}
</script> | 0 | [
2,
9090,
4865,
9696,
302,
10454,
800,
3726,
3726,
797,
749,
20,
302,
10454,
14,
9696,
4865,
31,
8361,
1072,
13,
8,
32,
6884,
55,
14328,
14,
2947,
47,
52,
14,
9456,
15,
14,
9456,
25,
550,
309,
20,
13,
19467,
306,
396,
17,
2947,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Extract text from String
===
I have one String and into this string I have a url between two characters # such as "Hello world #http://thisurl# my name is Pippo" I want to take the url (http://thisurl) between two #.
How can I do ? Thanks | 0 | [
2,
10962,
1854,
37,
3724,
800,
3726,
3726,
31,
57,
53,
3724,
17,
77,
48,
3724,
31,
57,
21,
287,
6362,
128,
81,
1766,
6926,
145,
28,
13,
7,
11515,
126,
6926,
21127,
6903,
1565,
911,
255,
5910,
51,
204,
25,
11280,
1638,
7,
31,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Find How many times does a request hit the OutputCache for a particular page?
===
I am in a situation where one of the things I have to consider is remove OutputCaching on one of the pages. Currently, the OutputCache directive is set on the page as follows
<%@ OutputCache Duration="300" VaryByParam="*" %>
But this is interfering with setting the Vary HttpHeader and thus I am considering removing it. Mostly as VaryByParam="*" I am not really sure how many versions of the output of the page are cached and how many times is the cache hit vs processing the page.
Is there any way I can find this out? Basically, I want to know what could be the perf hit if the OutputCaching is removed. I am already caching the data objects the page uses to render. | 0 | [
2,
477,
184,
151,
436,
630,
21,
3772,
770,
14,
5196,
793,
2569,
26,
21,
1498,
2478,
60,
800,
3726,
3726,
31,
589,
19,
21,
1858,
113,
53,
16,
14,
564,
31,
57,
20,
3563,
25,
4681,
5196,
793,
7192,
27,
53,
16,
14,
4434,
9,
871,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to use library in maven repo for clojure project?
===
I use lein to manage my clj project. When i want to wrap a java library, i found that i have to introduce it to my project firstly.
How can i use a library in maven repo in my project? | 0 | [
2,
184,
20,
275,
1248,
19,
1216,
3124,
302,
1638,
26,
7383,
2142,
99,
669,
60,
800,
3726,
3726,
31,
275,
13,
13535,
20,
4705,
51,
272,
15664,
669,
9,
76,
31,
259,
20,
8118,
21,
8247,
1248,
15,
31,
216,
30,
31,
57,
20,
8500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hooking RtlAllocateHeap ending up in infinite recursion
===
While allocating memory inside my hooked hookedRtlAllocateHeap function due to infinite recursion program is crashing.. How can I prevent it? | 1 | [
2,
5559,
68,
761,
7786,
19452,
9530,
438,
2552,
3119,
71,
19,
9698,
26604,
5991,
800,
3726,
3726,
133,
65,
2499,
1880,
1912,
572,
51,
14988,
14988,
5256,
531,
6880,
9530,
438,
2552,
1990,
397,
20,
9698,
26604,
5991,
625,
25,
14604,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to correctly stop a Callable submitted to ExecutorService
===
I'm trying to implement a sample application to test `Callable` and `ExecutorService` interfaces.
In my app I have declared:
ExecutorService exSvc = Executors.newSingleThreadExecutor();
Then:
Future<Integer> test = exSvc.submit(
new Callable<Integer>() {
public Integer call() {
for(int i = 0; i < 1000; i++){
System.out.println(i);
}
return 1;
}
});
Now I'm trying to stop the process before it terminate, I'm using `exSvc.shutdownNow()` but it doesn't work.
To stop gracefully a classical `Thread` I usually use some kind of _condition variable_. Which is a common approach to follow with `ExecutorService`? | 0 | [
2,
184,
20,
12044,
747,
21,
645,
579,
7368,
20,
1396,
17194,
2153,
11449,
800,
3726,
3726,
31,
22,
79,
749,
20,
8713,
21,
5717,
3010,
20,
1289,
13,
1,
9200,
579,
1,
17,
13,
1,
1706,
17194,
2153,
11449,
1,
6573,
18,
9,
19,
51,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
C# Structs with FieldOffsetValue(0)
===
I am currently doing some reading on structs and came across an example of structs being used with attributes. In the example the struct attribute being used is [FieldOffset(0)] which it says makes sure the fields are stored in the same piece of memory. What is the advantage(s) or disadvantage(s) of this? Also why would one want to use the FieldOffset attribute to put the fields in different parts of memory? | 0 | [
2,
272,
5910,
13,
10346,
18,
29,
575,
1299,
3554,
15165,
5,
387,
6,
800,
3726,
3726,
31,
589,
871,
845,
109,
1876,
27,
13,
10346,
18,
17,
281,
464,
40,
823,
16,
13,
10346,
18,
142,
147,
29,
13422,
9,
19,
14,
823,
14,
13,
103... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
passing parameters to batch from java works but without result
===
I'm trying to add version control to my web server (on windows, I know...) and I need to use a batch script to do automatic adds and commits. Here is what I have now :
public static void bzr_add(String path, String commit) throws IOException {
ProcessBuilder pb = new ProcessBuilder(scripts + "bzr_add.bat", storage, path, "\"" + commit + "\"");
Process p = pb.start();
String line;
BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream()));
while ((line = r.readLine()) != null) {
System.out.println(line);
}
r.close();
try {
p.waitFor();
} catch (InterruptedException ex) {
Logger.getLogger(local.class.getName()).log(Level.SEVERE, null, ex);
}
}
With "scripts" being the directory where the script can be found, "storage" the storage directory and "path" the path of the new file.
The batch script :
cd %1
bzr add %2
bzr commit -m %3
And what I obtain :
Infos: C:\Program Files\glassfish-3.1.2\glassfish\domains\domain1>cd c:\storage_dir\
Infos: C:\storage_dir>bzr add "dir\file.ext"
Infos: C:\storage_dir>bzr commit -m "commit_message"
So it seems ok, and when I copy this in the cmd shell it works (it also works when I do bzr_add.bat par1 par2 par3 in the shell). And if I modify the script to create new files, they are created in the correct directory so something is executed correctly.
But bazaar doesn't seem to agree on that when I execute the script through java, any guesses ? | 0 | [
2,
2848,
12905,
20,
13064,
37,
8247,
693,
47,
366,
829,
800,
3726,
3726,
31,
22,
79,
749,
20,
3547,
615,
569,
20,
51,
2741,
8128,
13,
5,
218,
1936,
15,
31,
143,
9,
9,
9,
6,
17,
31,
376,
20,
275,
21,
13064,
3884,
20,
107,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
adb shell on my phone device: weird characters appear
===
I have a Samsung Galaxy S with DarkyRom 10.4.2 XWJW1 (Android 2.3.6) and root access. I'm implementing an application and I wanted to execute it in my phone using eclipse, but I get the error: ActivityManager: /sbin/sh: am: not found. I tried to use adb shell to see what's going on, and if I use ls I get:
<-[1;34macct<-[0m
<-[1;34mcache<-[0m
<-[1;34mconfig<-[0m
...
I read here in stackoverflow that the am error could be because of a missing line in am file. I used busybox vi am and this is what I get:
<-999;999H<-[6n<-[1;1H<-[J
~
~
~
...
~
~<-[1;1H<-[24;1H<-[K- am 1/1 100%<-[1;1H
Does someone know why these weird characters appear? How can I fix it? | 0 | [
2,
21,
9007,
3593,
27,
51,
1132,
3646,
45,
5455,
1766,
1893,
800,
3726,
3726,
31,
57,
21,
22981,
9358,
13,
18,
29,
659,
93,
8541,
332,
9,
300,
9,
135,
993,
499,
728,
499,
165,
13,
5,
290,
18524,
172,
9,
240,
9,
379,
6,
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... |
Hash login then search it with linq
===
I'm writing a piece of code with linq which has to hash a string (in that case my login) and then try to find it into my database.
I tried :
var userFind = context.Users.FirstOrDefault(user =>HashHelper.HashCode(user.Login).Equals(u.Login));
I got an error because of the HashCode.
I wouldn't read all of my list with a foreach. I'm wondering if it's possible to do so with on ligne of code.
Regards. | 0 | [
2,
19170,
6738,
108,
94,
2122,
32,
29,
6294,
1251,
800,
3726,
3726,
31,
22,
79,
1174,
21,
1855,
16,
1797,
29,
6294,
1251,
56,
63,
20,
19170,
21,
3724,
13,
5,
108,
30,
610,
51,
6738,
108,
6,
17,
94,
1131,
20,
477,
32,
77,
51,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Two virtually identical pieces of jquery code working differently
===
In the example (see link) three of the four buttons open up a lightbox. The sequence is as follows:
1. User Clicks
2. Background fades to black
3. Lightbox Appears
4. Lightbox content fades in
This should happen every time the user clicks on the link, even if they have already opened that lightbox previously. For two of the links (top right and bottom left) it works just fine, but for the other one (top left) it works fine the first time the user clicks but after closing the lightbox and reopening, the content is already there and appears to 'fly in' from the right. The code for the lightboxes is identical, apart from ID tags.
Why is this happening?!!
The link to view is:
http://testing.xenongroupadmin.com/whatis/pfi/#
and the Jquery code is:
$(document).ready(function(){
$("a#show-whopanel").click(function(){
$("#lightbox").fadeIn(300, function(){
$("#who-panel").show(600, function(){
$("#animation1").fadeIn(1000)
});
});
});
$("a#close-panel1").click(function(){
$("#lightbox, #who-panel").fadeOut(300, function(){
$("div#animation1").hide(300);
}
);
});
});
$(document).ready(function(){
$("a#show-whatpanel").click(function(){
$("#lightbox").fadeIn(300, function(){
$("#what-panel").show(600, function(){
$("#animation2").fadeIn(1000)
});
});
});
$("a#close-pane2").click(function(){
$("#lightbox, #what-panel").fadeOut(300, function(){
$("div#animation2").hide(600);
}
);
});
});
$(document).ready(function(){
$("a#show-prosconspanel").click(function(){
$("#lightbox").fadeIn(300, function(){
$("#proscons-panel").show(600, function(){
$("#animation3").fadeIn(1000)
});
});
});
$("a#close-panel3").click(function(){
$("#lightbox, #proscons-panel").fadeOut(300, function(){
$("div#animation3").hide(600);
}
);
});
}); | 0 | [
2,
81,
9149,
6323,
2491,
16,
487,
8190,
93,
1797,
638,
12670,
800,
3726,
3726,
19,
14,
823,
13,
5,
1798,
3508,
6,
132,
16,
14,
222,
12861,
368,
71,
21,
471,
5309,
9,
14,
4030,
25,
28,
2415,
45,
137,
9,
4155,
10840,
18,
172,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 hide lines between rows in JQGrid TreeGrid
===
How do you hide the lines between a JQGrid TreeGrid?
I've tried:
<table id="TreeGrid" style="border-bottom: 0px none;border-right: 0px none;">
</table>
But that doesn't work for me. | 0 | [
2,
184,
20,
3077,
1560,
128,
11295,
19,
487,
1251,
16375,
1541,
16375,
800,
3726,
3726,
184,
107,
42,
3077,
14,
1560,
128,
21,
487,
1251,
16375,
1541,
16375,
60,
31,
22,
195,
794,
45,
13,
1,
5924,
4924,
3726,
7,
8101,
16375,
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... |
Map joomla to an old database
===
I have a database which I used to install joomla 1.7.Unfortunately I lost the joomla folder which i had kept on htdocs.I want to install another joomla but use the old database.I have tried to install another joomla and connect to the database old database I had used but it seems that a new site is being created.Is there any way I can use to map the joomla website to the database?I don want to repeat the same work of creating another website. | 0 | [
2,
2942,
2640,
2636,
531,
20,
40,
315,
6018,
800,
3726,
3726,
31,
57,
21,
6018,
56,
31,
147,
20,
16146,
2640,
2636,
531,
137,
9,
465,
9,
1020,
6469,
1020,
1373,
102,
31,
529,
14,
2640,
2636,
531,
19294,
56,
31,
41,
1025,
27,
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... |
Why gif animation doesn't animate when using it in paintComponent()?
===
I'm using `paintComponent()` to paint a gif animated image at the backgound of `JPanel`.
It shows up the gif but doesn't animate.
I use java 1.5 and i know that i can use label with icon.
**Does any body know why and how to fix it?**
private static class CirclePanel extends JPanel {
ImageIcon imageIcon = new ImageIcon(BarcodeModel.class.getResource("verify.gif"));
Point point = f.getLocation();
protected void paintComponent(Graphics g) {
Graphics gc = g.create();
Graphics2D g2d = (Graphics2D) g.create();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.3f));
g2d.setColor(Color.BLUE);
g2d.drawImage(imageIcon.getImage(), getWidth() / 2, getHeight() / 2, null);
g2d.drawRect(0, 0, getWidth(), getHeight());
g2d.setStroke(new BasicStroke(10f,BasicStroke.CAP_ROUND,BasicStroke.JOIN_MITER));
g2d.setFont(g.getFont().deriveFont(Font.BOLD | Font.ITALIC,15f));
g2d.drawString("Wait Please ...",getWidth()/2-imageIcon.getIconHeight()/3,getHeight()/2+imageIcon.getIconHeight()+15);
g2d.dispose();
}
This is the gif image.
![enter image description here][1]
[1]: http://i.stack.imgur.com/DZ6j5.gif | 0 | [
2,
483,
489,
821,
6236,
1437,
22,
38,
14487,
591,
76,
568,
32,
19,
5107,
11103,
218,
2291,
5,
6,
60,
800,
3726,
3726,
31,
22,
79,
568,
13,
1,
20578,
11103,
218,
2291,
5,
6,
1,
20,
5107,
21,
489,
821,
5784,
1961,
35,
14,
97,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Making a control to be visible only for a particular amount of time in c#
===
I am developing an application where i need the following requirement:
Suppose i have a button and a label (initially visibility set to false) in my form, and user clicks on the button, then the label should be displayed with some text that i assign to the label in the button click. But this label should be displayed only for some time, say some 3 secs and then it should automatically go invisible. For this if i gave:
private void button1_Click(object sender, EventArgs e)
{
label1.Visible=true;
label1.Text= "Magic";
Thread.Sleep(3000);
label1.Visible=false;
}
This code does not help the purpose. What is the approach to do it?
| 0 | [
2,
544,
21,
569,
20,
44,
4560,
104,
26,
21,
1498,
2006,
16,
85,
19,
272,
5910,
800,
3726,
3726,
31,
589,
3561,
40,
3010,
113,
31,
376,
14,
249,
8981,
45,
5787,
31,
57,
21,
5167,
17,
21,
1899,
13,
5,
27313,
102,
19476,
309,
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... |
Bootstrap js file not working in magento page
===
I have implementing bootstrap scrollspy in magento my custom template file.
But Bootstrap scrollspy js file not working in my custom template file.
I have call my bootstrap Js file from **`/js/bootstrap`**
So how do i fix this kind of issues? Can any one help me for this one?
Thanks
| 1 | [
2,
5894,
16514,
487,
18,
3893,
52,
638,
19,
4723,
17050,
2478,
800,
3726,
3726,
31,
57,
17333,
5894,
16514,
12159,
18,
6448,
19,
4723,
17050,
51,
5816,
22894,
3893,
9,
47,
5894,
16514,
12159,
18,
6448,
487,
18,
3893,
52,
638,
19,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
CSS aware intelligent html parser for python
===
I'm looking for a HTML parser which is css aware and works same way a browser renders html. I'm actually looking for equivalent of element.innerText (DOM-JS).
Let me give a example. consider the following html,
<style>
.AAA { display:inline;}
.BBB { display:none;}
.CCC { display:inline ;}
</style>
<span id="sarim">
<span class="AAA">a</span>
<span style="display:none">b</span>
c
<span class="CCC">d</span>
<div style="display:inline">e</div>
<span class="BBB">f</span>
</span>
Now If i run the above html in a browser and run `document.getElementById('sarim').innerText` is returns "a c d e". Thats exactly what i need. But if i use a html parser and strip the html tags it would return "abcdef". I need a parser which will automatically ignore "b" and "f" reading their css property.
Any idea which parser supports this ? I tried Beautiful soap,
hiddenelements = sarim.findAll(True, {'style' : 'display:none'})
for p in hiddenelements:
p.extract()
Now `sarim.text` returns the text but this only works for inline style and this is manual process which fails for the css class based styles, and as the classes will be random, i'm looking for a intelligent parser which will automatically do this.
I got a failsafe idea to run a headless wekbit (phantomjs.org) and use element.innerText to retrive the visible text, Any better idea ? | 0 | [
2,
272,
18,
18,
3854,
9214,
13,
15895,
2017,
4104,
26,
20059,
800,
3726,
3726,
31,
22,
79,
699,
26,
21,
13,
15895,
2017,
4104,
56,
25,
272,
18,
18,
3854,
17,
693,
205,
161,
21,
16495,
16535,
18,
13,
15895,
9,
31,
22,
79,
1121,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 display ad hoc constraints form validation messages?
===
ScalaForms
==============
In the example linked [here][1] there is this example about form validation:
// You can also define ad-hoc constraints on the fields:
val loginForm = Form(
tuple(
"email" -> nonEmptyText,
"password" -> text
) verifying("Invalid user name or password", fields => fields match {
case (e, p) => User.authenticate(e,p).isDefined
})
)
Via binding errors some constraints are displayed in my form. (Like the `nonEmptyText`, that gets a extra line behind the field stating `This field is required`. See:
loginForm.bindFromRequest.fold(
formWithErrors => // binding failure, you retrieve the form containing errors,
value => // binding success, you get the actual value
)
If I do a `.toString` to the `formWithErrors` i get this for the `nonEmptyText` constraint:
Form(ObjectMapping2(<function2>,<function1>,(Email adress,FieldMapping(,List(Constraint(Some(constraint.required),WrappedArray())))),(Password,FieldMapping(,List(Constraint(Some(constraint.required),WrappedArray())))),,List(Constraint(None,List()))),Map(Password -> test, Email adress -> ),List(FormError(Email adress,error.required,WrappedArray())),None)
The latter part is a [FormError][2] List: `List(FormError(Email adress,error.required,WrappedArray())),None)` which is a case class: `case class FormError (key: String, message: String, args: Seq[Any])` where `key` is defined as: `The error key (should be associated with a field using the same key).`.
The FieldConstructor picks this up and makes the 'Email adress' input box go red and add the error message ('This field is required').
Displaying the ad hoc constraints?
-----------------
So when the form fields are all filled the username and password are checked:
verifying("Invalid user name or password", fields => fields match {
case (e, p) => User.authenticate(e,p).isDefined
})
But i dont know how to display the 'Invalid user name or password' to the user. The `.toString` of the `FormError` List of `formWithErrors` is:
List(FormError(,Invalid user name or password,WrappedArray())),None)
The `Key` part is empty.
Question
-----------------
How do i display the ad hoc error?
I even tried:
BadRequest( views.html.test( formWithErrors ) ).flashing( "error" -> "Invalid user name or password." ) },
but for some reason its not working via the Flash either :(. This `@flash.get("error").getOrElse("no 'error'")` gives me 'no error' each time.
[1]: http://www.playframework.org/documentation/2.0.2/ScalaForms
[2]: http://www.playframework.org/documentation/api/2.0/scala/play/api/data/FormError.html | 0 | [
2,
184,
20,
3042,
21,
43,
21061,
16747,
505,
27999,
7561,
60,
800,
3726,
3726,
25975,
4190,
18,
800,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
3726,
19,
14,
823,
4727,
636,
6836,
500,
2558,
165,
500,
80... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
this left join query is too slow
===
my query is below,
select count(a.id) from users as a right join date_log as b on a.id = b.user_id WHERE
b.meeting_date BETWEEN '2012-06-01' AND date_add('2012-06-01',interval 1 month)
group by a.id
but, it's too slow when I try to select data from large database.
I added 'group by' terms in the query for removing duplicated ids.
is there better way to do this job?
| 0 | [
2,
48,
225,
1865,
25597,
25,
266,
2276,
800,
3726,
3726,
51,
25597,
25,
1021,
15,
5407,
2468,
5,
58,
9,
1340,
6,
37,
3878,
28,
21,
193,
1865,
1231,
1,
5567,
28,
334,
27,
21,
9,
1340,
800,
334,
9,
16704,
1,
1340,
113,
334,
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... |
Multiple foreign keys to the same table in Cake PHP?
===
Cake has its conventions for automating some functionality interaction between it's models and the tables they reference. Foreign keys should be called people_id, if they reference a table called people. How do I handle a case where a row holds two people, and needs foreign keys for both people? It's obvious that I can duplicate the column names, having two people_id columns.
Consider a competition where you have two competitors. Each competitor is represented by a row in the competitor's table. The competitions table needs to refer to both of those competitors. How can I do this wouldn't breaking the automatic functionality that Cake offers?
| 0 | [
2,
1886,
1228,
5534,
20,
14,
205,
859,
19,
8390,
13,
26120,
60,
800,
3726,
3726,
8390,
63,
82,
15117,
26,
3108,
79,
1880,
109,
18548,
7754,
128,
32,
22,
18,
2761,
17,
14,
7484,
59,
2801,
9,
1228,
5534,
378,
44,
227,
148,
1,
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... |
Entity Framework code first many-to-many mapping table
===
I have a question about Entity Framework Code First many-to-many relationships.
From examples that I have seen online and in a Programming Entity Framework CodeFirst book, when you have a collection on both classes EF would create a mapping table such as MembersRecipes and the primary key from each class would link to this table.
However when I do the below, I instead get a new field in the recipes table called Member_Id and a Recipe_Id in the Members table.
Which only creates two one-to-many relationships, but not a many-to-many so I could have Member 3 linked to recipes (4,5,6) or recipe 4 linked to members (1,2,3) etc.
Is there a way to create this mapping table? and if so how do you name it something else such as "cookbooks" ?
Thanks
public abstract class Entity {
[Required]
public int Id { get; set; }
}
public class Member : Entity {
[Required]
public string Name { get; set; }
public virtual IList<Recipe> Recipes { get; set; }
}
public class Recipe : Entity {
[Required]
public string Name { get; set; }
[ForeignKey("Author")]
public int AuthorId { get; set; }
public virtual Member Author { get; set; }
....
public virtual IList<Member> Members { get; set; }
} | 0 | [
2,
9252,
6596,
1797,
64,
151,
8,
262,
8,
14842,
13305,
859,
800,
3726,
3726,
31,
57,
21,
1301,
88,
9252,
6596,
1797,
64,
151,
8,
262,
8,
14842,
5833,
9,
37,
3770,
30,
31,
57,
541,
2087,
17,
19,
21,
3143,
9252,
6596,
1797,
3552... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make friendly url in liferay
===
I have my portlet placed in a page and the portlet is rendering with the values from the url parameters. but I need to hide the values and show friendly url..
check this url...
> http://betatest.businessworld.in/web/guest/storypage?CategoryID=37489&articleId=215754&version=1.1&journalArticleId=218207
Please help | 0 | [
2,
184,
20,
233,
4753,
287,
6362,
19,
201,
2787,
800,
3726,
3726,
31,
57,
51,
1295,
1336,
1037,
19,
21,
2478,
17,
14,
1295,
1336,
25,
15307,
29,
14,
4070,
37,
14,
287,
6362,
12905,
9,
47,
31,
376,
20,
3077,
14,
4070,
17,
298,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Making a mess of read and write
===
Ok what I am trying to do is read from one .text file to another text file using a button. So it's event driven but i have to reverse the output.
I am coding in netbeans because I am a newb and it is helpfull.
I have been working on this for a couple of days trying to find clear info on the web but I am having a hard time and now my code I think looks worse than when I started so please point out why what I am doing is wrong.
Thank you so much in advance for any advice that you can give.
Here is my button.
private void ReadButtonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
int x ;
Vector<String> readOrder = new Vector<String>();
try {
Scanner i = new Scanner(new FileReader("Out.txt"));
while( i.hasNextInt()){
x = i.nextInt();
readOrder.add(new Integer(x));
}
try {
try (BufferedWriter out = new BufferedWriter(new FileWriter("Outfile.txt")));
out.append(" " + x);
out.close();
}
i.close();
}
catch (Exception e ){}
for(int i = readOrder.size()-1 ; i >= 0 ; i-- )
System.out.println( readOrder.elementAt( i ).intValue() );
}
| 0 | [
2,
544,
21,
3957,
16,
1302,
17,
2757,
800,
3726,
3726,
5854,
98,
31,
589,
749,
20,
107,
25,
1302,
37,
53,
13,
9,
11969,
3893,
20,
226,
1854,
3893,
568,
21,
5167,
9,
86,
32,
22,
18,
807,
5355,
47,
31,
57,
20,
7006,
14,
5196,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Garbage collection with a generic stack
===
I'm writing a multiple undo/redo system for a custom textbox control in Silverlight. The thing I'm working on now is reducing memory consumption.
So the problem I'm having is that the stacks I'm using are being held in memory too long.
I figure it'd be relatively inexpensive to erase the stack altogether whenever its `Count` reaches 0. So I'm attempting to do that with this code, hoping that'll be picked up by the GC...
TextHistory.Clear()
TextHistory = Nothing
But that's definitely not working, and this stack can potentially hold 50 MB or more. By the way, `TextHistory` is a `Stack(Of Moment)`. And here's the `Moment` class...
Public Class Moment
Public Text As String
Public SelectionStart As Integer
Public SelectionLength As Integer
Public Sub New(ByRef _Text As String, _SelectionStart As Integer, _SelectionLength As Integer)
Text = _Text
SelectionStart = _SelectionStart
SelectionLength = _SelectionLength
End Sub
End Class
| 0 | [
2,
15024,
1206,
29,
21,
12733,
7566,
800,
3726,
3726,
31,
22,
79,
1174,
21,
1886,
367,
537,
118,
99,
537,
329,
26,
21,
5816,
1854,
5309,
569,
19,
1172,
3130,
9,
14,
584,
31,
22,
79,
638,
27,
130,
25,
7974,
1912,
8330,
9,
86,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Devise helper methods not exists
===
I'm using devise for auth the users in my app. The problem is that none of the devise helpers not exists in my app. For example. In file
app/controllers/admin/dashboard.php
I have this snippet of code
<% if user_signed_in ? %>
do something
<% end %>
I get
undefined method `user_signed_in?'
Here is the output ot rake routes command
new_admin_session GET /admin/sign_in(.:format) devise/sessions#new
admin_session POST /admin/sign_in(.:format) devise/sessions#create
destroy_admin_session DELETE /admin/sign_out(.:format) devise/sessions#destroy
admin_password POST /admin/password(.:format) devise/passwords#create
new_admin_password GET /admin/password/new(.:format) devise/passwords#new
edit_admin_password GET /admin/password/edit(.:format) devise/passwords#edit
PUT /admin/password(.:format) devise/passwords#update
cancel_admin_registration GET /admin/cancel(.:format) devise/registrations#cancel
admin_registration POST /admin(.:format) devise/registrations#create
new_admin_registration GET /admin/sign_up(.:format) devise/registrations#new
edit_admin_registration GET /admin/edit(.:format) devise/registrations#edit
PUT /admin(.:format) devise/registrations#update
DELETE /admin(.:format) devise/registrations#destroy
login /admin/login(.:format) devise/sessions#new
login /admin(.:format) devise/sessions#new
admin_dashboard_index GET /admin/dashboard/index(.:format) admin/dashboard#index
Here is the content of routes.rb
devise_for :admin
devise_scope :admin do
match 'admin/login' => 'devise/sessions#new', :as => :login
match 'admin' => 'devise/sessions#new', :as => :login
get "admin/dashboard/index"
end
namespace :admin do
resources :images
end
And Admin model
class Admin < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
attr_accessible :email, :password, :password_confirmation, :remember_me
end
What is wrong here ? I'm able to register or login, but I can't use helper methods.
| 0 | [
2,
29276,
448,
106,
3195,
52,
5636,
800,
3726,
3726,
31,
22,
79,
568,
29276,
26,
10343,
96,
14,
3878,
19,
51,
4865,
9,
14,
1448,
25,
30,
2369,
16,
14,
29276,
448,
445,
52,
5636,
19,
51,
4865,
9,
26,
823,
9,
19,
3893,
4865,
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... |
Show/hide toggle with iframe - Jquery
===
I'm new in Jquery (learning from examples).
I'm trying to create some step by step tutorial and then to show FAQ with iframe at the end.
My main problem is that the page loads all my iframes (but hides them) so it takes about 10-15 seconds to load the page.
I want to be able to load each iframe by clicking on the button/text only, somehow I managed to to that (because my URL is the same and only the id of the url changes: http://my.nanorep.com/widget/widget.html?account=waze&kb=623233&onloadquestionid=**ID**)
Id: **3490608** or **3490611**
When I click on forgot password for example it shows the iframe but when I clicks on it again it doubles it, I have no idea how to make it hide/ removed/ show it once.
The code: http://jsfiddle.net/ronvaisman/SKBWA
(it's under **web** -> **Login Issue**
Thanks for the help,
Ron | 0 | [
2,
298,
118,
19522,
20,
263,
4875,
29,
31,
8361,
13,
8,
487,
8190,
93,
800,
3726,
3726,
31,
22,
79,
78,
19,
487,
8190,
93,
13,
5,
26001,
37,
3770,
6,
9,
31,
22,
79,
749,
20,
1600,
109,
1424,
34,
1424,
29724,
17,
94,
20,
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... |
Is hdf5 suitable for real-time measurements
===
I would like to know if hdf5 is suitable for real-time data logging or not ?
More precisely:
I work on a project in which we want to continuously (sampling rate ranging form 30 to 400Hz) mix a fair amount of data (several hours) of different natures (telemetry, signals, videos).
Data have to be written in real-time (or with a small delay) in order to keep us from losing them on potential crash.
Our first prototype is based on sqlite3, however we feel that some limitations could rise from a long run usage: speed, one database == one file, and difficulties for accessing database from several threads (Lock exception when reading and writing at the same time).
So, I am considering the possibility to use hdf5 as a back-end for data storage on disk (and numpy/pytable for internal representation). Do you think it is possible to update hdf5 file on a regular basis from such python binding ?
Thank you very much !
Cheers | 0 | [
2,
25,
8590,
410,
264,
6445,
26,
683,
8,
891,
12776,
800,
3726,
3726,
31,
83,
101,
20,
143,
100,
8590,
410,
264,
25,
6445,
26,
683,
8,
891,
1054,
13,
13919,
54,
52,
13,
60,
91,
11628,
45,
31,
170,
27,
21,
669,
19,
56,
95,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 automate NUnit tests in an ASP.NET website project?
===
I have a client who has a large existing application written in ASP.NET, which is setup as a *website* project in Visual Web Developer 2010 Express.
I have been asked to demonstrate how to write unit tests and to help configure the Hudson build environment to run these tests automatically.
The code is reasonably well structured and although it does not use any UI patterns there is good separation. Business logic tends to sit inside separate classes rather than within the .aspx or associated code-behind files.
Nevertheless, as a website project rather than a web application, DLLs are not generated so the tests we have written cannot be run by the NUnit GUI.
I would like to be able to run the tests before check-in.
I would like to run the tests automatically as part of the continuous build process.
I cannot change the project type to a web application as there are downstream processes that are dependent on the project type.
Whilst upgrading to Visual Studio Professional is being investigated, I have to assume for the purpose of this exercise that I will need to make it work on VWD.
What are my options to achieve this, given the constraints above? Is it even possible?
TIA
| 0 | [
2,
184,
20,
3108,
5281,
10210,
242,
4894,
19,
40,
28,
306,
9,
2328,
2271,
669,
60,
800,
3726,
3726,
31,
57,
21,
6819,
72,
63,
21,
370,
3149,
3010,
642,
19,
28,
306,
9,
2328,
15,
56,
25,
18161,
28,
21,
1637,
14113,
9097,
2483,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XtraReports - DevExpress
===
I have asp.net MVC application, and I print report from web and I have two problem while printing:
<br>
1. Line break doesn't work in Google Chrome and works in IE, I want to work in Chrome too.
<br>
2. On printed paper there is web link to the bottom and above too. I want to remove both.
Does anyone know how to solve my problems ? | 0 | [
2,
993,
1939,
17437,
18,
13,
8,
9664,
21230,
800,
3726,
3726,
31,
57,
28,
306,
9,
2328,
307,
8990,
3010,
15,
17,
31,
4793,
1330,
37,
2741,
17,
31,
57,
81,
1448,
133,
7312,
45,
13,
1,
5145,
1,
137,
9,
293,
1442,
1437,
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... |
Asynchronous delegates vs Threads in C#
===
Replacing Threads (not ThreadPool Thread) with Asynchronous Delegates (Callbacks).
My Scenario: Spawn a Thread/del.beginInvoke() per Client.
According to me,
Reasons
1. need for Notification via Callback / Call delegate again in Callback
2. Avoid Thread Overhead, (delegates use Threadpool thread)
3. Passing Arguments (Avoid Casting to object) and need return value from the method.
Correct me if above reasons are wrong.
1. Is any other Reasons?
2. What scenario i exactly need to do some stuff with Asynchronous Delegates that
threads can't?
3.Performance ?
Example
public delegate void SendCallbackType();
SendCallbackType senderdel= new SendCallbackType(SendData);
public void StartSend() // This method Could be Called more than 700 times (Thread per Client)
{
senderdel.BeginInvoke(SendCallback,null);
// (or)
Thread t = new Thread(new ThreadStart(ThreadSend));
t.IsBackground = true;
t.Start();
}
//Async Delegate
void SendData()
{
string data = QueData.DeQueue();
RaiseOnData(data); // Raise to event.
}
void SendCallback(IAsyncResult ar)
{
senderdel.BeginInvoke(SendCallback, null);
}
//Thread
void ThreadSend()
{
while (true)
{
string data = QueData.DeQueue();
RaiseOnData(data); // Raise to event.
}
} | 0 | [
2,
21,
16023,
1291,
10845,
4611,
20396,
19,
272,
5910,
800,
3726,
3726,
5496,
20396,
13,
5,
1270,
9322,
13378,
9322,
6,
29,
21,
16023,
1291,
10845,
13,
5,
9200,
1958,
18,
6,
9,
51,
12705,
45,
13,
22860,
21,
9322,
118,
3436,
9,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Intercept Adobe flash player
===
I am building an application which uses the IE activex control to host youtube videos, using the youtube IFRAME based player API.
However, I wish to prevent links in the control from launching external browser windows - How do I do this?
I thought I might hook ShellExecute in my process, but this is never called. Nor is CreateProcess()
I used an API tracer and it seems like it is using COM interfaces to launch IE.
Any pointers (pun intended) on how I can go forward? Maybe I'll have to hook cocreateinstance and provide a faux object of my own making instead?
| 0 | [
2,
18324,
20299,
4433,
517,
800,
3726,
3726,
31,
589,
353,
40,
3010,
56,
2027,
14,
13,
660,
1348,
396,
569,
20,
2015,
7330,
6610,
15,
568,
14,
7330,
31,
8361,
432,
517,
21,
2159,
9,
207,
15,
31,
2536,
20,
2501,
6271,
19,
14,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is difference between Scrum and Agile Development? and Does Sprint and Iterations are same?
===
What is difference between Scrum and Agile Development?
and Does Sprint and Iterations are same?
| 0 | [
2,
98,
25,
2841,
128,
26562,
17,
27475,
522,
60,
17,
630,
6672,
17,
23534,
18,
50,
205,
60,
800,
3726,
3726,
98,
25,
2841,
128,
26562,
17,
27475,
522,
60,
17,
630,
6672,
17,
23534,
18,
50,
205,
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... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
putExtra getExtra in android
===
I am trying to pass some information from one activity to another with the help of putExtra and GetExtra but the activity crashes by showing the runtime exception.Please tell me how to solve this problem.
Thanks in advance
| 0 | [
2,
442,
23631,
164,
23631,
19,
13005,
800,
3726,
3726,
31,
589,
749,
20,
1477,
109,
676,
37,
53,
2358,
20,
226,
29,
14,
448,
16,
442,
23631,
17,
164,
23631,
47,
14,
2358,
21563,
34,
3187,
14,
485,
891,
5391,
9,
6744,
494,
55,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
air 3.3, new iPad, detection?
===
I understand air 3.3 scales up images for the new ipad, but is there a way so that I can detect that it is the new ipad and use @2x graphics instead?
I use this to get the width/height but on the new iPad it just returns 1024 x 768 and not 2048 x 1586:
var width = Math.max(GlobalVars.vars.stage.fullScreenWidth, GlobalVars.vars.stage.fullScreenHeight);
var height = Math.min(GlobalVars.vars.stage.fullScreenWidth, GlobalVars.vars.stage.fullScreenHeight); | 0 | [
2,
282,
203,
9,
240,
15,
78,
31,
8240,
15,
11643,
60,
800,
3726,
3726,
31,
1369,
282,
203,
9,
240,
10105,
71,
3502,
26,
14,
78,
31,
8240,
15,
47,
25,
80,
21,
161,
86,
30,
31,
92,
9092,
30,
32,
25,
14,
78,
31,
8240,
17,
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... |
Rails 3 ActionMailer sending 0 bytes pdf attachments
===
I have managed to send an email with pdf attachments that are stored on s3
def welcome_pack1(website_registration)
require 'open-uri'
@website_registration = website_registration
email_attachments = EmailAttachment.find(:all,:conditions=>{:goes_to_us=>true})
email_attachments.each do |a|
tempfile = File.new("#{Rails.root.to_s}/tmp/#{a.pdf_file_name}", "w")
tempfile << open(a.pdf.url)
tempfile.puts
attachments[a.pdf_file_name] = File.read("#{Rails.root.to_s}/tmp/#{a.pdf_file_name}")
end
mail(:to => website_registration.email, :subject => "Welcome")
end
The attachments are attached to the email. But they come through as 0 bytes. I was using the example posted here http://stackoverflow.com/questions/4356936/paperclip-actionmailer-adding-an-attachment. Am i missing something?
| 0 | [
2,
2240,
18,
203,
1028,
8079,
106,
4907,
713,
34,
3231,
13,
11124,
14575,
18,
800,
3726,
3726,
31,
57,
1471,
20,
2660,
40,
8517,
29,
13,
11124,
14575,
18,
30,
50,
8214,
27,
13,
18,
240,
6312,
5575,
1,
8573,
165,
5,
14113,
9097,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Entity Framework Code First Lazy Loading
===
I am having two object classes
public class User
{
public Guid Id { get; set; }
public string Name { get; set; }
// Navigation
public ICollection<Product> Products { get; set; }
}
public class Product
{
public Guid Id { get; set; }
// Navigation
public User User { get; set; }
public Guid User_Id { get; set; }
public string Name { get; set; }
}
When i load a user using dataContext, i get the list of Products being null (this is ok).
If i add "virtual" keyword to Products list,
public virtual ICollection<Product> Products { get; set; }
when i load the user, i get the Products list as well.
Why is this happening? I thought that "virtual" keyword is used for not loading the entities unless you explicit this (using an "Include" statement)
I think i got it all wrong
| 0 | [
2,
9252,
6596,
1797,
64,
16792,
12797,
800,
3726,
3726,
31,
589,
452,
81,
3095,
2684,
317,
718,
4155,
13,
1,
317,
9457,
43,
4924,
13,
1,
164,
73,
309,
73,
13,
1,
317,
3724,
204,
13,
1,
164,
73,
309,
73,
13,
1,
12894,
8368,
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... |
Control a textView
===
my application keeps force closing. But Eclipse shows no error or warnings
package com.example.pkg;
import android.os.Bundle;
import android.widget.TextView;
import android.app.Activity;
public class subActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_sub);
Thread r = new Thread(new Runnable(){
public void run()
{ final TextView tv=(TextView)findViewById(R.id.rline1);
String s=(String)tv.getText();
tv.setText(s+"Works !");
}
});
r.start();
}
}
Another Activity calls this Activity. That one has the TextView displayed. All I want to do is to change this string resource called R.string.rline1 that is being displayed on the TextView. Please tell me how to do this if there is another way
| 0 | [
2,
569,
21,
1854,
4725,
800,
3726,
3726,
51,
3010,
8968,
558,
4239,
9,
47,
11652,
1285,
90,
7019,
54,
3590,
18,
6030,
13,
960,
9,
29041,
9,
17244,
263,
73,
9010,
13005,
9,
759,
9,
9930,
413,
73,
9010,
13005,
9,
3976,
43,
3060,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Capistrano and rvm the right way
===
I have this situation on my client workstation.
When i try to make a deploy, with
cap deploy
i get this error message:
capistrano is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
Ok! But i don't want to add it to gemfile. I want to use it system wide. The gem is currently installed.
Some information about the binary:
~/Code/ecommerce (master ✔) ᐅ which cap
cap: aliased to bundled_cap
Any idea? I'm in wrong? | 0 | [
2,
2605,
702,
17555,
17,
13,
10359,
79,
14,
193,
161,
800,
3726,
3726,
31,
57,
48,
1858,
27,
51,
6819,
170,
10839,
9,
76,
31,
1131,
20,
233,
21,
17617,
15,
29,
2605,
17617,
31,
164,
48,
7019,
2802,
45,
2605,
702,
17555,
25,
52... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Tabbable input type="file" Without Text Box Being Tabbable
===
I have an input element of type 'file':
<input type="file">
and it currently uses jQuery's fileUpload Plugin (version 5.8.1).
I have some css that hides the text box of the file input, exposing only the button (I have no need for the textbox).
I desire the functionality to:
1. click the input button to open the upload dialog...
2. have the input button tabbable (focused) so that I may open the upload dialog that way too
Here is my problem:
If I make my input tabbable, then I also make the textbox tabbable (which I do not want since it's not even visible).
I have looked up the possibility of creating a button which, when clicked, will trigger the click event of the input to upload a file; however, I have read that this may be a security breach and is not supported on many browsers.
Is there a way that I may make the input tabbable (but only to the button), or is there some other way to trigger the click event on a input of type file?
Any suggestions would be greatly appreciated.
| 0 | [
2,
6523,
220,
579,
6367,
1001,
3726,
7,
16877,
7,
366,
1854,
1649,
142,
6523,
220,
579,
800,
3726,
3726,
31,
57,
40,
6367,
4520,
16,
1001,
13,
22,
16877,
22,
45,
13,
1,
108,
4881,
1001,
3726,
7,
16877,
7,
1,
17,
32,
871,
2027,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Admin properties with open graph tags
===
I have a question regarding the like button on my website (http://www.lisasmit.tk). I had this like button for while, but now I would like to add Open Graph Tags to my site, so the like will show up in other people's likes and so that I can send messages to the people who liked my page.
Now I have this problem that I do not see a "admin" function next to my like button, nor can I get into the adminsection on my facebook page. I have added all the meta-tags (as far as I know) underneath the <head> section, and I liked and unliked my page several times, but still nothing shows up.
I have used the statistics page (https://www.facebook.com/insights/), but I can't get any results there. The error mentions that there are no admindata found in the root of my page.
Also, I used the facebook debugger which mentions "Open Graph Warnings That Should Be Fixed" after I entered my url:
- Inferred Property: The 'og:url' property should be explicitly
provided, even if a value can be inferred from other tags.
- Inferred Property: The 'og:title' property should be explicitly provided, even
if a value can be inferred from other tags.
- Inferred Property:The 'og:description' property should be explicitly provided, even if a
value can be inferred from other tags.
These are the meta-tags I have added in my HTML section:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="https://www.facebook.com/2008/fbml" xmlns:og="http://ogp.me/ns#" xml:lang="en" lang="en">
<head>
<meta property="og:title" content="Lisa Smit" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://www.lisasmit.tk" />
<meta property="og:image" content="URLIMAGE" />
<meta property="og:site_name" content="Lisa Smit" />
<meta property="fb:admins" content="MYFBCODE" />
Hopefully someone can help me out! | 0 | [
2,
21,
43,
2160,
3704,
29,
368,
7210,
3383,
18,
800,
3726,
3726,
31,
57,
21,
1301,
3467,
14,
101,
5167,
27,
51,
2271,
13,
5,
21127,
6903,
6483,
9,
21047,
18,
5130,
9,
38,
197,
6,
9,
31,
41,
48,
101,
5167,
26,
133,
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.