Search Results

Search found 2008 results on 81 pages for 'greg smith'.

Page 49/81 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • How to get an object from a list based upon IEqualityComparer<T>

    - by Greg
    The Compare method in Linq lets you find by an IEqualityComparer, but I can't find a counterpart method that allows you retrieve an item by the same comparer. Is this really the best way to do it? MyItem myFinderItem = new MyItem(keyField1, keyField2); if (myList.Contains(myFinderItem, new MyEqualityComparer())) { MyItem myRealItem = myList.Single(item => new MyEqualityComparer().Equals(item , myFinderItem)); } (I'm sharing the usage of the IEqualityComaprer with a call to the Except Linq method and I'd like to maintain a single source for equality comparisons)

    Read the article

  • Developing Job References

    - by Joe Smith
    How do you develop references for jobs? I have 6 years of programming experience spanning two jobs, but sadly I don't have a lot of people I can draw on as references. It's been several years since I left my last job, which was at a small company, and I've lost touch with the few people I knew there. I now work at another small company. I think I've gone as far as I can in my current position, and would like to look for greener pastures, but I can't exactly use my current boss as a reference, even though I have a very good repore with him. I'm sure he'd make a great reference down the road, but I'm afraid I'd insult him or jeopardize my current job by mentioning that I'm thinking of leaving and would like him to help me. I've applied to some jobs, and I have gotten several replies like, "Oh, you're exactly what we're looking for. Send us a couple references and we'll schedule an interview. Oh, no references? You must be a psychopath, nevermind." I've tried doing some small freelance work on the side, just so I can have a contact who can vouch for my work, but the competition for even small projects is pretty fierce and I can rarely devote adequate time to freelancing while holding a full time job. In addition, I often encounter a Catch-22 where a lot of freelancing jobs also require references. So how do programmers maintain existing references and develop new ones, especially while holding a full time job?

    Read the article

  • What is the simplest, but solid, interface from WinForms to a SQL Server database?

    - by Greg
    Hi, If I wanted to have my data in SQL Server, but wanted to use a thick client WinForms application for users, what would be the best practice way to have calls occurring from WinForms to database? And how simple is this? I guess I'm trying to gauge to what extent there are issues with this approach and one needs to go for some (a) middle tier with web services, or (b) have to go asp.net or something. I really just have a simple app that needs a database and I'll only have a 10 - 30 clients on a LAN/WAN network that would be connecting in.

    Read the article

  • Setting up a "to-many" relationship value dependency for a transient Core Data attribute

    - by Greg Combs
    I've got a relatively complicated Core Data relationship structure and I'm trying to figure out how to set up value dependencies (or observations) across various to-many relationships. Let me start out with some basic info. I've got a classroom with students, assignments, and grades (students X assignments). For simplicity's sake, we don't really have to focus much on the assignments yet. StudentObj <--->> ScoreObj <<---> AssignmentObj Each ScoreObj has a to-one relation with the StudentObj and the AssignmentObj. ScoreObj has real attributes for the numerical grade, the turnInDate, and notes. AssignmentObj.scores is the set of Score objects for that assignment (N = all students). AssignmentObj has real attributes for name, dueDate, curveFunction, gradeWeight, and maxPoints. StudentObj.scores is the set of Score objects for that student (N = all assignments). StudentObj also has real attributes like name, studentID, email, etc. StudentObj has a transient (calculated, not stored) attribute called gradeTotal. This last item, gradeTotal, is the real pickle. it calculates the student's overall semester grade using the scores (ScoreObj) from all their assignments, their associated assignment gradeWeights, curves, and maxPoints, and various other things. This gradeTotal value is displayed in a table column, along with all the students and their individual assignment grades. Determining the value of gradeTotal is a relatively expensive operation, particularly with a large class, therefore I want to run it only when necessary. For simplicity's sake, I'm not storing that gradeTotal value in the core data model. I don't mind caching it somewhere, but I'm having a bitch of a time determining where and how to best update that cache. I need to run that calculation for each student whenever any value changes that affects their gradeTotal. If this were a simple to-one relationship, I know I could use something like keyPathsForValuesAffectingGradeTotal ... but it's more like a many-to-one-to-many relationship. Does anyone know of an elegant (and KVC correct) solution? I guess I could tear through all those score and assignment objects and tell them to register their students as observers. But this seems like a blunt force approach.

    Read the article

  • try-catch in JavaScript : how to get stack trace or line number of the original error

    - by Greg Bala
    When using TRY-CATCH in JavaScript, how to get the line number of the line that caused the error? On many browsers, the below code will work great and I will get the stack trace that points to the actual line that throw the exception. However, some browsers do not have "e.stack". Iphone's safari is one example. Is there someway to get the line number that will work for all browsers? try { // lots of code here var i = v.WillGenerateError; // how to get this line number in catch?? // lots of code here } catch (e) { alert (e.stack) // this will not work on iPhone, for example } Many thanks!

    Read the article

  • Windows Azure - access webrole local storage from separate workerrole

    - by Brett Smith
    I'm running an application on windows azure, the MVC views need to be dynamic, I started by storing them as records in the database, but am quite keen to move them to a physical location. My concept was to create the physical file via code... which worked great and speeds up the page load dramatically. This was of course before I realised that the files were only available for the duration of the role Next I looked at a start up task to create the files when the role was started - however I then realised that any separate instances weren't going to sync up unless I monitored the database for changes. So I moved from a start up task to a function in the run method of the role that checks the database every 10 minutes to see if changes have occurred. The problem is that this seems to choke up the application (at least in the warm up stage). Ideally I would like to move the run function to it's own worker role that can sit there and push files out to web role instances, but I'm unsure on how I would go about accessing the web roles local storage from the worker role. Can anybody tell me whether this is actually possible? and hopefully point me in the right direction to achieve this? Just to clarify what I'm trying to achieve -View is created in user interface running on web role and stored in database -Separate web role (front end) has clientside application with virtualpath provider pointing Views requests to local storage (localresource) -separate worker role to create View structure and load this into clientside web role local storage

    Read the article

  • Join Where Rows Don't Exist or Where Criteria Matches...?

    - by Greg
    I'm trying to write a query to tell me which orders have valid promocodes. Promocodes are only valid between certain dates and optionally certain packages. I'm having trouble even explaining how this works (see psudo-ish code below) but basically if there are packages associated with a promocode then the order has to have one of those packages and be within a valid date range otherwise it just has to be in a valid date range. The whole "if PrmoPackage rows exist" thing is really throwing me off and I feel like I should be able to do this without a whole bunch of Unions. (I'm not even sure if that would make it easier at this point...) Anybody have any ideas for the query? if `OrderPromoCode` = `PromoCode` then if `OrderTimestamp` is between `PromoStartTimestamp` and `PromoEndTimestamp` then if `PromoCode` has packages associated with it //yes then if `PackageID` is one of the specified packages //yes code is valid //no invalid //no code is valid Order: OrderID* | OrderTimestamp | PackageID | OrderPromoCode 1 | 1/2/11 | 1 | ABC 2 | 1/3/11 | 2 | ABC 3 | 3/2/11 | 2 | DEF 4 | 4/2/11 | 3 | GHI Promo: PromoCode* | PromoStartTimestamp* | PromoEndTimestamp* ABC | 1/1/11 | 2/1/11 ABC | 3/1/11 | 4/1/11 DEF | 1/1/11 | 1/11/13 GHI | 1/1/11 | 1/11/13 PromoPackage: PromoCode* | PromoStartTimestamp* | PromoEndTimestamp* | PackageID* ABC | 1/1/11 | 2/1/11 | 1 ABC | 1/1/11 | 2/1/11 | 3 GHI | 1/1/11 | 1/11/13 | 1 Desired Result: OrderID | IsPromoCodeValid 1 | 1 2 | 0 3 | 1 4 | 0

    Read the article

  • Twitter feed appears to be both RSS 2.0 and Atom?

    - by Greg K
    I'm parsing various site feeds, and putting together a small library to help me do it. Looking at the Atom RFC and RSS 2.0 specification, feeds from Twitter seem to be a combination. Twitter specifies an Atom namespace in an RSS 2.0 structure? GitHub uses Atom, whereas Flickr (offers multiple but the default 'Latest' feed from user profiles) appears to be RSS 2.0. How can Twitter specify a Atom namespace and then use RSS? This makes parsing feeds a little ambiguous, unless I ignore any specified namespace and just examine the document structure.

    Read the article

  • Determine branch of origin from bzr blame

    - by Dave Aaron Smith
    I had a complicated change that affected a bunch of files. I don't remember what bazaar branch I wrote that change in. We have a somewhat complicated merge setup, so the branch I'm in now lumps that change in with a lot of other changes. I'd like to do some very similar work so it would be nice to pull the original diff. I feel like I should be able to use bzr blame. I run this command on one of the files bzr blame --long path/to/file and I find one of the pertinent lines and get something like 1107.6.213 dsmith@satie 20091202 | tinyMCE.init({ Can I use that to figure out what branch and revision the original change came from? What do the 6 and 213 stand for?

    Read the article

  • what is a performance way to 'tree-walking' through my Entity Framework data

    - by Greg
    Hi, I have a Entity Framework design with a few tables that define a "graph". So there can be a large chain of relationships between objects in the few tables via concept of parent/child relationships. What is a performance way to 'tree-walking' through my Entity Framework data? That is I assume I wouldn't want to load the full set of all NODES and RELATIONSHIPS from the database for the purpose of walking the tree, where the end result may only be identifying leaf nodes? Or would this be OK with the way lazy loading may work at the column/parameter level? Else how could I load just the skeleton of the objects and then when needing to refer to any attributes have them lazy load then?

    Read the article

  • Nested Usercontrols and ViewState

    - by Bob Smith
    I have a UserControlParent that dynamically loads UserControlChild. In the UserControlChild, I store a value using the ViewState object by doing a ViewState["count"] = myCount; On Postbacks, the ViewState returns a null. Is this because the UserControlChild is being loaded dynamically? If it helps, the UserControlParent is loaded dynamically in the ASPX page as well.

    Read the article

  • All UITableCells rendered at once... why?

    - by Greg
    I'm extremely confused by the proper behavior of UITableView cell rendering. Here's the situation: I have a list of 250 items that are loading into a table view, each with an image. To optimize the image download, I followed along with Apple's LazyTableImages sample code... pretty much following it exactly. Really good system... for reference, here's the cell renderer within the Apple sample code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // customize the appearance of table view cells // static NSString *CellIdentifier = @"LazyTableCell"; static NSString *PlaceholderCellIdentifier = @"PlaceholderCell"; // add a placeholder cell while waiting on table data int nodeCount = [self.entries count]; if (nodeCount == 0 && indexPath.row == 0) { UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:PlaceholderCellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:PlaceholderCellIdentifier] autorelease]; cell.detailTextLabel.textAlignment = UITextAlignmentCenter; cell.selectionStyle = UITableViewCellSelectionStyleNone; } cell.detailTextLabel.text = @"Loading…"; return cell; } UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } // Leave cells empty if there's no data yet if (nodeCount > 0) { // Set up the cell... AppRecord *appRecord = [self.entries objectAtIndex:indexPath.row]; cell.textLabel.text = appRecord.appName; cell.detailTextLabel.text = appRecord.artist; // Only load cached images; defer new downloads until scrolling ends if (!appRecord.appIcon) { if (self.tableView.dragging == NO && self.tableView.decelerating == NO) { [self startIconDownload:appRecord forIndexPath:indexPath]; } // if a download is deferred or in progress, return a placeholder image cell.imageView.image = [UIImage imageNamed:@"Placeholder.png"]; } else { cell.imageView.image = appRecord.appIcon; } } return cell; } So – my implementation of Apple's LazyTableImages system has one crucial flaw: it starts all downloads for all images immediately. Now, if I remove this line: //[self startIconDownload:appRecord forIndexPath:indexPath]; Then the system behaves exactly like you would expect: new images load as their placeholders scroll into view. However, the initial view cells do not automatically load their images without that prompt in the cell renderer. So, I have a problem: with the prompt in the cell renderer, all images load at once. Without the prompt, the initial view doesn't load. Now, this works fine in Apple sample code, which got me wondering what was going on with mine. It's almost like it was building all cells up front rather than just the 8 or so that would appear within the display. So, I got looking into it, and this is indeed the case... my table is building 250 unique cells! I didn't think the UITableView worked like this, I guess I thought it only built as many items as were needed to populate the table. Is this the case, or is it correct that it would build all 250 cells up front? Also – related question: I've tried to compare my implementation against the Apple LazyTableImages sample, but have discovered that NSLog appears to be disabled within the Apple sample code (which makes direct behavior comparisons extremely difficult). Is that just a simple publish setting somewhere, or has Apple somehow locked down their samples so that you can't log output at runtime? Thanks!

    Read the article

  • Replacing Text Nodes With DOM Nodes

    - by Greg
    Hey, say I have a text node via XPath. How would I replace the text node with a new DOM node? For example, this little patch of code will go through text nodes, and if text matches something, it will replace it with a corresponding image via img element. I wanted something faster then a global page regex or even a element innerHTML regex. Any help would be appreciated. EDIT: Never mind. I figured it out.

    Read the article

  • how do use Ninject with class libraries I am developing?

    - by Greg
    Hi, If I am working on a class library how do I make use of Ninject here? Ie from the internal class library point of view and also from the client code? For example: should the class library have it's own IOC set up, or should it always assume the client code will supply? if no (ie it's upto the client to have the IOC in place) then where is the mapping data stored here'. Is this mapping of the class library's functionality to be places in the client? have a reusable library that is available, that uses interfaces with classes that use the getInstance concept to create concrete classes for you to use, then in this case would that make sense on the client side to use the IOC container to create instances of these classes? Or is that really applying a double layer of abstraction? Q2 Or in the cases where I'm building the reusable library myself and want the client to use an IOC container, then in my reusable library would I then dispense with any overhead of having factories or "getInstance" methods to instantiate the classes in the client? (i.e. as the IOC container would do this no?)

    Read the article

  • Get Specific Data From Array, Based On Another Value

    - by A Smith
    I have an array that outputs these values: Array ( [0] => stdClass Object ( [ID] => 6585 [COLOR] => red [Name] => steve ) [1] => stdClass Object ( [ID] => 5476 [COLOR] => blue [Name] => sol ) [2] => stdClass Object ( [ID] => 7564 [COLOR] => yellow [Name] => jake ) [3] => stdClass Object ( [ID] => 3465 [COLOR] => green [Name] => helen ) ) Now, I will know the ID of the person, and I need the get the COLOR value for that specific value set. How is this best achieved please?

    Read the article

  • accessing required modules from other modules

    - by john smith
    I have a bare-bone express application, exactly the one that is created with the express command. I have installed socket.io and attached it to my server, like this: var app = express(), server = http.createServer(app), io = io.listen(server); server.listen(8000); Now, I also have the routes files, which is called like this: app.get('/', routes.index); Inside this module I have the following function: exports.index = function(req, res){ socket.emit('news', { message: "foo" }); }; This obviously leads to a 500 reference error, because the routes file is an exportable module, and obviously has no idea what the socket is, as it is located in the app.js file. Is there a way I can access this socket object from this, or any other file? Please note that it is attached to the express generated app. extra: what about getting/setting session data? Thanks in advance.

    Read the article

  • c# hierarchy collection library? - anyone know of one (e.g. GetDirectChildren, GetAllChildren, GetPa

    - by Greg
    Hi, Does anyone know of a solid C# library / approach to manage a hierarchy/web type collection? This would be a library that would basic consist of the concept of nodes & relationships, for example to model web pages/files linked under a URL, or modeling IT infrastructure. It would have key methods such as: Node.GetDirectParents() Node.GetRootParents() Node.GetDirectChildren() Node.GetAllChildren() So it's smarts would include the ability to "walk the tree" of nodes based on the relationships when someone does ask for "give me all the children under this node" for example. It ideally include a persistence layer, to save/retrieve such data to/from a databases (e.g. with a Nodes and Relationships table). Thanks

    Read the article

  • WCF Rest services for use with the repository pattern?

    - by mark smith
    Hi there, I am considering moving my Service Layer and my data layer (repository pattern) to a WCF Rest service. So basically i would have my software installed locally (WPF client) which would call the Service Layer that exists via a Rest Service... The service layer would then call my data layer using a WCF Rest Service also OR maybe just call it via the DLL assembly I was hoping to understand what the performance would be like. Currently I have my datalayer and servicelayer installed locally via DLL Assemblies locally on the pc. Also i presume the WCF REST services won't support method overloading hance the same name but with a different signature?? I would really appreciate any feedback anyone can give. Thanks

    Read the article

  • Looking for marg_setValue fix in iPhoneOS

    - by John Smith
    I am trying to compile a library originally written for Cocoa. Things are good until it looks for the function marg_setValue(). It says there is a syntax error before char in marg_setValue(argumentList,argumentOffset,char,(char)lua_toboolean(state,luaArgument)); (it's talking about the third argument, not (char) ) I am trying to port LuaObjectiveCBridge to the iPhone. It has two choices, either using Runtime or Foundation. I have discovered there are some problems with foundation so I am trying runtime. But the compiler is not co-operating.

    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(k log n) where k is the number of integers returned. 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.upper_bound(y); for (; first != last; ++first) // do something with *first Can I do this in clojure?

    Read the article

  • Implementing MEF with ASP.NET MVC?

    - by mark smith
    I am trying to find out if anyone has any experience or ideas of using MEF (Managed Extensible Framework (Microsoft's new plugin framework) with ASP.NET MVC. I need to create a standard ASP.NET MVC, which I have. But I need to offer additional functionality i.e. Views and Controllers, etc, depending on if I add a plugin. It doesn't need to be dynamically compiled i.e. source code... but a DLL that i put into the system.. Is there any way to dynamically load a DLL when the app starts, and then MERGE a VIEWS and CONTROLLERS with the main system? I don't know if i am on the right track here. Then, I suppose in the "STANDARD" views that come with the app, I can use an "IF THEN" to find out if a plugin is loaded and MERGE in a user control. Well, I'm talking out loud here, but I think you understand what I am getting at. Any ideas?

    Read the article

  • Compare two Xcode build settings

    - by John Smith
    I have a project where I use two build settings predominantly. Unfortunately today something went wrong. One compiles and the other doesn't. How can I compare the two build settings in XCode to see what the differences are? (For those interested, the error I get in one build is jump to case label crosses initialization of 'const char* selectorName' if you know what this means I'll be very grateful )

    Read the article

  • Ideas for designing an automated content tagging system needed

    - by Benjamin Smith
    I am currently designing a website that amongst other is required to display and organise small amounts of text content (mainly quotes, article stubs, etc.). I currently have a database with 250,000+ items and need to come up with a method of tagging each item with relevant tags which will eventually allow for easy searching/browsing of the content for users. A very simplistic idea I have (and one that I believe is employed by some sites that I have been looking to for inspiration (http://www.brainyquote.com/quotes/topics.html)), is to simply search the database for certain words or phrases and use these words as tags for the content. This can easily be extended so that if for example a user wanted to show all items with a theme of love then I would just return a list of items with words and phrases relating to this theme. This would not be hard to implement but does not provide very good results. For example if I were to search for the month 'May' in the database with the aim of then classifying the items returned as realting to the topic of Spring then I would get back all occurrences of the word May, regardless of the semantic meaning. Another shortcoming of this method is that I believe it would be quite hard to automate the process to any large scale. What I really require is a library that can take an item, break it down and analyse the semantic meaning and also return a list of tags that would correctly classify the item. I know this is a lot to ask and I have a feeling I will end up reverting to the aforementioned method but I just thought I should ask if anyone knew of any pre-existing solution. I think that as the items in the database are short then it is probably quite a hard task to analyse any meaning from them however I may be mistaken. Another path to possibly go down would be to use something like amazon turk to outsource the task which may produce good results but would be expensive. Eventually I would like users to be able to (and want to!) tag content and to vote for the most relevant tags, possibly using a gameification mechanic as motivation however this is some way down the line. A temporary fix may be the best thing if this were the route I decided to go down as I could use the rough results I got as the starting point for a more in depth solution. If you've read this far, thanks for sticking with me, I know I'm spitballing but any input would be really helpful. Thanks.

    Read the article

  • How to get notification of workflow errors?

    - by Greg McGuffey
    I am having issues were a workflow is stalled because there is an issue with sending an email (send email activity). Typically, this is simply solved by resuming the workflow. I'm wondering if there any way to react to a workflow error, so the user knows they need to go in and resume the workflow. I'm also wondering about this relative to a workflow that is attempting to assign a task to a user who no longer exists in the CRM or one that has an invalid email address, which I'm assuming would cause errors in workflows as well. Any other suggestions related to this sort if issue would be welcome. Thanks!

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >