Search Results

Search found 1017 results on 41 pages for 'greg graham'.

Page 35/41 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41  | Next Page >

  • Unit test approach for generic classes/methods

    - by Greg
    Hi, What's the recommended way to cover off unit testing of generic classes/methods? For example (referring to my example code below). Would it be a case of have 2 or 3 times the tests to cover testing the methods with a few different types of TKey, TNode classes? Or is just one class enough? public class TopologyBase<TKey, TNode, TRelationship> where TNode : NodeBase<TKey>, new() where TRelationship : RelationshipBase<TKey>, new() { // Properties public Dictionary<TKey, NodeBase<TKey>> Nodes { get; private set; } public List<RelationshipBase<TKey>> Relationships { get; private set; } // Constructors protected TopologyBase() { Nodes = new Dictionary<TKey, NodeBase<TKey>>(); Relationships = new List<RelationshipBase<TKey>>(); } // Methods public TNode CreateNode(TKey key) { var node = new TNode {Key = key}; Nodes.Add(node.Key, node); return node; } public void CreateRelationship(NodeBase<TKey> parent, NodeBase<TKey> child) { . . .

    Read the article

  • Conditionally setting the font color of an item in a drop down box in JSF

    - by Greg
    I'm a newbie to web programming, so please bear with me. I am using JSF 1.2 and I want to conditionally set the color of the items in my drop down list. In other words, I have a collection of items that, along with a key and a value, also have a boolean property, warning, that is dynamically set by user action. I want the drop down to show all of the items, but those whose warning property is set to true should be displayed in red. I assume I have to extend the SelectItem class to add in the boolean property. How do I then conditionally set the color of the font of those items whose warning property is set to true in my JSP pages? Thanks in advance

    Read the article

  • Error with custom Class definition in protocol

    - by Greg
    I'm trying to set up a custom delegate protocol and am getting a strange error that I don't understand. I wonder if someone could point out what I'm doing wrong here (I'm still new to Ob-C and protocol use)... The situation is that I've built my own URLLoader class to manage loading and parsing data from the internet. I'm now trying to set up a protocol for delegates to implement that will respond to the URLLoader's events. So, below is my protocol... #import <UIKit/UIKit.h> #import "URLLoader.h" /** * Protocol for delegates that will respond to a load. */ @protocol URLLoadResponder <NSObject> - (void)loadDidComplete:(URLLoader *)loader; - (void)loadDidFail:(URLLoader *)loader withError:(NSString *)error; @end However, I'm getting the following error for both method signatures: Expected ')' before 'URLLoader' I feel like I must be overlooking something small and silly. Any help folks could offer would be greatly appreciated! Whoops ... it was pointed out that I should include URLLoader.h. Here it is: #import <Foundation/Foundation.h> #import "URLLoadResponder.h" /** * URLLoader inferface. */ @interface URLLoader : NSObject { NSString *name; NSString *loadedData; NSMutableData *responseData; NSObject *delegate; BOOL _isLoaded; } @property (nonatomic, retain) NSString *name; @property (nonatomic, retain) NSString *loadedData; @property (nonatomic, retain) NSObject *delegate; - (void)loadFromURL:(NSString *)url; - (void)addCompleteListener:(id)observer selector:(SEL)sel; - (void)removeCompleteListener:(id)observer; - (void)parseLoadedData:(NSString *)data; - (void)complete; - (void)close; - (BOOL)isLoaded; + (NSURL *)makeUrlWithString:(NSString *)url; + (URLLoader *)initWithName:(NSString *)name; @end

    Read the article

  • Stop lazy-loading images?

    - by Greg
    Here's the issue – I followed along with the Apple lazy-load image sample code to handle my graphical tables. It works great. However, my lazy-load image tables are being stacked within a navigation controller so that you can move in and out of menus. While all this works, I'm getting a persistent crash when I move into a table then move immediately back out of it using the "back" button. This appears to be a result of the network connections loading content not being closed properly, or calling back to their released delegates. Now, I've tried working through this and carefully setting all delegates to nil and calling close on all open network connections before releasing a menu. However, I'm still getting the error. Also – short posting my entire application code into this post, I can't really post a specific code snippet that illustrates this situation. I wonder if anyone has ideas for tasks that I may be missing? Do I need to do anything to close a network connection other than closing it and setting it to nil? Also, I'm new to debugging tools – can anyone suggest a good tool to use to watch network connections and see what's causing them to fail? Thanks!

    Read the article

  • Is it OK to set state within Event Raising methods?

    - by Greg
    I ran across this pattern in the code of a library I'm using. It sets state within the event raising method, but only if the event is not null. protected virtual void OnMyEvent(EventArgs e) { if(MyEvent != null) { State = "Executing"; // Only sets state if MyEvent != null. MyEvent(this,e); } } Which means that the state is not set when overriding the method: protected override void OnMyEvent(EventArgs e) { base.OnMyEvent(e); Debug.Assert( State == "Executing" ); // This fails } but is only set when handling the event: foo.MyEvent += (o, args) => Debug.Assert(State == "Executing"); // This passes Setting state within the if(MyEvent != null) seems like bad form, but I've checked the Event Design Guidelines and it doesn't mention this. Do you think this code is incorrect? If so, why? (Reference to design guidelines would be helpful). Edit for Context: It's a Control, I'm trying to create subclass of it, and the state that it's setting is calling EnsureChildControls() conditionally based upon there being an event handler. I can call EnsureChildControls() myself, but I consider that something of a hack.

    Read the article

  • why does my C# client that uses Library A need to have a using statement for Library B (which A uses

    - by Greg
    Hi, I have: Main Program Class - uses Library A Library A - has partial classes which mix in methods from Library B Library B - mix in methods & interfaces So in Library B when I include a partial Node class which implements INode (defined in Library B) I suddenly get an error in my main class where it uses Node from Library A. The error tells me in the Main Class I have to have a using statement to Library B. Any ideas?

    Read the article

  • Does the order of conditions in a WHERE clause affect MySQL performance?

    - by Greg
    Say that I have a long, expensive query, packed with conditions, searching a large number of rows. I also have one particular condition, like a company id, that will limit the number of rows that need to be searched considerably, narrowing it down to dozens from hundreds of thousands. Does make any difference to MySQL performance whether I do this: SELECT * FROM clients WHERE (firstname LIKE :foo OR lastname LIKE :foo OR phone LIKE :foo) AND (firstname LIKE :bar OR lastname LIKE :bar OR phone LIKE :bar) AND company = :ugh or this: SELECT * FROM clients WHERE company = :ugh AND (firstname LIKE :foo OR lastname LIKE :foo OR phone LIKE :foo) AND (firstname LIKE :bar OR lastname LIKE :bar OR phone LIKE :bar)

    Read the article

  • How do I get the sequence of numbers in a sorted-set that are between two integers in clojure?

    - by Greg Rogers
    Say I have a sorted-set of integers, xs, and I want to retrieve all the integers in xs that are [x, y), ie. between x and y. I can do: (select #(and (>= % x) (< % y)) xs) But this is inefficient - O(n) when it could be O(log n), I expect the number of elements returned to be small. Using take-while and drop-while would let me exit once I've reached y, but I still can't jump to x efficiently. I am just learning clojure so here is how I would do it in C++: set<int>::iterator first = xs.lower_bound(x); set<int>::iterator last = xs.lower_bound(y); for (; first != last; ++first) // do something with *first Can I do this in clojure?

    Read the article

  • jQuery .ready() automatically assigning variables for each element with ID in DOM

    - by Greg
    I have noticed some unexpected behaviour when using the jQuery .ready() function, whereby afterwards you can reference an element in the DOM simply by using its ID without prior declaration or assignment: <html> <script src="jquery.js"></script> <script> $(document).ready(function() { myowndiv.innerHTML = 'wow!' }); </script> <body> <div id="myowndiv"></div> </body> </html> I would have expected to have to declare and assign myowndiv with document.getElementById("myowndiv"); or $("#myowndiv"); before I could call innerHTML or anything else on it? Is this behaviour by design? Can anyone explain why? My fear is that if I refactor and end up not using .ready() or even using jQuery at all then my code will fail to execute. Cheers!

    Read the article

  • does class/object models have a out-of-the-box equivalent to a database foreign key constraint

    - by Greg
    Hi, Does does class/object models have a out-of-the-box equivalent to a database foreign key constraint? Assume the language is C# please. That is say Class A has a field that references Class B and vica-versa. If I have Object A & B (instantiated from these classes) what happens if I delete Object B? Does it auto-delete or throw a constraint issue if it still exists in Object A as a reference? That is, for this scenario is there a way to ensure when a Object A is delete that either (a) object B is delete like a cascade delete, or (b) a constraint exception is thrown as the expectation is that the reference in Class B should be non-null?

    Read the article

  • lua - how to call function from above it in code (prior to it being defined)?

    - by Greg
    what is the syntax (i.e. code example) in Lua so you can call a function prior to it being defined? i.e. how do you kind of create the function, but then add it's implementation further down in code. So roughly like this: define function name (doX) here somehow (i.e. subject of this question) call doX here (further down in the code) doX implemention here (i.e. all functions down at the bottom of the file)

    Read the article

  • How to determine element touched on touchend for a page with layers

    - by Greg
    I cannot supply a follow up question as of yet to Get the element under a touchend , so I am opening a new issue. I want to get the element under a touchend that is different from the touchstart, but my page has absolutely positioned elements, and the function document.elementFromPoint keeps on returning my background element instead of every element in front of it. How do I get the actual element being touched?

    Read the article

  • XCode Project Code Changes Not Updating 100% After Save-Build-Run

    - by Greg
    When I make code changes to my iPhone game project in XCode, and then do CMD-B + Enter, I expect the project to be saved, build and run on the simulator with the latest. What is happening though, sometimes, is that it doesn't pick up a small change I make unless I clean the project and then build. I'm a long time Java person and newish to C-based languages and it's compiler. Can someone explain to me what is cached after each build that does this and how to change my project settings to avoid having to clean everytime? Or tell me the bad news that this is part of C development? Not trying to bash it - I get compiled JSPs stuck in the working cache often in Java, too. :P

    Read the article

  • C++ - Creating a god object

    - by Greg Kritzman
    Hypothetical situation that I'm struggling to get my head past. HoldsFooBar.h: #include "foo.h" #include "bar.h" class HoldsFooBar{ foo F; bar B; }; foo.h: //includes? class foo{ HoldsFooBar *H; void Baz(); }; bar.h: //includes? class bar{ HoldsFooBar *H; void Qux(); }; I'm trying to get F to get a hold of B. In all other languages I've worked with, I would be able to H->B.Qux();, but I'm totally lost in C++. At the includes lines in foo.h and bar.h, it seems like my options are to forward-declare class HoldsFooBar; but then I can only access H, and F and B cannot see each other. Likewise, I can #include "HoldsFooBar.h" but because of my include guards, something ends up not getting linked properly, so the program doesn't run. Is what I'm trying to do even possible? Thank you very much! Any help would be appreciated!

    Read the article

  • Volume Shadow Copy not starting

    - by Gram
    Hi We are running a Windows 2008 Small Business Server with Symantec Backup Exec. Last night the back up failed due to the Volume Shadow Copy service being unable to start. When I try to manually start it I get the following error "windows could not start the volume shadow copy on local computer" Has anybody any suggestions other than rebooting the server? many thanks Graham

    Read the article

  • Raspberry Pi Powered Coffee Table Serves Up Arcade Classics

    - by Jason Fitzpatrick
    If your living room is boring for want of a plethora of arcade hits, this DIY project parks a Raspberry Pi powered arcade machine in a coffee table for at-your-finger-tips retro gaming. Courtesy of tinker Graham Gelding, this build combines a 24-inch monitor, arcade buttons, a Raspberry Pi board, and a wooden coffee table to great effect. The end result is a table-top style arcade that also doubles, courtesy of a wireless keyboard and mouse, as a web browsing and email station. Hit up the link below for more information. Coffee Table Pi [via Hack A Day] HTG Explains: Why It’s Good That Your Computer’s RAM Is Full 10 Awesome Improvements For Desktop Users in Windows 8 How To Play DVDs on Windows 8

    Read the article

  • Estudio de caso: CFO de At&T le apunta a la tecnología para transformar las Finanzas Globales

    - by RED League Heroes-Oracle
    AT&T es una de las pocas multinacionales modernas que han participado de todas las etapas anteriores de la innovación de las telecomunicaciones, de Alexander Graham Bell como inventor solitario, a Bell Labs, a los lanzamientos acelerados en las fundiciones de AT&T. La tecnología es el corazón de todo lo que AT&T hace, incluyendo sus inversiones en innovaciones tecnológicas para permitir que las finanzas de AT&T trabajen más estratégicamente con los negocios para asegurar que las inversiones en las iniciativas de crecimiento sean exitosas. Según John Stephens, Vicepresidente Ejecutivo y director financiero de AT&T, la empresa ha trazado un plan de inversión de tres años para mejorar y aumentar sus redes IP de banda ancha alámbricas e inalámbricas. El plan incluye la implementación del servicio 4G LTE para 300 millones de personas en los Estados Unidos, expansión de IP de banda ancha de alta velocidad a unos 57 millones de hogares de clientes y una expansión de la fibra a 1 millón de clientes corporativos adicionales en su área de servicio de telefonía fija. "La necesidad de velocidad es mayor que nunca, y este proyecto es nuestro paso hacia la innovación para ofrecer tal velocidad," dice Stephens. Como AT&T moderniza su infraestructura global, sus procesos operacionales se hacen tan poderosos como su red. Ha sido una tarea grande y compleja, pero Stephens se complace al decir que el departamento de finanzas de AT&T ha adoptado su papel de catalizador corporativo. Empezó con un concepto simple: "Vamos a hacer que todos hablen en el mismo idioma". Esto llevó a la consolidación de sistemas financieros heredados de las empresas adquiridas. No fue una tarea sencilla, dado que la empresa pasó por más de cinco adquisiciones importantes y un sinfín de otras transacciones. En 2007, AT&T tenía 17 aplicaciones apenas en la función de cuentas por pagar. Hoy, el número se ha reducido a dos. Asimismo, hubo 50 sistemas de reportes gerenciales oficiales y ahora hay tres, con planes de excluir uno de ellos. Al tener un único lenguaje volcado a las Finanzas en toda la empresa, el equipo de finanzas de AT&T ha eliminado las varias versiones de los mismos datos, reduciendo la posible confusión en las discusiones y en las decisiones de estrategia de negocios. Estos pasos también han reducido los costos y aceleraron la toma de decisiones. "Lo lindo de los sistemas es que permiten que la gente talentosa con habilidades analíticas usen su tiempo en esa zona, en vez de gastar tiempo en recolección, agregación y organización de los datos," señala Stephens. "Tenemos un proceso eficiente y eficaz que hace que nosotros, dejemos a la gente libre para dedicarse a aquello en que son realmente buenos. Y tenemos un equipo de alta calidad y ellos están en su mejor punto cuando son capaces de hacer su función para apoyar a la unidad de negocio”AT&T es una de las pocas multinacionales modernas que han participado de todas las etapas anteriores de la innovación de las telecomunicaciones, de Alexander Graham Bell como inventor solitario, a Bell Labs, a los lanzamientos acelerados en las fundiciones de AT&T. La tecnología es el corazón de todo lo que AT&T hace, incluyendo sus inversiones en innovaciones tecnológicas para permitir que las finanzas de AT&T trabajen más estratégicamente con los negocios para asegurar que las inversiones en las iniciativas de crecimiento sean exitosas.  Según John Stephens, Vicepresidente Ejecutivo y director financiero de AT&T, la empresa ha trazado un plan de inversión de tres años para mejorar y aumentar sus redes IP de banda ancha alámbricas e inalámbricas. El plan incluye la implementación del servicio 4G LTE para 300 millones de personas en los Estados Unidos, expansión de IP de banda ancha de alta velocidad a unos 57 millones de hogares de clientes y una expansión de la fibra a 1 millón de clientes corporativos adicionales en su área de servicio de telefonía fija. "La necesidad de velocidad es mayor que nunca, y este proyecto es nuestro paso hacia la innovación para ofrecer tal velocidad," dice Stephens. Como AT&T moderniza su infraestructura global, sus procesos operacionales se hacen tan poderosos como su red. Ha sido una tarea grande y compleja, pero Stephens se complace al decir que el departamento de finanzas de AT&T ha adoptado su papel de catalizador corporativo. Empezó con un concepto simple: "Vamos a hacer que todos hablen en el mismo idioma". Esto llevó a la consolidación de sistemas financieros heredados de las empresas adquiridas. No fue una tarea sencilla, dado que la empresa pasó por más de cinco adquisiciones importantes y un sinfín de otras transacciones. En 2007, AT&T tenía 17 aplicaciones apenas en la función de cuentas por pagar. Hoy, el número se ha reducido a dos. Asimismo, hubo 50 sistemas de reportes gerenciales oficiales y ahora hay tres, con planes de excluir uno de ellos. Al tener un único lenguaje volcado a las Finanzas en toda la empresa, el equipo de finanzas de AT&T ha eliminado las varias versiones de los mismos datos, reduciendo la posible confusión en las discusiones y en las decisiones de estrategia de negocios. Estos pasos también han reducido los costos y aceleraron la toma de decisiones. "Lo lindo de los sistemas es que permiten que la gente talentosa con habilidades analíticas usen su tiempo en esa zona, en vez de gastar tiempo en recolección, agregación y organización de los datos," señala Stephens. "Tenemos un proceso eficiente y eficaz que hace que nosotros, dejemos a la gente libre para dedicarse a aquello en que son realmente buenos. Y tenemos un equipo de alta calidad y ellos están en su mejor punto cuando son capaces de hacer su función para apoyar a la unidad de negocio”

    Read the article

  • Oracle is #1 in the RDBMS Sector for 2011

    - by jgelhaus
    Gartner 2011 Worldwide RDBMS Market Share Reports 48.8% revenue share for Oracle (*) Gartner has published their market share numbers for 2011 based on total software revenues.  According to Gartner, Oracle: is #1 in worldwide RDBMS software revenue share holds more revenue share than its seven closest competitors combined grew at 18.0%, exceeding both the industry average (16.3%) and the growth rates of its closest competitors. (*) Source: Market Share: All Software Markets, Worldwide 2011 by Colleen Graham, Joanne Correia, David Coyle, Fabrizio Biscotti, Matthew Cheung, Ruggero Contu, Yanna Dharmasthira, Tom Eid, Chad Eschinger, Bianca Granetto, Hai Hong Swinehart, Sharon Mertz, Chris Pang, Asheesh Raina, Dan Sommer, Bhavish Sood, Marianne D'Aquila, Laurie Wurster and Jie Zhang. - March 29, 2012

    Read the article

  • What's the format of Real World Performance Day?

    - by william.hardie
    A question that has cropped a lot of late is "what's the format of Real World Performance Day?" Not an unreasonable question you might think. Sure enough, a quick check of the Independent Oracle User Group's website tells us a bit about the Real World Performance Day event, but no formal agenda? This was one of the questions I posed to Tom Kyte (one of the main presenters) in our recent podcast. Tom tells us that this isn't your traditional event where one speaker follows another with loads of slides. In fact, the Real World Performance Day features Tom and fellow Oracle performance experts - Andrew Holdsworth and Graham Wood - continuously on stage throughout the day. All three will be discussing database performance challenges and solutions from development, architectural design and management perspectives. There's going to be multi-terabyte demos on show, less of the traditional slides, and more interactive debate and discussion going on. Tune-in and hear what else Tom has to say about this fairly unique event!

    Read the article

  • Steve Jobs est "un méchant dictateur" d'après un expert en nouvelles technologies, et vous, qu'en pensez-vous?

    Steve Jobs est "un méchant dictateur" d'après un expert en nouvelles technologies, et vous, qu'en pensez-vous ? Paul Graham, CEO de Y Combinator (entreprise qui investit dans des start-ups), a donné une interview à Bloomberg la semaine dernière. Lors de cet entretien, il n'a pas mâché ses mots. Parlant de l'industrie des nouvelles technologies, et donnant des conseils aux nouveaux entrepreneurs, il s'est ensuite penché sur le cas Apple. Il a alors déclaré que le monopole est toujours une mauvaise chose, par rapport au fait que la firme de Cupertino pourrait devenir le "Microsoft du mobile". Il a ensuite ajouté : "La situation est vraiment ironique et je me demande ce que Steve Jobs en pense. ...

    Read the article

  • What is Perl's relation with hackers?

    - by K.Steff
    I know Perl is a language revered by many hackers (as in hacker vs cracker) and respected by many good programmers for its expressiveness. I also realize it is useful to know and it's very handy at generalizing common Unix tasks (Unix here includes Linux and Cygwin). I also know that being a good hacker probably means you're a good programmer in general (references on this one are sparse around the web, but about everything Paul Graham has ever written seems approving of this statement to me). So my question is whether there is a reason that attracts hackers to Perl in particular? Will learing Perl improve my general programming, problem-solving and hacking skills if done properly? Does it present unique tools that are more useful to a hacker?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41  | Next Page >