PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,401,525 | 09/13/2011 12:02:33 | 235,017 | 12/19/2009 06:36:57 | 425 | 29 | Server unrisponsive after AJAX call is aborted | I have a situation where my Ajax call to the server may take a long time (30-40 seconds). I am using jQuery.ajax and setting the timeout to 60 seconds. So, if I do not get any response in 60 seconds, the call is aborted and an error is reported.
The problem now is any successive calls to the server after this point just keeps waiting, not just AJAX calls, even opening up a new page from the same server in a new window, just keeps waiting. The only way to get it working again is to restart the browser completely. What might be causing this? Is this something to do with the server? | php | jquery | ajax | apache | timeout | null | open | Server unrisponsive after AJAX call is aborted
===
I have a situation where my Ajax call to the server may take a long time (30-40 seconds). I am using jQuery.ajax and setting the timeout to 60 seconds. So, if I do not get any response in 60 seconds, the call is aborted and an error is reported.
The problem now is any successive calls to the server after this point just keeps waiting, not just AJAX calls, even opening up a new page from the same server in a new window, just keeps waiting. The only way to get it working again is to restart the browser completely. What might be causing this? Is this something to do with the server? | 0 |
11,430,281 | 07/11/2012 10:08:14 | 1,517,216 | 07/11/2012 08:59:44 | 1 | 0 | Tridion Broker db and IIS | I am currently using Tridion 5.3.After pages are published from Tridion CM side to Broker db, how are the pages fetched by IIS and shown to the end user.
Can you help me with this. | tridion | tridion-content-delivery | null | null | null | null | open | Tridion Broker db and IIS
===
I am currently using Tridion 5.3.After pages are published from Tridion CM side to Broker db, how are the pages fetched by IIS and shown to the end user.
Can you help me with this. | 0 |
11,430,285 | 07/11/2012 10:08:34 | 949,439 | 09/16/2011 19:09:38 | 1 | 0 | How can I report from rails3.2.3 using jasper report? | I am using rails 3.2.2. I want to report from rails using jasper report. Can I get any tutorial or Help? | jasper-reports | ruby-on-rails-3.2 | null | null | null | null | open | How can I report from rails3.2.3 using jasper report?
===
I am using rails 3.2.2. I want to report from rails using jasper report. Can I get any tutorial or Help? | 0 |
11,430,105 | 07/11/2012 09:59:06 | 1,505,907 | 07/06/2012 06:21:07 | 1 | 0 | Error in PHPmyadmin | In my Localhost when try to connect phpmyadmin I have an error like this
"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server".
How to correct the issue ? please help me. | mysql | null | null | null | null | null | open | Error in PHPmyadmin
===
In my Localhost when try to connect phpmyadmin I have an error like this
"phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server".
How to correct the issue ? please help me. | 0 |
11,728,304 | 07/30/2012 19:33:03 | 1,099,235 | 12/15/2011 06:10:25 | 18 | 0 | User Input Validation in Windows Forms Implementing Model View Presenter | I am trying to validate User Input in Windows Forms Application (using MVP design Pattern). Since this is my first project using MVP, I am not very clear where and how to put the user input validation code.
To be specific, I have a Products form which contains two text box controls, Namely ProductName and ProductPrice.
Below is the code for my ProductForm, IProductView and ProductPresenter
IProductView.cs
public interface IProductView
{
string ProductName { get; set; }
int ProductPrice { get; set; }
event EventHandler<EventArgs> Save;
}
frmProduct.cs
public partial class frmProduct : Form,IProductView
{
ProductPresenter pPresenter;
public frmProduct()
{
InitializeComponent();
pPresenter = new ProductPresenter(this);
}
public new string ProductName
{
get
{
return txtName.Text;
}
}
public int ProductPrice
{
get
{
return Convert.ToInt32(txtPrice.Text);
}
}
public event EventHandler<EventArgs> Save;
}
ProductPresenter.cs
public class ProductPresenter
{
private IProductView pView;
public ProductPresenter(IProductView View)
{
this.pView = View;
this.Initialize();
}
private void Initialize()
{
this.pView.Save += new EventHandler<EventArgs>(pView_Save);
void pView_Save(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
I do want to use the ErrorProvider(EP) Control + since I would be using EP control on many forms, I would really love if I could reuse most of the code by putting the EP code in some method and passing it the controls and appropriate message. Where should I put this validation code?
Regards,
| c# | winforms | validation | mvp | null | null | open | User Input Validation in Windows Forms Implementing Model View Presenter
===
I am trying to validate User Input in Windows Forms Application (using MVP design Pattern). Since this is my first project using MVP, I am not very clear where and how to put the user input validation code.
To be specific, I have a Products form which contains two text box controls, Namely ProductName and ProductPrice.
Below is the code for my ProductForm, IProductView and ProductPresenter
IProductView.cs
public interface IProductView
{
string ProductName { get; set; }
int ProductPrice { get; set; }
event EventHandler<EventArgs> Save;
}
frmProduct.cs
public partial class frmProduct : Form,IProductView
{
ProductPresenter pPresenter;
public frmProduct()
{
InitializeComponent();
pPresenter = new ProductPresenter(this);
}
public new string ProductName
{
get
{
return txtName.Text;
}
}
public int ProductPrice
{
get
{
return Convert.ToInt32(txtPrice.Text);
}
}
public event EventHandler<EventArgs> Save;
}
ProductPresenter.cs
public class ProductPresenter
{
private IProductView pView;
public ProductPresenter(IProductView View)
{
this.pView = View;
this.Initialize();
}
private void Initialize()
{
this.pView.Save += new EventHandler<EventArgs>(pView_Save);
void pView_Save(object sender, EventArgs e)
{
throw new NotImplementedException();
}
}
I do want to use the ErrorProvider(EP) Control + since I would be using EP control on many forms, I would really love if I could reuse most of the code by putting the EP code in some method and passing it the controls and appropriate message. Where should I put this validation code?
Regards,
| 0 |
11,728,306 | 07/30/2012 19:33:11 | 1,563,934 | 07/30/2012 19:23:17 | 1 | 0 | What mysql indexes should I use with this query? | SELECT * FROM items WHERE caption LIKE 'name%' AND type = 'private' OR owner LIKE 'name%' type = 'private' ORDER BY uses DESC LIMIT 40;
Possible keys: items_caption,items_owner,items_type
Key: items_uses
(Got these by using the explain command)
It takes about 1.8 seconds to do that query and there are over million records in the table. I don't know how to make a index for this query and I've no control over the source so I can't modify the query. | mysql | linux | query | index | key | null | open | What mysql indexes should I use with this query?
===
SELECT * FROM items WHERE caption LIKE 'name%' AND type = 'private' OR owner LIKE 'name%' type = 'private' ORDER BY uses DESC LIMIT 40;
Possible keys: items_caption,items_owner,items_type
Key: items_uses
(Got these by using the explain command)
It takes about 1.8 seconds to do that query and there are over million records in the table. I don't know how to make a index for this query and I've no control over the source so I can't modify the query. | 0 |
11,728,307 | 07/30/2012 19:33:12 | 743,171 | 05/07/2011 15:45:43 | 149 | 12 | CGContextSetFillColorWithColor: invalid context 0x0 | I am trying to set the color of all the ranges in my array but I am getting this error. I don't understand why. the ranges are all valid. I even tried manually inserting a range to test it. Thank You.
CGContextSetFillColorWithColor: invalid context 0x0
NSMutableAttributedString * string = [[NSMutableAttributedString alloc] initWithString:tv.text];
for (NSString * s in array) {
[string addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSRangeFromString(s)];
}
CATextLayer *textlayer = [[CATextLayer alloc]init];
textlayer.frame = CGRectMake(0, 0, 320, 480);
[self.view.layer addSublayer:textlayer];
textlayer.string = @"aString"; //works
textlayer.string = string; //does not work
tv.text = @"";
| iphone | objective-c | ios | ios5 | ios4 | null | open | CGContextSetFillColorWithColor: invalid context 0x0
===
I am trying to set the color of all the ranges in my array but I am getting this error. I don't understand why. the ranges are all valid. I even tried manually inserting a range to test it. Thank You.
CGContextSetFillColorWithColor: invalid context 0x0
NSMutableAttributedString * string = [[NSMutableAttributedString alloc] initWithString:tv.text];
for (NSString * s in array) {
[string addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:NSRangeFromString(s)];
}
CATextLayer *textlayer = [[CATextLayer alloc]init];
textlayer.frame = CGRectMake(0, 0, 320, 480);
[self.view.layer addSublayer:textlayer];
textlayer.string = @"aString"; //works
textlayer.string = string; //does not work
tv.text = @"";
| 0 |
11,728,311 | 07/30/2012 19:33:18 | 1,031,311 | 11/05/2011 16:34:17 | 28 | 3 | why does cmake reports error with gcc version unknown | I am trying to cross compile a program into android using cmake. when i try to compile using arm-gcc it checks the compiler with no problem but when it checks for the vesion it gives gcc version unknown error.
A snippet of the code is here
if("${gcc_version_RESULT}" STREQUAL "0")
if(NOT GCC_VERSION)
execute_process(
COMMAND "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests/gcc_version"
OUTPUT_VARIABLE GCC_VERSION)
endif()
i am not sure where the problem is ..
i have tried deleting the cmakecache, export CC, please helo me | android | gcc | cmake | cross-compiling | null | null | open | why does cmake reports error with gcc version unknown
===
I am trying to cross compile a program into android using cmake. when i try to compile using arm-gcc it checks the compiler with no problem but when it checks for the vesion it gives gcc version unknown error.
A snippet of the code is here
if("${gcc_version_RESULT}" STREQUAL "0")
if(NOT GCC_VERSION)
execute_process(
COMMAND "${CMAKE_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/config_tests/gcc_version"
OUTPUT_VARIABLE GCC_VERSION)
endif()
i am not sure where the problem is ..
i have tried deleting the cmakecache, export CC, please helo me | 0 |
11,728,046 | 07/30/2012 19:12:41 | 1,317,394 | 04/06/2012 12:05:14 | 773 | 55 | After "Default" animation | I want to add some animation after my Default.png is no longer necessary. I know that I will do it in `application didFinishLaunchingWithOptions` but my question what format animation should be and how to load it?
There is a plenty app with beautiful animations right after default. But i can't figure out how it works. | objective-c | ios | null | null | null | null | open | After "Default" animation
===
I want to add some animation after my Default.png is no longer necessary. I know that I will do it in `application didFinishLaunchingWithOptions` but my question what format animation should be and how to load it?
There is a plenty app with beautiful animations right after default. But i can't figure out how it works. | 0 |
11,728,312 | 07/30/2012 19:33:20 | 701,346 | 04/10/2011 23:23:42 | 860 | 28 | Teradata: Is it possible to generate an identity column value without creating a record? | In Oracle, I used to use sequences to generate value for a table's unique identifier. In a stored procedure, I'd call sequencename.nextval and assign that value to a variable. After that, I'd use that variable for the procedure's insert statement and the procedure's out param so I could deliver the newly-generated ID to the .NET client.
I'd like to do the same thing with Teradata, but I am thinking the only way to accomplish this is to create a table that holds a value that is sequentially incremented. Ideally, however, I'd really like to be able to acquire the value that will be used for an identity column's next value without actually creating a new record in the database. | teradata | identity-column | null | null | null | null | open | Teradata: Is it possible to generate an identity column value without creating a record?
===
In Oracle, I used to use sequences to generate value for a table's unique identifier. In a stored procedure, I'd call sequencename.nextval and assign that value to a variable. After that, I'd use that variable for the procedure's insert statement and the procedure's out param so I could deliver the newly-generated ID to the .NET client.
I'd like to do the same thing with Teradata, but I am thinking the only way to accomplish this is to create a table that holds a value that is sequentially incremented. Ideally, however, I'd really like to be able to acquire the value that will be used for an identity column's next value without actually creating a new record in the database. | 0 |
11,728,314 | 07/30/2012 19:33:28 | 209,706 | 11/12/2009 15:30:53 | 2,765 | 103 | Git: merge conflict and commit message | I merge with Git and get a conflict. After having resolved the conflicts, upon commit I will see an auto-generated commit message containing a list of files which were in conflict. What is the best-practice - should I keep this list of conflicting files for a good reason or can I delete this part of the commit message? | git | merge | null | null | null | null | open | Git: merge conflict and commit message
===
I merge with Git and get a conflict. After having resolved the conflicts, upon commit I will see an auto-generated commit message containing a list of files which were in conflict. What is the best-practice - should I keep this list of conflicting files for a good reason or can I delete this part of the commit message? | 0 |
11,728,316 | 07/30/2012 19:33:39 | 1,223,948 | 02/21/2012 17:19:52 | 1 | 0 | Script executes but code-behind not | I have a button on my aspx page. With this button, I'll add a option element into a select element and add some data to a GridView displayed on the page. I want to put the option element first than executes my code-behind from this button.
I have the button and the evaluated combobox:
<asp:DropDownList runat="server" ID="comboboxPeople" ... />
<asp:Button runat="server" ID="buttonAdd" text="Add passanger" OnClick="buttonAdd_Click" OnClientClick="addOptionToSelectElement();" />
I have the script:
function addOptionToSelectElement() {
var cb = document.getElementById('<%=comboboxPeople.ClientID %>');
var cbout = document.getElementById('<%=comboboxOutput.ClientID %>');
var op = document.createElement("op");
op.value = cb.options[cb.selectedIndex].value;
op.text = cb.options[cb.selectedIndex].text;
cbout.appendChild(op);
}
And my code-behind:
protected void buttonAdd_Click(object sender, EventArgs e)
{
DoSomething(...);
}
Here's my problem: If I attach the script function to my button, the code-behind doesn't work. If I don't use the script, my code-behind runs.
Any idea?
Thanks!! | javascript | asp.net | null | null | null | null | open | Script executes but code-behind not
===
I have a button on my aspx page. With this button, I'll add a option element into a select element and add some data to a GridView displayed on the page. I want to put the option element first than executes my code-behind from this button.
I have the button and the evaluated combobox:
<asp:DropDownList runat="server" ID="comboboxPeople" ... />
<asp:Button runat="server" ID="buttonAdd" text="Add passanger" OnClick="buttonAdd_Click" OnClientClick="addOptionToSelectElement();" />
I have the script:
function addOptionToSelectElement() {
var cb = document.getElementById('<%=comboboxPeople.ClientID %>');
var cbout = document.getElementById('<%=comboboxOutput.ClientID %>');
var op = document.createElement("op");
op.value = cb.options[cb.selectedIndex].value;
op.text = cb.options[cb.selectedIndex].text;
cbout.appendChild(op);
}
And my code-behind:
protected void buttonAdd_Click(object sender, EventArgs e)
{
DoSomething(...);
}
Here's my problem: If I attach the script function to my button, the code-behind doesn't work. If I don't use the script, my code-behind runs.
Any idea?
Thanks!! | 0 |
11,728,317 | 07/30/2012 19:33:41 | 1,387,727 | 05/10/2012 16:53:45 | 61 | 2 | GWT - Unexpected scrollbar appeared in GWT-DataGrid while using Canvas | I found a bug that there will be some unexpected scrollbars appeared in GWT-DataGrid when using Canvas in the same area. No matter what functions of Canvas I used, even if I just use Canvas to draw a line, it will cause problem. The scenario is hard to describe clearly. I will try my best. Hope you know what I am talking about.
In my app, when users click a button, the popup panel which contains a DataGrid will show up. Under the popup panel, in RootLayoutPanel, I have a Canvas which draws some graphs. If Canvas and the DataGrid appeared in the same area (they "interlace"), the bug will appear (some unexpected weird scroll bars show up). On the other hand, if they don't appear in the same area, or I just do not let the Canvas start drawing if they interlace, then no problem at all. For example, if I move the Canvas away from underneath of popup panel which contains DataGrid,so that they do not interlace, DataGrid will have no problem.
I found someone have reported this bug in Google as well. And it is exactly what I encounter. But no one can answer why or provide some workaround.
http://code.google.com/p/google-web-toolkit/issues/detail?id=7338
If you have any workaround. please let me know. Thanks | java | gwt | canvas | datagrid | scrollbar | null | open | GWT - Unexpected scrollbar appeared in GWT-DataGrid while using Canvas
===
I found a bug that there will be some unexpected scrollbars appeared in GWT-DataGrid when using Canvas in the same area. No matter what functions of Canvas I used, even if I just use Canvas to draw a line, it will cause problem. The scenario is hard to describe clearly. I will try my best. Hope you know what I am talking about.
In my app, when users click a button, the popup panel which contains a DataGrid will show up. Under the popup panel, in RootLayoutPanel, I have a Canvas which draws some graphs. If Canvas and the DataGrid appeared in the same area (they "interlace"), the bug will appear (some unexpected weird scroll bars show up). On the other hand, if they don't appear in the same area, or I just do not let the Canvas start drawing if they interlace, then no problem at all. For example, if I move the Canvas away from underneath of popup panel which contains DataGrid,so that they do not interlace, DataGrid will have no problem.
I found someone have reported this bug in Google as well. And it is exactly what I encounter. But no one can answer why or provide some workaround.
http://code.google.com/p/google-web-toolkit/issues/detail?id=7338
If you have any workaround. please let me know. Thanks | 0 |
11,728,298 | 07/30/2012 19:32:51 | 65,651 | 02/12/2009 17:09:22 | 31 | 2 | Combining BCrypt or PBKDF2 with another hashing algorithm | We are currently in the process of strengthening our password protection.
We have been doing a fair amount of reading on SHA-2, Bcrypt, PBKDF2, and Scrypt. That being said, we are not security experts or cryptologists, and a lot of the technical aspects of the subject matter goes over our heads.
We understand the purpose of the blowfish derived algorithms and the benefit of a work factor. All make sense, and at this point we are leaning toward implementing either PBKDF2 or Bcrypt.
However, we were curious as to whether or not there was a benefit to using a SHA-2 algorithm in concert with either Bcrypt or PBKDF2. We had looked at the post:
http://security.stackexchange.com/questions/11552/would-it-make-sense-to-use-bcrypt-and-pbkdf2-together
But this is really more about using both Bcrypt and PBKDF2 together, and not a SHA-2.
Is there a benefit of leveraging a SHA-2 algorithm with either Bcrypt or PBKDF2? Or is it wasted effort/performance for no appreciable increase in actual security?
Thanks in advance for any insight anyone can provide.
pbr | hashing | bcrypt | pbkdf2 | sha2 | null | null | open | Combining BCrypt or PBKDF2 with another hashing algorithm
===
We are currently in the process of strengthening our password protection.
We have been doing a fair amount of reading on SHA-2, Bcrypt, PBKDF2, and Scrypt. That being said, we are not security experts or cryptologists, and a lot of the technical aspects of the subject matter goes over our heads.
We understand the purpose of the blowfish derived algorithms and the benefit of a work factor. All make sense, and at this point we are leaning toward implementing either PBKDF2 or Bcrypt.
However, we were curious as to whether or not there was a benefit to using a SHA-2 algorithm in concert with either Bcrypt or PBKDF2. We had looked at the post:
http://security.stackexchange.com/questions/11552/would-it-make-sense-to-use-bcrypt-and-pbkdf2-together
But this is really more about using both Bcrypt and PBKDF2 together, and not a SHA-2.
Is there a benefit of leveraging a SHA-2 algorithm with either Bcrypt or PBKDF2? Or is it wasted effort/performance for no appreciable increase in actual security?
Thanks in advance for any insight anyone can provide.
pbr | 0 |
11,728,300 | 07/30/2012 19:32:57 | 1,558,422 | 07/27/2012 18:04:02 | 3 | 0 | SQL Syntax JOIN google bigquery | I am getting this error in Google BigQuery:
Error: Ambiguous field reference in SELECT clause. (Remember to fully qualify all field names in the SELECT clause as <table.field>.)
My query is
SELECT LoanPerf1.loankey, Loans.Key
FROM prosperloans1.LoanPerf1
JOIN prosperloans1.Loans
ON LoanPerf1.loankey = Loans.Key
prosperloans1 is the dataset id
the 2 table names are correct.
the error returns regardless of which field name appears first in the select clause.
The documentation on Google SQL Syntax says this is correct:
// Simple JOIN of two tables
SELECT table1.id, table2.username
FROM table1
JOIN table2
ON table1.name = table2.name AND table1.id = table2.customer_id;
Thanks
Shawn | google-bigquery | null | null | null | null | null | open | SQL Syntax JOIN google bigquery
===
I am getting this error in Google BigQuery:
Error: Ambiguous field reference in SELECT clause. (Remember to fully qualify all field names in the SELECT clause as <table.field>.)
My query is
SELECT LoanPerf1.loankey, Loans.Key
FROM prosperloans1.LoanPerf1
JOIN prosperloans1.Loans
ON LoanPerf1.loankey = Loans.Key
prosperloans1 is the dataset id
the 2 table names are correct.
the error returns regardless of which field name appears first in the select clause.
The documentation on Google SQL Syntax says this is correct:
// Simple JOIN of two tables
SELECT table1.id, table2.username
FROM table1
JOIN table2
ON table1.name = table2.name AND table1.id = table2.customer_id;
Thanks
Shawn | 0 |
11,728,056 | 07/30/2012 19:13:19 | 800,270 | 06/15/2011 19:18:29 | 570 | 46 | Why isn't <body> the canvas? | I've had many issues recently regarding the 'canvas' (see http://stackoverflow.com/questions/5225237/background-of-body-element) and how there really isn't any element that IS the canvas in XHTML/HTML.
Until I began running into these sort of problems (and `html{}` styles) I always assumed that body **was** the canvas of the webpage.
This would make sense since the it's ***called*** "body" and it's sibling, "head" contains no visible elements (or at least shouldn't).
Seeing as having "body" **be** the body/canvas of the webpage would make logical sense, as well as solve many a practical problem I see no logic whatsoever in the current structure of:
Canvas // all hail the inaccessible canvas
<html>
<body>
Why was HTML made like this? And why hasn't XHTML fixed this? | html | css | dom | xhtml | null | 08/01/2012 02:56:16 | not a real question | Why isn't <body> the canvas?
===
I've had many issues recently regarding the 'canvas' (see http://stackoverflow.com/questions/5225237/background-of-body-element) and how there really isn't any element that IS the canvas in XHTML/HTML.
Until I began running into these sort of problems (and `html{}` styles) I always assumed that body **was** the canvas of the webpage.
This would make sense since the it's ***called*** "body" and it's sibling, "head" contains no visible elements (or at least shouldn't).
Seeing as having "body" **be** the body/canvas of the webpage would make logical sense, as well as solve many a practical problem I see no logic whatsoever in the current structure of:
Canvas // all hail the inaccessible canvas
<html>
<body>
Why was HTML made like this? And why hasn't XHTML fixed this? | 1 |
11,728,057 | 07/30/2012 19:13:31 | 107,945 | 05/15/2009 20:49:35 | 1,284 | 54 | SQL Server Timezone | In SQL Server 2008 R2 if I do:
select SYSDATETIMEOFFSET()
I get back GMT -6.
The TimeZone in Windows that SQL Server is running on is set GMT -7.
Any ideas why there is a difference? Is there somewhere in SQL Server I need to set the TimeZone?
| sql-server | timezone | null | null | null | null | open | SQL Server Timezone
===
In SQL Server 2008 R2 if I do:
select SYSDATETIMEOFFSET()
I get back GMT -6.
The TimeZone in Windows that SQL Server is running on is set GMT -7.
Any ideas why there is a difference? Is there somewhere in SQL Server I need to set the TimeZone?
| 0 |
11,628,033 | 07/24/2012 09:34:49 | 844,295 | 07/14/2011 10:10:17 | 93 | 7 | Runtime Crash on constructing Gson object with NoClassDefFoundError | I am developing one android application and in that app I am trying to use Gson Library for Json serialization and de-serialization. I downloaded the library from the following link:-
http://code.google.com/p/google-gson/downloads/list
I included the gson-2.2.2.jar in Java Build Path, but the application crashes at run time when constructing Gson object:-
Gson gson = new Gson();
in logcat I get
07-24 14:53:21.648: E/dalvikvm(488): Could not find class 'com.google.gson.Gson', referenced from method com.google.gson.examples.android.GsonProguardExampleActivity.onCreate
07-24 14:53:21.648: W/dalvikvm(488): VFY: unable to resolve new-instance 10 (Lcom/google/gson/Gson;) in Lcom/google/gson/examples/android/GsonProguardExampleActivity;
07-24 14:53:21.668: D/dalvikvm(488): VFY: replacing opcode 0x22 at 0x0010
07-24 14:53:21.668: D/dalvikvm(488): VFY: dead code 0x0012-007a in Lcom/google/gson/examples/android/GsonProguardExampleActivity;.onCreate (Landroid/os/Bundle;)V
07-24 14:53:21.788: D/AndroidRuntime(488): Shutting down VM
07-24 14:53:21.788: W/dalvikvm(488): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-24 14:53:21.814: E/AndroidRuntime(488): FATAL EXCEPTION: main
07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson
07-24 14:53:21.814: E/AndroidRuntime(488): at com.google.gson.examples.android.GsonProguardExampleActivity.onCreate(GsonProguardExampleActivity.java:40)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Looper.loop(Looper.java:123)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invoke(Method.java:521)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-24 14:53:21.814: E/AndroidRuntime(488): at dalvik.system.NativeStart.main(Native Method)
Error is:-
**07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson**
Also, If I include full source of Gson library as another package in my project it all works well.
What am I doing wrong, is this the correct jar?? | android | json | gson | null | null | null | open | Runtime Crash on constructing Gson object with NoClassDefFoundError
===
I am developing one android application and in that app I am trying to use Gson Library for Json serialization and de-serialization. I downloaded the library from the following link:-
http://code.google.com/p/google-gson/downloads/list
I included the gson-2.2.2.jar in Java Build Path, but the application crashes at run time when constructing Gson object:-
Gson gson = new Gson();
in logcat I get
07-24 14:53:21.648: E/dalvikvm(488): Could not find class 'com.google.gson.Gson', referenced from method com.google.gson.examples.android.GsonProguardExampleActivity.onCreate
07-24 14:53:21.648: W/dalvikvm(488): VFY: unable to resolve new-instance 10 (Lcom/google/gson/Gson;) in Lcom/google/gson/examples/android/GsonProguardExampleActivity;
07-24 14:53:21.668: D/dalvikvm(488): VFY: replacing opcode 0x22 at 0x0010
07-24 14:53:21.668: D/dalvikvm(488): VFY: dead code 0x0012-007a in Lcom/google/gson/examples/android/GsonProguardExampleActivity;.onCreate (Landroid/os/Bundle;)V
07-24 14:53:21.788: D/AndroidRuntime(488): Shutting down VM
07-24 14:53:21.788: W/dalvikvm(488): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-24 14:53:21.814: E/AndroidRuntime(488): FATAL EXCEPTION: main
07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson
07-24 14:53:21.814: E/AndroidRuntime(488): at com.google.gson.examples.android.GsonProguardExampleActivity.onCreate(GsonProguardExampleActivity.java:40)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Handler.dispatchMessage(Handler.java:99)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.os.Looper.loop(Looper.java:123)
07-24 14:53:21.814: E/AndroidRuntime(488): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invokeNative(Native Method)
07-24 14:53:21.814: E/AndroidRuntime(488): at java.lang.reflect.Method.invoke(Method.java:521)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-24 14:53:21.814: E/AndroidRuntime(488): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-24 14:53:21.814: E/AndroidRuntime(488): at dalvik.system.NativeStart.main(Native Method)
Error is:-
**07-24 14:53:21.814: E/AndroidRuntime(488): java.lang.NoClassDefFoundError: com.google.gson.Gson**
Also, If I include full source of Gson library as another package in my project it all works well.
What am I doing wrong, is this the correct jar?? | 0 |
11,628,035 | 07/24/2012 09:35:02 | 393,835 | 07/16/2010 12:11:05 | 1,391 | 133 | NSXMLParser along with NSOperation is not working properly | To send request to server to download data I am using NSOperation.After receiving data I am using NSXMLParser to parse response but it is not calling parser delegate methods such -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
or - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName.Can anyone tell where I am doing wrong.
//Creating NSOperation as follows:
NSOperationQueue *operationQueue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(createRequestToGetData) object:nil];
[operationQueue addOperation:operation];
[operation release];
-(void)createRequestToGetData
{
NSError *error;
NSURL *theURL = [NSURL URLWithString:myUrl];
NSData *data = [NSData dataWithContentsOfURL:theURL];
MyXMLParser *theXMLParser = [[MyXMLParser alloc]init];
NSError *theError = NULL;
[theXMLParser parseXMLFileWithData:data parseError:&theError];
NSLog(@"Parse data:%@",theXMLParser.mParsedDict); //Cursor is not coming here.
[theXMLParser release];
}
Note: MyXMLParser is subclass of NSObject which implement Parser delegates methods but my cursor is not reaching at NSLog.When placed debug point in Parser delegate methods found that those methods are not getting called.
Can anyone tell where is the problem and how I can resolve this.
Thanks in advance! | iphone | objective-c | nsxmlparser | nsoperation | null | null | open | NSXMLParser along with NSOperation is not working properly
===
To send request to server to download data I am using NSOperation.After receiving data I am using NSXMLParser to parse response but it is not calling parser delegate methods such -(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
or - (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName.Can anyone tell where I am doing wrong.
//Creating NSOperation as follows:
NSOperationQueue *operationQueue = [NSOperationQueue new];
NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(createRequestToGetData) object:nil];
[operationQueue addOperation:operation];
[operation release];
-(void)createRequestToGetData
{
NSError *error;
NSURL *theURL = [NSURL URLWithString:myUrl];
NSData *data = [NSData dataWithContentsOfURL:theURL];
MyXMLParser *theXMLParser = [[MyXMLParser alloc]init];
NSError *theError = NULL;
[theXMLParser parseXMLFileWithData:data parseError:&theError];
NSLog(@"Parse data:%@",theXMLParser.mParsedDict); //Cursor is not coming here.
[theXMLParser release];
}
Note: MyXMLParser is subclass of NSObject which implement Parser delegates methods but my cursor is not reaching at NSLog.When placed debug point in Parser delegate methods found that those methods are not getting called.
Can anyone tell where is the problem and how I can resolve this.
Thanks in advance! | 0 |
11,628,037 | 07/24/2012 09:35:12 | 1,283,440 | 03/21/2012 13:08:40 | 6 | 0 | Access spring security from second application | I have two applications. Both of them use Spring security with the standart settings.
The problem that I need to access first application through the second one. I need to send password and login to the first application when logging in the second.
Can somebody help with samples or tips please? Thank you.
My spring-security.xml in both applications:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http pattern="/favicon.ico" security="none" />
<http auto-config="true">
<intercept-url pattern="/**" access="ROLE_ADMIN"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="hey" password="there" authorities="ROLE_ADMIN" />
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
| spring | security | null | null | null | null | open | Access spring security from second application
===
I have two applications. Both of them use Spring security with the standart settings.
The problem that I need to access first application through the second one. I need to send password and login to the first application when logging in the second.
Can somebody help with samples or tips please? Thank you.
My spring-security.xml in both applications:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
<http pattern="/favicon.ico" security="none" />
<http auto-config="true">
<intercept-url pattern="/**" access="ROLE_ADMIN"/>
</http>
<authentication-manager>
<authentication-provider>
<user-service>
<user name="hey" password="there" authorities="ROLE_ADMIN" />
</user-service>
</authentication-provider>
</authentication-manager>
</beans:beans>
| 0 |
11,627,833 | 07/24/2012 09:23:03 | 946,086 | 09/15/2011 05:42:20 | 67 | 7 | Why must I add these memory statements? | I encounter an error when I run this program from Chapter 8 of Cocoa Programming for Mac OSX by Aaron Hillegass.
The program binds a tableview to an array controller. In the setEmployees method of the array controller,
-(void)setEmployees:(NSMutableArray *)a
{
if(a==employees)
return;
[a retain];//must add
[employees release]; //must add
employees=a;
}
In the book, the two retain and release statements were not included and my program crashes whenever I try to add a new employee. After googling I found these two must-add statements to prevent program crashing.
I do not understand the memory management here. I am assigning `a` to `employees`. Why must I retain `a` if I am not deallocating anything? Why can I release `employees` before using it in the last assignment statement? | cocoa | memory-management | null | null | null | null | open | Why must I add these memory statements?
===
I encounter an error when I run this program from Chapter 8 of Cocoa Programming for Mac OSX by Aaron Hillegass.
The program binds a tableview to an array controller. In the setEmployees method of the array controller,
-(void)setEmployees:(NSMutableArray *)a
{
if(a==employees)
return;
[a retain];//must add
[employees release]; //must add
employees=a;
}
In the book, the two retain and release statements were not included and my program crashes whenever I try to add a new employee. After googling I found these two must-add statements to prevent program crashing.
I do not understand the memory management here. I am assigning `a` to `employees`. Why must I retain `a` if I am not deallocating anything? Why can I release `employees` before using it in the last assignment statement? | 0 |
11,627,835 | 07/24/2012 09:23:09 | 867,352 | 07/28/2011 11:32:20 | 13 | 1 | Socket close issue in Win7 64 bit? | I have a c# application using RemoteConnectionManager to connect to a socket.I use the functions RegisterChannel to connect to a Port.I do not call unregisterChannel to close the port.The issue i face here is when the application exists the port is closed and released in 32 bit OS,But when using the application in 64 bit the port is not closed when application terminates.
So all i need to know is "Is it possible to forcefully close a port when my application starts?" ..
| c# | sockets | remoting | windows-7-x64 | .net-remoting | null | open | Socket close issue in Win7 64 bit?
===
I have a c# application using RemoteConnectionManager to connect to a socket.I use the functions RegisterChannel to connect to a Port.I do not call unregisterChannel to close the port.The issue i face here is when the application exists the port is closed and released in 32 bit OS,But when using the application in 64 bit the port is not closed when application terminates.
So all i need to know is "Is it possible to forcefully close a port when my application starts?" ..
| 0 |
11,628,038 | 07/24/2012 09:35:20 | 902,040 | 08/19/2011 08:05:05 | 48 | 0 | File Exists in Java? | I trying to check whether a file exists at given directory location.
File seacrhFile = new File("D:/input", contract.conf);
if (seacrhFile.exists()) {
returnFile = seacrhFile;
} else {
system.out.println("No such file exists");
}
reutrn returnFile;
This is working in "D:/input" directory scenario, but if I Change the directory location to src/test/resources/input folder . Then I am getting "No such file exists", eventhough the file exists. | java | null | null | null | null | null | open | File Exists in Java?
===
I trying to check whether a file exists at given directory location.
File seacrhFile = new File("D:/input", contract.conf);
if (seacrhFile.exists()) {
returnFile = seacrhFile;
} else {
system.out.println("No such file exists");
}
reutrn returnFile;
This is working in "D:/input" directory scenario, but if I Change the directory location to src/test/resources/input folder . Then I am getting "No such file exists", eventhough the file exists. | 0 |
11,628,021 | 07/24/2012 09:33:45 | 1,003,374 | 10/19/2011 14:35:51 | 71 | 6 | C# - How to customize OpenFileDialog to select multiple folders and files? | I have posted - http://stackoverflow.com/questions/11624298/how-to-use-open-file-dialog-to-select-a-folder-or-how-to-reuse-rc-file-from, I couldn't find the correct answer.
So, I have changed my question.
I want to customize OpenFileDialog to select multiple folders and files. I tried to find a solution and could see some posts about it.
From the internet, I found the following project - https://github.com/scottwis/OpenFileOrFolderDialog.
However, while using this, I faced one problem. It uses the **GetOpenFileName** function and **OPENFILENAME** structure from MFC.
And **OPENFILENAME** has the member named "**templateID**".
It's the identifier for dialog template. And the sample project has the "**res1.rc**" file and, also have the templated dialog in it.
But I don't know **How can I attach this file to my C# project?**
Or is there any other perfect solution about - "**How to customize OpenFileDialog to select multiple folders and files?**"? | c# | openfiledialog | null | null | null | null | open | C# - How to customize OpenFileDialog to select multiple folders and files?
===
I have posted - http://stackoverflow.com/questions/11624298/how-to-use-open-file-dialog-to-select-a-folder-or-how-to-reuse-rc-file-from, I couldn't find the correct answer.
So, I have changed my question.
I want to customize OpenFileDialog to select multiple folders and files. I tried to find a solution and could see some posts about it.
From the internet, I found the following project - https://github.com/scottwis/OpenFileOrFolderDialog.
However, while using this, I faced one problem. It uses the **GetOpenFileName** function and **OPENFILENAME** structure from MFC.
And **OPENFILENAME** has the member named "**templateID**".
It's the identifier for dialog template. And the sample project has the "**res1.rc**" file and, also have the templated dialog in it.
But I don't know **How can I attach this file to my C# project?**
Or is there any other perfect solution about - "**How to customize OpenFileDialog to select multiple folders and files?**"? | 0 |
11,628,045 | 07/24/2012 09:35:40 | 1,456,252 | 06/14/2012 12:52:03 | 1 | 2 | how to know that page ended in webview and display next page | > ****i am working with webview and i want the functionality of "Reflow" so after spending a lot of time i got some idea and now i am
> reading three html pages as one and now i want to know that how can i
> know that the scroll bar reaches to end ,if it reaches to end display
> next three page.**
> More explanation is here-
> i am working on a task and i have to make a html book reader .here in this i have one checked button reflow on click of reflow all pages
> with joined together and will display as a one and automatically
> loaded after ending of the page very fastly one by one.so please give
> me the idea that how can i solved this issue ,i tried to googled many
> times but did not find any thing please help me.
> Sorry for english,thanks** | android | null | null | null | null | null | open | how to know that page ended in webview and display next page
===
> ****i am working with webview and i want the functionality of "Reflow" so after spending a lot of time i got some idea and now i am
> reading three html pages as one and now i want to know that how can i
> know that the scroll bar reaches to end ,if it reaches to end display
> next three page.**
> More explanation is here-
> i am working on a task and i have to make a html book reader .here in this i have one checked button reflow on click of reflow all pages
> with joined together and will display as a one and automatically
> loaded after ending of the page very fastly one by one.so please give
> me the idea that how can i solved this issue ,i tried to googled many
> times but did not find any thing please help me.
> Sorry for english,thanks** | 0 |
11,628,047 | 07/24/2012 09:35:44 | 440,558 | 09/06/2010 10:41:22 | 19,391 | 1,034 | Difference between regex_match and regex_search? | I was experimenting with regular expression in trying to make an answer to [this question](http://stackoverflow.com/questions/11627440/regex-c-extract-substring), and found that while `regex_match` finds a match, `regex_search` does not.
The following program was compiled with g++ 4.7.1:
#include <regex>
#include <iostream>
int main()
{
const std::string s = "/home/toto/FILE_mysymbol_EVENT.DAT";
std::regex rgx(".*FILE_(.+)_EVENT.DAT.*");
std::smatch match;
if (std::regex_match(s.begin(), s.end(), rgx))
std::cout << "regex_match: match\n";
else
std::cout << "regex_match: no match\n";
if (std::regex_search(s.begin(), s.end(), match, rgx))
std::cout << "regex_search: match\n";
else
std::cout << "regex_search: no match\n";
}
Output:
<pre>
regex_match: match
regex_search: no match
</pre>
Is my assumption that both should match wrong, or might there a problem with the library in GCC 4.7.1? | c++ | regex | gcc | g++ | null | null | open | Difference between regex_match and regex_search?
===
I was experimenting with regular expression in trying to make an answer to [this question](http://stackoverflow.com/questions/11627440/regex-c-extract-substring), and found that while `regex_match` finds a match, `regex_search` does not.
The following program was compiled with g++ 4.7.1:
#include <regex>
#include <iostream>
int main()
{
const std::string s = "/home/toto/FILE_mysymbol_EVENT.DAT";
std::regex rgx(".*FILE_(.+)_EVENT.DAT.*");
std::smatch match;
if (std::regex_match(s.begin(), s.end(), rgx))
std::cout << "regex_match: match\n";
else
std::cout << "regex_match: no match\n";
if (std::regex_search(s.begin(), s.end(), match, rgx))
std::cout << "regex_search: match\n";
else
std::cout << "regex_search: no match\n";
}
Output:
<pre>
regex_match: match
regex_search: no match
</pre>
Is my assumption that both should match wrong, or might there a problem with the library in GCC 4.7.1? | 0 |
11,628,048 | 07/24/2012 09:35:44 | 335,999 | 05/08/2010 05:09:37 | 50 | 4 | canvas poor performance in FF | So I'm having a webpage locally running html5 canvas. It runs smoothly in chrome and IE9 (60 fps in chrome, a bit slower in IE but still smooth) but performs poorly in FF (currently tested in 13.0.1 and 14.0.1 build). It turns out that I have to largely decrease the number of object rendered in FF in order to make it smooth. But no such problem exists in IE and chrome.
I'm using requestAnimFrame method from shim as follows
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element){
window.setTimeout(callback, 1000 / 60);
};
})();
My rendering code is
function animate() {
requestAnimFrame( animate );
// ...some code for object to appear in order during a certain time, but does not affect the performance...
for( var i = 0, len = eyes.length; i < len; i++ ) {
var eye = eyes[i];
eye.update( mouse ); // rendering
}
}
The code specification should accord with that in the link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ and have no problem in chrome and IE, but FF only.
Can anyone tell me how to improve this? Thanks
| javascript | html5 | firefox | canvas | requestanimationframe | null | open | canvas poor performance in FF
===
So I'm having a webpage locally running html5 canvas. It runs smoothly in chrome and IE9 (60 fps in chrome, a bit slower in IE but still smooth) but performs poorly in FF (currently tested in 13.0.1 and 14.0.1 build). It turns out that I have to largely decrease the number of object rendered in FF in order to make it smooth. But no such problem exists in IE and chrome.
I'm using requestAnimFrame method from shim as follows
window.requestAnimFrame = (function(){
return window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function(callback, element){
window.setTimeout(callback, 1000 / 60);
};
})();
My rendering code is
function animate() {
requestAnimFrame( animate );
// ...some code for object to appear in order during a certain time, but does not affect the performance...
for( var i = 0, len = eyes.length; i < len; i++ ) {
var eye = eyes[i];
eye.update( mouse ); // rendering
}
}
The code specification should accord with that in the link http://paulirish.com/2011/requestanimationframe-for-smart-animating/ and have no problem in chrome and IE, but FF only.
Can anyone tell me how to improve this? Thanks
| 0 |
11,541,747 | 07/18/2012 12:46:45 | 1,060,407 | 11/22/2011 18:23:47 | 638 | 50 | Select objects from has_many_and_belongs_to_many through 3 associations | Models definition:
class Article < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
has_and_belongs_to_many :articles
has_many :domains, :inverse_of=>:group
end
class Domain < ActiveRecord::Base
belongs_to :group, :inverse_of=>:domains
has_many :pages, :inverse_of=>:domain
end
class Page < ActiveRecord::Base
belongs_to :domain, :inverse_of=>:pages
belongs_to :article, :inverse_of=>:pages
end
For specific `Article` I want to select all `Domains` (associated through `groups.domains`) without any `Page` associated with that `Article`.
class Article < ActiveRecord::Base
has_and_belongs_to_many :groups
def avaiable_domains
groups.domains("where not exists page with article_id=#{id}")) ##????
end
end
Is it possible to write it in pure Active Record Query or Arel (without SQL in where method)? | mysql | ruby-on-rails | activerecord | null | null | null | open | Select objects from has_many_and_belongs_to_many through 3 associations
===
Models definition:
class Article < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class Group < ActiveRecord::Base
has_and_belongs_to_many :articles
has_many :domains, :inverse_of=>:group
end
class Domain < ActiveRecord::Base
belongs_to :group, :inverse_of=>:domains
has_many :pages, :inverse_of=>:domain
end
class Page < ActiveRecord::Base
belongs_to :domain, :inverse_of=>:pages
belongs_to :article, :inverse_of=>:pages
end
For specific `Article` I want to select all `Domains` (associated through `groups.domains`) without any `Page` associated with that `Article`.
class Article < ActiveRecord::Base
has_and_belongs_to_many :groups
def avaiable_domains
groups.domains("where not exists page with article_id=#{id}")) ##????
end
end
Is it possible to write it in pure Active Record Query or Arel (without SQL in where method)? | 0 |
11,541,754 | 07/18/2012 12:47:00 | 313,750 | 04/11/2010 02:47:34 | 98 | 4 | How to make jQuery 1.7 .on() hover? | I'm having a problem with dynamically created elements on hover state. When I hover on newly created html element, it doesn't work.
Here's my HTML code:
<button id="create">create new button</button>
<button class="hover">hover me</button>
<div></div>
jQuery:
var createBtn = $("#create");
createBtn.click(function() {
$('div').append('<button class="hover">new hover button</button');
return false;
});
$('.hover').hover(function() {
alert('you hovered the button!');
}, function() {
alert('you removed the hover from button!');
});
I even tried this code:
$('.hover').on({
mouseenter : function() {
alert('you hovered the button!');
},
mouseleave : function() {
alert('you removed the hover from button!');
}
});
as shown here http://api.jquery.com/on/, but still no luck.
Here's also demo: http://jsfiddle.net/BQ2FA/
| jquery | hover | null | null | null | null | open | How to make jQuery 1.7 .on() hover?
===
I'm having a problem with dynamically created elements on hover state. When I hover on newly created html element, it doesn't work.
Here's my HTML code:
<button id="create">create new button</button>
<button class="hover">hover me</button>
<div></div>
jQuery:
var createBtn = $("#create");
createBtn.click(function() {
$('div').append('<button class="hover">new hover button</button');
return false;
});
$('.hover').hover(function() {
alert('you hovered the button!');
}, function() {
alert('you removed the hover from button!');
});
I even tried this code:
$('.hover').on({
mouseenter : function() {
alert('you hovered the button!');
},
mouseleave : function() {
alert('you removed the hover from button!');
}
});
as shown here http://api.jquery.com/on/, but still no luck.
Here's also demo: http://jsfiddle.net/BQ2FA/
| 0 |
11,541,757 | 07/18/2012 12:47:18 | 1,534,700 | 07/18/2012 12:01:18 | 1 | 0 | fmin with a threshold function | I have some experimental data I would like to fit by fmin function. I have already used fmin with another sample and everything was ok.
This time I would to represent data by a function like :
def f3(c,t):
resultat=0
test=t-c[0]
if (test<0):
resultat = c[1]
else:
resultat = c[1]+c[2]*(t-c[0])+c[3]*(t-c[0])*(t-c[0])+c[4]*(t-c[0])*(t-c[0])*(t-c[0])
return resultat
t is a time vector and c[0] is a threshold (c[i] for the polynomial coefficients)
*(by the way the data can be represented by this function because I used it to generate the data example!)*
The function error is given by :
def e3(p,temps,y):
error = 0
i=0
for t in temps:
error = error + (f3(p,t)-y[i])**2
i=i+1
#cont = min(0,p[0])
#error = error +10000*(cont*cont)*(cont*cont*cont*cont)
return error
p3=[10,250,0,0,0] and T_out is a vector
The fitting operation is :
p3_min = fmin(e3,p3[:], args=(temps,T_out),xtol=0.0001,ftol=0.0001)
This instruction works very well for "classic" polynomial function but
for the f3 function (with a 'if' in it), p3_min is not as optimized as expected.
I tried to implement constraint like p[0]>0 or increase the number of iterations but I cannot manage to get the expected value.
Has anyone ever tried to fit data with a "threshold" function?
I would be grateful to get some help.
| python | scipy | data-fitting | null | null | null | open | fmin with a threshold function
===
I have some experimental data I would like to fit by fmin function. I have already used fmin with another sample and everything was ok.
This time I would to represent data by a function like :
def f3(c,t):
resultat=0
test=t-c[0]
if (test<0):
resultat = c[1]
else:
resultat = c[1]+c[2]*(t-c[0])+c[3]*(t-c[0])*(t-c[0])+c[4]*(t-c[0])*(t-c[0])*(t-c[0])
return resultat
t is a time vector and c[0] is a threshold (c[i] for the polynomial coefficients)
*(by the way the data can be represented by this function because I used it to generate the data example!)*
The function error is given by :
def e3(p,temps,y):
error = 0
i=0
for t in temps:
error = error + (f3(p,t)-y[i])**2
i=i+1
#cont = min(0,p[0])
#error = error +10000*(cont*cont)*(cont*cont*cont*cont)
return error
p3=[10,250,0,0,0] and T_out is a vector
The fitting operation is :
p3_min = fmin(e3,p3[:], args=(temps,T_out),xtol=0.0001,ftol=0.0001)
This instruction works very well for "classic" polynomial function but
for the f3 function (with a 'if' in it), p3_min is not as optimized as expected.
I tried to implement constraint like p[0]>0 or increase the number of iterations but I cannot manage to get the expected value.
Has anyone ever tried to fit data with a "threshold" function?
I would be grateful to get some help.
| 0 |
11,541,733 | 07/18/2012 12:46:16 | 777,833 | 05/31/2011 14:17:14 | 27 | 0 | Pthread timeout | All I waint to do is launch a thread and see if it has finished in a certain period of time.
OS: linux; language: C++.
I'd like not to use non portable functions (like suggested in [this answer][1]).
Is there any way to do that, other than using a mutex and a
condition variable (as suggested [here][2])? There is no shared data between the two threads, so technically I would not need a mutex.
All I want is, for the function that launches the thread, to continue if
- thread has finished or
- a certain time elapsed.
... and keep the code as simple as I can.
[1]: http://stackoverflow.com/a/1244687/777833
[2]: http://stackoverflow.com/a/5750851/777833 | c++ | linux | pthreads | null | null | null | open | Pthread timeout
===
All I waint to do is launch a thread and see if it has finished in a certain period of time.
OS: linux; language: C++.
I'd like not to use non portable functions (like suggested in [this answer][1]).
Is there any way to do that, other than using a mutex and a
condition variable (as suggested [here][2])? There is no shared data between the two threads, so technically I would not need a mutex.
All I want is, for the function that launches the thread, to continue if
- thread has finished or
- a certain time elapsed.
... and keep the code as simple as I can.
[1]: http://stackoverflow.com/a/1244687/777833
[2]: http://stackoverflow.com/a/5750851/777833 | 0 |
11,541,758 | 07/18/2012 12:47:26 | 1,534,800 | 07/18/2012 12:37:52 | 1 | 0 | How to get ActionDescriptor using action and controller names | Given the action name, controller name and HTTP verb (GET, POST .. etc), is it possible to check whether the action has (ie. is decorated by) a specific action filter attribute?
Please note: The action and controller are not the current action and controller but can be any action and controller in the app.
Thanks! | asp.net-mvc | asp.net-mvc-3 | null | null | null | null | open | How to get ActionDescriptor using action and controller names
===
Given the action name, controller name and HTTP verb (GET, POST .. etc), is it possible to check whether the action has (ie. is decorated by) a specific action filter attribute?
Please note: The action and controller are not the current action and controller but can be any action and controller in the app.
Thanks! | 0 |
11,541,759 | 07/18/2012 12:47:31 | 1,495,959 | 07/02/2012 11:42:00 | 1 | 0 | How to compile atl files using maven | i have an ATL projects and i need to compile it using maven.
Is it possible to compile with maven other files rather than java ?
Does anyone experienced before compiling atl files using maven ?
Thank you in advance
| maven | atl | null | null | null | null | open | How to compile atl files using maven
===
i have an ATL projects and i need to compile it using maven.
Is it possible to compile with maven other files rather than java ?
Does anyone experienced before compiling atl files using maven ?
Thank you in advance
| 0 |
11,541,760 | 07/18/2012 12:47:34 | 1,503,495 | 07/05/2012 09:19:26 | 28 | 0 | How to set an timer in textbox using jquery..? | I have a text box on a jsp page. I want when the page loades the value of textbox should show how much time been the page loaded. Or in simple words i want to setup a countup timer in a textbox which should start immediately and automatically when the page loads. And when the user click on submit button the user navigates to another jsp page shows that how much seconds he took to click the submit button (button was on previous page).
I am doing following HTML
<input type="text" id="timeleft" name="timeleft" />
In jquery Script i am doing the following :
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var start = new Date;
setInterval(function() {
$('timeleft').val((new Date - start) / 1000);
}, 1000); });
</script>
But the timer is not visible in textbox...? What is the error..? | jquery | jsp | null | null | null | null | open | How to set an timer in textbox using jquery..?
===
I have a text box on a jsp page. I want when the page loades the value of textbox should show how much time been the page loaded. Or in simple words i want to setup a countup timer in a textbox which should start immediately and automatically when the page loads. And when the user click on submit button the user navigates to another jsp page shows that how much seconds he took to click the submit button (button was on previous page).
I am doing following HTML
<input type="text" id="timeleft" name="timeleft" />
In jquery Script i am doing the following :
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var start = new Date;
setInterval(function() {
$('timeleft').val((new Date - start) / 1000);
}, 1000); });
</script>
But the timer is not visible in textbox...? What is the error..? | 0 |
11,541,762 | 07/18/2012 12:47:46 | 1,175,881 | 01/29/2012 00:15:14 | 89 | 3 | C# dynamicly add button and send event args with it | Hy,
The answer would be verry easy i think, but i can't find it...
I've got a listview programmed this way:
ListView board = new ListView();
board.Bounds = new Rectangle(new Point(0, 0), new Size(this.Width, this.Height));
board.View = View.Details;
board.LabelEdit = false;
board.AllowColumnReorder = false;
board.GridLines = true;
//textPieces 0 = Van 1 = Titel 2 = Ontvangen 3 = groote
board.Columns.Add(" Afzender ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Titel ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Ontvangen ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Groote ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Bekijken ", -10, HorizontalAlignment.Center);
for (int c = 0; c < new_message_counter; c++) {
ListViewItem item = new ListViewItem(berichten_verzameling[c, 0], 0);
item.SubItems.Add(berichten_verzameling[c, 1]);
item.SubItems.Add(berichten_verzameling[c, 2]);
item.SubItems.Add(berichten_verzameling[c, 3]);
Button dynamicbutton = new Button();
dynamicbutton.Text = "Bekijk dit bericht";
dynamicbutton.Name = "show_all_number_" + c;
item.SubItems.Add(dynamicbutton);
board.Items.Add(item);
}
groupBox1_all_message.Controls.Add(board);
As some of you probably already saw, is there an error... because this don't work: ( item.SubItems.Add(dynamicbutton);)
So my first question is how can i show the button on the same line of the other info.
And my seccond question is maybey more advanged. How can i make an eventhandler for al these button dynamicly, and send some arguments with it...
Like in html / javascript it was something like :
<button OnClick="DoStuff(5,true);">do it!</button>
But how would that be in C#???
Thanks in advantage
TWCrap | c# | listview | button | dynamic | event-handling | null | open | C# dynamicly add button and send event args with it
===
Hy,
The answer would be verry easy i think, but i can't find it...
I've got a listview programmed this way:
ListView board = new ListView();
board.Bounds = new Rectangle(new Point(0, 0), new Size(this.Width, this.Height));
board.View = View.Details;
board.LabelEdit = false;
board.AllowColumnReorder = false;
board.GridLines = true;
//textPieces 0 = Van 1 = Titel 2 = Ontvangen 3 = groote
board.Columns.Add(" Afzender ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Titel ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Ontvangen ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Groote ", -10, HorizontalAlignment.Center);
board.Columns.Add(" Bekijken ", -10, HorizontalAlignment.Center);
for (int c = 0; c < new_message_counter; c++) {
ListViewItem item = new ListViewItem(berichten_verzameling[c, 0], 0);
item.SubItems.Add(berichten_verzameling[c, 1]);
item.SubItems.Add(berichten_verzameling[c, 2]);
item.SubItems.Add(berichten_verzameling[c, 3]);
Button dynamicbutton = new Button();
dynamicbutton.Text = "Bekijk dit bericht";
dynamicbutton.Name = "show_all_number_" + c;
item.SubItems.Add(dynamicbutton);
board.Items.Add(item);
}
groupBox1_all_message.Controls.Add(board);
As some of you probably already saw, is there an error... because this don't work: ( item.SubItems.Add(dynamicbutton);)
So my first question is how can i show the button on the same line of the other info.
And my seccond question is maybey more advanged. How can i make an eventhandler for al these button dynamicly, and send some arguments with it...
Like in html / javascript it was something like :
<button OnClick="DoStuff(5,true);">do it!</button>
But how would that be in C#???
Thanks in advantage
TWCrap | 0 |
11,541,763 | 07/18/2012 12:47:52 | 1,432,054 | 06/02/2012 06:20:17 | 24 | 0 | Sorting Multi-dimension array based on key | I am trying to sort an array based on a particular key value in a multidimensional array as follows
<?php
$country = array(
array(
'country' => 'India',
'visits' => 22,
'newVisits' => 16,
'newVisitsPercent' => 72.7),
array(
'country' => 'USA',
'visits' => 30,
'newVisits' => 15,
'newVisitsPercent' => 50),
array(
'country' => 'Japan',
'visits' => 25,
'newVisits' => 15,
'newVisitsPercent' => 60));
?>
I wanna Sort the array in Descending order of the 'visits' key of the array.
Desired Array is
<?php
$country = array(
array(
'country' => 'USA',
'visits' => 30,
'newVisits' => 15,
'newVisitsPercent' => 50),
array(
'country' => 'Japan',
'visits' => 25,
'newVisits' => 15,
'newVisitsPercent' => 60),
array(
'country' => 'India',
'visits' => 22,
'newVisits' => 16,
'newVisitsPercent' => 72.7));
?>
Tried to search in SO all results were sorting based on the value of the key. Please let me know which function do we need to use.
I looked in to ksort, Multi-sort functions | php | arrays | sorting | null | null | null | open | Sorting Multi-dimension array based on key
===
I am trying to sort an array based on a particular key value in a multidimensional array as follows
<?php
$country = array(
array(
'country' => 'India',
'visits' => 22,
'newVisits' => 16,
'newVisitsPercent' => 72.7),
array(
'country' => 'USA',
'visits' => 30,
'newVisits' => 15,
'newVisitsPercent' => 50),
array(
'country' => 'Japan',
'visits' => 25,
'newVisits' => 15,
'newVisitsPercent' => 60));
?>
I wanna Sort the array in Descending order of the 'visits' key of the array.
Desired Array is
<?php
$country = array(
array(
'country' => 'USA',
'visits' => 30,
'newVisits' => 15,
'newVisitsPercent' => 50),
array(
'country' => 'Japan',
'visits' => 25,
'newVisits' => 15,
'newVisitsPercent' => 60),
array(
'country' => 'India',
'visits' => 22,
'newVisits' => 16,
'newVisitsPercent' => 72.7));
?>
Tried to search in SO all results were sorting based on the value of the key. Please let me know which function do we need to use.
I looked in to ksort, Multi-sort functions | 0 |
11,541,701 | 07/18/2012 12:44:38 | 1,534,453 | 07/18/2012 10:29:32 | 1 | 0 | Facebook Authorized/base_facebook.php | I have big problem with post/feed but i dont know where is problem. Meybe somthing is wrong with premissions ? But when I install this app dialog window say that the applications have premissions to add POST/FEED on my wall.
<?php
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => 'myappid',
'secret' => 'mysecretkey',
));
// See if there is a user from a cookie
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
$logoutUrl = $facebook->getLogoutUrl();
echo 'aaa';
} catch (FacebookApiException $e) {
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
$user = null;
}
try {
echo 'done';
$facebook->api("/me/feed", "post", array(
message => "POST TEST",
picture => "http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png",
link => "www.gmail.com",
name => "gmail",
caption => "gmail"
));
} catch (FacebookApiException $e) {
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
}
}else
{
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => 'email,read_mailbox,publish_stream,user_birthday,user_location,read_stream,user_work_history,user_about_me,user_hometown'
)
);
}
?>
Catch exception in post/feed selection catch this error:
FacebookApiException Object
(
[result:protected] => Array
(
[error] => Array
(
[message] => (#200) The user hasn't authorized the application to perform this action
[type] => OAuthException
[code] => 200
)
)
[message:protected] => (#200) The user hasn't authorized the application to perform this action
[string:private] =>
[code:protected] => 0
[file:protected] => /home/base_facebook.php
[line:protected] => 1106
[trace:private] => Array
(
[0] => Array
(
[file] => /home/base_facebook.php
[line] => 810
[function] => throwAPIException
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => Array
(
[error] => Array
(
[message] => (#200) The user hasn't authorized the application to perform this action
[type] => OAuthException
[code] => 200
)
)
)
)
[1] => Array
(
[function] => _graph
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => /me/feed
[1] => post
[2] => Array
(
[message] => POST TEST
[picture] => http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png
[link] => www.gmail.com
[name] => gmail
[caption] => gmail
)
)
)
[2] => Array
(
[file] => /home/base_facebook.php
[line] => 587
[function] => call_user_func_array
[args] => Array
(
[0] => Array
(
[0] => Facebook Object
(
[appId:protected] => 345291315545354
[appSecret:protected] => b8a9178e480fa834d2761f0f2ea9f167
[user:protected] => 100002049484921
[signedRequest:protected] => Array
(
[algorithm] => HMAC-SHA256
[expires] => 1342620000
[issued_at] => 1342614646
[oauth_token] => AAAE6CmY1BQoBAJZArgdb5SFNfHiM4dpSZCMVrLBI66u75eDNFByAcZCYQQN4LdfhQweQvBb67AF74a0sswek4BemnxskkBntQiC0OUMM2htrxQznjyb
[user] => Array
(
[country] => pl
[locale] => pl_PL
[age] => Array
(
[min] => 18
[max] => 20
)
)
[user_id] => 100002049484921
)
[state:protected] => 38b8b7b9c24c06b9474699db9cfc0fe5
[accessToken:protected] => AAAE6CmY1BQoBAJZArgdb5SFNfHiM4dpSZCMVrLBI66u75eDNFByAcZCYQQN4LdfhQweQvBb67AF74a0sswek4BemnxskkBntQiC0OUMM2htrxQznjyb
[fileUploadSupport:protected] =>
)
[1] => _graph
)
[1] => Array
(
[0] => /me/feed
[1] => post
[2] => Array
(
[message] => POST TEST
[picture] => http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png
[link] => www.gmail.com
[name] => gmail
[caption] => gmail
)
)
)
)
[3] => Array
(
[file] => /home/index.php
[line] => 35
[function] => api
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => /me/feed
[1] => post
[2] => Array
(
[message] => POST TEST
[picture] => http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png
[link] => www.gmail.com
[name] => gmail
[caption] => gmail
)
)
)
)
)
Evrything work but i have only problem with this post section. Meybe someone see a somthing wrong in my code.
| php | facebook | facebook-graph-api | sdk | null | null | open | Facebook Authorized/base_facebook.php
===
I have big problem with post/feed but i dont know where is problem. Meybe somthing is wrong with premissions ? But when I install this app dialog window say that the applications have premissions to add POST/FEED on my wall.
<?php
require 'facebook.php';
$facebook = new Facebook(array(
'appId' => 'myappid',
'secret' => 'mysecretkey',
));
// See if there is a user from a cookie
$user = $facebook->getUser();
if ($user) {
try {
$user_profile = $facebook->api('/me');
$logoutUrl = $facebook->getLogoutUrl();
echo 'aaa';
} catch (FacebookApiException $e) {
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
$user = null;
}
try {
echo 'done';
$facebook->api("/me/feed", "post", array(
message => "POST TEST",
picture => "http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png",
link => "www.gmail.com",
name => "gmail",
caption => "gmail"
));
} catch (FacebookApiException $e) {
echo '<pre>'.htmlspecialchars(print_r($e, true)).'</pre>';
}
}else
{
$loginUrl = $facebook->getLoginUrl(
array(
'scope' => 'email,read_mailbox,publish_stream,user_birthday,user_location,read_stream,user_work_history,user_about_me,user_hometown'
)
);
}
?>
Catch exception in post/feed selection catch this error:
FacebookApiException Object
(
[result:protected] => Array
(
[error] => Array
(
[message] => (#200) The user hasn't authorized the application to perform this action
[type] => OAuthException
[code] => 200
)
)
[message:protected] => (#200) The user hasn't authorized the application to perform this action
[string:private] =>
[code:protected] => 0
[file:protected] => /home/base_facebook.php
[line:protected] => 1106
[trace:private] => Array
(
[0] => Array
(
[file] => /home/base_facebook.php
[line] => 810
[function] => throwAPIException
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => Array
(
[error] => Array
(
[message] => (#200) The user hasn't authorized the application to perform this action
[type] => OAuthException
[code] => 200
)
)
)
)
[1] => Array
(
[function] => _graph
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => /me/feed
[1] => post
[2] => Array
(
[message] => POST TEST
[picture] => http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png
[link] => www.gmail.com
[name] => gmail
[caption] => gmail
)
)
)
[2] => Array
(
[file] => /home/base_facebook.php
[line] => 587
[function] => call_user_func_array
[args] => Array
(
[0] => Array
(
[0] => Facebook Object
(
[appId:protected] => 345291315545354
[appSecret:protected] => b8a9178e480fa834d2761f0f2ea9f167
[user:protected] => 100002049484921
[signedRequest:protected] => Array
(
[algorithm] => HMAC-SHA256
[expires] => 1342620000
[issued_at] => 1342614646
[oauth_token] => AAAE6CmY1BQoBAJZArgdb5SFNfHiM4dpSZCMVrLBI66u75eDNFByAcZCYQQN4LdfhQweQvBb67AF74a0sswek4BemnxskkBntQiC0OUMM2htrxQznjyb
[user] => Array
(
[country] => pl
[locale] => pl_PL
[age] => Array
(
[min] => 18
[max] => 20
)
)
[user_id] => 100002049484921
)
[state:protected] => 38b8b7b9c24c06b9474699db9cfc0fe5
[accessToken:protected] => AAAE6CmY1BQoBAJZArgdb5SFNfHiM4dpSZCMVrLBI66u75eDNFByAcZCYQQN4LdfhQweQvBb67AF74a0sswek4BemnxskkBntQiC0OUMM2htrxQznjyb
[fileUploadSupport:protected] =>
)
[1] => _graph
)
[1] => Array
(
[0] => /me/feed
[1] => post
[2] => Array
(
[message] => POST TEST
[picture] => http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png
[link] => www.gmail.com
[name] => gmail
[caption] => gmail
)
)
)
)
[3] => Array
(
[file] => /home/index.php
[line] => 35
[function] => api
[class] => BaseFacebook
[type] => ->
[args] => Array
(
[0] => /me/feed
[1] => post
[2] => Array
(
[message] => POST TEST
[picture] => http://psdhunter.com/psds/742-thumb-mail-amp-safari-icons.png
[link] => www.gmail.com
[name] => gmail
[caption] => gmail
)
)
)
)
)
Evrything work but i have only problem with this post section. Meybe someone see a somthing wrong in my code.
| 0 |
11,541,704 | 07/18/2012 12:44:54 | 1,449,316 | 06/11/2012 15:28:10 | 77 | 11 | Memory Usage Really high in ARC | In my app I have noticed that it goes very slow when switching between tabs. Further investigation showed that in my memory usage test my app was over 70mb in 5 minutes of testing. My native email app was only using 40mb. This cannot happen
I am using ARC and what I thought was that if I use something like
@property(nonatomic, strong)NSString *string;
ARC will dealloc this automatically. It doesn't seem to be doing that at all.
What I would like to know is if I can reduce my memory by using `dealloc` in my code (when I switched to ARC it deleted all my `dealloc` methods) or if there is another way to speed up my app.
To give you more information on what the app does here is a list of key points:
-Gets mail messages from webservice along with pdfs
-Stores arrays to check if messages have been read, deleted, or unread
-Mail tab checks for new messages from the webservice everytime someone clicks on the tab
-Same check for pdf files
Any information will help me a lot.
Thanks | iphone | memory | automatic-ref-counting | null | null | null | open | Memory Usage Really high in ARC
===
In my app I have noticed that it goes very slow when switching between tabs. Further investigation showed that in my memory usage test my app was over 70mb in 5 minutes of testing. My native email app was only using 40mb. This cannot happen
I am using ARC and what I thought was that if I use something like
@property(nonatomic, strong)NSString *string;
ARC will dealloc this automatically. It doesn't seem to be doing that at all.
What I would like to know is if I can reduce my memory by using `dealloc` in my code (when I switched to ARC it deleted all my `dealloc` methods) or if there is another way to speed up my app.
To give you more information on what the app does here is a list of key points:
-Gets mail messages from webservice along with pdfs
-Stores arrays to check if messages have been read, deleted, or unread
-Mail tab checks for new messages from the webservice everytime someone clicks on the tab
-Same check for pdf files
Any information will help me a lot.
Thanks | 0 |
11,387,224 | 07/08/2012 22:26:05 | 1,510,633 | 07/08/2012 22:09:44 | 1 | 0 | How to gray out menu item in Android ICS (Setting -> Security -> Screen Lock)? | I am developing an application for ICS with a Device Administrator. I need to gray out the menu selection “Screen Lock” under Setting -> Security, and if not possible to gray out the Face Unlock, Pattern, Pin and Password under Setting -> Security -> Screen Lock.
I am out after the program code that doing it, either Java or XML.
Thanks in advance
Joel
| android | locking | screen | device | administrator | null | open | How to gray out menu item in Android ICS (Setting -> Security -> Screen Lock)?
===
I am developing an application for ICS with a Device Administrator. I need to gray out the menu selection “Screen Lock” under Setting -> Security, and if not possible to gray out the Face Unlock, Pattern, Pin and Password under Setting -> Security -> Screen Lock.
I am out after the program code that doing it, either Java or XML.
Thanks in advance
Joel
| 0 |
11,387,237 | 07/08/2012 22:28:56 | 888,617 | 08/10/2011 19:20:22 | 736 | 30 | Design pattern in WPF | I am making my first WPF application, so this question may seem rather odd. I have been reading about MVVM and so far it has made sense to me. What I don't understand, though, is separating all the XAML.
What I mean is this: I assume you don't place everything in the MainWindow.xaml and just collapse controls based upon what is going to be used. I would think you would want a container that would contain xaml of other files. Is this correct?
How do you go about separating the XAML out so that it isn't just a mash of everything in one file? | c# | .net | wpf | mvvm | null | null | open | Design pattern in WPF
===
I am making my first WPF application, so this question may seem rather odd. I have been reading about MVVM and so far it has made sense to me. What I don't understand, though, is separating all the XAML.
What I mean is this: I assume you don't place everything in the MainWindow.xaml and just collapse controls based upon what is going to be used. I would think you would want a container that would contain xaml of other files. Is this correct?
How do you go about separating the XAML out so that it isn't just a mash of everything in one file? | 0 |
11,387,238 | 07/08/2012 22:29:30 | 337,806 | 05/11/2010 00:45:33 | 1,311 | 26 | Flash Builder: Change stage background color with AS3 | I'm not talking about a meta/binding, such as:
[SWF(backgroundColor="0xec9900")]
I need to be able to change the color on the fly. | actionscript-3 | flex4 | flash-builder | null | null | null | open | Flash Builder: Change stage background color with AS3
===
I'm not talking about a meta/binding, such as:
[SWF(backgroundColor="0xec9900")]
I need to be able to change the color on the fly. | 0 |
11,387,242 | 07/08/2012 22:30:13 | 1,454,158 | 06/13/2012 15:57:04 | 76 | 2 | ActiveRecord. Include data from join table | (Ruby/Rails guru's preferably :P)
I've got a bit of an interesting question. Hope it's not already answered (wait, yes I do!) but I've looked and couldn't find it. (Hopefully not because it's not possible)
I've got two classes (and I'd like to keep it that way) Group and Event (see below).
class Group < ActiveRecord::Base
has_and_belongs_to_many :events
end
However in my join table (group_events), I have additional columns which provide extenuating circumstances to the event... I want this information to be available on the event object. (For example, whether attendance is mandatory or not etc)
My second slightly related question is, can I not do the following:
class Event < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class GroupEvent < Event
# Implies that a GroupEvent would be an Event, with all the other attributes of the group_events table minus the
# two id's (group_id, event_id) that allowed for its existence (those would just be references to the group and event object)
end | mysql | ruby-on-rails | ruby | activerecord | null | null | open | ActiveRecord. Include data from join table
===
(Ruby/Rails guru's preferably :P)
I've got a bit of an interesting question. Hope it's not already answered (wait, yes I do!) but I've looked and couldn't find it. (Hopefully not because it's not possible)
I've got two classes (and I'd like to keep it that way) Group and Event (see below).
class Group < ActiveRecord::Base
has_and_belongs_to_many :events
end
However in my join table (group_events), I have additional columns which provide extenuating circumstances to the event... I want this information to be available on the event object. (For example, whether attendance is mandatory or not etc)
My second slightly related question is, can I not do the following:
class Event < ActiveRecord::Base
has_and_belongs_to_many :groups
end
class GroupEvent < Event
# Implies that a GroupEvent would be an Event, with all the other attributes of the group_events table minus the
# two id's (group_id, event_id) that allowed for its existence (those would just be references to the group and event object)
end | 0 |
11,387,244 | 07/08/2012 22:30:23 | 1,510,639 | 07/08/2012 22:18:38 | 1 | 0 | load external content after phonegap is loaded | I have an application that loads an external content (a xml) when you start, the problem is that phonegap don't show the application until the content is completly loaded, taking too time to start. I want to show the progress and then show my listbox with the content loaded.
Can i do that?
thanks
here is my code
var onDeviceReady = function() {
$.mobile.loadingMessageTextVisible = true;
$.mobile.showPageLoadingMsg("b", "Cargando fuentes");
var News = $( "#newsreader" ).find( ".News" );
News.empty();
$.getFeed({
url: 'url',
dataType: "xml",
success: function(feed) {
for(var i = 0; i < feed.items.length; i++) {
var item = feed.items[i];
html = '<li data-theme="c">'
+ '<a href="#article?id='
+ i
+ '">'
+ item.title
+ '</a>'
+ '</li>';
$( News ).append(html);
}
News.listview( "refresh" );
}});};
$(function() {
document.addEventListener("deviceready", onDeviceReady, true);});
| jquery | mobile | phonegap | null | null | null | open | load external content after phonegap is loaded
===
I have an application that loads an external content (a xml) when you start, the problem is that phonegap don't show the application until the content is completly loaded, taking too time to start. I want to show the progress and then show my listbox with the content loaded.
Can i do that?
thanks
here is my code
var onDeviceReady = function() {
$.mobile.loadingMessageTextVisible = true;
$.mobile.showPageLoadingMsg("b", "Cargando fuentes");
var News = $( "#newsreader" ).find( ".News" );
News.empty();
$.getFeed({
url: 'url',
dataType: "xml",
success: function(feed) {
for(var i = 0; i < feed.items.length; i++) {
var item = feed.items[i];
html = '<li data-theme="c">'
+ '<a href="#article?id='
+ i
+ '">'
+ item.title
+ '</a>'
+ '</li>';
$( News ).append(html);
}
News.listview( "refresh" );
}});};
$(function() {
document.addEventListener("deviceready", onDeviceReady, true);});
| 0 |
11,387,250 | 07/08/2012 22:31:34 | 1,472,219 | 06/21/2012 13:18:07 | 10 | 0 | How do you set axis properties in a .net chart? | My chart looks all jacked up. For one, there are too many labels along the x axis. For two, it is getting x axis info as a DateTime object. In this case, I would like to have the time of day shown.
So how can I make there be less labels and have the content of the labels be a time instead of a date?
http://i1120.photobucket.com/albums/l493/powerfulcrunch/chart.png
private void drawMinuteGraph(string data)
{
Chart chart = new Chart();
Series series = new Series("default");
series.ChartType = SeriesChartType.Line;
chart.Series.Add(series);
ChartArea chartArea = new ChartArea();
chart.ChartAreas.Add(chartArea);
Axis x = new Axis(chartArea, AxisName.X);
x.LineWidth = 90;
Axis y = new Axis(chartArea, AxisName.Y);
Data[] _data = data.getHistory("History", data);
List<DateTime> dates = new List<DateTime>();
List<double> values = new List<double>();
foreach (Data __data in _data)
{
dates.Add(__data.timestamp);
values.Add(__data.value);
}
chart.Height = 150;
chart.Width = 150;
chart.Series["default"].Points.DataBindXY(dates, values);
flowLayoutPanel.Controls.Add(chart);
} | c# | null | null | null | null | null | open | How do you set axis properties in a .net chart?
===
My chart looks all jacked up. For one, there are too many labels along the x axis. For two, it is getting x axis info as a DateTime object. In this case, I would like to have the time of day shown.
So how can I make there be less labels and have the content of the labels be a time instead of a date?
http://i1120.photobucket.com/albums/l493/powerfulcrunch/chart.png
private void drawMinuteGraph(string data)
{
Chart chart = new Chart();
Series series = new Series("default");
series.ChartType = SeriesChartType.Line;
chart.Series.Add(series);
ChartArea chartArea = new ChartArea();
chart.ChartAreas.Add(chartArea);
Axis x = new Axis(chartArea, AxisName.X);
x.LineWidth = 90;
Axis y = new Axis(chartArea, AxisName.Y);
Data[] _data = data.getHistory("History", data);
List<DateTime> dates = new List<DateTime>();
List<double> values = new List<double>();
foreach (Data __data in _data)
{
dates.Add(__data.timestamp);
values.Add(__data.value);
}
chart.Height = 150;
chart.Width = 150;
chart.Series["default"].Points.DataBindXY(dates, values);
flowLayoutPanel.Controls.Add(chart);
} | 0 |
11,387,251 | 07/08/2012 22:31:42 | 1,073,400 | 11/30/2011 13:08:20 | 115 | 0 | Why does this code crash with Bad-Access Error ? Am I not getting proper Core Motion access? (iOS) | *Reminder : this is my first attempt at Xcode / Objective-C* :-)
Hello,
I'm trying to test whether the following calculation :
double degrees = asin(deviceMotion.magneticField.field.y / sqrt(pow(deviceMotion.magneticField.field.x, 2.0) + pow(deviceMotion.magneticField.field.y, 2.0))) * 180.0 / M_PI)
*where x & y are the values of the magnetic field's x & y axis, returned by the magneticField property, (in microTeslas)..*
can successfully convert those values into degrees
for that reason I've written the following bit of code :
#import "MyGameViewController.h"
#import "TestDegrees.h"
@interface MyGameViewController()
{
TestDegrees *test;
}
@end
@implementation MyGameViewController
-(void) viewDidLoad
{
test = [[TestDegrees alloc] init];
}
- (IBAction)playPressed:(UIButton *)sender
{
[test play] ;
}
**TestDegrees.h**
#import <Foundation/Foundation.h>
#import "CoreMotion.h"
@interface TestDegrees : NSObject
-(void) play;
@end
**TestDegrees.m**
#import "TestDegrees.h"
#import "CoreMotion.h"
@interface TestDegrees
@end
@implementation TestDegrees
-(void) play
{
CMDeviceMotion *deviceMotion;
deviceMotion = [[CMDeviceMotion alloc] init];
int counter = 0;
while(counter != 1000)
{
NSLog(@"Degrees : %F",asin(deviceMotion.magneticField.field.y / sqrt(pow(deviceMotion.magneticField.field.x, 2.0) + pow(deviceMotion.magneticField.field.y, 2.0))) * 180.0 / M_PI);
counter++;
}
}
@end
well all of the above compiles with no errors but when it runs, as soon as it gets to NSLog I get a `Thread1: BAD_ACCESS...` thingy
What am I doing wrong?
Am I not establishing proper magnetometer access? | objective-c | ios | xcode | magnetometer | null | null | open | Why does this code crash with Bad-Access Error ? Am I not getting proper Core Motion access? (iOS)
===
*Reminder : this is my first attempt at Xcode / Objective-C* :-)
Hello,
I'm trying to test whether the following calculation :
double degrees = asin(deviceMotion.magneticField.field.y / sqrt(pow(deviceMotion.magneticField.field.x, 2.0) + pow(deviceMotion.magneticField.field.y, 2.0))) * 180.0 / M_PI)
*where x & y are the values of the magnetic field's x & y axis, returned by the magneticField property, (in microTeslas)..*
can successfully convert those values into degrees
for that reason I've written the following bit of code :
#import "MyGameViewController.h"
#import "TestDegrees.h"
@interface MyGameViewController()
{
TestDegrees *test;
}
@end
@implementation MyGameViewController
-(void) viewDidLoad
{
test = [[TestDegrees alloc] init];
}
- (IBAction)playPressed:(UIButton *)sender
{
[test play] ;
}
**TestDegrees.h**
#import <Foundation/Foundation.h>
#import "CoreMotion.h"
@interface TestDegrees : NSObject
-(void) play;
@end
**TestDegrees.m**
#import "TestDegrees.h"
#import "CoreMotion.h"
@interface TestDegrees
@end
@implementation TestDegrees
-(void) play
{
CMDeviceMotion *deviceMotion;
deviceMotion = [[CMDeviceMotion alloc] init];
int counter = 0;
while(counter != 1000)
{
NSLog(@"Degrees : %F",asin(deviceMotion.magneticField.field.y / sqrt(pow(deviceMotion.magneticField.field.x, 2.0) + pow(deviceMotion.magneticField.field.y, 2.0))) * 180.0 / M_PI);
counter++;
}
}
@end
well all of the above compiles with no errors but when it runs, as soon as it gets to NSLog I get a `Thread1: BAD_ACCESS...` thingy
What am I doing wrong?
Am I not establishing proper magnetometer access? | 0 |
11,499,750 | 07/16/2012 07:21:23 | 227,884 | 12/09/2009 10:46:20 | 5,242 | 254 | Java Multithreading: Behaviour when Reference count of thread object becomes zero | *[Before I begin I tried searching related questions, since I found none, I ask a question here]*
I am learning Java, and the following scenario hit my head:
class MyThread extends Thread {
void run(){
//a heavy function
}
}
And now in the main thread, I invoke this thread as:
public static void main(...){
new MyThread().start();
System.gc(); //just a request..
//end of main thread too.
//Reference to that MyThread object is now zero.
}
I ran that code. It seems the thread is still alive. The program ends when **all** the threads quit.
My questions:
- When the reference count is zero, wont the thread be eligible for GC? If it is really eligible, what is the behaviour of garbage collection? Will the thread be terminated?
- I know its a bad thing to do but is it well defined to not have `otherThread.join()` in `main()`?
I have a few explanation of myself (but I do not know how right I am -- the reason I made a post here):
- JVM maitains a reference to the thread as long as it is **active**. So ref count is never really zero.
- The executing function has an implicit `this` reference, so the ref count is again not zero.
Am I correct in any of the explanations above? Or is there any other explanation altogether?
Thanks and regards :) | java | multithreading | garbage-collection | reference-counting | null | null | open | Java Multithreading: Behaviour when Reference count of thread object becomes zero
===
*[Before I begin I tried searching related questions, since I found none, I ask a question here]*
I am learning Java, and the following scenario hit my head:
class MyThread extends Thread {
void run(){
//a heavy function
}
}
And now in the main thread, I invoke this thread as:
public static void main(...){
new MyThread().start();
System.gc(); //just a request..
//end of main thread too.
//Reference to that MyThread object is now zero.
}
I ran that code. It seems the thread is still alive. The program ends when **all** the threads quit.
My questions:
- When the reference count is zero, wont the thread be eligible for GC? If it is really eligible, what is the behaviour of garbage collection? Will the thread be terminated?
- I know its a bad thing to do but is it well defined to not have `otherThread.join()` in `main()`?
I have a few explanation of myself (but I do not know how right I am -- the reason I made a post here):
- JVM maitains a reference to the thread as long as it is **active**. So ref count is never really zero.
- The executing function has an implicit `this` reference, so the ref count is again not zero.
Am I correct in any of the explanations above? Or is there any other explanation altogether?
Thanks and regards :) | 0 |
11,499,787 | 07/16/2012 07:24:26 | 1,463,252 | 06/18/2012 09:29:46 | 344 | 29 | Installing a Windows Service -Setup.exe fails | There is a weird issue I am facing. I created my first windows service looking through various blogs and tutorials.
Then created setup for that adding installer etc. It works fine while installing , un-installing via Visual Studio but it fails when i deploy it .
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\bhuvint\Documents\Visual Studio 2010\Projects\CPNS Library\ServicePackage\CommonPushNotificationWindowsService.application resulted in exception. Following failure messages were detected:
+ You cannot start application CommonPushNotificationWindowsService from this location because it is already installed from a different location.
+ You cannot start application CommonPushNotificationWindowsService from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application it is already installed from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application. You can start it from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application or you can uninstall it and reinstall it from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application.
I have already un-installed the service and trying to install it from the deployed service in the same pc to test. But it fails with above error. Please help asap. | c# | asp.net | null | null | null | null | open | Installing a Windows Service -Setup.exe fails
===
There is a weird issue I am facing. I created my first windows service looking through various blogs and tutorials.
Then created setup for that adding installer etc. It works fine while installing , un-installing via Visual Studio but it fails when i deploy it .
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of C:\Users\bhuvint\Documents\Visual Studio 2010\Projects\CPNS Library\ServicePackage\CommonPushNotificationWindowsService.application resulted in exception. Following failure messages were detected:
+ You cannot start application CommonPushNotificationWindowsService from this location because it is already installed from a different location.
+ You cannot start application CommonPushNotificationWindowsService from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application it is already installed from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application. You can start it from location file:///C:/inetpub/wwwroot/ServicePackage/CommonPushNotificationWindowsService.application or you can uninstall it and reinstall it from location file:///C:/Users/bhuvint/Documents/Visual%20Studio%202010/Projects/CPNS%20Library/ServicePackage/CommonPushNotificationWindowsService.application.
I have already un-installed the service and trying to install it from the deployed service in the same pc to test. But it fails with above error. Please help asap. | 0 |
11,499,789 | 07/16/2012 07:24:29 | 1,528,148 | 07/16/2012 07:17:06 | 1 | 0 | How to upload an excel file to iPad | The app I am developing involves using a contact list, does anyone know how I can have the users upload their spreadsheets into their iPad (without using Dropbox API or a cord)?
Thanks in advance! | ipad | null | null | null | null | null | open | How to upload an excel file to iPad
===
The app I am developing involves using a contact list, does anyone know how I can have the users upload their spreadsheets into their iPad (without using Dropbox API or a cord)?
Thanks in advance! | 0 |
11,499,790 | 07/16/2012 07:24:36 | 1,384,362 | 05/09/2012 10:45:19 | 8 | 4 | WSO2 Carbon studio 1.0.14 does not support enrich fromregistry key | I made a sequence in the wso2 esb portal using an envolepe enrich mediator which source was a key from registry. When I moved this code to the eclipse carbon studio 1.0.14 it failed and the enrich mediator instruction got empty.
Is not it supported in this version? Is there a walkaround for this? | wso2 | wso2esb | null | null | null | null | open | WSO2 Carbon studio 1.0.14 does not support enrich fromregistry key
===
I made a sequence in the wso2 esb portal using an envolepe enrich mediator which source was a key from registry. When I moved this code to the eclipse carbon studio 1.0.14 it failed and the enrich mediator instruction got empty.
Is not it supported in this version? Is there a walkaround for this? | 0 |
11,499,791 | 07/16/2012 07:24:37 | 649,605 | 03/08/2011 10:11:59 | 433 | 21 | nested SQL Statements with Propel? | I'm trying to translate a SQL Statement into Propel, without so much success. I have this SQL Statement:
SELECT id, param1, param2
FROM Field1
WHERE id
in
(
SELECT DISTINCT Field1_id
FROM Field2
WHERE id in
(
SELECT DISTINCT `Field2_id`
FROM `Field3`
WHERE
`param7` is null
AND param5 > 40
)
) LIMIT 0, 1000
i started doing it in a raw Way:
$connection = Propel::getConnection();
$query = "my Query";
$statement = $connection->prepare($query);
$statement->execute();
$results = $statement->fetch(PDO::FETCH_ASSOC);
This works pretty well, but i can't do any Propel Actions on $results cause it is an Array.
So how can i translate this SQL into Propel without the raw Way? | sql | symfony | symfony-1.4 | propel | null | null | open | nested SQL Statements with Propel?
===
I'm trying to translate a SQL Statement into Propel, without so much success. I have this SQL Statement:
SELECT id, param1, param2
FROM Field1
WHERE id
in
(
SELECT DISTINCT Field1_id
FROM Field2
WHERE id in
(
SELECT DISTINCT `Field2_id`
FROM `Field3`
WHERE
`param7` is null
AND param5 > 40
)
) LIMIT 0, 1000
i started doing it in a raw Way:
$connection = Propel::getConnection();
$query = "my Query";
$statement = $connection->prepare($query);
$statement->execute();
$results = $statement->fetch(PDO::FETCH_ASSOC);
This works pretty well, but i can't do any Propel Actions on $results cause it is an Array.
So how can i translate this SQL into Propel without the raw Way? | 0 |
11,499,792 | 07/16/2012 07:24:37 | 1,411,803 | 05/23/2012 05:59:46 | 1 | 1 | I'm having the different names for different provider how to identify it as a common name in C# | I will explain here this is the xml i'm having and you see the Betting Offer that is
Home Draw Away and the Outcome like X,1,2 for one of my provider
<BettingOffer typeId="43" scopeId="2" type="Home Draw Away">
<Odds id="11940061906901" outcome="X">3.20</Odds>
<Odds id="11940061706901" outcome="1">2.14</Odds>
<Odds id="11940061806901" outcome="2">3.00</Odds>
</BettingOffer>
Another Provider supply XMl like this for same betting offer:
<Event Name="Arsenal v Sunderland" ID="40103450" StartTime="18/08/12 15:00:00">
<Market Name="Full Time Result" ID="40" PlaceCount="1" PlaceOdds="1/1">
<Participant Name="Home Win" Odds="1/3" OddsDecimal="1.33" ID="290245295"/>
<Participant Name="Draw" Odds="4/1" OddsDecimal="5.00" ID="290245296" />
<Participant Name="Away Win" Odds="8/1" OddsDecimal="9.00" ID="290245297"/>
</Market>
</Event>
Another Provider supply XMl like:
<Event racetype="" tracktype="" handicap=" " class="0">
<Description>Sibir Novosibirsk v Rotor Volgograd</Description>
<Market mkt_typ="Win/Draw/Win" lp_avail="Y" sp_avail="N" mkt_id="9255156">
<Occurrence bet_id="52761388" lp_num="8" lp_den="15" decimal="1.5333333333333" >
<Description>Sibir Novosibirsk</Description>
</Occurrence>
<Occurrence bet_id="52761389" lp_num="13" lp_den="5" decimal="3.6" >
<Description>Draw</Description>
</Occurrence>
<Occurrence bet_id="52761390" lp_num="9" lp_den="2" decimal="5.5" >
<Description>Rotor Volgograd</Description>
</Occurrence>
</Market>
</Event>
Now you can visibly see that different provider supply different name for the
Betting offer(ie Market ) and the outcome varies too for the provider. outcome like Rotor
Volgograd,Sibir Novosibirsk, 1, X, 2,Home,draw,Away it is common to find that for player
too. That's what i had explained earlier so someone please help me regarding this issue. | c# | asp.net | null | null | null | null | open | I'm having the different names for different provider how to identify it as a common name in C#
===
I will explain here this is the xml i'm having and you see the Betting Offer that is
Home Draw Away and the Outcome like X,1,2 for one of my provider
<BettingOffer typeId="43" scopeId="2" type="Home Draw Away">
<Odds id="11940061906901" outcome="X">3.20</Odds>
<Odds id="11940061706901" outcome="1">2.14</Odds>
<Odds id="11940061806901" outcome="2">3.00</Odds>
</BettingOffer>
Another Provider supply XMl like this for same betting offer:
<Event Name="Arsenal v Sunderland" ID="40103450" StartTime="18/08/12 15:00:00">
<Market Name="Full Time Result" ID="40" PlaceCount="1" PlaceOdds="1/1">
<Participant Name="Home Win" Odds="1/3" OddsDecimal="1.33" ID="290245295"/>
<Participant Name="Draw" Odds="4/1" OddsDecimal="5.00" ID="290245296" />
<Participant Name="Away Win" Odds="8/1" OddsDecimal="9.00" ID="290245297"/>
</Market>
</Event>
Another Provider supply XMl like:
<Event racetype="" tracktype="" handicap=" " class="0">
<Description>Sibir Novosibirsk v Rotor Volgograd</Description>
<Market mkt_typ="Win/Draw/Win" lp_avail="Y" sp_avail="N" mkt_id="9255156">
<Occurrence bet_id="52761388" lp_num="8" lp_den="15" decimal="1.5333333333333" >
<Description>Sibir Novosibirsk</Description>
</Occurrence>
<Occurrence bet_id="52761389" lp_num="13" lp_den="5" decimal="3.6" >
<Description>Draw</Description>
</Occurrence>
<Occurrence bet_id="52761390" lp_num="9" lp_den="2" decimal="5.5" >
<Description>Rotor Volgograd</Description>
</Occurrence>
</Market>
</Event>
Now you can visibly see that different provider supply different name for the
Betting offer(ie Market ) and the outcome varies too for the provider. outcome like Rotor
Volgograd,Sibir Novosibirsk, 1, X, 2,Home,draw,Away it is common to find that for player
too. That's what i had explained earlier so someone please help me regarding this issue. | 0 |
11,499,793 | 07/16/2012 07:24:40 | 1,401,284 | 05/17/2012 14:56:41 | 145 | 0 | Reading from authentication cookie | I'm trying to read the username from auth ticket ( wich is `TESTTEST` )
-----LOGIN PAGE------
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
"TESTTEST",
DateTime.Now,
DateTime.Now.AddMinutes(30),
false,
String.Empty,
FormsAuthentication.FormsCookiePath);
string encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie authCookie = new HttpCookie(
FormsAuthentication.FormsCookieName,
encryptedTicket);
authCookie.Secure = true;
Response.Cookies.Add(authCookie);
FormsAuthentication.RedirectFromLoginPage("User", false);
------Protected page -------
HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
Label1.Text = ticket.Name;
Results : label text is `"USER"` instead of `"TESTTEST"`
- What shall I do? | c# | asp.net | null | null | null | null | open | Reading from authentication cookie
===
I'm trying to read the username from auth ticket ( wich is `TESTTEST` )
-----LOGIN PAGE------
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(1,
"TESTTEST",
DateTime.Now,
DateTime.Now.AddMinutes(30),
false,
String.Empty,
FormsAuthentication.FormsCookiePath);
string encryptedTicket = FormsAuthentication.Encrypt(ticket);
HttpCookie authCookie = new HttpCookie(
FormsAuthentication.FormsCookieName,
encryptedTicket);
authCookie.Secure = true;
Response.Cookies.Add(authCookie);
FormsAuthentication.RedirectFromLoginPage("User", false);
------Protected page -------
HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
Label1.Text = ticket.Name;
Results : label text is `"USER"` instead of `"TESTTEST"`
- What shall I do? | 0 |
11,499,797 | 07/16/2012 07:24:48 | 1,024,335 | 11/01/2011 19:03:57 | 1 | 1 | Viewin rule-flow files in drools-guvnor | I'm working on a project that involves creating work-flows, in Drools flow.
I have a lot of rule flow (rf) files, that I want to be available for viewing through a web UI.
I've seen that drools-guvnor allows management of rf files. But it seems that it does not allow users to view them (only downloading works).
I've also heard that the bpmn file format works with Guvnor, but in my work-flows, i need to use global objects, which i don't think are supported.
So my queries are,
Is there a way to display rf files on Guvnor?
and
Can globals be used in bpmn files? | bpmn | drools-flow | drools-guvnor | null | null | null | open | Viewin rule-flow files in drools-guvnor
===
I'm working on a project that involves creating work-flows, in Drools flow.
I have a lot of rule flow (rf) files, that I want to be available for viewing through a web UI.
I've seen that drools-guvnor allows management of rf files. But it seems that it does not allow users to view them (only downloading works).
I've also heard that the bpmn file format works with Guvnor, but in my work-flows, i need to use global objects, which i don't think are supported.
So my queries are,
Is there a way to display rf files on Guvnor?
and
Can globals be used in bpmn files? | 0 |
11,499,798 | 07/16/2012 07:24:56 | 546,888 | 12/18/2010 09:14:48 | 71 | 7 | Not able to run applet in my IE8 | I have a web page which In which I am searching for a zebra printer by an applet.
The applet works fine on other system but not on my system.I tested the few thing about applet setting in my browser...
1> I Checked If applet is enabled or not by JAVA administrative window from control panel
2> I checked JAVA Add - Ons in my IE from "Manage Add Ons" option..
I am referring this link to solve the problem :
[http://javatester.org/enabled.html][1]
But this on line applet testing gives..
"ClassNotFoundExceptioln : Tiny" error.
It seems that applet is working in my system but it not able to retrieve class file from the server.
Do you have any ideas ? How to solve this problem ?
Is there any network OR firewall settings ?
Thanks,
Gunjan Shah.
[1]: http://javatester.org/enabled.html | java | applet | null | null | null | null | open | Not able to run applet in my IE8
===
I have a web page which In which I am searching for a zebra printer by an applet.
The applet works fine on other system but not on my system.I tested the few thing about applet setting in my browser...
1> I Checked If applet is enabled or not by JAVA administrative window from control panel
2> I checked JAVA Add - Ons in my IE from "Manage Add Ons" option..
I am referring this link to solve the problem :
[http://javatester.org/enabled.html][1]
But this on line applet testing gives..
"ClassNotFoundExceptioln : Tiny" error.
It seems that applet is working in my system but it not able to retrieve class file from the server.
Do you have any ideas ? How to solve this problem ?
Is there any network OR firewall settings ?
Thanks,
Gunjan Shah.
[1]: http://javatester.org/enabled.html | 0 |
11,499,805 | 07/16/2012 07:25:09 | 355,023 | 12/31/2009 01:30:43 | 482 | 1 | Git http.proxy Setting | I was trying to figure this git thing out and at one moment I messed with the http.proxy variable. Right now it's just nonsense, 'asdf' so pushing doesn't work. I don't know what the proxy setting was before (I don't even know what proxy server is). Any way to set http.proxy to the correct value?
Right now the error is: "Couldn't resolve proxy 'asdf' while accessing ... fatal: HTTP request failed. | git | proxy | null | null | null | null | open | Git http.proxy Setting
===
I was trying to figure this git thing out and at one moment I messed with the http.proxy variable. Right now it's just nonsense, 'asdf' so pushing doesn't work. I don't know what the proxy setting was before (I don't even know what proxy server is). Any way to set http.proxy to the correct value?
Right now the error is: "Couldn't resolve proxy 'asdf' while accessing ... fatal: HTTP request failed. | 0 |
11,499,725 | 07/16/2012 07:19:28 | 1,157,952 | 01/19/2012 07:50:44 | 107 | 4 | Entity Framework Code First with XML as Data Source | Is it possible to work with Entity Framework (Code First) and having the data source being an XML file? I need to populate the domain objects with values from the XML file.
The XML file has this structure:
<Person name="John" age="12">
<Products>
<Product id="1" name="Product 1" />
<Product id="2" name="Product 2" />
<Product id="3" name="Product 3" />
</Products>
</Person>
C# domain objects has this structure:
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public ICollection<Product> Products { get; set; }
}
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
}
I can use Linq to XML to parse trough each element of XML and populate the objects, but i was looking for a more automated way to do this (if exists). | c# | asp.net-mvc | entity-framework | xml-serialization | code-first | null | open | Entity Framework Code First with XML as Data Source
===
Is it possible to work with Entity Framework (Code First) and having the data source being an XML file? I need to populate the domain objects with values from the XML file.
The XML file has this structure:
<Person name="John" age="12">
<Products>
<Product id="1" name="Product 1" />
<Product id="2" name="Product 2" />
<Product id="3" name="Product 3" />
</Products>
</Person>
C# domain objects has this structure:
public class Person
{
public string Name { get; set; }
public int Age { get; set; }
public ICollection<Product> Products { get; set; }
}
public class Product
{
public int Id { get; set; }
public string Name { get; set; }
}
I can use Linq to XML to parse trough each element of XML and populate the objects, but i was looking for a more automated way to do this (if exists). | 0 |
11,499,726 | 07/16/2012 07:19:37 | 748,530 | 05/11/2011 11:19:36 | 184 | 18 | why sorry pop up cause of text size? | I have a layout with a textview and a button as below.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/info_layout">
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp" />
<Button android:id="@+id/butn1"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dip"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/button1" />
</LinearLayout>
The above layout works fine for many languages but for arab its giving sorry pop up, but if i change textSize to 18sp it works fine. Even i tried removing margin from button before changing text size but still the problem raises.I'll set text for text View in java file.So im not understanding what's exact cause for this problem. | android | android-layout | android-textview | android-button | android-textattributes | null | open | why sorry pop up cause of text size?
===
I have a layout with a textview and a button as below.
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/info_layout">
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="20sp" />
<Button android:id="@+id/butn1"
android:layout_gravity="center_horizontal"
android:layout_marginTop="40dip"
android:layout_width="150dip"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/button1" />
</LinearLayout>
The above layout works fine for many languages but for arab its giving sorry pop up, but if i change textSize to 18sp it works fine. Even i tried removing margin from button before changing text size but still the problem raises.I'll set text for text View in java file.So im not understanding what's exact cause for this problem. | 0 |
11,410,489 | 07/10/2012 09:37:06 | 1,294,668 | 03/27/2012 05:11:37 | 6 | 1 | Fingerprint Comparing Code |
I have saved the fingerprint impression in sqlite database as bitmap . Can anybody please help me with source code or link of android code to compare two fingerprint impressions as bitmap . To match for equality.
I have tried with following code . But it matches with all the fingerprint impression stored in database.
public boolean compare(Bitmap imageToCompare , Bitmap imageInDb )
{ System.out.println("Inside Compare");
System.out.println("imageToCompare::::"+imageToCompare);
System.out.println("imageInDb::::"+imageInDb);
/*int width = imageToCompare.getWidth();
System.out.println("width::::::"+width);
int height = imageToCompare.getHeight();
System.out.println("height::::"+height);
int pixelCount = width * height;
int width1 = imageInDb.getWidth();
System.out.println("width1::::::"+width1);
int height1 = imageInDb.getHeight();
System.out.println("height1::::"+height1);*/
int pixelCount = mImageWidth * mImageHeight;
System.out.println("pixelCount::::"+pixelCount);
int[] pixels1 = new int[pixelCount];
int[] pixels2 = new int[pixelCount];
System.out.println("11111111111111111");
//imageToCompare.getPixels(pixels1, 0, 0, 0, width, height);
imageToCompare.getPixels(pixels1, 0,mImageWidth, 0, 0, mImageWidth, mImageHeight);
imageInDb.getPixels(pixels2, 0,mImageWidth, 0,0, mImageWidth, mImageHeight);
System.out.println("22222222222222");
for (int i = 0; i < pixelCount; i++) {
if (pixels1[i] != pixels2[i]) {
System.out.println("333333333333");
return false;
}
}
System.out.println("444444444444444444");
return true;
}
thanks | android | fingerprint | null | null | null | null | open | Fingerprint Comparing Code
===
I have saved the fingerprint impression in sqlite database as bitmap . Can anybody please help me with source code or link of android code to compare two fingerprint impressions as bitmap . To match for equality.
I have tried with following code . But it matches with all the fingerprint impression stored in database.
public boolean compare(Bitmap imageToCompare , Bitmap imageInDb )
{ System.out.println("Inside Compare");
System.out.println("imageToCompare::::"+imageToCompare);
System.out.println("imageInDb::::"+imageInDb);
/*int width = imageToCompare.getWidth();
System.out.println("width::::::"+width);
int height = imageToCompare.getHeight();
System.out.println("height::::"+height);
int pixelCount = width * height;
int width1 = imageInDb.getWidth();
System.out.println("width1::::::"+width1);
int height1 = imageInDb.getHeight();
System.out.println("height1::::"+height1);*/
int pixelCount = mImageWidth * mImageHeight;
System.out.println("pixelCount::::"+pixelCount);
int[] pixels1 = new int[pixelCount];
int[] pixels2 = new int[pixelCount];
System.out.println("11111111111111111");
//imageToCompare.getPixels(pixels1, 0, 0, 0, width, height);
imageToCompare.getPixels(pixels1, 0,mImageWidth, 0, 0, mImageWidth, mImageHeight);
imageInDb.getPixels(pixels2, 0,mImageWidth, 0,0, mImageWidth, mImageHeight);
System.out.println("22222222222222");
for (int i = 0; i < pixelCount; i++) {
if (pixels1[i] != pixels2[i]) {
System.out.println("333333333333");
return false;
}
}
System.out.println("444444444444444444");
return true;
}
thanks | 0 |
11,410,498 | 07/10/2012 09:37:36 | 1,153,581 | 01/17/2012 09:36:59 | 5 | 1 | IIS 7.0 asp.net session timeout | I have the following request:
I have a website with 2 areas -
1) public - session is set for 10 minutes dynamically in code (during page request processing)
2) private - session is set for one hour dynamically in code (during page request processing)
My problem is that I have 2 environetns that act differently:
1. Development environment - reacts as expected (public and private areas have the definitions that were defined by code).
2. Production environment - all areas have 15 (or 20) minutes session timeout (the timing depends on which server I define the environment).
Due to the description, I understand that the code itself is not necessary.
Now, the only difference between the 2 environments is that Production has SSL encryption.
What do I need to add in order to make both environments act the same?
Thanks in advance. | c# | asp.net | iis | ssl | null | null | open | IIS 7.0 asp.net session timeout
===
I have the following request:
I have a website with 2 areas -
1) public - session is set for 10 minutes dynamically in code (during page request processing)
2) private - session is set for one hour dynamically in code (during page request processing)
My problem is that I have 2 environetns that act differently:
1. Development environment - reacts as expected (public and private areas have the definitions that were defined by code).
2. Production environment - all areas have 15 (or 20) minutes session timeout (the timing depends on which server I define the environment).
Due to the description, I understand that the code itself is not necessary.
Now, the only difference between the 2 environments is that Production has SSL encryption.
What do I need to add in order to make both environments act the same?
Thanks in advance. | 0 |
11,410,499 | 07/10/2012 09:37:43 | 1,479,559 | 06/25/2012 09:42:49 | 99 | 5 | Segmentate an single nucleotide polymorphism Array data.frame error | I have a question that seems to be almost impossible to answer, because the data set to use is several gbs big and i cant post any sample data because the set is 1 big multidimensional array. But i thought maybe there is someone who understands coding so well that he could tell me where the error came from. The function i`m using is used for the segmentation of the different clusters/samples.
The code for this function respectively:
function (object, method = c("DNACopy", "HMM", "BioHMM", "GLAD"),
normalizedTo = 2, doLog = TRUE, doMerge = FALSE, useLair = FALSE,
subsample = "OPA", alpha = 0.01)
{
method <- match.arg(method)
if (method == "DNACopy") {
object <- sortGenomic(object)
if (!require(DNAcopy))
stop("package `DNAcopy` is not installed")
observed <- assayData(object)$intensity/normalizedTo
if (doLog)
observed <- log2(observed)
states <- matrix(NA, ncol = ncol(observed), nrow = nrow(observed),
dimnames = dimnames(observed))
predicted <- states
if (useLair) {
lair.states <- matrix(NA, ncol = ncol(observed),
nrow = nrow(observed), dimnames = dimnames(observed))
lair.predicted <- lair.states
lair <- assayData(object)$lair
lair[!assayData(object)$nor.gt] <- NA
}
chrom <- numericCHR(fData(object)$CHR)
maploc <- fData(object)$MapInfo
cna.intensity <- smooth.CNA(CNA(observed, chrom, maploc,
sampleid = sampleNames(object)))
seg.intensity <- DNAcopy::segment(cna.intensity, alpha = alpha)
assays <- unique(seg.intensity$output$ID)
seg.intensity <- split(seg.intensity$output, seg.intensity$output$ID)
for (assay in 1:length(assays)) {
seg.smp <- seg.intensity[[assays[assay]]]
for (state in 1:nrow(seg.smp)) {
states[chrom == seg.smp$chrom[state] & maploc >=
seg.smp$loc.start[state] & maploc <= seg.smp$loc.end[state],
assay] <- state
predicted[chrom == seg.smp$chrom[state] & maploc >=
seg.smp$loc.start[state] & maploc <= seg.smp$loc.end[state],
assay] <- seg.smp$seg.mean[state]
}
if (useLair) {
if (all(is.na(lair[,assay]))){
lair.states[, assay] <- states[,assay]
} else {
all.na <- aggregate(lair[, assay], by = list(states[,
assay]), FUN = function(x) all(is.na(x)))
selection <- (!states[, assay] %in% all.na[all.na[,
2], 1])
cna.lair <- CNA(lair[selection, assay], states[selection,
assay], maploc[selection], sampleid = paste(sampleNames(object)[assay],
"lair"))
seg.lair <- DNAcopy::segment(cna.lair, alpha = alpha)
seg.lair <- seg.lair$output
if (any(all.na[, 2])) {
exc.seg <- seg.smp[all.na[, 2], ]
exc.seg$chrom <- all.na[all.na[, 2], 1]
exc.seg$seg.mean <- NA
seg.lair <- rbind(seg.lair, exc.seg)
idx <- order(seg.lair$chrom, seg.lair$loc.start)
seg.lair <- seg.lair[idx, ]
}
seg.lair$loc.start[1] <- seg.smp$loc.start[1]
prevstate <- seg.lair$chrom[1]
for (lair.state in 2:nrow(seg.lair)) {
if (seg.lair$chrom[lair.state] == prevstate) {
seg.lair$loc.end[lair.state - 1] <- (seg.lair$loc.end[lair.state -
1] + seg.lair$loc.start[lair.state])%/%2
seg.lair$loc.start[lair.state] <- seg.lair$loc.end[lair.state -
1] + 1
}
else {
seg.lair$loc.end[lair.state - 1] <- seg.smp$loc.end[prevstate]
seg.lair$loc.start[lair.state] <- seg.smp$loc.start[seg.lair$chrom[lair.state]]
}
prevstate <- seg.lair$chrom[lair.state]
}
seg.lair$loc.end[nrow(seg.lair)] <- seg.smp$loc.end[prevstate]
for (state in 1:nrow(seg.lair)) {
stateprobes <- states[, assay] == seg.lair$chrom[state] &
maploc >= seg.lair$loc.start[state] & maploc <=
seg.lair$loc.end[state]
lair.states[stateprobes, assay] <- state
lair.predicted[stateprobes, assay] <- seg.lair$seg.mean[state]
}
}
}
}
res <- object
assayData(res)$observed <- observed
if (useLair)
assayData(res)$states <- lair.states
else assayData(res)$states <- states
assayData(res)$predicted <- predicted
if (useLair) {
assayData(res)$lair.predicted <- lair.predicted
}
res
}
else segmentate.old(object, method, normalizedTo, doLog,
doMerge, subsample)
}
Somewhere @ lines 40 till 70 something goes wrong the error i`m getting is:
> Error in `$<-.data.frame`(`*tmp*`, "chrom", value = c(12L, 22L)) :
> replacement has 2 rows, data has 3
i know this is almost impossible to answer so any tips or hints are very much appreciated.
Greets,
Sanshine
| r | multidimensional-array | segmentation | null | null | null | open | Segmentate an single nucleotide polymorphism Array data.frame error
===
I have a question that seems to be almost impossible to answer, because the data set to use is several gbs big and i cant post any sample data because the set is 1 big multidimensional array. But i thought maybe there is someone who understands coding so well that he could tell me where the error came from. The function i`m using is used for the segmentation of the different clusters/samples.
The code for this function respectively:
function (object, method = c("DNACopy", "HMM", "BioHMM", "GLAD"),
normalizedTo = 2, doLog = TRUE, doMerge = FALSE, useLair = FALSE,
subsample = "OPA", alpha = 0.01)
{
method <- match.arg(method)
if (method == "DNACopy") {
object <- sortGenomic(object)
if (!require(DNAcopy))
stop("package `DNAcopy` is not installed")
observed <- assayData(object)$intensity/normalizedTo
if (doLog)
observed <- log2(observed)
states <- matrix(NA, ncol = ncol(observed), nrow = nrow(observed),
dimnames = dimnames(observed))
predicted <- states
if (useLair) {
lair.states <- matrix(NA, ncol = ncol(observed),
nrow = nrow(observed), dimnames = dimnames(observed))
lair.predicted <- lair.states
lair <- assayData(object)$lair
lair[!assayData(object)$nor.gt] <- NA
}
chrom <- numericCHR(fData(object)$CHR)
maploc <- fData(object)$MapInfo
cna.intensity <- smooth.CNA(CNA(observed, chrom, maploc,
sampleid = sampleNames(object)))
seg.intensity <- DNAcopy::segment(cna.intensity, alpha = alpha)
assays <- unique(seg.intensity$output$ID)
seg.intensity <- split(seg.intensity$output, seg.intensity$output$ID)
for (assay in 1:length(assays)) {
seg.smp <- seg.intensity[[assays[assay]]]
for (state in 1:nrow(seg.smp)) {
states[chrom == seg.smp$chrom[state] & maploc >=
seg.smp$loc.start[state] & maploc <= seg.smp$loc.end[state],
assay] <- state
predicted[chrom == seg.smp$chrom[state] & maploc >=
seg.smp$loc.start[state] & maploc <= seg.smp$loc.end[state],
assay] <- seg.smp$seg.mean[state]
}
if (useLair) {
if (all(is.na(lair[,assay]))){
lair.states[, assay] <- states[,assay]
} else {
all.na <- aggregate(lair[, assay], by = list(states[,
assay]), FUN = function(x) all(is.na(x)))
selection <- (!states[, assay] %in% all.na[all.na[,
2], 1])
cna.lair <- CNA(lair[selection, assay], states[selection,
assay], maploc[selection], sampleid = paste(sampleNames(object)[assay],
"lair"))
seg.lair <- DNAcopy::segment(cna.lair, alpha = alpha)
seg.lair <- seg.lair$output
if (any(all.na[, 2])) {
exc.seg <- seg.smp[all.na[, 2], ]
exc.seg$chrom <- all.na[all.na[, 2], 1]
exc.seg$seg.mean <- NA
seg.lair <- rbind(seg.lair, exc.seg)
idx <- order(seg.lair$chrom, seg.lair$loc.start)
seg.lair <- seg.lair[idx, ]
}
seg.lair$loc.start[1] <- seg.smp$loc.start[1]
prevstate <- seg.lair$chrom[1]
for (lair.state in 2:nrow(seg.lair)) {
if (seg.lair$chrom[lair.state] == prevstate) {
seg.lair$loc.end[lair.state - 1] <- (seg.lair$loc.end[lair.state -
1] + seg.lair$loc.start[lair.state])%/%2
seg.lair$loc.start[lair.state] <- seg.lair$loc.end[lair.state -
1] + 1
}
else {
seg.lair$loc.end[lair.state - 1] <- seg.smp$loc.end[prevstate]
seg.lair$loc.start[lair.state] <- seg.smp$loc.start[seg.lair$chrom[lair.state]]
}
prevstate <- seg.lair$chrom[lair.state]
}
seg.lair$loc.end[nrow(seg.lair)] <- seg.smp$loc.end[prevstate]
for (state in 1:nrow(seg.lair)) {
stateprobes <- states[, assay] == seg.lair$chrom[state] &
maploc >= seg.lair$loc.start[state] & maploc <=
seg.lair$loc.end[state]
lair.states[stateprobes, assay] <- state
lair.predicted[stateprobes, assay] <- seg.lair$seg.mean[state]
}
}
}
}
res <- object
assayData(res)$observed <- observed
if (useLair)
assayData(res)$states <- lair.states
else assayData(res)$states <- states
assayData(res)$predicted <- predicted
if (useLair) {
assayData(res)$lair.predicted <- lair.predicted
}
res
}
else segmentate.old(object, method, normalizedTo, doLog,
doMerge, subsample)
}
Somewhere @ lines 40 till 70 something goes wrong the error i`m getting is:
> Error in `$<-.data.frame`(`*tmp*`, "chrom", value = c(12L, 22L)) :
> replacement has 2 rows, data has 3
i know this is almost impossible to answer so any tips or hints are very much appreciated.
Greets,
Sanshine
| 0 |
11,410,504 | 07/10/2012 09:38:13 | 1,514,305 | 07/10/2012 09:17:15 | 1 | 0 | feel unable to use created element on jquery | I'm new in jquery and I suffer from a problem which is a little strange !
after creation a div in jquery,i can't use it,this example will show you how is the problem!
let's assume that in the get.php page there is just:echo "test test";
the code in my file :
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#bda").click(function()
{
$.post("get.php",function(data){
$("#tdiv").append('<div class="info" >'+data +'</div>');
});
});
$(".info").click(function()
{
alert("done");
});
});
</script>
</head>
<body>
<div id="bda">click here</div>
<div align="center" style="border:1px solid blue" id="tdiv">
example
</div>
<div class="info" >it works here</div>
Can some one help me.. | jquery | element | created | null | null | null | open | feel unable to use created element on jquery
===
I'm new in jquery and I suffer from a problem which is a little strange !
after creation a div in jquery,i can't use it,this example will show you how is the problem!
let's assume that in the get.php page there is just:echo "test test";
the code in my file :
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function()
{
$("#bda").click(function()
{
$.post("get.php",function(data){
$("#tdiv").append('<div class="info" >'+data +'</div>');
});
});
$(".info").click(function()
{
alert("done");
});
});
</script>
</head>
<body>
<div id="bda">click here</div>
<div align="center" style="border:1px solid blue" id="tdiv">
example
</div>
<div class="info" >it works here</div>
Can some one help me.. | 0 |
11,410,506 | 07/10/2012 09:38:17 | 1,067,943 | 11/27/2011 14:26:06 | 252 | 0 | How to use multi properties in class that contain one variable? | Would be very grateful if you help me.
I have class named "config" that have private string variable named "param".
I need to get from "config" class "param" variable sometimes as int type sometimes as bool type or string.
As I understand I need create 3 properties in config class,each property have to convert type,
as follow:
the first property converts string to int,
the second converts string to bool,
the third property gets me the string value.
The class should look something like this:
class Config
{
private string param;
public int
{
get
{
return int.parse(param);
}
}
public bool
{
get
{
return bool.tryparse(param);
}
}
public string
{
get
{
return param;
}
}
}
But I dont know how can those properties be used in accordance
to the variable type that I want to get out of class.
I hope you can help me!!
Thank you in advance!
| c# | .net | properties | enums | null | null | open | How to use multi properties in class that contain one variable?
===
Would be very grateful if you help me.
I have class named "config" that have private string variable named "param".
I need to get from "config" class "param" variable sometimes as int type sometimes as bool type or string.
As I understand I need create 3 properties in config class,each property have to convert type,
as follow:
the first property converts string to int,
the second converts string to bool,
the third property gets me the string value.
The class should look something like this:
class Config
{
private string param;
public int
{
get
{
return int.parse(param);
}
}
public bool
{
get
{
return bool.tryparse(param);
}
}
public string
{
get
{
return param;
}
}
}
But I dont know how can those properties be used in accordance
to the variable type that I want to get out of class.
I hope you can help me!!
Thank you in advance!
| 0 |
11,410,510 | 07/10/2012 09:38:34 | 1,338,649 | 04/17/2012 11:49:11 | 10 | 0 | Multiple file upload extension in yii | I was trying to create multiple file upload extension in yii framework. I created it but when i using it multiple times in one form then HTML elements conflicting with each other... and its not working. so can anybody help mi about it? | php | yii | yii-mvc | yii-components | yii-events | null | open | Multiple file upload extension in yii
===
I was trying to create multiple file upload extension in yii framework. I created it but when i using it multiple times in one form then HTML elements conflicting with each other... and its not working. so can anybody help mi about it? | 0 |
11,410,512 | 07/10/2012 09:38:41 | 1,481,995 | 06/26/2012 07:42:16 | 1 | 0 | How to close a WPF child window using MVVM without any MVVM frameworks? | I am very new to MVVM and WPF.
The application I have created has two buttons, openWindow and closeWindow.
I managed to hook up the openWindow using the ICommand and go it to open a new window :)
My question is how when I press that closeWindow, do I close that opened window?
I am not using any MVVM frameworks like MVVM Light etc.
Much appreciated. | wpf | mvvm | null | null | null | null | open | How to close a WPF child window using MVVM without any MVVM frameworks?
===
I am very new to MVVM and WPF.
The application I have created has two buttons, openWindow and closeWindow.
I managed to hook up the openWindow using the ICommand and go it to open a new window :)
My question is how when I press that closeWindow, do I close that opened window?
I am not using any MVVM frameworks like MVVM Light etc.
Much appreciated. | 0 |
11,410,514 | 07/10/2012 09:38:52 | 1,488,814 | 06/28/2012 14:09:31 | 43 | 1 | getting storage information in android | I was wondering how I can get the information about any memory card, internal storage that an android device have! what I want is the free, used memory amount and if possible the extra details about memory card! ( not the internal Storage ) | android | android-layout | android-intent | android-hardware | null | null | open | getting storage information in android
===
I was wondering how I can get the information about any memory card, internal storage that an android device have! what I want is the free, used memory amount and if possible the extra details about memory card! ( not the internal Storage ) | 0 |
11,410,519 | 07/10/2012 09:39:02 | 1,257,942 | 03/08/2012 20:29:18 | 1 | 0 | jQuery mobile: input isn't in jquery mobile style | @using (var form = Html.BeginForm("SearchCustomer","Home")){
@Html.ValidationSummary(true)
<table>
<tr>
<td>
@Html.EditorFor(m => Model.SearchString)
</td>
<td>
</td>
<td>
<input type="submit" name="foo" data-role="none" />
</td>
</tr>
</table>
}
I want that input to be in jQuery mobile style, but if I set the data-role to "button" the page is empty. What can I do? | jquery | mobile | input | styles | submit | null | open | jQuery mobile: input isn't in jquery mobile style
===
@using (var form = Html.BeginForm("SearchCustomer","Home")){
@Html.ValidationSummary(true)
<table>
<tr>
<td>
@Html.EditorFor(m => Model.SearchString)
</td>
<td>
</td>
<td>
<input type="submit" name="foo" data-role="none" />
</td>
</tr>
</table>
}
I want that input to be in jQuery mobile style, but if I set the data-role to "button" the page is empty. What can I do? | 0 |
11,349,839 | 07/05/2012 17:55:36 | 29,121 | 10/17/2008 22:01:03 | 440 | 10 | How do I get rid of the grey bar in UINavigationController (iOS app) | I'm using this code to open up a page in my iOS app when a user clicks a button, but I get a grey bar at the top of the page when the user does so. How can I get rid of this?
- (IBAction) colours:(id)sender {
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:colourPickerView];
[self presentViewController:navigationController animated:YES completion: nil];
} | iphone | ios | user-interface | null | null | null | open | How do I get rid of the grey bar in UINavigationController (iOS app)
===
I'm using this code to open up a page in my iOS app when a user clicks a button, but I get a grey bar at the top of the page when the user does so. How can I get rid of this?
- (IBAction) colours:(id)sender {
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:colourPickerView];
[self presentViewController:navigationController animated:YES completion: nil];
} | 0 |
11,349,840 | 07/05/2012 17:55:49 | 185,824 | 10/07/2009 18:07:14 | 2,277 | 95 | How to access web project from selenium based unit test project? | I have two projects in my solution Web and SeleniumTests which is Unit Test Project.
I have TestClass with following method:
[TestMethod]
public void Demo1()
{
// Create a new instance of the Firefox driver.
// Notice that the remainder of the code relies on the interface,
// not the implementation.
// Further note that other drivers (InternetExplorerDriver,
// ChromeDriver, etc.) will require further configuration
// before this example will work. See the wiki pages for the
// individual drivers at http://code.google.com/p/selenium/wiki
// for further information.
IWebDriver driver = new FirefoxDriver();
//Notice navigation is slightly different than the Java version
//This is because 'get' is a keyword in C#
driver.Navigate().GoToUrl("http://www.google.com/");
// Find the text input element by its name
IWebElement query = driver.FindElement(By.Name("q"));
// Enter something to search for
query.SendKeys("Cheese");
// Now submit the form. WebDriver will find the form for us from the element
query.Submit();
// Google's search is rendered dynamically with JavaScript.
// Wait for the page to load, timeout after 10 seconds
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.Until((d) => { return d.Title.ToLower().StartsWith("cheese"); });
// Should see: "Cheese - Google Search"
System.Console.WriteLine("Page title is: " + driver.Title);
//Close the browser
driver.Quit();
}
All is fine but in real world i don't want to access Google.com but certain page of Web Project. Is there a way to access it without explicitly writting as url in `driver.Navigate().GoToUrl("http://www.google.com/");`
For example i want to access ~/Default.aspx of Web Project.
thanks | c# | asp.net | selenium | null | null | null | open | How to access web project from selenium based unit test project?
===
I have two projects in my solution Web and SeleniumTests which is Unit Test Project.
I have TestClass with following method:
[TestMethod]
public void Demo1()
{
// Create a new instance of the Firefox driver.
// Notice that the remainder of the code relies on the interface,
// not the implementation.
// Further note that other drivers (InternetExplorerDriver,
// ChromeDriver, etc.) will require further configuration
// before this example will work. See the wiki pages for the
// individual drivers at http://code.google.com/p/selenium/wiki
// for further information.
IWebDriver driver = new FirefoxDriver();
//Notice navigation is slightly different than the Java version
//This is because 'get' is a keyword in C#
driver.Navigate().GoToUrl("http://www.google.com/");
// Find the text input element by its name
IWebElement query = driver.FindElement(By.Name("q"));
// Enter something to search for
query.SendKeys("Cheese");
// Now submit the form. WebDriver will find the form for us from the element
query.Submit();
// Google's search is rendered dynamically with JavaScript.
// Wait for the page to load, timeout after 10 seconds
WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
wait.Until((d) => { return d.Title.ToLower().StartsWith("cheese"); });
// Should see: "Cheese - Google Search"
System.Console.WriteLine("Page title is: " + driver.Title);
//Close the browser
driver.Quit();
}
All is fine but in real world i don't want to access Google.com but certain page of Web Project. Is there a way to access it without explicitly writting as url in `driver.Navigate().GoToUrl("http://www.google.com/");`
For example i want to access ~/Default.aspx of Web Project.
thanks | 0 |
11,349,842 | 07/05/2012 17:55:54 | 1,424,536 | 05/29/2012 18:18:30 | 16 | 3 | How to divert All incoming calls to voicemail through coding in Android | How to divert All incoming calls to voicemail through coding in Android? I am aware that you can set a flag for a contact which determines whether the call should be diverted to voicemail or not. ContactsContract.RawContacts has got a flag to indicate that call should be forwarded to voice mail
SEND_TO_VOICEMAIL read/write An indicator of whether calls from this raw contact should be forwarded directly to voice mail ('1') or not ('0').
However I need to send all incoming call to voice mail.
Thanks,
| android | null | null | null | null | null | open | How to divert All incoming calls to voicemail through coding in Android
===
How to divert All incoming calls to voicemail through coding in Android? I am aware that you can set a flag for a contact which determines whether the call should be diverted to voicemail or not. ContactsContract.RawContacts has got a flag to indicate that call should be forwarded to voice mail
SEND_TO_VOICEMAIL read/write An indicator of whether calls from this raw contact should be forwarded directly to voice mail ('1') or not ('0').
However I need to send all incoming call to voice mail.
Thanks,
| 0 |
11,349,693 | 07/05/2012 17:45:18 | 1,502,038 | 07/04/2012 16:00:57 | 1 | 0 | Navigation Bar iOS problems with backbutton | I am having problems with the Navigation Bar, I have a UITableView, and when I click one of the cells, I create a new view with a scrollView and NavigationBar. The problem is that when I go back to the TableView, the button I clicked is kind of disable. Can some give me some suggestions please.
My best regards.
Thanks.
| ios | null | null | null | null | null | open | Navigation Bar iOS problems with backbutton
===
I am having problems with the Navigation Bar, I have a UITableView, and when I click one of the cells, I create a new view with a scrollView and NavigationBar. The problem is that when I go back to the TableView, the button I clicked is kind of disable. Can some give me some suggestions please.
My best regards.
Thanks.
| 0 |
11,349,845 | 07/05/2012 17:55:57 | 1,069,254 | 11/28/2011 11:44:42 | 145 | 7 | Facebook Graph API, how to filter likes? | I saw that there is the possibility to filter some stuff with since=TIME and until=TIME, but I'm not able to do this with the likes.
Is it a bug, not implemented or there's simply another way to do this? | facebook-graph-api | like | null | null | null | null | open | Facebook Graph API, how to filter likes?
===
I saw that there is the possibility to filter some stuff with since=TIME and until=TIME, but I'm not able to do this with the likes.
Is it a bug, not implemented or there's simply another way to do this? | 0 |
11,349,846 | 07/05/2012 17:56:00 | 1,504,795 | 07/05/2012 17:46:14 | 1 | 0 | gmail admin login via google-api | I have been going over the google-api-java-client and oauth2 documentation. I am new to both OAuth and google's API.
My question is this. I need to write some in-house programs to do administrative tasks on all of our users in GMail. Is using OAuth the best way to go? All I really need to do is log in as the gmail administrator and run some automated tasks on each user account/data.
If OAuth is the best way to go, do I use the gmail domain key?
Thanks in advance, | google-api | google-api-java-client | null | null | null | null | open | gmail admin login via google-api
===
I have been going over the google-api-java-client and oauth2 documentation. I am new to both OAuth and google's API.
My question is this. I need to write some in-house programs to do administrative tasks on all of our users in GMail. Is using OAuth the best way to go? All I really need to do is log in as the gmail administrator and run some automated tasks on each user account/data.
If OAuth is the best way to go, do I use the gmail domain key?
Thanks in advance, | 0 |
11,349,847 | 07/05/2012 17:56:05 | 1,042,112 | 11/11/2011 17:01:22 | 18 | 1 | spring-roo maven project does not support special characters | I'm using Spring/Roo with maven for an app server, and need to be able to post some special characters, like "ñ á é". When I print these characters on my server, and display them in console, they appear as "?", like this
System.out.print("ñ á é");
console print -> ? ? ?
How can they be properly encoded, i have another project without maven and spring-roo, using the same JVM, and i don't have this issues
hope someone can help thx in advance
| java | maven | spring-mvc | encoding | spring-roo | null | open | spring-roo maven project does not support special characters
===
I'm using Spring/Roo with maven for an app server, and need to be able to post some special characters, like "ñ á é". When I print these characters on my server, and display them in console, they appear as "?", like this
System.out.print("ñ á é");
console print -> ? ? ?
How can they be properly encoded, i have another project without maven and spring-roo, using the same JVM, and i don't have this issues
hope someone can help thx in advance
| 0 |
11,349,849 | 07/05/2012 17:56:08 | 884,209 | 08/08/2011 13:59:11 | 89 | 1 | Jquery - best way to detect mobile browser? (mousedown/touchmove) | I have some Jquery scroller.
For desktop browsers I use this construction:
holder.bind('mousedown.rotate', function(e){
//some actions
doc.bind('mousemove.dragrotate', function(e){
//some actions
});
doc.bind('mouseup.dragrotate', function(){
//some actions
doc.unbind('.dragrotate');
});
});
for mobile browsers it works in this way:
holder.bind('touchmove', function(jQueryEvent) {
//some actions
});
what is the best way to determine mobile borwsers?
is there a way to use same function for all platforms?
thx | jquery | mobile | mousedown | touchmove | null | null | open | Jquery - best way to detect mobile browser? (mousedown/touchmove)
===
I have some Jquery scroller.
For desktop browsers I use this construction:
holder.bind('mousedown.rotate', function(e){
//some actions
doc.bind('mousemove.dragrotate', function(e){
//some actions
});
doc.bind('mouseup.dragrotate', function(){
//some actions
doc.unbind('.dragrotate');
});
});
for mobile browsers it works in this way:
holder.bind('touchmove', function(jQueryEvent) {
//some actions
});
what is the best way to determine mobile borwsers?
is there a way to use same function for all platforms?
thx | 0 |
11,349,850 | 07/05/2012 17:56:16 | 789,489 | 06/08/2011 15:46:20 | 249 | 8 | Is it possible to create a many to many relations ship on the same object in Salesforce | Our customers have inter relations between them as: suppliers-buyers
meaning: we sell to both suppliers and buyers in the industry we work in.
I am trying to store that relation ship of our customers (between them) in salesforce. It is kind of a Many-to-Many relation. So on every Account I want to have a related list of all it's Buyers it sells to, and also Sellers it buys from (and vice versa on the others account)
I tried with a Junction Object- but I can't create 2 Master-Detail relations on the same object (mainly Account).
Is it possible?
| salesforce | data-modeling | null | null | null | null | open | Is it possible to create a many to many relations ship on the same object in Salesforce
===
Our customers have inter relations between them as: suppliers-buyers
meaning: we sell to both suppliers and buyers in the industry we work in.
I am trying to store that relation ship of our customers (between them) in salesforce. It is kind of a Many-to-Many relation. So on every Account I want to have a related list of all it's Buyers it sells to, and also Sellers it buys from (and vice versa on the others account)
I tried with a Junction Object- but I can't create 2 Master-Detail relations on the same object (mainly Account).
Is it possible?
| 0 |
11,349,857 | 07/05/2012 17:56:45 | 1,449,475 | 06/11/2012 16:51:01 | 29 | 1 | Unwanted black outline in Raphael.js | I'm attempting to create an animated menu bar using raphael.js. It works fine in Firefox but in Chromium a black outline appears around the graphic. [View this jsFiddle in Chrome][1].
As the graphic moves it also seems to leave behind traces of this black outline. I've tried setting the`"stroke-width"` attribute to `0` but this doesn't seem to have any effect.
Any help on the matter would be much appreciated.
[1]: http://jsfiddle.net/sTCSn/1/ | javascript | svg | raphael | vector-graphics | null | null | open | Unwanted black outline in Raphael.js
===
I'm attempting to create an animated menu bar using raphael.js. It works fine in Firefox but in Chromium a black outline appears around the graphic. [View this jsFiddle in Chrome][1].
As the graphic moves it also seems to leave behind traces of this black outline. I've tried setting the`"stroke-width"` attribute to `0` but this doesn't seem to have any effect.
Any help on the matter would be much appreciated.
[1]: http://jsfiddle.net/sTCSn/1/ | 0 |
11,349,858 | 07/05/2012 17:56:45 | 507,519 | 11/14/2010 18:21:43 | 17,760 | 618 | How do I get the old colors and look & feel back in Eclipse 4.2? | I had been using Eclipse 3.x for a few years and while I had a few issues w.r.t. its stability and performance, I never had any particular annoyance with the UI itself...
Now that the new and shiny Eclipse 4.2 is out of the oven, it feels more stable and somewhat snappier, *but* I instantly felt a dislike for some details of its UI:
- I find the "curved" look of the main toolbar distracting and it seems to me that it does not mix well with any other element in my desktop. It could just be a color issue, but the toolbar is prevalent enough to merit a specific mention.
- The default colors do not work well with the TFT/TN displays of the laptop and both desktop computers that I am using. The various gradients seem completely washed out, the tab separators are practically invisible and the toolbar curve looks totally weird.
It's also almost impossible to tell which view is active - Eclipse 3.x used a unique blue color for the active tab header. Juno uses a color-reversal in all inactive tabs, which probably sounds more visible, but in my opinion that effect is lost because the active tab is still in a shade of gray which is lost in the overall gray-ness of the new UI...
So, how do I get back to a more reasonable look and feel? Is there somewhere a theming option that would help?
PS.1: I use Eclipse/GTK on Linux...
PS.2: What happened to all the colors in Juno, anyway?
PS: Can we keep the new splash screen, though? *That* one, I like...
| eclipse | look-and-feel | null | null | null | null | open | How do I get the old colors and look & feel back in Eclipse 4.2?
===
I had been using Eclipse 3.x for a few years and while I had a few issues w.r.t. its stability and performance, I never had any particular annoyance with the UI itself...
Now that the new and shiny Eclipse 4.2 is out of the oven, it feels more stable and somewhat snappier, *but* I instantly felt a dislike for some details of its UI:
- I find the "curved" look of the main toolbar distracting and it seems to me that it does not mix well with any other element in my desktop. It could just be a color issue, but the toolbar is prevalent enough to merit a specific mention.
- The default colors do not work well with the TFT/TN displays of the laptop and both desktop computers that I am using. The various gradients seem completely washed out, the tab separators are practically invisible and the toolbar curve looks totally weird.
It's also almost impossible to tell which view is active - Eclipse 3.x used a unique blue color for the active tab header. Juno uses a color-reversal in all inactive tabs, which probably sounds more visible, but in my opinion that effect is lost because the active tab is still in a shade of gray which is lost in the overall gray-ness of the new UI...
So, how do I get back to a more reasonable look and feel? Is there somewhere a theming option that would help?
PS.1: I use Eclipse/GTK on Linux...
PS.2: What happened to all the colors in Juno, anyway?
PS: Can we keep the new splash screen, though? *That* one, I like...
| 0 |
11,349,859 | 07/05/2012 17:56:46 | 1,504,790 | 07/05/2012 17:41:47 | 1 | 0 | mobile barcode readers - where do they draw their information? | I'm pretty much a noob. I've been wondering how mobile barcode readers worked. I've seen several apps on the market that would let you scan a barcode, and then show you corresponding product data.
I was wondering where the product data typically comes from. Is it usually from a built-in database, or do apps tend to connect to a server to access a database?
Thanks for any and all assistance! | barcode | null | null | null | null | null | open | mobile barcode readers - where do they draw their information?
===
I'm pretty much a noob. I've been wondering how mobile barcode readers worked. I've seen several apps on the market that would let you scan a barcode, and then show you corresponding product data.
I was wondering where the product data typically comes from. Is it usually from a built-in database, or do apps tend to connect to a server to access a database?
Thanks for any and all assistance! | 0 |
11,349,861 | 07/05/2012 17:56:48 | 1,006,896 | 10/21/2011 10:23:25 | 1 | 0 | An error that won't go away while coding Android in eclipse | I'm new to coding Java/Android and I'm using eclipse to do it.
I'm getting this error "***Syntax error, insert ")" to complete MethodInvocation***" at line "***b.setOnClickListener(new OnClickListener()***".
And "***Syntax error, insert "AssignmentOperator Expression" to complete Assignment***" at line "***});***"
And "***Syntax error, insert ";" to complete Statement***" at the next line "***}***" after "***});***"
I've checked the code multiple times and I can't seem to figure out why the errors won't go away. Any input would be very much appreciated.
I've already tried saving all files and restarting eclipse and no change.
public class Main extends Activity {
/**
* called when the activity is first created
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Main.this, Second.class));
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
| android | null | null | null | null | null | open | An error that won't go away while coding Android in eclipse
===
I'm new to coding Java/Android and I'm using eclipse to do it.
I'm getting this error "***Syntax error, insert ")" to complete MethodInvocation***" at line "***b.setOnClickListener(new OnClickListener()***".
And "***Syntax error, insert "AssignmentOperator Expression" to complete Assignment***" at line "***});***"
And "***Syntax error, insert ";" to complete Statement***" at the next line "***}***" after "***});***"
I've checked the code multiple times and I can't seem to figure out why the errors won't go away. Any input would be very much appreciated.
I've already tried saving all files and restarting eclipse and no change.
public class Main extends Activity {
/**
* called when the activity is first created
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button b = (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startActivity(new Intent(Main.this, Second.class));
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
| 0 |
11,468,720 | 07/13/2012 10:29:45 | 1,503,324 | 07/05/2012 08:09:19 | 1 | 0 | cUrl alternatives to get POST answer on a webpage | I would like to get the resulting web page of a specific form submit. This form is using POST so my current goal is to be able to send POST data to an url, and to get the HTML content of the result in a variable.
My problem is that i cannot use cUrl (not enabled), that's why i ask for your knowledge to know if an other solution is possible.
Thanks in advance | php | javascript | html | curl | null | null | open | cUrl alternatives to get POST answer on a webpage
===
I would like to get the resulting web page of a specific form submit. This form is using POST so my current goal is to be able to send POST data to an url, and to get the HTML content of the result in a variable.
My problem is that i cannot use cUrl (not enabled), that's why i ask for your knowledge to know if an other solution is possible.
Thanks in advance | 0 |
11,468,722 | 07/13/2012 10:29:47 | 485,343 | 10/23/2010 22:35:36 | 953 | 62 | How to verify server (peer) name after x509 SSL/TLS handshake using SSLEngine? | I'm using `SSLEngine` with `NIO` for non-blocking TLS communication.
The engine is working fine, and is able to validate the CA trust, the validity period of the server certificate.
But what I'm missing is a validation that the certificate subject name matches the server name to which I'm connecting.
What's the best way to implement it, considering all the SSL extensions like [subject alternative names][1], etc?
I tried simply checking the subject name, but it doesn't work even with `google.nl`, the subject in the cert is `google.com`, and `google.nl` is only to be found in the alternative names extension.
[1]: http://www.ietf.org/rfc/rfc4985.txt | java | jsse | sslengine | null | null | null | open | How to verify server (peer) name after x509 SSL/TLS handshake using SSLEngine?
===
I'm using `SSLEngine` with `NIO` for non-blocking TLS communication.
The engine is working fine, and is able to validate the CA trust, the validity period of the server certificate.
But what I'm missing is a validation that the certificate subject name matches the server name to which I'm connecting.
What's the best way to implement it, considering all the SSL extensions like [subject alternative names][1], etc?
I tried simply checking the subject name, but it doesn't work even with `google.nl`, the subject in the cert is `google.com`, and `google.nl` is only to be found in the alternative names extension.
[1]: http://www.ietf.org/rfc/rfc4985.txt | 0 |
11,471,854 | 07/13/2012 13:51:13 | 703,929 | 04/12/2011 11:09:20 | 172 | 13 | mongoDB pinboard schema | I am creating pinboard (something like http://www.pinterest.com). I am using MongoDB as database (to store all pins).
Pins {
userid,
img,
title,
description,
comments {
[userid, username, comment]
}
}
I want to store images in gridFs. How I should link gridFs file to Pins.img. There should be only one image, but could be linked in multiple pins.
I can't figure it out. | php | mongodb | gridfs | null | null | null | open | mongoDB pinboard schema
===
I am creating pinboard (something like http://www.pinterest.com). I am using MongoDB as database (to store all pins).
Pins {
userid,
img,
title,
description,
comments {
[userid, username, comment]
}
}
I want to store images in gridFs. How I should link gridFs file to Pins.img. There should be only one image, but could be linked in multiple pins.
I can't figure it out. | 0 |
11,471,868 | 07/13/2012 13:51:57 | 1,523,681 | 07/13/2012 13:29:15 | 1 | 0 | Converting TEXT that represents NEGATIVE TIME value to a number or time value for adding (Excel) | I've got a spreadsheet (Office 2007 version of Excel) full of text entries that are negative time values, example "-0:07" as in an employee took 7 mins less to complete a job than expected. I need to perform mathematical calculations on these entries and am looking for a more elegant formula/method than I've come up with so far.
I know about 1904 date system and * or / by 24 to convert back and forth, the problem is getting a formula that will recognize the text entry as a negative time value.
I've tried value(), *1, which both work on the text fields if the number is positive, but the "-" seems to mess those up. Even paste-special/add fails to recognize these as numbers.
Here's what I came up with that gets the job done, but it's just so ugly to me:
=IF(LEFT(E5,1)="-",((VALUE(RIGHT(E5,LEN(E5)-1)))*-1.0),VALUE(E5))
Obviously my text entry is in cell E5 in this example.
This works, so I'm not desperate for a solution, but for educational purposes (and smaller code) I'd like to know if there's a better way to this. Does anyone have a suggestion for something shorter, easier?
Thanks.
P.S. - an interesting tidbit here, I use Excel at work, but not at home, so I uploaded a sample spreadsheet to Google Docs, and it actually handles the Value() command on those entries properly. Weird, huh?
Thanks again for any suggestions.
| excel | time | excel-formula | convert | negative-number | null | open | Converting TEXT that represents NEGATIVE TIME value to a number or time value for adding (Excel)
===
I've got a spreadsheet (Office 2007 version of Excel) full of text entries that are negative time values, example "-0:07" as in an employee took 7 mins less to complete a job than expected. I need to perform mathematical calculations on these entries and am looking for a more elegant formula/method than I've come up with so far.
I know about 1904 date system and * or / by 24 to convert back and forth, the problem is getting a formula that will recognize the text entry as a negative time value.
I've tried value(), *1, which both work on the text fields if the number is positive, but the "-" seems to mess those up. Even paste-special/add fails to recognize these as numbers.
Here's what I came up with that gets the job done, but it's just so ugly to me:
=IF(LEFT(E5,1)="-",((VALUE(RIGHT(E5,LEN(E5)-1)))*-1.0),VALUE(E5))
Obviously my text entry is in cell E5 in this example.
This works, so I'm not desperate for a solution, but for educational purposes (and smaller code) I'd like to know if there's a better way to this. Does anyone have a suggestion for something shorter, easier?
Thanks.
P.S. - an interesting tidbit here, I use Excel at work, but not at home, so I uploaded a sample spreadsheet to Google Docs, and it actually handles the Value() command on those entries properly. Weird, huh?
Thanks again for any suggestions.
| 0 |
11,471,870 | 07/13/2012 13:52:06 | 1,523,715 | 07/13/2012 13:44:10 | 1 | 0 | download image on android using http request in android | i have used a tutorial in and arrived at this result the program wworks in emulator but however it ceases to work in android device
the code is given here and all other android permissions required are set internet and write to external device are set
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import org.apache.http.util.ByteArrayBuffer;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
public class main extends Activity {
private final String PATH = "/mnt/sdcard/Pictures/";
TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv = (TextView)findViewById(R.id.textView1);
DownloadFromUrl(PATH + "dwnldimg.png");
ImageView iv = (ImageView) findViewById(R.id.imageView1);
Bitmap bmp = BitmapFactory.decodeFile(PATH + "dwnldimg.png");
iv.setImageBitmap(bmp);
}
public void DownloadFromUrl(String fileName) {
try {
URL url = new URL("http://192.168.1.4/evilempire.jpg"); //you can write here any link
File file = new File(fileName);
long startTime = System.currentTimeMillis();
tv.setText("Starting download......from " + url);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();;
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
/*
* Read bytes to the Buffer until there is nothing more to read(-1).
*/
ByteArrayBuffer baf = new ByteArrayBuffer(50);
int current = 0;
while ((current = bis.read()) != -1) {
baf.append((byte) current);
}
FileOutputStream fos = new FileOutputStream(file);
fos.write(baf.toByteArray());
fos.close();
tv.setText("Download Completed in" + ((System.currentTimeMillis() - startTime) / 1000) + " sec");
} catch (IOException e) {
tv.setText("Error: " + e);
}
}
}
| android | null | null | null | null | null | open | download image on android using http request in android
===
i have used a tutorial in and arrived at this result the program wworks in emulator but however it ceases to work in android device
the code is given here and all other android permissions required are set internet and write to external device are set
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import org.apache.http.util.ByteArrayBuffer;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.TextView;
public class main extends Activity {
private final String PATH = "/mnt/sdcard/Pictures/";
TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
tv = (TextView)findViewById(R.id.textView1);
DownloadFromUrl(PATH + "dwnldimg.png");
ImageView iv = (ImageView) findViewById(R.id.imageView1);
Bitmap bmp = BitmapFactory.decodeFile(PATH + "dwnldimg.png");
iv.setImageBitmap(bmp);
}
public void DownloadFromUrl(String fileName) {
try {
URL url = new URL("http://192.168.1.4/evilempire.jpg"); //you can write here any link
File file = new File(fileName);
long startTime = System.currentTimeMillis();
tv.setText("Starting download......from " + url);
HttpURLConnection conn = (HttpURLConnection)url.openConnection();;
conn.setDoInput(true);
conn.connect();
InputStream is = conn.getInputStream();
BufferedInputStream bis = new BufferedInputStream(is);
/*
* Read bytes to the Buffer until there is nothing more to read(-1).
*/
ByteArrayBuffer baf = new ByteArrayBuffer(50);
int current = 0;
while ((current = bis.read()) != -1) {
baf.append((byte) current);
}
FileOutputStream fos = new FileOutputStream(file);
fos.write(baf.toByteArray());
fos.close();
tv.setText("Download Completed in" + ((System.currentTimeMillis() - startTime) / 1000) + " sec");
} catch (IOException e) {
tv.setText("Error: " + e);
}
}
}
| 0 |
11,471,871 | 07/13/2012 13:52:08 | 1,334,427 | 04/15/2012 11:11:49 | 237 | 32 | Performance differences between automatic propreties and normally declared propreties. True or False? | there are many discussions about propreties everywhere i looked but can anyone point out the fact if we have any performance loss when we use automatic(getter/setter) propreties because as we know they are created at runtime whereas normal propreties ( field + getter/setter) already have their fields declared. Any small performance performance gain is important for me. Cheers and thanks. | c# | .net | visual-studio-2010 | clr | clr4.0 | 07/16/2012 09:43:32 | not constructive | Performance differences between automatic propreties and normally declared propreties. True or False?
===
there are many discussions about propreties everywhere i looked but can anyone point out the fact if we have any performance loss when we use automatic(getter/setter) propreties because as we know they are created at runtime whereas normal propreties ( field + getter/setter) already have their fields declared. Any small performance performance gain is important for me. Cheers and thanks. | 4 |
11,372,919 | 07/07/2012 06:47:43 | 760,838 | 03/29/2011 10:14:13 | 329 | 10 | How to remove from this Debugger warning | In my iphone app i have a login screen after loging in i am navigating to a class ( i have tab barcontroller with 5 tabs here)
like this i am programmatically creating the tabbar
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *arrControllers = [[NSMutableArray alloc] initWithCapacity:5];
//Add PunchClock to tab View Controller
PunchClock* objPunchClock = [[PunchClock alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objPunchClock];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objPunchClock release];
tabBarController .viewControllers = arrControllers;
[arrControllers release];
[self.view addSubview:[tabBarController view]];
after logging in while navigating to this class i am getting this Debugger warning
2012-07-07 12:09:27.988 WorkForce[1475:207] Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
2012-07-07 12:09:28.074 WorkForce[1475:207] Using two-stage rotation animation is not supported when rotating more than one view controller or view controllers not the window delegate
what is it mean,,,how to remove this warning? please help me out
| iphone | objective-c | ios | xcode | debugging | null | open | How to remove from this Debugger warning
===
In my iphone app i have a login screen after loging in i am navigating to a class ( i have tab barcontroller with 5 tabs here)
like this i am programmatically creating the tabbar
tabBarController = [[UITabBarController alloc] init];
NSMutableArray *arrControllers = [[NSMutableArray alloc] initWithCapacity:5];
//Add PunchClock to tab View Controller
PunchClock* objPunchClock = [[PunchClock alloc] initWithTabBar];
NavigationController = [[UINavigationController alloc] initWithRootViewController:objPunchClock];
NavigationController.navigationBar.tintColor = [UIColor brownColor];
[arrControllers addObject:NavigationController];
[NavigationController release];
[objPunchClock release];
tabBarController .viewControllers = arrControllers;
[arrControllers release];
[self.view addSubview:[tabBarController view]];
after logging in while navigating to this class i am getting this Debugger warning
2012-07-07 12:09:27.988 WorkForce[1475:207] Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
2012-07-07 12:09:28.074 WorkForce[1475:207] Using two-stage rotation animation is not supported when rotating more than one view controller or view controllers not the window delegate
what is it mean,,,how to remove this warning? please help me out
| 0 |
11,372,999 | 07/07/2012 07:02:56 | 760,150 | 05/19/2011 00:22:35 | 1 | 1 | How to test if a string is a substring of any instance of a regex? | In any programming language and library,
How can you test if a string is a substring of any instance of a regular expression?
For example, all the instances of the regex
RA = /^a{1,2}c{1,2}$/
are
'ac', 'acc', 'aac', 'aacc'.
The string 'cc' is not an instance of the regex but is a substring of two instances of the regex. How can you test that 'c' has such a property?
Equivalently, how can you get (in general) a regex whose instances are all substrings of any instances of another regex.
For the example above, the regex
RB = /^a{0,2}c{0,2}$/
has the instances
'', 'c', 'cc', 'a', 'ac', 'acc', 'aa', 'aac', 'aacc'
which are all the substrings of the instances of RA.
How can you calculate such a RB from RA for any regex RA?
Thanks in advance!
| regex | substring | instance | null | null | null | open | How to test if a string is a substring of any instance of a regex?
===
In any programming language and library,
How can you test if a string is a substring of any instance of a regular expression?
For example, all the instances of the regex
RA = /^a{1,2}c{1,2}$/
are
'ac', 'acc', 'aac', 'aacc'.
The string 'cc' is not an instance of the regex but is a substring of two instances of the regex. How can you test that 'c' has such a property?
Equivalently, how can you get (in general) a regex whose instances are all substrings of any instances of another regex.
For the example above, the regex
RB = /^a{0,2}c{0,2}$/
has the instances
'', 'c', 'cc', 'a', 'ac', 'acc', 'aa', 'aac', 'aacc'
which are all the substrings of the instances of RA.
How can you calculate such a RB from RA for any regex RA?
Thanks in advance!
| 0 |
11,373,002 | 07/07/2012 07:03:24 | 1,191,938 | 02/06/2012 09:27:03 | 56 | 1 | Read from a file containing integers - java | I am trying to read from a file that contains three numbers. The file looks like this:
45
20
32
My code is below:
try {
FileReader file = new FileReader("temperature.txt");
BufferedReader buf = new BufferedReader(file);
int i = 0;
String s = null;
while((s = buf.readLine()) != null){
fileValues[i] = Integer.parseInt(s);
i++;
}
}catch (Exception e){e.printStackTrace();}
The program compiles alright and gives no errors. But when I output the contents of the array fileValues I get:
0
0
0
Any help would be appreciated. Thanks! | java | arrays | file-io | null | null | null | open | Read from a file containing integers - java
===
I am trying to read from a file that contains three numbers. The file looks like this:
45
20
32
My code is below:
try {
FileReader file = new FileReader("temperature.txt");
BufferedReader buf = new BufferedReader(file);
int i = 0;
String s = null;
while((s = buf.readLine()) != null){
fileValues[i] = Integer.parseInt(s);
i++;
}
}catch (Exception e){e.printStackTrace();}
The program compiles alright and gives no errors. But when I output the contents of the array fileValues I get:
0
0
0
Any help would be appreciated. Thanks! | 0 |
11,373,009 | 07/07/2012 07:04:31 | 242,042 | 01/01/2010 20:58:20 | 909 | 93 | Should I use POM first or MANIFEST first when developing OSGi application with Maven? | There are two main approaches when developing an OSGi application with Maven: POM-first and MANIFEST first.
I'm looking for an answer that is in a form of a table that shows pros and cons of each method.
To be more specific, I would also like to know how it relates to:
* Maturity of toolset
* Vendor independence
* Development ease (which includes finding people who can do the development on the tooling)
* Compatibility
* Avoiding ClassNotFound
* Avoiding manual work | maven | osgi | tycho | maven-bundle-plugin | null | null | open | Should I use POM first or MANIFEST first when developing OSGi application with Maven?
===
There are two main approaches when developing an OSGi application with Maven: POM-first and MANIFEST first.
I'm looking for an answer that is in a form of a table that shows pros and cons of each method.
To be more specific, I would also like to know how it relates to:
* Maturity of toolset
* Vendor independence
* Development ease (which includes finding people who can do the development on the tooling)
* Compatibility
* Avoiding ClassNotFound
* Avoiding manual work | 0 |
11,373,013 | 07/07/2012 07:04:57 | 834,239 | 07/07/2011 19:35:42 | 172 | 0 | How to pass Django variable as javascript method parameter? | I have a following `extra_context` in my views.py.
extra_context = {
'user': list_user,
'time': str(list_time),
'latlng': list_latlng
}
All of the above variables are datatype of `python list`. Now i want to use these variable in Gmap v3 javascript. I found a following snippet for google map: (posting the main part)
<script type="text/javascript">
var map ;
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 2,
center: latlng,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var flightPlanCoordinates = [ {% for ip in latlng %}{{ ip }}{% endfor %}];
for(var i in flightPlanCoordinates){
var marker = add_marker(flightPlanCoordinates[i][0], flightPlanCoordinates[i][1],"Some title!","html for info box");
marker.setMap(map);
}
}
function add_marker(lat,lng,title,box_html) {
var infowindow = new google.maps.InfoWindow({
content: box_html
});
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat,lng),
map: map,
title: title
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
return marker;
}
The above code shows a marker accoriding to the `latlng` list passed from the context. But the problem is occurring at that time when i also tried to pass `time and user` with the same way. It shows nothing on the Map. By the way i tried with this coide:
var user = [{% for i in user %}{{ i }}{% endfor %}];
var timestamp = [{% for y in time %}{{ y }}{% endfor %}];
Is that the right way? I am new in javascript i wrote according the `latlng` code.
I tried with `alert(timestamp)`. Nothing happens :(
Another problem is i have to pass these three parameter to `add_marker`
java script method. TO do this i have to run three for loop concurrently. Posting the pseudo code:
var user = [{% for i in user %}{{ i }}{% endfor %}];
var timestamp = [{% for y in time %}{{ y }}{% endfor %}];
var flightPlanCoordinates = [ {% for ip in latlng %}{{ ip }}{% endfor %}];
for (var in flightPlanCoordinates) and for (a in timestamp) and for(b in user)
{
var marker = add_marker(flightPlanCoordinates[i][0], flightPlanCoordinates[i][1],b,a);
marker.setMap(map); | python | google-maps | google-maps-api-3 | django-templates | django-views | null | open | How to pass Django variable as javascript method parameter?
===
I have a following `extra_context` in my views.py.
extra_context = {
'user': list_user,
'time': str(list_time),
'latlng': list_latlng
}
All of the above variables are datatype of `python list`. Now i want to use these variable in Gmap v3 javascript. I found a following snippet for google map: (posting the main part)
<script type="text/javascript">
var map ;
function initialize() {
var latlng = new google.maps.LatLng(-34.397, 150.644);
var myOptions = {
zoom: 2,
center: latlng,
mapTypeId: google.maps.MapTypeId.TERRAIN
};
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var flightPlanCoordinates = [ {% for ip in latlng %}{{ ip }}{% endfor %}];
for(var i in flightPlanCoordinates){
var marker = add_marker(flightPlanCoordinates[i][0], flightPlanCoordinates[i][1],"Some title!","html for info box");
marker.setMap(map);
}
}
function add_marker(lat,lng,title,box_html) {
var infowindow = new google.maps.InfoWindow({
content: box_html
});
var marker = new google.maps.Marker({
position: new google.maps.LatLng(lat,lng),
map: map,
title: title
});
google.maps.event.addListener(marker, 'click', function() {
infowindow.open(map,marker);
});
return marker;
}
The above code shows a marker accoriding to the `latlng` list passed from the context. But the problem is occurring at that time when i also tried to pass `time and user` with the same way. It shows nothing on the Map. By the way i tried with this coide:
var user = [{% for i in user %}{{ i }}{% endfor %}];
var timestamp = [{% for y in time %}{{ y }}{% endfor %}];
Is that the right way? I am new in javascript i wrote according the `latlng` code.
I tried with `alert(timestamp)`. Nothing happens :(
Another problem is i have to pass these three parameter to `add_marker`
java script method. TO do this i have to run three for loop concurrently. Posting the pseudo code:
var user = [{% for i in user %}{{ i }}{% endfor %}];
var timestamp = [{% for y in time %}{{ y }}{% endfor %}];
var flightPlanCoordinates = [ {% for ip in latlng %}{{ ip }}{% endfor %}];
for (var in flightPlanCoordinates) and for (a in timestamp) and for(b in user)
{
var marker = add_marker(flightPlanCoordinates[i][0], flightPlanCoordinates[i][1],b,a);
marker.setMap(map); | 0 |
11,373,021 | 07/07/2012 07:06:23 | 1,340,736 | 04/18/2012 07:56:49 | 71 | 0 | confusion in union concept | #include<stdio.h>
union node {
int i;
char c[2];
};
main() {
union node n;
n.c[0] = 0;
n.c[1] = 2;
printf("%d\n", n.i);
return 0;
}
I think it gives `512` output becouse c[0] value stores in first byte and c[1] value stores in second byte, but gives `1965097472`. Why ?.
I compiled this program in codeblocks in windows. | c++ | c | unions | null | null | null | open | confusion in union concept
===
#include<stdio.h>
union node {
int i;
char c[2];
};
main() {
union node n;
n.c[0] = 0;
n.c[1] = 2;
printf("%d\n", n.i);
return 0;
}
I think it gives `512` output becouse c[0] value stores in first byte and c[1] value stores in second byte, but gives `1965097472`. Why ?.
I compiled this program in codeblocks in windows. | 0 |
11,373,027 | 07/07/2012 07:07:03 | 1,508,381 | 07/07/2012 07:02:29 | 1 | 0 | How to navigate between windows in java? | I am a new comer in java. Currently I am trying to make several small programs. Let me ask you a question: I want to close my present window (Frame) and open a new window when a particular button (say, "Next") is clicked in the present window.
Would you please tell me, how to do it?
Thanks. | java | null | null | null | null | 07/08/2012 13:17:14 | not a real question | How to navigate between windows in java?
===
I am a new comer in java. Currently I am trying to make several small programs. Let me ask you a question: I want to close my present window (Frame) and open a new window when a particular button (say, "Next") is clicked in the present window.
Would you please tell me, how to do it?
Thanks. | 1 |
11,650,521 | 07/25/2012 13:13:29 | 1,189,569 | 02/04/2012 16:22:28 | 1 | 0 | GCD Async Socket (TCP) using same socket on different view controllers | I am beginner with socket programming and objective c programming. I have application that is using GCDAsyncSocket library and I am initializing socket and connecting on Initial View Controller in my application. What I do not know is how to use that same socket (**from Initial View Controller) to write and read data on my Second View Controller?**
How to pass socket throughout the different views? | ios | null | null | null | null | null | open | GCD Async Socket (TCP) using same socket on different view controllers
===
I am beginner with socket programming and objective c programming. I have application that is using GCDAsyncSocket library and I am initializing socket and connecting on Initial View Controller in my application. What I do not know is how to use that same socket (**from Initial View Controller) to write and read data on my Second View Controller?**
How to pass socket throughout the different views? | 0 |
11,650,522 | 07/25/2012 13:13:30 | 1,519,058 | 07/11/2012 20:54:24 | 6 | 0 | xQuery, how to get text from node with childs? | `//div[@id="transactions"]/p` gives this output (from html content I'm trying to scrape):
http://i.stack.imgur.com/WgIQX.jpg
How this query can return a string like this (the content if each `<p>` in it's own line):
contentOfP1
contentOfP2
contentOfP3
...
Notice that each p have child nodes (`<strong>` and `<a>`) and text with no tags. when trying to retrieve all text from a specific `<p>`, it gives this:
http://i.stack.imgur.com/dEdBA.png
Thanks in advance :-)
ps:I put links only coz i'm not allowed yet to post images :( | xml | text | content | xquery | xmlnode | null | open | xQuery, how to get text from node with childs?
===
`//div[@id="transactions"]/p` gives this output (from html content I'm trying to scrape):
http://i.stack.imgur.com/WgIQX.jpg
How this query can return a string like this (the content if each `<p>` in it's own line):
contentOfP1
contentOfP2
contentOfP3
...
Notice that each p have child nodes (`<strong>` and `<a>`) and text with no tags. when trying to retrieve all text from a specific `<p>`, it gives this:
http://i.stack.imgur.com/dEdBA.png
Thanks in advance :-)
ps:I put links only coz i'm not allowed yet to post images :( | 0 |
11,650,523 | 07/25/2012 13:13:33 | 960,537 | 09/23/2011 06:35:39 | 46 | 0 | How to track a request,if it coming from my company or from out my company | I am designing an application where i need to redirect my company user without asking them to Login and if an external person is trying to use the website, i need to ask them Userid and password.
How can this be implemented using c# and MVC3. | javascript | asp.net-mvc-3 | c#-4.0 | asp.net-web-api | null | 07/28/2012 10:56:07 | not a real question | How to track a request,if it coming from my company or from out my company
===
I am designing an application where i need to redirect my company user without asking them to Login and if an external person is trying to use the website, i need to ask them Userid and password.
How can this be implemented using c# and MVC3. | 1 |
11,650,438 | 07/25/2012 13:08:17 | 943,648 | 09/14/2011 00:54:16 | 232 | 4 | Replace SELECT INTO statement with a cursor ORACLE | This is the querry
How to Replace SELECT INTO statement with a cursor ?
I'm newbie in Oracle
Thanks for your help
SELECT CEQ_LISTE_TYPE_QUESTIONS.ID_LISTE_TYPE_QUESTION
INTO vintIdListeTypeQuestion
FROM CEQ_FORMULAIRES
inner join CEQ_LISTE_TYPE_QUESTIONS on CEQ_LISTE_TYPE_QUESTIONS.ID_LISTE_TYPE_FORMULAIRE=CEQ_FORMULAIRES.ID_TYPE_FORMULAIRE AND CEQ_LISTE_TYPE_QUESTIONS.WEBCODE='ITEM_BETA_LACTAMASE'
WHERE CEQ_FORMULAIRES.ID_FORMULAIRE=to_number(out_rec.ID_FORMULAIRE) and ceq_formulaires.date_inactive is null;
| oracle | plsql | null | null | null | null | open | Replace SELECT INTO statement with a cursor ORACLE
===
This is the querry
How to Replace SELECT INTO statement with a cursor ?
I'm newbie in Oracle
Thanks for your help
SELECT CEQ_LISTE_TYPE_QUESTIONS.ID_LISTE_TYPE_QUESTION
INTO vintIdListeTypeQuestion
FROM CEQ_FORMULAIRES
inner join CEQ_LISTE_TYPE_QUESTIONS on CEQ_LISTE_TYPE_QUESTIONS.ID_LISTE_TYPE_FORMULAIRE=CEQ_FORMULAIRES.ID_TYPE_FORMULAIRE AND CEQ_LISTE_TYPE_QUESTIONS.WEBCODE='ITEM_BETA_LACTAMASE'
WHERE CEQ_FORMULAIRES.ID_FORMULAIRE=to_number(out_rec.ID_FORMULAIRE) and ceq_formulaires.date_inactive is null;
| 0 |
11,650,529 | 07/25/2012 13:14:00 | 84,704 | 03/30/2009 16:06:27 | 16,536 | 558 | Diagnosing and fixing access violation in TControl.Perform where no user-written code is involved in the current call stack? | I have a delphi 2007 application that is having periodic access violations in TControl.Perform method from the standard VCL unit Controls.pas. The call stack looks like this:
exception message : Access violation at address 00000000. Read of address 00000000.
Main ($1cac):
00000000 +000 ???
004cd644 +024 mainexe.exe Controls 5021 +5 TControl.Perform
004ce705 +015 mainexe.exe Controls 5542 +2 TControl.CMMouseEnter
004cd9b7 +2bb mainexe.exe Controls 5146 +83 TControl.WndProc
004d19bb +4fb mainexe.exe Controls 7304 +111 TWinControl.WndProc
004a8ff8 +06c mainexe.exe StdCtrls 3684 +13 TButtonControl.WndProc
004cd644 +024 mainexe.exe Controls 5021 +5 TControl.Perform
004d182b +36b mainexe.exe Controls 7255 +62 TWinControl.WndProc
004a8ff8 +06c mainexe.exe StdCtrls 3684 +13 TButtonControl.WndProc
004d10e4 +02c mainexe.exe Controls 7073 +3 TWinControl.MainWndProc
0048af08 +014 mainexe.exe Classes 11583 +8 StdWndProc
75ce7bc5 +00a USER32.dll DispatchMessageA
004ecaf4 +0fc mainexe.exe Forms 8105 +23 TApplication.ProcessMessage
004ecb2e +00a mainexe.exe Forms 8124 +1 TApplication.HandleMessage
004ece23 +0b3 mainexe.exe Forms 8223 +20 TApplication.Run
0136cac7 +383 mainexe.exe mainexe 326 +45 initialization
75563398 +010 kernel32.dll BaseThreadInitThunk
I am unable to reproduce it in the office, so I only get the call stacks from customers directly, via MadExcept.
I am not sure how to diagnose or otherwise determine the cause, and then correct a fault that occurs this way. I'm hoping someone has seen this "TControl.Perform" style of access violation, and has some idea on the root causes.
My #1 suspicion is that a form has been "freed" by some other area of my code, and that a window message is being processed, and that TControl (as a base class of some real control in some real form) is simply failing because Self is nil, or some resource like the window handle is invalid.
I'm looking for a technique that will help me diagnose this problem, that can be executed on a client's computer, without access to the delphi debugger. Thoughts I've had include adding some logging (but what?) or even running WinDbg (the windows SDK debugger tool) on the client's machine.
| delphi | delphi-2007 | access-violation | null | null | null | open | Diagnosing and fixing access violation in TControl.Perform where no user-written code is involved in the current call stack?
===
I have a delphi 2007 application that is having periodic access violations in TControl.Perform method from the standard VCL unit Controls.pas. The call stack looks like this:
exception message : Access violation at address 00000000. Read of address 00000000.
Main ($1cac):
00000000 +000 ???
004cd644 +024 mainexe.exe Controls 5021 +5 TControl.Perform
004ce705 +015 mainexe.exe Controls 5542 +2 TControl.CMMouseEnter
004cd9b7 +2bb mainexe.exe Controls 5146 +83 TControl.WndProc
004d19bb +4fb mainexe.exe Controls 7304 +111 TWinControl.WndProc
004a8ff8 +06c mainexe.exe StdCtrls 3684 +13 TButtonControl.WndProc
004cd644 +024 mainexe.exe Controls 5021 +5 TControl.Perform
004d182b +36b mainexe.exe Controls 7255 +62 TWinControl.WndProc
004a8ff8 +06c mainexe.exe StdCtrls 3684 +13 TButtonControl.WndProc
004d10e4 +02c mainexe.exe Controls 7073 +3 TWinControl.MainWndProc
0048af08 +014 mainexe.exe Classes 11583 +8 StdWndProc
75ce7bc5 +00a USER32.dll DispatchMessageA
004ecaf4 +0fc mainexe.exe Forms 8105 +23 TApplication.ProcessMessage
004ecb2e +00a mainexe.exe Forms 8124 +1 TApplication.HandleMessage
004ece23 +0b3 mainexe.exe Forms 8223 +20 TApplication.Run
0136cac7 +383 mainexe.exe mainexe 326 +45 initialization
75563398 +010 kernel32.dll BaseThreadInitThunk
I am unable to reproduce it in the office, so I only get the call stacks from customers directly, via MadExcept.
I am not sure how to diagnose or otherwise determine the cause, and then correct a fault that occurs this way. I'm hoping someone has seen this "TControl.Perform" style of access violation, and has some idea on the root causes.
My #1 suspicion is that a form has been "freed" by some other area of my code, and that a window message is being processed, and that TControl (as a base class of some real control in some real form) is simply failing because Self is nil, or some resource like the window handle is invalid.
I'm looking for a technique that will help me diagnose this problem, that can be executed on a client's computer, without access to the delphi debugger. Thoughts I've had include adding some logging (but what?) or even running WinDbg (the windows SDK debugger tool) on the client's machine.
| 0 |
11,650,534 | 07/25/2012 13:14:10 | 1,551,670 | 07/25/2012 12:54:44 | 1 | 0 | How to change the image preview from the custom view Pallete in Eclipse? | I've made some custom views for Android using Eclipse and i was wondering if is it possible to change that default image preview from the "Custom & Library Views" Palette
Thanks | android | eclipse | android-widget | custom-view | null | null | open | How to change the image preview from the custom view Pallete in Eclipse?
===
I've made some custom views for Android using Eclipse and i was wondering if is it possible to change that default image preview from the "Custom & Library Views" Palette
Thanks | 0 |
10,101,699 | 04/11/2012 07:32:07 | 339,946 | 05/13/2010 04:57:26 | 400 | 4 | Do locally created objects get released when their ViewController is dismissed? | I'm throwing up around 50 UIImageViews into a view via a loop, looks something like this (Photo is just my subclass):
Photo *photoImage = [[Photo alloc] initWithImage:photo];
[self.view addSubview:photoImage];
My current design flow uses the `presentViewController` and `dismissViewController` to move along views. When this I decide to dismiss this view, are these objects removed from memory and cleaned up? Also, are my array objects removed when the viewController is dismissed, or am I suppose to be using viewDidUnload?
I'm using ARC btw. Thanks
| iphone | ios | xcode | ipad | null | null | open | Do locally created objects get released when their ViewController is dismissed?
===
I'm throwing up around 50 UIImageViews into a view via a loop, looks something like this (Photo is just my subclass):
Photo *photoImage = [[Photo alloc] initWithImage:photo];
[self.view addSubview:photoImage];
My current design flow uses the `presentViewController` and `dismissViewController` to move along views. When this I decide to dismiss this view, are these objects removed from memory and cleaned up? Also, are my array objects removed when the viewController is dismissed, or am I suppose to be using viewDidUnload?
I'm using ARC btw. Thanks
| 0 |
11,649,865 | 07/25/2012 12:37:08 | 350,421 | 05/25/2010 23:29:40 | 94 | 10 | Getting both or one Checkbox value in for each loop | I have a form that the user can submit either 1 or 2 checked boxes. It must be at least 1. The checkbox setup looks like so:
<input name="request['+fields+'][Type of Folder:]"
id="cbpathCDB'+fields+'" type="checkbox"
value="Content Database" class="cbShowPath required" data-id="'+fields+'"/>
<input name="request['+fields+'][Type of Folder:]"
id="cbpathEFS'+fields+'" type="checkbox"
value="File System" class="efsShowPath required" data-id="'+fields+'"/>
There is other inputs that are also being submitted, so I am using this for each:
$a=$_REQUEST['request'];
foreach ($a as $name) {
foreach ($name as $key => $desc) {
if ($desc !== '') {
$note.= $key;
$note.= $desc;
}
}
}
This gets all the data fine if the user checks ONE checkbox, but if the user checks both checkboxes, only the value of the FIRST checkbox is shown.
What do I need to do here in order to get both values? | php | checkbox | foreach | null | null | null | open | Getting both or one Checkbox value in for each loop
===
I have a form that the user can submit either 1 or 2 checked boxes. It must be at least 1. The checkbox setup looks like so:
<input name="request['+fields+'][Type of Folder:]"
id="cbpathCDB'+fields+'" type="checkbox"
value="Content Database" class="cbShowPath required" data-id="'+fields+'"/>
<input name="request['+fields+'][Type of Folder:]"
id="cbpathEFS'+fields+'" type="checkbox"
value="File System" class="efsShowPath required" data-id="'+fields+'"/>
There is other inputs that are also being submitted, so I am using this for each:
$a=$_REQUEST['request'];
foreach ($a as $name) {
foreach ($name as $key => $desc) {
if ($desc !== '') {
$note.= $key;
$note.= $desc;
}
}
}
This gets all the data fine if the user checks ONE checkbox, but if the user checks both checkboxes, only the value of the FIRST checkbox is shown.
What do I need to do here in order to get both values? | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.