A c++ code snippet similar to the code below caused our TFS build to fail with a C2360 compiler error.
switch (i)
{
case 0 :
for each (int n in a)
System::Console::WriteLine(n.ToString());
break;
case 1 :
System::Console::WriteLine("n is not in scope here");
break;
}
This is fixed by using {}…
In Rails 2.x you can use validations to make sure you have a unique combined value like this:
validates_uniqueness_of :husband, :scope => :wife
In the corresponding migration it could look like this:
add_index :family, [:husband, :wife], :unique => true
This would make sure the husband/wife combination is unique in the database.…
Hello, experts!
I am trying to create instance of class javax.servlet.ServletException with following code
public class MyTroubleViewer {
public static void main(String[] args) {
javax.servlet.ServletException servletException = new javax.servlet.ServletException("Hello");
System.out.println(servletException.getMessage());
}
}
But…
Where in the Spring-MVC/JSP application would you store things that need to be accessed by both the controllers and views such as environment specific base_url's, application ids to be used in javascript and so on?
I've tried creating an application scoped bean and then at the top of my JSPs, but that doesn't seem to be working.
…
I've a web server and a separate SQL server. I'm trying to use transaction scope to ensure that SQL queries are completed with my linq queries.
I wrap everything with this
using (TransactionScope scope = new TransactionScope())
I want to know where I need to install DTC. Do I need to install it on the IIS 7.5 box AND the SQL…
I am unable to update value of select from AngularJs.
Here is my code
<select ng-model="family.grade" >
<option ng-repeat="option in options" value='{{option.id}}'>{{option.text}}</option>
</select>
Here are the options which i am using to populate my select
var options =…
Hello. I am working on a Silverlight/WCF application and of course have numerous async calls throughout the Silverlight program. I was wondering on how is the best way to handle the creation of the client classes and subscribing. Specifically, if I subscribe to an event in a method, after it returns does it fall out…
i have two maven projects, the first one is a library and the other one use it to works properly, the both have to elvolve regardless each other, this is why i use two different project.
But breakpoints on my library code doesn't work when i launch my app (the second application).
This is how i include my library in…
Hi I am making a wordpress plugin where I need the Admin to enter data into a database table. I am able to install the db table when the Plugin is activated, however I can't figure out how to save the user input. I've asked on the WP forums but they're dead... Any experienced guru who can lend some guidance would be…
I am currently rethinking the object dispose handling of the qooxdoo JavaScript framework.
Have a look at the following diagram (A is currently in scope):
Let's say we want to delete B. Generally, we cut all reference between all objects. This means we cut connection 1 to 5 in the example. Is this really…
We are using the core service in ASP.NET custom page in order to create pages and components and sevenral updates (checkout,save and chekin).
we want those operations to work in transaction, we tried to implement it acording to some examples over the net. However we didn't succeded operating the rollback.…
I have some proprietary.jar that I need to include in my project, but I don't wish to install it to the local repository.
What I did initially was to put the jar into version control in my project's lib/ folder, and then specify the Maven dependency as:
<!-- LOCAL DEPENDENCY -->
<dependency>
…
Hi all,
I am using squid like Internet proxy server on RHEL 4 update 6 & 8 with quite heavy load i.e. 8k established connections during peak hour. Without depending much on application provider's expertise I want to achieve maximum o/p from linux. W.r.t. that I have certain questions as following:
…
I have an array in my main class that holds objects that I need to print out for a menu listing. The array is declared and initialized in main. I need to, however, access the same array in a sub-menu function. If I copy the code (for loop that prints out the values) to the sub-menu, nothing is printed…
In C# you can have nested classes like this, which are useful if you have classes which do not have meaning outside the scope of one particular class, e.g. in a factory pattern:
public abstract class BankAccount
{
private BankAccount() {}
private sealed class SavingsAccount : BankAccount { ... }…
I am trying to use the Google Contacts API to connect to a user's contact information, on my Google apps domain.
Generating an access_token using the gdata api's ContactsService clientlogin function while using the API key for my project works fine, but I would prefer to not store the user's…
This code:
template <template <typename> class T>
class A
{
};
template <typename T>
class B
{
A<B> x;
};
doesn't compile, I suppose since A<B> is interpreted as A<B<T> > within B's scope.
So, how do you pass B as a template template…
I am facing a strange issue with JSF.
I have developed one controller and bind it to request scope.
I need to access one jsf page like http://localhost:8080/selectRule.jsf?type=A and on the same IE session I want to issue another request like…
I have two datasets I need to pull from, A base that both reports use and then a separate one that only one report pulls from. I get the error
Error 12 The Value expression for the text box ‘Textbox9’ refers to the field ‘Name’. Report…
This post is related to post InvalidStateException while trying to enter data into DB.
Do i need to put some entries in web.xml?Does web.xml control opening and closing of factory?I saw folloing entries in web.xml of another similar project…
I'm using webflows in Grails and I'm currently writing tests for it. Now, inside I've got something that throws an error so I set a message to the flash scope before redirecting:
...
if (some_condition) {
flash.message = "my error…
Hi,
I made the upgrade to SP2. I'm trying to use the Lookup function to link data from two different servers. I'm trying first a simple exercise linking data from two datasets from the same server, having one dataset with journals…
Some near-code to try to illustrate the question, when are objects marked as available to be garbage-collected --
class ToyBox
{
public List<Toy> Toys = new List<Toy>();
}
class Factory
{
public…
I'm trying to extract the number '1' that appears on the line with the ID I'm feeding (i.e. 12072).
I've been trying for the past 2 hours to get this regex to work but I'm at a loss. So far I've got
12072.*?(\d+)(?!.*\d)
…