unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Issue With Regular Expression
===
I use the method String.matches(String regex) to find if a string matches the regex expression
From my point of view the regular expression regex="[0-9]+" means a String that contains at least one figure between 0 and 9
But when I debug "3.5".matches("[0-9]+") it returns false.
So what is wrong ?
Thanks | 0 | [
2,
1513,
29,
1290,
1803,
800,
3726,
3726,
31,
275,
14,
2109,
3724,
9,
12280,
160,
5,
11130,
7953,
1706,
6,
20,
477,
100,
21,
3724,
1717,
14,
7953,
1706,
1803,
37,
51,
454,
16,
1418,
14,
1290,
1803,
7953,
1706,
3726,
7,
2558,
387... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
OOP javascript and jquery books
===
I am looking for any good JavaScript and jquery books. Anybody have any suggestion?
I have a heavy development in object oriented JavaScript.
Thanks | 4 | [
2,
13,
21709,
8247,
8741,
17,
487,
8190,
93,
964,
800,
3726,
3726,
31,
589,
699,
26,
186,
254,
8247,
8741,
17,
487,
8190,
93,
964,
9,
11181,
57,
186,
10910,
60,
31,
57,
21,
1278,
522,
19,
3095,
13,
6800,
8247,
8741,
9,
3669,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Trouble syncing libavformat/ffmpeg with x264 and RTP
===
I've been working on some streaming software that takes live feeds
from various kinds of cameras and streams over the network using
H.264. To accomplish this, I'm using the x264 encoder directly (with
the "zerolatency" preset) and feeding NALs as they are available to
libavformat to pack into RTP (ultimately RTSP). Ideally, this
application should be as real-time as possible. For the most part,
this has been working well.
Unfortunately, however, there is some sort of synchronization issue:
any video playback on clients seems to show a few smooth frames,
followed by a short pause, then more frames; repeat. Additionally,
there appears to be approximately a 4-second delay. This happens with
every video player I've tried: Totem, VLC, and basic gstreamer pipes.
I've boiled it all down to a somewhat small test case:
#include <stdio.h>
#include <stdint.h>
#include <unistd.h>
#include <x264.h>
#include <libavformat/avformat.h>
#include <libswscale/swscale.h>
#define WIDTH 640
#define HEIGHT 480
#define FPS 30
#define BITRATE 400000
#define RTP_ADDRESS "127.0.0.1"
#define RTP_PORT 49990
struct AVFormatContext* avctx;
struct x264_t* encoder;
struct SwsContext* imgctx;
uint8_t test = 0x80;
void create_sample_picture(x264_picture_t* picture)
{
// create a frame to store in
x264_picture_alloc(picture, X264_CSP_I420, WIDTH, HEIGHT);
// fake image generation
// disregard how wrong this is; just writing a quick test
int strides = WIDTH / 8;
uint8_t* data = malloc(WIDTH * HEIGHT * 3);
memset(data, test, WIDTH * HEIGHT * 3);
test = (test << 1) | (test >> (8 - 1));
// scale the image
sws_scale(imgctx, (const uint8_t* const*) &data, &strides, 0, HEIGHT,
picture->img.plane, picture->img.i_stride);
}
int encode_frame(x264_picture_t* picture, x264_nal_t** nals)
{
// encode a frame
x264_picture_t pic_out;
int num_nals;
int frame_size = x264_encoder_encode(encoder, nals, &num_nals, picture, &pic_out);
// ignore bad frames
if (frame_size < 0)
{
return frame_size;
}
return num_nals;
}
void stream_frame(uint8_t* payload, int size)
{
// initalize a packet
AVPacket p;
av_init_packet(&p);
p.data = payload;
p.size = size;
p.stream_index = 0;
p.flags = AV_PKT_FLAG_KEY;
p.pts = AV_NOPTS_VALUE;
p.dts = AV_NOPTS_VALUE;
// send it out
av_interleaved_write_frame(avctx, &p);
}
int main(int argc, char* argv[])
{
// initalize ffmpeg
av_register_all();
// set up image scaler
// (in-width, in-height, in-format, out-width, out-height, out-format, scaling-method, 0, 0, 0)
imgctx = sws_getContext(WIDTH, HEIGHT, PIX_FMT_MONOWHITE,
WIDTH, HEIGHT, PIX_FMT_YUV420P,
SWS_FAST_BILINEAR, NULL, NULL, NULL);
// set up encoder presets
x264_param_t param;
x264_param_default_preset(¶m, "ultrafast", "zerolatency");
param.i_threads = 3;
param.i_width = WIDTH;
param.i_height = HEIGHT;
param.i_fps_num = FPS;
param.i_fps_den = 1;
param.i_keyint_max = FPS;
param.b_intra_refresh = 0;
param.rc.i_bitrate = BITRATE;
param.b_repeat_headers = 1; // whether to repeat headers or write just once
param.b_annexb = 1; // place start codes (1) or sizes (0)
// initalize
x264_param_apply_profile(¶m, "high");
encoder = x264_encoder_open(¶m);
// at this point, x264_encoder_headers can be used, but it has had no effect
// set up streaming context. a lot of error handling has been ommitted
// for brevity, but this should be pretty standard.
avctx = avformat_alloc_context();
struct AVOutputFormat* fmt = av_guess_format("rtp", NULL, NULL);
avctx->oformat = fmt;
snprintf(avctx->filename, sizeof(avctx->filename), "rtp://%s:%d", RTP_ADDRESS, RTP_PORT);
if (url_fopen(&avctx->pb, avctx->filename, URL_WRONLY) < 0)
{
perror("url_fopen failed");
return 1;
}
struct AVStream* stream = av_new_stream(avctx, 1);
// initalize codec
AVCodecContext* c = stream->codec;
c->codec_id = CODEC_ID_H264;
c->codec_type = AVMEDIA_TYPE_VIDEO;
c->flags = CODEC_FLAG_GLOBAL_HEADER;
c->width = WIDTH;
c->height = HEIGHT;
c->time_base.den = FPS;
c->time_base.num = 1;
c->gop_size = FPS;
c->bit_rate = BITRATE;
avctx->flags = AVFMT_FLAG_RTP_HINT;
// write the header
av_write_header(avctx);
// make some frames
for (int frame = 0; frame < 10000; frame++)
{
// create a sample moving frame
x264_picture_t* pic = (x264_picture_t*) malloc(sizeof(x264_picture_t));
create_sample_picture(pic);
// encode the frame
x264_nal_t* nals;
int num_nals = encode_frame(pic, &nals);
if (num_nals < 0)
printf("invalid frame size: %d\n", num_nals);
// send out NALs
for (int i = 0; i < num_nals; i++)
{
stream_frame(nals[i].p_payload, nals[i].i_payload);
}
// free up resources
x264_picture_clean(pic);
free(pic);
// stream at approx 30 fps
printf("frame %d\n", frame);
usleep(33333);
}
return 0;
}
This test shows black lines on a white background that
should move smoothly to the left. It has been written for ffmpeg 0.6.5
(sorry) but appears to work the same on 0.8.3 on Ubuntu. I've taken
some shortcuts in error handling to make this example as short as
possible while still showing the problem, so please excuse some of the
nasty code. I should also note that while an SDP is not used here, I
have tried using that already with similar results. The test can be
compiled with:
gcc -g -std=gnu99 streamtest.c -lswscale -lavformat -lx264 -lm -lpthread -o streamtest
It can be played with gtreamer directly:
gst-launch udpsrc port=49990 ! application/x-rtp,payload=96,clock-rate=90000 ! rtph264depay ! decodebin ! xvimagesink
You should immediately notice the stuttering. One common "fix" I've
seen all over the Internet is to add sync=false to the pipeline:
gst-launch udpsrc port=49990 ! application/x-rtp,payload=96,clock-rate=90000 ! rtph264depay ! decodebin ! xvimagesink sync=false
This causes playback to be smooth (and near-realtime), but is a
non-solution and only works with gstreamer. I'd like to fix the
problem at the source. I've been able to stream with near-identical
parameters using raw ffmpeg and haven't had any issues:
ffmpeg -re -i sample.mp4 -vcodec libx264 -vpre ultrafast -vpre baseline -b 400000 -an -f rtp rtp://127.0.0.1:49990 -an
So clearly I'm doing something wrong. But what is it? | 0 | [
2,
2572,
6063,
6302,
13,
8326,
5214,
23588,
118,
2460,
79,
20427,
29,
993,
20470,
17,
761,
13726,
800,
3726,
3726,
31,
22,
195,
74,
638,
27,
109,
11920,
2306,
30,
1384,
515,
17058,
37,
617,
8623,
16,
8688,
17,
9464,
84,
14,
982,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Stored Procedure Prepared statements on a variable assignment
===
<p>I've put together a simple stored proceure in which two parameters are passed through to make it more dynamic. As you can seen from the "First Two Digits and Count of Records" section, I've put in my dynamic sql with a prepared statement. What I'm not sure is can I make the "SET vTotalFT =" variable section dynamic with a prepared statement as well? As can be seen at the moment I have to hardcode the table name and field, but want my vTotalFT variable to be assigned based on a prepared dymanic sql statement, but not sure of the syntax here. The idea is that when I call my procedure, I just tell it which table and which field to use for the analysis. Any thoughts would be much appreciated.</p>
<code>
CREATE PROCEDURE `sp_benfords_ft_digits_analysis`(vTable varchar(255), vField varchar(255))
SQL SECURITY INVOKER
BEGIN
-- Variables
DECLARE vTotalFT int(11);
-- Removes existing table
DROP TABLE IF EXISTS analysis_benfords_ft_digits;
-- Builds base analysis table
CREATE TABLE analysis_benfords_ft_digits
(
ID int(11) NOT NULL AUTO_INCREMENT,
FT_Digits int(11),
Count_of_Records int(11),
Actual decimal(18,3),
Benfords decimal(18,3),
Difference Decimal(18,3),
AbsDiff decimal(18,3),
Zstat decimal(18,3),
PRIMARY KEY (ID),
KEY id_id (ID)
);
-- First Two Digits and Count of Records
SET @s = concat('INSERT INTO analysis_benfords_ft_digits
(FT_Digits,Count_of_Records)
select substring(cast(',vField,' as char(50)),1,2) as FT_Digits, count(*) as Count_of_Records
from ',vTable,'
where ',vField,' >= 10
group by 1');
prepare stmt from @s;
execute stmt;
deallocate prepare stmt;
SET vTotalFT = (select sum(Count_of_Records) from
(select substring(cast(Gross_Amount as char(50)),1,2) as FT_Digits, count(*) as Count_of_Records
from supplier_invoice_headers
where Gross_Amount >= 10
group by 1) a);
-- Actual
UPDATE analysis_benfords_ft_digits
SET Actual = Count_of_Records / vTotalFT;
-- Benfords
UPDATE analysis_benfords_ft_digits
SET Benfords = Log(1 + (1 / FT_Digits)) / Log(10);
-- Difference
UPDATE analysis_benfords_ft_digits
SET Difference = Actual - Benfords;
-- AbsDiff
UPDATE analysis_benfords_ft_digits
SET AbsDiff = abs(Difference);
-- ZStat
UPDATE analysis_benfords_ft_digits
SET ZStat = cast((ABS(Actual-Benfords)-IF((1/(2*vTotalFT))<ABS(Actual-Benfords),(1/(2*vTotalFT)),0))/(SQRT(Benfords*(1-Benfords)/vTotalFT)) as decimal(18,3));
</code> | 0 | [
2,
51,
18,
22402,
8214,
7004,
3268,
9015,
27,
21,
7612,
8427,
800,
3726,
3726,
13,
1,
306,
1,
49,
22,
195,
442,
429,
21,
1935,
8214,
895,
1105,
4221,
19,
56,
81,
12905,
50,
1100,
120,
20,
233,
32,
91,
7782,
9,
28,
42,
92,
54... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to disable code signing requirement
===
After getting email for invalid binary from Appstore, fixed issue now trying to archive again, Xcode is giving error that code signing is required for product type Application' in SDK iOS 5.1.
So how can i disable this code signing.
Thanks for help. | 0 | [
2,
184,
20,
1460,
579,
1797,
5479,
8981,
800,
3726,
3726,
75,
1017,
8517,
26,
16671,
14171,
37,
4865,
16828,
15,
3535,
1513,
130,
749,
20,
9250,
188,
15,
993,
9375,
25,
1438,
7019,
30,
1797,
5479,
25,
1390,
26,
2374,
1001,
3010,
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... |
Change MAMP PRO Path to Configuration File
===
I am running MAMP PRO 2.1.1 on a MAC using OS 10.7.4 (Lion). How do I change the path to the configuration (php.ini) file so that it is the same as the path to the installed Configuration file? | 0 | [
2,
753,
1216,
2554,
895,
2013,
20,
8091,
3893,
800,
3726,
3726,
31,
589,
946,
1216,
2554,
895,
172,
9,
165,
9,
165,
27,
21,
1572,
568,
13,
759,
332,
9,
465,
9,
300,
13,
5,
14891,
6,
9,
184,
107,
31,
753,
14,
2013,
20,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
wpf elementhost doesnt show
===
I'm having quite a bit of an issue with this elementhost thing. Can someone please take a look at what I have and let me know what's going on or why this isnt showing? Everything seems to work, it's just that I cant see the elementhost displayed on the screen (user control).
private void btnTest_Click(object sender, EventArgs e)
{
LoadView(item);
}
public void LoadView(Person item)
{
TestHost.Child = TestView;
try
{
if (item != null)
{
TestView view = (TestView) TestHost.Child;
TestViewModel vm = (TestViewModel) view.DataContext;
vm.LoadItems(item);
}
TestHost.Visible = true;
}
catch(Exception ex)
{
ex.ToString();
}
} | 0 | [
2,
619,
7721,
4520,
11694,
5886,
298,
800,
3726,
3726,
31,
22,
79,
452,
1450,
21,
1142,
16,
40,
1513,
29,
48,
4520,
11694,
584,
9,
92,
737,
2247,
247,
21,
361,
35,
98,
31,
57,
17,
408,
55,
143,
98,
22,
18,
228,
27,
54,
483,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to create page dynamically?
===
I am making link directory where user enter his website title,description and keywords.I am displaying records on separate page name as latest news.My question is .How to create page dynamically that if user click on title a news dynamic php page created and that title of user website goes to title of that dynamic page,and on new dynamic page user can comments as there is live example of it on digg
please help | 1 | [
2,
184,
20,
1600,
2478,
7782,
1326,
60,
800,
3726,
3726,
31,
589,
544,
3508,
16755,
113,
4155,
2830,
33,
2271,
581,
15,
546,
8741,
872,
17,
1246,
12827,
9,
49,
589,
17418,
742,
27,
1725,
2478,
204,
28,
5736,
996,
9,
915,
1301,
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... |
Nested ITaskItem Arrays in MSBuild Custom Task
===
I am writing a custom MSBuild task that outputs an array of `ITaskItem`. I want to be able to add a custom metadatum to each TaskItem that is of type `ITaskItem[]`, like so:
<!-- language: c# -->
public class MyTask : Task
{
[Required]
public string MyInput { get; set; }
[Output]
public ITaskItem[] MyOutput { get; set; }
public override bool Execute()
{
MyOutput[0] = new TaskItem("A");
MyOutput[0].SetMetadata("Phonetic", "Alpha");
MyOutput[0].SetMetadata("SoundsLike", "Aye");
// Here's what I'd like to be able to do, but can't:
MyOutput[0].SetMetadata("Numbers", new ITaskItem[] { new TaskItem("1"), new TaskItem("2"), new TaskItem("3") });
return !Log.HasLoggedErrors;
}
}
The [`SetMetadata`](http://msdn.microsoft.com/en-us/library/microsoft.build.framework.itaskitem.setmetadata.aspx) method only takes a string as the metadatum value, which is the crux of my problem.
The pure MSBuild solution [here](http://stackoverflow.com/questions/4786301/double-loop-in-msbuild "Double-Loop in MSBuild") is what I'm after (except, of course, my nested items will more often than not be different for each parent item).
Any ideas as to how I can accomplish this in my custom MSBuild task? Thanks in advance.
| 0 | [
2,
5618,
69,
32,
20310,
2119,
79,
7718,
18,
19,
4235,
29361,
5816,
3005,
800,
3726,
3726,
31,
589,
1174,
21,
5816,
4235,
29361,
3005,
30,
5196,
18,
40,
7718,
16,
13,
1,
3188,
2413,
38,
1503,
1,
9,
31,
259,
20,
44,
777,
20,
354... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 change the .sbselector to different element in Jquery Selectbox plugin
===
I am using the jQuery Selectbox plugin in my application. I want to change the value of it(Change .sbselector). Can anybody give me idea to solve it. | 0 | [
2,
184,
20,
753,
14,
13,
9,
18,
220,
3434,
19932,
20,
421,
4520,
19,
487,
8190,
93,
5407,
5309,
10922,
108,
800,
3726,
3726,
31,
589,
568,
14,
487,
8190,
93,
5407,
5309,
10922,
108,
19,
51,
3010,
9,
31,
259,
20,
753,
14,
1923,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Matlab VS Python - eig(A,B) VS sc.linalg.eig(A,B)
===
I have the following matrices sigma and sigmad:
sigma:
1.9958 0.7250
0.7250 1.3167
sigmad:
4.8889 1.1944
1.1944 4.2361
If I try to solve the generalized eigenvalue problem in python I obtain:
d,V = sc.linalg.eig(matrix(sigmad),matrix(sigma))
V:
-1 -0.5614
-0.4352 1
If I try to solve the g. e. problem in matlab I obtain:
[V,d]=eig(sigmad,sigma)
V:
-0.5897 -0.5278
-0.2564 0.9400
But the d's do coincide. I find this to be extremely strange, does anyone know what's happening? Thank you for your help on this!
| 0 | [
2,
4277,
9086,
4611,
20059,
13,
8,
13,
62,
2816,
5,
58,
15,
220,
6,
4611,
4729,
9,
9356,
10641,
9,
62,
2816,
5,
58,
15,
220,
6,
800,
3726,
3726,
31,
57,
14,
249,
24849,
15020,
17,
15020,
43,
45,
15020,
45,
137,
9,
3483,
4284... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 choice from random module in Python
===
I'm trying to build a randomized dataset based on an input dataset. No entry from the randomized dataset can be equal to any of those in the input dataset.
In order to achieve this I tried the following:
data = infile.readlines()
ltotal = len(data)
for line in data:
words = string.split(line)
init = 0
while init != ltotal:
p1 = random.choice(words)
p2 = random.choice(words)
words.remove(p1)
words.remove(p2)
if "%s\t%s\n" % (p1, p2) not in data and "%s\t%s\n" % (p2, p1) not in data:
outfile.write("%s\t%s\n" % (p1, p2))
However, I'm getting the following error:
> Traceback (most recent call last): File
> "C:\Users\eduarte\Desktop\negcreator.py", line 46, in <module>
> convert(indir, outdir) File "C:\Users\eduarte\Desktop\negcreator.py", line 27, in convert
> p1 = random.choice(words) File "C:\Python27\lib\random.py", line 274, in choice
> return seq[int(self.random() * len(seq))] # raises IndexError if seq is empty IndexError: list index out of range
I was pretty sure this would work. What am I doing wrong?
Thanks in advance. | 0 | [
2,
7019,
568,
1837,
37,
5477,
12613,
19,
20059,
800,
3726,
3726,
31,
22,
79,
749,
20,
1895,
21,
5477,
1333,
1054,
3554,
432,
27,
40,
6367,
1054,
3554,
9,
90,
2792,
37,
14,
5477,
1333,
1054,
3554,
92,
44,
2747,
20,
186,
16,
273,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Yii mysql datetime empty
===
I have a problem with a Yii model, I create a MySQL table with two datetime column.
And create the model with gii. The problem is that when I get the data from the model I get the datetime fields empty. | 0 | [
2,
7679,
49,
51,
18,
22402,
1231,
891,
2424,
800,
3726,
3726,
31,
57,
21,
1448,
29,
21,
7679,
49,
1061,
15,
31,
1600,
21,
51,
18,
22402,
859,
29,
81,
1231,
891,
4698,
9,
17,
1600,
14,
1061,
29,
4100,
49,
9,
14,
1448,
25,
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... |
Collapsing a jQuery accordion when clicking a link outside of the accordion menu
===
I'm using this jQuery accordion menu found here [jQuery Vertical Accordion Menu Plugin][1]. The plugin is working well without much customization. The feature that I was really looking for that this plugin offers is persistent menu state after a page refresh. This plugin uses cookies to accomplish this. On to the problem...
If you click outside the accordion menu the state is still maintained. I'm trying to figure out a way to collapse the entire menu when a link is clicked outside of the accordion menu.
My first inclination was to find some way to delete or reset the data in state saving cookie when the window.location was equal to a certain URL. (At the moment it I be happy if when returning to the home page that the menu was completely collapsed).
I'm thinking the best solution would be some jQuery that if an <A> was clicked outside of #Accordion-Navigation was clicked that it would reset the cookie or collapse the menu.
I'm open to anything.
I tried the following with no luck.
jQuery(document).ready(function(jQuery){
var siteurl = "http://myhomepageurl.com/index.php";
if (window.location.href == siteurl) {
jQuery.cookie('dcjq-accordion-1', null, { path: '/'});
}
});
Any suggestions at a more elegant solution would be greatly appreciated! Thanks for taking the time to have a look in advance!
[1]: http://www.designchemical.com/lab/jquery-vertical-accordion-menu-plugin/getting-started/ "jQuery Vertical Accordion Menu Plugin" | 0 | [
2,
24898,
21,
487,
8190,
93,
20753,
76,
25590,
21,
3508,
719,
16,
14,
20753,
11379,
800,
3726,
3726,
31,
22,
79,
568,
48,
487,
8190,
93,
20753,
11379,
216,
235,
636,
728,
8190,
93,
7035,
20753,
11379,
10922,
108,
500,
2558,
165,
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... |
Using the method in two model in one view of asp.net mvc 2.0
===
I have one view in my ASP.net MVC 2.0 project, I want to list the list of employee that I create method `GetProfileCustomer()` in `CustomerModels` and `GetTransaction()` in `TransactionModels`. Any one can tell me , how can I import two different of models in one views?
Thanks. | 0 | [
2,
568,
14,
2109,
19,
81,
1061,
19,
53,
1418,
16,
28,
306,
9,
2328,
307,
8990,
172,
9,
387,
800,
3726,
3726,
31,
57,
53,
1418,
19,
51,
28,
306,
9,
2328,
307,
8990,
172,
9,
387,
669,
15,
31,
259,
20,
968,
14,
968,
16,
7362,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
SherlockDialogFragment and empty space on dialog
===
How to delete clean space on top dialog?
To display I extends my class SherlockDialogFragment. Maybe try to change the setStyle?
My layout of dialog:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:padding="10dp" >
<ProgressBar
android:id="@+id/pbDialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<TextView
android:id="@+id/tvDialog"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:gravity="center_vertical|center_horizontal"
android:text="text" />
</LinearLayout>
My screen:
![screen with spaces][1]
[1]: http://i.stack.imgur.com/6WMag.jpg | 0 | [
2,
22815,
4286,
5567,
22133,
1130,
17,
2424,
726,
27,
28223,
800,
3726,
3726,
184,
20,
27448,
2745,
726,
27,
371,
28223,
60,
20,
3042,
31,
9073,
51,
718,
22815,
4286,
5567,
22133,
1130,
9,
913,
1131,
20,
753,
14,
309,
4381,
60,
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... |
How to inflate XML-Layout-File correctly inside Custom ViewGroup?
===
I want to inflate a XML-Layout-File in a custom ViewGroup Class, my Problem is that it produces just a empty screen. Doing the same in the Activity Class works fine.
Here is my simple XML-Layout-File:
shownumberlayout.xml:
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:id="@+id/layoutForNumber">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tvNumber"
android:layout_centerHorizontal="true"
android:textColor="#000000"
android:text="Test"
android:layout_centerVertical="true"
android:textSize="30dip">
</TextView>
</RelativeLayout>
Here is the working Version, inflating the `shownumberlayout.xml` in the Activity `ShowNumber`:
ShowNumber.class
public class ShowNumber extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
LayoutInflater inflater = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
ViewGroup vg = (ViewGroup) inflater.inflate(R.layout.shownumberlayout, null);
setContentView(vg);
}
}
This shows a White Background with the black Text “Test” centered.
Now the Version inflating the xml in the Custom `ViewGroup`-Class:
ViewGroup.class
public class ViewNumber extends ViewGroup {
private LayoutInflater inflater;
public ViewNumber(Context context) {
super(context);
// TODO Auto-generated constructor stub
initView(context);
}
public ViewNumber(Context context, AttributeSet attrs) {
super(context, attrs);
// TODO Auto-generated constructor stub
initView(context);
}
public ViewNumber(Context context, AttributeSet attrs, int defStyle) {
super(context, attrs, defStyle);
// TODO Auto-generated constructor stub
initView(context);
}
private void initView(Context context){
inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.shownumberlayout, null);
}
@Override
protected void onLayout(boolean changed, int l, int t, int r, int b) {
// TODO Auto-generated method stub
}
}
ShowNumber.class
public class ShowNumber extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ViewGroup vg = new ViewNumber(this);
setContentView(vg);
}
}
Im doing it basically like in [this][1] Answer explained.
This just produces a Empty Black Screen. What I am doing wrong?
[1]: http://stackoverflow.com/questions/3368182/anyway-to-use-xml-layout-files-for-specific-view-viewgroups | 0 | [
2,
184,
20,
19,
13830,
62,
23504,
8,
4414,
1320,
8,
16877,
12044,
572,
5816,
1418,
8024,
60,
800,
3726,
3726,
31,
259,
20,
19,
13830,
62,
21,
23504,
8,
4414,
1320,
8,
16877,
19,
21,
5816,
1418,
8024,
718,
15,
51,
1448,
25,
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... |
In Mercurial, how to run original command if default arguments are present?
===
I have configured `hg log` in `~/.hgrc` to only list commits from the current branch by default:
[defaults]
log = --branch .
However, occasionally I'd like to really see commits from all branches. Is there a way to tell `hg log` when invoked form the command line to not use the configured defaults but fall back to the built-in behavior? As a brute-force solution ignoring `~/.hgrc` altogether for this particular invocation of `hg log` would be fine for me.
I'm aware that defaults are deprecated in favor of aliases, but aliases cannot be created with the same names as existing commands, which is what I want in order to not have to learn new command names, esp. when `~/.hgrc` settings are to be shared by multiple developers. | 0 | [
2,
19,
9046,
3594,
192,
15,
184,
20,
485,
501,
1202,
100,
12838,
10553,
50,
734,
60,
800,
3726,
3726,
31,
57,
28895,
13,
1,
18187,
6738,
1,
19,
13,
1,
118,
9,
18187,
5453,
1,
20,
104,
968,
9686,
18,
37,
14,
866,
1686,
34,
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... |
Selecting value from drop down in Ruby
===
I need code for selecting value from drop down in Ruby..Can any one help me out?
Thanks. | 0 | [
2,
20764,
1923,
37,
2804,
125,
19,
10811,
800,
3726,
3726,
31,
376,
1797,
26,
20764,
1923,
37,
2804,
125,
19,
10811,
9,
9,
1245,
186,
53,
448,
55,
70,
60,
3669,
9,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
JQuery syntax in C#
===
I have written the following Javascript but get the error 'Invalid JSON primitive: strSeason'. The rest of the syntax seems fine but I can't seem to get the 'data' parameter right. Can anybody help me with the syntax?
TagBuilder script = new TagBuilder("script");
script.Attributes.Add("type", "text/javascript");
script.Attributes.Add("language", "javascript");
// ReSharper disable LocalizableElement
script.InnerHtml = @"
$.ajax({
type: 'POST',
async: true,
contentType: 'application/json; charset=utf-8',
dataType: 'html',
url: '/en-US/" + areaName + '/' + controllerName + '/' + actionName + @"',
data: " + "{strSeason:'" + season + "', strTeam:'" + team + @"'},
beforeSend: function(xhr){
$(this).addClass('ajaxRefreshing');
xhr.setRequestHeader('X-Client', 'jQuery');
},
success: function(html){
$(this).html(html);
},
complete: function(){
$(this).removeClass('ajaxRefreshing');
}
});
"; | 0 | [
2,
487,
8190,
93,
22649,
19,
272,
5910,
800,
3726,
3726,
31,
57,
642,
14,
249,
8247,
8741,
47,
164,
14,
7019,
13,
22,
108,
18506,
43,
487,
528,
11473,
45,
13,
9729,
4015,
22,
9,
14,
760,
16,
14,
22649,
2206,
1123,
47,
31,
92,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Limit on serialized data for jquery ajax method?
===
Is there a limit on the length of data given through POST type **ajax** method of jquery?
I'm submitting a form in the background using ajax() method:
$.ajax({type:'POST', url: '<?=BASE_URL?>comenzi/save', dataType:'json', data:$('#theForm').serialize(), success: function(response) { ...
But some of the inputs are not being sent, can not be found in the POST.
Is there a limit for this data parameter, or I should look for another problem here?
**UPDATE:**
I've put out the form to console in two different ways:
console.log($('#theForm').serialize());
console.log($('#theForm'));
On the second output, all of my inputs are there, but in the serialized output I could not find some of my inputs. What could be the problem?
Thanks! | 0 | [
2,
4496,
27,
27877,
1054,
26,
487,
8190,
93,
20624,
2109,
60,
800,
3726,
3726,
25,
80,
21,
4496,
27,
14,
1476,
16,
1054,
504,
120,
678,
1001,
13,
1409,
6881,
7522,
1409,
2109,
16,
487,
8190,
93,
60,
31,
22,
79,
28848,
21,
505,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Image resizing in Scrollview
===
I have an ImageView in a ScrollView and resizing the ScrollView at some point. The problem is, that the ImageView is resizing to the same size as the ScrollView, but I want it to keep the original image size.
What I'm doing is this:
scrollView.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height); // fullscreen scrollview
[scrollView setContentMode:UIViewContentModeTopLeft]; //i want the content to be on the top left, thats correct right?
[scrollView setContentSize:CGSizeMake(imageInScrollView.frame.size.width, imageInScrollView.frame.size.height)]; // now im setting the size of the content, which is like 200x200 but it shows in fullscreen
Please read the comments next to my code, thank you! | 0 | [
2,
1961,
10719,
3335,
19,
12159,
4725,
800,
3726,
3726,
31,
57,
40,
1961,
4725,
19,
21,
12159,
4725,
17,
10719,
3335,
14,
12159,
4725,
35,
109,
454,
9,
14,
1448,
25,
15,
30,
14,
1961,
4725,
25,
10719,
3335,
20,
14,
205,
1072,
28... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript Multiple Value Call
===
I'm calling a function from an input radio button and have this:
onClick=\"changeBilling('".$results['id']."', this.value)\"
But my this.value isn't working properly. When I look it up in the page, the id is filling properly, but the second value still says this.value, and not the value of the button that is calling the function.
I see this in the browser element manager:
onclick="changeBilling('149', this.value)"
What am I doing wrong? | 0 | [
2,
8247,
8741,
1886,
1923,
645,
800,
3726,
3726,
31,
22,
79,
2555,
21,
1990,
37,
40,
6367,
603,
5167,
17,
57,
48,
45,
27,
150,
10129,
3726,
1,
7,
16229,
9580,
68,
5,
22,
7,
9,
4403,
29955,
18,
2558,
22,
1340,
22,
500,
9,
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... |
Enable Safe Exception Handling in C++ Builder
===
For Windows 8 application certification, there are (among other) these requirements:
- 3.2 Your app must be compiled using the /SafeSEH flag to ensure safe exceptions handling
- 3.3 Your app must be compiled using the /NXCOMPAT flag to prevent data execution
- 3.4 Your app must be compiled using the /DYNAMICBASE flag for address space layout randomization (ASLR)
I wasn't able to find out how to enable either of these in C++Builder XE.
For /NXCOMPAT and /DYNAMICBASE, one can use editbin.exe from VS or peflags.exe from Cygwin. Though I would feel more confident about possible side-effects, if there was native way to enable these.
Anyway, I'm totally at loss regarding /SafeSEH. | 0 | [
2,
9240,
1834,
5391,
7988,
19,
272,
20512,
14960,
800,
3726,
3726,
26,
1936,
469,
3010,
10439,
15,
80,
50,
13,
5,
21068,
89,
6,
158,
4786,
45,
13,
8,
203,
9,
135,
154,
4865,
491,
44,
9316,
568,
14,
13,
118,
18166,
18,
4362,
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... |
Combo Box slect value
===
I have a combobox in a form and a button.
I want to add values to the combobox upon a click.
For example:
In the comboboc there are 1,2,3,4 values present. I want to add 5 upon a button click.
I am not sure how to do this. | 0 | [
2,
22621,
1649,
13,
18,
14439,
1923,
800,
3726,
3726,
31,
57,
21,
22621,
5309,
19,
21,
505,
17,
21,
5167,
9,
31,
259,
20,
3547,
4070,
20,
14,
22621,
5309,
685,
21,
10840,
9,
26,
823,
45,
19,
14,
22621,
1192,
150,
80,
50,
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... |
jQuery: programatically selecting option in Chrome
===
I have a userscript that has to change a whole list of options depending on 1 option in a select. In Opera this script works fine, but not in Chrome (Yes, jQuery is available).
HTML:
<select id="autoConfig-gametype" style="width: 100%;">
<option value="1" selected="">1. [RECOMMENDED] All latest Game-settings, Paladin, archers, simple tech smithy</option>
<option value="2">2. No paladin, archers, simple tech system [TWMASTERS Settings]</option>
<option value="3">3. No paladin, no archers. Packages, 3 lvl tech-system. [CLASSIC]</option>
</select>
<select name="game::tech">
<option value="0">0: 10 level</option>
<option value="1">1: 3 level (up to 15)</option>
<option value="2" selected="selected">2: Simple</option>
</select>
With jQuery I have used `attr` and `prop`, but both have no result in Chrome. The select that needs to be manipulated does not change.
jQuery:
$("#autoConfig-gametype").change(function()
{
var value = $(this).val();
switch(value)
{
case "1":
// Game > Tech
$("[name='game::tech'] option").removeProp("selected");
$("[name='game::tech'] option").removeAttr("selected");
$("[name='game::tech'] option:eq(0)").attr("selected",true);
$("[name='game::tech'] option:eq(0)").prop("selected",true);
break;
case "2":
// Game > Tech
$("[name='game::tech'] option").removeProp("selected");
$("[name='game::tech'] option").removeAttr("selected");
$("[name='game::tech'] option:eq(1)").attr("selected",true);
$("[name='game::tech'] option:eq(1)").prop("selected",true);
break;
case "3":
// Game > Tech
$("[name='game::tech'] option").removeProp("selected");
$("[name='game::tech'] option").removeAttr("selected");
$("[name='game::tech'] option:eq(2)").attr("selected",true);
$("[name='game::tech'] option:eq(2)").prop("selected",true);
break;
}
});
I am kind of stuck here right now, because I am making this script for someone who only uses chrome.. | 0 | [
2,
487,
8190,
93,
45,
625,
721,
8438,
20764,
4255,
19,
13,
12985,
800,
3726,
3726,
31,
57,
21,
4155,
8741,
30,
63,
20,
753,
21,
979,
968,
16,
6368,
4758,
27,
137,
4255,
19,
21,
5407,
9,
19,
1877,
48,
3884,
693,
1123,
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... |
How do I display the name of an external protocol handler in Firefox?
===
I've written an application for Windows that handles a specific type of URL (e.g abcd://efgh) and am correctly registering my protocol handler in my application's installer, so when you click a link to (for example) abcd://efgh, the protocol handler for the abcd protocol handles the request. After I install my app (which registers the protocol handler), the first time I click on that link in Firefox, a dialog is displayed saying "This link needs to be opened with an application." In the dialog there is a list view, and the first entry in the list view is selected, but there is no text there. Selecting this empty view and clicking "OK" dismisses the dialog and runs my protocol handler.
How do I get this Firefox dialog to display a name for my protocol handler?
Note: I also have to install a Firefox extension, so adding code to my extension to do this is a possibility. | 0 | [
2,
184,
107,
31,
3042,
14,
204,
16,
40,
4886,
8494,
24641,
19,
535,
18219,
60,
800,
3726,
3726,
31,
22,
195,
642,
40,
3010,
26,
1936,
30,
3053,
18,
21,
1903,
1001,
16,
287,
6362,
13,
5,
62,
9,
263,
5079,
43,
6903,
6917,
4780,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Does Twitter track a tweets originating IP Address?
===
I had an iPad stolen a few months ago. A few days ago, the thief accidentally tweeted a random photo. That iPad has location services and iCloud disabled, so that's out. But, it brings me to the question at hand...
Does Twitter track the originating IP address for each tweet? If so, is there any immediate way to get it? I don't see it in any API documentation.
Here is all the data I can muster about said tweet: http://api.twitter.com/1/statuses/show/215632207346270209.json | 2 | [
2,
630,
10623,
792,
21,
20224,
18,
17292,
15735,
3218,
60,
800,
3726,
3726,
31,
41,
40,
31,
8240,
6746,
21,
310,
818,
1464,
9,
21,
310,
509,
1464,
15,
14,
14186,
9746,
20224,
69,
21,
5477,
3056,
9,
30,
31,
8240,
63,
1474,
687,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
PL / SQL Get a certain number contiguous ROWs in a table
===
I've got a school projet kind of huge and only a few days left, so here is one problem im stack on, hope you can help.
I've got this table :
places(id, otherInfo)
Simple enough, well I'd need to make a SQL query or PL/SQL (oracle) function to retrieve a certain number of contiguous rows. Like if I call the function like this :
getContiguousPlaces(3);
On the table which has
ID
1
4
5
6
18
19
I want to get rows number 4,5 and 6.
How could I do that ? | 0 | [
2,
12443,
13,
118,
4444,
255,
164,
21,
1200,
234,
1065,
8407,
9627,
11295,
19,
21,
859,
800,
3726,
3726,
31,
22,
195,
330,
21,
116,
895,
10307,
825,
16,
2329,
17,
104,
21,
310,
509,
225,
15,
86,
235,
25,
53,
1448,
797,
7566,
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... |
Calculate Euclidean distance matrix on GPU
===
Let `p` be a matrix of first set of locations where each row gives the coordinates of a particular point. Similarly, let `q` be a matrix of second set of locations where each row gives the coordinates of a particular point.
Then formula for pairwise Euclidean distance is:
k(i,j) = (p(i,:) - q(j,:))*(p(i,:) - q(j,:))',
where `p(i,:)` denotes `i`-th row of matrix `p`, and `p'` denotes the transpose of `p`.
I would like to compute matrix `k` on CUDA-enabled GPU (NVidia Tesla) in C++. I have OpenCV v.2.4.1 with GPU support but I'm open to other alternatives, like Thrust library. However, I'm not too familiar with GPU programming. Can you suggest an efficient way to accomplish this task? What C++ libraries should I use?
| 0 | [
2,
18469,
22422,
5609,
1583,
8187,
27,
489,
4201,
800,
3726,
3726,
408,
13,
1,
306,
1,
44,
21,
8187,
16,
64,
309,
16,
4095,
113,
206,
3131,
2352,
14,
13714,
16,
21,
1498,
454,
9,
5843,
15,
408,
13,
1,
1251,
1,
44,
21,
8187,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Determining session ID from WebDriverJS
===
I'm trying to run WebDriverJS on the browser, but the documentation is somewhat vague on how to get it controlling the host browser. Here, it says:
> Launching a browser to run a WebDriver test against another browser is a tad redundant
> (compared to simply using node). Instead, using WebDriverJS in the browser is intended for
> automating the browser actually running the script. This can be accomplished as long as the > URL for the server and session ID for the browser are known. While these values may be
> passed to the builder directly, they may also be defined using the wdurl and wdsid
> "environment variables", which are parsed from the loading page's URL query data:
<!-- Assuming HTML URL is /test.html?wdurl=http://localhost:4444/wd/hub&wdsid=foo1234 -->
<!DOCTYPE html>
<script src="webdriver.js"></script>
<input id="input" type="text"/>
<script>
// Attaches to the server and session controlling this browser.
var driver = new webdriver.Builder().build();
var input = driver.findElement(webdriver.By.tagName('input'));
input.sendKeys('foo bar baz').then(function() {
assertEquals('foo bar baz',
document.getElementById('input').value);
});
</script>
I want to open up my test page from Node.js, and then run the commands included in the client-side script. However, I don't know how I would be able to extract the session ID (wdsid query parameter) when I build the session. Does anyone have any idea? | 0 | [
2,
13521,
3723,
4924,
37,
2741,
21752,
728,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
485,
2741,
21752,
728,
18,
27,
14,
16495,
15,
47,
14,
13945,
25,
4131,
14800,
27,
184,
20,
164,
32,
10106,
14,
2015,
16495,
9,
235,
15,
32,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Gmaps4rails: How can I center the map on custom location on fly?
===
I'm trying to set the center of map in ajax callback function. I have this:
window.onload = function() {
navigator.geolocation.getCurrentPosition(function(loc) {
lat = loc.coords.latitude;
lng = loc.coords.longitude;
$.getJSON('/near', { lat: lat, lng: lng }, function(json) {
$(".map_container").show();
Gmaps.loadMaps();
Gmaps.map.addMarkers(json);
Gmaps.map.serviceObject.setCenter(new google.maps.LatLng(lat, lng)); //not workin
});
});
};
,but it does not center the map. Any ideas how to get it work? | 0 | [
2,
13,
14336,
1919,
300,
7301,
18,
45,
184,
92,
31,
459,
14,
2942,
27,
5816,
1474,
27,
2855,
60,
800,
3726,
3726,
31,
22,
79,
749,
20,
309,
14,
459,
16,
2942,
19,
20624,
645,
1958,
1990,
9,
31,
57,
48,
45,
1463,
9,
218,
8294... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I get the RDF node or statement that represents the objects which have a certain [property,object] pair?
===
Okay, to clarify, I have an XML/RDF file that describes data with a natural categorical tree structure (like folders and files). The data is not structured in a tree, rather, there is information that explains how to rebuild the tree (namely the nested set values of each node). I am starting with no knowledge other than the assumption that some statement in the file has a RootTree property who's object is the URI of the statement describing the root node of the tree.
Obtaining that object is easy, I simply use:
// Obtain the node describing the root of the Pearltree.
mRootProp = mModel.createProperty(Pearltree.RDF.PearlTreeNS, "rootTree");
NodeIterator roots = mModel.listObjectsOfProperty(mRootProp);
Now, I am further able to list all statements which have the property `pt:parentTree` and the object `roots.nextNode()`:
StmtIterator sit = mModel.listStatements(null, RDF.ParentTree, rootNode);
This gives me a list of all such statements. These statements are part of *elements* that look like such in the RDF/XML file (note these have a different parentTree value but appear in the same context):
`
...
<pt:RootPearl rdf:about="http://www.pearltrees.com/dcow/pearltrees-videos/id5296268#rootPearl">
<dcterms:title><![CDATA[Pearltrees videos]]></dcterms:title>
<pt:parentTree rdf:resource="http://www.pearltrees.com/dcow/pearltrees-videos/id5296268" />
<pt:inTreeSinceDate>2012-06-11T20:25:55</pt:inTreeSinceDate>
<pt:leftPos>1</pt:leftPos>
<pt:rightPos>8</pt:rightPos>
</pt:RootPearl>
<pt:PagePearl rdf:about="http://www.pearltrees.com/dcow/pearltrees-videos/id5296268#pearl46838293">
<dcterms:title><![CDATA[why Pearltrees?]]></dcterms:title>
<dcterms:identifier>http://www.youtube.com/watch?v%3di4rDqMMFx8g</dcterms:identifier>
<pt:parentTree rdf:resource="http://www.pearltrees.com/dcow/pearltrees-videos/id5296268" />
<pt:inTreeSinceDate>2012-06-11T20:25:55</pt:inTreeSinceDate>
<pt:leftPos>2</pt:leftPos>
<pt:rightPos>3</pt:rightPos>
</pt:PagePearl>
...
`
Now, what I would like to do is obtain a reference to all statements with subject sit.nextStatement()'s subject. In this example:
"http://www.pearltrees.com/dcow/pearltrees-videos/id5296268#rootPearl"
and
"http://www.pearltrees.com/dcow/pearltrees-videos/id5296268#pearl46838293"
My goal is to obtain the content of each *element* including its rightPos and leftPos so I can reconstruct the tree.
Can anyone help me out, I'm sure I'm just missing some small detail (=
| 0 | [
2,
184,
107,
31,
164,
14,
13,
897,
410,
15421,
54,
3331,
30,
4719,
14,
3916,
56,
57,
21,
1200,
636,
10890,
106,
1084,
15,
23793,
500,
2146,
60,
800,
3726,
3726,
1705,
15,
20,
23116,
15,
31,
57,
40,
23504,
118,
897,
410,
3893,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I store an HTML table while the user is viewing a single record, so I don't need to re-request it?
===
I'm using Jquery Mobile. On my page I have a table, which I'm dynamically filling via AJAX.
The user can load details for each record, which I'm also pulling in via AJAX. Currently I'm replacing the table with the detail view.
Since the application will primarly run on mobile devices, I would like to avoid re-requesting the table from the server, since it already has been loaded once (but removed from the DOM when the detail view was loaded).
**Question**:
Say I don't want to use local storage, what's the best way to tuck the table away and re-insert it into my content container when the user tries to go back to the table from the detail-view?
Is there a best practice to do this or should I just create a div.dump, append the whole table and set display="none"? | 0 | [
2,
184,
92,
31,
1718,
40,
13,
15895,
859,
133,
14,
4155,
25,
11244,
21,
345,
571,
15,
86,
31,
221,
22,
38,
376,
20,
302,
8,
99,
10351,
32,
60,
800,
3726,
3726,
31,
22,
79,
568,
487,
8190,
93,
3241,
9,
27,
51,
2478,
31,
57,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fallback solution for HTML <audio> and legacy browsers
===
I am working on creating a sound board with various audio clips.
Rather than using the standard HTML5 audio controls, I want to style each button with some title text, so that when a user presses a button, the associated clip plays.
Everything is working fine in HTML 5 browsers (Chrome, Firefox, Safari, and IE9+), using the following code:
<script type="text/javascript" charset="utf-8">
$(function() {
$("audio").removeAttr("controls").each(function(i, audioElement) {
var audio = $(this);
var that = this; //closure to keep reference to current audio tag
$("#doc").append($('<button>'+audio.attr("title")+'</button>').click(function() {
that.play();
}));
});
});
</script>
<!-- Sample Audio Clip -->
<audio controls preload="auto" autobuffer title="Sounds of Laughter">
<source src="assets/clips/1.mp3" />
<source src="assets/clips/1.ogg" />
</audio>
However, this solution is not supported on non-HTML 5 compliant browsers like Internet Explorer 8.
I am looking for some sort of workaround solution that will allow me to either (a) detect if a browser doesn't support the HTML 5 <audio> tag and redirect to an alternate version of the sound board or (b) use a fallback (flash, etc.) with custom styling on the button if <audio> support is not present. | 0 | [
2,
1080,
1958,
4295,
26,
13,
15895,
13,
1,
1346,
6921,
1,
17,
7780,
16495,
18,
800,
3726,
3726,
31,
589,
638,
27,
2936,
21,
646,
686,
29,
617,
4023,
17270,
9,
864,
119,
568,
14,
1236,
13,
15895,
264,
4023,
8671,
15,
31,
259,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Code Igniter whats wrong with my code
===
can you see what is wrong with my code?
this is the error I am getting:
Parse error: syntax error, unexpected '}' in /Applications/XAMPP/xamppfiles/htdocs/BLOCK/application/controllers/email.php on line 36
Greatly appreciated!
<?php
class Email extends CI_Controller{
function __construct(){
parent::CI_Controller();
}
function index(){
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxx',
'smtp_pass' => 'xxx'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('xxx', 'name');
$this->email->to('xxx');
$this->email->subject('EMAIL TEST');
$this->email->message('Its working...');
if($this->email->send()){
echo 'Successfully sent.';
}
else{show_error($this->email->print_debugger())}
}
} | 3 | [
2,
1797,
31,
16606,
815,
98,
18,
1389,
29,
51,
1797,
800,
3726,
3726,
92,
42,
196,
98,
25,
1389,
29,
51,
1797,
60,
48,
25,
14,
7019,
31,
589,
1017,
45,
2017,
870,
7019,
45,
22649,
7019,
15,
9380,
13,
22,
1,
22,
19,
13,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Maintain Page State and URL parameter after server side validation
===
I am working on demo application for learning purpose. Need some help below. My requirement is to use SERVLET/JSP for this. Values are hard coded just for demo purpose.
**Question: Manage Page State after Server Side Validation**
***Manage Page State?***
Form submitted and doPost called on Servlet. In case of error need to post submitted values back to posted to refill form values.
**Got 2 options: please look at my servlet doPost**
Should I use session
Should I use user object --> I have used this
*Am I doing it right or is there any better approach?*
**Question 2 Important**
I arrive at UserEdit.jsp page from UserList.jsp page which uses URL Pattern like /user/edit than my URL in browser is `http://localhost:8080/Navigation/user/edit?id=10`. I pass id for demo purpose right now.
**Problem:** In case of form input error when I use `getServletContext().getRequestDispatcher("/WEB-INF/admin/UserEdit.jsp").forward(req, res);`
than my URL is changed and becomes `http://localhost:8080/Navigation/user/edit`.
How can I keep my same URL with id paramter like ?id=10 in URL. I have tried alot but solution found yet. See my Servlet.
**User Class**
package com.myapp.web;
public class User {
private Long id;
private String firstname;
private String lastname;
public User() {};
public User(Long id, String firstname, String lastname) {
this.id = id;
this.firstname = firstname;
this.lastname = lastname;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getFirstName() {
return firstname;
}
public void setFirstName(String firstname) {
this.firstname = firstname.trim();
}
public String getLastName() {
return lastname;
}
public void setLastName(String lastname) {
this.lastname = lastname.trim();
}
}
**One SERVLET for CRUD operation.**
package com.myapp.web;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/user/*")
public class UserServlet extends HttpServlet {
private static final long serialVersionUID = 1L;
User user;
public UserServlet() {
super();
}
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
String action = req.getPathInfo();
System.out.println("doGet action = " + action);
if (action.equals("/edit")) {
System.out.println("/UserEdit.jsp");
user = new User();
String id = req.getParameter("id");
user.setFirstName("Jhon");
user.setLastName("Doe");
req.setAttribute("user", user);
getServletContext().getRequestDispatcher("/WEB-INF/admin/UserEdit.jsp").forward(req, res);
} else {
getServletContext().getRequestDispatcher("/WEB-INF/admin/UserList.jsp").forward(req, res);
}
}
protected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,
IOException {
user = new User();
Map<String, String> errors = new HashMap<String, String>();
String action = req.getPathInfo();
System.out.println("doPost action = " + action);
user.setFirstName(req.getParameter("firstname"));
user.setLastName(req.getParameter("lastname"));
if (user.getFirstName().isEmpty())
errors.put("firstname", "Please enter firstname.");
if (user.getLastName().isEmpty())
errors.put("lastname", "Please enter lastname.");
if (action.equals("/edit")) {
if (!errors.isEmpty()) {
req.setAttribute("errors", errors);
req.setAttribute("user", user);
//getServletContext().getRequestDispatcher("/WEB-INF/admin/UserEdit.jsp?id=" + req.getParameter("id")).forward(req, res);
getServletContext().getRequestDispatcher("/WEB-INF/admin/UserEdit.jsp").forward(req, res);
} else {
req.setAttribute("success", "Form Successfully submitted");
req.setAttribute("user", user);
getServletContext().getRequestDispatcher("/WEB-INF/admin/UserEdit.jsp").forward(req, res);
}
}
}
}
***2 pages in /WEB-INF/admin***
**UserList.jsp**
<div><a href="${pageContext.request.contextPath}/user/edit?id=10">Go To Edit</a></div>
**UserEdit.jsp**
<a href="${pageContext.request.contextPath}/user/list">Go To List</a>
<form action="${pageContext.request.contextPath}/user/edit" method="post">
<fieldset>
<div>
<label for="firstname">FirstName</label>
<input type="text" name="firstname" id="firstname" value="${user.firstName}" />
<div style="color: red;">${errors.firstname}</div>
</div>
<div>
<label for="lastname">LastName</label>
<input type="text" name="lastname" id="lastname" value="${user.lastName}" />
<div style="color: red;">${errors.lastname}</div>
</div>
</fieldset>
<input type="submit" value="Submit" />
</form>
<div style="color: blue;">${success}</div> | 0 | [
2,
4027,
2478,
146,
17,
287,
6362,
18906,
75,
8128,
270,
27999,
800,
3726,
3726,
31,
589,
638,
27,
8376,
3010,
26,
2477,
2131,
9,
376,
109,
448,
1021,
9,
51,
8981,
25,
20,
275,
13,
10321,
1336,
118,
728,
3401,
26,
48,
9,
4070,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
3D level editor for concepts/sketches in WPF/C#
===
I used to work with the Hammer editor of Valve for my Portal 2 mod, however if I just want to draw a basic concept or sketch for chambers while brainstorming, the editor has just *too much* features so I can not focus on what I really need and have to mess around with specific things I don't need. Therefore I am thinking about the development of a simple tool (in C# based on WPF/XAML) which is optimized for basic level geometry, only consisting of cubes/voxels, and a few gameplay entities. For the moment I am doing some research to approximate whether this is a good idea or whether this would be wasted time.
So far my requirements would be:
- tiled view with a 3d window and different 2d perspectives known from different 3d editing tools (the 2d views could be made optional to simplify the usability)
- camera movement in the 3d window
- basic item handling including selection, movement and rotation
Although I have specific details about the file formats I don't want to mess with that in the early stages where I just want to get the editor working. Anything related to (de)serialization is not part of this question.
----------
My questions:
1. Are there any similiar projects I might have a look into or even reuse?
2. Which resources (tutorials, books, articles, ...) would you recommend for the development of such an editor? | 0 | [
2,
203,
43,
662,
1835,
26,
8700,
118,
18,
7572,
5370,
19,
619,
7721,
118,
150,
5910,
800,
3726,
3726,
31,
147,
20,
170,
29,
14,
5416,
1835,
16,
11291,
26,
51,
8281,
172,
7226,
15,
207,
100,
31,
114,
259,
20,
2003,
21,
2125,
24... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Javascript event listener works in browser, not in phonegap?
===
I am writing a color picker with an RGB slider in jquery mobile for a phonegap application. it works in the browser, but does NOT work when pushed to the phone (using phonegap/eclipse). I don't know how to get javascript console feedback using phonegap, so I am kind of at a loss.
I have tried using ".on .change .live .bind" for the change event listeners and all of them I can get working in the browser, but NONE in the phonegap application.
Here is the javascript:
$(function () {
$("#red, #green, #blue").change(function () {
var red = $("#red").val();
var green = $("#green").val();
var blue = $("#blue").val();
var redp = Math.round((red * 100) / 255);
var greenp = Math.round((green * 100) / 255);
var bluep = Math.round((blue * 100) / 255);
$('#redrgb').html(red);
$('#greenrgb').html(green);
$('#bluergb').html(blue);
$('#redpercent').html(redp + "%");
$('#greenpercent').html(greenp + "%");
$('#bluepercent').html(bluep + "%");
$("#swatch").css("background-color", "rgb(" + red + "," + green + "," + blue + ")");
console.log(red); }); });
Here is the HTML
<div id="colorpicker">
<div id="swatch">
<div class="rgb swatchtext" id="redrgb">255</div><div class="percent swatchtext" id="redpercent">100%</div>
<div class="rgb swatchtext" id="greenrgb">140</div><div class="percent swatchtext" id="greenpercent">55%</div>
<div class="rgb swatchtext" id="bluergb">60</div><div class="percent swatchtext" id="bluepercent">24%</div>
</div>
<div class="rgbslider" id="sliderred"><input type="range" class="rgbsliders" id="red" value="255" min="0" max="255" /></div>
<div class="rgbslider" id="slidergreen"><input type="range" class="rgbsliders" id="green" value="140" min="0" max="255" /></div>
<div class="rgbslider" id="sliderblue"><input type="range" class="rgbsliders" id="blue" value="60" min="0" max="255" /></div>
</div>
I am using JQuery-Mobile, phonegap, and right now I'm testing on android, but once I get it working it will be on iOS as well. | 0 | [
2,
8247,
8741,
807,
21772,
693,
19,
16495,
15,
52,
19,
1132,
1136,
306,
60,
800,
3726,
3726,
31,
589,
1174,
21,
1665,
2036,
106,
29,
40,
761,
11400,
3295,
106,
19,
487,
8190,
93,
3241,
26,
21,
1132,
1136,
306,
3010,
9,
32,
693,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
database two column logical OR index, or create separate 'index' table
===
I have this following table:
Matches -> match_id, team_a_id , team_b_id, score
This table will record matches between two teams (team A and team B). However, sometimes team A play as the host and sometimes team B plays as the host. Therefore, when I tried to find history matches between team a and team b. What I currently I am doing is to
select * from matches where (team_a_id = 1 and team_b_id = 2) or (team_a_id = 2 and team_b_id = 1);
Is there any better approach to such case? As for the query above, am I right to include index of combination team_a_id and team_b_id? But even so, then I still have a Logical OR condition between AB OR BA.
**Alternatively**,
I have another idea, that is to have another table let say history
History -> team_hash, match_id
I manually build team_hash where `hash(a,b) == hash(b,a)`. But this result in slightly slower insert but faster read. Or is it really faster read? | 0 | [
2,
6018,
81,
4698,
11545,
54,
4348,
15,
54,
1600,
1725,
13,
22,
25671,
22,
859,
800,
3726,
3726,
31,
57,
48,
249,
859,
45,
1717,
13,
8,
1,
730,
1,
1340,
15,
173,
1,
58,
1,
1340,
13,
15,
173,
1,
220,
1,
1340,
15,
1618,
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... |
“Content-Disposition: form-data;” text appears
===
Under Drupal 7 some text appears in the bottom of each page:
</div> <!-- end of body_wrapper-->
-----------------------------298121937530093
Content-Disposition: form-data; name="func"
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery(document).ready(function () { });
//--><!]]>
</script>
</body>
</html>
How to get rid of it?
| 0 | [
2,
13,
1,
25424,
8,
2906,
9339,
45,
505,
8,
18768,
73,
1,
1854,
1780,
800,
3726,
3726,
131,
15708,
6720,
453,
109,
1854,
1780,
19,
14,
2129,
16,
206,
2478,
45,
13,
1,
118,
12916,
1,
13,
1,
187,
8,
8,
241,
16,
358,
1,
499,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Heap sort or quick sort better one?
===
I gave a written round of a company
i have a doubt in a question can anyone help me?
`which is the fastest sorting algorithm among the following?
a - bubble sort
b - shell sort
c - heap sort
d - quick sort`
i m confused b/w quick sort and heap sort both have a time complexity of O(nlogn). | 0 | [
2,
15414,
2058,
54,
2231,
2058,
574,
53,
60,
800,
3726,
3726,
31,
492,
21,
642,
560,
16,
21,
237,
31,
57,
21,
3063,
19,
21,
1301,
92,
1276,
448,
55,
60,
13,
1,
2140,
25,
14,
7518,
2058,
68,
9083,
497,
14,
249,
60,
21,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get all associate/composite objects inside an object (in Abstract way)
===
**Business**:
I have a payment system in which payment can be made though GiftCoupon, ClubMembershipCard etc. One payment itself can have multiple payment components
**Class**:
I have a Payment class. It has payment components like GiftCouponPayment, ClubMembershipCardPayment, CashPayment and so on. Each component type satisfy a common interface IPaymentComponent. I have implemented it using the knowledge about the existing types.
**Questions**
1) How to implement this function in a **abstract** way – without knowing what all are the types that exist? That means it need to work for all types that implement IPaymentComponent interface.
2) Is it association or composition when LINQ to SQL generate GiftCouponPayment entities inside Payment object?
Note: I am using LINQ to SQL as ORM. GiftCouponPayment and Payment are autogenerated classes and these objects are created by ORM. I have added more functionality to these classes by using partial classes.
**LINQ to SQL Diagram**
![enter image description here][1]
**C# CODE**
public interface IPaymentComponent
{
int MyID { get; set; }
int GetEffectiveValue();
}
public partial class GiftCouponPayment : IPaymentComponent
{
public int MyID
{
get
{
return this.GiftCouponPaymentID;
}
set
{
this.GiftCouponPaymentID = value;
}
}
public int GetEffectiveValue()
{
if (this.CouponNumber < 2000)
{
return 0;
}
return this.CouponValue;
}
}
public partial class Payment
{
public List<IPaymentComponent> AllPaymentComponents()
{
List<IPaymentComponent> allPayComps = new List<IPaymentComponent>();
List<GiftCouponPayment> giftCouponPaymentList = new List<GiftCouponPayment>();
List<CashPayment> cashPaymentList = new List<CashPayment>();
foreach (GiftCouponPayment g in this.GiftCouponPayments)
{
giftCouponPaymentList.Add(g);
allPayComps.Add(g);
}
foreach (CashPayment c in this.CashPayments)
{
cashPaymentList.Add(c);
allPayComps.Add(c);
}
return allPayComps;
}
}
[1]: http://i.stack.imgur.com/VFyEf.jpg | 0 | [
2,
164,
65,
4169,
118,
960,
14882,
591,
3916,
572,
40,
3095,
13,
5,
108,
8502,
161,
6,
800,
3726,
3726,
13,
1409,
18717,
1409,
45,
31,
57,
21,
7582,
329,
19,
56,
7582,
92,
44,
117,
362,
4207,
17856,
218,
15,
288,
6990,
2418,
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... |
gnuplot data dgrid3d changes circle to square
===
I have unstructured data in my file, thats really long. I want to create a coloured pm3d graph. from what I understand, i have to interpolate the data with set dgrid3d. However if I do that, my data points which are on a circular xy Area are interpolated to a square. Any idea how to avoid this? Sorting the data in the file by hand is no option... | 0 | [
2,
26092,
13221,
38,
1054,
13,
43,
16375,
240,
43,
1693,
2775,
20,
735,
800,
3726,
3726,
31,
57,
367,
13971,
43,
1054,
19,
51,
3893,
15,
30,
18,
510,
175,
9,
31,
259,
20,
1600,
21,
16246,
6736,
240,
43,
7210,
9,
37,
98,
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... |
How do you choose the EC2 instance for your django app?
===
My team has created a nice django app and now it is going to be deployed on an EC2 instance. Now there are a few questions that I am looking answer for:
* How do I decide which instance is good for my app (micro, small, medium, large etc.). In other words how can I tell how much memory/processing power is required by this application.
* How can I quantify maximum number of concurrent users on my server. This is important for this application, I need to know how many users would be supported by micro/small/medium or large instance.
* Should I go for everything installed on a single instance or should I have separate instance for database, backups and application.
* How can I have an estimate of extra resources required with addition of each user (I think this would not be linear)
I know that answer to these questions are very subjective and most of the things depend on application design and architecture. Therefore, I am more interested in getting to know the process involved in making such decisions. | 2 | [
2,
184,
107,
42,
3538,
14,
6695,
135,
4851,
26,
154,
3857,
14541,
4865,
60,
800,
3726,
3726,
51,
173,
63,
679,
21,
2210,
3857,
14541,
4865,
17,
130,
32,
25,
228,
20,
44,
6698,
27,
40,
6695,
135,
4851,
9,
130,
80,
50,
21,
310,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cannot cast expression of type 'string' to type 'ScatterView'
===
I have a [SurfaceRadioButton][1] that has to change the **Visibility** of [ScatterView][2] (scatterViewCoordinates)
First, what I have done was to change the Visibility of the object ()
private void CoordinatesChecked(object sender, RoutedEventArgs e)
{
scatterViewCoordinates.Visibility = Visibility.Visible;
}
After that I modified the XAML code, and I included the name of the ScatterView in the Tag value of the SurfaceRadioButton.
<s:SurfaceRadioButton Name="Coordinates" Content="Coordinates"
Checked="CoordinatesChecked" Tag="scatterViewCoordinates" />
Now I was trying to cast the Tag value contained in the SurfaceRadioButton to a ScatterView, and after that to call the Visibility method.
private void CoordinatesChecked(object sender, RoutedEventArgs e)
{
string senderName = ((SurfaceRadioButton)sender).Tag.ToString();
((ScatterView)senderName).Visibility = Visibility.Hidden;
}
And I get this error
`Cannot cast expression of type 'string' to type 'ScatterView'`
Any ideas to resolve this problem (I don't even now if this respect the MVVM concept :s) ?
Suggestions are welcomed too.
[1]: http://msdn.microsoft.com/en-us/library/microsoft.surface.presentation.controls.surfaceradiobutton.aspx
[2]: http://msdn.microsoft.com/en-us/library/microsoft.surface.presentation.controls.scatterview.aspx | 0 | [
2,
1967,
1325,
1803,
16,
1001,
13,
22,
11130,
22,
20,
1001,
13,
22,
18,
5782,
815,
4725,
22,
800,
3726,
3726,
31,
57,
21,
636,
18830,
11129,
811,
444,
500,
2558,
165,
500,
30,
63,
20,
753,
14,
13,
1409,
3762,
14264,
1409,
16,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can I initialize a value to a pointer?
===
int *p;
*p=100;
cout<<*p;
Is this correct or it should give some error?
| 0 | [
2,
92,
31,
2104,
2952,
21,
1923,
20,
21,
454,
106,
60,
800,
3726,
3726,
19,
38,
1637,
306,
73,
1637,
306,
3726,
4031,
73,
272,
1320,
1,
2483,
306,
73,
25,
48,
4456,
54,
32,
378,
590,
109,
7019,
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,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
How to submit Multiple Options & multiple forms in PHP
===
I have a html/php form like the following:
Form 1:
Apple
options:
-big
-medium
-small
Submit button
Form 2:
Orange
options:
-big
-medium
-small
Submit button
Table:
Items
id
user_id
fruit_type
size
Question:
Currently, user has to click on "Submit" on each of the fruit they want to resize. Is there any way to combine this into one form so user can click submit all size-options once they finished choosing them? I don't know how to write a Mysql query that can handle this because the fruit_type is different on both forms.
Secondly, how do you make the form "remember" user's current size setting and default to that selection.
| 0 | [
2,
184,
20,
12298,
1886,
6368,
279,
1886,
1997,
19,
13,
26120,
800,
3726,
3726,
31,
57,
21,
13,
15895,
118,
26120,
505,
101,
14,
249,
45,
505,
6352,
4037,
6368,
45,
13,
8,
6407,
13,
8,
28451,
13,
8,
15988,
12298,
5167,
505,
4274... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
combine ByteBuffer & FloatBufffer
===
Is there a good way to combine ByteBuffer & FloatBuffer ?
For example I get <code>byte[]</code> data and I need to convert it to <code>float[]</code> data and vice versa :
<code>byte[]</code> to <code>float[] (java.lang.UnsupportedOperationException) </code> :
byte[] bytes = new bytes[N];
ByteBuffer.wrap(bytes).asFloatBuffer().array();
<code>float[]</code> to <code>byte[]</code> :
float[] floats = new float[N];
FloatBuffer floatBuffer = FloatBuffer.wrap(floats);
ByteBuffer byteBuffer = ByteBuffer.allocate(floatBuffer.capacity() * 4);
byteBuffer.asFloatBuffer().put(floats);
byte[] bytes = byteBuffer.array(); | 0 | [
2,
12287,
34,
591,
2345,
6866,
279,
11510,
220,
5386,
2407,
800,
3726,
3726,
25,
80,
21,
254,
161,
20,
12287,
34,
591,
2345,
6866,
279,
11510,
2345,
6866,
13,
60,
26,
823,
31,
164,
13,
1,
9375,
1,
23246,
2558,
500,
1,
118,
9375,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Scrolling does not work on dynamic table
===
I have a table with class=list which outputs files that are uploaded in a server and it is created dynamically using php.The table is inside another div.The code is
<div class="list">
<table>....php code for table...</table>
</div>
I have positioned the div list in a fixed position.The css file is
.list{background:#66CDAA;width:20cm;position:fixed;top:3cm;left:11cm;}
The problem is that if table gets too big the page doen't scroll down. I have tried:
body{overflow:auto}
But it doesn't work.
As an alernative solution I know that I could add to .list
.list{overflow:auto;height:something;}
But then the list would have a fixed height which I don't want and also the table would scroll instead of the page.
So is there any alternative?? | 0 | [
2,
13,
28166,
630,
52,
170,
27,
7782,
859,
800,
3726,
3726,
31,
57,
21,
859,
29,
718,
3726,
5739,
56,
5196,
18,
6488,
30,
50,
23782,
19,
21,
8128,
17,
32,
25,
679,
7782,
1326,
568,
13,
26120,
9,
124,
859,
25,
572,
226,
13,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Adding a custom (Retina) image to a UIBarButtonItem
===
Is there anything more required to add a custom image to an iPhone UIBarButtonItem than dragging a .png with an `@2x` suffix into the project (which is roughly 40 x 40px) and specifying this image in the image field for `Bar Item` in the attributes inspector?
When I do this with a 46 x 46 image it appears stretched and pixellated and doesn't look Retina-ish at all (see attached screenshot).
ps: I've attempted cleaning the build in XCode (with shift+option+command+k as per some instructions) and have ensured the suffix is lower cased correctly with '@2x' as per some other recommendations.
![screen_grab][1]
[1]: http://i.stack.imgur.com/vSeIV.png | 0 | [
2,
4721,
21,
5816,
13,
5,
99,
9016,
6,
1961,
20,
21,
13,
5661,
1850,
811,
444,
2119,
79,
800,
3726,
3726,
25,
80,
602,
91,
1390,
20,
3547,
21,
5816,
1961,
20,
40,
21024,
13,
5661,
1850,
811,
444,
2119,
79,
119,
13052,
21,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you unit test a JavaFX controller with JUnit
===
What's the proper way of initializing the JavaFX runtime so you can unit test (with JUnit) controllers that make use of the concurrency facilities and `Platform.runLater(Runnable)`. Calling `Application.launch(...)` from the `@BeforeClass` method results in a dead lock. If `Application.launch(...)` is not called then the following error is thrown:
<pre>
java.lang.IllegalStateException: Toolkit not initialized
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:121)
at com.sun.javafx.application.PlatformImpl.runLater(PlatformImpl.java:116)
at javafx.application.Platform.runLater(Platform.java:52)
at javafx.concurrent.Task.runLater(Task.java:1042)
at javafx.concurrent.Task.updateMessage(Task.java:987)
at com.xyz.AudioSegmentExtractor.call(AudioSegmentExtractor.java:64)
at com.xyz.CompletionControllerTest.setUp(CompletionControllerTest.java:69)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
</pre> | 0 | [
2,
184,
107,
42,
1237,
1289,
21,
8247,
16488,
9919,
29,
7446,
242,
800,
3726,
3726,
98,
22,
18,
14,
4119,
161,
16,
2104,
3335,
14,
8247,
16488,
485,
891,
86,
42,
92,
1237,
1289,
13,
5,
1410,
7446,
242,
6,
9919,
18,
30,
233,
27... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to refresh Bing Maps AJAX?
===
I create Bing Maps AJAX control and initialize it with always the same values: lat, lng and zoom level. This is a default aerial map type and a maximum zoom level. And every time I get the following image:
<a href="http://i50.tinypic.com/acturr.jpg">http://i50.tinypic.com/acturr.jpg</a>
There is no any documented (or not) method to refresh the current area so I should to do zoom out and zoom in using mouse every time, it's annoying. For Google Maps I found a useful trick:
google.maps.event.trigger(this.map, 'resize');
Does Bing Maps AJAX API have something the same? | 0 | [
2,
184,
20,
24905,
18080,
6867,
20624,
60,
800,
3726,
3726,
31,
1600,
18080,
6867,
20624,
569,
17,
2104,
2952,
32,
29,
550,
14,
205,
4070,
45,
14303,
15,
644,
2723,
17,
19469,
662,
9,
48,
25,
21,
12838,
9830,
2942,
1001,
17,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to Model a TimeField in Django?
===
I have modeled a class called ConversationHistory. Whenever an instance is created I wish to set the current date and current time.
class ConversationHistory(models.Model):
contact_date = models.DateField(_(u"Conversation Date"), blank=True)
contact_time = models.DateTimeField(_(u"Conversation Time"), blank=True)
def __init__(self, *args, **kwargs):
super(ConversationHistory, self).__init__(*args, **kwargs)
self.contact_date = datetime.datetime.now()
self.contact_time = datetime.datetime.now()
The idea is that the user can later still adjust the date and time as two different fields.
I am now a bit lost how to make the time field only to show and accept time, rather than date and time. I recon it is not possible to have a time field without datetime, but then how would I show only the time in the form? | 0 | [
2,
184,
20,
1061,
21,
85,
1109,
19,
3857,
14541,
60,
800,
3726,
3726,
31,
57,
16822,
21,
718,
227,
2735,
16853,
9,
6634,
40,
4851,
25,
679,
31,
2536,
20,
309,
14,
866,
1231,
17,
866,
85,
9,
718,
2735,
16853,
5,
13998,
18,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: Activity not starting from a widget
===
I am trying to launch an activity from a home screen widget. However, the activity is not starting when I click the widget. Below is my code.
@Override
public void onReceive(Context context, Intent i) {
AppWidgetManager mgr = AppWidgetManager.getInstance(context);
Intent intent = new Intent(context, MyActivity.class);
PendingIntent pendingLayout = PendingIntent.getService(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widgetlayout);
views.setOnClickPendingIntent(R.id.widget, pendingLayout);
ComponentName comp = new ComponentName(context,
RecentTaskWidget.class.getName());
mgr.updateAppWidget(comp, views);
}
Thx!
Rahul. | 0 | [
2,
13005,
45,
2358,
52,
1422,
37,
21,
4807,
43,
3060,
800,
3726,
3726,
31,
589,
749,
20,
3394,
40,
2358,
37,
21,
213,
2324,
4807,
43,
3060,
9,
207,
15,
14,
2358,
25,
52,
1422,
76,
31,
10840,
14,
4807,
43,
3060,
9,
1021,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the difference between VC++ project lib directories and linker inputs
===
I am just approaching C++ development (from a C# background), and i am wondering what is the difference between Library Directories in C++ project settings (in Visual Studio):
![enter image description here][1]
and the Linker "Inputs" where i can also supply libraries:
Is there any fundamental difference between these?
[1]: http://i.stack.imgur.com/gdGzB.png | 0 | [
2,
98,
25,
14,
2841,
128,
13,
8990,
20512,
669,
13,
8326,
559,
1596,
17,
3508,
106,
6367,
18,
800,
3726,
3726,
31,
589,
114,
8371,
272,
20512,
522,
13,
5,
2665,
21,
272,
5910,
2395,
6,
15,
17,
31,
589,
5712,
98,
25,
14,
2841,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
chrome extenstion: a html page for input
===
im wondering if there is a possibly to add a page to the extenstion, that i can access with a link that is store in the popup page.
i want a page that stay open in a tab, so i can add input to him from the user. even if i press other tabs, becuse the popup page get closed every time(i read there is no way to keep him open)
if there is a way to creat a page like that, is it possible to use stuff like:
chrome.extension.sendRequest(null,{},function(response){.....})
and
chrome.extension.onRequest.addListener(function (request, sender, sendRespons) {
........
}
and ofcourse any other of the chrome api methods.
(sorry for my english) | 0 | [
2,
13,
12985,
1396,
8710,
3309,
45,
21,
13,
15895,
2478,
26,
6367,
800,
3726,
3726,
797,
5712,
100,
80,
25,
21,
2879,
20,
3547,
21,
2478,
20,
14,
1396,
8710,
3309,
15,
30,
31,
92,
1381,
29,
21,
3508,
30,
25,
1718,
19,
14,
1675... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
go to #id by scroll buggy on iPad
===
Example: http://bit.ly/LWZv42
Coding a one page layout with animated scroll for Nav. Everything works perfect in desktop, but on the iPad you simply can't go back and forth by clicking the nav li links. I noticed though if you click a nav link then scroll a little down/up the page it will work.
function init_siteNav(){
function goToByScroll(id){
$('html,body').animate({scrollTop: $(id).offset().top},'slow');
}
$('.siteMenu li.home a').click(function(){
goToByScroll('body');
return false;
});
$('.siteMenu li.clients a').click(function(){
goToByScroll('#portfolioWrap');
return false;
});
$('.siteMenu li.contact a').click(function(){
goToByScroll('#contactMapHolder');
return false;
});
}
Any suggestions?
| 0 | [
2,
162,
20,
6926,
1340,
34,
12159,
6256,
2687,
27,
31,
8240,
800,
3726,
3726,
823,
45,
7775,
6903,
3326,
9,
102,
118,
23281,
380,
710,
3941,
13,
15458,
21,
53,
2478,
9106,
29,
5784,
12159,
26,
16048,
9,
796,
693,
2107,
19,
17404,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
android spinner position anf if statements
===
having an odd issue here and dont know why it doesnt work, im not that used to java yet.
to determin the selected item what needs to be done?
the spinner has 8 items and 'position' never = 1, or any other number.
onItemSelected() is deffinately getting fired so is the if statement wrong?
public void onItemSelected(AdapterView parent, View v,int position, long id) {
if (position == 1) //do something
}
| 0 | [
2,
13005,
3310,
1031,
649,
40,
410,
100,
9015,
800,
3726,
3726,
452,
40,
4210,
1513,
235,
17,
1049,
143,
483,
32,
5886,
170,
15,
797,
52,
30,
147,
20,
8247,
768,
9,
20,
15190,
2160,
14,
1704,
9101,
98,
2274,
20,
44,
677,
60,
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... |
Fade Out/In UIBarButtonItem?
===
I have looked around but can't find a definitive answer. I need to fade in and out a couple of UIBarButtonItems, simple as that. How can I?
If I can't fade a UIBarButtonItem in anyway whatsoever, then what could I do as an alternative?
Thanks. Any help is always appreciated. | 0 | [
2,
11381,
70,
118,
108,
13,
5661,
1850,
811,
444,
2119,
79,
60,
800,
3726,
3726,
31,
57,
292,
140,
47,
92,
22,
38,
477,
21,
15676,
1623,
9,
31,
376,
20,
11381,
19,
17,
70,
21,
1335,
16,
13,
5661,
1850,
811,
444,
2119,
79,
18... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to write a Java annotation processor?
===
I may be just looking in the wrong direction but I find the JSE documentation on annotation processing very ... sparse. I want to write an annotation processor which processes annotated String fields and local variables to substitute them with a computed String expression. This should not be too complicated but I'm pretty lost in the Javadoc for javax.annotation.processing. | 0 | [
2,
184,
20,
2757,
21,
8247,
40,
1270,
857,
14762,
60,
800,
3726,
3726,
31,
123,
44,
114,
699,
19,
14,
1389,
1400,
47,
31,
477,
14,
487,
870,
13945,
27,
40,
1270,
857,
5511,
253,
13,
9,
9,
9,
23162,
9,
31,
259,
20,
2757,
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... |
cannot access a disposed object. Object Name:'MarshalingwindowFrame'
===
During openning my project in Visual Studio 2010 this issue came out.
![enter image description here][1]
[1]: http://i.stack.imgur.com/iCXAI.png
So, how can I fix it? Can't open DataSet and contiu any other work in VS. Please, tell me what can be th ereason? | 0 | [
2,
1967,
1381,
21,
17913,
43,
3095,
9,
3095,
204,
45,
22,
19988,
192,
68,
27508,
8361,
22,
800,
3726,
3726,
112,
368,
2981,
51,
669,
19,
3458,
1120,
498,
48,
1513,
281,
70,
9,
13,
187,
2558,
13679,
1961,
5318,
235,
500,
2558,
16... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setup Facebook Insights for page Error
===
I'm trying to set up Facebook Insights for my company's Facebook page. The tags have been put into the header on our UAT 'site by our developer. I've gone and followed the steps in the FAQ, but I keep getting the following error message:
The app ID specified within the "FB:app_id" meta tag is not allowed on this domain. You must set up the Connect Base Domains for you app to be a prefix of <Website URL>
Does anyone know why this is? Is it because it's gone into UAT first? Or is it because we don't have an app, only a fan page? Also, I'm not the page administrator, will that cause problems?
Is there a walk through available, that I can give to the Dev. team to follow and then I can get my Facebook Insights?
Apologies for the basic nature of the request, but our Dev. team don't want to get involved and it's too techy for the Social Media manager, so it's fallen to me, the Web Analyst. I don't know anything about Facebook and I have a basic knowledge of tagging and HTML, but that is all. Go easy on me!
Thanks, | 0 | [
2,
18161,
9090,
9239,
18,
26,
2478,
7019,
800,
3726,
3726,
31,
22,
79,
749,
20,
309,
71,
9090,
9239,
18,
26,
51,
237,
22,
18,
9090,
2478,
9,
14,
3383,
18,
57,
74,
442,
77,
14,
157,
106,
27,
318,
287,
721,
13,
22,
9097,
34,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Catching Magento one-page checkout redirect
===
I’ve added a step at the end of the Magento one page checkout process. After the user hits “Place Order”, this step appears.
I’ve disabled the `$result['success'] = true;` so it shouldn’t redirect, but something (after a pause) redirects to checkout/cart and I can’t figure out what JS function is responsible. | 0 | [
2,
9436,
4723,
17050,
53,
8,
6486,
2631,
1320,
302,
14706,
800,
3726,
3726,
31,
1,
195,
905,
21,
1424,
35,
14,
241,
16,
14,
4723,
17050,
53,
2478,
2631,
1320,
953,
9,
75,
14,
4155,
3858,
13,
1,
5119,
389,
1,
15,
48,
1424,
1780... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
server answer of POST request - invalid postback or callback argument
===
I am currently developping a tool to get and parse some content of an external website (not mine). I will not paste the code as i don't think it does bring anything, but if in any manner you think it's useful, i will do it.
Here are the major steps of my tool:
-Get the Web page using a regular webrequest/webresponse.
-Parse the Web page to know how many pages should be parsed (the Web page parsed is a research result, so it can provide many pages of results)
-As a page change in a regular browser is done by submitting a form, i did inspect all the POST parameters (hidden) of this form by parsing the web page.
-Create the POST request with these parameters
-Send the POST request to the server using WebClient and the UploadString() method.
Unfortunately, the last part doesn't work and throw a 500 error "Invalid postback or callback argument. Event validation is enabled using ..."
If it can help, in the hidden parameters of the form, a parameter named "EventValidation" is present, and i do provide it to the POST request.
Maybe someone could have an idea of what is going on as i am not so familiar with asp.
Please forgive my english mistakes
| 0 | [
2,
8128,
1623,
16,
678,
3772,
13,
8,
16671,
678,
1958,
54,
645,
1958,
5476,
800,
3726,
3726,
31,
589,
871,
2803,
3181,
21,
5607,
20,
164,
17,
2017,
870,
109,
2331,
16,
40,
4886,
2271,
13,
5,
1270,
1114,
6,
9,
31,
129,
52,
640,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Use GroupSizeReductionOrder in RibbonControlsLibrary with MVVM
===
I am using the RibbonControlsLibrary (.Net 4.0) for my ribbons. My implementation is completely realized using MVVM.
Now I like to use the benefit of the resizing feature. But I can't set the reduction order of the group boxes. This is because I have to define the names of the group boxes in a special order. I can't set the names of the group boxes, because I am using data templates.
I tried to bind the name of the ribbon group box user controls to a property on the datacontext, but as I supposed this doesn't work.
So, do I have any chance to set the ribbon group box user control names to a property of the data context? | 0 | [
2,
275,
1170,
11907,
69,
21263,
7861,
19,
9162,
12898,
18,
1210,
2559,
622,
29,
17967,
20147,
800,
3726,
3726,
31,
589,
568,
14,
9162,
12898,
18,
1210,
2559,
622,
13,
5,
9,
2328,
268,
9,
387,
6,
26,
51,
9162,
18,
9,
51,
6123,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Payment Gateway integration in Opencart
===
I want to integrate CitrusPay (An indian payment gateway) in my opencart application. I have received a PHP integration kit but don't know where to start in opencart. Please let me know how to add Citruspay as a payment method.
| 0 | [
2,
7582,
12171,
8078,
19,
368,
1367,
38,
800,
3726,
3726,
31,
259,
20,
18399,
22456,
12224,
13,
5,
210,
909,
7582,
12171,
6,
19,
51,
368,
1367,
38,
3010,
9,
31,
57,
420,
21,
13,
26120,
8078,
6346,
47,
221,
22,
38,
143,
113,
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... |
speed up ideas -- can CUDA help here?
===
I'm working on an algorithm that has to do a small number
of operations on a large numbers of small arrays, somewhat independently.
To give an idea:
- 1k sorting of arrays of length typically of 0.5k-1k elements.
- 1k of LU-solve of matrices that have rank 10-20.
everything is in floats.
Then, there is some horizontality to this problem: the above
operations have to be carried independently on 10k arrays.
Also, the intermediate results need not be stored: for example, i don't
need to keep the sorted arrays, only the sum of the smallest $m$ elements.
The whole thing has been programmed in c++ and runs. My question is:
would you expect a problem like this to enjoy significant speed ups
(factor 2 or more) with CUDA?
Best regards,
| 0 | [
2,
1362,
71,
3478,
13,
8,
8,
92,
272,
5729,
448,
235,
60,
800,
3726,
3726,
31,
22,
79,
638,
27,
40,
9083,
30,
63,
20,
107,
21,
284,
234,
16,
1311,
27,
21,
370,
2116,
16,
284,
7718,
18,
15,
4131,
9029,
9,
20,
590,
40,
882,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 open contact groups in phonebook programatically in android?
===
i want to open contact groups which are stored in phone book like *(family,work,friends,business etc)* from my app to get list of contacts in the group can anyone plzz share the code or any help ?? THANKYOU !! | 0 | [
2,
184,
92,
31,
368,
2203,
1170,
19,
1132,
5199,
625,
721,
8438,
19,
13005,
60,
800,
3726,
3726,
31,
259,
20,
368,
2203,
1170,
56,
50,
8214,
19,
1132,
360,
101,
1637,
5,
13819,
15,
3783,
15,
12299,
18,
15,
18717,
2722,
6,
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... |
CANNOT generate apple MDM cert
===
We successfully reg the $299 enterprise program, and can download the official mdm protocal reference.
However, I cannot generate the MDM cert, my steps:
1. Generate a new App IDs, fill in the Description and Bundle Identifier(in format com.apple.mgmt.company).
One possible problem is:I found the "Bundle seed ID" using team ID instead of "Generate new" in many docs.
2. Check newly generated App ID and found the "Push Notification" status is "Configurable" instead of "Enabled".
3. Click "Configure" of above App ID, found in the section "Enable for apple push notification service", my status is "configurable" and in action column "Configure" button is greyed out. and will prompt to "https://identity.apple.com/pushcert/" page.
| 2 | [
2,
1967,
7920,
4037,
8138,
79,
13,
17580,
800,
3726,
3726,
95,
3673,
7953,
14,
6439,
3483,
6002,
625,
15,
17,
92,
7121,
14,
989,
8138,
79,
9347,
3430,
2801,
9,
207,
15,
31,
1967,
7920,
14,
8138,
79,
13,
17580,
15,
51,
2382,
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... |
Fire multiple RESTFul calls to application without waiting for Response from previous request
===
We are using httpclient jar for RESTFul call to our applications which are hosted on different servers.
The problem is:-
1. We send a ping request to application to check whether the application is running or not.The ping request is sent within a very short interval of time of about 3-5 seconds.
But if the application sends late response>3-5 seconds then the periodic pinging is not observed..My application waits for response to come back and only then new ping request is fired.
Is there any way of firing periodic request without waiting for response time from the application..But I should also be able to discard the response which comes say after 20- seconds..This way I might avoid flooding of Restful request/response..
Please suggest... | 0 | [
2,
535,
1886,
760,
1566,
3029,
20,
3010,
366,
1672,
26,
1627,
37,
1158,
3772,
800,
3726,
3726,
95,
50,
568,
7775,
150,
18513,
38,
5112,
26,
760,
1566,
645,
20,
318,
3767,
56,
50,
2812,
27,
421,
17595,
9,
14,
1448,
25,
45,
8,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to run a script after a choice is made in a tcl tk combobox
===
I'm using [`ttk::combobox`][1] and I want to run a script each time a choice is made. But in the documentation only a `-postcommand` option exists, which runs the script _before_ the choice. How can I run the script after the choice (I want to be able to know when a choice is made).
Also, the combobox is `-state readonly` so no choices can be made through the entry.
[1]: http://www.tcl.tk/man/tcl/TkCmd/ttk_combobox.htm | 0 | [
2,
184,
20,
485,
21,
3884,
75,
21,
1837,
25,
117,
19,
21,
13,
38,
5316,
13,
38,
197,
22621,
5309,
800,
3726,
3726,
31,
22,
79,
568,
636,
1,
38,
38,
197,
45,
45,
960,
1192,
5309,
1,
500,
2558,
165,
500,
17,
31,
259,
20,
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... |
Sinatra - CSS and Javascripts not loading on certain pages
===
I'm currently developing an admin dashboard using Sinatra, and I'm finding for one route in particular, my stylesheets and javascripts aren't working.
The route is <code>'/users/:id/?'</code>
For some reason, when I hit that page, the browser is looking for <code>http::localhost:9393/users/css/my_stylesheet.css</code> instead of <code>public/css/my_stylesheet.css</code> and so-on. Why is this happening with this route? The layout file (containing the stylesheet and script links) is that same for this route as it is for any other. | 0 | [
2,
21491,
13,
8,
272,
18,
18,
17,
8247,
8741,
18,
52,
12797,
27,
1200,
4434,
800,
3726,
3726,
31,
22,
79,
871,
3561,
40,
21,
43,
2160,
26478,
568,
21491,
15,
17,
31,
22,
79,
3007,
26,
53,
858,
19,
1498,
15,
51,
1034,
17627,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Replace local file by remote file
===
How do I replace a local file by its latest version in the repository?
Is there also a way of replacing all local files which are conflicting with the corresponding files from the repository? | 0 | [
2,
3934,
375,
3893,
34,
5388,
3893,
800,
3726,
3726,
184,
107,
31,
3934,
21,
375,
3893,
34,
82,
5736,
615,
19,
14,
24869,
60,
25,
80,
67,
21,
161,
16,
5496,
65,
375,
6488,
56,
50,
22297,
29,
14,
7265,
6488,
37,
14,
24869,
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... |
Android search dialog does not open on button/action press
===
I need some second eyes on this. I have followed the basic instructions [here][1] to set up search in the application I'm working on, yet I am unable to make the search dialog appear, both using the device search button and my search action on the action bar.
As far as the action bar is concerned, I have confirmed that onSearchRequested is being called on the activity when the action is pressed. Any resources referenced in these files are existing - the application runs without errors.
My searchable.xml:
<?xml version="1.0" encoding="utf-8"?>
<searchable xmlns:android="http://schemas.android.com/apk/res/android"
android:label="@string/search_label"
android:hint="@string/search_hint" >
</searchable>
The activity definition of my search handling activity in AndroidManifest.xml:
<activity android:name=".SearchActivity">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="@xml/searchable"/>
</activity>
For each activity in which I would like search, I have added:
<meta-data android:name="android.app.default_searchable"
android:value=".SearchActivity" />
When I press any of the buttons mentioned above, nothing happens. Nothing happens in logcat either. Since onSearchRequested is being called, I'm suspecting there is something wrong with my configuration, but I have been unable to find it so far.
[1]: http://developer.android.com/guide/topics/search/search-dialog.html | 0 | [
2,
13005,
2122,
28223,
630,
52,
368,
27,
5167,
118,
8645,
901,
800,
3726,
3726,
31,
376,
109,
153,
194,
27,
48,
9,
31,
57,
709,
14,
2125,
7650,
636,
6836,
500,
2558,
165,
500,
20,
309,
71,
2122,
19,
14,
3010,
31,
22,
79,
638,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do you properly use Android's Focusable In Touch Mode in a game app?
===
I have read an Android [Touch Mode article](http://developer.android.com/resources/articles/touch-mode.html) about using (or not using) the feature of setting a `View` as focusable in touch mode. I have not found a use for it in my application yet, but despite the warnings the article has against using the feature in general, it seemingly implies in more than one place that game developers *should* be using it.
I feel like I have a good idea how the feature works, but the article never actually says how it could be useful in a game. Since my app *is* a game, I feel like I am missing something important. My question is, how is having `View`s that are focusable in touch mode useful for this purpose? | 0 | [
2,
184,
107,
42,
7428,
275,
13005,
22,
18,
1776,
579,
19,
1723,
3740,
19,
21,
250,
4865,
60,
800,
3726,
3726,
31,
57,
1302,
40,
13005,
636,
15725,
3740,
2002,
500,
5,
21127,
6903,
26051,
106,
9,
290,
18524,
9,
960,
118,
99,
1209... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 convert a string that include hex to hex in Perl?
===
For example, I have a string "\x80\x81\x82.abc\x00", then it should be converted to hex 8081822e61626300. Do you know how to do it in Perl. :)
Thanks | 0 | [
2,
184,
20,
8406,
21,
3724,
30,
468,
24,
396,
20,
24,
396,
19,
416,
255,
60,
800,
3726,
3726,
26,
823,
15,
31,
57,
21,
3724,
13,
7,
1,
396,
2887,
1,
396,
3980,
1,
396,
4075,
9,
21880,
1,
396,
2032,
7,
15,
94,
32,
378,
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... |
How set file group in XAR archive
===
I pack archive with XAR. In [TOC].xml all my files have group - staff. I need set group to wheel. How can I do this? Thanks. | 0 | [
2,
184,
309,
3893,
214,
19,
993,
512,
9250,
800,
3726,
3726,
31,
3607,
9250,
29,
993,
512,
9,
19,
636,
262,
150,
500,
9,
396,
8184,
65,
51,
6488,
57,
214,
13,
8,
1138,
9,
31,
376,
309,
214,
20,
3556,
9,
184,
92,
31,
107,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Encryption and Decryption in android programming
===
i want to create one app to encrypte and decrypt a file, i know about AES Algorithm but i need a sample to help me for start this project . thanks | 1 | [
2,
24420,
17,
121,
11435,
872,
19,
13005,
3143,
800,
3726,
3726,
31,
259,
20,
1600,
53,
4865,
20,
1957,
11435,
62,
17,
121,
11435,
21,
3893,
15,
31,
143,
88,
21,
160,
9083,
47,
31,
376,
21,
5717,
20,
448,
55,
26,
799,
48,
669,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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... |
Why doesn't my :first-child css rule get applied?
===
<!-- HTML -->
<section class="row slide">
<div class="span4">
<h1>
<span>Some</span>
<br />
<span>Title</span>
</h1>
</div>
</section>
<section class="row slide">
<div class="span4">
<h1>
<em>Some emphasis</em>
<br />
<span>Some</span>
<br />
<span>Title</span>
</h1>
</div>
</section>
<section class="row slide">
<div class="span4">
<h1>
<em>Some other emphasis</em>
<br />
<span>Some</span>
<br />
<span>Title</span>
</h1>
</div>
</section>
/* CSS */
section h1 span:first-child{
color:#FF0033;
}
I'm trying to target the first ```<span>``` in every ```<h1>``` tag that's in a ```<section>``` container but as soon as the ```<span>``` is not the first child element (like the ```<em>```) then it's not applying the rule.
| 0 | [
2,
483,
1437,
22,
38,
51,
13,
45,
3552,
8,
11287,
272,
18,
18,
1828,
164,
2435,
60,
800,
3726,
3726,
13,
1,
187,
8,
8,
13,
15895,
13,
8,
8,
1,
13,
1,
10579,
718,
3726,
7,
5417,
6464,
7,
1,
13,
1,
12916,
718,
3726,
7,
18,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
displaying errors to the user
===
I send a seach item to the server and the server returns results in xml.I realise that it returns blank when no match is found on the server database or other errors from the server. The results are displayed to the user if they are found. i want to display the error message to the user when the search result is blank and also display other errors that the server might return when a search is made to it. the format in which errors are returned as xml is as below.
<errors>
<error code =1234>
<message> error message</message>
</error>
</errors>
And the search results are also returned in the format
<searches>
<search id ='1234'>
<name> somename </name>
<address> some address </address>
<sector> some sector </sector>
<contacts> 12345, me@me.com </contacts>
<searches>
this is the loop that displays successful results to user.
<?php
$obj = simplexml_load_string($result);//result is containing the result
foreach($objj as $searches):
echo $searches -> name
endforeach
?>
I have to always check whether the root node is <searches> else i display the error message but it seem its not working. Any help.Thanks in advance | 0 | [
2,
17418,
11908,
20,
14,
4155,
800,
3726,
3726,
31,
2660,
21,
598,
673,
9101,
20,
14,
8128,
17,
14,
8128,
4815,
1736,
19,
23504,
9,
49,
16794,
30,
32,
4815,
6463,
76,
90,
730,
25,
216,
27,
14,
8128,
6018,
54,
89,
11908,
37,
14... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the Cocoa/OSX equivalent of wglMakeCurrent or glXMakeCurrent?
===
I understand that Cocoa requires that windows be created/managed on the main thread. So, I'd like to have two or three windows with unique contexts, but I'd really prefer to draw to each of them from separate threads. Plus, a little bit of Google searching seems to indicate that rapidly context-switching on one thread is pretty expensive/slow. | 0 | [
2,
98,
25,
14,
24507,
118,
759,
396,
4602,
16,
619,
8430,
11115,
17657,
54,
489,
24560,
11115,
17657,
60,
800,
3726,
3726,
31,
1369,
30,
24507,
4781,
30,
1936,
44,
679,
118,
177,
8030,
27,
14,
407,
9322,
9,
86,
15,
31,
22,
43,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
retrieving multiple values from checkbox and hidden field
===
my code works as expected but a little issue occurred, i try retrieving values from checkboxes with same name and hidden fields with the same name, it works but one of the hidden field keeps on returning the first value even if the checkbox was not selected.
here is my code
while($row=mysql_fetch_array($res1)){
?>
<tr><td class='bold'><?php echo $sn;?><input type="hidden" name="snum[]" value="<?php echo $sn; ?>" /></td>
<td><?php echo $row['subLocationName']; ?>
<input type="hidden" name="location[]" value="<?php echo $row['dllink_id']; ?>"/></td>
<td><input type="checkbox" name="available[]" value="<?php echo $row['subLocationName']; ?>"/></td>
<input type="hidden" name="locationID[]" value="<?php echo $row['locationName']; ?>"/>
<input type="hidden" name="sublocation[]" value="<?php echo $row['subLocationName']; ?>"/>
<input type="hidden" name="device[]" value="<?php echo $row['deviceName']; ?>"/>
<td></td><td></td></tr>
<?php
$sn++;
}
the values are from my database.
the retrieving code is this
if(isset($_POST['submit_btn'])){
$serial_num = $_POST['snum'];
$locationDeviceLink = $_POST['location'];
$linkAvailable =$_POST['available'];
$location = $_POST['locationID'];
$subLocation = $_POST['sublocation'];
$device = $_POST['device'];
$measure_date = date("Y-m-d");
$sn = count($linkAvailable);
for ($i=0; $i<$sn; $i++ ){
if(!empty($linkAvailable[$i])){
echo "serial number:".$serial_num[$i]." location:".$locationDeviceLink[$i]." available:".$linkAvailable[$i]." Location:".$location[$i]." subLocation:".$subLocation[$i]." Device:".$device[$i]." Date:".$measure_date."<br/>";
}
}
}
the problem is the subLocation value, it keeps returning the first value then the second as it appears even if the associated checkbox is not checked and another checkbox is checked, please can anyone help me out, cant't think of anything more.
thanks in advance
joseph O
| 0 | [
2,
13,
6239,
3272,
8397,
1886,
4070,
37,
2631,
5309,
17,
3689,
575,
800,
3726,
3726,
51,
1797,
693,
28,
1727,
47,
21,
265,
1513,
2437,
15,
31,
1131,
13,
6239,
3272,
8397,
4070,
37,
2631,
5309,
160,
29,
205,
204,
17,
3689,
2861,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Tiled map and sprites : am I doing it the right way?
===
I'm developing an old-fashioned 2D RPG with Python + pyglet.
The map is made of several layers (up to 10), each of them consituted of squared tiles (32x32 pixels). The sprites (party characters, NPC, and some others things) are drawn between two layers (usually just before the last).
To render it, I use a single Batch, with many OrderedGroups : one group per layer, and a group per sprite.
The problem with sprites is that they must be rendered in the decreasing order of their y value, so groups are arranged as follow (let's suppose there's 3 layers in the map, and that 2 sprites must be drawn just before the last) :
g[0] = OrderedGroup(0) : first layer
g[1] = OrderedGroup(1) : second layer
g[2] = OrderedGroup(2) : empty, serves as a base for the following :
OrderedGroup(0, parent = g[2]) : the highest sprite
OrderedGroup(1, parent = g[2]) : the lowest sprite
g[3] = OrderedGroup(3) : the third layer
When I add layer-sprites to the batch, I specify that they are static. When I add party sprites, they are 'dynamic'.
So my first question : since they all belong to the same batch, isn't it contradictory ? (said differently : is 'static' or 'dynamic' a property of the sprite object, or of the batch ?) (note : I precise that I have really few knowledge about OpenGL and have no idea how batch and groups are implemented)
For the time being, performance is correct (I want 60 fps, and I have them up to 8 moving sprites), but perfomance decreases quickly with more than 8 moving sprites (which should not happen in the final game, but I'd like my engine to be the most efficient possible without translating parts in C/ASM).
So my second question : is the strategy I choose (use batch, and as few as possible) the good one ?
Thanks in advance for answers | 0 | [
2,
9189,
69,
2942,
17,
27902,
18,
13,
45,
589,
31,
845,
32,
14,
193,
161,
60,
800,
3726,
3726,
31,
22,
79,
3561,
40,
315,
8,
15016,
172,
43,
22338,
29,
20059,
2754,
13,
28860,
1336,
9,
14,
2942,
25,
117,
16,
238,
9124,
13,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How can I use multiple Gemfiles for my application?
===
I am working with a team of developers, and we are all using the same Gemfile from our repository. Because I am working on a Mac, and others are using Ubuntu, we have a Gemfile.local.example file in our repository as well that has the appropriate notification gems for each OS, all commented out.
I un-commented the gems for my OS and saved as a new file, not in version control, Gemfile.local. Now I would like "bundle install" to install gems from both files.
I can't find any good documentation on doing this. | 0 | [
2,
184,
92,
31,
275,
1886,
8551,
16877,
18,
26,
51,
3010,
60,
800,
3726,
3726,
31,
589,
638,
29,
21,
173,
16,
10168,
15,
17,
95,
50,
65,
568,
14,
205,
8551,
16877,
37,
318,
24869,
9,
185,
31,
589,
638,
27,
21,
1572,
15,
17,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
rails 3 single table inheritance with multiple forms
===
I have set up a rails application that uses single table inheritance but I need to have a distinct form for my child classes. The application keeps a collection of indicators of security compromise, such as malicious IP addresses. So I have a class called Indicator which holds most of the information. However, if the indicator is a malware hash I need to collect additional information. So I created another class called MalwareIndicator which inherits from Indicator. Everything is working fine with that.
I wanted my routes to be restful and look nice so I have this in my config/routes.rb file
resources :indicators
resources :malware, :controller => "indicators", :type => "MalwareIndicator"
That works very nicely. I have all these routes that point back to my single controller. But then in the controller I'm not sure how to handle multiple forms. For example, if someone goes to malware/new the Indicators#New funtion is called and it is able to figure out that the user wants to create a MalwareIndicator. So what must my respond_to block look like in order to send the user to the correct form? Right now it still sends the user to the new indicator form.
def new
if params[:type] == "MalwareIndicator"
@indicator = MalwareIndicator.new
else
@indicator = Indicator.new
end
@pagename = "New Indicator(s)"
respond_to do |format|
format.html # new.html.erb
format.json { render json: @indicator }
end
end
I feel like I'm pretty close. On the other hand, I might be doing everything wrong so if anyone wants to slap me and say "quit being a dumbass" I would be grateful for that as well. | 0 | [
2,
2240,
18,
203,
345,
859,
13852,
29,
1886,
1997,
800,
3726,
3726,
31,
57,
309,
71,
21,
2240,
18,
3010,
30,
2027,
345,
859,
13852,
47,
31,
376,
20,
57,
21,
4421,
505,
26,
51,
850,
2684,
9,
14,
3010,
8968,
21,
1206,
16,
13310,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 Clean URLs not working as intended
===
I am trying to use a .htaccess file to change my URLs from
xxx\table\change.php?id=1
to
xxx\table\change\1
I have the following code in my .htaccess file, which is in the root folder of my web site.
RewriteEngine On
RewriteRule ^change/([^/\.]+)/?$ change.php?id=$1 [L]
RewriteRule ^change/([^/\.]+)/?$ change.php?id=$1 [L]
However when I restart Apache and visit the desired URL, it still shows up as
xxx\table\change.php?id=1
Any suggestions?
mod_rewrite is uncommented in the httpd.conf file. | 0 | [
2,
13,
26120,
2745,
13,
911,
7532,
52,
638,
28,
2081,
800,
3726,
3726,
31,
589,
749,
20,
275,
21,
13,
9,
9020,
20604,
3893,
20,
753,
51,
13,
911,
7532,
37,
13,
13290,
1,
5924,
1,
16229,
9,
26120,
60,
1340,
3726,
165,
20,
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... |
Why is my NSRange always 0?
===
I want to implement a delete key for my calculator app. My pseudocode for this was:
foo = length of current number
bar = length of current number-1
current number = current number with character at index (foo-bar) removed
To do this in objective-c I have tried to implement this using the NSRange function as well as the StringbyappendingString method:
- (IBAction)DelPressed {
if ([self.display.text length] >=2)
{
int len = [self.display.text length];//Length of entire display
//Add to the brainlong printing out the length of the entire display
self.brainlog.text = [NSString stringWithFormat:@"Len is %g",len];
int le = ([self.display.text length]-1);//Length of entire display - 1
NSString *lestring = [NSString stringWithFormat:@"LE is %g",le];
//Add to the brainlog printing out the length of the display -1
self.brainlog.text = [self.brainlog.text stringByAppendingString:lestring];
NSRange range = NSMakeRange(le, len);//range only includes the last character
self.display.text = [self.display.text stringByReplacingCharactersInRange:range withString:@" "];//Replace the last character with whitespace
}
The output to brainlog (ie the length of both le and len) is:
Len is -1.99164 Le is -1.99164
Hard to see, but here's an image of the number I input to the calculator using the iOS simulator:

I have tried to change the value of le (ie making it the length of the display -3 or -5 etc) and both le and len are still the same.
I have also tried to make le in reference to len:
int len = [self.display.text length];//Length of entire display
//Add to the brainlong printing out the length of the entire display
self.brainlog.text = [NSString stringWithFormat:@"Len is %g",len];
int le = len-1;
But the values of the two are still the same. How can I use NSRange to delete the last character of the display? | 0 | [
2,
483,
25,
51,
13,
2172,
8366,
550,
713,
60,
800,
3726,
3726,
31,
259,
20,
8713,
21,
27448,
1246,
26,
51,
28539,
4865,
9,
51,
8452,
9375,
26,
48,
23,
45,
4310,
111,
800,
1476,
16,
866,
234,
748,
800,
1476,
16,
866,
234,
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... |
Bitmap loading from url using Async tasks and handling concurrency
===
I used the same code as shown in the link[Multithreading For performance][1], but I cant see the image on the screen.
[1]: http://android-developers.blogspot.in/2010/07/multithreading-for-performance.html | 0 | [
2,
1142,
15022,
12797,
37,
287,
6362,
568,
21,
9507,
150,
8674,
17,
7988,
25547,
800,
3726,
3726,
31,
147,
14,
205,
1797,
28,
1721,
19,
14,
3508,
2558,
21531,
96,
22883,
26,
956,
500,
2558,
165,
500,
15,
47,
31,
2973,
196,
14,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to run specific pages on https
===
I have used a rule to redirect pages to https.The following is the rule in web.config:
<rewrite>
<rules>
<rule name="HTTPs Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{ALL_HTTP}" matchType="Pattern"
pattern="HTTP_X_FORWARDED_PROTO:https" ignoreCase="true" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" />
</rule>
</rewrite>
This rule is redirecting all the pages to https but I want to redirect some pages of my application like if I have two pages test.aspx and test1.aspx then i want to redirect test.aspx to https and test1.aspx to http.
How it will be possible.
Thanks | 0 | [
2,
184,
20,
485,
1903,
4434,
27,
7775,
18,
800,
3726,
3726,
31,
57,
147,
21,
1828,
20,
302,
14706,
4434,
20,
7775,
18,
9,
124,
249,
25,
14,
1828,
19,
2741,
9,
14093,
2816,
45,
13,
1,
99,
23716,
1,
13,
1,
16154,
18,
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... |
Adding a click event within a another function
===
This has been bugging me way too long. I am trying to create a click event within a function, which doesn’t seem to be working. Here is the basic layout:
function init() {
$('#a2').click(function() {
//does some stuff. Works fine.
$('#addDest').click(function() {
//does more stuff. Works fine…
if ($("#input2").is(':visible'))
{alert("test");};
});
});
};
The page is always assuming #input2 is visible! Even though it is switching on and off. I check in Firebug and it is able to know the truth. However, when I click on #input2, the alert ALWAYS pops up!
I could throw my problem part outside of the function. But that will create more problems – as I will have some undeclared variables when the document loads. I am thinking I made this the long way and maybe event handlers or clickevents are a solution for more. But I am not quite at that level of understanding yet. I know it is reading that problem area, as when the page loads. Is there an easier solution to this issue? I know I prolly need to learn more... Thanks a lot!!
| 0 | [
2,
4721,
21,
10840,
807,
363,
21,
226,
1990,
800,
3726,
3726,
48,
63,
74,
6256,
2762,
55,
161,
266,
175,
9,
31,
589,
749,
20,
1600,
21,
10840,
807,
363,
21,
1990,
15,
56,
1437,
1,
38,
2260,
20,
44,
638,
9,
235,
25,
14,
2125,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where should we put our enums in Java
===
A short question that always bother me when I develop in Java. I actually use a lot of different enums and I am never sure of where I should put them. Usually, I create a special package named *enumeration* which I am quite sure is not the best practice. Should I put my enums directly in the same package than the group of class it most belong to?
Also, would it be the same for another language (C# or C++)? | 1 | [
2,
113,
378,
95,
442,
318,
1957,
723,
18,
19,
8247,
800,
3726,
3726,
21,
502,
1301,
30,
550,
8006,
55,
76,
31,
2803,
19,
8247,
9,
31,
1121,
275,
21,
865,
16,
421,
1957,
723,
18,
17,
31,
589,
243,
562,
16,
113,
31,
378,
442,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get rid of space between text and td's border
===
I have a `<td>` that has `valign="bottom"` and the text contained in the td has `font-size:100px`.
How do I get rid of the space between the text and the border in a `<td>`. Please find sample code here
http://jsfiddle.net/jM8JC/1/
Thanks
--SD | 0 | [
2,
164,
6681,
16,
726,
128,
1854,
17,
15596,
22,
18,
1862,
800,
3726,
3726,
31,
57,
21,
13,
1,
38,
43,
1,
30,
63,
13,
1,
3377,
9693,
3726,
7,
22389,
7,
1,
17,
14,
1854,
3437,
19,
14,
15596,
63,
13,
1,
21931,
8,
10454,
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... |
Class that logs, android activities
===
I have idea for some app in my head but i don't know exactly how to start programming it. Actually the hardest part is that:
Is there a class that system gets notified when ( for example ) message icon has been clicked or lets say settings menu has been opened.
I would like to make some app that logs certain phone activites. Like: Settings has been opened at 10pm, Phone was last unlocked at 9.59pm ..etc etc..
Can you push me in right direction? Don't need to code, i will be glad just with class name or something like that =) | 0 | [
2,
718,
30,
18893,
15,
13005,
1648,
800,
3726,
3726,
31,
57,
882,
26,
109,
4865,
19,
51,
157,
47,
31,
221,
22,
38,
143,
1890,
184,
20,
799,
3143,
32,
9,
1121,
14,
20766,
141,
25,
30,
45,
25,
80,
21,
718,
30,
329,
3049,
22904... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android Back button and Fragment - Animation Won't Work
===
I have a custom Back button included in my Android Application. My Custom animation when clicking the fragments is ok but it seems I can't apply animation when clicking my own back button or even the back button of android. I don't know how to fix it, I already included these code in my Activity Class but it seems not to work.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menuitem1:
break;
case R.id.menuitem2:
super.onBackPressed();
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
break;
default:
break;
}
return true;
}
I also tried to override the onbackPressed method but it seems also not to work
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right);
}
I don't know how to implement this one...Kindly help me wth this one because we are running out of time because of this. Thank you
Waiting for positive responses.

| 0 | [
2,
13005,
97,
5167,
17,
14847,
13,
8,
6236,
230,
22,
38,
170,
800,
3726,
3726,
31,
57,
21,
5816,
97,
5167,
506,
19,
51,
13005,
3010,
9,
51,
5816,
6236,
76,
25590,
14,
10837,
25,
5854,
47,
32,
2206,
31,
92,
22,
38,
5645,
6236,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
javascript: Split an HREF string using a hash character
===
I have the following code that returns the url of each of the links in the function:
var nav_link;
$('#nav_what-we-do').find('.top-dropdown').find('a').each(function(index, elem) {
console.log("Descendant: " + elem.tagName + " " + elem.href);
the_link = $(this);
nav_link = elem.href.split('#');
if (nav_link[0] === '/what-we-do/') {
the_link.attr('href','#'+nav_link[1]);
the_link.click(function() {
var tab_id = $(this).attr('href');
selectTab(tab_id);
return false;
});
}
});
The console prints links like:
Descendant: A http://localhost/testsite/what-we-do/#solutions
Descendant: A http://localhost/testsite/what-we-do/#features
Descendant: A http://localhost/testsite/what-we-do/features/test
Descendant: A http://localhost/testsite/what-we-do/solutions/test2
Now I want only those links that contain the hash(#) and split them using this hash.
Then I want to check if array(0) contains the characters "/what-we-do/".
I have tried to split the links like this:
nav_link = elem.href.split('#');
but the **IF** part is not working.
Can someone tell me what I am doing wrong. | 0 | [
2,
8247,
8741,
45,
2132,
40,
746,
14057,
3724,
568,
21,
19170,
925,
800,
3726,
3726,
31,
57,
14,
249,
1797,
30,
4815,
14,
287,
6362,
16,
206,
16,
14,
6271,
19,
14,
1990,
45,
4033,
16048,
1,
6258,
73,
5579,
5,
22,
5910,
18343,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Transform a triangle into a Square with relative transforms on covered objects
===
Take a look at this picture:
http://upload.wikimedia.org/wikipedia/commons/e/e7/View_volume.svg
I have a similiar setup in inkscape and want to transform the grey part into a square.
Moving the edge points is no problem, but it has to transform all objects covered by the grey polygon relative to the square transformation. How can i do this? | 2 | [
2,
8007,
21,
8676,
77,
21,
735,
29,
4543,
8007,
18,
27,
1363,
3916,
800,
3726,
3726,
247,
21,
361,
35,
48,
2151,
45,
7775,
6903,
576,
8294,
9,
17375,
8260,
9,
5583,
118,
17375,
26132,
118,
17130,
18,
118,
62,
118,
62,
9816,
4725... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
System.Net.WebException is not being caught
===
I have a strange issue happening. I have some code which must do an http post to a client's server. Their post returns content to me, which I need to show to my user. If thee is a problem, I want to trap the error and inject my own content to let the user know there was a problem.
Here is my static helper class for performing the http post.
public static class HttpPostHelper
{
public static string Post(string url, NameValueCollection values)
{
StringBuilder dataBuilder = new StringBuilder();
foreach (var key in values.AllKeys)
{
EncodeAndAddItem(ref dataBuilder, key, values[key]);
}
Uri uri = new Uri(url);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = dataBuilder.Length;
using (Stream writeStream = request.GetRequestStream())
{
UTF8Encoding encoding = new UTF8Encoding();
byte[] bytes = encoding.GetBytes(dataBuilder.ToString());
writeStream.Write(bytes, 0, bytes.Length);
}
string result = String.Empty;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
using (Stream responseStream = response.GetResponseStream())
{
using (StreamReader readStream = new StreamReader(responseStream, Encoding.UTF8))
{
result = readStream.ReadToEnd();
}
}
}
return result;
}
private static void EncodeAndAddItem(ref StringBuilder baseRequest, string key, string dataItem)
{
if (baseRequest == null)
{
baseRequest = new StringBuilder();
}
if (baseRequest.Length != 0)
{
baseRequest.Append("&");
}
baseRequest.Append(key);
baseRequest.Append("=");
baseRequest.Append(System.Web.HttpUtility.UrlEncode(dataItem));
}
}
And here is my code that does the post and returns the content.
private string GetReturnContent(string callback, NameValueCollection data, LogRequest request)
{
string content = String.Empty;
try
{
content = HttpPostHelper.Post(callback, data);
request.Message = String.Format("Content Retrieved from Callback: {0}", content);
logService.Debug(request);
}
catch (System.Net.WebException ex)
{
var response = ex.Response as HttpWebResponse;
if (response != null)
{
if ((int)response.StatusCode == 403)
{
content = String.Format("The url {0} returned access denied (403).", callback);
request.Message = content;
logService.Warn(request);
}
else if ((int)response.StatusCode == 404)
{
content = String.Format("The url {0} returned page not found (404).", callback);
request.Message = content;
logService.Warn(request);
}
else if ((int)response.StatusCode == 405)
{
content = String.Format("The url {0} returned 405 error. Please ensure the url is configured to accept http POST requests", callback);
request.Message = content;
logService.Warn(request);
}
else if ((int)response.StatusCode == 500)
{
content = String.Format("The url {0} returned a server error (500).", callback);
request.Message = content;
logService.Warn(request);
}
else
{
exceptionHandler.HandleError(ex);
content = String.Format("The url {0} returned an error: {1}", callback, ex.Message);
request.Message = content;
logService.Error(request);
}
}
else
{
exceptionHandler.HandleError(ex);
content = String.Format("The url {0} returned an error: {1}", callback, ex.Message);
request.Message = content;
logService.Error(request);
}
}
return content;
}
The problem is that no matter what, I always get a server error reported to me (through an e-mail reporting handler, but that is another story. I have the exception caught, and I am not re-throwing it, and yet I still get an error report.
>**Exception:**
>System.Net.WebException : Unable to connect to the remote server
>**Inner Exception Message:**
>System.Net.Sockets.SocketException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond [redacted]
The stack trace points to this line as the culprit in my PostHelper
using (Stream writeStream = request.GetRequestStream())
> at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() | 0 | [
2,
329,
9,
2328,
9,
14113,
10066,
872,
25,
52,
142,
1383,
800,
3726,
3726,
31,
57,
21,
2578,
1513,
4942,
9,
31,
57,
109,
1797,
56,
491,
107,
40,
7775,
678,
20,
21,
6819,
22,
18,
8128,
9,
66,
678,
4815,
2331,
20,
55,
15,
56,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
URI when including aggregate information in RESTful response
===
Let's say I have a RESTful API method to return data about a series of locations:
/locations
[{
location_id: 1,
location_name: 'Austin'
},{
location_id: 2,
location_name: 'San Francisco'
},{
location_id: 3,
location_name: 'Seattle'
}]
Now let's say I want to return an aggregate employee_count for each location:
[{
location_id: 1,
location_name: 'Austin',
employee_count: 96
},{
location_id: 2,
location_name: 'San Francisco',
employee_count: 71
},{
location_id: 3,
location_name: 'Seattle',
employee_count: 85
}]
What should my uri be, then? Still /locations?
My concern is that calculating employee_count with each request to /locations could ensue additional, wasteful overhead, as employee_count may only be used 5 - 10% of the time. | 0 | [
2,
13,
3594,
76,
215,
8544,
676,
19,
760,
1566,
1627,
800,
3726,
3726,
408,
22,
18,
395,
31,
57,
21,
760,
1566,
21,
2159,
2109,
20,
788,
1054,
88,
21,
231,
16,
4095,
45,
13,
118,
19032,
18,
636,
1,
1474,
1,
1340,
45,
137,
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... |
Bash: Is there a way to easily break a large array into smaller ones?
===
I was wondering if there is an easy way in bash to break up a large array into several smaller ones.
I currently am thinking something like this:
for ((i = 0; i<= (bigArrayLength/2); i++)) do
bigArray[i] = smallArray[i]
done
for ((i = (bigArrayLength/2); i <=bigArrayLength; i++))
do
bigArray[i] = secondSmallArray[i]
done
But there has to be a better way to go about it.
Any suggestions?
Thanks!
| 0 | [
2,
13158,
45,
25,
80,
21,
161,
20,
2351,
1442,
21,
370,
7718,
77,
2012,
53,
18,
60,
800,
3726,
3726,
31,
23,
5712,
100,
80,
25,
40,
2010,
161,
19,
13158,
20,
1442,
71,
21,
370,
7718,
77,
238,
2012,
53,
18,
9,
31,
871,
589,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.