Search Results

Search found 650 results on 26 pages for 'water bills'.

Page 5/26 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Nesting Levels in Custom Section Handlers in .NET Configuration Files

    - by Water Cooler v2
    I know I can have 1 parent element and 1 child element in my own custom app.config section like so: <sectionGroup> <section> <element /> </section> </sectionGroup> My question is, can I have one or more levels of nesting more than this? Like so: <biggestSectionGroup> <biggerSectionGroup> <sectionGroup> <section> <element /> </section> </sectionGroup> </biggerSectionGroup> </biggestSectionGroup>

    Read the article

  • Writing Facebook apps in C#

    - by Water Cooler v2
    Hi, I am a C# developer and fancy the idea of writing a C# app or two to integrate with the Facebook API. I read from this page: http://wiki.developers.facebook.com/index.php/User:C_Sharp that there's this Microsoft SDK for Facebook Platform that has binary assemblies that I can use to write my C# app. As a start, I want to try out the example mentioned on the above-mentioned page -- one that gets me a friend list. The problem is: I am completely new to this Facebook development thing and I see I am going to need, at the very least, an API Key and some Facebook service Secret key or some such, to begin writing some code. Do I also need a developer account? Where do I get all these things from?

    Read the article

  • How can I put rows of MySQL data under the appropriate titles using PHP?

    - by sfarbota
    I have the following MySQL table structure: num field company phone website 1 Gas abcd 123456789 abcd.com 2 Water efgh 987654321 efgh.com 3 Water ijkl 321654987 ijkl.com 4 Heat mnop 987654321 mnop.com 5 Gas qrst 123789654 qrst.com ... Is it possible with PHP (maybe using some mixture of GROUP_BY and ORDER_BY) to echo the data to the screen in the following format: Gas: abcd qrst 123456789 123789654 abcd.com qrst.com Water: efgh ijkl 987654321 321654987 efgh.com ijkl.com Heat: mnop 321654987 mnop.com The exact format of it isn't important. I just need for the different rows of data to be listed under the appropriate field with none of the fields repeated. I've been trying to figure this out for a while now, but I'm new to PHP and I can't seem to figure out how to do this, if it's even possible, or if there's a better way to organize my data to make it easier.

    Read the article

  • Typecast to a type from just the string representation of the type name

    - by Water Cooler v2
    sTypeName = ... //do some string stuff here to get the name of the type /* The Assembly.CreateInstance function returns a type of System.object. I want to type cast it to the type whose name is sTypeName. assembly.CreateInstance(sTypeName) So, in effect I want to do something like: */ assembly.CreateInstance(sTypeName) as Type.GetType(sTypeName); How do I do that? And, what do I take on the left side of the assignment expression, assuming this is C# 2.0. I don't have the var keyword.

    Read the article

  • Are bad data issues that common?

    - by Water Cooler v2
    I've worked for clients that had a large number of distinct, small to mid-sized projects, each interacting with each other via properly defined interfaces to share data, but not reading and writing to the same database. Each had their own separate database, their own cache, their own file servers/system that they had dedicated access to, and so they never caused any problems. One of these clients is a mobile content vendor, so they're lucky in a way that they do not have to face the same problems that everyday business applications do. They can create all those separate compartments where their components happily live in isolation of the others. However, for many business applications, this is not possible. I've worked with a few clients, one of whose applications I am doing the production support for, where there are "bad data issues" on an hourly basis. Yeah, it's that crazy. Some data records from one of the instances (lower than production, of course) would have been run a couple of weeks ago, and caused some other user's data to get corrupted. And then, a data script will have to be written to fix this issue. And I've seen this happening so much with this client that I have to ask. I've seen this happening at a moderate rate with other clients, but this one just seems to be out of order. If you're working with business applications that share a large amount of data by reading and writing to/from the same database, are "bad data issues" that common in your environment?

    Read the article

  • Does .NET have a linker?

    - by Water Cooler v2
    From Jon Skeet's blog: What does the following comment mean? // The line below only works when linked rather than // referenced, as otherwise you need a cast. // The compiler treats it as if it both takes and // returns a dynamic value. string value = com.MakeMeDynamic(10); I understand what referencing an assembly is. You may reference it when compiling the program files either using the /ref: switch at the command line or you may add a statically reference to the assembly in Visual Studio. But how do you link to an assembly in .NET? Does he mean, load the assembly using Reflection (Assembly.LoadFile())? Or, the Win32 API LoadLibrary()? Or, does .NET have a linker that I have never heard of?

    Read the article

  • System.Windows.Forms.DataGridView does not display data

    - by Water Cooler v2
    All I am doing is a simple: // Both the methods, order.GetAllOrderItems() and order.GetOrderedItemsWhereBrandIs("foo") // return an IEnumerable<T> so the assignment to the DataSource property of the DataGridView // should be fine. The problem is in re-assigning the data source property. public void DisplayItems() { // The data appears if I have just this line. dgvOrderedItems.DataSource = order.GetAllOrderItems(); dgvOrderedItems.DataSource = null; // This time the data grid does not take the new data source. Instead, because // of the null assignment in the previous statement, it displays no data at all. dgvOrderedItems.DataSource = order.GetOrderedItemsWhereBrandIs("Lenovo"); } My question is: is there a way to change the data source of a DataGridView control once it has been set? I am using C# 4.0 and Visual Studio 2010 for development.

    Read the article

  • Getting fields of a class through reflection

    - by Water Cooler v2
    I've done it a gazillion times in the past and successfully so. This time, I'm suffering from lapses of amnesia. So, I am just trying to get the fields on an object. It is an embarrassingly simple and stupid piece of code that I am writing in a test solution before I do something really useful in production code. Strangely, the GetFieldsOf method reports a zero length array on the "Amazing" class. Help. class Amazing { private NameValueCollection _nvc; protected NameValueCollection _myDict; } private static FieldInfo[] GetFieldsOf(string className, string nameSpace = "SomeReflection") { Type t; return (t = Assembly.GetExecutingAssembly().GetType( string.Format("{0}.{1}", nameSpace, className) )) == null ? null : t.GetFields(); }

    Read the article

  • Class library assemblies used by Windows Services written in C#

    - by Water Cooler v2
    If I write a C# class called Foo and that is compiled into an assembly named FooLib.dll. Then, I write a Windows Service in C# that references FooLib.dll. When I deploy my Windows Service using InstallUtil.exe: a) do I have to explicitly tell it to reference my FooLib.dll? b) where does FooLib.dll get deployed if I mean to deploy it as a private assembly and not in the GAC?

    Read the article

  • Dynamically load a type from an external assembly

    - by Water Cooler v2
    From managed code, how do I load a managed type from another assembly at runtime, assuming the calling code does not have a static reference to the assembly? To clarify, let's say I have class Lib in Lib.cs compiled into Lib.dll. I want to write a class Foo in a separate assembly called Foo.dll, that does not have a reference to Lib.dll statically, but instead loads Lib.dll and then reflects on for the presence of the class Lib and then calls a method on it. Sorry for such an obvious question on Reflection. I figure it'll take much lesser time to get the answer on a forum that to read a few articles.

    Read the article

  • JavaScript/JSON Serializer

    - by Water Cooler v2
    I see that a JSON serializer is present in the System.Web.Script.Serialization namespace, and is shipped in the System.Web.Extensions.dll assembly. Is this assembly distributed with the .NET framework v4.0 redistributable? Is it also guaranteed to be present on a user's machine if any edition of Visual Studio 2010 is installed?

    Read the article

  • Does this copy the reference or the object?

    - by Water Cooler v2
    Sorry, I am being both thick and lazy, but mostly lazy. Actually, not even that. I am trying to save time so I can do more in less time as there's a lot to be done. Does this copy the reference or the actual object data? public class Foo { private NameValueCollection _nvc = null; public Foo( NameValueCollection nvc) { _nvc = nvc; } } public class Bar { public static void Main() { NameValueCollection toPass = new NameValueCollection(); new Foo( toPass ); // I believe this only copies the reference // so if I ever wanted to compare toPass and // Foo._nvc (assuming I got hold of the private // field using reflection), I would only have to // compare the references and wouldn't have to compare // each string (deep copy compare), right? } I think I know the answer for sure: it only copies the reference. But I am not even sure why I am asking this. I guess my only concern is, if, after instantiating Foo by calling its parameterized ctor with toPass, if I needed to make sure that the NVC I passed as toPass and the NVC private field _nvc had the exact same content, I would just need to compare their references, right?

    Read the article

  • Compile time error: cannot convert from specific type to a generic type

    - by Water Cooler v2
    I get a compile time error with the following relevant code snippet at the line that calls NotifyObservers in the if construct. public class ExternalSystem<TEmployee, TEventArgs> : ISubject<TEventArgs> where TEmployee : Employee where TEventArgs : EmployeeEventArgs { protected List<IObserver<TEventArgs>> _observers = null; protected List<TEmployee> _employees = null; public virtual void AddNewEmployee(TEmployee employee) { if (_employees.Contains(employee) == false) { _employees.Add(employee); string message = FormatMessage("New {0} hired.", employee); if (employee is Executive) NotifyObservers(new ExecutiveEventArgs { e = employee, msg = message }); else if (employee is BuildingSecurity) NotifyObservers(new BuildingSecurityEventArgs { e = employee, msg = message }); } } public void NotifyObservers(TEventArgs args) { foreach (IObserver<TEventArgs> observer in _observers) observer.EmployeeEventHandler(this, args); } } The error I receive is: The best overloaded method match for 'ExternalSystem.NotifyObservers(TEventArgs)' has some invalid arguments. Cannot convert from 'ExecutiveEventArgs' to 'TEventArgs'. I am compiling this in C# 3.0 using Visual Studio 2008 Express Edition.

    Read the article

  • Can I pass a non-generic type where a generic type is expected?

    - by Water Cooler v2
    I want to define a set of classes that collect and persist data. I want to call them either on-demand basis, or in a chain-of-responsibility fashion, as the caller pleases. To support the chaining, I have declared my interface like so: interface IDataManager<T, K> { T GetData(K args); void WriteData(Stream stream); void WriteData(T data, Stream stream); IDataCollectionPolicy Policy; IDataManager<T, K> NextDataManager; } But the T's and K's for each concrete types will be different. If I give it like this: IDataManager<T, K> NextDataManager; I assume that the calling code will only be able to chain types that have the same T's and K's. Is there a way I can have it chain any type of IDataManager? One thing that occurs to me is to have IDataManager inherit from a non-generic IDataManager like so: interface IDataManager { } interface IDataManager<T, K>: IDataManager { T GetData(K args); void WriteData(Stream stream); void WriteData(T data, Stream stream); IDataCollectionPolicy Policy; IDataManager NextDataManager; } Is this going to work?

    Read the article

  • Can I have a type that's both, covariant and contravariant, i.e. fully fungible/changeable with sub

    - by Water Cooler v2
    Just a stupid question. I could try it out in 2 minutes, really. It's just that I have 1 GB RAM and have already got 2 instances of VS 2010 open on my desktop, with an instance of VS 2005, too. Opening another instance of VS 2010 would be an over kill. Can I have a type (for now forgetting its semantics) that can be covariant as well as contravariant? For e.g. public interface Foo<in out T> { void DoFooWith(T arg); } Off to Eric Lippert's blog for the meat and potatoes of variance in C# 4.0 as there's little else anywhere that covers adequate ground on the subject.

    Read the article

  • ref and out parameters in C# and cannot be marked as variant.

    - by Water Cooler v2
    What does the statement mean? From here ref and out parameters in C# and cannot be marked as variant. 1) Does it mean that the following can not be done. public class SomeClass<R, A>: IVariant<R, A> { public virtual R DoSomething( ref A args ) { return null; } } 2) Or does it mean I cannot have the following. public delegate R Reader<out R, in A>(A arg, string s); public static void AssignReadFromPeonMethodToDelegate(ref Reader<object, Peon> pReader) { pReader = ReadFromPeon; } static object ReadFromPeon(Peon p, string propertyName) { return p.GetType().GetField(propertyName).GetValue(p); } static Reader<object, Peon> pReader; static void Main(string[] args) { AssignReadFromPeonMethodToDelegate(ref pReader); bCanReadWrite = (bool)pReader(peon, "CanReadWrite"); Console.WriteLine("Press any key to quit..."); Console.ReadKey(); } I tried (2) and it worked.

    Read the article

  • What are these folders for? Can I remove them? How?

    - by Water Cooler v2
    In a folder on the SVN server/repository that is designated for our project, there have appeared the following folders: branches/ conf/ db/ hooks/ locks/ tags/ trunk/ README.txt (file) format (file) We have all the code in the trunk folder. There were, as far as I can remember, only 3 or 4 folders earlier. Within the trunk folder, too, there are now these folders. OurCode/ conf/ db/ hooks/ locks/ README.txt (file) format (file) I understand many of these folders or files are not necessary, but I can't be too sure. My questions are: 1) What are each of these files and/or folders for? 2) Which are the ones that are not necessary? 3) How may I remove them from the server repository?

    Read the article

  • Test if a method is an override?

    - by Water Cooler v2
    Is there a way to tell if a method is an override? For e.g. public class Foo { public virtual void DoSomething() {} public virtual int GimmeIntPleez() { return 0; } } public class BabyFoo: Foo { public override int GimmeIntPleez() { return -1; } } Is it possible to reflect on BabyFoo and tell if GimmeIntPleez is an override?

    Read the article

  • Restrict a generic type

    - by Water Cooler v2
    I want to restrict the generic type parameter to: 1) either that of a certain user defined reference type; OR 2) any of the primitive types in the CLR; How do I say something to the effect of: interface IDataManager<T>: IDataManager where T: IDataObject, T: ValueType

    Read the article

  • Practical Scheme Programming

    - by Ixmatus
    It's been a few months since I've touched Scheme and decided to implement a command line income partitioner using Scheme. My initial implementation used plain recursion over the continuation, but I figured a continuation would be more appropriate to this type of program. I would appreciate it if anyone (more skilled with Scheme than I) could take a look at this and suggest improvements. I'm that the multiple (display... lines is an ideal opportunity to use a macro as well (I just haven't gotten to macros yet). (define (ab-income) (call/cc (lambda (cc) (let ((out (display "Income: ")) (income (string->number (read-line)))) (cond ((<= income 600) (display (format "Please enter an amount greater than $600.00~n~n")) (cc (ab-income))) (else (let ((bills (* (/ 30 100) income)) (taxes (* (/ 20 100) income)) (savings (* (/ 10 100) income)) (checking (* (/ 40 100) income))) (display (format "~nDeduct for bills:---------------------- $~a~n" (real->decimal-string bills 2))) (display (format "Deduct for taxes:---------------------- $~a~n" (real->decimal-string taxes 2))) (display (format "Deduct for savings:-------------------- $~a~n" (real->decimal-string savings 2))) (display (format "Remainder for checking:---------------- $~a~n" (real->decimal-string checking 2)))))))))) Invoking (ab-income) asks for input and if anything below 600 is provided it (from my understanding) returns (ab-income) at the current-continuation. My first implementation (as I said earlier) used plain-jane recursion. It wasn't bad at all either but I figured every return call to (ab-income) if the value was below 600 kept expanding the function. (please correct me if that apprehension is incorrect!)

    Read the article

  • need help with some basic java.

    - by Racket
    Hi, I'm doing the first chapter exercises on my Java book and I have been stuck for a problem for a while now. I'll print the question, prompt/read a double value representing a monetary amount. Then determine the fewest number of each bill and coin needed to represent that amount, starting with the highest (assume that a ten dollar bill is the maximum size needed). For example, if the value entered is 47,63 (forty-seven dollars and sixty-three cents), and the program should print the equivalent amount as: 4 ten dollar bills 1 five dollar bills 2 one dollar bills 2 quarters 1 dimes 0 nickels 3 pennies" etc. I'm doing an example exactly as they said in order to get an idea, as you will see in the code. Nevertheless, I managed to print 4 dollars, and I can't figure out how to get "1 five dollar", only 7 dollars (see code). Please, don't do the whole code for me. I just need some advice in regards to what I said. Thank you. import java.util.Scanner; public class PP29 { public static void main (String[] args) { Scanner sc = new Scanner (System.in); int amount; double value; double test1; double quarter; System.out.println("Enter \"double\" value: "); value = sc.nextDouble(); amount = (int) value / 10; // 47,63 / 10 = 4. int amount2 = (int) value % 10; // 47 - 40 = 7 quarter = value * 100; // 47,63 * 100 = 4736 int sum = (int) quarter % 100; // 4763 / 100 => 4763-4700 = 63. System.out.println(amount); System.out.println(amount2); } }

    Read the article

  • Control diamond square algorithm to generate islands/pangea.

    - by Gabriel A. Zorrilla
    I generated a height map with the diamond square algorithm. The thing is i do not manage to create islands, this is, restrict the height other than water level range to a certain value in the center of the map. I manualy seeded a circle in the middle of the map but the rest of the map still receives heights over the water level. I dont fully understand the Perlin noise algorithm so i'd like to work with my current implementation of the diamond square algorithm which took me 3 days to interpret and code in PHP. :P

    Read the article

  • Utilities Worldwide Succeed with Oracle Utilities Applications

    - by caroline.yu
    More than 50 utilities worldwide have selected or implemented Oracle Utilities applications in the current fiscal year to date to respond to environmental imperatives, adapt to changing business conditions, meet and exceed customer expectations, implement smart grid components and address operational issues. Customers who have recently selected or implemented Oracle Utilities applications include: Acea Distribuzione, California Water Service Company, City of Winnipeg, Denver Water, Enersource Hydro, GasTerra, Modesto Irrigation District, Rappahannock Electric Cooperative, San Francisco Public Utilities Commission and Western Power. "Around the world, utilities are under pressure to address customer demands, improve environmental quality and comply with regulatory requirements. Oracle Utilities provides a choice of mission-critical applications to deliver tangible business results. Our recent traction in the industry illustrates the solid value we bring to our customers," said Stephan Scholl, senior vice president and general manager, Oracle Utilities.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >