PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 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 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,341,265 | 12/01/2011 12:17:39 | 908,984 | 08/24/2011 06:03:26 | 8 | 0 | apply color correction for multiple images in photoshop | apply color correction for multiple images in Photoshop?
I have edited a image in Photoshop by changing color, brightness and many things.
Now i have to apply the same changes in another image.
but i forgot the values which i have changed.
Is there possible to copy the properties to another image?. if it does >please guide me.
give me some tutorial for this process..
thanks in advance,
GANESH M | image | colors | photoshop | adjustment | color-codes | 12/02/2011 23:01:23 | off topic | apply color correction for multiple images in photoshop
===
apply color correction for multiple images in Photoshop?
I have edited a image in Photoshop by changing color, brightness and many things.
Now i have to apply the same changes in another image.
but i forgot the values which i have changed.
Is there possible to copy the properties to another image?. if it does >please guide me.
give me some tutorial for this process..
thanks in advance,
GANESH M | 2 |
1,439,190 | 09/17/2009 14:18:36 | 27,826 | 10/14/2008 12:42:33 | 848 | 31 | Mocking a DataServiceQuery<TElement> | **How can I mock a DataServiceQuery<TElement> for unit testing purpose?**
Long Details follow:
Imagine an ASP.NET MVC application, where the controller talks to an ADO.NET DataService that encapsulates the storage of our models (for example sake we'll be reading a list of Customers). With a reference to the service, we get a generated class inheriting from DataServiceContext:
namespace Sample.Services
{
public partial class MyDataContext : global::System.Data.Services.Client.DataServiceContext
{
public MyDataContext(global::System.Uri serviceRoot) : base(serviceRoot) { /* ... */ }
public global::System.Data.Services.Client.DataServiceQuery<Customer> Customers
{
get
{
if((this._Customers==null))
{
this._Customers = base.CreateQuery<Customer>("Customers");
}
return this._Customers;
}
}
/* and many more members */
}
}
The Controller could be:
namespace Sample.Controllers
{
public class CustomerController : Controller
{
private IMyDataContext context;
public CustomerController(IMyDataContext context)
{
this.context=context;
}
public ActionResult Index() { return View(context.Customers); }
}
}
As you can see, I used a constructor that accepts an IMyDataContext instance so that we can use a mock in our unit test:
[TestFixture]
public class TestCustomerController
{
[Test]
public void Test_Index()
{
MockContext mockContext = new MockContext();
CustomerController controller = new CustomerController(mockContext);
var customersToReturn = new List<Customer>
{
new Customer{ Id=1, Name="Fred" },
new Customer{ Id=2, Name="Wilma" }
};
mockContext.CustomersToReturn = customersToReturn;
var result = controller.Index() as ViewResult;
var models = result.ViewData.Model;
//Now we have to compare the Customers in models with those in customersToReturn,
//Maybe by loopping over them?
foreach(Customer c in models) //*** LINE A ***
{
//TODO: compare with the Customer in the same position from customersToreturn
}
}
}
MockContext and MyDataContext need to implement the same interface IMyDataContext:
namespace Sample.Services
{
public interface IMyDataContext
{
DataServiceQuery<Customer> Customers { get; }
/* and more */
}
}
However, when we try and implement the MockContext class, we run into problems due to the nature of DataServiceQuery (which, to be clear, we're using in the IMyDataContext interface simply because that's the data type we found in the auto-generated MyDataContext class that we started with). If we try to write:
public class MockContext : IMyDataContext
{
public IList<Customer> CustomersToReturn { set; private get; }
public DataServiceQuery<Customer> Customers { get { /* ??? */ } }
}
In the Customers getter we'd like to instantiate a DataServiceQuery<Customer> instance, populate it with the Customers in CustomersToReturn, and return it. The problems I run into:
**1~** DataServiceQuery<TElement> has no public constructor; to instantiate one you should call CreateQuery<T> on a DataServiceContext; see [MSDN](http://msdn.microsoft.com/en-us/library/cc646677.aspx)
**2~** If I make the MockContext inherit from DataServiceContext as well, and call CreateQuery<T> to get a DataServiceQuery to use, the service and query have to be tied to a valid URI and, when I try to iterate or access the objects in the query, it will try and execute against that URI. In other words, if I change the MockContext as such:
namespace Sample.Tests.Controllers.Mocks
{
public class MockContext : DataServiceContext, IMyDataContext
{
public MockContext() :base(new Uri("http://www.contoso.com")) { }
public IList<Customer> CustomersToReturn { set; private get; }
public DataServiceQuery<Customer> Customers
{
get
{
var query = CreateQuery<Customer>("Customers");
query.Concat(CustomersToReturn.AsEnumerable<Customer>());
return query;
}
}
}
}
Then, in the unit test, we get an error on the line marked as LINE A, because http://www.contoso.com doesn't host our service. The same error is triggered even if LINE A tries to get the number of elements in models.
Thanks in advance.
| asp.net | mvc | mocking | wcf-data-services | null | null | open | Mocking a DataServiceQuery<TElement>
===
**How can I mock a DataServiceQuery<TElement> for unit testing purpose?**
Long Details follow:
Imagine an ASP.NET MVC application, where the controller talks to an ADO.NET DataService that encapsulates the storage of our models (for example sake we'll be reading a list of Customers). With a reference to the service, we get a generated class inheriting from DataServiceContext:
namespace Sample.Services
{
public partial class MyDataContext : global::System.Data.Services.Client.DataServiceContext
{
public MyDataContext(global::System.Uri serviceRoot) : base(serviceRoot) { /* ... */ }
public global::System.Data.Services.Client.DataServiceQuery<Customer> Customers
{
get
{
if((this._Customers==null))
{
this._Customers = base.CreateQuery<Customer>("Customers");
}
return this._Customers;
}
}
/* and many more members */
}
}
The Controller could be:
namespace Sample.Controllers
{
public class CustomerController : Controller
{
private IMyDataContext context;
public CustomerController(IMyDataContext context)
{
this.context=context;
}
public ActionResult Index() { return View(context.Customers); }
}
}
As you can see, I used a constructor that accepts an IMyDataContext instance so that we can use a mock in our unit test:
[TestFixture]
public class TestCustomerController
{
[Test]
public void Test_Index()
{
MockContext mockContext = new MockContext();
CustomerController controller = new CustomerController(mockContext);
var customersToReturn = new List<Customer>
{
new Customer{ Id=1, Name="Fred" },
new Customer{ Id=2, Name="Wilma" }
};
mockContext.CustomersToReturn = customersToReturn;
var result = controller.Index() as ViewResult;
var models = result.ViewData.Model;
//Now we have to compare the Customers in models with those in customersToReturn,
//Maybe by loopping over them?
foreach(Customer c in models) //*** LINE A ***
{
//TODO: compare with the Customer in the same position from customersToreturn
}
}
}
MockContext and MyDataContext need to implement the same interface IMyDataContext:
namespace Sample.Services
{
public interface IMyDataContext
{
DataServiceQuery<Customer> Customers { get; }
/* and more */
}
}
However, when we try and implement the MockContext class, we run into problems due to the nature of DataServiceQuery (which, to be clear, we're using in the IMyDataContext interface simply because that's the data type we found in the auto-generated MyDataContext class that we started with). If we try to write:
public class MockContext : IMyDataContext
{
public IList<Customer> CustomersToReturn { set; private get; }
public DataServiceQuery<Customer> Customers { get { /* ??? */ } }
}
In the Customers getter we'd like to instantiate a DataServiceQuery<Customer> instance, populate it with the Customers in CustomersToReturn, and return it. The problems I run into:
**1~** DataServiceQuery<TElement> has no public constructor; to instantiate one you should call CreateQuery<T> on a DataServiceContext; see [MSDN](http://msdn.microsoft.com/en-us/library/cc646677.aspx)
**2~** If I make the MockContext inherit from DataServiceContext as well, and call CreateQuery<T> to get a DataServiceQuery to use, the service and query have to be tied to a valid URI and, when I try to iterate or access the objects in the query, it will try and execute against that URI. In other words, if I change the MockContext as such:
namespace Sample.Tests.Controllers.Mocks
{
public class MockContext : DataServiceContext, IMyDataContext
{
public MockContext() :base(new Uri("http://www.contoso.com")) { }
public IList<Customer> CustomersToReturn { set; private get; }
public DataServiceQuery<Customer> Customers
{
get
{
var query = CreateQuery<Customer>("Customers");
query.Concat(CustomersToReturn.AsEnumerable<Customer>());
return query;
}
}
}
}
Then, in the unit test, we get an error on the line marked as LINE A, because http://www.contoso.com doesn't host our service. The same error is triggered even if LINE A tries to get the number of elements in models.
Thanks in advance.
| 0 |
11,255,064 | 06/29/2012 01:40:16 | 420,540 | 08/14/2010 18:13:20 | 139 | 3 | wait for gdb to attach | I've been using gdb normally for 1 or 2 projects. I.e. I invoke `gdb --args prog args` . gdb runs in the same tty as the program I'm debugging.
However my latest project is modifying the dtach utility. This is a program like screen, so the tty's are redirected elsewhere, thus I have to use gdb's attach functionality.
The problem with gdb attach is that obviously you can't attach from the very beginning as you need to run the program first in order to get a pid to attach to.
Is there any way I can get a program to wait at a point until gdb is attached?
I can't use gdbserver as I'm on cygwin. Also I tried using `pause()`, but that just hung when I tried to continue. | c | debugging | gdb | cygwin | null | null | open | wait for gdb to attach
===
I've been using gdb normally for 1 or 2 projects. I.e. I invoke `gdb --args prog args` . gdb runs in the same tty as the program I'm debugging.
However my latest project is modifying the dtach utility. This is a program like screen, so the tty's are redirected elsewhere, thus I have to use gdb's attach functionality.
The problem with gdb attach is that obviously you can't attach from the very beginning as you need to run the program first in order to get a pid to attach to.
Is there any way I can get a program to wait at a point until gdb is attached?
I can't use gdbserver as I'm on cygwin. Also I tried using `pause()`, but that just hung when I tried to continue. | 0 |
5,915,085 | 05/06/2011 17:46:33 | 585,472 | 01/22/2011 09:33:07 | 11 | 0 | how much time does it take to crack a 24bit wep IV's to repeat?? | consider a busy access point that sends 1500bytes packets at IEEE802.11b data rate of 11Mbps.How long does the attacker have to wait for 24-bit WEP IVs to start repeating? iF The IVs are generated randomly how long does an attacker have to wait on an average for the first collision (two packets encrypted with the same IV)? | security | null | null | null | null | 05/06/2011 18:17:46 | off topic | how much time does it take to crack a 24bit wep IV's to repeat??
===
consider a busy access point that sends 1500bytes packets at IEEE802.11b data rate of 11Mbps.How long does the attacker have to wait for 24-bit WEP IVs to start repeating? iF The IVs are generated randomly how long does an attacker have to wait on an average for the first collision (two packets encrypted with the same IV)? | 2 |
11,346,485 | 07/05/2012 14:31:22 | 127,856 | 06/23/2009 21:11:34 | 1,292 | 59 | Jenkins multi-configuration job and MSBuild | I'm looking for a way to pass user-defined axis values to a free-style job that uses MSBuild. Let me explain.
So we have JobA which is a multi-configuration project that only has one axis (key1) and multiple value (foo and bar). I also have a free-style job called JobB which uses MSBuild to _build_ a specific project within a solution.
I was wondering how I could pass the values (foo and bar) of the axis (key1) of JobA to JobB so that JobB could use it in the command line arguments of the MSBuild plugin.
Thanks | continuous-integration | hudson | jenkins | null | null | null | open | Jenkins multi-configuration job and MSBuild
===
I'm looking for a way to pass user-defined axis values to a free-style job that uses MSBuild. Let me explain.
So we have JobA which is a multi-configuration project that only has one axis (key1) and multiple value (foo and bar). I also have a free-style job called JobB which uses MSBuild to _build_ a specific project within a solution.
I was wondering how I could pass the values (foo and bar) of the axis (key1) of JobA to JobB so that JobB could use it in the command line arguments of the MSBuild plugin.
Thanks | 0 |
5,098,684 | 02/23/2011 23:34:03 | 631,295 | 02/23/2011 23:14:46 | 1 | 0 | mysql not reverse sorting datetime field correctly | I am trying to sort a datetime field in descending order. It is sorting by day just fine. However, the time part is random. It sorts in ascending order perfectly.
Sample query:
<code>SELECT * FROM pcvisit WHERE page_id='0005e1ca1784383bf6bf032f33dc6e27' ORDER BY dtime DESC</code>
Result:
<pre>
4adbc6b1cab4f14e7c9f2e308eb0944e | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 16:08:35 | 1
733ab6507fbdab0e71f357f2f0ff6067 | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 07:24:12 | 1
a5f9c9810e9648d2dbe4dec0e785216c | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 05:26:59 | 1
981e24b4dd257f44a7a41dbdfe4def54 | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-22 09:07:12 | 3
67906b350d59e97d7f56b7ceb254857e | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-22 06:55:44 | 1
</pre>
I have also tried:
<code>SELECT * FROM pcvisit WHERE page_id='0005e1ca1784383bf6bf032f33dc6e27' ORDER BY dtime DESC, TIME(dtime) DESC</code>
Trying my best to not have to split it into 2 fields. | mysql | datetime | sorting | order-by | null | 06/23/2012 20:51:58 | too localized | mysql not reverse sorting datetime field correctly
===
I am trying to sort a datetime field in descending order. It is sorting by day just fine. However, the time part is random. It sorts in ascending order perfectly.
Sample query:
<code>SELECT * FROM pcvisit WHERE page_id='0005e1ca1784383bf6bf032f33dc6e27' ORDER BY dtime DESC</code>
Result:
<pre>
4adbc6b1cab4f14e7c9f2e308eb0944e | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 16:08:35 | 1
733ab6507fbdab0e71f357f2f0ff6067 | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 07:24:12 | 1
a5f9c9810e9648d2dbe4dec0e785216c | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-23 05:26:59 | 1
981e24b4dd257f44a7a41dbdfe4def54 | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-22 09:07:12 | 3
67906b350d59e97d7f56b7ceb254857e | 0005e1ca1784383bf6bf032f33dc6e27 | 2011-02-22 06:55:44 | 1
</pre>
I have also tried:
<code>SELECT * FROM pcvisit WHERE page_id='0005e1ca1784383bf6bf032f33dc6e27' ORDER BY dtime DESC, TIME(dtime) DESC</code>
Trying my best to not have to split it into 2 fields. | 3 |
11,125,714 | 06/20/2012 18:18:48 | 1,226,369 | 02/22/2012 16:37:13 | 6 | 4 | How can I animate a hover function that adds a class created by another script? | I am working from an existing template and I have gotten my menu to add the class ulDisplay to the list items and open the whole menu on hover. Now I would like to animate the action instead of it just popping open? The menu is four levels deep so the lines that find the children multiple levels deep are important.
here is the script:
$(document).ready(function() {
$('ul#nav-primary').hover(function() {
$(this).addClass("ulDisplay");
$(this).find('ul,li').removeClass("ulHide");
$(this).find('ul,li').addClass("ulDisplay");
},
function() {
$('ul#nav-primary').removeClass("ulDisplay");
$('ul#nav-primary').find('ul,li').removeClass("ulDisplay");
$('ul#nav-primary li').find('ul,li').addClass("ulHide");
})
}); | jquery | hover | find | animate | addclass | null | open | How can I animate a hover function that adds a class created by another script?
===
I am working from an existing template and I have gotten my menu to add the class ulDisplay to the list items and open the whole menu on hover. Now I would like to animate the action instead of it just popping open? The menu is four levels deep so the lines that find the children multiple levels deep are important.
here is the script:
$(document).ready(function() {
$('ul#nav-primary').hover(function() {
$(this).addClass("ulDisplay");
$(this).find('ul,li').removeClass("ulHide");
$(this).find('ul,li').addClass("ulDisplay");
},
function() {
$('ul#nav-primary').removeClass("ulDisplay");
$('ul#nav-primary').find('ul,li').removeClass("ulDisplay");
$('ul#nav-primary li').find('ul,li').addClass("ulHide");
})
}); | 0 |
6,960,510 | 08/05/2011 17:49:32 | 873,561 | 08/01/2011 22:04:08 | 1 | 0 | mod_rewrite works on ubuntu but not on centOS6 nor gentoo | i'm trying to configure `mod_rewrite` to make it work with codeigniter project where i have a `.htaccess` file with the following content:
RewriteEngine on
RewriteCond %{REQUEST_METHOD} !=POST
RewriteRule ^(.+)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [L]
wich works on `Ubuntu` but not on `CentOS6` nor `Gentoo`, does anyone knows what's wrong here?
Thanks in advanced :) | regex | apache | http | mod-rewrite | centos | 08/06/2011 18:42:02 | off topic | mod_rewrite works on ubuntu but not on centOS6 nor gentoo
===
i'm trying to configure `mod_rewrite` to make it work with codeigniter project where i have a `.htaccess` file with the following content:
RewriteEngine on
RewriteCond %{REQUEST_METHOD} !=POST
RewriteRule ^(.+)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?/$1 [L]
wich works on `Ubuntu` but not on `CentOS6` nor `Gentoo`, does anyone knows what's wrong here?
Thanks in advanced :) | 2 |
1,600,874 | 10/21/2009 13:32:33 | 93,468 | 02/03/2009 22:24:01 | 877 | 31 | Radiobutton.Checked not working for first button in group | I've got a check for the first radiobutton in my group of ASP.NET radiobuttons. For some reason, the page loads and that first button is automatically checked, not that we're setting it to be checked..it must naturally check itself since it's the first in the group.
However, when I actually check that it's checked in an if statement (so that I can act on it) it returns false even though it's checked for sure when the page renders
`myRadioButton.Checked` ends up with false. Not sure why. | asp.net | null | null | null | null | null | open | Radiobutton.Checked not working for first button in group
===
I've got a check for the first radiobutton in my group of ASP.NET radiobuttons. For some reason, the page loads and that first button is automatically checked, not that we're setting it to be checked..it must naturally check itself since it's the first in the group.
However, when I actually check that it's checked in an if statement (so that I can act on it) it returns false even though it's checked for sure when the page renders
`myRadioButton.Checked` ends up with false. Not sure why. | 0 |
7,318,146 | 09/06/2011 10:04:29 | 739,095 | 05/05/2011 03:04:25 | 3 | 2 | Java Book Suggestion for Elementary School Children (4th Grader) | Here's a programming issue that hit me from left field.
I just sent my 9-year-old to computer camp for the 1st time. He came back excited to program, which was my goal. They taught him in a high-level educational language that I had never heard of before, which is fine, except that if I want to help him continue to program, I need to learn that language or teach him a language that I already know, i.e., Java. At 1500 pages, my favorite Java book is a bit much for him to lift, let alone read.
Does anyone have a recommendation for a beginners Java book and/or curriculum that is appropriate for a 4th-grader?
Thanks. | java | education | null | null | null | 09/27/2011 06:13:17 | off topic | Java Book Suggestion for Elementary School Children (4th Grader)
===
Here's a programming issue that hit me from left field.
I just sent my 9-year-old to computer camp for the 1st time. He came back excited to program, which was my goal. They taught him in a high-level educational language that I had never heard of before, which is fine, except that if I want to help him continue to program, I need to learn that language or teach him a language that I already know, i.e., Java. At 1500 pages, my favorite Java book is a bit much for him to lift, let alone read.
Does anyone have a recommendation for a beginners Java book and/or curriculum that is appropriate for a 4th-grader?
Thanks. | 2 |
8,833,543 | 01/12/2012 10:30:16 | 1,065,489 | 11/25/2011 11:02:31 | 7 | 14 | Dynamically Resize div using mouse | I want to have a div tag with resize capability using mouse. I mean when I mousedown on any of the corner of the div and drag the mouse then the div should be resized according to the mouse movement. And when I leave the mouse button the div should have this size permanently.
Thank You | javascript | html | css | resize | null | 01/12/2012 16:43:26 | not a real question | Dynamically Resize div using mouse
===
I want to have a div tag with resize capability using mouse. I mean when I mousedown on any of the corner of the div and drag the mouse then the div should be resized according to the mouse movement. And when I leave the mouse button the div should have this size permanently.
Thank You | 1 |
5,272,639 | 03/11/2011 12:00:05 | 635,532 | 02/26/2011 13:20:21 | 11 | 8 | What are the best street / road image recognition libraries? | I am aware of OpenCV, but I am looking for more powerful alternatives, especially for detecting and tracking streets.
| opencv | computer-vision | null | null | null | 09/19/2011 16:39:15 | not constructive | What are the best street / road image recognition libraries?
===
I am aware of OpenCV, but I am looking for more powerful alternatives, especially for detecting and tracking streets.
| 4 |
7,430,657 | 09/15/2011 12:17:25 | 650,574 | 03/08/2011 22:06:49 | 79 | 3 | how to develop web app to sell online | I have made a booking system for online ticket reservations, but they cant pay online! so I now I have a client that he wants me to make them able to pay tickets online. The problem is that I have never worked with ecommerce before. Is there any good book or tutorial how to start with developing for banks? because my client is going to choose the bank that will give me the gateway to make the transactions. What is the first thing to do? are there any instructions from the bank, how to setup the gateway? or they will help me? or I must know all this by myself? what are your recommendations?
Thank you for your time and help. | php | e-commerce | banking | null | null | 09/15/2011 12:55:03 | not constructive | how to develop web app to sell online
===
I have made a booking system for online ticket reservations, but they cant pay online! so I now I have a client that he wants me to make them able to pay tickets online. The problem is that I have never worked with ecommerce before. Is there any good book or tutorial how to start with developing for banks? because my client is going to choose the bank that will give me the gateway to make the transactions. What is the first thing to do? are there any instructions from the bank, how to setup the gateway? or they will help me? or I must know all this by myself? what are your recommendations?
Thank you for your time and help. | 4 |
8,357,992 | 12/02/2011 14:44:01 | 1,077,577 | 12/02/2011 14:29:24 | 1 | 0 | Snowflakes schema of database for data quality assessment (Project Survey at different levels) | I am doing project related to Data Quality Assessment of projects at different levels.
I want the design of Dimensional Model SnowFlakes or Fact Constellation schema for Data Quality Assessment of projects at different hierarchical levels such as Branch, Regional and global levels of a company for my reference. Hopefully also some sample source code of such a website. Please help me my friends.
With Regards,
Naveen Kumar
| database | database-design | data-structures | data | null | 12/02/2011 15:02:04 | not a real question | Snowflakes schema of database for data quality assessment (Project Survey at different levels)
===
I am doing project related to Data Quality Assessment of projects at different levels.
I want the design of Dimensional Model SnowFlakes or Fact Constellation schema for Data Quality Assessment of projects at different hierarchical levels such as Branch, Regional and global levels of a company for my reference. Hopefully also some sample source code of such a website. Please help me my friends.
With Regards,
Naveen Kumar
| 1 |
4,080,533 | 11/02/2010 17:45:05 | 493,652 | 11/01/2010 14:05:39 | 3 | 0 | What's the most important in the long run... how a site looks, or how it actually functions? | Was having this debate with a friend recently.
If you only really had time to focus on **one or the other**, would you focus on how your site looked to pull most customers in and hap-hazardly botched together site architecture, navigation and a back-end.
Or would you be happy with a site with little or no design (like jacob neilson's), or a site that looks like a windows form, but does the job amazingly? | css | design | functionality | null | null | 11/02/2010 17:49:28 | off topic | What's the most important in the long run... how a site looks, or how it actually functions?
===
Was having this debate with a friend recently.
If you only really had time to focus on **one or the other**, would you focus on how your site looked to pull most customers in and hap-hazardly botched together site architecture, navigation and a back-end.
Or would you be happy with a site with little or no design (like jacob neilson's), or a site that looks like a windows form, but does the job amazingly? | 2 |
6,621,989 | 07/08/2011 08:40:43 | 835,022 | 07/08/2011 08:40:43 | 1 | 0 | using string in another project in C# | I have a string value in one project in C#. I want to use this string value in another project.
Can some one suggest me how to do this? | c# | visual-studio-2010 | null | null | null | 09/01/2011 05:28:56 | not a real question | using string in another project in C#
===
I have a string value in one project in C#. I want to use this string value in another project.
Can some one suggest me how to do this? | 1 |
3,259,992 | 07/15/2010 20:55:08 | 116,622 | 06/03/2009 14:09:01 | 630 | 19 | What every c++ programmer need to know about 'this' pointer? | straight and clear as the title says :)
Background:
I run into some [tutorial][1] and I realized that I missed some things...
So, I would really appreciate if anyone can point out any must_know_facts with an example.
[1]: http://www.codersource.net/c/c-tutorials/c-tutorial-this-pointer.aspx
Thanks! | c++ | pointers | this | null | null | 07/15/2010 21:12:03 | not a real question | What every c++ programmer need to know about 'this' pointer?
===
straight and clear as the title says :)
Background:
I run into some [tutorial][1] and I realized that I missed some things...
So, I would really appreciate if anyone can point out any must_know_facts with an example.
[1]: http://www.codersource.net/c/c-tutorials/c-tutorial-this-pointer.aspx
Thanks! | 1 |
8,993,967 | 01/24/2012 20:52:23 | 901,505 | 08/18/2011 22:27:47 | 130 | 4 | Setting Up phpMyAdmin | I've seen a couple of tutorials on how to set up phpMyAdmin on a remote server. Notably, [this one][1] which has me editing the `config.inc.php` file. I followed the instructions, but I still am stopped at the login page and I am not sure what the right username and password would be to enter.
// My config.inc.php file
<?php
$cfg['blowfish_secret'] = 'Some Passphrase';
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['PmaAbsoluteUri'] = 'http://www.domainname.com/phpMyAdmin/';
$cfg['Servers'][$i]['host'] = 'MySQL.domainname.com';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
?>
After saving this and placing it in the phpMyAdmin directory on the remote server then going to `http://www.domainname.com/phpMyAdmin/index.php`, I see the following screen. Clicking **Go** with empty fields doesn't do anything.
![phpMyAdmin login page][2]
Any advice?
[1]: http://service.futurequest.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=25
[2]: http://i.stack.imgur.com/yyrHD.png | php | mysql | phpmyadmin | null | null | 01/25/2012 18:07:16 | off topic | Setting Up phpMyAdmin
===
I've seen a couple of tutorials on how to set up phpMyAdmin on a remote server. Notably, [this one][1] which has me editing the `config.inc.php` file. I followed the instructions, but I still am stopped at the login page and I am not sure what the right username and password would be to enter.
// My config.inc.php file
<?php
$cfg['blowfish_secret'] = 'Some Passphrase';
$i = 0;
$i++;
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['PmaAbsoluteUri'] = 'http://www.domainname.com/phpMyAdmin/';
$cfg['Servers'][$i]['host'] = 'MySQL.domainname.com';
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
?>
After saving this and placing it in the phpMyAdmin directory on the remote server then going to `http://www.domainname.com/phpMyAdmin/index.php`, I see the following screen. Clicking **Go** with empty fields doesn't do anything.
![phpMyAdmin login page][2]
Any advice?
[1]: http://service.futurequest.net/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=25
[2]: http://i.stack.imgur.com/yyrHD.png | 2 |
11,223,958 | 06/27/2012 10:18:17 | 1,482,348 | 06/26/2012 10:01:48 | 1 | 0 | transition from one scene to another | I got three NSArray named a,b,c and another NSMutable Array named na. The 3 arrays contains elements imagename.image. When the button is taped the 3 arrays are merged to the mutable array na. Again the array get split. This process is repeated and after the third tap the 10th element of na should be displayed on another view controller.I have set a counter j. i need the steps when j==3. Can you help me? I am new to xcode. Thanks | xcode4.2 | null | null | null | null | null | open | transition from one scene to another
===
I got three NSArray named a,b,c and another NSMutable Array named na. The 3 arrays contains elements imagename.image. When the button is taped the 3 arrays are merged to the mutable array na. Again the array get split. This process is repeated and after the third tap the 10th element of na should be displayed on another view controller.I have set a counter j. i need the steps when j==3. Can you help me? I am new to xcode. Thanks | 0 |
11,676,440 | 07/26/2012 19:13:16 | 1,208,222 | 02/14/2012 03:23:44 | 12 | 2 | How can I send massive mail in java? | I have made a site where the users can subscribe workshop.
I want the teacher of each workshop can send a mail to all his students, and sometimes I want to send a global mail to all the students.
Now I use the library javamail with gmail, but I can't send massive mail.
Is there a easy way to made a snmp server in java? and how can my mails avoid the spam folder? | java | email | null | null | null | 07/26/2012 19:39:49 | not a real question | How can I send massive mail in java?
===
I have made a site where the users can subscribe workshop.
I want the teacher of each workshop can send a mail to all his students, and sometimes I want to send a global mail to all the students.
Now I use the library javamail with gmail, but I can't send massive mail.
Is there a easy way to made a snmp server in java? and how can my mails avoid the spam folder? | 1 |
10,616,212 | 05/16/2012 09:59:26 | 1,398,180 | 05/16/2012 09:05:13 | 1 | 0 | DatabaseAuthenticationProvider throws NullPointerException at AbstractContextSource.getReadOnlyContext |
I used Spring Security LDAP authentication defined in xml file and it worked fine:
<!-- language: lang-xml -->
<security:authentication-manager>
<security:ldap-authentication-provider
user-search-filter="(uid={0})"
user-search-base="dc=company,dc=com">
</security:ldap-authentication-provider>
</security:authentication-manager>
<security:ldap-server url="ldap://mail.company.com" />
I needed to insert some logic into authenticator provider (logging into database to name one) so I implemented DaoAuthenticationProvider to use LDAP:
xml configuration:
<!-- language: lang-xml -->
<security:authentication-manager>
<security:authentication-provider ref="appAuthenticationProvider" />
</security:authentication-manager>
class implementation:
<!-- language: lang-java -->
@Service("appAuthenticationProvider")
public class AppAuthenticationProvider extends DaoAuthenticationProvider {
private LdapAuthenticationProvider ldapProvider;
public DatabaseAuthenticationProvider(){
DefaultSpringSecurityContextSource contextSource = new DefaultSpringSecurityContextSource("ldap://mail.company.com");
BindAuthenticator authenticator = new BindAuthenticator(contextSource);
authenticator.setUserSearch(new FilterBasedLdapUserSearch("dc=company,dc=com", "(uid={0})", contextSource));
ldapProvider = new LdapAuthenticationProvider(authenticator);
}
public Authentication authenticate(Authentication authRequest) throws AuthenticationException {
return ldapProvider.authenticate(authRequest);
}
}
It looks qute what you'd expect from the first implementation but authenticate method throws following exception:
java.lang.NullPointerException
org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:125)
org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:792)
org.springframework.security.ldap.SpringSecurityLdapTemplate.searchForSingleEntry(SpringSecurityLdapTemplate.java:196)
org.springframework.security.ldap.search.FilterBasedLdapUserSearch.searchForUser(FilterBasedLdapUserSearch.java:116)
org.springframework.security.ldap.authentication.BindAuthenticator.authenticate(BindAuthenticator.java:90)
org.springframework.security.ldap.authentication.LdapAuthenticationProvider.doAuthentication(LdapAuthenticationProvider.java:178)
org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider.authenticate(AbstractLdapAuthenticationProvider.java:61)
myapp.security.AppAuthenticationProvider.authenticate(AppAuthenticationProvider.java:69)
Logs in first case looks like this:
[myapp] 2012-05-16 11:38:44,339 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:38:44,364 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:38:44,365 DEBUG org.springframework.ldap.core.support.AbstractContextSource - AuthenticationSource not set - using default implementation
[myapp] 2012-05-16 11:38:44,365 INFO org.springframework.ldap.core.support.AbstractContextSource - Property 'userDn' not set - anonymous context will be used for read-write operations
[myapp] 2012-05-16 11:38:44,365 DEBUG org.springframework.ldap.core.support.AbstractContextSource - Using LDAP pooling.
[myapp] 2012-05-16 11:38:44,365 DEBUG org.springframework.ldap.core.support.AbstractContextSource - Trying provider Urls: ldap://mail.company.com
[myapp] 2012-05-16 11:38:44,369 INFO org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - groupSearchBase is empty. Searches will be performed from the context source base
[myapp] 2012-05-16 11:39:33,956 DEBUG org.springframework.security.authentication.ProviderManager - Authentication attempt using org.springframework.security.ldap.authentication.LdapAuthenticationProvider
[myapp] 2012-05-16 11:39:33,957 DEBUG org.springframework.security.ldap.authentication.LdapAuthenticationProvider - Processing authentication request for user: JohnDoe
[myapp] 2012-05-16 11:39:33,960 DEBUG org.springframework.security.ldap.search.FilterBasedLdapUserSearch - Searching for user 'JohnDoe', with user search [ searchFilter: '(uid={0})', searchBase: 'dc=company,dc=com', scope: subtree, searchTimeLimit: 0, derefLinkFlag: false ]
[myapp] 2012-05-16 11:39:34,812 DEBUG org.springframework.ldap.core.support.AbstractContextSource - Got Ldap context on server 'ldap://mail.company.com'
[myapp] 2012-05-16 11:39:35,025 DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Searching for entry under DN '', base = 'dc=company,dc=com', filter = '(uid={0})'
[myapp] 2012-05-16 11:39:35,060 DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Found DN: cn=JohnDoe,cn=users,dc=company,dc=com
[myapp] 2012-05-16 11:39:35,082 DEBUG org.springframework.security.ldap.authentication.BindAuthenticator - Attempting to bind as cn=JohnDoe,cn=users,dc=company,dc=com
In the second case:
[myapp] 2012-05-16 11:34:13,563 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:34:28,363 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:34:37,194 DEBUG org.springframework.security.authentication.ProviderManager - Authentication attempt using myapp.security.AppAuthenticationProvider
[myapp] 2012-05-16 11:34:37,197 DEBUG org.springframework.security.ldap.authentication.LdapAuthenticationProvider - Processing authentication request for user: JohnDoe
[myapp] 2012-05-16 11:34:37,197 DEBUG org.springframework.security.ldap.search.FilterBasedLdapUserSearch - Searching for user 'JohnDoe', with user search [ searchFilter: '(uid={0})', searchBase: 'dc=company,dc=com', scope: subtree, searchTimeLimit: 0, derefLinkFlag: false ]
Got any idea? | spring | security | spring-security | ldap | null | null | open | DatabaseAuthenticationProvider throws NullPointerException at AbstractContextSource.getReadOnlyContext
===
I used Spring Security LDAP authentication defined in xml file and it worked fine:
<!-- language: lang-xml -->
<security:authentication-manager>
<security:ldap-authentication-provider
user-search-filter="(uid={0})"
user-search-base="dc=company,dc=com">
</security:ldap-authentication-provider>
</security:authentication-manager>
<security:ldap-server url="ldap://mail.company.com" />
I needed to insert some logic into authenticator provider (logging into database to name one) so I implemented DaoAuthenticationProvider to use LDAP:
xml configuration:
<!-- language: lang-xml -->
<security:authentication-manager>
<security:authentication-provider ref="appAuthenticationProvider" />
</security:authentication-manager>
class implementation:
<!-- language: lang-java -->
@Service("appAuthenticationProvider")
public class AppAuthenticationProvider extends DaoAuthenticationProvider {
private LdapAuthenticationProvider ldapProvider;
public DatabaseAuthenticationProvider(){
DefaultSpringSecurityContextSource contextSource = new DefaultSpringSecurityContextSource("ldap://mail.company.com");
BindAuthenticator authenticator = new BindAuthenticator(contextSource);
authenticator.setUserSearch(new FilterBasedLdapUserSearch("dc=company,dc=com", "(uid={0})", contextSource));
ldapProvider = new LdapAuthenticationProvider(authenticator);
}
public Authentication authenticate(Authentication authRequest) throws AuthenticationException {
return ldapProvider.authenticate(authRequest);
}
}
It looks qute what you'd expect from the first implementation but authenticate method throws following exception:
java.lang.NullPointerException
org.springframework.ldap.core.support.AbstractContextSource.getReadOnlyContext(AbstractContextSource.java:125)
org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:792)
org.springframework.security.ldap.SpringSecurityLdapTemplate.searchForSingleEntry(SpringSecurityLdapTemplate.java:196)
org.springframework.security.ldap.search.FilterBasedLdapUserSearch.searchForUser(FilterBasedLdapUserSearch.java:116)
org.springframework.security.ldap.authentication.BindAuthenticator.authenticate(BindAuthenticator.java:90)
org.springframework.security.ldap.authentication.LdapAuthenticationProvider.doAuthentication(LdapAuthenticationProvider.java:178)
org.springframework.security.ldap.authentication.AbstractLdapAuthenticationProvider.authenticate(AbstractLdapAuthenticationProvider.java:61)
myapp.security.AppAuthenticationProvider.authenticate(AppAuthenticationProvider.java:69)
Logs in first case looks like this:
[myapp] 2012-05-16 11:38:44,339 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:38:44,364 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:38:44,365 DEBUG org.springframework.ldap.core.support.AbstractContextSource - AuthenticationSource not set - using default implementation
[myapp] 2012-05-16 11:38:44,365 INFO org.springframework.ldap.core.support.AbstractContextSource - Property 'userDn' not set - anonymous context will be used for read-write operations
[myapp] 2012-05-16 11:38:44,365 DEBUG org.springframework.ldap.core.support.AbstractContextSource - Using LDAP pooling.
[myapp] 2012-05-16 11:38:44,365 DEBUG org.springframework.ldap.core.support.AbstractContextSource - Trying provider Urls: ldap://mail.company.com
[myapp] 2012-05-16 11:38:44,369 INFO org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulator - groupSearchBase is empty. Searches will be performed from the context source base
[myapp] 2012-05-16 11:39:33,956 DEBUG org.springframework.security.authentication.ProviderManager - Authentication attempt using org.springframework.security.ldap.authentication.LdapAuthenticationProvider
[myapp] 2012-05-16 11:39:33,957 DEBUG org.springframework.security.ldap.authentication.LdapAuthenticationProvider - Processing authentication request for user: JohnDoe
[myapp] 2012-05-16 11:39:33,960 DEBUG org.springframework.security.ldap.search.FilterBasedLdapUserSearch - Searching for user 'JohnDoe', with user search [ searchFilter: '(uid={0})', searchBase: 'dc=company,dc=com', scope: subtree, searchTimeLimit: 0, derefLinkFlag: false ]
[myapp] 2012-05-16 11:39:34,812 DEBUG org.springframework.ldap.core.support.AbstractContextSource - Got Ldap context on server 'ldap://mail.company.com'
[myapp] 2012-05-16 11:39:35,025 DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Searching for entry under DN '', base = 'dc=company,dc=com', filter = '(uid={0})'
[myapp] 2012-05-16 11:39:35,060 DEBUG org.springframework.security.ldap.SpringSecurityLdapTemplate - Found DN: cn=JohnDoe,cn=users,dc=company,dc=com
[myapp] 2012-05-16 11:39:35,082 DEBUG org.springframework.security.ldap.authentication.BindAuthenticator - Attempting to bind as cn=JohnDoe,cn=users,dc=company,dc=com
In the second case:
[myapp] 2012-05-16 11:34:13,563 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:34:28,363 INFO org.springframework.security.ldap.DefaultSpringSecurityContextSource - URL 'ldap://mail.company.com', root DN is ''
[myapp] 2012-05-16 11:34:37,194 DEBUG org.springframework.security.authentication.ProviderManager - Authentication attempt using myapp.security.AppAuthenticationProvider
[myapp] 2012-05-16 11:34:37,197 DEBUG org.springframework.security.ldap.authentication.LdapAuthenticationProvider - Processing authentication request for user: JohnDoe
[myapp] 2012-05-16 11:34:37,197 DEBUG org.springframework.security.ldap.search.FilterBasedLdapUserSearch - Searching for user 'JohnDoe', with user search [ searchFilter: '(uid={0})', searchBase: 'dc=company,dc=com', scope: subtree, searchTimeLimit: 0, derefLinkFlag: false ]
Got any idea? | 0 |
4,171,359 | 11/13/2010 06:46:46 | 426,435 | 08/20/2010 14:21:26 | 1 | 1 | iphone learning | i wat to learn iphone calayer and that kind of think..
I know basic iphone development..
From where i can learn this?
Thanks
Shyam parmar
| iphone | null | null | null | null | null | open | iphone learning
===
i wat to learn iphone calayer and that kind of think..
I know basic iphone development..
From where i can learn this?
Thanks
Shyam parmar
| 0 |
11,258,422 | 06/29/2012 08:24:44 | 607,846 | 02/08/2011 09:16:51 | 857 | 15 | Naming conventions for mocks and interfaces | Which do you prefer and why?
MockTurtle in MockTurtle.h
ITurtle in ITurtle.h
or
TurtleMock in TurtleMock.h
TurtleInterface in TurtleInterface .h
Which is more "standard"? | c++ | null | null | null | null | 06/29/2012 08:30:28 | not constructive | Naming conventions for mocks and interfaces
===
Which do you prefer and why?
MockTurtle in MockTurtle.h
ITurtle in ITurtle.h
or
TurtleMock in TurtleMock.h
TurtleInterface in TurtleInterface .h
Which is more "standard"? | 4 |
2,300,867 | 02/20/2010 03:08:53 | 144,776 | 07/24/2009 21:54:38 | 32 | 2 | How can I avoid "duplicate symbol" errors in xcode with shared static libraries? | I have static libraries A, B and C organized into xCode projects. A and B depend on C. When I build an iPhone project that depends on A and B, I get a linker error that a duplicate symbol (from C) was detected in A and B. How can I organize these three static libraries so I can include them in other xCode projects without experiencing this error? | xcode | objective-c | null | null | null | null | open | How can I avoid "duplicate symbol" errors in xcode with shared static libraries?
===
I have static libraries A, B and C organized into xCode projects. A and B depend on C. When I build an iPhone project that depends on A and B, I get a linker error that a duplicate symbol (from C) was detected in A and B. How can I organize these three static libraries so I can include them in other xCode projects without experiencing this error? | 0 |
579,661 | 02/23/2009 22:30:44 | 50,348 | 12/30/2008 23:55:43 | 34 | 0 | Simple AJAX Script will NOT load on Homepage only | My email script on the left navigation panel... under "Brad's Secrets of Attraction" will not load on the homepage. It works on EVERY other page.
Live Site: [BradP.com][1]
This is strange to me.
Does anyone know why?
Thanks for the help.
Best
Nick
[1]: http://www.BradP.com | javascript | ajax | null | null | null | null | open | Simple AJAX Script will NOT load on Homepage only
===
My email script on the left navigation panel... under "Brad's Secrets of Attraction" will not load on the homepage. It works on EVERY other page.
Live Site: [BradP.com][1]
This is strange to me.
Does anyone know why?
Thanks for the help.
Best
Nick
[1]: http://www.BradP.com | 0 |
2,773,337 | 05/05/2010 12:54:47 | 329,637 | 04/30/2010 09:27:00 | 17 | 3 | Whats wrong with this simple Layout? | Im trying to define a LinearLayout which contains another LinearLayout which should always be desplayed in the horizontal and vertical center. An ImageView should be placed always vertically centered on the right side of the parent Layout:
> A B
I defined it the following:
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="60px">
<LinearLayout android:id="@+id/footer" android:orientation="horizontal" android:layout_height="50px" android:paddingTop="5px" android:layout_width="wrap_content" android:background="@drawable/footer_border" android:paddingRight="5px" android:paddingLeft="5px" android:layout_gravity="center_horizontal">
<ImageButton android:id="@+id/libraryButton" android:layout_height="wrap_content" android:src="@drawable/library_button" android:background="#000000" android:layout_width="wrap_content"/>
<ImageButton android:id="@+id/bookButton" android:layout_height="wrap_content" android:src="@drawable/book_button" android:background="#000000" android:layout_width="wrap_content" android:paddingLeft="15px" android:paddingRight="15px"/>
<ImageButton android:id="@+id/workspaceButton" android:layout_height="wrap_content" android:src="@drawable/workspace_button" android:background="#000000" android:layout_width="wrap_content"/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:id="@+id/loading">
</ImageView>
</LinearLayout>
But unfornatuley its not working... The LinearLayout (A) and the ImageView (B) is on the left side.... But i set gravity to center and right?? Why? | android | null | null | null | null | null | open | Whats wrong with this simple Layout?
===
Im trying to define a LinearLayout which contains another LinearLayout which should always be desplayed in the horizontal and vertical center. An ImageView should be placed always vertically centered on the right side of the parent Layout:
> A B
I defined it the following:
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="60px">
<LinearLayout android:id="@+id/footer" android:orientation="horizontal" android:layout_height="50px" android:paddingTop="5px" android:layout_width="wrap_content" android:background="@drawable/footer_border" android:paddingRight="5px" android:paddingLeft="5px" android:layout_gravity="center_horizontal">
<ImageButton android:id="@+id/libraryButton" android:layout_height="wrap_content" android:src="@drawable/library_button" android:background="#000000" android:layout_width="wrap_content"/>
<ImageButton android:id="@+id/bookButton" android:layout_height="wrap_content" android:src="@drawable/book_button" android:background="#000000" android:layout_width="wrap_content" android:paddingLeft="15px" android:paddingRight="15px"/>
<ImageButton android:id="@+id/workspaceButton" android:layout_height="wrap_content" android:src="@drawable/workspace_button" android:background="#000000" android:layout_width="wrap_content"/>
</LinearLayout>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:id="@+id/loading">
</ImageView>
</LinearLayout>
But unfornatuley its not working... The LinearLayout (A) and the ImageView (B) is on the left side.... But i set gravity to center and right?? Why? | 0 |
11,608,810 | 07/23/2012 08:22:25 | 1,540,714 | 07/20/2012 12:05:48 | 6 | 0 | Magento: rewriting multiple URLs (from) to one target (to) using a regex? | I want to rewrite some of my URLs using a regex. This is my rewrite stuff in config.xml of my module.
<rewrite>
<My_Module>
<from><![CDATA[#^/(abc)|(def)/configuration/#]]></from>
<to>/config/configuration/</to>
<complete>1</complete>
</My_Module>
</rewrite>
As you see, what I am trying to achive is to rewrite all urls that contain *abc/configuration* or *def/configuration*. This does not work. So how can I add multiple URLs to the same rewrite in Magento? I dont care if its done with a regex or a line for each rewrite in config.xml, so far I did not manage to figure it out either way.
Thanks!
Thanks! | magento | url-rewriting | null | null | null | null | open | Magento: rewriting multiple URLs (from) to one target (to) using a regex?
===
I want to rewrite some of my URLs using a regex. This is my rewrite stuff in config.xml of my module.
<rewrite>
<My_Module>
<from><![CDATA[#^/(abc)|(def)/configuration/#]]></from>
<to>/config/configuration/</to>
<complete>1</complete>
</My_Module>
</rewrite>
As you see, what I am trying to achive is to rewrite all urls that contain *abc/configuration* or *def/configuration*. This does not work. So how can I add multiple URLs to the same rewrite in Magento? I dont care if its done with a regex or a line for each rewrite in config.xml, so far I did not manage to figure it out either way.
Thanks!
Thanks! | 0 |
9,355,430 | 02/20/2012 02:19:40 | 699,632 | 04/06/2011 03:25:04 | 7,485 | 409 | How does Flash deal with my anonymous function? | I have a linked list class that stores a linked collection of entities.
I've added an `iterate()` method to this class which I am sceptical of. It accepts a function as its only argument, which should accept an instance of `Entity` only.
i.e.
list.iterate(function(entity:Entity)
{
trace(entity.id);
});
I'm concerned about this method because I'm not sure what will happen to the function I've given to `iterate()` in this case. Will what I'm doing hurt the performance or memory usage of my game at all when compared to doing my iterations manually like so?:
var i:Entity = list.first;
while(i != null)
{
trace(i.id);
i = i.next;
}
Any information on this is appreciated. | flash | actionscript-3 | memory-management | actionscript | null | null | open | How does Flash deal with my anonymous function?
===
I have a linked list class that stores a linked collection of entities.
I've added an `iterate()` method to this class which I am sceptical of. It accepts a function as its only argument, which should accept an instance of `Entity` only.
i.e.
list.iterate(function(entity:Entity)
{
trace(entity.id);
});
I'm concerned about this method because I'm not sure what will happen to the function I've given to `iterate()` in this case. Will what I'm doing hurt the performance or memory usage of my game at all when compared to doing my iterations manually like so?:
var i:Entity = list.first;
while(i != null)
{
trace(i.id);
i = i.next;
}
Any information on this is appreciated. | 0 |
10,643,778 | 05/17/2012 21:26:37 | 1,290,365 | 03/24/2012 18:35:22 | 1 | 1 | How to call a request RestKit to another class in ios sdk? | Im using a simple
Users * Subscribes= [[Users alloc] init];
[Subscribes send];
to call a method over other class
that method run a simple request over my class "Users.m"
But the problem is I have a EXEC_BAD_ACCESS over the class
RKObjectLoader.M
in this line
#377- [super prepareURLRequest];
- Im using the most new RestKit Api
- xcode 4.2 with ios sdk 5.0
- Im tested with differents requests
Actually if I try run the same method with a typical
[self send];
everything is ok And I have my correct response
| ios | xcode4 | restkit | null | null | null | open | How to call a request RestKit to another class in ios sdk?
===
Im using a simple
Users * Subscribes= [[Users alloc] init];
[Subscribes send];
to call a method over other class
that method run a simple request over my class "Users.m"
But the problem is I have a EXEC_BAD_ACCESS over the class
RKObjectLoader.M
in this line
#377- [super prepareURLRequest];
- Im using the most new RestKit Api
- xcode 4.2 with ios sdk 5.0
- Im tested with differents requests
Actually if I try run the same method with a typical
[self send];
everything is ok And I have my correct response
| 0 |
6,845,297 | 07/27/2011 13:40:02 | 865,508 | 07/27/2011 13:40:02 | 1 | 0 | SQL Count distinct absence periods of students | I'm looking for a way to count the distincts periods students have been absence:
Each time a student turns in an absence I create a record in the absence table, some absences can overlap, some prolounge a previous absence.
StuId StrPer EndPer
------ ----------- -----------
111111 2011-01-10 2011-01-15
222222 2011-02-01 2011-02-05
222222 2011-02-06 2011-02-08
333333 2011-04-07 2011-04-14
444444 2011-04-20 2011-04-25
444444 2011-04-23 2011-04-28
111111 2011-05-01 2011-05-03
Now I want to count the number of unique absence periods, the result should be:
StuId NbrAbs
------ ------
111111 2
222222 1
333333 1
444444 1
Who can help me with a query for this.
Thx in advance and sorry for my bad english...
Christophe | sql | null | null | null | null | null | open | SQL Count distinct absence periods of students
===
I'm looking for a way to count the distincts periods students have been absence:
Each time a student turns in an absence I create a record in the absence table, some absences can overlap, some prolounge a previous absence.
StuId StrPer EndPer
------ ----------- -----------
111111 2011-01-10 2011-01-15
222222 2011-02-01 2011-02-05
222222 2011-02-06 2011-02-08
333333 2011-04-07 2011-04-14
444444 2011-04-20 2011-04-25
444444 2011-04-23 2011-04-28
111111 2011-05-01 2011-05-03
Now I want to count the number of unique absence periods, the result should be:
StuId NbrAbs
------ ------
111111 2
222222 1
333333 1
444444 1
Who can help me with a query for this.
Thx in advance and sorry for my bad english...
Christophe | 0 |
10,091,112 | 04/10/2012 14:56:04 | 70,942 | 02/25/2009 17:01:58 | 706 | 28 | Using a global variable to control a while loop in a separate thread | gcc (GCC) 4.6.3
c89
valgrind-3.6.1
Hello,
I am running a while loop in a worker thread that polls every 1/2 second. I control it with a global variable start_receiving after the user enters ctrl-c it will change the value to false.
Having a global like this is it good practice?
The reason I asked as I get these 2 errors when I run helgrind:
==6814== Possible data race during write of size 4 at 0x601958 by thread #1
==6814== at 0x401131: main (driver.c:78)
==6814== This conflicts with a previous read of size 4 by thread #2
==6814== at 0x4012A7: thread_recv_fd (driver.c:127)
This are the lines of code:
driver.c:78 is this line of code start_receiving = FALSE;
driver.c:127 is this line of code while(start_receiving) in the while loop
Source code, just the important snippets:
static int start_receiving = FALSE;
int main(void)
{
pthread_t thread_recv_id;
pthread_attr_t thread_attr;
/* Start polling as soon as thread has been created */
start_receiving = TRUE;
do {
/* Start thread that will send a message */
if(pthread_create(&thread_recv_id, &thread_attr, thread_recv_fd, NULL) == -1) {
fprintf(stderr, "Failed to create thread, reason [ %s ]",
strerror(errno));
break;
}
}
while(0);
/* Wait for ctrl-c */
pause();
/* Stop polling - exit while loop */
start_receiving = FALSE;
/* Clean up threading properties */
pthread_join(thread_recv_id, NULL);
pthread_exit(NULL);
}
void *thread_recv_fd()
{
while(start_receiving) {
pthread_mutex_lock(&mutex_queue);
queue_remove();
pthread_mutex_unlock(&mutex_queue);
usleep(500);
}
pthread_exit(NULL);
}
Many thanks for any suggestions,
| c | pthreads | null | null | null | null | open | Using a global variable to control a while loop in a separate thread
===
gcc (GCC) 4.6.3
c89
valgrind-3.6.1
Hello,
I am running a while loop in a worker thread that polls every 1/2 second. I control it with a global variable start_receiving after the user enters ctrl-c it will change the value to false.
Having a global like this is it good practice?
The reason I asked as I get these 2 errors when I run helgrind:
==6814== Possible data race during write of size 4 at 0x601958 by thread #1
==6814== at 0x401131: main (driver.c:78)
==6814== This conflicts with a previous read of size 4 by thread #2
==6814== at 0x4012A7: thread_recv_fd (driver.c:127)
This are the lines of code:
driver.c:78 is this line of code start_receiving = FALSE;
driver.c:127 is this line of code while(start_receiving) in the while loop
Source code, just the important snippets:
static int start_receiving = FALSE;
int main(void)
{
pthread_t thread_recv_id;
pthread_attr_t thread_attr;
/* Start polling as soon as thread has been created */
start_receiving = TRUE;
do {
/* Start thread that will send a message */
if(pthread_create(&thread_recv_id, &thread_attr, thread_recv_fd, NULL) == -1) {
fprintf(stderr, "Failed to create thread, reason [ %s ]",
strerror(errno));
break;
}
}
while(0);
/* Wait for ctrl-c */
pause();
/* Stop polling - exit while loop */
start_receiving = FALSE;
/* Clean up threading properties */
pthread_join(thread_recv_id, NULL);
pthread_exit(NULL);
}
void *thread_recv_fd()
{
while(start_receiving) {
pthread_mutex_lock(&mutex_queue);
queue_remove();
pthread_mutex_unlock(&mutex_queue);
usleep(500);
}
pthread_exit(NULL);
}
Many thanks for any suggestions,
| 0 |
10,023,116 | 04/05/2012 05:31:14 | 465,558 | 10/04/2010 05:58:18 | 1,334 | 17 | Application crash even with try..catch | I have some application in C++ and C# ( together in the same project ).
In some scenario ( not reproduce every time ) the application crash (!) and i don't see any reason to this crash.
I added try..catch block to any place that can be the crash cause - i add try..catch to the 'Program.cs' code that will catch the exception - and nothing help.
How to find the problem ?
where to start ?
Thanks for any help. | c# | c++ | null | null | null | 04/05/2012 09:18:29 | not a real question | Application crash even with try..catch
===
I have some application in C++ and C# ( together in the same project ).
In some scenario ( not reproduce every time ) the application crash (!) and i don't see any reason to this crash.
I added try..catch block to any place that can be the crash cause - i add try..catch to the 'Program.cs' code that will catch the exception - and nothing help.
How to find the problem ?
where to start ?
Thanks for any help. | 1 |
6,388,359 | 06/17/2011 15:51:24 | 802,177 | 06/16/2011 19:34:10 | 1 | 0 | Salesforce ANT retrieve referenced packages | I'm trying to use ant to retrieve all the information from a salesforce org so that I can examine and modify the data. I understand how to retrieve all of the components referenced in the Force.com Migration Tool Guide: http://www.salesforce.com/us/developer/docs/daas/index.htm like CustomObjects, CustomFields, Layouts, etc. by editing the packages.xml file and using ant. When I use the Eclipse IDE however, I get a "referenced packages" folder that contains many different components that I was not able to get through ant. Is there a way to obtain these components through the use of ant? | ant | salesforce | null | null | null | null | open | Salesforce ANT retrieve referenced packages
===
I'm trying to use ant to retrieve all the information from a salesforce org so that I can examine and modify the data. I understand how to retrieve all of the components referenced in the Force.com Migration Tool Guide: http://www.salesforce.com/us/developer/docs/daas/index.htm like CustomObjects, CustomFields, Layouts, etc. by editing the packages.xml file and using ant. When I use the Eclipse IDE however, I get a "referenced packages" folder that contains many different components that I was not able to get through ant. Is there a way to obtain these components through the use of ant? | 0 |
2,362,450 | 03/02/2010 10:33:51 | 227,868 | 12/09/2009 10:23:26 | 1 | 0 | How do I put coordinates from an object into a CLLocation? (Objective-C, iPhone) | I'm currently using the ARKit ported by the http://iphonear.org guys, looping through a fetched xml and plotting coordinates on the screen. However for some reason casting the object values:
for(NSObject *locxml in xmlLocations) {
tempLocation = [[CLLocation alloc]
initWithLatitude: (int)[locxml valueForKey:@"lat"]
longitude: (int)[locxml valueForKey:@"long"]];
tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = [locxml valueForKey:@"title"];
[tempLocationArray addObject:tempCoordinate];
[tempLocation release];
[locxml release];
}
just doesn't show up anything, i have already tried
[[locxml valueForKey:@"lat"] doubleValue] which does indeed shows coordinates just totally in the wrong place (yeah i'm sure of this).
Any help on how to put coordinates from an object into a CLLocation? | iphone | objective-c | cllocation | object | coordinates | null | open | How do I put coordinates from an object into a CLLocation? (Objective-C, iPhone)
===
I'm currently using the ARKit ported by the http://iphonear.org guys, looping through a fetched xml and plotting coordinates on the screen. However for some reason casting the object values:
for(NSObject *locxml in xmlLocations) {
tempLocation = [[CLLocation alloc]
initWithLatitude: (int)[locxml valueForKey:@"lat"]
longitude: (int)[locxml valueForKey:@"long"]];
tempCoordinate = [ARGeoCoordinate coordinateWithLocation:tempLocation];
tempCoordinate.title = [locxml valueForKey:@"title"];
[tempLocationArray addObject:tempCoordinate];
[tempLocation release];
[locxml release];
}
just doesn't show up anything, i have already tried
[[locxml valueForKey:@"lat"] doubleValue] which does indeed shows coordinates just totally in the wrong place (yeah i'm sure of this).
Any help on how to put coordinates from an object into a CLLocation? | 0 |
8,151,306 | 11/16/2011 11:59:23 | 284,741 | 03/02/2010 20:23:39 | 1,109 | 57 | SMTP DATE command purpose? | I am looking at my SMTP logs. The script I just run tells me that one of our mail servers has sent 19848kb, and received 386kb. This is pretty weird as this server should just be forwarding on mail that it received.
One of the sources out outbound traffic I noticed is for lines to do with the DATE command. For instance, this line:
11/16/11 00:26:57 SMTP-OU 8AA56F43369C40ECBE07D7A805617D74.MAI 1184 [ipAddress] DATE 250 2.0.0 OK 1321403130 v50si13351192wec.51 172503 45
`DATE` is the command. `250 2.0.0 OK 1321403130 v50si13351192wec.51` is the response to the command. `172503` is the number of bytes sent, and `45` is the number of bytes received.
I can't find the specification of what this command does. Is it something like `Data-extended`? It can't be transmitting just the calender-date, because it is too big for that. | smtp | null | null | null | null | 11/17/2011 13:58:12 | off topic | SMTP DATE command purpose?
===
I am looking at my SMTP logs. The script I just run tells me that one of our mail servers has sent 19848kb, and received 386kb. This is pretty weird as this server should just be forwarding on mail that it received.
One of the sources out outbound traffic I noticed is for lines to do with the DATE command. For instance, this line:
11/16/11 00:26:57 SMTP-OU 8AA56F43369C40ECBE07D7A805617D74.MAI 1184 [ipAddress] DATE 250 2.0.0 OK 1321403130 v50si13351192wec.51 172503 45
`DATE` is the command. `250 2.0.0 OK 1321403130 v50si13351192wec.51` is the response to the command. `172503` is the number of bytes sent, and `45` is the number of bytes received.
I can't find the specification of what this command does. Is it something like `Data-extended`? It can't be transmitting just the calender-date, because it is too big for that. | 2 |
8,913,968 | 01/18/2012 16:47:29 | 939,457 | 09/11/2011 18:34:59 | 483 | 23 | How to generate different variants of end user documentation | I'm not sure if this is the right place to ask this,so if I'm wrong please let me know where it would be the best place.
I'm working on a project that creates tools customized for several customers. The company policy requires that they get the documentation in word and/or PDF, using a very specific template (available in WORD, and my attempts to translate it in LATEX didn't produce a great output)
The basic document is mostly the same, but some command line option may not be available for a customer, some configuration options may not be available for them, some input file format may be different (a whole section of the document in this case) and the configuration file example is/should be specific to each customer.
I want to generate the documentation automatically, based on the program output (the tool has support to display command line options and configuration options ), a template (not decided if it's going to be a word template or something else) and a minimal (preferably none) customer specific configuration file.
The environment is Linux, and preferred language is python.
Given the above conditions, how would you approach the problem ? Is there some tool that may help here ? Can you suggest any google keywords to search for ?
What I've tried:
- converted the template to latex and using m4 to generate the final
latex and convert to PDF - can't really reproduce the PDF output of
the WORD
- using python to automate OpenOffice.org (I'm still investigating this)
| documentation | code-generation | end-user | null | null | null | open | How to generate different variants of end user documentation
===
I'm not sure if this is the right place to ask this,so if I'm wrong please let me know where it would be the best place.
I'm working on a project that creates tools customized for several customers. The company policy requires that they get the documentation in word and/or PDF, using a very specific template (available in WORD, and my attempts to translate it in LATEX didn't produce a great output)
The basic document is mostly the same, but some command line option may not be available for a customer, some configuration options may not be available for them, some input file format may be different (a whole section of the document in this case) and the configuration file example is/should be specific to each customer.
I want to generate the documentation automatically, based on the program output (the tool has support to display command line options and configuration options ), a template (not decided if it's going to be a word template or something else) and a minimal (preferably none) customer specific configuration file.
The environment is Linux, and preferred language is python.
Given the above conditions, how would you approach the problem ? Is there some tool that may help here ? Can you suggest any google keywords to search for ?
What I've tried:
- converted the template to latex and using m4 to generate the final
latex and convert to PDF - can't really reproduce the PDF output of
the WORD
- using python to automate OpenOffice.org (I'm still investigating this)
| 0 |
3,021,523 | 06/11/2010 09:02:28 | 24,545 | 10/02/2008 15:44:37 | 17,177 | 454 | Beautiful examples of bit manipulation | What are the most elegant or useful examples of bit manipulation you have encountered or used?
Examples in all languages are welcome. | language-agnostic | bit-manipulation | null | null | null | 04/09/2012 13:48:08 | not constructive | Beautiful examples of bit manipulation
===
What are the most elegant or useful examples of bit manipulation you have encountered or used?
Examples in all languages are welcome. | 4 |
2,275,098 | 02/16/2010 17:58:51 | 230,851 | 12/13/2009 22:02:21 | 38 | 0 | AS3 - get access to the internal bitmap used by CacheAsBitmap ? | is it possible to get access to Flash's internal bitmap cache of an object when CacheAsBitmap is on ?
eg, something like:
var bmd:BitmapData = someDisplayObject.getCachedBitmapData();
if (bmd != null)
trace("stoked!");
else
trace("bummer. got to bmd.Draw(someDisplayObject) ourselves.");
seems unlikely, but thought i'd ask.
tia,
Orion
| actionscript-3 | bitmapdata | null | null | null | null | open | AS3 - get access to the internal bitmap used by CacheAsBitmap ?
===
is it possible to get access to Flash's internal bitmap cache of an object when CacheAsBitmap is on ?
eg, something like:
var bmd:BitmapData = someDisplayObject.getCachedBitmapData();
if (bmd != null)
trace("stoked!");
else
trace("bummer. got to bmd.Draw(someDisplayObject) ourselves.");
seems unlikely, but thought i'd ask.
tia,
Orion
| 0 |
742,869 | 04/13/2009 02:14:10 | 84,520 | 03/30/2009 08:47:00 | 33 | 1 | How to set the text of a label inside a user control | I have a user control that displays a list of categories. In that user control I have a Label control that I would like to write to from the code behind file. This is my Label
<asp:Label ID="Label1" runat="server" />
I have tried this code:
Label lblCount = (Label)this.Page.FindControl("Label1");
lblCount.text = "some text";
How can I get access to write to the label from the user control code behind page? What code would I need. I keep getting this error: Object reference not set to an instance of an object.
Any help would be greatly appreciated.
| label | usercontrols | null | null | null | null | open | How to set the text of a label inside a user control
===
I have a user control that displays a list of categories. In that user control I have a Label control that I would like to write to from the code behind file. This is my Label
<asp:Label ID="Label1" runat="server" />
I have tried this code:
Label lblCount = (Label)this.Page.FindControl("Label1");
lblCount.text = "some text";
How can I get access to write to the label from the user control code behind page? What code would I need. I keep getting this error: Object reference not set to an instance of an object.
Any help would be greatly appreciated.
| 0 |
10,360,867 | 04/28/2012 05:24:48 | 1,362,402 | 04/28/2012 05:10:01 | 1 | 0 | how specify and use an old software database. | i develop a software that work with some data. some of data is input by end user and some data must read from a device. this device has own software that read data directly from devices and save them somewhere that i don't know.
how can i find out what kind of database software used or where data has been saved. for use this data in my own database.
i use vb.net for develop my project.
device data reader software is MeteoWare.
thanks. | database | vb.net | null | null | null | 04/28/2012 05:32:07 | not a real question | how specify and use an old software database.
===
i develop a software that work with some data. some of data is input by end user and some data must read from a device. this device has own software that read data directly from devices and save them somewhere that i don't know.
how can i find out what kind of database software used or where data has been saved. for use this data in my own database.
i use vb.net for develop my project.
device data reader software is MeteoWare.
thanks. | 1 |
8,191,596 | 11/19/2011 03:12:47 | 1,031,889 | 11/06/2011 05:49:49 | 3 | 0 | mod_fcgid: error reading data from FastCGI server | I'm deploying my Django app in hostmonster. When running I got error:
[Fri Nov 18 19:50:04 2011] [warn] [client 113.185.2.152] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Fri Nov 18 19:50:04 2011] [error] [client 113.185.2.152] Premature end of script headers: django.fcgi
[Fri Nov 18 19:50:04 2011] [error] [client 113.185.2.152] invalid CGI ref "/500.php" in /home4/riasolut/public_html/500.shtml
my django.fcgi is:
#!/home/riaolut/python-2.7.2/
# -*- mode: python; -*-
import sys, os
# Add a custom Python path.
sys.path.insert(0, "/home/riasolut/django/django_projects/")
# Switch to the directory of your project. (Optional.)
#os.chdir("/home/riasolut/django/django_projects/thep_viet")
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "thep_viet.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
But when I ssh to my host and run django.fcgi manual by python command.
I got the message:
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 200 OK
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="NONE,NOARCHIVE"><title>Welcome to Django</title>
<style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
body { font:small sans-serif; }
body>div { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; }
h2 { margin-bottom:.8em; }
h2 span { font-size:80%; color:#666; font-weight:normal; }
h3 { margin:1em 0 .5em 0; }
h4 { margin:0 0 .5em 0; font-weight: normal; }
table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; }
tbody td, tbody th { vertical-align:top; padding:2px 3px; }
thead th { padding:1px 6px 1px 3px; background:#fefefe; text-align:left; font-weight:normal; font-size:11px; border:1px solid #ddd; }
tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; }
ul { margin-left: 2em; margin-top: 1em; }
#summary { background: #e0ebff; }
#summary h2 { font-weight: normal; color: #666; }
#explanation { background:#eee; }
#instructions { background:#f6f6f6; }
#summary table { border:none; background:transparent; }
</style>
</head>
<body>
<div id="summary">
<h1>It worked!</h1>
<h2>Congratulations on your first Django-powered page.</h2>
</div>
<div id="instructions">
<p>Of course, you haven't actually done any work yet. Here's what to do next:</p>
<ul>
<li>If you plan to use a database, edit the <code>DATABASES</code> setting in <code>thep_viet/settings.py</code>.</li>
<li>Start your first app by running <code>python thep_viet/manage.py startapp [appname]</code>.</li>
</ul>
</div>
<div id="explanation">
<p>
You're seeing this message because you have <code>DEBUG = True</code> in your
Django settings file and you haven't configured any URLs. Get to work!
</p>
</div>
</body></html>
How can I fix this error? | django | null | null | null | null | null | open | mod_fcgid: error reading data from FastCGI server
===
I'm deploying my Django app in hostmonster. When running I got error:
[Fri Nov 18 19:50:04 2011] [warn] [client 113.185.2.152] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server
[Fri Nov 18 19:50:04 2011] [error] [client 113.185.2.152] Premature end of script headers: django.fcgi
[Fri Nov 18 19:50:04 2011] [error] [client 113.185.2.152] invalid CGI ref "/500.php" in /home4/riasolut/public_html/500.shtml
my django.fcgi is:
#!/home/riaolut/python-2.7.2/
# -*- mode: python; -*-
import sys, os
# Add a custom Python path.
sys.path.insert(0, "/home/riasolut/django/django_projects/")
# Switch to the directory of your project. (Optional.)
#os.chdir("/home/riasolut/django/django_projects/thep_viet")
# Set the DJANGO_SETTINGS_MODULE environment variable.
os.environ['DJANGO_SETTINGS_MODULE'] = "thep_viet.settings"
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
But when I ssh to my host and run django.fcgi manual by python command.
I got the message:
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 200 OK
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="robots" content="NONE,NOARCHIVE"><title>Welcome to Django</title>
<style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
body { font:small sans-serif; }
body>div { border-bottom:1px solid #ddd; }
h1 { font-weight:normal; }
h2 { margin-bottom:.8em; }
h2 span { font-size:80%; color:#666; font-weight:normal; }
h3 { margin:1em 0 .5em 0; }
h4 { margin:0 0 .5em 0; font-weight: normal; }
table { border:1px solid #ccc; border-collapse: collapse; width:100%; background:white; }
tbody td, tbody th { vertical-align:top; padding:2px 3px; }
thead th { padding:1px 6px 1px 3px; background:#fefefe; text-align:left; font-weight:normal; font-size:11px; border:1px solid #ddd; }
tbody th { width:12em; text-align:right; color:#666; padding-right:.5em; }
ul { margin-left: 2em; margin-top: 1em; }
#summary { background: #e0ebff; }
#summary h2 { font-weight: normal; color: #666; }
#explanation { background:#eee; }
#instructions { background:#f6f6f6; }
#summary table { border:none; background:transparent; }
</style>
</head>
<body>
<div id="summary">
<h1>It worked!</h1>
<h2>Congratulations on your first Django-powered page.</h2>
</div>
<div id="instructions">
<p>Of course, you haven't actually done any work yet. Here's what to do next:</p>
<ul>
<li>If you plan to use a database, edit the <code>DATABASES</code> setting in <code>thep_viet/settings.py</code>.</li>
<li>Start your first app by running <code>python thep_viet/manage.py startapp [appname]</code>.</li>
</ul>
</div>
<div id="explanation">
<p>
You're seeing this message because you have <code>DEBUG = True</code> in your
Django settings file and you haven't configured any URLs. Get to work!
</p>
</div>
</body></html>
How can I fix this error? | 0 |
10,008,701 | 04/04/2012 09:47:21 | 76,701 | 03/11/2009 15:16:25 | 4,744 | 46 | Finding the IP of a domain name | I feel silly asking this question... Sometimes I have a domain that I want to know the IP of. For example `google.com` -> `173.194.41.135`.
What I usually do for this is use `tracert`, which besides doing a traceroute, shows the IP.
But this is silly because turning domains to IPs is what DNS is all about. Isn't there some basic tool that does just that?
I'm interested in hearing about a tool like that for both Windows and Linux. Also I'd be happy to hear about any Python function that does this. | windows | linux | dns | null | null | 04/06/2012 17:23:50 | off topic | Finding the IP of a domain name
===
I feel silly asking this question... Sometimes I have a domain that I want to know the IP of. For example `google.com` -> `173.194.41.135`.
What I usually do for this is use `tracert`, which besides doing a traceroute, shows the IP.
But this is silly because turning domains to IPs is what DNS is all about. Isn't there some basic tool that does just that?
I'm interested in hearing about a tool like that for both Windows and Linux. Also I'd be happy to hear about any Python function that does this. | 2 |
9,477,285 | 02/28/2012 06:14:10 | 226,955 | 12/08/2009 07:38:19 | 84 | 2 | Google Analytics Javacript event tracker code not tracking events | I have Google Analytics code that I added to my site (in PHP pages), and I also added code to track outbound links/events. The code was modified slightly, since I don't need it to wait a second before opening the links, since they're all being opened in a new window anyway.
For some reason though, the events aren't being tracked at all.
Here's the Analytics code in the header:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
function recordOutboundLink(link, category, action) {
try {
var myTracker=_gat._getTrackerByName();
_gaq.push(['myTracker._trackEvent', category, action]);
}catch(err){}
}
</script>
And here is the code I have on each link:
<a href="http://sitelink.tld" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'http://sitelink.tld');">
Can someone help me figure out why the events wouldn't be showing up on the Analytics Events page?
Thanks a lot! | javascript | google-analytics | null | null | null | 02/29/2012 18:51:59 | too localized | Google Analytics Javacript event tracker code not tracking events
===
I have Google Analytics code that I added to my site (in PHP pages), and I also added code to track outbound links/events. The code was modified slightly, since I don't need it to wait a second before opening the links, since they're all being opened in a new window anyway.
For some reason though, the events aren't being tracked at all.
Here's the Analytics code in the header:
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXX-X']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
<script type="text/javascript">
function recordOutboundLink(link, category, action) {
try {
var myTracker=_gat._getTrackerByName();
_gaq.push(['myTracker._trackEvent', category, action]);
}catch(err){}
}
</script>
And here is the code I have on each link:
<a href="http://sitelink.tld" target="_blank" onClick="recordOutboundLink(this, 'Outbound Links', 'http://sitelink.tld');">
Can someone help me figure out why the events wouldn't be showing up on the Analytics Events page?
Thanks a lot! | 3 |
10,243,783 | 04/20/2012 09:44:10 | 185,027 | 10/06/2009 14:39:49 | 171 | 9 | Creating an ad-hoc query system | I'm trying to get information about the creation of a little query system for a software. As far as I know there are applications that let the user work against data with the combination of some pre-stablished parameters (as reporting, charting, etc).
Maybe not, but I would like to know if I can take benefit of some collection of patterns or maybe concrete literature/technology.
The project will be developed in C# (.NET 4).
Thanks a lot.
| c# | design | design-patterns | architecture | null | 04/20/2012 19:53:22 | not constructive | Creating an ad-hoc query system
===
I'm trying to get information about the creation of a little query system for a software. As far as I know there are applications that let the user work against data with the combination of some pre-stablished parameters (as reporting, charting, etc).
Maybe not, but I would like to know if I can take benefit of some collection of patterns or maybe concrete literature/technology.
The project will be developed in C# (.NET 4).
Thanks a lot.
| 4 |
11,653,847 | 07/25/2012 15:59:07 | 1,549,435 | 07/24/2012 17:17:46 | 11 | 4 | How do I make a thread sleep for the UI to give it some task | I am trying to launch a thread when an application starts and wait for UI to give it some work without using BackgroundWorker. This thread sleeps when no work is given, and wakes up when the ui asks it do something.
| c# | multithreading | null | null | null | 07/25/2012 20:40:46 | not a real question | How do I make a thread sleep for the UI to give it some task
===
I am trying to launch a thread when an application starts and wait for UI to give it some work without using BackgroundWorker. This thread sleeps when no work is given, and wakes up when the ui asks it do something.
| 1 |
8,412,918 | 12/07/2011 09:22:02 | 1,080,246 | 12/04/2011 16:27:35 | 21 | 3 | what caused "Data Transfer Interrupted" on a ssh tunnel connection? | I try to connect to twitter through an ssh tunnel and got "Data Transfer Interrupted" error . The ssh tunnel is made by "ssh -D 8118 ... " command and seamonkey 2.5 is set to use local socks 5 proxy 127.0.0.1:8118.
it worked well until recently, but I didn't make any changes to remote server neither local workstation. Then I tried with firefox 8 and it works! As I know seamonkey seems on the same codebase with firefox, it makes thing even more strange.
I googled for a while and didn't find an explanation. So what this the cause for error? Thanks a lot. | firefox | ssh | tunnel | null | null | 12/07/2011 22:23:07 | off topic | what caused "Data Transfer Interrupted" on a ssh tunnel connection?
===
I try to connect to twitter through an ssh tunnel and got "Data Transfer Interrupted" error . The ssh tunnel is made by "ssh -D 8118 ... " command and seamonkey 2.5 is set to use local socks 5 proxy 127.0.0.1:8118.
it worked well until recently, but I didn't make any changes to remote server neither local workstation. Then I tried with firefox 8 and it works! As I know seamonkey seems on the same codebase with firefox, it makes thing even more strange.
I googled for a while and didn't find an explanation. So what this the cause for error? Thanks a lot. | 2 |
7,004,576 | 08/10/2011 00:18:29 | 850,990 | 07/18/2011 23:36:43 | 43 | 0 | Can I send a SelectList through the UIHint Control Parameters? | Can I send a SelectList through a Data Annotation? Something like...
[UIHint("DropDownList", "", new SelectList(new[] {"one","two","three"}))]
public virtual int? OptionID { get; set; }
I don't understand the syntax but this seems possible. If so, how do I access it from an editor template?
If not, how could I dynamically send a SelectList to a DropDownList Editor Template? I specifically would like to avoid making a separate template for every SelectList - I have too many of them. Thanks | asp.net-mvc | asp.net-mvc-3 | dataannotations | selectlist | mvc-editor-templates | null | open | Can I send a SelectList through the UIHint Control Parameters?
===
Can I send a SelectList through a Data Annotation? Something like...
[UIHint("DropDownList", "", new SelectList(new[] {"one","two","three"}))]
public virtual int? OptionID { get; set; }
I don't understand the syntax but this seems possible. If so, how do I access it from an editor template?
If not, how could I dynamically send a SelectList to a DropDownList Editor Template? I specifically would like to avoid making a separate template for every SelectList - I have too many of them. Thanks | 0 |
9,247,559 | 02/12/2012 08:53:31 | 1,204,863 | 02/12/2012 08:28:52 | 1 | 0 | Keep My App alive - Android | I'm trying to make an App on Android 2.2 that has to run whether the screen is on or off.
I tried realizing it via a Service, but when my phone turns the screen off the service stopps working and I don't understand why.
In my Application I use
startService(new Intent(this, MyService.class));
when the User presses a button
and
Notification notification = new Notification();
startForeground(1, notification);
in the onCreate-Method of the Service class
(I tried it within the onStart() Method, too)
(I also could not find out what the id-field of startForeground() expects so I used the 1)
The service then should start an infinite vibration pattern of the phone so I know whether it is running or not.
But when I turn off the screen, the phone stops vibration immediately
Please help me. I don't know how I can fix that (and google was not a big help)
Sincerely
zed
| android | null | null | null | null | null | open | Keep My App alive - Android
===
I'm trying to make an App on Android 2.2 that has to run whether the screen is on or off.
I tried realizing it via a Service, but when my phone turns the screen off the service stopps working and I don't understand why.
In my Application I use
startService(new Intent(this, MyService.class));
when the User presses a button
and
Notification notification = new Notification();
startForeground(1, notification);
in the onCreate-Method of the Service class
(I tried it within the onStart() Method, too)
(I also could not find out what the id-field of startForeground() expects so I used the 1)
The service then should start an infinite vibration pattern of the phone so I know whether it is running or not.
But when I turn off the screen, the phone stops vibration immediately
Please help me. I don't know how I can fix that (and google was not a big help)
Sincerely
zed
| 0 |
9,084,053 | 01/31/2012 17:27:00 | 922,768 | 09/01/2011 03:18:49 | 60 | 0 | Looking for a easy, simple and free WYSIWYG web page editor | I am looking for a free, very easy to use and simple WYSIWYG web page editor which can let me create web pages in just a few minutes for my lab group. I have searched and googled a lot online. Most of them seems very fancy and require lot of times to learn before creating a web page. I am getting very confused. Can some one recommend a very easy drag-drop web page editor without having html knowledge. Here are expections and tasks I like for the web pages editor.
1) I need to create a few web pages soon so hope it only requires me a few minutes to learn . I do not need fancy flash or other features.
2) I have little knowledge of html so hope it has just drag-drop Window office Word type features.
3) Tasks for the web pages:
a) A homepage which shows a summary of our experiments which includes links, texts and word tables
b) All links will links to a few window office excels worksheets so the web editor should let me link to excel files and other window office word files.
c) My OS is Window 7.
That's all I need. I just need a free, very simple, very easy web page editor which let me put a few links and all these links connect to either excel files, word files, Power-points files or notepad files. That's it.
Thank you very much
| html | excel | editor | wysiwyg | null | 01/31/2012 17:33:25 | not constructive | Looking for a easy, simple and free WYSIWYG web page editor
===
I am looking for a free, very easy to use and simple WYSIWYG web page editor which can let me create web pages in just a few minutes for my lab group. I have searched and googled a lot online. Most of them seems very fancy and require lot of times to learn before creating a web page. I am getting very confused. Can some one recommend a very easy drag-drop web page editor without having html knowledge. Here are expections and tasks I like for the web pages editor.
1) I need to create a few web pages soon so hope it only requires me a few minutes to learn . I do not need fancy flash or other features.
2) I have little knowledge of html so hope it has just drag-drop Window office Word type features.
3) Tasks for the web pages:
a) A homepage which shows a summary of our experiments which includes links, texts and word tables
b) All links will links to a few window office excels worksheets so the web editor should let me link to excel files and other window office word files.
c) My OS is Window 7.
That's all I need. I just need a free, very simple, very easy web page editor which let me put a few links and all these links connect to either excel files, word files, Power-points files or notepad files. That's it.
Thank you very much
| 4 |
7,697,303 | 10/08/2011 14:02:10 | 730,815 | 04/29/2011 09:56:34 | 21 | 0 | Free Rich text editor with browse images and upload image (PHP) | Free Rich text editor with browse images and upload image (PHP).
Could you guide me to free rich text editor with browse image and upload image ?
Best regards | php | null | null | null | null | 10/08/2011 14:18:45 | not a real question | Free Rich text editor with browse images and upload image (PHP)
===
Free Rich text editor with browse images and upload image (PHP).
Could you guide me to free rich text editor with browse image and upload image ?
Best regards | 1 |
6,465,403 | 06/24/2011 08:44:16 | 134,227 | 07/07/2009 12:34:07 | 104 | 14 | Refresh comments section | I have put together a JQuery script that when entering a comment, it goes to a database and pulls the result back and displays it on the page. This works well, however I need a seperate page with just the comments on, which auto refreshes the results every 5 seconds (instead of clicking refresh on the browser). What I would also like is for the comments to FadeIn. I have tried to do this with resources I have found online, but most of them seem to keep replicating my content as well as refreshing.
Can you help?
***Summary: Comments page has the form and shows the comments, moderator page only shows the comments (this page needs to auto refresh).***
**Comments page:**
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="comments.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Live Comments</title>
</head>
<body>
<div id="leaveComment">
<h2>Leave a Comment</h2>
<div class="row">
<label>Your Name:</label>
<input type="text">
</div>
<div class="row">
<label>Comment:</label>
<textarea cols="10" rows="5"></textarea>
</div>
<button id="add">Add</button>
</div>
<div id="comments">
<h2>Live Comments</h2>
</div>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript">
$(function() {
//retrieve comments to display on page
$.getJSON("comments.php?jsoncallback=?", function(data) {
//loop through all items in the JSON array
for (var x = 0; x < data.length; x++) {
//create a container for each comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text(data[x].name).appendTo(div);
$("<div>").addClass("comment").text(data[x].comment).appendTo(div);
}
});
//add click handler for button
$("#add").click(function() {
//define ajax config object
var ajaxOpts = {
type: "post",
url: "addComment.php",
data: "&author=" + $("#leaveComment").find("input").val() + "&comment=" + $("#leaveComment").find("textarea").val(),
success: function(data) {
//create a container for the new comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text($("#leaveComment").find("input").val()).appendTo(div);
$("<div>").addClass("comment").text($("#leaveComment").find("textarea").val()).appendTo(div).fadeIn("slow");
//empty inputs
$("#leaveComment").find("input").val("");
$("#leaveComment").find("textarea").val("");
}
};
$.ajax(ajaxOpts);
});
});
</script>
</body>
</html>
**Moderator page**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="comments.css">
</head>
<body>
<div id="comments">
<h2>Live Comments</h2>
</div>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript">
$(function() {
//retrieve comments to display on page
$.getJSON("comments.php?jsoncallback=?", function(data) {
//loop through all items in the JSON array
for (var x = 0; x < data.length; x++) {
//create a container for each comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text(data[x].name).appendTo(div);
$("<div>").addClass("comment").text(data[x].comment).appendTo(div);
}
});
//add click handler for button
$("#add").click(function() {
//define ajax config object
var ajaxOpts = {
type: "post",
url: "addComment.php",
data: "&author=" + $("#leaveComment").find("input").val() + "&comment=" + $("#leaveComment").find("textarea").val(),
success: function(data) {
//create a container for the new comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text($("#leaveComment").find("input").val()).appendTo(div);
$("<div>").addClass("comment").text($("#leaveComment").find("textarea").val()).appendTo(div);
//empty inputs
$("#leaveComment").find("input").val("");
$("#leaveComment").find("textarea").val("");
}
};
$.ajax(ajaxOpts);
});
});
</script>
</body>
</html>
| php | javascript | jquery | json | null | 06/25/2011 02:17:05 | not a real question | Refresh comments section
===
I have put together a JQuery script that when entering a comment, it goes to a database and pulls the result back and displays it on the page. This works well, however I need a seperate page with just the comments on, which auto refreshes the results every 5 seconds (instead of clicking refresh on the browser). What I would also like is for the comments to FadeIn. I have tried to do this with resources I have found online, but most of them seem to keep replicating my content as well as refreshing.
Can you help?
***Summary: Comments page has the form and shows the comments, moderator page only shows the comments (this page needs to auto refresh).***
**Comments page:**
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<link rel="stylesheet" type="text/css" href="comments.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Live Comments</title>
</head>
<body>
<div id="leaveComment">
<h2>Leave a Comment</h2>
<div class="row">
<label>Your Name:</label>
<input type="text">
</div>
<div class="row">
<label>Comment:</label>
<textarea cols="10" rows="5"></textarea>
</div>
<button id="add">Add</button>
</div>
<div id="comments">
<h2>Live Comments</h2>
</div>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript">
$(function() {
//retrieve comments to display on page
$.getJSON("comments.php?jsoncallback=?", function(data) {
//loop through all items in the JSON array
for (var x = 0; x < data.length; x++) {
//create a container for each comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text(data[x].name).appendTo(div);
$("<div>").addClass("comment").text(data[x].comment).appendTo(div);
}
});
//add click handler for button
$("#add").click(function() {
//define ajax config object
var ajaxOpts = {
type: "post",
url: "addComment.php",
data: "&author=" + $("#leaveComment").find("input").val() + "&comment=" + $("#leaveComment").find("textarea").val(),
success: function(data) {
//create a container for the new comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text($("#leaveComment").find("input").val()).appendTo(div);
$("<div>").addClass("comment").text($("#leaveComment").find("textarea").val()).appendTo(div).fadeIn("slow");
//empty inputs
$("#leaveComment").find("input").val("");
$("#leaveComment").find("textarea").val("");
}
};
$.ajax(ajaxOpts);
});
});
</script>
</body>
</html>
**Moderator page**
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" type="text/css" href="comments.css">
</head>
<body>
<div id="comments">
<h2>Live Comments</h2>
</div>
<script type="text/javascript" src="jquery-1.6.1.min.js"></script>
<script type="text/javascript">
$(function() {
//retrieve comments to display on page
$.getJSON("comments.php?jsoncallback=?", function(data) {
//loop through all items in the JSON array
for (var x = 0; x < data.length; x++) {
//create a container for each comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text(data[x].name).appendTo(div);
$("<div>").addClass("comment").text(data[x].comment).appendTo(div);
}
});
//add click handler for button
$("#add").click(function() {
//define ajax config object
var ajaxOpts = {
type: "post",
url: "addComment.php",
data: "&author=" + $("#leaveComment").find("input").val() + "&comment=" + $("#leaveComment").find("textarea").val(),
success: function(data) {
//create a container for the new comment
var div = $("<div>").addClass("row").appendTo("#comments");
//add author name and comment to container
$("<label>").text($("#leaveComment").find("input").val()).appendTo(div);
$("<div>").addClass("comment").text($("#leaveComment").find("textarea").val()).appendTo(div);
//empty inputs
$("#leaveComment").find("input").val("");
$("#leaveComment").find("textarea").val("");
}
};
$.ajax(ajaxOpts);
});
});
</script>
</body>
</html>
| 1 |
11,571,660 | 07/20/2012 01:30:30 | 1,538,099 | 07/19/2012 13:48:01 | 1 | 0 | Where can i learn debugging on code blocks | ok so i want to learn how to debug on code blocks.
im new to the ide and have little experience with debugging on visual studio.
please give me a good source to learn debugging for code blocks. | c++ | null | null | null | null | 07/20/2012 11:43:18 | not constructive | Where can i learn debugging on code blocks
===
ok so i want to learn how to debug on code blocks.
im new to the ide and have little experience with debugging on visual studio.
please give me a good source to learn debugging for code blocks. | 4 |
6,378,398 | 06/16/2011 20:47:43 | 802,279 | 06/16/2011 20:47:43 | 1 | 0 | VBS script to copy file and then copy filepath and filename to clipboard | I am trying to find a script that will let me right-click on a file in XP (or 7) and then choose and option (like "Copy to MyServer").
That would copy the file to the set location, and then it would then copy the filepath and name of the file to the clipboard so that I could paste that location into something else. (I want to paste it into my helpdesk ticket that only accepts URLs for pictures.)
So essentially this would let me copy a picture on my computer to a specific server and then paste the location into my form. Make sense?
I found some VBS code that will copy a file, and some VBS code that will let me right-click a file to get the location displayed. But I have no idea how to combine them. Any ideas on how to do this?
Copy code:
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "\\file to be copied path", "\\destination directory"
Get path code (requires a registry edit to show up in the context menu):
set oFso = createObject("scripting.filesystemobject")
if wscript.arguments.count >= 1 then
strPath = wscript.arguments(0)
strDriveName = ofso.GetDriveName(strPath)
set oDrive = ofso.GetDrive(strDriveName)
Select Case oDrive.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
strFileName = ofso.GetFileName(strPath)
test = inputbox("The path is...","Path", strPath)
else
msgbox "no args"
end if | vbscript | copy | filenames | paste | filepath | null | open | VBS script to copy file and then copy filepath and filename to clipboard
===
I am trying to find a script that will let me right-click on a file in XP (or 7) and then choose and option (like "Copy to MyServer").
That would copy the file to the set location, and then it would then copy the filepath and name of the file to the clipboard so that I could paste that location into something else. (I want to paste it into my helpdesk ticket that only accepts URLs for pictures.)
So essentially this would let me copy a picture on my computer to a specific server and then paste the location into my form. Make sense?
I found some VBS code that will copy a file, and some VBS code that will let me right-click a file to get the location displayed. But I have no idea how to combine them. Any ideas on how to do this?
Copy code:
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.CopyFile "\\file to be copied path", "\\destination directory"
Get path code (requires a registry edit to show up in the context menu):
set oFso = createObject("scripting.filesystemobject")
if wscript.arguments.count >= 1 then
strPath = wscript.arguments(0)
strDriveName = ofso.GetDriveName(strPath)
set oDrive = ofso.GetDrive(strDriveName)
Select Case oDrive.DriveType
Case 0: t = "Unknown"
Case 1: t = "Removable"
Case 2: t = "Fixed"
Case 3: t = "Network"
Case 4: t = "CD-ROM"
Case 5: t = "RAM Disk"
End Select
strFileName = ofso.GetFileName(strPath)
test = inputbox("The path is...","Path", strPath)
else
msgbox "no args"
end if | 0 |
3,561,408 | 08/24/2010 22:04:26 | 428,568 | 08/23/2010 15:38:13 | 11 | 0 | highlight link and make it do 2 functions | I need several functionalities within a link.
When you mouse over a text link:
1. A row is highlighted.
2. An icon is displayed next to a link
3. Upon clicking text link you go to yahoo.com
4. Upon clicking an icon a window pops!
[1]: http://i.stack.imgur.com/JNIe3.gif | highlighting | highlight | null | null | null | 08/25/2010 19:52:52 | not a real question | highlight link and make it do 2 functions
===
I need several functionalities within a link.
When you mouse over a text link:
1. A row is highlighted.
2. An icon is displayed next to a link
3. Upon clicking text link you go to yahoo.com
4. Upon clicking an icon a window pops!
[1]: http://i.stack.imgur.com/JNIe3.gif | 1 |
7,708,569 | 10/10/2011 04:32:54 | 766,135 | 05/23/2011 14:00:40 | 19 | 1 | Apache Wicket and Ajax PUSH | do you know some "cool" java library for Apache Wicket, which be able to do Ajax PUSH? I watched for some solution on the Wicket pages, but it looks like there is nothing :-( There is some ICE Wicket PUSH project (ICEfaces), but alpha version only... I need some simple and stable solution :-)
Thank you for advice. | wicket | ajax-push | null | null | null | null | open | Apache Wicket and Ajax PUSH
===
do you know some "cool" java library for Apache Wicket, which be able to do Ajax PUSH? I watched for some solution on the Wicket pages, but it looks like there is nothing :-( There is some ICE Wicket PUSH project (ICEfaces), but alpha version only... I need some simple and stable solution :-)
Thank you for advice. | 0 |
3,892,810 | 10/08/2010 17:15:36 | 247,007 | 01/09/2010 10:20:10 | 80 | 5 | C# webbrowser alters source | I have a webbrowser control which I navigate to an URL that contains this html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title></title>
</head>
<body marginheight="60" topmargin="60">
<p align="center"><img src="nocontent.jpg" alt="" height="434" width="525" border="0" /></p>
</body>
</html>
But when I use this code to fetch the source:
HTMLDocument objHtmlDoc = (HTMLDocument)browser.Document.DomDocument;
string pageSource = objHtmlDoc.documentElement.innerHTML;
Console.WriteLine(pageSource);
This is the result:
<HEAD><TITLE></TITLE>
<META content=text/html;charset=utf-8 http-equiv=content-type></HEAD>
<BODY topMargin=60 marginheight="60">
<P align=center><IMG border=0 alt="" src="nocontent.jpg" width=525 height=434></P></BODY>
This is no good for further processing, how can I make sure it shows the same source as when I would rightclick it and select "view source"?
| c# | webbrowser-control | null | null | null | null | open | C# webbrowser alters source
===
I have a webbrowser control which I navigate to an URL that contains this html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<title></title>
</head>
<body marginheight="60" topmargin="60">
<p align="center"><img src="nocontent.jpg" alt="" height="434" width="525" border="0" /></p>
</body>
</html>
But when I use this code to fetch the source:
HTMLDocument objHtmlDoc = (HTMLDocument)browser.Document.DomDocument;
string pageSource = objHtmlDoc.documentElement.innerHTML;
Console.WriteLine(pageSource);
This is the result:
<HEAD><TITLE></TITLE>
<META content=text/html;charset=utf-8 http-equiv=content-type></HEAD>
<BODY topMargin=60 marginheight="60">
<P align=center><IMG border=0 alt="" src="nocontent.jpg" width=525 height=434></P></BODY>
This is no good for further processing, how can I make sure it shows the same source as when I would rightclick it and select "view source"?
| 0 |
10,346,157 | 04/27/2012 06:58:24 | 1,306,570 | 04/01/2012 16:54:40 | 11 | 0 | Using DS-5 CE to compile .APK with Google API 10 in Window 7 | When I using DS-5 CE to compile .APK with Google API 10 in Window 7, it always fail.
The error msg is can't find google map lib.
Is it DS-5 CE that don't support Google API?
If true, how to link it ? | android | null | null | null | null | null | open | Using DS-5 CE to compile .APK with Google API 10 in Window 7
===
When I using DS-5 CE to compile .APK with Google API 10 in Window 7, it always fail.
The error msg is can't find google map lib.
Is it DS-5 CE that don't support Google API?
If true, how to link it ? | 0 |
11,324,358 | 07/04/2012 07:30:42 | 501,778 | 11/09/2010 10:53:47 | 220 | 0 | How to view the contents of .dat file in linux | I have a file with .dat extension how can i view the contents of the file in hexa ? mean if i open the file i should be able to see the contents in hex format, can this be done using vim editor. I have installed tnef but when i try opening this dat file it says "Seems not to be a TNEF file" | linux | null | null | null | null | 07/04/2012 07:48:35 | off topic | How to view the contents of .dat file in linux
===
I have a file with .dat extension how can i view the contents of the file in hexa ? mean if i open the file i should be able to see the contents in hex format, can this be done using vim editor. I have installed tnef but when i try opening this dat file it says "Seems not to be a TNEF file" | 2 |
4,958,573 | 02/10/2011 14:52:20 | 21,935 | 09/24/2008 23:35:17 | 93 | 6 | Java's swing print() usage | Does java's swing print() have to be called on the EDT (event dispatch thread)?
It is taking an extended amount of time to execute and long running things being on the EDT are a pain, as we all know. | java | swing | printing | null | null | null | open | Java's swing print() usage
===
Does java's swing print() have to be called on the EDT (event dispatch thread)?
It is taking an extended amount of time to execute and long running things being on the EDT are a pain, as we all know. | 0 |
1,106,683 | 07/09/2009 22:06:50 | 122,321 | 06/12/2009 23:11:19 | 862 | 42 | What is this particular type of revelation called? | After struggling with a particular problem or bug in some part of my code for hours, without getting anywhere,
I often get a sudden revelation as soon as I try to explain the problem to one of my coworkers, or while formulating it in writing for posting to some forum.
Does this kind of experience have a name?
Where can I read more about it and how to train it? Do any of you use this consciously in your day-to-day work?
| debugging | terminology | self-improvement | productivity | null | 03/04/2012 05:35:43 | off topic | What is this particular type of revelation called?
===
After struggling with a particular problem or bug in some part of my code for hours, without getting anywhere,
I often get a sudden revelation as soon as I try to explain the problem to one of my coworkers, or while formulating it in writing for posting to some forum.
Does this kind of experience have a name?
Where can I read more about it and how to train it? Do any of you use this consciously in your day-to-day work?
| 2 |
10,229,722 | 04/19/2012 14:01:12 | 507,323 | 11/14/2010 11:50:25 | 142 | 4 | how new spotify android app is made? | I just downloaded the new spotify android app preview on the spotify website. I installed it on my phone which has android 4. It looks beautiful, it has responsiveness etc... but I told me this app is for android 4 only. Then I tried to install it on an old phone with android 2.2 and it worked really well! That's why I'm wondering : how that application has been developped? It has the look and feel of android 4 but works in android 2.2.
Is it an android 2.2 app with a theme that looks like android 4 ?
Is it an android 4 app with a kind of backward compatibility library?
Other ideas? | android | android-4.0 | null | null | null | 04/20/2012 04:19:43 | not a real question | how new spotify android app is made?
===
I just downloaded the new spotify android app preview on the spotify website. I installed it on my phone which has android 4. It looks beautiful, it has responsiveness etc... but I told me this app is for android 4 only. Then I tried to install it on an old phone with android 2.2 and it worked really well! That's why I'm wondering : how that application has been developped? It has the look and feel of android 4 but works in android 2.2.
Is it an android 2.2 app with a theme that looks like android 4 ?
Is it an android 4 app with a kind of backward compatibility library?
Other ideas? | 1 |
196,476 | 10/13/2008 01:38:25 | 23,899 | 09/30/2008 19:25:49 | 150 | 2 | As a software developer, what are the traits that you look for in a manager? | Specifically, what are the best indicators to forecast if someone will be a great manager for a team of software developers, and also, someone that you would want to work for?
Examples:
- education
- breadth of technical knowledge
- depth of knowledge in a particular domain
- interpersonal skills
- work on open source projects
- choice of tools, operating systems, and languages
- taste in music
- etc
*Please:* **Only one trait per response,** so they can be voted up or down.
----------
This question is intentionally similar to [a question on the traits of software developers][1]. Since many software managers are software developers who got promoted, I think it will be interested to see if the traits line up.
[1]: http://stackoverflow.com/questions/196470/what-are-the-traits-that-you-look-for-in-a-software-developer | traits | manager | null | null | null | 10/25/2011 12:44:14 | not constructive | As a software developer, what are the traits that you look for in a manager?
===
Specifically, what are the best indicators to forecast if someone will be a great manager for a team of software developers, and also, someone that you would want to work for?
Examples:
- education
- breadth of technical knowledge
- depth of knowledge in a particular domain
- interpersonal skills
- work on open source projects
- choice of tools, operating systems, and languages
- taste in music
- etc
*Please:* **Only one trait per response,** so they can be voted up or down.
----------
This question is intentionally similar to [a question on the traits of software developers][1]. Since many software managers are software developers who got promoted, I think it will be interested to see if the traits line up.
[1]: http://stackoverflow.com/questions/196470/what-are-the-traits-that-you-look-for-in-a-software-developer | 4 |
9,285,555 | 02/14/2012 23:05:12 | 1,075,581 | 12/01/2011 13:56:48 | 40 | 0 | Deciding on a framework - am I thinking too hard about this? | I have a website that I have, essentially, reached the limit of what I can do with it based on the development tools I've been using.
Those tools? Notepad++. That's all.
I'm pretty impressed with how far I've come using only that, but likewise embarrassed to only recently learn about "frameworks". Oops...
I know I need to "start over" with this site. Basically, go from v1.0 to v2.0, so I can do more with it than I've already been able to. I'm attempting to select a framework to use, but it's creating quite the headache for me. **Am I worrying too much about it?** Here's where I am so far:
The site is PHP-based. Ergo, I'm looking for a PHP Framework, but I'm also attempting to allow for the integration of a Python framework in the future should I begin using that (it's possible - the site was once written with ASP Classic VBScript!).
**Can frameworks co-exist?** Meaning, can I add a Python framework into the site to exist concurrently with a PHP framework?
The frameworks I'm looking at, right now, are CakePHP, Drupal, and CodeIgniter.
The other concern I have is about becoming "married" to a framework. What if I get a month into using it and decide that it just isn't working out -- **how committed am I to continuing with it?**
I realize there's a lot I don't know, and that's what's making this question so difficult to write -- not exactly knowing what answers I need. So, if you're still reading this, I thank you sincerely for your time and patience.
Any help you can provide would be invaluable to me, as I really feel like a babe in the woods at this point. | php | drupal | codeigniter | cakephp | frameworks | 02/15/2012 01:27:43 | not constructive | Deciding on a framework - am I thinking too hard about this?
===
I have a website that I have, essentially, reached the limit of what I can do with it based on the development tools I've been using.
Those tools? Notepad++. That's all.
I'm pretty impressed with how far I've come using only that, but likewise embarrassed to only recently learn about "frameworks". Oops...
I know I need to "start over" with this site. Basically, go from v1.0 to v2.0, so I can do more with it than I've already been able to. I'm attempting to select a framework to use, but it's creating quite the headache for me. **Am I worrying too much about it?** Here's where I am so far:
The site is PHP-based. Ergo, I'm looking for a PHP Framework, but I'm also attempting to allow for the integration of a Python framework in the future should I begin using that (it's possible - the site was once written with ASP Classic VBScript!).
**Can frameworks co-exist?** Meaning, can I add a Python framework into the site to exist concurrently with a PHP framework?
The frameworks I'm looking at, right now, are CakePHP, Drupal, and CodeIgniter.
The other concern I have is about becoming "married" to a framework. What if I get a month into using it and decide that it just isn't working out -- **how committed am I to continuing with it?**
I realize there's a lot I don't know, and that's what's making this question so difficult to write -- not exactly knowing what answers I need. So, if you're still reading this, I thank you sincerely for your time and patience.
Any help you can provide would be invaluable to me, as I really feel like a babe in the woods at this point. | 4 |
5,956,241 | 05/10/2011 20:44:10 | 424,422 | 08/18/2010 18:58:26 | 186 | 22 | Recursively linking records | I have a table with timeslots that users can sign up for. On the administrative end, the admin-user can choose to 'link' two timeslots together, which basically says to the end-user, 'If you sign up for one of these timeslots, you must sign up for all other timeslots that are linked to it.' These links are stored in another table which has two columns, one being the ID of the timeslot requiring a link, and the other being the ID of the timeslot that is being linked to.
How can I make it such that when linking one timeslot with another, BOTH depend on the other being selected. This needs to be recursive for other linked timeslots as well, like the following example:
Admin says:
#1 is linked to #2
#3 is linked to #2
Therefore:
#1 is linked to #2
#2 is linked to #1
#3 is linked to #2
#2 is linked to #3
#3 is linked to #1
#1 is linked to #3
What is the best way to accomplish this? Right now I'm trying to put that information into a link table, but if there's another way that I can do it with more PHP and less SQL that would work also. I would provide a code sample, but I don't think that it would be helpful.
Edit: Conceptual answers are fine. I don't need code written for me unless for demonstrative purposes. | php | mysql | sql | null | null | null | open | Recursively linking records
===
I have a table with timeslots that users can sign up for. On the administrative end, the admin-user can choose to 'link' two timeslots together, which basically says to the end-user, 'If you sign up for one of these timeslots, you must sign up for all other timeslots that are linked to it.' These links are stored in another table which has two columns, one being the ID of the timeslot requiring a link, and the other being the ID of the timeslot that is being linked to.
How can I make it such that when linking one timeslot with another, BOTH depend on the other being selected. This needs to be recursive for other linked timeslots as well, like the following example:
Admin says:
#1 is linked to #2
#3 is linked to #2
Therefore:
#1 is linked to #2
#2 is linked to #1
#3 is linked to #2
#2 is linked to #3
#3 is linked to #1
#1 is linked to #3
What is the best way to accomplish this? Right now I'm trying to put that information into a link table, but if there's another way that I can do it with more PHP and less SQL that would work also. I would provide a code sample, but I don't think that it would be helpful.
Edit: Conceptual answers are fine. I don't need code written for me unless for demonstrative purposes. | 0 |
11,170,409 | 06/23/2012 14:46:45 | 1,116,010 | 12/26/2011 07:36:54 | 36 | 1 | How to disable cursor positioning and text selection in an EditText? (Android) | I'm searching for a way to prevent the user from moving the cursor position anywhere. The cursor should always stay at the end of the current EditText value. In addition to that the user should not be able to select anything in the EditText. Do you have any idea how to realize that in Android using an EditText?
Thank you!
Greetings
Time-Over | android | cursor | edittext | cursor-position | textselection | null | open | How to disable cursor positioning and text selection in an EditText? (Android)
===
I'm searching for a way to prevent the user from moving the cursor position anywhere. The cursor should always stay at the end of the current EditText value. In addition to that the user should not be able to select anything in the EditText. Do you have any idea how to realize that in Android using an EditText?
Thank you!
Greetings
Time-Over | 0 |
8,603,747 | 12/22/2011 12:16:37 | 1,109,305 | 12/21/2011 06:59:44 | 1 | 0 | How to load ndroid SDK and ANdroid Manager on Eclipse | Can anyone assist me in knowing how to integrate Android developing environment with Eclipse | android | android-emulator | null | null | null | 07/05/2012 15:45:02 | not a real question | How to load ndroid SDK and ANdroid Manager on Eclipse
===
Can anyone assist me in knowing how to integrate Android developing environment with Eclipse | 1 |
10,305,481 | 04/24/2012 20:24:38 | 1,336,901 | 04/16/2012 17:24:37 | 1 | 1 | phpmyadmin not showing tables that are utf8 | I set all my tables in a database to UTF8 and now when I try to access them through phpmyadmin it says that their are no tables for the database, but when I do a mysql> SHOW TABLES they are all there. Super confused on why phpmyadmin is having a hard time with this. Any help would be amazing! | utf-8 | phpmyadmin | mysql-error-2002 | null | null | null | open | phpmyadmin not showing tables that are utf8
===
I set all my tables in a database to UTF8 and now when I try to access them through phpmyadmin it says that their are no tables for the database, but when I do a mysql> SHOW TABLES they are all there. Super confused on why phpmyadmin is having a hard time with this. Any help would be amazing! | 0 |
8,426,824 | 12/08/2011 05:58:36 | 616,971 | 02/14/2011 22:40:01 | 80 | 4 | Core Data binding to NSTableView automatically | Just wondering if there is a binding that can be set from an NSTableView to an Array Controller that is setup to read from Core Data that will automatically label all the columns and populate the table.
I can bind individual columns no problem but was just wondering if there was a faster way that didn't involve manually labelling the columns.
Thanks for your help, Ben | osx | cocoa | core-data | null | null | null | open | Core Data binding to NSTableView automatically
===
Just wondering if there is a binding that can be set from an NSTableView to an Array Controller that is setup to read from Core Data that will automatically label all the columns and populate the table.
I can bind individual columns no problem but was just wondering if there was a faster way that didn't involve manually labelling the columns.
Thanks for your help, Ben | 0 |
3,696,685 | 09/12/2010 21:25:28 | 434,340 | 08/29/2010 17:43:13 | 135 | 15 | For business, which OS is more secure: Windows 7 or OSX 10.6? | I've seen the outcomes of certain hacking competitions yield varied results and the argument over which OS is currently more secure has never seemed to go beyond an anecdotal level. I currently split my development (PHP, MySQL web applications which handle sensitive transcript information, among others) 50% between OSX Snow Leopard and Windows 7. Is there an argument for either from a security stand point? | windows | security | osx | operating-system | hacking | 09/12/2010 21:30:13 | not constructive | For business, which OS is more secure: Windows 7 or OSX 10.6?
===
I've seen the outcomes of certain hacking competitions yield varied results and the argument over which OS is currently more secure has never seemed to go beyond an anecdotal level. I currently split my development (PHP, MySQL web applications which handle sensitive transcript information, among others) 50% between OSX Snow Leopard and Windows 7. Is there an argument for either from a security stand point? | 4 |
10,938,909 | 06/07/2012 19:55:25 | 1,294,236 | 03/26/2012 23:29:32 | 1 | 0 | MS Dynamic CRM 2011: How do I download an attachment from an annotation using client-side JScript? | I'm trying to provide a link to the attachment of a note through the client-side JScript. The standard MS-made Notes component does this through the following url:
[serverurl]/[appname]/Activities/Attachment/download.aspx?AttachmentType=5&AttachmentId={blahblahblah}&IsNotesTabAttachment=1&CRMWRPCToken=blahblahblah&CRMWRPCTokenTimeStamp=blahblahblah
The problem is that I don't know how to get the Token or TokenTimeStamp, so I'm receiving an Access Denied error ("form is no longer available, security precaution, etc").
The only other way I can think of doing this is through the OData endpoint, but that would at best get me a base64 string that I still would have translate into a filestream to give to the browser (all of which seems like it would take forever to implement/figure out).
I've found a few other posts that describe the same thing, but no one has answered them:
http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/6eb9e0d4-0c0c-4769-ab36-345fbfc9754f/
http://social.microsoft.com/Forums/is/crm/thread/45dabb6e-1c6c-4cb4-85a4-261fa58c04da | file-download | client-side | dynamics-crm-2011 | jscript | null | null | open | MS Dynamic CRM 2011: How do I download an attachment from an annotation using client-side JScript?
===
I'm trying to provide a link to the attachment of a note through the client-side JScript. The standard MS-made Notes component does this through the following url:
[serverurl]/[appname]/Activities/Attachment/download.aspx?AttachmentType=5&AttachmentId={blahblahblah}&IsNotesTabAttachment=1&CRMWRPCToken=blahblahblah&CRMWRPCTokenTimeStamp=blahblahblah
The problem is that I don't know how to get the Token or TokenTimeStamp, so I'm receiving an Access Denied error ("form is no longer available, security precaution, etc").
The only other way I can think of doing this is through the OData endpoint, but that would at best get me a base64 string that I still would have translate into a filestream to give to the browser (all of which seems like it would take forever to implement/figure out).
I've found a few other posts that describe the same thing, but no one has answered them:
http://social.microsoft.com/Forums/en-US/crmdevelopment/thread/6eb9e0d4-0c0c-4769-ab36-345fbfc9754f/
http://social.microsoft.com/Forums/is/crm/thread/45dabb6e-1c6c-4cb4-85a4-261fa58c04da | 0 |
11,174,014 | 06/24/2012 00:10:10 | 554,019 | 12/25/2010 22:37:39 | 669 | 6 | How lync sdk work with iis | When i create object from LyncClient class to get Current Client it doesn't work
this is my code
if (!IsPostBack)
{
try
{
_lyncClient = Microsoft.Lync.Model.LyncClient.GetClient();
_contactManager = _lyncClient.ContactManager;
}
catch
{
Response.Write("Error");
}
var contactlist = DB.GetContactListByURI(_lyncClient.Uri).ToList();
if (contactlist != null)
{
var groups = DB.GetGroupsInContactList(contactlist.FirstOrDefault().Id).ToList();
foreach (var group in groups)
{
_contactManager = _lyncClient.ContactManager;
try
{
if (!_contactManager.Groups.Any(g => g.Name == group.GroupName))
{
_contactManager.BeginAddGroup(group.GroupName, result => _contactManager.EndAddGroup(result), null);
waitGroup.WaitOne(2000);
}
else
{
return;
}
}
catch
{
Response.Write("Please Open Your Lync Comunicator.");
return;
}
var contacts = DB.GetContactsInGroup(group.Id).ToList();
foreach (var contact in contacts)
{
_lyncClient = Microsoft.Lync.Model.LyncClient.GetClient();
_contactManager = _lyncClient.ContactManager;
_group = _contactManager.Groups.Where(gr => gr.Name == group.GroupName).FirstOrDefault();
if (contact.ContactName == _lyncClient.Uri)
{
continue;
}
string URI = contact.ContactName;
IAsyncResult reslt = _group.BeginAddContact(_contactManager.GetContactByUri(URI),
null, null);
_group.EndAddContact(reslt);
waitContact.WaitOne(2000);
}
}
Response.Write("Your Lync Comunicator Updated.");
}
}
} | iis7 | lync | null | null | null | 06/24/2012 01:48:31 | not a real question | How lync sdk work with iis
===
When i create object from LyncClient class to get Current Client it doesn't work
this is my code
if (!IsPostBack)
{
try
{
_lyncClient = Microsoft.Lync.Model.LyncClient.GetClient();
_contactManager = _lyncClient.ContactManager;
}
catch
{
Response.Write("Error");
}
var contactlist = DB.GetContactListByURI(_lyncClient.Uri).ToList();
if (contactlist != null)
{
var groups = DB.GetGroupsInContactList(contactlist.FirstOrDefault().Id).ToList();
foreach (var group in groups)
{
_contactManager = _lyncClient.ContactManager;
try
{
if (!_contactManager.Groups.Any(g => g.Name == group.GroupName))
{
_contactManager.BeginAddGroup(group.GroupName, result => _contactManager.EndAddGroup(result), null);
waitGroup.WaitOne(2000);
}
else
{
return;
}
}
catch
{
Response.Write("Please Open Your Lync Comunicator.");
return;
}
var contacts = DB.GetContactsInGroup(group.Id).ToList();
foreach (var contact in contacts)
{
_lyncClient = Microsoft.Lync.Model.LyncClient.GetClient();
_contactManager = _lyncClient.ContactManager;
_group = _contactManager.Groups.Where(gr => gr.Name == group.GroupName).FirstOrDefault();
if (contact.ContactName == _lyncClient.Uri)
{
continue;
}
string URI = contact.ContactName;
IAsyncResult reslt = _group.BeginAddContact(_contactManager.GetContactByUri(URI),
null, null);
_group.EndAddContact(reslt);
waitContact.WaitOne(2000);
}
}
Response.Write("Your Lync Comunicator Updated.");
}
}
} | 1 |
6,312,470 | 06/10/2011 21:54:41 | 775,187 | 05/29/2011 14:03:53 | 84 | 2 | web data extractor | sometimes I see a table column in html on webpage and I would like to copy it, is there such tool/extension that allow me to do this?<br/>
for example, I need a table with 2 columns and I would to copy just the first column. | html | firefox | extension | null | null | null | open | web data extractor
===
sometimes I see a table column in html on webpage and I would like to copy it, is there such tool/extension that allow me to do this?<br/>
for example, I need a table with 2 columns and I would to copy just the first column. | 0 |
4,747,573 | 01/20/2011 13:17:14 | 288,362 | 03/07/2010 20:44:42 | 110 | 1 | Rails 3 routes for page | I have a page_controller with a few actions (dashboard, rules, contact). Each has a corresponding view. I don't know how to route it in Rails 3.
match 'page/:action' => 'page#:action'
The above doesn't work - what I would like is named routes like: page_path(:dashboard) or page_dashboard_path.
Any ideas?
- Jacob | ruby-on-rails-3 | null | null | null | null | null | open | Rails 3 routes for page
===
I have a page_controller with a few actions (dashboard, rules, contact). Each has a corresponding view. I don't know how to route it in Rails 3.
match 'page/:action' => 'page#:action'
The above doesn't work - what I would like is named routes like: page_path(:dashboard) or page_dashboard_path.
Any ideas?
- Jacob | 0 |
9,680,881 | 03/13/2012 08:56:34 | 1,206,494 | 02/13/2012 09:58:11 | 11 | 0 | Make changes to PHP script to run as Perl script | I have a PHP script for seperating the header and text of an email. I wanted to convert it to a PERL script such that it will take the email as input file from the user.
The following is the PHP script:
#!/usr/bin/php
<?php
//debug
#ini_set ("display_errors", "1");
#error_reporting(E_ALL);
//include email parser
require_once('/path/to/class/rfc822_addresses.php');
require_once('/path/to/class/mime_parser.php');
// read email in from stdin
$fd = fopen(ARGV[0], "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
//create the email parser class
$mime=new mime_parser_class;
$mime->ignore_syntax_errors = 1;
$parameters=array(
'Data'=>$email,
);
$mime->Decode($parameters, $decoded);
//---------------------- GET EMAIL HEADER INFO -----------------------//
//get the name and email of the sender
$fromName = $decoded[0]['ExtractedAddresses']['from:'][0]['name'];
$fromEmail = $decoded[0]['ExtractedAddresses']['from:'][0]['address'];
//get the name and email of the recipient
$toEmail = $decoded[0]['ExtractedAddresses']['to:'][0]['address'];
$toName = $decoded[0]['ExtractedAddresses']['to:'][0]['name'];
//get the subject
$subject = $decoded[0]['Headers']['subject:'];
$removeChars = array('<','>');
//get the message id
$messageID = str_replace($removeChars,'',$decoded[0]['Headers']['message-id:']);
//get the reply id
$replyToID = str_replace($removeChars,'',$decoded[0]['Headers']['in-reply-to:']);
//---------------------- FIND THE BODY -----------------------//
//get the message body
if(substr($decoded[0]['Headers']['content-type:'],0,strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Body'])){
$body = $decoded[0]['Body'];
} elseif(substr($decoded[0]['Parts'][0]['Headers']['content-type:'],0,strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Parts'][0]['Body'])) {
$body = $decoded[0]['Parts'][0]['Body'];
} elseif(substr($decoded[0]['Parts'][0]['Parts'][0]['Headers']['content-type:'],0,strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Parts'][0]['Parts'][0]['Body'])) {
$body = $decoded[0]['Parts'][0]['Parts'][0]['Body'];
}
//print out our data
echo "
Message ID: $messageID
Reply ID: $replyToID
Subject: $subject
To: $toName $toEmail
From: $fromName $fromEmail
Body: $body
";
//show all the decoded email info
print_r($decoded);
I just needed to know what changes should i make to make it run as a perl script?? | php | perl | null | null | null | 03/16/2012 04:05:11 | not a real question | Make changes to PHP script to run as Perl script
===
I have a PHP script for seperating the header and text of an email. I wanted to convert it to a PERL script such that it will take the email as input file from the user.
The following is the PHP script:
#!/usr/bin/php
<?php
//debug
#ini_set ("display_errors", "1");
#error_reporting(E_ALL);
//include email parser
require_once('/path/to/class/rfc822_addresses.php');
require_once('/path/to/class/mime_parser.php');
// read email in from stdin
$fd = fopen(ARGV[0], "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
//create the email parser class
$mime=new mime_parser_class;
$mime->ignore_syntax_errors = 1;
$parameters=array(
'Data'=>$email,
);
$mime->Decode($parameters, $decoded);
//---------------------- GET EMAIL HEADER INFO -----------------------//
//get the name and email of the sender
$fromName = $decoded[0]['ExtractedAddresses']['from:'][0]['name'];
$fromEmail = $decoded[0]['ExtractedAddresses']['from:'][0]['address'];
//get the name and email of the recipient
$toEmail = $decoded[0]['ExtractedAddresses']['to:'][0]['address'];
$toName = $decoded[0]['ExtractedAddresses']['to:'][0]['name'];
//get the subject
$subject = $decoded[0]['Headers']['subject:'];
$removeChars = array('<','>');
//get the message id
$messageID = str_replace($removeChars,'',$decoded[0]['Headers']['message-id:']);
//get the reply id
$replyToID = str_replace($removeChars,'',$decoded[0]['Headers']['in-reply-to:']);
//---------------------- FIND THE BODY -----------------------//
//get the message body
if(substr($decoded[0]['Headers']['content-type:'],0,strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Body'])){
$body = $decoded[0]['Body'];
} elseif(substr($decoded[0]['Parts'][0]['Headers']['content-type:'],0,strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Parts'][0]['Body'])) {
$body = $decoded[0]['Parts'][0]['Body'];
} elseif(substr($decoded[0]['Parts'][0]['Parts'][0]['Headers']['content-type:'],0,strlen('text/plain')) == 'text/plain' && isset($decoded[0]['Parts'][0]['Parts'][0]['Body'])) {
$body = $decoded[0]['Parts'][0]['Parts'][0]['Body'];
}
//print out our data
echo "
Message ID: $messageID
Reply ID: $replyToID
Subject: $subject
To: $toName $toEmail
From: $fromName $fromEmail
Body: $body
";
//show all the decoded email info
print_r($decoded);
I just needed to know what changes should i make to make it run as a perl script?? | 1 |
10,571,457 | 05/13/2012 11:47:44 | 1,234,275 | 02/26/2012 19:27:56 | 55 | 2 | Which widget is that? | I'd like to try to create menu like this, it's very useful.
On tablets it's always on screen:
![VK][1]
On small screens & smartphones I can pull-right my screen:
![VK][2]
It reminds me the SlidingDrawer, but I think it's custom widget or smth else. What do you think about it?
[1]: http://cs5758.userapi.com/u12605908/docs/ddfeba116c65/2.png
[2]: http://cs11028.userapi.com/v11028012/466/IaUxfEM4ewU.jpg | android | android-application | null | null | null | 05/22/2012 19:51:28 | not a real question | Which widget is that?
===
I'd like to try to create menu like this, it's very useful.
On tablets it's always on screen:
![VK][1]
On small screens & smartphones I can pull-right my screen:
![VK][2]
It reminds me the SlidingDrawer, but I think it's custom widget or smth else. What do you think about it?
[1]: http://cs5758.userapi.com/u12605908/docs/ddfeba116c65/2.png
[2]: http://cs11028.userapi.com/v11028012/466/IaUxfEM4ewU.jpg | 1 |
10,677,932 | 05/20/2012 23:00:00 | 1,406,732 | 05/20/2012 20:33:13 | 1 | 0 | word.sub-word.sub-sub-word | I am new to programming so I don't know what the terminology is and I apologize. I want to be able to write something that looks like this:
Label Label1 = new Label();
Label1.Text = DateTime.Now.ToString("MM.dd.yyyy");
But with my own objects:
Reciept ReciptForAirPlaneTicket = new Reciept();
ReciptForAirPlaneTicket.MOP = MOP.CreditCard.Visa("4111111111111111|0517");
I really am not trying to be lazy, but I have been looking for almost a day now and I don't even know what to look for. I think I need to make at least a class but also a struct or something called enum but I really don't know.
I am using C#. | c# | null | null | null | null | 05/21/2012 02:34:44 | not a real question | word.sub-word.sub-sub-word
===
I am new to programming so I don't know what the terminology is and I apologize. I want to be able to write something that looks like this:
Label Label1 = new Label();
Label1.Text = DateTime.Now.ToString("MM.dd.yyyy");
But with my own objects:
Reciept ReciptForAirPlaneTicket = new Reciept();
ReciptForAirPlaneTicket.MOP = MOP.CreditCard.Visa("4111111111111111|0517");
I really am not trying to be lazy, but I have been looking for almost a day now and I don't even know what to look for. I think I need to make at least a class but also a struct or something called enum but I really don't know.
I am using C#. | 1 |
7,619,336 | 10/01/2011 09:23:27 | 900,721 | 08/18/2011 13:46:35 | 35 | 0 | Java live chat opensource | Does anybody know any Java live chat opensource? I want to embed into the application.
Please let me know.
Thanks | java | chat | live | null | null | 10/01/2011 23:41:43 | not a real question | Java live chat opensource
===
Does anybody know any Java live chat opensource? I want to embed into the application.
Please let me know.
Thanks | 1 |
898,378 | 05/22/2009 15:09:31 | 78,551 | 03/16/2009 11:51:52 | 200 | 17 | TeamBuild and Web Deployment Projects | With the new TFS 2008 and the upcoming TFS 2010, are Web Deployment Projects depreciated? We used them in our 2005 projects because we needed the multiple distribution of files across a cluster but now that TeamBuild does that, and we are just now moving out of VSS to TFS 2008, I was wondering if there was an argument to be made on removing the WDPs and just go with a strict TeamBuild solution.
We use CruiseControl.NET to build currently but was looking at moving to one solution instead of just using the CC.NET plugin to build from TFS Source Control.
Thanks all! | tfs | team-build | null | null | null | null | open | TeamBuild and Web Deployment Projects
===
With the new TFS 2008 and the upcoming TFS 2010, are Web Deployment Projects depreciated? We used them in our 2005 projects because we needed the multiple distribution of files across a cluster but now that TeamBuild does that, and we are just now moving out of VSS to TFS 2008, I was wondering if there was an argument to be made on removing the WDPs and just go with a strict TeamBuild solution.
We use CruiseControl.NET to build currently but was looking at moving to one solution instead of just using the CC.NET plugin to build from TFS Source Control.
Thanks all! | 0 |
10,718,361 | 05/23/2012 10:44:51 | 1,081,568 | 12/05/2011 12:48:27 | 13 | 2 | Extension method in where clause in linq to Entities | In linq to Entities we needed a method that works like "sql like". We have implemented our own extension method to IQueryable, because contains method not work for us because doesn't accept patterns like '%a%b%'
The created code is:
private const char WildcardCharacter = '%';
public static IQueryable<TSource> WhereLike<TSource>(this IQueryable<TSource> _source, Expression<Func<TSource, string>> _valueSelector, string _textSearch)
{
if (_valueSelector == null)
{
throw new ArgumentNullException("valueSelector");
}
return _source.Where(BuildLikeExpressionWithWildcards(_valueSelector, _textSearch));
}
private static Expression<Func<TSource, bool>> BuildLikeExpressionWithWildcards<TSource>(Expression<Func<TSource, string>> _valueSelector, string _textToSearch)
{
var method = GetPatIndexMethod();
var body = Expression.Call(method, Expression.Constant(WildcardCharacter + _textToSearch + WildcardCharacter), _valueSelector.Body);
var parameter = _valueSelector.Parameters.Single();
UnaryExpression expressionConvert = Expression.Convert(Expression.Constant(0), typeof(int?));
return Expression.Lambda<Func<TSource, bool>> (Expression.GreaterThan(body, expressionConvert), parameter);
}
private static MethodInfo GetPatIndexMethod()
{
var methodName = "PatIndex";
Type stringType = typeof(SqlFunctions);
return stringType.GetMethod(methodName);
}
This works correctly and the code is executed entirely in SqlServer, but now we would use this extension method inside where clause as:
myDBContext.MyObject.Where(o => o.Description.Like(patternToSearch) || o.Title.Like(patterToSerch));
The problem is that the methods used in the where clause have to return a bool result if is it used with operators like '||' , and I don't know how to make that the code I have created returns a bool and keep the code executed in sqlserver. I suppose that I have to convert the returned Expression by BuildLinqExpression method to bool, but I don't know how to do it
To sum up! First of all it's possible to create our own extensiond methods in Linq to Entities that execute the code in SqlServer? if this is possible how I have to do it?
Thanks for your help. | c# | entity-framework | linq-to-entities | null | null | null | open | Extension method in where clause in linq to Entities
===
In linq to Entities we needed a method that works like "sql like". We have implemented our own extension method to IQueryable, because contains method not work for us because doesn't accept patterns like '%a%b%'
The created code is:
private const char WildcardCharacter = '%';
public static IQueryable<TSource> WhereLike<TSource>(this IQueryable<TSource> _source, Expression<Func<TSource, string>> _valueSelector, string _textSearch)
{
if (_valueSelector == null)
{
throw new ArgumentNullException("valueSelector");
}
return _source.Where(BuildLikeExpressionWithWildcards(_valueSelector, _textSearch));
}
private static Expression<Func<TSource, bool>> BuildLikeExpressionWithWildcards<TSource>(Expression<Func<TSource, string>> _valueSelector, string _textToSearch)
{
var method = GetPatIndexMethod();
var body = Expression.Call(method, Expression.Constant(WildcardCharacter + _textToSearch + WildcardCharacter), _valueSelector.Body);
var parameter = _valueSelector.Parameters.Single();
UnaryExpression expressionConvert = Expression.Convert(Expression.Constant(0), typeof(int?));
return Expression.Lambda<Func<TSource, bool>> (Expression.GreaterThan(body, expressionConvert), parameter);
}
private static MethodInfo GetPatIndexMethod()
{
var methodName = "PatIndex";
Type stringType = typeof(SqlFunctions);
return stringType.GetMethod(methodName);
}
This works correctly and the code is executed entirely in SqlServer, but now we would use this extension method inside where clause as:
myDBContext.MyObject.Where(o => o.Description.Like(patternToSearch) || o.Title.Like(patterToSerch));
The problem is that the methods used in the where clause have to return a bool result if is it used with operators like '||' , and I don't know how to make that the code I have created returns a bool and keep the code executed in sqlserver. I suppose that I have to convert the returned Expression by BuildLinqExpression method to bool, but I don't know how to do it
To sum up! First of all it's possible to create our own extensiond methods in Linq to Entities that execute the code in SqlServer? if this is possible how I have to do it?
Thanks for your help. | 0 |
8,588,543 | 12/21/2011 10:42:58 | 673,108 | 03/23/2011 13:28:40 | 205 | 6 | Jquery or pure javascript | Would a javascript programmer, that knows javascript pretty well, write his/her code in Jquery or in pure javascript?
With other words. Are jquery just for people who doesn't know javascript well enough?
Lets say we are talking about creating "comapny presentation websites", where javascript mainly will be be used for animations. | javascript | jquery | null | null | null | 12/21/2011 13:53:28 | not constructive | Jquery or pure javascript
===
Would a javascript programmer, that knows javascript pretty well, write his/her code in Jquery or in pure javascript?
With other words. Are jquery just for people who doesn't know javascript well enough?
Lets say we are talking about creating "comapny presentation websites", where javascript mainly will be be used for animations. | 4 |
11,388,782 | 07/09/2012 03:31:19 | 1,451,543 | 06/12/2012 14:53:56 | 36 | 1 | How to make HTML5 work without JS or Jquery | I love the design of https://vimeo.com and i'm looking how they write the code. There new design is made by HTML5, but there is no html5shiv.js. Normaly i use
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<style>
.clear {
zoom: 1;
display: block;
}
</style>
<![endif]-->
but in vimeo there is nothing like that. So what they just import this js code into there main js ? Or they are using some new method? | javascript | jquery | html5 | vimeo | null | null | open | How to make HTML5 work without JS or Jquery
===
I love the design of https://vimeo.com and i'm looking how they write the code. There new design is made by HTML5, but there is no html5shiv.js. Normaly i use
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<style>
.clear {
zoom: 1;
display: block;
}
</style>
<![endif]-->
but in vimeo there is nothing like that. So what they just import this js code into there main js ? Or they are using some new method? | 0 |
8,894,537 | 01/17/2012 12:23:48 | 213,133 | 11/17/2009 18:10:55 | 554 | 19 | Perl Regular Expression | Need help with regular expression to replace
"CALLID = DB4EC1F310000134255A83470A7B6A4B ID = DB..."
with
"CALLID = <a>DB4EC1F310000134255A83470A7B6A4B</a> ID = DB..."
Thanks in advance.
Gourav | regex | null | null | null | null | 01/18/2012 02:52:29 | not a real question | Perl Regular Expression
===
Need help with regular expression to replace
"CALLID = DB4EC1F310000134255A83470A7B6A4B ID = DB..."
with
"CALLID = <a>DB4EC1F310000134255A83470A7B6A4B</a> ID = DB..."
Thanks in advance.
Gourav | 1 |
8,809,636 | 01/10/2012 19:53:03 | 1,133,428 | 01/06/2012 01:34:14 | 1 | 0 | Pivot control MVVM-Light-EventToCommand SelectedIndex sends previous index WP7 | I get the index of the Pivot item I'm leaving, not the Pivot Item that I am going to.
I have searched for some time now and can think of some solutions like using an event in the view and then sending a message using MVVM-Light to the ViewModel. But I'd rather not do that, I'd rather stick to this current implementation, slightly different of course.
Any help is appreciated
My xaml:
<controls:Pivot x:Name="ContentPivot" Margin="12,0,12,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand Command ="{Binding SelectSlideCommand}"
CommandParameter="{Binding SelectedIndex, ElementName=ContentPivot}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<controls:PivotItem x:Name="PivotItem0" Header="0">
<Image Source="{Binding ViewingSlides[0].Path}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</controls:PivotItem>
<controls:PivotItem x:Name="PivotItem1" Header="1">
<Image Source="{Binding ViewingSlides[1].Path}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</controls:PivotItem>
<controls:PivotItem x:Name="PivotItem2" Header="2">
<Image Source="{Binding ViewingSlides[2].Path}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</controls:PivotItem>
</controls:Pivot>
and c#:
`public RelayCommand<int> SelectSlideCommand `
`SelectSlideCommand = new RelayCommand<int>((pivotItem) => SelectSlideAction(pivotItem)); `
void SelectSlideAction(int parameter)
{
currentIndex = parameter;
UpdateViewingSlides();
Debug.WriteLine("SelectSlideAction: " + parameter);
} | wpf | xaml | windows-phone-7 | mvvm | mvvm-light | null | open | Pivot control MVVM-Light-EventToCommand SelectedIndex sends previous index WP7
===
I get the index of the Pivot item I'm leaving, not the Pivot Item that I am going to.
I have searched for some time now and can think of some solutions like using an event in the view and then sending a message using MVVM-Light to the ViewModel. But I'd rather not do that, I'd rather stick to this current implementation, slightly different of course.
Any help is appreciated
My xaml:
<controls:Pivot x:Name="ContentPivot" Margin="12,0,12,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<cmd:EventToCommand Command ="{Binding SelectSlideCommand}"
CommandParameter="{Binding SelectedIndex, ElementName=ContentPivot}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<controls:PivotItem x:Name="PivotItem0" Header="0">
<Image Source="{Binding ViewingSlides[0].Path}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</controls:PivotItem>
<controls:PivotItem x:Name="PivotItem1" Header="1">
<Image Source="{Binding ViewingSlides[1].Path}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</controls:PivotItem>
<controls:PivotItem x:Name="PivotItem2" Header="2">
<Image Source="{Binding ViewingSlides[2].Path}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</controls:PivotItem>
</controls:Pivot>
and c#:
`public RelayCommand<int> SelectSlideCommand `
`SelectSlideCommand = new RelayCommand<int>((pivotItem) => SelectSlideAction(pivotItem)); `
void SelectSlideAction(int parameter)
{
currentIndex = parameter;
UpdateViewingSlides();
Debug.WriteLine("SelectSlideAction: " + parameter);
} | 0 |
6,445,686 | 06/22/2011 19:52:44 | 265,683 | 02/03/2010 21:40:43 | 186 | 5 | What copyright and disclaimer information is needed in this app | Can anyone explain what, if anything is required for a disclaimer for the following app.
The app will use celebrity photographs taken from various sources, such as :
http://www.myspacefunk.com/Images/Male_Celebrities/
I will be making an app which can make modifications to such images.
However those original images do not belong to me, do I need to state to the user where these images originally came from? Do I need to seek direct allowance from the originator to use these in my app? How does the law work on these types of things - I really want to avoid having to get direct permission in the interests of the amount of time this will take.
Thanks in advance and apologies for my ignorance to these important concepts. | android | licensing | copyright | photos | law | 06/22/2011 20:05:36 | off topic | What copyright and disclaimer information is needed in this app
===
Can anyone explain what, if anything is required for a disclaimer for the following app.
The app will use celebrity photographs taken from various sources, such as :
http://www.myspacefunk.com/Images/Male_Celebrities/
I will be making an app which can make modifications to such images.
However those original images do not belong to me, do I need to state to the user where these images originally came from? Do I need to seek direct allowance from the originator to use these in my app? How does the law work on these types of things - I really want to avoid having to get direct permission in the interests of the amount of time this will take.
Thanks in advance and apologies for my ignorance to these important concepts. | 2 |
9,002,740 | 01/25/2012 12:29:53 | 1,169,194 | 01/25/2012 12:25:49 | 1 | 0 | How to fetch from Mysql something that has date for this week (from this monday till sunday) | I've got table with tickets in DB:
- name
- deadline
deadline is in DATE format. So how can I fetch only those tickets for current week (from monday till sunday) using plain MYSQL?
Thanks. | mysql | date | null | null | null | 01/25/2012 14:05:12 | not a real question | How to fetch from Mysql something that has date for this week (from this monday till sunday)
===
I've got table with tickets in DB:
- name
- deadline
deadline is in DATE format. So how can I fetch only those tickets for current week (from monday till sunday) using plain MYSQL?
Thanks. | 1 |
10,289,548 | 04/23/2012 23:12:15 | 771,541 | 05/26/2011 14:59:47 | 151 | 9 | Open button in new tab/window | Is it possible from a users point of view, to click a button and the result to load in a new tab/window, not automatically. Like if you middle click on a link in some browsers or right click -> Open in new tab/window.
Is this at all possible? I know you can make custom buttons and such but this is more out of curiosity.
Thanks. | button | browser | null | null | null | 04/25/2012 12:29:44 | not a real question | Open button in new tab/window
===
Is it possible from a users point of view, to click a button and the result to load in a new tab/window, not automatically. Like if you middle click on a link in some browsers or right click -> Open in new tab/window.
Is this at all possible? I know you can make custom buttons and such but this is more out of curiosity.
Thanks. | 1 |
8,515,207 | 12/15/2011 04:43:14 | 1,063,295 | 11/24/2011 05:55:46 | 6 | 0 | Is there a way to order mysql rows by the occurrence frequency? Thanks | Is there a method to order mysql rows by the occurrence frequency? Thanks! | mysql | order | null | null | null | 12/16/2011 02:51:42 | not a real question | Is there a way to order mysql rows by the occurrence frequency? Thanks
===
Is there a method to order mysql rows by the occurrence frequency? Thanks! | 1 |
471,791 | 01/23/2009 03:23:02 | 34,537 | 11/05/2008 03:00:23 | 505 | 13 | gcc compile time notes/msg | I know msvc can do this via pragma message -> http://support.microsoft.com/kb/155196
does gcc have a way to print user created warnings or messages ? (i couldn't find a solution with google :() | compiler-warnings | gcc | null | null | null | null | open | gcc compile time notes/msg
===
I know msvc can do this via pragma message -> http://support.microsoft.com/kb/155196
does gcc have a way to print user created warnings or messages ? (i couldn't find a solution with google :() | 0 |
11,494,090 | 07/15/2012 17:29:35 | 1,090,562 | 12/09/2011 21:50:56 | 137 | 5 | mongodb queries continue to execute, nevertheless script finished | I had a script which parsed data and inserts info into Mongodb.
Script finished its execution but mongodb still inserts information into collection.
As far as I understood this is due to some sort of stack of queries
How can I check how many inserts are to be done?
or any other sort of similar information. | mongodb | null | null | null | null | 07/16/2012 13:27:35 | not a real question | mongodb queries continue to execute, nevertheless script finished
===
I had a script which parsed data and inserts info into Mongodb.
Script finished its execution but mongodb still inserts information into collection.
As far as I understood this is due to some sort of stack of queries
How can I check how many inserts are to be done?
or any other sort of similar information. | 1 |
10,791,379 | 05/28/2012 23:15:20 | 1,149,976 | 01/15/2012 02:02:03 | 29 | 0 | Homework Java Overriding | I have Super class RECTANGLE with 2 variables and a Child class SQUARE with 1 variable. I am using class Square to inherit the getArea() method and overide it fine. Eclipse editor gives me an error in my SQUARE class, "super(width, length);". LENGTH variable has an error that can be fixed with making it static in the RECTANGLE class, that's not what I desire I guess. My homework requires that class SQUARE has a constructor with 1 variable to multiply by itself. What is the logical error in my code?
public class Rectangle
{
double width, length;
Rectangle(double width, double length)
{
this.width = width;
this.length = length;
}
double getArea()
{
double area = width * length;
return area;
}
void show()
{
System.out.println("Rectangle's width and length are: " + width + ", " + length);
System.out.println("Rectangle's area is: " + getArea());
System.out.println();
}
}
public class Square extends Rectangle
{
double width, length;
Square(double width)
{
super(width, length);
this.width = width;
}
double getArea()
{
double area = width * width;
return area;
}
void show()
{
System.out.println("Square's width is: " + width) ;
System.out.println("Square's area is: " + getArea());
}
}
public class ShapesAPP
{
public static void main(String[] args)
{
Rectangle shape1 = new Rectangle(5, 2);
Square shape2 = new Square(5);
shape1.show( );
shape2.show( );
}
}
| homework | null | null | null | null | 05/29/2012 10:18:48 | too localized | Homework Java Overriding
===
I have Super class RECTANGLE with 2 variables and a Child class SQUARE with 1 variable. I am using class Square to inherit the getArea() method and overide it fine. Eclipse editor gives me an error in my SQUARE class, "super(width, length);". LENGTH variable has an error that can be fixed with making it static in the RECTANGLE class, that's not what I desire I guess. My homework requires that class SQUARE has a constructor with 1 variable to multiply by itself. What is the logical error in my code?
public class Rectangle
{
double width, length;
Rectangle(double width, double length)
{
this.width = width;
this.length = length;
}
double getArea()
{
double area = width * length;
return area;
}
void show()
{
System.out.println("Rectangle's width and length are: " + width + ", " + length);
System.out.println("Rectangle's area is: " + getArea());
System.out.println();
}
}
public class Square extends Rectangle
{
double width, length;
Square(double width)
{
super(width, length);
this.width = width;
}
double getArea()
{
double area = width * width;
return area;
}
void show()
{
System.out.println("Square's width is: " + width) ;
System.out.println("Square's area is: " + getArea());
}
}
public class ShapesAPP
{
public static void main(String[] args)
{
Rectangle shape1 = new Rectangle(5, 2);
Square shape2 = new Square(5);
shape1.show( );
shape2.show( );
}
}
| 3 |
7,111,392 | 08/18/2011 17:13:17 | 887,007 | 08/10/2011 01:44:48 | 6 | 1 | error due to R.java | I'm new to Android programming and as a part of learning i tried to run this open source project(below) which ends up in an error at the `import com.example.android.apis.R;`. Also where and all there is `R`. As far as i know `R.java` is automatically generated and we don't need to create it or edit it. What is the reason for this error. Can anyone please explain this. I used Eclipse to run this project.
package com.example.android.apis.media;
import com.example.android.apis.R;
import android.app.Activity;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.MediaPlayer.OnVideoSizeChangedListener;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.Toast;
public class MediaPlayerDemo_Video extends Activity implements
OnBufferingUpdateListener, OnCompletionListener,
OnPreparedListener, OnVideoSizeChangedListener, SurfaceHolder.Callback {
private static final String TAG = "MediaPlayerDemo";
private int mVideoWidth;
private int mVideoHeight;
private MediaPlayer mMediaPlayer;
private SurfaceView mPreview;
private SurfaceHolder holder;
private String path;
private Bundle extras;
private static final String MEDIA = "media";
private static final int LOCAL_AUDIO = 1;
private static final int STREAM_AUDIO = 2;
private static final int RESOURCES_AUDIO = 3;
private static final int LOCAL_VIDEO = 4;
private static final int STREAM_VIDEO = 5;
private boolean mIsVideoSizeKnown = false;
private boolean mIsVideoReadyToBePlayed = false;
/**
*
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.mediaplayer_2);
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
extras = getIntent().getExtras();
}
private void playVideo(Integer Media) {
doCleanUp();
try {
switch (Media) {
case LOCAL_VIDEO:
/*
* TODO: Set the path variable to a local media file path.
*/
path = "";
if (path == "") {
// Tell the user to provide a media file URL.
Toast
.makeText(
MediaPlayerDemo_Video.this,
"Please edit
MediaPlayerDemo_Video Activity, "
+ "and set the path
variable to your media file path."
+ " Your media file
must be stored on sdcard.",
Toast.LENGTH_LONG).show();
}
break;
case STREAM_VIDEO:
/*
* TODO: Set path variable to progressive streamable mp4 or
* 3gpp format URL. Http protocol should be used.
* Mediaplayer can only play "progressive streamable
* contents" which basically means: 1. the movie atom has to
* precede all the media data atoms. 2. The clip has to be
* reasonably interleaved.
*
*/
path = "";
if (path == "") {
// Tell the user to provide a media file URL.
Toast
.makeText(
MediaPlayerDemo_Video.this,
"Please edit
MediaPlayerDemo_Video Activity,"
+ " and set the path
variable to your media file URL.",
Toast.LENGTH_LONG).show();
}
break;
}
// Create a new media player and set the listeners
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
}
}
public void onBufferingUpdate(MediaPlayer arg0, int percent) {
Log.d(TAG, "onBufferingUpdate percent:" + percent);
}
public void onCompletion(MediaPlayer arg0) {
Log.d(TAG, "onCompletion called");
}
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
Log.v(TAG, "onVideoSizeChanged called");
if (width == 0 || height == 0) {
Log.e(TAG, "invalid video width(" + width + ") or height("
+ height + ")");
return;
}
mIsVideoSizeKnown = true;
mVideoWidth = width;
mVideoHeight = height;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void onPrepared(MediaPlayer mediaplayer) {
Log.d(TAG, "onPrepared called");
mIsVideoReadyToBePlayed = true;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void surfaceChanged(SurfaceHolder surfaceholder, int i, int
j, int k) {
Log.d(TAG, "surfaceChanged called");
}
public void surfaceDestroyed(SurfaceHolder surfaceholder) {
Log.d(TAG, "surfaceDestroyed called");
}
public void surfaceCreated(SurfaceHolder holder) {
Log.d(TAG, "surfaceCreated called");
playVideo(extras.getInt(MEDIA));
}
@Override
protected void onPause() {
super.onPause();
releaseMediaPlayer();
doCleanUp();
}
@Override
protected void onDestroy() {
super.onDestroy();
releaseMediaPlayer();
doCleanUp();
}
private void releaseMediaPlayer() {
if (mMediaPlayer != null) {
mMediaPlayer.release();
mMediaPlayer = null;
}
}
private void doCleanUp() {
mVideoWidth = 0;
mVideoHeight = 0;
mIsVideoReadyToBePlayed = false;
mIsVideoSizeKnown = false;
}
private void startVideoPlayback() {
Log.v(TAG, "startVideoPlayback");
holder.setFixedSize(mVideoWidth, mVideoHeight);
mMediaPlayer.start();
}
}
This is the code i tried to run. | android | null | null | null | null | null | open | error due to R.java
===
I'm new to Android programming and as a part of learning i tried to run this open source project(below) which ends up in an error at the `import com.example.android.apis.R;`. Also where and all there is `R`. As far as i know `R.java` is automatically generated and we don't need to create it or edit it. What is the reason for this error. Can anyone please explain this. I used Eclipse to run this project.
package com.example.android.apis.media;
import com.example.android.apis.R;
import android.app.Activity;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.media.MediaPlayer.OnBufferingUpdateListener;
import android.media.MediaPlayer.OnCompletionListener;
import android.media.MediaPlayer.OnPreparedListener;
import android.media.MediaPlayer.OnVideoSizeChangedListener;
import android.os.Bundle;
import android.util.Log;
import android.view.SurfaceHolder;
import android.view.SurfaceView;
import android.widget.Toast;
public class MediaPlayerDemo_Video extends Activity implements
OnBufferingUpdateListener, OnCompletionListener,
OnPreparedListener, OnVideoSizeChangedListener, SurfaceHolder.Callback {
private static final String TAG = "MediaPlayerDemo";
private int mVideoWidth;
private int mVideoHeight;
private MediaPlayer mMediaPlayer;
private SurfaceView mPreview;
private SurfaceHolder holder;
private String path;
private Bundle extras;
private static final String MEDIA = "media";
private static final int LOCAL_AUDIO = 1;
private static final int STREAM_AUDIO = 2;
private static final int RESOURCES_AUDIO = 3;
private static final int LOCAL_VIDEO = 4;
private static final int STREAM_VIDEO = 5;
private boolean mIsVideoSizeKnown = false;
private boolean mIsVideoReadyToBePlayed = false;
/**
*
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.mediaplayer_2);
mPreview = (SurfaceView) findViewById(R.id.surface);
holder = mPreview.getHolder();
holder.addCallback(this);
holder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
extras = getIntent().getExtras();
}
private void playVideo(Integer Media) {
doCleanUp();
try {
switch (Media) {
case LOCAL_VIDEO:
/*
* TODO: Set the path variable to a local media file path.
*/
path = "";
if (path == "") {
// Tell the user to provide a media file URL.
Toast
.makeText(
MediaPlayerDemo_Video.this,
"Please edit
MediaPlayerDemo_Video Activity, "
+ "and set the path
variable to your media file path."
+ " Your media file
must be stored on sdcard.",
Toast.LENGTH_LONG).show();
}
break;
case STREAM_VIDEO:
/*
* TODO: Set path variable to progressive streamable mp4 or
* 3gpp format URL. Http protocol should be used.
* Mediaplayer can only play "progressive streamable
* contents" which basically means: 1. the movie atom has to
* precede all the media data atoms. 2. The clip has to be
* reasonably interleaved.
*
*/
path = "";
if (path == "") {
// Tell the user to provide a media file URL.
Toast
.makeText(
MediaPlayerDemo_Video.this,
"Please edit
MediaPlayerDemo_Video Activity,"
+ " and set the path
variable to your media file URL.",
Toast.LENGTH_LONG).show();
}
break;
}
// Create a new media player and set the listeners
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
}
}
public void onBufferingUpdate(MediaPlayer arg0, int percent) {
Log.d(TAG, "onBufferingUpdate percent:" + percent);
}
public void onCompletion(MediaPlayer arg0) {
Log.d(TAG, "onCompletion called");
}
public void onVideoSizeChanged(MediaPlayer mp, int width, int height) {
Log.v(TAG, "onVideoSizeChanged called");
if (width == 0 || height == 0) {
Log.e(TAG, "invalid video width(" + width + ") or height("
+ height + ")");
return;
}
mIsVideoSizeKnown = true;
mVideoWidth = width;
mVideoHeight = height;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void onPrepared(MediaPlayer mediaplayer) {
Log.d(TAG, "onPrepared called");
mIsVideoReadyToBePlayed = true;
if (mIsVideoReadyToBePlayed && mIsVideoSizeKnown) {
startVideoPlayback();
}
}
public void surfaceChanged(SurfaceHolder surfaceholder, int i, int
j, int k) {
Log.d(TAG, "surfaceChanged called");
}
public void surfaceDestroyed(SurfaceHolder surfaceholder) {
Log.d(TAG, "surfaceDestroyed called");
}
public void surfaceCreated(SurfaceHolder holder) {
Log.d(TAG, "surfaceCreated called");
playVideo(extras.getInt(MEDIA));
}
@Override
protected void onPause() {
super.onPause();
releaseMediaPlayer();
doCleanUp();
}
@Override
protected void onDestroy() {
super.onDestroy();
releaseMediaPlayer();
doCleanUp();
}
private void releaseMediaPlayer() {
if (mMediaPlayer != null) {
mMediaPlayer.release();
mMediaPlayer = null;
}
}
private void doCleanUp() {
mVideoWidth = 0;
mVideoHeight = 0;
mIsVideoReadyToBePlayed = false;
mIsVideoSizeKnown = false;
}
private void startVideoPlayback() {
Log.v(TAG, "startVideoPlayback");
holder.setFixedSize(mVideoWidth, mVideoHeight);
mMediaPlayer.start();
}
}
This is the code i tried to run. | 0 |
6,817,454 | 07/25/2011 14:12:12 | 861,732 | 07/25/2011 14:12:12 | 1 | 0 | Masters in MIS or CS? | Am in my final year in Undergradute degree under computer science.I intend to pursue higher studies in USA.Am torn between a degree in MIS and CS.basically,am not fond of coding and obviously,am not good at that.What is the scope for MIS?looking good? | management | information | systems | null | null | 07/25/2011 14:16:57 | off topic | Masters in MIS or CS?
===
Am in my final year in Undergradute degree under computer science.I intend to pursue higher studies in USA.Am torn between a degree in MIS and CS.basically,am not fond of coding and obviously,am not good at that.What is the scope for MIS?looking good? | 2 |
7,337,780 | 09/07/2011 17:07:49 | 722,359 | 04/24/2011 04:57:40 | 49 | 2 | Using a thread with media player | I'm trying to get this to work the way I want and it just won't I think I had it at some point but I was trying to fix something else and changed a few things and messed it up. Basically I'm this button is a play button. It is supposed to run media player through another thread so that it reacts and buffers faster. Issue is after it plays through to the end and I click play it is ended and keeps running the onCompletion. When I would like it to start over and play from the beginning again.
public void onClick(View v) {
if (System.currentTimeMillis() - lastClick > 1000) {
lastClick = System.currentTimeMillis();
if(playClick%2==0){
song1.setBackgroundResource(R.drawable.button_pause);
try{
if(playClick==0){
playThread();
if(lastPlayedExists){
lastPlayed.release();
}
}
mp.start();
mpExists = true;
playClick++;
lastPlayed = mp;
lastPlayedExists=true;
wl.acquire();
wlExists = true;
buffCheck();
mp.setOnCompletionListener(new OnCompletionListener(){
@Override
public void onCompletion(MediaPlayer media) {
mp.reset();
progressBar.setSecondaryProgress(0);
song1.setBackgroundResource(R.drawable.button_play);
}
});
}catch (NullPointerException e){
}
}
else if (playClick%2==1){
song1.setBackgroundResource(R.drawable.button_play);
mp.pause();
playClick++;
}
}
}
});
And this is the thread for media player
private void playThread(){
try{
new Thread(new Runnable() {
public void run() {
try {
mp.setDataSource(song);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
mp.prepare();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
}catch(IllegalStateException e){
}
}
I have tried it with the onCompletion having mp.reset(), mp.stop(), and mp.release() along with trying lastPlayed.release() all in different tests. As well as none of them being there and it just being the button change and the progress bar reset. If you know how to fix this and make it replay as it should I would greatly appreciate it. Or if you know how to make the thread stop and restart some how so that I can just make it recall and do the thread over again that would work too (atm when that has been tried it crashes because the thread has already been started). Thanks and I appreciate any input. | android | multithreading | mediaplayer | null | null | null | open | Using a thread with media player
===
I'm trying to get this to work the way I want and it just won't I think I had it at some point but I was trying to fix something else and changed a few things and messed it up. Basically I'm this button is a play button. It is supposed to run media player through another thread so that it reacts and buffers faster. Issue is after it plays through to the end and I click play it is ended and keeps running the onCompletion. When I would like it to start over and play from the beginning again.
public void onClick(View v) {
if (System.currentTimeMillis() - lastClick > 1000) {
lastClick = System.currentTimeMillis();
if(playClick%2==0){
song1.setBackgroundResource(R.drawable.button_pause);
try{
if(playClick==0){
playThread();
if(lastPlayedExists){
lastPlayed.release();
}
}
mp.start();
mpExists = true;
playClick++;
lastPlayed = mp;
lastPlayedExists=true;
wl.acquire();
wlExists = true;
buffCheck();
mp.setOnCompletionListener(new OnCompletionListener(){
@Override
public void onCompletion(MediaPlayer media) {
mp.reset();
progressBar.setSecondaryProgress(0);
song1.setBackgroundResource(R.drawable.button_play);
}
});
}catch (NullPointerException e){
}
}
else if (playClick%2==1){
song1.setBackgroundResource(R.drawable.button_play);
mp.pause();
playClick++;
}
}
}
});
And this is the thread for media player
private void playThread(){
try{
new Thread(new Runnable() {
public void run() {
try {
mp.setDataSource(song);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalStateException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
mp.prepare();
} catch (IllegalStateException e) {
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}).start();
}catch(IllegalStateException e){
}
}
I have tried it with the onCompletion having mp.reset(), mp.stop(), and mp.release() along with trying lastPlayed.release() all in different tests. As well as none of them being there and it just being the button change and the progress bar reset. If you know how to fix this and make it replay as it should I would greatly appreciate it. Or if you know how to make the thread stop and restart some how so that I can just make it recall and do the thread over again that would work too (atm when that has been tried it crashes because the thread has already been started). Thanks and I appreciate any input. | 0 |
7,384,964 | 09/12/2011 08:11:02 | 108,302 | 05/17/2009 02:37:56 | 439 | 9 | Eclipse debuging stdin/stdout on Windows | I'm trying to debug my program, however it requires me to enter in values in stdin and read them on stdout. This works fine when I click "run" in Eclipse, but when clicking debug, I get odd output, usually nothing.
For example:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char buffer[50];
printf("enter some text: ");
fflush(stdout);
scanf("%49s", buffer);
printf("you entered '%s'", buffer);
fflush(stdout);
return EXIT_SUCCESS;
}
I get:
enter some text: 35^running
Then I type:
hello
Then nothing happens even after I press enter a couple of times.
Eventually, after terminating the program, I get:
you entered 'hello'=thread-exited,id="1",group-id="i1"
P.S. I'm using GDB 7.2 (MinGW) and Eclipse Indigo 3.7.0 | c | eclipse | console | stdout | stdin | null | open | Eclipse debuging stdin/stdout on Windows
===
I'm trying to debug my program, however it requires me to enter in values in stdin and read them on stdout. This works fine when I click "run" in Eclipse, but when clicking debug, I get odd output, usually nothing.
For example:
#include <stdio.h>
#include <stdlib.h>
int main(void) {
char buffer[50];
printf("enter some text: ");
fflush(stdout);
scanf("%49s", buffer);
printf("you entered '%s'", buffer);
fflush(stdout);
return EXIT_SUCCESS;
}
I get:
enter some text: 35^running
Then I type:
hello
Then nothing happens even after I press enter a couple of times.
Eventually, after terminating the program, I get:
you entered 'hello'=thread-exited,id="1",group-id="i1"
P.S. I'm using GDB 7.2 (MinGW) and Eclipse Indigo 3.7.0 | 0 |
10,975,541 | 06/11/2012 06:49:36 | 749,232 | 05/11/2011 18:05:38 | 244 | 13 | Clearing memory in PHP, for executing on large set of database rows | I want to execute a complex database query which involves about 60000 rows. When the execution completes on a few rows itself, the memory(RAM) gets filled up, and execution terminates with an error that further memory cannot be allocated. How can I clear the RAM after executing a few rows, so that execution can continue uninterrupted.
**N.B:** Alternate useful workarounds is also acceptable. | php | database | postgresql | memory-management | null | 06/11/2012 19:23:52 | not a real question | Clearing memory in PHP, for executing on large set of database rows
===
I want to execute a complex database query which involves about 60000 rows. When the execution completes on a few rows itself, the memory(RAM) gets filled up, and execution terminates with an error that further memory cannot be allocated. How can I clear the RAM after executing a few rows, so that execution can continue uninterrupted.
**N.B:** Alternate useful workarounds is also acceptable. | 1 |
3,650,393 | 09/06/2010 09:35:16 | 440,497 | 09/06/2010 09:35:16 | 1 | 0 | git log over restricts output when using --follow? | On the following:
gsl@aragorn:~/gitTest> uname -a
Linux aragorn 2.6.31.12-0.2-default #1 SMP 2010-03-16 21:25:39 +0100 i686 i686 i386 GNU/Linux
gsl@aragorn:~/gitTest> cat /etc/SuSE-release
openSUSE 11.2 (i586)
VERSION = 11.2
gsl@aragorn:~/gitTest> git --version
git version 1.7.2.2
I get (with a bash alias of gitnp='git --no-pager'):
(1)
gsl@aragorn:~/gitTest> gitnp log --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
594ceed7a0fb35a860a6e2cb913d5398f09a861f 1st mod junk.txt
df271b2ebd5801bd8d827b0630577cad51c40896 initial junk.txt
(2)
gsl@aragorn:~/gitTest> gitnp log --follow --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
594ceed7a0fb35a860a6e2cb913d5398f09a861f 1st mod junk.txt
df271b2ebd5801bd8d827b0630577cad51c40896 initial junk.txt
(3)
gsl@aragorn:~/gitTest> gitnp log -2 --follow --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
(4)
gsl@aragorn:~/gitTest> gitnp log -2 --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
594ceed7a0fb35a860a6e2cb913d5398f09a861f 1st mod junk.txt
Why don't I see 2 output lines for item 3 above?
-=> Gregg <=- | git | null | null | null | null | 04/07/2012 16:06:26 | too localized | git log over restricts output when using --follow?
===
On the following:
gsl@aragorn:~/gitTest> uname -a
Linux aragorn 2.6.31.12-0.2-default #1 SMP 2010-03-16 21:25:39 +0100 i686 i686 i386 GNU/Linux
gsl@aragorn:~/gitTest> cat /etc/SuSE-release
openSUSE 11.2 (i586)
VERSION = 11.2
gsl@aragorn:~/gitTest> git --version
git version 1.7.2.2
I get (with a bash alias of gitnp='git --no-pager'):
(1)
gsl@aragorn:~/gitTest> gitnp log --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
594ceed7a0fb35a860a6e2cb913d5398f09a861f 1st mod junk.txt
df271b2ebd5801bd8d827b0630577cad51c40896 initial junk.txt
(2)
gsl@aragorn:~/gitTest> gitnp log --follow --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
594ceed7a0fb35a860a6e2cb913d5398f09a861f 1st mod junk.txt
df271b2ebd5801bd8d827b0630577cad51c40896 initial junk.txt
(3)
gsl@aragorn:~/gitTest> gitnp log -2 --follow --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
(4)
gsl@aragorn:~/gitTest> gitnp log -2 --pretty=oneline junk.txt
500e8791578c5baf7a139d4997841769a995ac6b mod of junk and junk3
594ceed7a0fb35a860a6e2cb913d5398f09a861f 1st mod junk.txt
Why don't I see 2 output lines for item 3 above?
-=> Gregg <=- | 3 |
11,626,424 | 07/24/2012 07:50:46 | 1,015,476 | 10/26/2011 21:44:06 | 145 | 0 | Vector & Stack Overflow - Part Deux | This is related to the my previous question;
http://stackoverflow.com/questions/11597980/vector-stack-overflow
But will hopefully explain the new situation (and my new question).
So Yesterday i thought i had a break-through in this stack overflow exception, i thought i had solved it. Though at that time i was very tired and had quite a lot of code commented out.
This morning, re-working on my game, i started by getting everything back running. To my despair only about half an hour ago to come to the say bloody error message i thought i had overcome yesterday :/.
Alas im back at square one, but going onto the answer to my previous question, i'm looking again at trying to find the root cause which i believe is the enemies Animations. Below is my header files for the enemies & animation classes:
Anim - http://pastebin.com/uKQB1RVq
Enemies - http://pastebin.com/pktA1vXi
As you can see in my enemies class there isn't really anything note worth to talk about, that i feel would be causing this exception, apart from the Animations. (The only other thing is my Timer's class, which is just a few ints and bools, again nothing that i can consider to be memory extensive.)
So my question is this;
1. How can i be 100% positive about this? Is there a way in my IDE (Visual C++ 2010) to see how much stack memory is being used?
2. Leading on from q. 1, what would be a solution to this issue, for example, even though im not 100% sure the animations are the actually cause of the exception, commenting the animations out and say create a vector of animations compiles fine without issue. Would that be the way to go?
*I have testing scenario set up, i know that using the plain old 4 Animation calls if i reduce the array of Vector2's & RectArray's to 15 instead of the 20 (*Just to say that these are simple structs, containing ints for the plain old x & y, and then for x, y, width & height*) the game compiles up fine(Which is most likely the main reason i'm leaning towards the Animation class being the issue), if i could measure how much stack memory that it is using and then compare that with what creating a vector array of animations uses, then i should hopefully by able to make a good call on whether or not this is more importantly the real issue or if it is infact something else. | c++ | animation | vector | null | null | 07/24/2012 12:10:55 | too localized | Vector & Stack Overflow - Part Deux
===
This is related to the my previous question;
http://stackoverflow.com/questions/11597980/vector-stack-overflow
But will hopefully explain the new situation (and my new question).
So Yesterday i thought i had a break-through in this stack overflow exception, i thought i had solved it. Though at that time i was very tired and had quite a lot of code commented out.
This morning, re-working on my game, i started by getting everything back running. To my despair only about half an hour ago to come to the say bloody error message i thought i had overcome yesterday :/.
Alas im back at square one, but going onto the answer to my previous question, i'm looking again at trying to find the root cause which i believe is the enemies Animations. Below is my header files for the enemies & animation classes:
Anim - http://pastebin.com/uKQB1RVq
Enemies - http://pastebin.com/pktA1vXi
As you can see in my enemies class there isn't really anything note worth to talk about, that i feel would be causing this exception, apart from the Animations. (The only other thing is my Timer's class, which is just a few ints and bools, again nothing that i can consider to be memory extensive.)
So my question is this;
1. How can i be 100% positive about this? Is there a way in my IDE (Visual C++ 2010) to see how much stack memory is being used?
2. Leading on from q. 1, what would be a solution to this issue, for example, even though im not 100% sure the animations are the actually cause of the exception, commenting the animations out and say create a vector of animations compiles fine without issue. Would that be the way to go?
*I have testing scenario set up, i know that using the plain old 4 Animation calls if i reduce the array of Vector2's & RectArray's to 15 instead of the 20 (*Just to say that these are simple structs, containing ints for the plain old x & y, and then for x, y, width & height*) the game compiles up fine(Which is most likely the main reason i'm leaning towards the Animation class being the issue), if i could measure how much stack memory that it is using and then compare that with what creating a vector array of animations uses, then i should hopefully by able to make a good call on whether or not this is more importantly the real issue or if it is infact something else. | 3 |
4,536,408 | 12/27/2010 03:11:55 | 493,219 | 11/01/2010 05:01:36 | 37 | 0 | Decode Images - BLACKBERRY/Java | Does anyone know how to decode an .png image on a sd card to bitmap on blackberry? | java | blackberry | java-me | null | null | null | open | Decode Images - BLACKBERRY/Java
===
Does anyone know how to decode an .png image on a sd card to bitmap on blackberry? | 0 |
8,641,682 | 12/27/2011 06:08:40 | 908,879 | 08/24/2011 04:25:10 | 429 | 9 | Is there a way to remove unused lines of a JS Library? | I currently coded something awesome based on a JS Library, and I want to remove every useless line that is doing nothing but take more time to download from the server.
**What is the best way to keep track of what piece of code was used/unused when my code executed?** (So I can remove the unused code)
My first thoughts are to put `"var log += "<br />Function name was used."` on every function and remove every function that wasn't called. But I am curious about if there is another way
*I want to point out that modifying certain JS Libraries might violate their Licences and possibly cause strong legal issues. So if anyone is reading this and is planning to do the same thing as me, please read carefully the Licence(s) before you even attempt to do this!* | javascript | null | null | null | null | null | open | Is there a way to remove unused lines of a JS Library?
===
I currently coded something awesome based on a JS Library, and I want to remove every useless line that is doing nothing but take more time to download from the server.
**What is the best way to keep track of what piece of code was used/unused when my code executed?** (So I can remove the unused code)
My first thoughts are to put `"var log += "<br />Function name was used."` on every function and remove every function that wasn't called. But I am curious about if there is another way
*I want to point out that modifying certain JS Libraries might violate their Licences and possibly cause strong legal issues. So if anyone is reading this and is planning to do the same thing as me, please read carefully the Licence(s) before you even attempt to do this!* | 0 |
11,543,215 | 07/18/2012 14:03:10 | 925,927 | 09/02/2011 19:55:15 | 191 | 4 | Insert into List(Text) Field | I have a Drupal content type that includes Zip Codes (Postal Codes). An unlimited number of Zip Codes is allowed, and the Zip Codes are defined in the "**Allowed Values List**" in the field definition. I have many Zip Codes that I need to insert, and have them staged them and their relationship to nodes in a temporary database table.
I do the following insert to both "**field_data_field_zip_codes**" and "**field_revision_field_zip_codes**", but I still do not see the values in the online Content.
Has someone done this type of thing before, and know what I am missing? I looked at using "Feeds" but that module doesn't seem to support multi-value fields, just flat tables.
INSERT INTO field_revision_field_wp_zip_codes
SELECT c.entity_type AS entity_type
,'wp_content_component' AS bundle
,0 AS deleted
,c.entity_id AS entity_id
,c.entity_id AS revision_id
,'und' AS language
,(@rownum:=@rownum+1) - 1 AS delta
,z.zip AS field_wp_zip_codes_value
FROM field_data_field_wp_cc_id c
INNER JOIN cc_zips z
ON z.cc = c.field_wp_cc_id_value,
(SELECT @rownum:=0) r
WHERE z.cc = '1039'
AND c.entity_id = '3699';
| drupal | drupal-7 | null | null | null | 07/18/2012 15:34:09 | off topic | Insert into List(Text) Field
===
I have a Drupal content type that includes Zip Codes (Postal Codes). An unlimited number of Zip Codes is allowed, and the Zip Codes are defined in the "**Allowed Values List**" in the field definition. I have many Zip Codes that I need to insert, and have them staged them and their relationship to nodes in a temporary database table.
I do the following insert to both "**field_data_field_zip_codes**" and "**field_revision_field_zip_codes**", but I still do not see the values in the online Content.
Has someone done this type of thing before, and know what I am missing? I looked at using "Feeds" but that module doesn't seem to support multi-value fields, just flat tables.
INSERT INTO field_revision_field_wp_zip_codes
SELECT c.entity_type AS entity_type
,'wp_content_component' AS bundle
,0 AS deleted
,c.entity_id AS entity_id
,c.entity_id AS revision_id
,'und' AS language
,(@rownum:=@rownum+1) - 1 AS delta
,z.zip AS field_wp_zip_codes_value
FROM field_data_field_wp_cc_id c
INNER JOIN cc_zips z
ON z.cc = c.field_wp_cc_id_value,
(SELECT @rownum:=0) r
WHERE z.cc = '1039'
AND c.entity_id = '3699';
| 2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.