unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
Is it possible to to access the underlying Window type in wxHaskell?
===
What I'm wondering is if it is possible to get the bare metal C++ Window type from the wxWidgets port to Haskell. I've looked through the library's documentation and so far have been unsuccessful.
What I'm planning to do with it is pass it to a C function (which then interfaces with C++ code) to render some 3D graphics using OGRE3D. I know that a small binding for OGRE exists in Haskell all ready, but all of the tutorials are written in C++ and I am a newb to OGRE. I don't want to translate the tutorials to Haskell while I'm still learning the library.
If this isn't possible, what other course of action would you recommend? | 0 | [
2,
25,
32,
938,
20,
20,
1381,
14,
10974,
1463,
1001,
19,
619,
396,
6482,
16507,
60,
800,
3726,
3726,
98,
31,
22,
79,
5712,
25,
100,
32,
25,
938,
20,
164,
14,
4856,
1484,
272,
20512,
1463,
1001,
37,
14,
619,
396,
3976,
43,
3060... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
populate ExtJS combobox with JSON
===
I am using ExtJS (3) and just trying to populate a combobox/drop down using records from the database that are being queried using JSON.
Here is my JSON call:
var projectDropDown = new Ext.data.Store({
autoLoad: true,
url: 'dropdown.json',
storeId: 'projectDropDown',
idProperty: 'ProjectID',
fields: [ 'ProjectID', 'ProjectName' ]
});
And then my combobox code:
{
xtype: 'combo',
id: 'ProjectName',
fieldLabel: 'Project Name',
valueField: 'ProjectID',
displayField: 'ProjectName',
store: projectDropDown,
typeAhead: true,
mode: 'local',
triggerAction: 'all',
emptyText:'Select a Project...',
selectOnFocus:true
}
The JSON is returning my data like this:
[{"ProjectID":"1","ProjectName":"Mike's Test Project"},{"ProjectID":"2","ProjectName":"My Second Test Project"},{"ProjectID":"3","ProjectName":"My Third Project"},{"ProjectID":"6","ProjectName":"More testing from me"}]
I think I am close, I just don't see what I am missing to make the connection.
Thanks for any assistance. | 0 | [
2,
1675,
12383,
1396,
38,
728,
18,
22621,
5309,
29,
487,
528,
800,
3726,
3726,
31,
589,
568,
1396,
38,
728,
18,
13,
5,
240,
6,
17,
114,
749,
20,
1675,
12383,
21,
22621,
5309,
118,
12361,
125,
568,
742,
37,
14,
6018,
30,
50,
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... |
jQuery Slider With Loading Bar?
===
Are there any jQuery sliders with a loading bar? I have seen them on a couple sites but I don't remember which those were. The closest thing I can think of would be the Orbit slider but that's a radial loading bar and I'm just looking for a flat line at the bottom..
Any Suggestions? | 0 | [
2,
487,
8190,
93,
3295,
106,
29,
12797,
748,
60,
800,
3726,
3726,
50,
80,
186,
487,
8190,
93,
3295,
445,
29,
21,
12797,
748,
60,
31,
57,
541,
105,
27,
21,
1335,
3259,
47,
31,
221,
22,
38,
1518,
56,
273,
46,
9,
14,
6993,
584,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NHibernate.QueryException: could not resolve property - Column name with ID
===
When I try to execute the below class using ICriteria,
if (_userGroupId > 0 && _userId > 0 )
{
return session.CreateCriteria(typeof(UserUserGroup))
.Add(Restrictions.Eq("UserGroupID", _userGroupId))
.Add(Restrictions.Eq("UserID", _userId))
.Add(Restrictions.Eq("Deleted", false));
}
for class
public class UserUserGroup
{
public virtual long UserUserGroupId { get; set; }
public virtual long UserGroupId { get; set; }
public virtual long UserId { get; set; }
public virtual bool Deleted { get; set; }
public UserUserGroup() {}
public UserUserGroup(long userGroupId, long userId)
{
UserGroupId = userGroupId;
UserId = userId;
}
}
with Mapping,
public void Override(AutoMapping<UserUserGroup> mapping)
{
mapping.Id(map => map.UserUserGroupId, "UserUserGroupID").GeneratedBy.HiLo("hibernate_unique_key", "next_hi", "100", "tablename='UserUserGroups'");
mapping.Map(map => map.UserId,"UserID").Nullable();
mapping.Map(map => map.UserGroupId,"UserGroupID").Nullable();
mapping.Map(map => map.Deleted,"Deleted").Nullable();
}
It throws Exception,
NHibernate.QueryException: could not resolve property: UserGroupID
Please help. How to get the property resolved? | 0 | [
2,
12109,
15191,
8820,
9,
8190,
93,
10066,
872,
45,
110,
52,
9854,
1354,
13,
8,
4698,
204,
29,
4924,
800,
3726,
3726,
76,
31,
1131,
20,
15644,
14,
1021,
718,
568,
31,
16063,
9605,
15,
100,
13,
5,
1,
16704,
8024,
1340,
13,
1,
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... |
Visual Studio 2010 C# DataReceived does not seem to trigger
===
Visual Studio 2010 C# code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace YamanPonics
{
public partial class Form1 : Form
{
string RxString;
//Default SerialPortStatus equals TRUE when first starting up
Boolean serialPortDisconnected = true;
public Form1()
{
InitializeComponent();
//Add available Serial COM ports to combobox
foreach (string ports in System.IO.Ports.SerialPort.GetPortNames())
{
//MessageBox.Show("Serial port avialible" + " " + ports);
comPortCmbBox.Items.Add(ports);
}
}
private void DisplayText(object sender, EventArgs e)
{
serialMsgViewerRchTxt.AppendText(RxString);
MessageBox.Show("Displayed Serial Text!");
}
private void serialPort1_DataReceived (object sender, System.IO.Ports.SerialDataReceivedEventArgs e)
{
RxString = serialPort1.ReadExisting();
this.Invoke(new EventHandler(DisplayText));
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
//If SerialPort1 IsOpen
if (serialPort1.IsOpen)
{
//Close SerialPort1 communication
serialPort1.Close();
}
}
private void connectDisconnectBtn_Click(object sender, EventArgs e)
{
//Set arduinoComPort value to COM Port value
string arduinoComPort = comPortCmbBox.Text;
//if SerialPortStatus boolean equals FALSE then
if (serialPortDisconnected && (arduinoComPort != ""))
{
//Set serialPort1 BaudRate value to default value of 38400(required for atlas-scientific sensors)
serialPort1.BaudRate = 38400;
//Set serialPort1 Read and Write timeout values
serialPort1.ReadTimeout = 250;
serialPort1.WriteTimeout = 250;
//Set serialPort1 DataBits value
serialPort1.DataBits = 8;
//Open serialPort1 communication
serialPort1.Open();
//Change connectDisconnectBtn text to Disconnect
connectDisconnectBtn.Text = "Disconnect";
//Set serialPortDisconnected to FALSE
serialPortDisconnected = false;
}
else //if SerialPortStatus bollean equals TRUE
{
//Close SerialPort1 communication
serialPort1.Close();
//Set connectDisconnectBtn text to Connect
connectDisconnectBtn.Text = "Connect";
//Set serialPortDisconnected to TRUE
serialPortDisconnected = true;
}
}
private void SendBtn_Click(object sender, EventArgs e)
{
//if serialPort1 IsOpen then
if (serialPort1.IsOpen)
{
serialPort1.Write("{ph}");
}
}
}
}
That code is a simple Serial connect/disconnect and send/receive application. Connect, Disconnect, and send works properly. When my arduino receives a command it sends a response back. My 2010 C# application is not receiving the response in the richtextbox and do not understand why. I can receive a response when I use another serial terminal program so I do know for sure that data is being sent. What am I not doing to successfully receive a response? | 0 | [
2,
3458,
1120,
498,
272,
5910,
1054,
27700,
630,
52,
2260,
20,
7286,
800,
3726,
3726,
3458,
1120,
498,
272,
5910,
1797,
45,
568,
329,
73,
568,
329,
9,
15015,
5757,
9,
17083,
596,
73,
568,
329,
9,
11103,
218,
2291,
13998,
73,
568,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fast erase (not clear) a ByteBuffer in Java
===
I am trying to clean up a ByteBuffer to be all clear bytes (all 0). I tried to loop over all position in a buffer and set them to 0, but the efficiency is bad. Is there any better way to quickly clear a ByteBuffer, as what BitSet.clear() is doing?
Just side note that ByteBuffer.clear() is not working for me in this scenario. I have to erase all the data inside of the buffer, instead of just reset the pointer to the beginning.
Any hints? Thanks in advance! | 0 | [
2,
1512,
23593,
13,
5,
1270,
1207,
6,
21,
34,
591,
2345,
6866,
19,
8247,
800,
3726,
3726,
31,
589,
749,
20,
2745,
71,
21,
34,
591,
2345,
6866,
20,
44,
65,
1207,
34,
3231,
13,
5,
1233,
713,
6,
9,
31,
794,
20,
5293,
84,
65,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Match an email address which is before a specific word
===
I have a regex to match email addresses in javascript. Lets see an example:
var email = "aaa@bbb.com (A,B); ccc@ddd.com (C,D); eee@fff.com (E,F);";
var emails = email.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi);
This will return me all the emails in the var emails.
Now, I have a string:
var initials = "(A,B)";
And I would like to get only the email before the initials value;
If the var initials is "(A,B)", then I would like to get only the aaa@bbb.com email address.
Thank you a lot for your help! | 0 | [
2,
730,
40,
8517,
3218,
56,
25,
115,
21,
1903,
833,
800,
3726,
3726,
31,
57,
21,
7953,
1706,
20,
730,
8517,
12636,
19,
8247,
8741,
9,
6884,
196,
40,
823,
45,
4033,
8517,
800,
13,
7,
22160,
1,
220,
3490,
9,
960,
13,
5,
58,
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... |
All of a sudden can't open excel file with microsoft.jet.4.0 with c#. I changed nothing at all with the connection string?
===
So I'm working on this thing for work, that converts an excel list of instructions into a better looking, formatted word document. I've been connecting to the excel document and then storing the file into a datatable for easier access.
I had just finally gotten the borders and stuff right for my word document when i started getting an error:
`External table is not in the expected format.`
Here is the full connection algorithm:
http://pastebin.com/Bye5MZLP (sorry, i couldn't quite figure out the formatting of stackoverflow)
EDIT: i pulled up my old code from dropbox previous versions that was definetly working as well as redownload a copy of the excel doc i know was working..... what gives? has something changed in my computer? | 0 | [
2,
65,
16,
21,
4224,
92,
22,
38,
368,
20700,
3893,
29,
7099,
9,
10307,
9,
300,
9,
387,
29,
272,
5910,
9,
31,
1015,
626,
35,
65,
29,
14,
2760,
3724,
60,
800,
3726,
3726,
86,
31,
22,
79,
638,
27,
48,
584,
26,
170,
15,
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... |
show dynamic time with javascript
===
I want to show the time which I have in my php variable with the help of Javascript
I am coding an online exam module, where I want to display the total elapsed time
say for example
$time_elapsed //contains the time taken till now from the start of the exam
And if I got a div say,
<div id="time"></div>
how can I show the dynamic running time with starting from '$time_elapsed' after load the window for each question
Please if you guys have an answer for this..
Thanks | 0 | [
2,
298,
7782,
85,
29,
8247,
8741,
800,
3726,
3726,
31,
259,
20,
298,
14,
85,
56,
31,
57,
19,
51,
13,
26120,
7612,
29,
14,
448,
16,
8247,
8741,
31,
589,
13,
15458,
40,
2087,
11796,
12613,
15,
113,
31,
259,
20,
3042,
14,
600,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 catch an error in a int parsed from string?
===
I am having trubble finding a way that works and helps to catch an error input. I need to handle if the input is not a 1 or a 2. Like . or a - or just any letter. I have tried catch and well nothing seems to work :/
Someone that have an idea for me to try? I am greatfull for any suggestions!! Thx in advance!
Regards
The code i have written so far looks like this:
console.WriteLine();
Console.Write("Make your choice: ");
int myinput = int.Parse(Console.ReadLine());
if (myinput == 1)
{
FirstEvent();
}
if (myinput == 2)
{
SecondEvent();
}
| 0 | [
2,
184,
107,
31,
2949,
40,
7019,
19,
21,
19,
38,
2017,
18,
69,
37,
3724,
60,
800,
3726,
3726,
31,
589,
452,
8600,
13784,
3007,
21,
161,
30,
693,
17,
7778,
20,
2949,
40,
7019,
6367,
9,
31,
376,
20,
3053,
100,
14,
6367,
25,
52... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Safe to throw an exception created on another thread C#
===
I want to catch an exception in a thread A, then pass the exception object to a thread B, and throw it from thread B. Is that safe?
Thread A
try {
// Code that throws exceptions
} catch (Exception e) {
sendToOtherThread(e);
}
Thread B
Exception e = receiveException();
throw e; | 0 | [
2,
1834,
20,
3814,
40,
5391,
679,
27,
226,
9322,
272,
5910,
800,
3726,
3726,
31,
259,
20,
2949,
40,
5391,
19,
21,
9322,
21,
15,
94,
1477,
14,
5391,
3095,
20,
21,
9322,
334,
15,
17,
3814,
32,
37,
9322,
334,
9,
25,
30,
1834,
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... |
WebGL on Chrome for Windows : warning X3206 when cast float to int
===
I think i found a strange bug of Windows version of the Chrome WebGL implementation. Linking a shader with a cast float to int cause an "warning X3206: implicit truncation of vector type" error. I have tried many way to avoid it, but no chance.
for example :
int i;
vec3 u = vec3(1.5, 2.5, 3.5);
float z = u.z;
i = int(u.z): // warning X3206: implicit truncation of vector type
i = int(z): // warning X3206: implicit truncation of vector type
The strange thing is that this vertex program perfectly works on the Linux version on the same computer (same graphic card). Is it a driver issue ? (I have tested on two Windows version with two different graphic cards with the same result). Other strange thing (to me) : X3206 is ordinary an DirectX error (?!) what is the relation with WebGL ?
Here is the complete shader i use and cause the Warning:
#define MATRIX_ARRAY_SIZE 48
/* vertex attributes */
attribute vec4 p;
attribute vec3 n;
attribute vec3 u;
attribute vec3 t;
attribute vec3 b;
attribute vec4 c;
attribute vec4 i;
attribute vec4 w;
/* enable vertex weight */
uniform bool ENw;
/* enable comput tangent */
uniform bool ENt;
/* eye view matrix */
uniform mat4 MEV;
/* transform matrices */
uniform mat4 MXF[MATRIX_ARRAY_SIZE];
/* transform normal matrices */
uniform mat3 MNR[MATRIX_ARRAY_SIZE];
/* varying fragment shader */
varying vec4 Vp;
varying vec3 Vn;
varying vec2 Vu;
varying vec3 Vt;
varying vec3 Vb;
varying vec4 Vc;
void main(void) {
/* Position et Normal transform */
if(ENw) { /* enable vertex weight */
Vp = vec4(0.0, 0.0, 0.0, 0.0);
Vn = vec3(0.0, 0.0, 0.0);
Vp += (MXF[int(i.x)] * p) * w.x;
Vn += (MNR[int(i.x)] * n) * w.x;
Vp += (MXF[int(i.y)] * p) * w.y;
Vn += (MNR[int(i.y)] * n) * w.y;
Vp += (MXF[int(i.z)] * p) * w.z;
Vn += (MNR[int(i.z)] * n) * w.z;
Vp += (MXF[int(i.w)] * p) * w.w;
Vn += (MNR[int(i.w)] * n) * w.w;
} else {
Vp = MXF[0] * p;
Vn = MNR[0] * n;
}
/* Tangent et Binormal transform */
if(ENt) { /* enable comput tangent */
vec3 Cz = cross(Vn, vec3(0.0, 0.0, 1.0));
vec3 Cy = cross(Vn, vec3(0.0, 1.0, 0.0));
if(length(Cz) > length(Cy)) {
Vt = Cz;
} else {
Vt = Cy;
}
Vb = cross(Vn, Vt);
} else {
Vt = t;
Vb = b;
}
/* Texcoord et color */
Vu = u.xy;
Vc = c;
gl_PointSize = u.z;
gl_Position = MEV * Vp;
}
If someone found an elegant workaround... | 0 | [
2,
2741,
8430,
27,
13,
12985,
26,
1936,
13,
45,
3590,
993,
12402,
379,
76,
1325,
11510,
20,
19,
38,
800,
3726,
3726,
31,
277,
31,
216,
21,
2578,
6256,
16,
1936,
615,
16,
14,
13,
12985,
2741,
8430,
6123,
9,
12585,
21,
7546,
139,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 long limit parameter supported for Facebook check-in Graph API?
===
I'm trying the below Facebook API to getting my friends' check-in around a specified location.
https://graph.facebook.com/search?type=checkin¢er=xx,xx&since=XX-XX-XX
Here I have a question, that is how long my friends' check-in I can got - seemed that since parameter can't support too long check-in, e.g. today is 2012-07-04, one of my friends made a check-in on 2012-06-02, but even I set the parameter of since looks like this: since=2012-06-01, there are no any data I can got, could you explain me why? thanks!
| 0 | [
2,
184,
175,
4496,
18906,
1827,
26,
9090,
2631,
8,
108,
7210,
21,
2159,
60,
800,
3726,
3726,
31,
22,
79,
749,
14,
1021,
9090,
21,
2159,
20,
1017,
51,
954,
22,
2631,
8,
108,
140,
21,
9931,
1474,
9,
7775,
18,
6903,
9614,
9,
6413... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 merge two criterias / QueryObjects in NHibernate
===
I have a **QueryObject** object **detached** and I have a second **ICriteria** object **criteria**.
ICriteria criteria = session.CreateCriteria<Theme>()
.CreateAlias("InceptionCycle", "ic", JoinType.LeftOuterJoin)
.CreateAlias("ClosingCycle", "cc", JoinType.LeftOuterJoin)
.Add(Restrictions.Le("ic.CycleMonth", cycleDate))
.Add(Restrictions.Or(
Restrictions.IsNull("cc.ID"),
Restrictions.Ge("cc.CycleMonth", cycleDate)));
QueryOver<Theme, Theme> detached = new GlobalTheme().GetQuery();
// and now how to make new query : detached AND criteria
Is it possible to merge/join/add AND condition between this two criteria objects? Something like this (of course following line of code doesn't work as Add method do not accept **ICriteria** type):
detached.DetachedCriteria.GetExecutableCriteria(session).Add(criteria).List<Theme>();
The reason why I want to achieve is:
- **GlobalTheme** query has some conditions that can be mixed with other criterias
- **ICriteria criteria** has other condition that also can me mixed with other criterias (I'll refactor it to QueryObject in the future)
As a result, in order to handle all combination of **n** possible criterias I would have to create at least n*n **QueryObjects**. If it's possible to AND two or more criterias, I have to create only **n** **QueryObject** types.
Thanks | 0 | [
2,
184,
20,
12666,
81,
9157,
18,
13,
118,
25597,
23793,
18,
19,
12109,
15191,
8820,
800,
3726,
3726,
31,
57,
21,
13,
1409,
8190,
93,
23793,
1409,
3095,
13,
1409,
43,
5735,
6261,
1409,
17,
31,
57,
21,
153,
13,
1409,
49,
16063,
96... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
table max-height 100% of div position fixed
===
I have a div:
position: fixed;
top: 100px;
bottom: 0px;
left: 0px;
right: 0px;
and inside this div is a table:
height: 100%;
max-height: 100%;
and when table cells gets some data, table grows down, but always not bigger than div container. This work well but not in Firefox 13, table grows down to bigger than fixed positioned container.
How can I fix it?
| 0 | [
2,
859,
2049,
8,
252,
7748,
12849,
16,
13,
12916,
649,
3535,
800,
3726,
3726,
31,
57,
21,
13,
12916,
45,
649,
45,
3535,
73,
371,
45,
808,
306,
396,
73,
2129,
45,
713,
306,
396,
73,
225,
45,
713,
306,
396,
73,
193,
45,
713,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Passing controls / values between presenters , GWT Model View Presenter?
===
A rookie here. I have this specific issue in implementing Model View Presenter Pattern using GWT in one of my use cases.
I just started with Ray Ryan's Google IO talk and following some articles on Google Developers site. I have not used any of the GWT add-ons like GWTP or MVP4G or GIN or any other stuff.
Just followed the contacts example on the GWT site and tried to model my case.
Here's the issue.
I have my AppController onValueChage method like this
public void onValueChange(ValueChangeEvent<String> event) {
if(token != null){
presenter = null;
if(token == "display")
{
presenter = new DefaultPresenter(rpcService, eventBus, new DefaultView());
}
else if(token == "popup")
{
presenter = new PopUpPresenter(rpcService, eventBus, new PopUpView());
}
else if(token == "dialog")
{
presenter = new DialogPresenter(rpcService, eventBus, new DialogView());
}
if (presenter!= null) {
presenter.go(container);
}
}
}
And my app flows like this, first **Display** then a selection in there causes a **Dialog** and then **Dialog** sets some variable. And then after the **Dialog** is hidden, i need to comeback to my original **Display** and carry on. But the problem is i'm not able to come back to my original **DisplayPresenter** with the same view because i end up creating a new instance of the presenter whenever there's a history change.
All the things in **bold** are separate presenters which extends the **Presenter** and all of them have specific views.
Questions ?
1. Help me come out of this limbo of creating new instances of the presenters everytime there's a history change.
2. Is there a way in MVP pattern to pass controls between presenters with values persisting ?
3. How to load a existing instance of a presenter inside app controller on an event fire?
| 0 | [
2,
2848,
8671,
13,
118,
4070,
128,
9391,
18,
13,
15,
14094,
38,
1061,
1418,
9391,
60,
800,
3726,
3726,
21,
7959,
235,
9,
31,
57,
48,
1903,
1513,
19,
17333,
1061,
1418,
9391,
3732,
568,
14094,
38,
19,
53,
16,
51,
275,
1871,
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... |
Select a tableRow within a TableLayout Dinamically
===
Im creating a Tablelayout with many TableRows dinamically, like this for example:
for(int i = 0; i<cont; i++)
{
id[i] = customers[i].CustomerNumber;
//Create a new row to be added.
tr = new TableRow(this);
//Create text views to be added to the row.
tv = new TextView(this);
//Put the data into the text view by passing it to a user defined function createView()
createView(tr, tv, id[i].ToString());
//Add the new row to our tableLayout tl
tl.AddView(tr);
}
And this is the createView code:
private void createView(TableRow tr, TextView t, String viewdata) {
t.SetText(viewdata, TextView.BufferType.Editable);
//adjust the porperties of the textView
//t.SetLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT));
//You have to use Android.Graphics.Color not System.ConsoleColor;
t.SetTextColor(Color.Blue);
t.SetBackgroundColor(Color.Cyan);
t.SetPadding(5, 0, 0, 0);
tr.SetPadding(0, 1, 0, 1);
tr.SetBackgroundColor(Color.Black);
tr.AddView(t); // add TextView to row.
}
Ok, but my issue is that i want to select from the TableLayout that contains everything a single row to be able to select and respond a click event in order to use it for further purpose. | 0 | [
2,
5407,
21,
859,
5417,
363,
21,
859,
4414,
1320,
926,
6865,
8438,
800,
3726,
3726,
797,
2936,
21,
859,
4414,
1320,
29,
151,
859,
5417,
18,
926,
6865,
8438,
15,
101,
48,
26,
823,
45,
26,
5,
6391,
31,
800,
713,
73,
31,
1,
1126,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 a table from Soapclient result in PHP
===
I'm trying to build a table from webservice response using php 5.3.x .
This is a part of my WSDL:
`
<s:element name="CardStatementResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CardStatementResult" type="tns:CardStatementResult"/>
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="CardStatementResult">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="CardHolder" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="AccountNo" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="Currency" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="MoreTrans" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="StartBalance" nillable="true" type="s:decimal"/>
<s:element minOccurs="1" maxOccurs="1" name="EndBalance" nillable="true" type="s:decimal"/>
<s:element minOccurs="0" maxOccurs="1" name="Transactions" type="tns:ArrayOfTransactionRecord"/>
<s:element minOccurs="0" maxOccurs="1" name="Delay" type="s:string"/>
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfTransactionRecord">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="TransactionRecord" nillable="true" type="tns:TransactionRecord"/>
</s:sequence>
</s:complexType>
<s:complexType name="TransactionRecord">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="STAN" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="TransactionDate" nillable="true" type="s:dateTime"/>
<s:element minOccurs="0" maxOccurs="1" name="TranType" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TranTypeDesc" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ReferenceNumber" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ApprovalNumber" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DebitCredit" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="TranCurr" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="TranAmount" nillable="true" type="s:decimal"/>
<s:element minOccurs="1" maxOccurs="1" name="TranActualAmount" nillable="true" type="s:decimal"/>
<s:element minOccurs="1" maxOccurs="1" name="TranActivityFee" nillable="true" type="s:decimal"/>
<s:element minOccurs="0" maxOccurs="1" name="AcctCurr" type="s:string"/>
<s:element minOccurs="1" maxOccurs="1" name="AcctCurrAmount" nillable="true" type="s:decimal"/>
<s:element minOccurs="1" maxOccurs="1" name="AcctActivityFee" nillable="true" type="s:decimal"/>
<s:element minOccurs="1" maxOccurs="1" name="AcctProcessFee" nillable="true" type="s:decimal"/>
<s:element minOccurs="1" maxOccurs="1" name="AcctServiceFee" nillable="true" type="s:decimal"/>
<s:element minOccurs="0" maxOccurs="1" name="AcqPart" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="DataStorRet" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="CAID" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="CATI" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="CATA" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="MCC" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="ReversalFlag" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="AuthorizationFlag" type="s:string"/>
</s:sequence>
</s:complexType>`
this is what i'm trying
`
$result = $client->CardStatement(array('req' => $parameters));
$row = $result->TransactionRecord;
print "
<div id='demo'>
<table cellpadding='0' cellspacing='0' border='0' class='display' id='example' width='100%'>
<thead>
<tr>
<th>Row</th>
<th>TransactionDate</th>
<th>DebitCredit</th>
<th>TranAmount</th>
<th>TranActualAmount</th>
</tr>
</thead>
<tbody>";
foreach ($row as $k => $v) {
if (($k + 1) % 2 == 0) {
$grade = 'odd_gradeX';
} else {
$grade = 'even_gradeX';
}
print "
<td align='right' class= $grade>" . ($k + 1) . "</td>
<td>". $v->TransactionDate. "</td>
<td align='right'>" . $v->DebitCredit . "</td>
<td align='right'>" . $v->TranAmount . "</td>
<td align='right'>" . $v->TranActualAmount . "</td> ";
}
print "
</tbody>
<tfoot>
<tr>
<th>Row</th>
<th>TransactionDate</th>
<th>DebitCredit</th>
<th>TranAmount</th>
<th>TranActualAmount</th>
</tr>
</tfoot>
</table>
</div>";?>
`
when om trying to access to TransactionRecord i'm getting this error
"Undefined property: stdClass::$TransactionRecord"
so my question is how can i access TransactionRecord and
how can i create a table from it?
assuming that i'm using php SoapClient? | 0 | [
2,
184,
20,
1600,
21,
859,
37,
6447,
150,
18513,
38,
829,
19,
13,
26120,
800,
3726,
3726,
31,
22,
79,
749,
20,
1895,
21,
859,
37,
2741,
11449,
1627,
568,
13,
26120,
331,
9,
240,
9,
396,
13,
9,
48,
25,
21,
141,
16,
51,
619,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
2d interpolation in python with random spot
===
I checked the available interpolation method in scipy, but could not get the proper solution for my case.
assume i have 100 points whose coordinates are random,
e.g., their x and y positions are:
x=np.random.rand(100)*100
y=np.random.rand(100)*100
z = f(x,y) #the point value calculated by certain function
now i want to get the point value z of a new evenly sampled coordinates (xnew and y new)
xnew = range(100)
ynew = range(100)
how should i do this using bilinear sampling?
i know it is possible to do it point by point, e.g., find the 4 nearest random points, and do the interpolation, but there got to be some easier existing functions to do this
thanks alot! | 0 | [
2,
172,
43,
23336,
857,
19,
20059,
29,
5477,
1999,
800,
3726,
3726,
31,
6505,
14,
904,
23336,
857,
2109,
19,
9569,
6448,
15,
47,
110,
52,
164,
14,
4119,
4295,
26,
51,
610,
9,
7158,
31,
57,
808,
819,
1196,
13714,
50,
5477,
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... |
User Created Open Graph Objects in Facebook App
===
I'm trying to build a Facebook App that will run in the Canvas on Facebook. I want to give users the ability to create custom open graph objects. For example I want users to be able to make a donation bucket. Title, Description, amount needed, time left, goal. I want the user to make these and then when someone contributes it will post saying "USER_NAME added to the donation TITLE"
Is it possible for users to create objects in this way? Most of what I've seen is about the developer making objects and users acting on them.
Pointing me to an article or tutorial would be much appreciated.
Thanks in advance! | 0 | [
2,
4155,
679,
368,
7210,
3916,
19,
9090,
4865,
800,
3726,
3726,
31,
22,
79,
749,
20,
1895,
21,
9090,
4865,
30,
129,
485,
19,
14,
9696,
27,
9090,
9,
31,
259,
20,
590,
3878,
14,
2165,
20,
1600,
5816,
368,
7210,
3916,
9,
26,
823,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Not able to launch putty with telnet session using php
===
I have putty.exe on my desktop so if I will go to command prompt and then to C:\Documents and Settings\user\Desktop location and execute following command it will launch the Putty window of telnet connection to server specified:
putty.exe telnet://a.b.c.d/
I am trying to launch the putty to telnet to specific server using following but its not working for me:
<?php
$securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe telnet://a.b.c.d/ ";
exec($securecrt);
?>
If I try following then it launches the putty application but will have to provide the host name or IP to login:
<?php
$securecrt = "C:\\Documents and Settings\\user\\Desktop\\putty.exe ";
exec($securecrt);
?>
Not sure if I am missing something very basic, It will be great if someone can help with this. | 0 | [
2,
52,
777,
20,
3394,
442,
1084,
29,
6757,
2328,
3723,
568,
13,
26120,
800,
3726,
3726,
31,
57,
442,
1084,
9,
1706,
62,
27,
51,
17404,
86,
100,
31,
129,
162,
20,
1202,
11443,
4417,
17,
94,
20,
272,
45,
1,
28132,
18,
17,
12410,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Entity framework 4.3 data type of object not showing in SQLCe DB
===
I have a class that has a property of type object. When the DB for my application gets generated the property of type object does not get generated. I was expecting for a field of type SQLVariant to be generated but instead the property is getting ignored. I'm using the code first model and entity framework 4.3.1 which is the current framework. I can't use VS 2012 it is not an option for this project. Does the type object not get mapped in 4.3.1? Is there a work around. I need this type to hold values that are not of a particular data type. eg strings, doubles, ints. I'm also using SQLCe 4.0 as the engine for this project. Is the choice of DB causing the problem or does 4.3.1 not map objects to SQLVariants at all. I noticed that the SQLVariant was not available as a data type in the SQLCe DB when i tried to add the column manualy as a test to see if that data type was available. Maybe i have answered at least part of my question my self but was still wondering about whether or not it will map to other DBs. I might switch the engine if that will help out here. So if it does map which very light weight DB would be best for this?
Thanks in advance for any help on this. | 0 | [
2,
9252,
6596,
268,
9,
240,
1054,
1001,
16,
3095,
52,
3187,
19,
4444,
255,
1105,
13,
9007,
800,
3726,
3726,
31,
57,
21,
718,
30,
63,
21,
1354,
16,
1001,
3095,
9,
76,
14,
13,
9007,
26,
51,
3010,
3049,
6756,
14,
1354,
16,
1001,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does user agent stylesheet override my styles?
===
I want a font-size of a 11, but Chrome and Firefox are giving me 16. When I examine the element in Chrome I see and look at the computed property I see:
font-size: 16px;
table - medium user agent stylesheet
Style Attribute - 11px
table - medium user agent stylesheet
.v11gray - 11px style.css
Under computed styles in Firefox I get:
font-size: 16px
TABLE[0].style → 11px element
.v11gray → 11px style.css:19
The last three lines are struck out. Why is my css rule being overridden? Are there steps I can take to find out? | 0 | [
2,
483,
630,
4155,
2267,
1034,
17627,
84,
11891,
51,
6443,
60,
800,
3726,
3726,
31,
259,
21,
9978,
8,
10454,
16,
21,
547,
15,
47,
13,
12985,
17,
535,
18219,
50,
1438,
55,
347,
9,
76,
31,
9691,
14,
4520,
19,
13,
12985,
31,
196,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 add a new OperationContract to an existing ServiceContract
===
Sorry for the newbie question here.
I have a class marked with the [ServiceContract] attribute and I want to add another [OperationContract] to it.
That is fine but after I have done it I need the Reference.cs to reflect the change, and it doesnt.
What am i missing please? | 0 | [
2,
184,
20,
3547,
21,
78,
1453,
23311,
20,
40,
3149,
365,
23311,
800,
3726,
3726,
1875,
26,
14,
78,
5893,
1301,
235,
9,
31,
57,
21,
718,
2739,
29,
14,
636,
11449,
23311,
500,
35,
14755,
17,
31,
259,
20,
3547,
226,
636,
11377,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 and when does a service automatically restarted in Android
===
According to the docs (ref: [http://developer.android.com/reference/android/app/Service.html#ProcessLifecycle][1]), android will automatically restart a service that is killed due to low memory.
To quote:
> Note this means that most of the time your service is running, it may be killed by the system if it is under heavy memory pressure. If this happens, the system will later try to restart the service.
My questions are:
(1) How does the system decide which services to restart?
(2) When is "later"?
[1]: http://developer.android.com/reference/android/app/Service.html#ProcessLifecycle | 0 | [
2,
184,
17,
76,
630,
21,
365,
7499,
27440,
19,
13005,
800,
3726,
3726,
496,
20,
14,
9765,
18,
13,
5,
14057,
45,
636,
21127,
6903,
26051,
106,
9,
290,
18524,
9,
960,
118,
28018,
118,
290,
18524,
118,
7753,
118,
11449,
9,
15895,
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... |
Android App crashes on 4G internet connection but works fine on GSM mode Only
===
I have created an android application which user Http Post and Get calls to read and write data from web server. Nothing too flashy also. My phone/SIM has 4G. Every time the app tries to connect, thing go slow and most of the time the app crashes. So I changed settings to GSM only. Guess what? The app works much better. What could be the possible reasons for it? | 0 | [
2,
13005,
4865,
21563,
27,
268,
263,
2620,
2760,
47,
693,
1123,
27,
489,
18,
79,
3740,
104,
800,
3726,
3726,
31,
57,
679,
40,
13005,
3010,
56,
4155,
7775,
678,
17,
164,
3029,
20,
1302,
17,
2757,
1054,
37,
2741,
8128,
9,
626,
266... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
bashscript for changing wput uploaddirectory on every 5000 passage
===
how i can change the uploaddirectory of wput on every 5000 passage?
whats wrong in my code?
only for the record; i need infnite loop i want run this script 24h 365 days!
every 5000 passage one number higher in directory like incoming1-infinite
best regards
haug
#!/bin/bash
for (( ; ; ))
do
no=1
while [ $no -le 5000 ]
do
perl job.pl false false 1
cd comp
for fname in *.jpg;
do
mv -i "$fname" ${RANDOM}${RANDOM}.jpg
done
for fname in *.jpg;
do
mv "$fname" $(echo "$fname" | sha1sum | cut -f1 -d' ').jpg
done
if [ $no = '5000' ]
then
echo $no
echo $n
n=$(( n+1 )) <-- this one not do what i need :-(
else
wput *.jpg ftp://user:pass@ip:port/incoming$n/ <-- here is the important part 2, i need it to change one directory higher every 5000 passage for example; incoming1 until infinite
rm -rf *.jpg
cd ..
fi
no=`expr $no + 1`
done
done | 0 | [
2,
13158,
8741,
26,
4226,
619,
4881,
71,
8294,
10197,
93,
27,
352,
16024,
4849,
800,
3726,
3726,
184,
31,
92,
753,
14,
71,
8294,
10197,
93,
16,
619,
4881,
27,
352,
16024,
4849,
60,
98,
18,
1389,
19,
51,
1797,
60,
104,
26,
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... |
Show count when hovering on Treemap in Google Chart API
===
I'm generating [a tree map via Google Chart API](https://developers.google.com/chart/interactive/docs/gallery/treemap) (loaded on start and modified by ajax calls depending on filters). Whenever I hover on one of the squares of the treemap, only the name of the square is shown. How can I get the count too? Is is possible to show it in a tooltip also? | 0 | [
2,
298,
2468,
76,
18503,
27,
1541,
15022,
19,
8144,
1795,
21,
2159,
800,
3726,
3726,
31,
22,
79,
13500,
636,
58,
1541,
2942,
1197,
8144,
1795,
21,
2159,
500,
5,
21127,
18,
6903,
26051,
445,
9,
16111,
4875,
9,
960,
118,
5433,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
bash: spec: command not found
===
I installed `rspec` gem. I got following message
Successfully installed rspec-2.11.0
1 gem installed
Installing ri documentation for rspec-2.11.0...
Installing RDoc documentation for rspec-2.11.0...
but when I run
spec path/to/file.rb
I get
-bash: spec: command not found
Any solution on this? | 0 | [
2,
13158,
45,
12737,
45,
1202,
52,
216,
800,
3726,
3726,
31,
4066,
13,
1,
1224,
12610,
1,
8551,
9,
31,
330,
249,
2802,
3673,
4066,
13,
1224,
12610,
8,
135,
9,
1306,
9,
387,
137,
8551,
4066,
25429,
13,
928,
13945,
26,
13,
1224,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Linux script to return domains on a web page
===
I was tasked with this question:
Write a bash script that takes a URL as its first argument and prints out statistics of the number of links per host/domain in the HTML of the URL.
So for instance given a URL like www.bbc.co.uk it might print something like
www.bbc.co.uk: 45
bbc.com: 1
google.com: 2
Facebook.com: 4
That is, it should analyse the HTML of the page, pull out all the links, examine the href attribute, decide which links are to the same domain (figure that one out of course), and which are foreign, then produce statistics for the local ones and for the remote ones.
Rules: You may use any set of standard Linux commands in your script. You may not use any higher-level programming languages such as C or Python or Perl. You may however use awk, sed, etc.
I came up with the solution as follows:
#!/bin/sh
echo "Enter a url eg www.bbc.com:"
read url
content=$(wget "$url" -q -O -)
echo "Enter file name to store URL output"
read file
echo $content > $file
echo "Enter file name to store filtered links:"
read links
found=$(cat $file | grep -o -E 'href="([^"#]+)"' | cut -d'"' -f2 | sort | uniq | awk '/http/' > $links)
output=$(egrep -o '^http://[^/]+/' $links | sort | uniq -c > out)
cat out
I was then told that "i must look at the data, and then check that your program deals satisfactorily with all the scenarios.This reports URLs but no the domains"
Is there someone out there that can help me or point me in the right direction so as i can be able to achieve my goal? what am i missing or what is the script not doing? I thought i had made it work as required. | 0 | [
2,
13024,
3884,
20,
788,
15544,
27,
21,
2741,
2478,
800,
3726,
3726,
31,
23,
14605,
29,
48,
1301,
45,
2757,
21,
13158,
3884,
30,
1384,
21,
287,
6362,
28,
82,
64,
5476,
17,
12202,
70,
5818,
16,
14,
234,
16,
6271,
416,
2015,
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... |
How can I make the sample projects for Qualcomm Snapdragon run on Android emulator?
===
I am trying Qualcomm Snapdragon SDK (https://developer.qualcomm.com/mobile-development/mobile-technologies/snapdragon-sdk-android/download). I am successful with compiling and building the sample projects, for example, the audio SDK sample, in Eclipse with ADT.
In addition I installed Qualcomm SDK package in SDK manager according to the guide given on Qualcomm website. I run the project with Qualcomm customized target (when configuring the virtual device, you may specify Qualcomm as the target rather than native API 15 and the like).
But the features that ought to be available are all shown to be 'unsupported', according to the run output of the app.
| 0 | [
2,
184,
92,
31,
233,
14,
5717,
2314,
26,
13,
14512,
960,
79,
6877,
20433,
485,
27,
13005,
3579,
14868,
60,
800,
3726,
3726,
31,
589,
749,
13,
14512,
960,
79,
6877,
20433,
13,
18,
43,
197,
13,
5,
21127,
18,
6903,
26051,
106,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to display the icon for 24 hours using XSLT
===
I have used xslt ddwrt function ifNew to display the icon for 48 hours (refer below Code)
<xsl:if test="ddwrt:IfNew(string(@ArticleStartDate))">
<div class="hw-newIcon"><img src=”icon.gif”/></div>
</xsl:if>
Actually, now I want to make into 24 hours duration. If anyone can help me how to display only for 24 hours using xsl. | 0 | [
2,
184,
20,
3042,
14,
9801,
26,
937,
974,
568,
993,
18,
255,
38,
800,
3726,
3726,
31,
57,
147,
993,
18,
255,
38,
13,
8096,
7127,
38,
1990,
100,
2681,
20,
3042,
14,
9801,
26,
4564,
974,
13,
5,
99,
2407,
1021,
1797,
6,
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... |
how to use svn while working on same file?
===
How to use svn when two programmers are working on same file in same project?
do one programmer need to wait before other programmer commits his work on that file? | 0 | [
2,
184,
20,
275,
13,
18,
16578,
133,
638,
27,
205,
3893,
60,
800,
3726,
3726,
184,
20,
275,
13,
18,
16578,
76,
81,
17968,
18,
50,
638,
27,
205,
3893,
19,
205,
669,
60,
107,
53,
17968,
376,
20,
1760,
115,
89,
17968,
9686,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
filter content by tags with raw text
===
I'm trying to create a filter / tagging system. This [answer][1] works well but uses classes and not raw text. Most of the jquery sorting / filtering seems to use classes and I would like to use raw text.
My html is set up like this.
<div class="pin">
<img src="/thumbnail.jpg" >
<span>10.08.12</span>
<ul>
<li>Red</li>
<li>Green</li>
<li>Blue</li>
<li>Yellow</li>
</ul>
</div>
The tags are within `.li` elements but I would like them to become links that would filter the page of content.
<div class="pin">
<img src="/thumbnail.jpg" >
<span>10.08.12</span>
<ul>
<li><a href="#">Red</a></li>
<li><a href="#">Green</a></li>
<li><a href="#">Blue</a></li>
<li><a href="#">Yellow</a></li>
</ul>
</div>
Whats the best way to only show the `.pin` based on if they have that particular list item. For example clicking `<li><a href="#">Red</a></li>` will filter all `.pin` divs with a list item of `Red`.
A plugin would work fine, but I haven't found any that work with this scenario.
Thank you.
[1]: http://stackoverflow.com/questions/2703961/filtering-content-jquery | 0 | [
2,
11945,
2331,
34,
3383,
18,
29,
4333,
1854,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
11945,
13,
118,
3383,
2762,
329,
9,
48,
636,
5950,
4662,
500,
2558,
165,
500,
693,
134,
47,
2027,
2684,
17,
52,
4333,
1854,
9,
127,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to get this ListView as a two-column table?
===
I am a new ASP.NET developer and I am struggling in getting the ListView that I am working on it as the image shown below:
![enter image description here][1]
**How to do that?**
My ASP.NET Code:
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1" >
<ItemTemplate>
<tr style="">
<td>
<p>
<asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>' />
</p>
</th>
<td>
<p>
<asp:Label ID="UsernameLabel" runat="server"
Text='<%# Eval("Username") %>' />
</p>
</td>
<td>
<p>
<asp:Label ID="JobTitleLabel" runat="server" Text='<%# Eval("JobTitle") %>' />
</p>
</td>
<td>
<p>
<asp:Label ID="DivisionLabel" runat="server" Text='<%# Eval("DivisionName") %>' />
</p>
</td>
<td>
<p>
<asp:Label ID="RoleLabel" runat="server" Text='<%# Eval("RoleName") %>' />
</p>
</td>
</tr>
</ItemTemplate>
<LayoutTemplate>
<table id="Table2" runat="server">
<tr id="Tr5" runat="server">
<td id="Td4" runat="server">
<table ID="itemPlaceholderContainer" runat="server" border="1" style="">
<tr id="Tr6" runat="server">
<td id="Td6" runat="server" colspan="3">
<center>Personal Information</center>
</td>
</tr>
<tr id="Tr9" runat="server" style="">
<th id="Th3" runat="server">
Name</th>
</tr>
<tr id="Tr10" runat="server">
<th id="Th4" runat="server">
Username</th>
</tr>
<tr id="Tr11" runat="server">
<th id="Th5" runat="server">
JobTitle</th>
</tr>
<tr id="Tr12" runat="server">
<th id="Th6" runat="server">
Badge Number</th>
</tr>
<tr id="Tr13" runat="server">
<th id="Th7" runat="server">
Division</th>
</tr>
<tr id="Tr14" runat="server">
<th id="Th8" runat="server">
Role</th>
</tr>
<tr ID="itemPlaceholder" runat="server">
</tr>
</table>
</td>
</tr>
<tr id="Tr8" runat="server">
<td id="Td7" runat="server" style="">
<asp:DataPager ID="DataPager1" runat="server" PageSize="5">
<Fields>
<asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
<asp:NumericPagerField />
<asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True"
ShowNextPageButton="False" ShowPreviousPageButton="False" />
</Fields>
</asp:DataPager>
</td>
</tr>
</table>
</LayoutTemplate>
</asp:ListView>
What I am getting right now is listing the headers or titles on the left column and the retreived values underneath them in a one instead of showing each value with its header. Here's a snapshot of what I am getting right now:
![enter image description here][2]
[1]: http://i.stack.imgur.com/jMEMb.png
[2]: http://i.stack.imgur.com/gAEoq.png | 0 | [
2,
184,
20,
164,
48,
968,
4725,
28,
21,
81,
8,
716,
4404,
103,
859,
60,
800,
3726,
3726,
31,
589,
21,
78,
28,
306,
9,
2328,
10058,
17,
31,
589,
7587,
19,
1017,
14,
968,
4725,
30,
31,
589,
638,
27,
32,
28,
14,
1961,
1721,
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... |
Speed up zip extraction
===
I use the code below to extract files from an InputStream.
I want to bypass overwriting existing files with same size to speed up extraction process.
When this situation occurred I use zis.getNextEntry() to get next ZipEntry, but it seems to extract all bytes, and the overall execution time was not changed.
Is there any way to obtain only zip entries info without extracting it?
public void unzipDatabase(InputStream resStream, File path) {
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(
resStream, 262144));
ZipEntry ze;
byte[] buffer = new byte[16384];
int readLen = 0;
try {
while ((ze = zis.getNextEntry()) != null) {
File outputFile = new File(path, ze.getName());
if (ze.isDirectory())
outputFile.mkdir();
else if (outputFile.exists()
&& outputFile.length() == ze.getSize())
continue;
else {
outputFile.createNewFile();
FileOutputStream fos = new FileOutputStream(outputFile);
BufferedOutputStream bof = new BufferedOutputStream(fos,
262144);
while ((readLen = zis.read(buffer)) > 0)
bof.write(buffer, 0, readLen);
bof.close();
fos.close();
}
}
zis.close();
} catch (Exception e) {
}
}
| 0 | [
2,
1362,
71,
12133,
16748,
800,
3726,
3726,
31,
275,
14,
1797,
1021,
20,
10962,
6488,
37,
40,
6367,
11260,
9,
31,
259,
20,
8900,
84,
12646,
3149,
6488,
29,
205,
1072,
20,
1362,
71,
16748,
953,
9,
76,
48,
1858,
2437,
31,
275,
796... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Activerecord relationship joins
===
I'm working in Rails and Activerecord and trying to merge some data from related tables together in my view, here are my models:
class Report < ActiveRecord::Base
has_many :votes
end
class Vote < ActiveRecord::Base
belongs_to :reports
end
class User < ActiveRecord::Base
has_many :votes
end
Each vote has a user and a report.
In my view I need the following, hopefully as easily as possible:
1. a total number of votes for each report from all users
2. a true/false if the user has voted on the particular report
Right now, my basic understanding of ActiveRecord queries only takes me as far as creating a *helper* with the report and the current `user` and than querying for the existence of `report`
Same goes for counting the total number of votes for all users for a `report` as follows:
**Controller**
def index
#this is where I need some help to get the related information into a single
#object
@reports = Report.where('...')
end
**View**
<% @reports.each do |report| %>
<% if(hasVoted(@current_user.id, report.id)) %>
<!-- display the 'has voted html' -->
<% end %>
<% end %>
**Helper**
def hasVoted(current_user_id, report_id)
if(Vote.exists?(:user_id => current_user_id, :report_id => report_id))
true
else
false
end
end
Hope that gives you some insight into helping...thanks! | 0 | [
2,
1348,
14953,
1429,
10612,
800,
3726,
3726,
31,
22,
79,
638,
19,
2240,
18,
17,
1348,
14953,
17,
749,
20,
12666,
109,
1054,
37,
1597,
7484,
429,
19,
51,
1418,
15,
235,
50,
51,
2761,
45,
718,
1330,
13,
1,
1348,
14953,
45,
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... |
RESTFul Web Service Basic Auth
===
Hi I'm trying to implement basic auth for my restful web service. I'm not using spring. I've followed all the steps described [here][1]
[1]: http://www.ericonjava.com/?p=325
However, I'm getting a 403 forbidden error when I try to access the rest service via the browser. The browser is not prompting for the username password. What am I doing wrong?
Thanks in advnace
Shravan | 0 | [
2,
760,
1566,
2741,
365,
2125,
10343,
96,
800,
3726,
3726,
4148,
31,
22,
79,
749,
20,
8713,
2125,
10343,
96,
26,
51,
760,
1566,
2741,
365,
9,
31,
22,
79,
52,
568,
1573,
9,
31,
22,
195,
709,
65,
14,
2382,
745,
636,
6836,
500,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What is the purpose of a zero length array in a struct?
===
When I'm looking the Linux kernel code, found the below code:
struct thread_info {
struct task_struct *task;
struct exec_domain *exec_domain;
unsigned long flags;
__u32 status;
__u32 cpu;
int preempt_count;
mm_segment_t addr_limit;
struct restart_block restart_block;
void __user *sysenter_return;
unsigned long previous_esp;
__u8 supervisor_stack[0];
};
Notice that the last variable "supervisor_stack", it is a zero length array, what is the usage of it? Thanks in advance! | 0 | [
2,
98,
25,
14,
2131,
16,
21,
4606,
1476,
7718,
19,
21,
13,
10346,
60,
800,
3726,
3726,
76,
31,
22,
79,
699,
14,
13024,
17007,
1797,
15,
216,
14,
1021,
1797,
45,
13,
10346,
9322,
1,
108,
4120,
13,
1,
13,
10346,
3005,
1,
10346,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Removal of noisy pixels using opencv
===
I am trying to detect text from an input image using openCV.
For that I need to remove the noise components from the image. The criteria for that which am using is that if the pixel count of certain component is less than 15 am eliminating that particular component.
e.g suppose the below given images are provided as i/p to the function:
![input image 1][1]
![Input image 2][2]
As it can be seen both the images contain a lot of unwanted noisy pixels, specially the first one.
So if anyone can suggest a feasible way for achieving it, it would be highly appreciated.
[1]: http://i.stack.imgur.com/6JfpQ.png
[2]: http://i.stack.imgur.com/W4pmy.png | 0 | [
2,
7797,
16,
22729,
18146,
18,
568,
368,
12732,
800,
3726,
3726,
31,
589,
749,
20,
9092,
1854,
37,
40,
6367,
1961,
568,
368,
12732,
9,
26,
30,
31,
376,
20,
4681,
14,
3406,
5090,
37,
14,
1961,
9,
14,
9157,
26,
30,
56,
589,
568,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
I reinstalled win XP on my desktop now boot option is not coming as i have ubuntu 10.10 installed on my other partition what to do?
===
I was using XP and ubuntu on different partitions xp is NTFS and ubuntu is ext4 on differnt partitions. My windows crashed and i reinstalled xp in C: drive without touching ubuntu file system.
But now when i start my computer it directly goes onto xp without giving boot options which it used to give me before. i knw there is problem with grub but i dont knw how to fix it.
please help all my projects are on ubuntu file system. | 2 | [
2,
31,
7102,
21300,
69,
628,
23045,
27,
51,
17404,
130,
6801,
4255,
25,
52,
880,
28,
31,
57,
287,
12968,
2473,
332,
9,
1036,
4066,
27,
51,
89,
10711,
98,
20,
107,
60,
800,
3726,
3726,
31,
23,
568,
23045,
17,
287,
12968,
2473,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
redirect to login page in AJAX requests
===
In my JS code I'm checking for a 403 status code on AJAX response and redirect to login page like this:
$.ajax({
statusCode: {
403: function() {
window.location.href = "/login";
}
}
});
Should I use the full url to my site like the follows:
403: function() {
window.location.href = "www.mysite/login";
}
Or it's enough to use the relative one?
| 0 | [
2,
302,
14706,
20,
6738,
108,
2478,
19,
20624,
12279,
800,
3726,
3726,
19,
51,
487,
18,
1797,
31,
22,
79,
9886,
26,
21,
13,
25821,
1782,
1797,
27,
20624,
1627,
17,
302,
14706,
20,
6738,
108,
2478,
101,
48,
45,
5579,
9,
6881,
752... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
extjs radio button table
===
How can I programmatically add a row of radio buttons to a table using extjs?
The new row would have a unique name/id. I don't want to have lables for the radio button, what I want to have is a header row with the lables there. Like a survey.
Here is what I currently have...
oLicForm = new Ext.form.Panel({...})
oInfoStore.each(function(oRecord){
aComboValues = oRecord.data.fieldValues.split('|');
var sComboLabels;
var aComboValues;
var aRadioFieldValues=new Array();
for (var i = 0; i < aComboValues.length; i++)
{
bCheckedRadio = false;
if(aComboValues[i] == "NULL" || aComboValues[i] == "Not Installed")
{
bCheckedRadio = true;
}
aRadioFieldValues.push({
boxLabel: aComboValues[i],
name: oRecord.data.recId,
inputValue: aComboValues[i],
checked : bCheckedRadio
});
}
var oRadioField = new Ext.form.RadioGroup({
fieldLabel: oRecord.get('fieldName'),
items: aRadioFieldValues
});
console.log("addig radio"+oRecord.get('fieldName'));
//oAddSrvForm.add(oComboField);
oForm.add(oRadioField);
} | 0 | [
2,
1396,
38,
728,
18,
603,
5167,
859,
800,
3726,
3726,
184,
92,
31,
625,
6732,
1326,
3547,
21,
3131,
16,
603,
12861,
20,
21,
859,
568,
1396,
38,
728,
18,
60,
14,
78,
3131,
83,
57,
21,
2619,
204,
118,
1340,
9,
31,
221,
22,
38... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
org.ksoap2.serialization.soapprimitive , error in try catch block , why?
===
I have a big problem.
Android 2.1 api
I download from the web, through ksoap Protocol, the data.
the result is this exception "org.ksoap2.serialization.SoapPrimitive" and do not understand why.
with debugging, the "for" run correctly the first round, but in the second it hangs education "re = (SoapObject) ((SoapObject) envelope.getResponse ()). getProperty (s)" reporting the error "org.ksoap2.serialization.SoapPrimitive"
Thanks in advance to help me.
here the code:
request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("dev", false);
request.addProperty("Cap", input_cap.getText().toString());
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
envelope.addMapping(NAMESPACE,Offerta.Offerta_CLASS.getSimpleName()
,Offerta.Offerta_CLASS);
androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, envelope);
int nOff = ((SoapObject) envelope.getResponse()).getPropertyCount();
SoapObject re;
for (int i = 0; i < nOff; i++) {
//here error to the second round
re = (SoapObject) ((SoapObject) envelope.getResponse()).getProperty(i);
img.setImageBitmap(getBitmap(Integer.parseInt(re.getProperty(0).toString())));
titolo.setText(re.getProperty(1).toString());
descrizioneTitolo.setText(re.getProperty(3).toString());
provincia.setText(getProvincia(Integer.parseInt(re.getProperty(13).toString())));
sintesi.setText(re.getProperty(2).toString());
contenitore_paese.addView(view);
}
sorry for my English but I am Italian | 0 | [
2,
13,
5583,
9,
197,
656,
2552,
135,
9,
4104,
2815,
1829,
9,
656,
7753,
14786,
49,
6142,
13,
15,
7019,
19,
1131,
2949,
1921,
13,
15,
483,
60,
800,
3726,
3726,
31,
57,
21,
580,
1448,
9,
13005,
172,
9,
165,
21,
2159,
31,
7121,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GWT Platform gatekeeper user needs to sing in again on page refresh
===
What would be the best practice to keep the user logged in if he or she refresh the page.
(Assume that the user signed in already.)
At the moment the gatekeeper is performing its duty but when the user refresh [F5 , browser button] the page. The user is redirected to the login screen (aka default place).
Has anyone found a way to relogging the user?
| 0 | [
2,
14094,
38,
2452,
3315,
8566,
4155,
2274,
20,
4481,
19,
188,
27,
2478,
24905,
800,
3726,
3726,
98,
83,
44,
14,
246,
1345,
20,
643,
14,
4155,
13,
19287,
19,
100,
24,
54,
39,
24905,
14,
2478,
9,
13,
5,
9755,
9472,
30,
14,
4155... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
why i can not open an Excel(xls) with HSSF
===
Im getting an error when i am trying to open an Excel sheet with MS office 2003.
This excel sheet is created using HSSFWorkbook immplementing the usermodel scope
org.apache.poi.hssf.usermodel
What are the differences between usermodel and event model?
Thanks
| 0 | [
2,
483,
31,
92,
52,
368,
40,
20700,
5,
396,
7532,
6,
29,
746,
18,
18,
410,
800,
3726,
3726,
797,
1017,
40,
7019,
76,
31,
589,
749,
20,
368,
40,
20700,
6125,
29,
4235,
488,
973,
9,
48,
20700,
6125,
25,
679,
568,
746,
18,
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... |
Correct route for a singular nested resource
===
I have 2 resources, one being a nested resource of another:
`parent_resource` and `child_resource`.
This gives me the following routes:
somesite.com/parent_resources/14
somesite.com/parent_resources/14/child_resources/1
However there is only ever going to be a single `child_resource` for each `parent_resource`, so to someone using the site this is very confusing. I would like the child_resource paths to look like this:
somesite.com/parent_resource/14/child_resource
somesite.com/parent_resource/14/child_resource/edit
etc
What is the correct way to do this? | 0 | [
2,
4456,
858,
26,
21,
12217,
5618,
69,
6577,
800,
3726,
3726,
31,
57,
172,
2566,
15,
53,
142,
21,
5618,
69,
6577,
16,
226,
45,
13,
1,
18908,
1,
99,
12097,
1,
17,
13,
1,
11287,
1,
99,
12097,
1,
9,
48,
2352,
55,
14,
249,
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... |
I keep on getting an error 13 type mismatch error, How can I get it out?
===
In Access 2010 I am trying to create a search box for a table of contacts on a form.
Here is my code:
Private Sub Command119_Click()
On Error GoTo Command119_Click_Err
If (Eval("[Forms]![frmTitlePage]![SearchBox] Is Null")) Then
' Clear Filter when search box empty
DoCmd.RunCommand acCmdRemoveFilterSort
End If
' Handle "'s in search
TempVars.Add "strSearch", Replace(Forms!frmTitlePage!SearchBox, """", """""")
' Build the Filter
TempVars.Add "strFilter", "([Last Name] Like "" * " & [TempVars]![strSearch] & " * "" )"
TempVars.Add "strFilter", TempVars!strFilter & " OR ([First Name] Like "" * " & [TempVars]![strSearch] & " * "" )"
DoCmd.ApplyFilter "", TempVars!strFilter, ""
TempVars.Remove "strFilter"
TempVars.Remove "strSearch"
Command119_Click_Exit:
Exit Sub
Command119_Click_Err:
MsgBox Error$
Resume Command119_Click_Exit
End Sub
I am obviously horrible at this coding so any additional help to clean this search tool up would help tremendously.
| 0 | [
2,
31,
643,
27,
1017,
40,
7019,
539,
1001,
2462,
12280,
7019,
15,
184,
92,
31,
164,
32,
70,
60,
800,
3726,
3726,
19,
1381,
498,
31,
589,
749,
20,
1600,
21,
2122,
1649,
26,
21,
859,
16,
11894,
27,
21,
505,
9,
235,
25,
51,
179... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 submit a form to a web page and retrieve content by script
===
I would like to know how to get contents from a web page which allow different parameter in address link as below:
launch webpage.aspx?PARAMETER=111
{wait for page to load}
retrieve webpage content
launch webpage.aspx?PARAMETER=112
{wait for page to load}
retrieve webpage content
Repeat the steps from PARAMETER from 113 to 120. | 0 | [
2,
184,
20,
12298,
21,
505,
20,
21,
2741,
2478,
17,
11917,
2331,
34,
3884,
800,
3726,
3726,
31,
83,
101,
20,
143,
184,
20,
164,
8478,
37,
21,
2741,
2478,
56,
1655,
421,
18906,
19,
3218,
3508,
28,
1021,
45,
3394,
2741,
6486,
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... |
.htaccess RewriteRule backreference order
===
I have a question about htaccess rewriting rule.
Is it possible to convert this url:
*www.site.com/en/test*
In something like this:
*www.site.com/test.php?language=en*
I tried to use this RewriteRule
RewriteRule ^([a-z][a-z])/(.*)$ $1.php?language=$2
But in some online testing tool the result URL was:
*www.site.com/en.php?language=test*
Thank you in advance.
Mat | 0 | [
2,
13,
9,
9020,
20604,
27891,
16154,
97,
28018,
389,
800,
3726,
3726,
31,
57,
21,
1301,
88,
13,
9020,
20604,
302,
12646,
1828,
9,
25,
32,
938,
20,
8406,
48,
287,
6362,
45,
1637,
6483,
9,
9097,
9,
960,
118,
219,
118,
10543,
2483,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to make magento search returns only products from specific store in magento multistore website?
===
I have a magento multi store. When I search for a product in store A, it returns products from store B. How do I restrict the search to only return products from store A when search is conducted in store A? | 0 | [
2,
184,
20,
233,
4723,
17050,
2122,
4815,
104,
1985,
37,
1903,
1718,
19,
4723,
17050,
1889,
16828,
2271,
60,
800,
3726,
3726,
31,
57,
21,
4723,
17050,
1889,
1718,
9,
76,
31,
2122,
26,
21,
2374,
19,
1718,
21,
15,
32,
4815,
1985,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Duplicate Pointer, Shallow Copy or Deep Copy?
===
Consider the following:
Action<int, T> a1 = new Action<int, T>(_insert);
Action<int, T> a2 = new Action<int, T>(a1);
What is a2 referring to ? Is it a1, a shallow copy of a1 or is it a deep copy of a1 ? | 0 | [
2,
19429,
454,
106,
15,
7258,
4344,
54,
855,
4344,
60,
800,
3726,
3726,
3563,
14,
249,
45,
1028,
1,
6391,
15,
13,
38,
1,
21,
165,
800,
78,
1028,
1,
6391,
15,
13,
38,
1,
5,
1,
108,
18,
6767,
6,
73,
1028,
1,
6391,
15,
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 does my FactoryGirl callback run when it shouldn't?
===
I am using FactoryGirl 3.3.0 with RoR 3.2.3
I have a user model which has_one profile like so;
class User < ActiveRecord::Base
has_secure_password
has_one :profile, dependent: :destroy
accepts_nested_attributes_for :profile, update_only: true
attr_accessible :email, :username, :password, :password_confirmation, :profile_attributes
before_create :build_profile
end
class Profile < ActiveRecord::Base
attr_accessible :first_name, :last_name
belongs_to :user
validates :user, presence: true
validates :first_name, presence: true, on: :update
validates :last_name, presence: true, on: :update
end
In my rspec tests I need to sometimes prevent the before_create :build_profile from running so I can have a user without a profile. I manage this with a FactoryGirl callback
after(:build) {|user| user.class.skip_callback(:create, :before, :build_profile)}
My user factories are defined as follows;
FactoryGirl.define do
factory :user do
sequence(:email) {|n| "user_#{n}@example.com"}
sequence(:username) {|n| "user_#{n}"}
password "secret"
factory :user_with_profile do
factory :new_user_with_profile do
before(:create) {|user| user.activated = false}
end
factory :activated_user_with_profile do
before(:create) {|user| user.activated = true}
end
end
factory :user_without_profile do
after(:build) {|user| user.class.skip_callback(:create, :before, :build_profile)}
factory :new_user_without_profile do
before(:create) {|user| user.activated = false}
end
factory :activated_user_without_profile do
before(:create) {|user| user.activated = true}
end
end
end
end
My expectation was that the `:new_user_without_profile` and `:activated_user_without_profile` would inherit the `after(:build)` callback from `:user_without_profile` while the `:new_user_with_profile` and `:activated_user_with_profile` factories would not, but it's not quite working like that. Here's an excerpt from the console to demonstrate my problem;
irb(main):001:0> user = FactoryGirl.create :new_user_with_profile
irb(main):002:0> user.profile
=> #<Profile id: 11, first_name: "", last_name: "", created_at: "2012-07-10 08:40:10", updated_at: "2012-07-10 08:40:10", user_id: 18>
irb(main):003:0> user = FactoryGirl.create :new_user_without_profile
irb(main):004:0> user.profile
=> nil
irb(main):005:0> user = FactoryGirl.create :new_user_with_profile
irb(main):006:0> user.profile
=> nil
So, the first time I create a :new_user_with_profile, a profile is created as expected but the second time (after creating a :new_user_without_profile), it doesn't any more! The after(:build) callback doesn't seem to be getting called again (if I add some code to it to output something, I don't see it in the terminal). I have no idea what's going wrong here. Does anyone else? | 0 | [
2,
483,
630,
51,
3129,
9649,
645,
1958,
485,
76,
32,
5714,
22,
38,
60,
800,
3726,
3726,
31,
589,
568,
3129,
9649,
203,
9,
240,
9,
387,
29,
761,
248,
203,
9,
135,
9,
240,
31,
57,
21,
4155,
1061,
56,
63,
1,
849,
5296,
101,
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... |
HEAD.js & jQuery: loading script twice, how to remove it before adding the second time
===
I am using [head.js][1] to load a script that provides UI enhancements to dynamically loaded widgets:-
head.js('url_to_script');
Sometimes I want to reload that widget (remove from DOM and GET HTML again) and subsequently the js needs to run again. The simplest way to do this would be to remove the script and reload it with head.js so that it runs again. I am using jQuery, so I have tried the following:-
$('script[src="' + js_url + '"]').remove();
head.js('url_to_script');
With no luck... any help much appreciated!
[1]: http://headjs.com/ | 0 | [
2,
157,
9,
728,
18,
279,
487,
8190,
93,
45,
12797,
3884,
2088,
15,
184,
20,
4681,
32,
115,
4721,
14,
153,
85,
800,
3726,
3726,
31,
589,
568,
636,
1743,
9,
728,
18,
500,
2558,
165,
500,
20,
6305,
21,
3884,
30,
1927,
13,
5661,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Netbeans: can I configure to flag calls to non-exist functions and invalid signatures? (PHP)
===
*Class A*
class A {
public foo( Apple $apple )
{
//whatever
}
}
*YetAnotherFile.php* (in the same project)
$a = new A;
$a->foo( 42 ); // I really would like a little warning flag here
$a->foo( new Apple(), 'howdy' ); // I really would like...
$a->bar(); // I really would like...
I hope I got my own example right, anyway I hope you get my point.
Thank you...
| 0 | [
2,
4275,
863,
5950,
45,
92,
31,
1065,
15951,
20,
3157,
3029,
20,
538,
8,
1706,
702,
3719,
17,
16671,
19506,
60,
13,
5,
26120,
6,
800,
3726,
3726,
1637,
1898,
21,
2483,
718,
21,
13,
1,
317,
4310,
111,
5,
4037,
5579,
24212,
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... |
Casting generic type instances created using Reflection
===
I'm creating instances of a generic type using reflection:
public interface IModelBuilder<TModel>
{
TModel BuildModel();
}
public class MyModel
{
public string Name { get; set; }
}
public class MyModelBuilder : IModelBuilder<MyModel>
{
public MyModel BuildModel()
{
throw new NotImplementedException();
}
}
At runtime all we know is the Type of model e.g. `MyModel`. I can find instances of the relevant model builder like so:
var modelBuilders = from t in Assembly.GetExecutingAssembly().GetTypes()
from i in t.GetInterfaces()
where i.IsGenericType
&& i.GetGenericTypeDefinition() == typeof(IModelBuilder<>)
&& i.GetGenericArguments()[0] == modelType
select t;
var builder = Activator.CreateInstance(modelBuilders.First());
But I'm not sure how I can then cast the instance as `IModelBuilder<TModel>` so I can call and work with the result of `BuildModel()`.
| 0 | [
2,
9087,
12733,
1001,
13946,
679,
568,
9138,
800,
3726,
3726,
31,
22,
79,
2936,
13946,
16,
21,
12733,
1001,
568,
9138,
45,
317,
6573,
31,
13998,
20904,
1,
38,
13998,
1,
13,
1,
13,
38,
13998,
1895,
13998,
5,
6,
73,
13,
1,
317,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ActionView::Template::Error (undefined method `to_key' for nil:NilClass):
===
hey im getting this error these are my view log and controller .I unable to resolve the issue its urgent..
view
62: %span.new_topic_button= link_to I18n.t('txt.new_topic', :default => 'Start a new topic'), new_forum_topic_path(@forum), :class => " button_normal grey_new"
63: .page_info
64: = page_entries_info @topics
65: = will_paginate @topics, :renderer => PaginationListLinkRenderer, :class => 'pagination', :inner_window => 2, :outer_window => -1, :first_label => "First", :last_label => "Last", :previous_label => "Previous", :next_label => "Next"
log
app/views/forums/_topics_main.html.haml:65:in `block in _app_views_forums__topics_main_html_haml___1064304677_113943610'
app/views/forums/_topics_main.html.haml:30:in `_app_views_forums__topics_main_html_haml___1064304677_113943610'
app/views/forums/_topics_main_collection.html.haml:32:in `_app_views_forums__topics_main_collection_html_haml__860678259_92775780'
app/views/forums/show.html.haml:10:in `_app_views_forums_show_html_haml___750925007_87708100'
app/controllers/forums_controller.rb:44:in `show'
def show
(session[:forums] ||= {})[@forum.id] = Time.now.utc
(session[:forums_page] ||= Hash.new(1))[@forum.id] = current_page if current_page > 1
@current_city= nil
@current_category = nil
order_name = 'sticky desc,' + (params[:sort_by] || "last_updated_at") + ' DESC'
@topics = @forum.topics.paginate(:page => current_page).order(order_name)
if params[:category_id] || params[:city_id] || params[:merchant_id] || params[:show_voted_up_topics] || params[:sort_by]
@voted_up_topics_flg = false
if params[:show_voted_up_topics] == "true"
@voted_up_topics_flg = true
end
@current_category = Category.find(params[:category_id]) if params[:category_id] && params[:category_id] != ""
@current_city = City.find(params[:city_id]) if params[:city_id] && params[:city_id] != ""
@current_merchant = Merchant.find_by_id(params[:merchant_id]) if params[:merchant_id] && params[:merchant_id] != ""
@topics = Topic.filter_by_category_city_merchant(@current_category, @current_city, @current_merchant, order_name, @voted_up_topics_flg, current_page, @forum)
end
respond_to do |format|
format.html
format.xml { render :xml => @forum }
format.js { @topics = @topics }
end
end
| 0 | [
2,
1028,
4725,
45,
45,
9577,
6554,
45,
45,
29992,
13,
5,
1020,
13439,
2109,
13,
1,
262,
1,
4237,
22,
26,
1781,
255,
45,
103,
947,
1898,
6,
45,
800,
3726,
3726,
8409,
797,
1017,
48,
7019,
158,
50,
51,
1418,
6738,
17,
9919,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android: network relationship graph
===
I'll first explain what I'm trying to achieve and later on explain my current approach to solving it. I'm thankful for any useful input even if it would mean to start from scratch. I'll add more code or explanation if needed.
This is going to be a part of a bigger Android application. This part should display all nodes within a prior selected network and the relationships between the nodes all in one scrollable view/layout. The relationships should be pictured by arrows between the nodes, showing which nodes each node could 'hear' during a certain interval. The nodes sadly have to be clickable, because you have to able to set some options for other parts of the app within that view already. The actual data (nodes, neighbourhood relationships) should finally be returned via a webservice from a database, but this is not yet entirely relevant apart from the fact that the amount of nodes isn't static.
My current approach to this is to create GridView fill it with a custom ButtonAdapter, that way I can use a non-static amount of custom (transparent) buttons.
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ButtonAdapter(this));
I have created methods that can draw arrows on a Bitmap and I can also easily set it as the GridView's background by converting it to Drawable.
protected Bitmap drawArrow(float startX, float startY, float endX, float endY, Bitmap bitmap) {
....
}
Drawable d = new BitmapDrawable(bitmap);
gridview.setBackgroundDrawable(d);
My issue with that approach is, that I'd need to know the exact size of the GridView for the Bitmap and the position of the buttons or alternatively the total height and width, that 1 button would use. Due to creating it within the onCreate I don't get the actual sizes at this point though. Is there a solution to this problem?
And even if that'd work I'm not sure just yet whether I can set the background in a way that it would scroll 1:1 with the GridView instead of getting scaled. | 0 | [
2,
13005,
45,
982,
1429,
7210,
800,
3726,
3726,
31,
22,
211,
64,
3271,
98,
31,
22,
79,
749,
20,
4689,
17,
138,
27,
3271,
51,
866,
2141,
20,
17533,
32,
9,
31,
22,
79,
21412,
26,
186,
4811,
6367,
166,
100,
32,
83,
884,
20,
799... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
store a sql report in a sqlce text field?
===
OK, the above may seem somewhat strange but please bear with me...
I'm building a reporting app. in C# on .NET3.5 which contains a SQLCE 3.5 sp1 database.
I want to use the database to store the sql for the various reports which will be available to users (so they don't have to know anything about the dirty bits..).
When they wish to run a report they just select the appropriate button on the UI and it goes away and picks up the relevant sql from the database and inserts it into a piece of code to run the report, subsequently presenting them with the returned data.
I've got a table structured like so -
* ReportIdx numeric,
* ReportName varchar(120),
* SQL_Txt varchar(MAX),
* Comments varchar(120)
Running the following -
>INSERT INTO
SqlLib
(ReportIdx, ReportName, SQL_Txt, Comments)
VALUES (3, 'TestRowInsert02', 'select * from test_table where testid in('1', '2','3') ', 'Wonder IF this will work?')<
I get the following error message -
*Error in values list in INSERT INTO clause.
Unable to parse query text.
Error Source: SQL Server Compact ADO.NET Data Provider
Error Message: There was an error parsing the query. [ Token line number = 3, Token Line offset = 90, Token in error = 1]*
I've tried inserting a forward slash(\\) in front of the commas inside the sql_txt value but the above error presents again and the sql insert statement is altered as follows -
>INSERT INTO
> SqlLib
(ReportIdx, ReportName, SQL_Txt, Comments)
VALUES (3, 'TestRowInsert02', 'select * from test_table where testid in(\' 1 \\ ', \' 2 \\ ',\' 3 \\ ') ', 'Wonder IF this will work?')<
I guess what I really need to know is 'Can I store the sql for a report in a SQLCE Column so it can be simply retrieved and run subsequently in another piece of code?
Can I format the contents so they do not require further processing before I can use it in a SQL report? | 0 | [
2,
1718,
21,
4444,
255,
1330,
19,
21,
4444,
255,
1105,
1854,
575,
60,
800,
3726,
3726,
5854,
15,
14,
784,
123,
2260,
4131,
2578,
47,
2247,
2746,
29,
55,
9,
9,
9,
31,
22,
79,
353,
21,
6670,
4865,
9,
19,
272,
5910,
27,
13,
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... |
Reference or documentation for XenServer cmdlets
===
I just started writing powershell scripts for Citrix XenServer. However, I can only find code snippets and this [cmdlet poster](http://www.google.de/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CFUQFjAA&url=http%3A%2F%2Fwww.x-tech.at%2Fdownload_file.php%3Ffile%3D%252Ffiles%252FCitrix_XenServer_6.0_CmdLet_Poster.pdf&ei=KfXqT-27IoPIsga4r_3zBQ&usg=AFQjCNFQQ0EmfJLoZSLCzDZoguJW11Sitw) on the internet.
Where can I find a full documentation with explanations and possible parameters directly from Citrix? All APIs and references available are only valid for the command line.
Thank you! | 0 | [
2,
2801,
54,
13945,
26,
13,
14940,
10321,
106,
2390,
43,
11045,
800,
3726,
3726,
31,
114,
373,
1174,
414,
15984,
17505,
26,
5486,
17224,
13,
14940,
10321,
106,
9,
207,
15,
31,
92,
104,
477,
1797,
13,
29061,
18,
17,
48,
636,
9095,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
extracting and printing an html element by it's id using DOMDocument
===
i want to extract couple of tables from a web page and show them in my page
i was going to use regex to extract them but then i saw the DOMDocument class
and it seems cleaner i've looked in stackoverflow and it seems all the questions are about getting inner text or using a loop to get inner nodes of elements . i want to now how can i extract and print a html element by it's id .
$html = file_get_contents("www.site.com");
$xml = new DOMDocument();
$xml->loadHTML($html);
$xpath = new DOMXPath($xml);
$table =$xpath->query("//*[@id='myid']");
$table->saveHTML(); // this obviously doesn't work
how can i show or echo the $table as an actual html table on my page ? | 0 | [
2,
10962,
68,
17,
7312,
40,
13,
15895,
4520,
34,
32,
22,
18,
4924,
568,
11859,
28132,
800,
3726,
3726,
31,
259,
20,
10962,
1335,
16,
7484,
37,
21,
2741,
2478,
17,
298,
105,
19,
51,
2478,
31,
23,
228,
20,
275,
7953,
1706,
20,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple Segue on UITableViewController - Error:NSInvalidArgumentException
===
I have a custom UITableViewController and I need to push other custom view controllers on tap to the UITableViewCell.
As you can see on screenshot,
I embedded navigation controllers to each view controllers and uitableviewcontroller
and I added unique identifiers to both segues as 'segue1' and 'segue2'
, but I always get below error. I tried push and modal types, didn't make any difference.
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<AllNotificationsTableViewController: 0x6d6d300>) has no segue with identifier 'segue2''
*** First throw call stack:
![enter image description here][1]
[1]: http://i.stack.imgur.com/2w7ns.png | 0 | [
2,
1886,
1353,
3982,
27,
13,
11193,
579,
4725,
12898,
1252,
13,
8,
7019,
45,
2172,
108,
18506,
2542,
3073,
1130,
10066,
872,
800,
3726,
3726,
31,
57,
21,
5816,
13,
11193,
579,
4725,
12898,
1252,
17,
31,
376,
20,
3250,
89,
5816,
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... |
BadFormatException installing 64-bit service
===
.NET 4.0, Windows 7, VS 2010:
Trying to install 64-bit service using the Setup Project leads to Error 1001. Exception occurred while initializing the installation: System.BadImageFormatException.
The Setup Project was created using [this][1]. I also set Target Platform to 64bit as instructed [here][2].
If I switch the service's platform to 32bit, everything works fine.
Do you know how to resolve this System.BadImageFormatException exception?
[1]: http://msdn.microsoft.com/en-us/library/zt39148a%28v=vs.100%29.aspx
[2]: http://msdn.microsoft.com/en-us/library/cd7a85k9%28v=vs.80%29.aspx | 0 | [
2,
896,
23588,
10066,
872,
25429,
4384,
8,
3326,
365,
800,
3726,
3726,
13,
9,
2328,
268,
9,
387,
15,
1936,
453,
15,
4611,
15742,
749,
20,
16146,
4384,
8,
3326,
365,
568,
14,
18161,
669,
4259,
20,
7019,
808,
165,
9,
5391,
2437,
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... |
SoundPool is not working on 2.1,2.2 verstions
===
i have an application in which i have recording and playing the recordedaudio with soundpool,
it is working in 2.3 but not in 2.2.not able to replicate the issue,
can any one of u suggest a solution,
here is my code
explosion=sp.load(path, 1); sp.setOnLoadCompleteListener(new
OnLoadCompleteListener() {
@Override public void onLoadComplete(SoundPool soundPool, int
sampleId, int status) {
if(explosion!=0)
sp.play(explosion, 1, 1, 0, 0, 1.6f); } }); | 0 | [
2,
646,
13378,
25,
52,
638,
27,
172,
9,
15793,
9,
135,
13,
5498,
3309,
18,
800,
3726,
3726,
31,
57,
40,
3010,
19,
56,
31,
57,
1576,
17,
791,
14,
801,
1346,
6921,
29,
646,
13378,
15,
32,
25,
638,
19,
172,
9,
240,
47,
52,
19... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can you use the CMS Orchard along side your own ASP.NET website?
===
I have a ASP.NET website which has various utility scripts/pages for some software but no public website. I would like to use Microsoft's Orchard CMS to create the website for visitors to look at - but would this mean I would have to move the utility scripts?
Can you run ASP.NET pages etc alongside Orchard or do you have to extend Orchard to do those tasks for you? If you can run scripts alongside, is there anything you should do to prevent interference with Orchard?
I will accept an answer from someone who has experience with Orchard or good reasoning.
Thanks in advance! | 0 | [
2,
92,
42,
275,
14,
2390,
18,
12635,
303,
270,
154,
258,
28,
306,
9,
2328,
2271,
60,
800,
3726,
3726,
31,
57,
21,
28,
306,
9,
2328,
2271,
56,
63,
617,
10082,
17505,
118,
6486,
18,
26,
109,
2306,
47,
90,
317,
2271,
9,
31,
83,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Repeater and tr runat=server. How to add class to row?
===
I need to the attribute `class` (if it doesn't exist) to table row located in a repeater. There's a question is inside the code.
**aspx**
<asp:Repeater runat="server">........
<ItemTemplate> .....
<tr runat="server" id="row" >
.....................
**codeBehind**
void rpt_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
var row= e.Item.FindControl("row");
//how do I use it? How do I add "class" (if not exists) to "row"?
}
} | 0 | [
2,
6830,
106,
17,
9235,
485,
721,
3726,
10321,
106,
9,
184,
20,
3547,
718,
20,
3131,
60,
800,
3726,
3726,
31,
376,
20,
14,
35,
14755,
13,
1,
1898,
1,
13,
5,
821,
32,
1437,
22,
38,
3182,
6,
20,
859,
3131,
335,
19,
21,
6830,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
python paramiko on windows
===
i wrote a python script using paramiko ssh. it runs fine on debian. now i would like to run and build it on windows systems. so i installed python 2.7 and python 3.2, paramiko-1.7.7.1,pycrypto-2.3.win32-py2.7, pywin32-217.win-amd64-py2.7 and pywin32-217.win-amd64-py3.2. when i start the script i get the following error
Traceback (most recent call last):
File "C:\data\scripts\mrssh.py", line 1, in <module>
import paramiko
File "C:\Python27\lib\site-packages\paramiko\__init__.py", line 69, in <module>
from transport import SecurityOptions, Transport
File "C:\Python27\lib\site-packages\paramiko\transport.py", line 32, in <module>
from paramiko import util
File "C:\Python27\lib\site-packages\paramiko\util.py", line 32, in <module>
from paramiko.common import *
File "C:\Python27\lib\site-packages\paramiko\common.py", line 98, in <module>
from Crypto import Random
ImportError: No module named Crypto
| 0 | [
2,
20059,
2258,
79,
7427,
27,
1936,
800,
3726,
3726,
31,
738,
21,
20059,
3884,
568,
2258,
79,
7427,
13,
18,
1635,
9,
32,
1461,
1123,
27,
121,
10035,
9,
130,
31,
83,
101,
20,
485,
17,
1895,
32,
27,
1936,
1242,
9,
86,
31,
4066,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Undefined method 'reject' when using mongoid-paperclip gem
===
The error I am getting
NoMethodError (undefined method `reject' for #<ActionDispatch::Http::UploadedFile:0x007fab6ea5c370>):
app/controllers/photos_controller.rb:3:in `create'
The form (it's in HAML)
%form{:id => 'photo-upload-form', :method => 'post', :action => '/photos', :enctype => 'multipart/form-data'}
%input{:type => 'file', :id => 'photo', :name => 'photo'}
%input.btn{:type => 'submit', :value => 'Upload Photo'}
photos_controller.rb Controller
class PhotosController < ApplicationController
def create # POST /photos
photo = Photo.create(params[:photo])
render :nothing => true
end
end
photo.rb Model
class Photo
include Mongoid::Document
include Mongoid::Paperclip
has_mongoid_attached_file :photo,
:storage => :s3,
:bucket => 'pracmanage',
:s3_credentials => {
:access_key_id => '<My_Access_Key>',
:secret_access_key => '<My_Secret_Access_Key>'
},
:styles => {
:thumb => "100x100",
:medium => "200x200",
:large => "600x400"
}
end
Gemfile (have run bundle install)
gem 'mongoid-paperclip', :require => "mongoid_paperclip"
gem 'aws-sdk'
Versions
Ruby 1.9.3
Rails 3.2.3
Mongoid 2.4.8
Mongoid-Paperclip 0.0.7
Paperclip 3.1.2
aws-sdk 1.5.7
The code is fairly simple and I've followed the docs. No idea what I should do. | 0 | [
2,
367,
13439,
2109,
13,
22,
99,
17759,
22,
76,
568,
21028,
6516,
8,
17945,
150,
6013,
8551,
800,
3726,
3726,
14,
7019,
31,
589,
1017,
90,
5909,
1807,
43,
29992,
13,
5,
1020,
13439,
2109,
13,
1,
99,
17759,
22,
26,
6926,
1,
8645,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fastest SQL Full Text Search
===
Im currently using SQLite FTS4 engine, and it's performance is great. But does someone know of any benchmarks/comparison to MySQL's full text search (or any other SQL database)?
P.S. I'm not looking for any Lucene/NoSQL alternatives. | 0 | [
2,
7518,
4444,
255,
503,
1854,
2122,
800,
3726,
3726,
797,
871,
568,
4444,
10601,
1187,
18,
300,
1406,
15,
17,
32,
22,
18,
956,
25,
374,
9,
47,
630,
737,
143,
16,
186,
25324,
18,
118,
960,
16258,
218,
20,
51,
18,
22402,
22,
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... |
get date value for db in android
===
I am storing from-date and to-date in my sqlite db in 2012-02-15 00:02:03 format. Now how can retrieve this. I tried with the following query .. where did i go wrong.
select category,sum(amount) from inbox where strftime(currentdate) > strftime(fastdate)
it shows error. can any one help me to solve this | 0 | [
2,
164,
1231,
1923,
26,
13,
9007,
19,
13005,
800,
3726,
3726,
31,
589,
25615,
37,
8,
8209,
17,
20,
8,
8209,
19,
51,
4444,
10601,
13,
9007,
19,
563,
8,
3564,
8,
1193,
13,
2032,
21825,
22336,
2595,
9,
130,
184,
92,
11917,
48,
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... |
HttpServletResponse sendredirect reloads the same page
===
I'm working in a JSF 2.0 + RichFaces 4 project.
When in my logical bussiness I detect an error (like INFO: Exception when handling error trying to reset the response. java.lang.NumberFormatException: For input string: "a") I had created a filter that catch the error and executes the next order:
resp.sendRedirect("/proj_name/error/errorPage.xhtml") ;
But the errorPage.xhtml is loaded into the form that generates the error.
For example, if a <rich:table> generates the error, errorPage.xhtml is loaded instead the "form" that contains the table.
I tried modify web.xml several meanings, but I haven't any result.
Thanks | 0 | [
2,
7775,
10321,
413,
8722,
8782,
870,
2660,
99,
14706,
27339,
18,
14,
205,
2478,
800,
3726,
3726,
31,
22,
79,
638,
19,
21,
487,
18,
410,
172,
9,
387,
2754,
2042,
6413,
18,
268,
669,
9,
76,
19,
51,
11545,
1683,
18,
8776,
31,
90... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 check,has the user already authenticated the application or it has to be authenticated via Linkedin api?
===
How can i check has the user already authenticated the application or it has to be authenticated via Linkedin javascript api ?
My problem is,if user hasn't authenticated the application he can do that by clicking on a checkbox that initiates popup for linkedin app authentication without using the predefined linkedin button ?
<script type="IN/Login" data-onAuth="demoLoginTagAuthCapture" data-onLogout="demoLoginTagLogoutCapture"></script> - how can i show this script in popup,not using the linkedin button ? | 0 | [
2,
184,
20,
2631,
15,
6482,
14,
4155,
614,
14351,
1669,
14,
3010,
54,
32,
63,
20,
44,
14351,
1669,
1197,
4727,
108,
21,
2159,
60,
800,
3726,
3726,
184,
92,
31,
2631,
63,
14,
4155,
614,
14351,
1669,
14,
3010,
54,
32,
63,
20,
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 to pass value from displaytag to new window and display it?
===
I have tried
<display:table name="jobTrackerCol" pagesize="20" sort="list" id="data" requestURI="" class="tablelist">
<display:column title="Request Id" sortable="true" ><%-- property="request_id" > --%>
<a href=# onClick="popupSmallWindow('${data.query}');">${data.request_id}</a>
</display:column>
</display:table>
javascript
function popupSmallWindow(query){
//window.location="http://www.continue.com";
myString = query.replace(/[\r\n]/g, "<br />");
alert(myString);
}
value in ${data.query} is long sql query.
I want to display that query in alert or new window when I click on the link.Please guide me on this
| 0 | [
2,
184,
20,
1477,
1923,
37,
3042,
8628,
20,
78,
1463,
17,
3042,
32,
60,
800,
3726,
3726,
31,
57,
794,
13,
1,
2906,
5438,
45,
5924,
204,
3726,
7,
1636,
220,
4792,
106,
7771,
7,
4434,
2952,
3726,
7,
1323,
7,
2058,
3726,
7,
5739,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
appending string to file name by passing through variable in objective c
===
NSString *devicetype;
if((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)){
devicetype = @"ipad";
}else{
devicetype = @"iphone";
}
----------
YOU MUST HAVE GOT ABOVE CODE.
I HAVE TWO IMAGES
> BACKGROUND_IPAD.PNG AND
> BACKGROUND_IPHONE.PNG
NOW I WANT TO USE THIS STRING LIKE
BackGround = [CCSprite spriteWithFile:[NSSTRING STRINGWITHFORMAT:@"background_%@.png",DEVICETYPE]];
CAN I USE LIKE THIS?
IF(NOT) IS THERE ANOTHER BETTER WAY! | 0 | [
2,
4865,
7601,
3724,
20,
3893,
204,
34,
2848,
120,
7612,
19,
7038,
272,
800,
3726,
3726,
13,
2172,
11130,
1637,
546,
18507,
4474,
73,
100,
5,
5,
5661,
1,
16704,
1,
6280,
6413,
1,
20347,
79,
5,
6,
800,
3726,
287,
2366,
106,
6280,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 add image to html from sd card
===
I have an html file. I show it as webview. I tried to add image on it from sd but i couldn't.
Here is the code i used:
`<tr height="21" style='height:15.75pt'>
<td height="21" class="xl71" style='height:15.75pt'> </td>
<td class="borderLeft"> </td>
<td> </td>
<td>
<![if !vml]>
<span style='mso-ignore:vglayout;add
position:absolute;z-index:20;margin-left:24px;margin-top:3px;width:73px;
height:144px'><img src="/sdcard/SurucuImza.jpg" alt="" width="168" height="120" v:shapes="Picture_x0020_421" /></span>
<![endif]>
<span
style='mso-ignore:vglayout2'>
<table cellpadding="0" cellspacing="0">
<tr>`
I have used the path here:
<img src="/sdcard/SurucuImza.jpg" alt="" width="168" height="120" v:shapes="Picture_x0020_421" />
But it didn't work. I can't show the image.
Do you have any idea? | 0 | [
2,
184,
20,
3547,
1961,
20,
13,
15895,
37,
13,
18,
43,
2056,
800,
3726,
3726,
31,
57,
40,
13,
15895,
3893,
9,
31,
298,
32,
28,
2741,
4725,
9,
31,
794,
20,
3547,
1961,
27,
32,
37,
13,
18,
43,
47,
31,
711,
22,
38,
9,
235,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ios get play count for items in the media library
===
I am currently trying to categorise a users music collection and the ability to get the users most played songs/artists would greatly improve the user experience in the app. Is it possible to get the play count? and how would I go about doing it | 0 | [
2,
13,
7760,
164,
418,
2468,
26,
3755,
19,
14,
941,
1248,
800,
3726,
3726,
31,
589,
871,
749,
20,
13,
14375,
2628,
21,
3878,
232,
1206,
17,
14,
2165,
20,
164,
14,
3878,
127,
257,
916,
118,
22175,
18,
83,
5629,
3545,
14,
4155,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
WCF Post with Query String
===
I am currently developing a Windows Service hosted WCF service. One of the methods has a URI which is set up to receive a callback from a payment provider. This is the interface contract...
[OperationContract]
[WebInvoke(UriTemplate = "3DSecureCallback?TrxId={id}", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare)]
void ThreeDSecureCallBack(string id, Stream body);
This issue I am having is that the 3rd party provider posts to our service. I have to provide a callback url to it. So we can reconcile payments, we provide a URL with a query string parameter containing the transaction id.
During development of this service, the call backs have been successful. (This was prior to adding the Steam parameter)
However, we are now at the stage where we need to parse the posted data. This is the point that the 2nd 'Stream' parameter was added to the method signature.
The issue that I am getting is that I receive the following exception...
For request in operation ThreeDSecureCallBack to be a stream the operation must have a single parameter whose type is Stream.
By removing the id parameter, and having stream only, we can get the post data. This won't work in practice though as I need to query string paramter also.
Can anyone advise on how to resolve this issue please? I am really at a loss.
Thanks in advance,
David | 0 | [
2,
11801,
410,
678,
29,
25597,
3724,
800,
3726,
3726,
31,
589,
871,
3561,
21,
1936,
365,
2812,
11801,
410,
365,
9,
53,
16,
14,
3195,
63,
21,
13,
3594,
56,
25,
309,
71,
20,
2588,
21,
645,
1958,
37,
21,
7582,
11747,
9,
48,
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... |
How to run steTimeout in a for loop
===
I was studying the article on Database Normalization 2NF in Wikipedia at [Wikipedia][1], when I came across the last example, on tournament winners. There it says that because there is a transitive dependency in the table, it is not in 2NF, and further optimization is needed (like splitting it into further tables) to restore that to 3NF and eliminating chances of data corruption. Can anybody tell me what kinds of 'corruption' can creep in to "show the same person from being shown with different dates of birth on different records"?
[1]: http://en.wikipedia.org/wiki/Third_normal_form | 0 | [
2,
184,
20,
485,
6621,
891,
1320,
19,
21,
26,
5293,
800,
3726,
3726,
31,
23,
4493,
14,
2002,
27,
6018,
1826,
1829,
172,
11408,
19,
20169,
35,
636,
17375,
26132,
500,
2558,
165,
500,
15,
76,
31,
281,
464,
14,
236,
823,
15,
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... |
GUI matlab radiobutton switches and axes
===
I'm trying to program a gui in matlab where one select a point in a 3D point cloud and assign a propriety to the corresponding radiobutton selection. I'm pretty new in the world of matlab programming and programming in general.
The actual problem:
I defined a radio button group containing 3 buttons:
MarkAsGood
MarkAsBad
Unmark
which I control with this switch loop:
function uipanel2_SelectionChangeFcn(hObject, eventdata, handles)
switch get(eventdata.NewValue,'Tag') % Get Tag of selected object.
case 'MarkAsGood'
% Code for when MarkAsGood is selected.
handles.current_state = 'Good';
case 'MarkAsBad'
% Code for when MarkAsBad is selected.
handles.current_state = 'Bad';
case 'Unmark'
% Code for when Unmark is selected.
handles.current_state = 'Unmarked';
otherwise
disp('radiobutton mismatch');
end
disp(handles.current_state)
% Update handles structure
guidata(hObject, handles);
`handles.current_state` holds a string containing the propriety of the particle
then I have a function that creates a 3d plot where I give the xyz coordinates of the particles. With a selection tool for 3d graphs I select the particle and the `particle.state` should be changed accordingly to the `handles.current_state`
function axes1_ButtonDownFcn(hObject, eventdata, handles)
%select the plot
axes(handles.axes1);
hold on;
if isempty(handles.current_plist_index)
disp('no tomogram selected');
else
%generate the point cloud
n_particle = size(handles.current_plist_index, 2);
PointCloud = zeros(n_particle, 3);
for p = 1 : n_particle
indx = handles.current_plist_index(p);
PointCloud(p, :) = get_translated_center(handles.particle_structure(indx));
end
%pass the point cloud to the selection function
set(gcf, 'WindowButtonDownFcn', {@callbackClickA3DPoint, PointCloud', handles});
%assign the value to the particle
if handles.current_index > 0
disp(handles.current_index)
%assign to the particle the value good / bad / unmarked retrived from
%the current state managed by the radio button MarkAs
indx = handles.current_plist_index(handles.current_index);
particle = handles.particle_structure(indx);
particle.state = handles.current_state;
else
disp('wrong current index / no particle selected')
disp(['current index:' handles.current_index])
end
end
% Update handles structure
guidata(hObject, handles);
Now the program works good only for the radiobutton I have selected when the callback ` axes1_ButtonDownFcn` is called for the first time.
While if I change the selection of the radio button the `handles.current_state` should switch to the selected propriety. Which it does inside the
`uipanel2_SelectionChangeFcn` function but when I call the function ` axes1_ButtonDownFcn` again the variable `handles.current_state` is not changed, showing the previous radiobutton selection.
tl:dr Why does the gui not update the `handles.current_state` variable inside the `axes1_ButtonDownFcn(hObject, eventdata, handles)`?
ps: if you need other code elements don't hesitate to ask, I will post a figure of the gui which maybe can help you to orient in the program | 0 | [
2,
9457,
4277,
9086,
603,
811,
444,
18114,
17,
10398,
18,
800,
3726,
3726,
31,
22,
79,
749,
20,
625,
21,
9457,
19,
4277,
9086,
113,
53,
5407,
21,
454,
19,
21,
203,
43,
454,
4005,
17,
13952,
21,
9476,
3272,
1084,
20,
14,
7265,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
App store submission - new release list
===
This is not code related but it is an issue I am having with an iPhone app.
I submitted two apps (separate binaries), one for iphone , one for ipad. They had slightly different names and screenshots but the same icon graphics. The two apps were approved by Apple but only the iPad version got listed in the "see all" list in its catagory in iTunes.
I am wondering why the iphone version did not appear in the counterpart list.
My question is, is it something I have done or something apple has done?
Thanks | 0 | [
2,
4865,
1718,
10923,
13,
8,
78,
830,
968,
800,
3726,
3726,
48,
25,
52,
1797,
1597,
47,
32,
25,
40,
1513,
31,
589,
452,
29,
40,
21024,
4865,
9,
31,
7368,
81,
4865,
18,
13,
5,
18,
14189,
5487,
4511,
11301,
6,
15,
53,
26,
2102... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Hiding UIButton as IBAction
===
It's not difficult to hide a UIButton typically, but I have it set to an IBAction instead of IBOutlet. This is necessary because when the button is pressed, text pops up, but then I want the button to disappear. What is the solution? | 0 | [
2,
5314,
13,
5661,
811,
444,
28,
13,
4598,
8645,
800,
3726,
3726,
32,
22,
18,
52,
1956,
20,
3077,
21,
13,
5661,
811,
444,
2442,
15,
47,
31,
57,
32,
309,
20,
40,
13,
4598,
8645,
700,
16,
13,
4598,
1320,
1336,
9,
48,
25,
2378,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 come these images load so fast? (example website)
===
How come this site load so fast, even though there are lots of images? (see portfolio):
http://www.girlfriendnyc.com/
I downloaded the entire page and found out that they have just a couple of .js files, but couldn't see in detail cause the code is compressed & pretty much impossible to read.
Also, there's this **before** the DOCTYPE spec:
<script type="text/javascript">window.location.hash = '#/portfolio';</script>
I would really like to know what's going on in there. Any help is appreciated. Cheers! | 1 | [
2,
184,
340,
158,
3502,
6305,
86,
1512,
60,
13,
5,
29041,
2271,
6,
800,
3726,
3726,
184,
340,
48,
689,
6305,
86,
1512,
15,
166,
362,
80,
50,
7503,
16,
3502,
60,
13,
5,
1798,
10588,
6,
45,
7775,
6903,
6483,
9,
24273,
1536,
150,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Express.js checking request type with .is() doesn't work
===
I'm trying to check what the type of content is, but it doesn't appear to be working. Here is the output on the shell:
$ node app.js
# Request http://localhost:3000 via browser
CLIENT DOES NOT WANT XML, JSON, OR HTML
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
And here is the contents of the app.js script:
var express = require('express');
var app = express.createServer();
app.get('/', function(req, res) {
if (req.is('xml')) {
console.log("CLIENT WANTS XML");
} else if (req.is('json') || req.is('html')) {
console.log("CLIENT WANTS JSON OR HTML");
} else {
console.log("CLIENT DOES NOT WANT XML, JSON, OR HTML");
console.log(req.header('Accept'));
}
});
app.listen(3000);
I would expect the `text/html` Accept header to trigger the `req.is('html')` function or even the `application/xhtml+xml` Accept header to trigger the `req.is('xml')`, but the `else` statement actually gets run. I'm using Express 3.0.0 rc1 and Node 0.8.1. | 0 | [
2,
2999,
9,
728,
18,
9886,
3772,
1001,
29,
13,
9,
403,
5,
6,
1437,
22,
38,
170,
800,
3726,
3726,
31,
22,
79,
749,
20,
2631,
98,
14,
1001,
16,
2331,
25,
15,
47,
32,
1437,
22,
38,
1893,
20,
44,
638,
9,
235,
25,
14,
5196,
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... |
Reading a .vtk file with python
===
I've been given a legacy format vtk file (I think its an unstructured grid) and I'd like to read it in with python and output a .npy file instead, since I know how to deal with that.
The file is a dump from ATHENA and so has density, velocity, magnetic field along with the coordinates.
I'm very much a procedural programmer, so all these objects are confusing...
| 0 | [
2,
1876,
21,
13,
9,
710,
38,
197,
3893,
29,
20059,
800,
3726,
3726,
31,
22,
195,
74,
504,
21,
7780,
2595,
566,
38,
197,
3893,
13,
5,
49,
277,
82,
40,
367,
13971,
43,
7354,
6,
17,
31,
22,
43,
101,
20,
1302,
32,
19,
29,
2005... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Erlang views with couchbase
===
Is anybody sing erlang views with couchbase? If so what do you do it and what are your experiences ?
I'm thinking of migrating from couchdb to couchbase...
Thanks
Thanos | 0 | [
2,
13,
106,
9949,
4146,
29,
4914,
8436,
800,
3726,
3726,
25,
11181,
4481,
13,
106,
9949,
4146,
29,
4914,
8436,
60,
100,
86,
98,
107,
42,
107,
32,
17,
98,
50,
154,
5513,
13,
60,
31,
22,
79,
1440,
16,
28749,
37,
4914,
9007,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Obtaining current GCC architecture
===
How can I find out what the `-march` default argument is for the current architecture if I don't supply any? | 0 | [
2,
12114,
866,
489,
3384,
2607,
800,
3726,
3726,
184,
92,
31,
477,
70,
98,
14,
13,
1,
8,
6620,
1,
12838,
5476,
25,
26,
14,
866,
2607,
100,
31,
221,
22,
38,
2837,
186,
60,
3,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Android, How to get context of calling activity in an IntentService?
===
If I call
Intent intent = new Intent(ReadingActivity.this, AdService.class);
startService(intent);
from within the onCreate method of MyActivity class how do I get access to MyActivity.this from inside the onHandleIntent method of the IntentService class
@Override
protected void onHandleIntent(Intent arg0) {
// TODO Auto-generated method stub
((BookLib) getApplication()).createAd(I need to pass the calling activities context here);
}
| 0 | [
2,
13005,
15,
184,
20,
164,
4141,
16,
2555,
2358,
19,
40,
6936,
11449,
60,
800,
3726,
3726,
100,
31,
645,
6936,
6936,
800,
78,
6936,
5,
22883,
19348,
9,
1565,
15,
21,
43,
11449,
9,
1898,
6,
73,
799,
11449,
5,
6391,
2291,
6,
73... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create a customized dynamic table view like the news feed page in Facebook or Path?
===
I am a beginner in app development. The app I am developing now has a feature of news feed like the one in Facebook or Path. What kind of architecture should I use in this case? And how can I link the prototype cell views I drew in storyboard to the code? | 4 | [
2,
184,
20,
1600,
21,
28779,
7782,
859,
1418,
101,
14,
996,
4063,
2478,
19,
9090,
54,
2013,
60,
800,
3726,
3726,
31,
589,
21,
26931,
19,
4865,
522,
9,
14,
4865,
31,
589,
3561,
130,
63,
21,
1580,
16,
996,
4063,
101,
14,
53,
19,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to return a distionary key, based on searching multiple values
===
I have a python dictionary that has key:value pairs where the value is a nested list containing positions for a 3d geometry matrix:
{Point_Index: [position_X, position_Y, position_Z]}
I should mention that the keys are unique, but the values are not.
How would I search the dictionary and return the Point_Index Key, based on the highest position_X, position_y and Position_Z in the dictionary?
Thanks for any help! | 0 | [
2,
184,
20,
788,
21,
1460,
3309,
1857,
1246,
15,
432,
27,
5792,
1886,
4070,
800,
3726,
3726,
31,
57,
21,
20059,
9186,
30,
63,
1246,
45,
15165,
7473,
113,
14,
1923,
25,
21,
5618,
69,
968,
3503,
3062,
26,
21,
203,
43,
11689,
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... |
Python osascript returning 0 it seems
===
I'm trying to work with applescript for retrieving BPM values of songs. Eventually I'd like to implement it with a game. Here's my code:
import os
import time
import sys
def getBPM():
iTunesInstruct = """'
tell application "iTunes"
set k to get bpm of current track
end tell
return k
'"""
bpm = os.system('arch -i386 osascript -e ' + iTunesInstruct )
#bpm =90
bpm = int(bpm)
bpm = round(bpm)
if bpm > 250:
bpm = 200
return bpm
def getBeatSecond(bpm):
bps = float(bpm) / 60
#raw_input(bps)
return float(bps)
i = 0
beatMatch = True
while True:
beat = 1 / getBeatSecond(getBPM()) # BPS Beat divided by a second.
if beatMatch:
time.sleep(beat)
print beat
else:
raw_input('Go??')
i += 1
if i > 50:
break
But this seems to only work once... it got the BPM of the song I was listening to, saw it was 94, and then it seems on the second iteration it thought it was 0, and then it divided by 0 and died. What's going on? | 0 | [
2,
20059,
13,
4947,
8741,
2485,
713,
32,
2206,
800,
3726,
3726,
31,
22,
79,
749,
20,
170,
29,
4037,
8741,
26,
13,
6239,
3272,
8397,
17308,
79,
4070,
16,
916,
9,
878,
31,
22,
43,
101,
20,
8713,
32,
29,
21,
250,
9,
235,
22,
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... |
Counting object results in Twitter query
===
I'm trying to show my query results of my Twitter-api request.
But I can't find the proper code anywhere on the interweb.
So after my query, I'd like to post the amount of objects, not the content of the objects itself.
Thanks. | 0 | [
2,
11195,
3095,
1736,
19,
10623,
25597,
800,
3726,
3726,
31,
22,
79,
749,
20,
298,
51,
25597,
1736,
16,
51,
10623,
8,
2552,
49,
3772,
9,
47,
31,
92,
22,
38,
477,
14,
4119,
1797,
4922,
27,
14,
1480,
14113,
9,
86,
75,
51,
25597,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can't cancel a button click
===
I have a html button in a web page. When I click the button, I'd like to redirect to another page.
I have this code :
<button id="btn" type="submit" style="width: auto">
<div style="height: 40px">
<img alt="Button" src="/images/somepicture.png" style="float: left" />
<span style="margin: auto">Label</span>
</div>
</button>
<script language="javascript" type="text/javascript">
$(function () {
$("#btn")
.mousedown(function (event) {
window.location.href = "otherpage";
event.preventDefault();
});
});
</script>
However, this code is not behaving as expected. The page is simply posting, and the redirection does not occurs.
What is wrong with my code? | 0 | [
2,
92,
22,
38,
14815,
21,
5167,
10840,
800,
3726,
3726,
31,
57,
21,
13,
15895,
5167,
19,
21,
2741,
2478,
9,
76,
31,
10840,
14,
5167,
15,
31,
22,
43,
101,
20,
302,
14706,
20,
226,
2478,
9,
31,
57,
48,
1797,
13,
45,
13,
1,
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... |
Epiphany Browser 2.30.6-1 from Debian Squeeze doesn't dynamically load scripts?
===
I have a lil problem only with the Epiphany Browser 2.30.6-1 from Debian Squeeze when i'm trying to dynamically load scripts. It places correctly the script element with the attributes but the browser doesn't continue to download the file. I'm using this simple command from dojo:
dojo.create('script',{type:'application/javascript',src:libfile},query('html > head')[0],'first');
It works with any other browser without problem. I tried to do this manually with DOM command ands still nothing and at last i googled it for relative problems for any browser not just for Epiphany and still didn't find anything. It is not so important but just i'm wondering why doesn't work in this browser. | 0 | [
2,
5971,
9944,
93,
16495,
172,
9,
1762,
9,
379,
8,
165,
37,
121,
10035,
10202,
1437,
22,
38,
7782,
1326,
6305,
17505,
60,
800,
3726,
3726,
31,
57,
21,
9672,
1448,
104,
29,
14,
5971,
9944,
93,
16495,
172,
9,
1762,
9,
379,
8,
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... |
XMLEventWriter from scratch: how do I emit xmlns attribute?
===
I am trying to write an XML document from scratch using the XMLEventWriter from the StAX API.
I cannot figure out how to get the default namespace attribute to be emitted.
For example, the default namespace URI string is "http://www.liquibase.org/xml/ns/dbchangelog/1.9". I want that to be present in my XML root element as xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9".
What's the magic recipe here? XMLEventWriter.setDefaultNamespace() didn't work.
Thanks,
Laird | 0 | [
2,
23504,
4943,
38,
9657,
37,
12395,
45,
184,
107,
31,
8468,
38,
23504,
2172,
35,
14755,
60,
800,
3726,
3726,
31,
589,
749,
20,
2757,
40,
23504,
4492,
37,
12395,
568,
14,
23504,
4943,
38,
9657,
37,
14,
13,
18,
15514,
21,
2159,
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... |
What's wrong with this array search function?
===
I have written the following function to search an multi-dimensional array by key, but if I call the function with key "uri", it appends arrays having key "0" to the found array. What's wrong?
function search_arr($array, $key, &$found) {
foreach ($array as $k => $each) {
if ($k == $key) {
// output of "print $k = $key" is "0 = uri"
$found[] = $each;
}
if (is_array($each)) {
search_arr($each, $key, &$found);
}
}
}
| 0 | [
2,
98,
22,
18,
1389,
29,
48,
7718,
2122,
1990,
60,
800,
3726,
3726,
31,
57,
642,
14,
249,
1990,
20,
2122,
40,
1889,
8,
7865,
7718,
34,
1246,
15,
47,
100,
31,
645,
14,
1990,
29,
1246,
13,
7,
3594,
7,
15,
32,
4865,
2451,
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... |
addEventListener("beforeload") missing events
===
I'm trying to make a simple Chrome Addon to remove every event from domain x. I've looked into it and found out about the "beforeload" event listener, this is apparently what things like adblock use to block ads completely from loading. I've implemented this into the addon and added things like console.log("addon loaded") to be sure it's actually loading the javascript, but the **problem is, it only catches a handful of the events, for instance on a page of 50 events, it catches only maybe 1-2. It misses obvious other things.**
twitch.js
document.addEventListener("beforeload", function(event) {
event.preventDefault();
$(event.target).remove();
}, true);
manifest.json
...
"content_scripts": [ {
"js": [ "js/jquery.js", "js/twitch.js" ],
"css": [ "css/twitch.css"],
"matches": ["*://*/*"],
"run_at": "document_start",
"all_frames" : true
}],
...
Does anyone have any ideas? | 0 | [
2,
3547,
4943,
38,
13891,
106,
5,
7,
12750,
8294,
7,
6,
2863,
963,
800,
3726,
3726,
31,
22,
79,
749,
20,
233,
21,
1935,
13,
12985,
3547,
218,
20,
4681,
352,
807,
37,
4603,
993,
9,
31,
22,
195,
292,
77,
32,
17,
216,
70,
88,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Fastest GUI for lowend computer
===
I developed a **public view** for the status of different objects, looking something like this one: [http://tctechcrunch2011.files.wordpress.com/2012/07/bridge-metrics.jpeg][1]
It currently runs on an old machine (don't know specs now, sorry for that) using linux with running a **website in fullscreen view** in opera. The website GETs a JSON from a server an then arranages some html divs according to the stati in the JSON.
The problem is, that everything more than just displaying some html divs (e.g. blinking via css toggling in a window.setintervall callback) is very slow and sometimes hangs.
Whats the best solution to replace the web frontend but keep tasks like sending a GET request and parsing the JSON response easy? Something like python + opengl?
Or any other solutions to **get the best out of this old machine?**
[1]: http://tctechcrunch2011.files.wordpress.com/2012/07/bridge-metrics.jpeg | 4 | [
2,
7518,
9457,
26,
708,
2451,
1428,
800,
3726,
3726,
31,
885,
21,
13,
1409,
12259,
1418,
1409,
26,
14,
1782,
16,
421,
3916,
15,
699,
301,
101,
48,
53,
45,
636,
21127,
6903,
6668,
6524,
13555,
3097,
9,
16877,
18,
9,
9587,
5890,
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... |
Shorthand for IgnoreRoute
===
I noticed a SO answer suggesting [or-delimited matches for IgnoreRoute][1], like this:
routes.IgnoreRoute("*.js|css|swf");
When I gave that a try, it failed. I had to convert that suggested one-line of code into multiple lines, like this:
routes.IgnoreRoute("Javascript/{*catchall}");
routes.IgnoreRoute("Content/{*catchall}");
routes.IgnoreRoute("Scripts/{*catchall}");
Is there in fact a more compact way to express this, as the original (erroneously?) suggested?
And yes, please assume that I want and need `routes.RouteExistingFiles = true`
[1]: http://stackoverflow.com/a/4682764/284758 | 0 | [
2,
502,
3203,
26,
7174,
20179,
800,
3726,
3726,
31,
2711,
21,
86,
1623,
8946,
636,
248,
8,
546,
23012,
1717,
26,
7174,
20179,
500,
2558,
165,
500,
15,
101,
48,
45,
5050,
9,
23565,
99,
20179,
5,
7,
2483,
9,
728,
18,
1,
6824,
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... |
Programatically created Like Button leaks huge amounts of Memory
===
I'm working on a pure Javascript Application that needs to create Facebook Like Buttons programatically (RSS News Reader). Unfortunately this isn't viable because repeatedly creating Like Buttons leaks huge amounts of memory in a short time.
I've created a [jsFiddle][1] that demonstrates the problem (just watch the memory consumption for the jsFiddle Tab continously increase and never recover). Any suggestions on how to prevent this from happening would be appreciated.
P.S: Ironically, the Google+ Like button has the same problem.
[1]: http://jsfiddle.net/oliverw/G2qkc/3/ | 0 | [
2,
625,
721,
8438,
679,
101,
5167,
11724,
18,
2329,
8545,
16,
1912,
800,
3726,
3726,
31,
22,
79,
638,
27,
21,
4267,
8247,
8741,
3010,
30,
2274,
20,
1600,
9090,
101,
12861,
625,
721,
8438,
13,
5,
1224,
18,
996,
7765,
6,
9,
6200,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 are all the MSDeploy attributes in MSDeploy files?
===
Created a dump of an Application Pool using MSDeploy, and it created an XML file.
The file contains alot of matching MSDeploy attributes, here is the processModel tag,
<processModel identityType="LocalSystem" userName=""
MSDeploy.userName="1" password="" MSDeploy.password="1"
loadUserProfile="true" MSDeploy.loadUserProfile="1"
setProfileEnvironment="false"
MSDeploy.setProfileEnvironment="1" logonType="LogonBatch"
MSDeploy.logonType="1" manualGroupMembership="false"
MSDeploy.manualGroupMembership="1" idleTimeout="00:11:00"
MSDeploy.idleTimeout="1" maxProcesses="1"
MSDeploy.maxProcesses="1" shutdownTimeLimit="00:01:30"
MSDeploy.shutdownTimeLimit="1" startupTimeLimit="00:01:30"
MSDeploy.startupTimeLimit="1" pingingEnabled="true"
MSDeploy.pingingEnabled="1" pingInterval="00:00:30"
MSDeploy.pingInterval="1" pingResponseTime="00:01:30"
MSDeploy.pingResponseTime="1"
MSDeploy.MSDeployLinkName="processModel" />
most of the attributes have a duplicate proceeding it with MSDeploy with a number 1 as value.
eg. `password="" MSDeploy.password="1"` what does this attribute do? what does the 1 mean? I haven't been able to find anything online since honestly not sure what should I be looking for.
I would appreciate any sort of info how what this is or what it is used for. | 0 | [
2,
98,
50,
65,
14,
4235,
17309,
10892,
13422,
19,
4235,
17309,
10892,
6488,
60,
800,
3726,
3726,
679,
21,
11424,
16,
40,
3010,
3067,
568,
4235,
17309,
10892,
15,
17,
32,
679,
40,
23504,
3893,
9,
14,
3893,
1588,
21,
5639,
16,
10120... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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.