Search Results

Search found 1870 results on 75 pages for 'matt mcclellan'.

Page 47/75 | < Previous Page | 43 44 45 46 47 48 49 50 51 52 53 54  | Next Page >

  • Using iterateFunc to call objective c method

    - by Matt Welch
    Using spacemanager, I need to perform an action on select bodies after each step, so I figured that defining my own C function for iterateFunc would be the way to go. Everything works great, except I'm not sure how to then call an obj c method in the same class. In other words, an obj c class contains both the c function replacing iterateFunc, and the method that needs to be called. I don't see how to tell the c function what 'self' is, such that I can call the method. As far as i can tell, there's no way to pass in any extra info to the new iterateFunc. Any ideas, or a better way to go about things?

    Read the article

  • Nested luabind classes declared in Lua

    - by Matt Fichman
    I am trying to declare a class B in a namespace A using Luabind (from the Lua side). I figure that if Luabind has a clean way to do this, it would look something like this: class 'A.B' (Super) function A.B:__init() Super.__init(self) end Notice that the B class is defined in the A table. I know the following hackish way of doing this: class 'A.B' (Super) A = {} A.B = _G['A.B'] However, I would really like to know if Luabind provides this feature explicitly.

    Read the article

  • Performance of .NET ILMerged assemblies

    - by matt
    I have two .NET libraries: "Foo.Bar" and "Foo.Baz". "Foo.Bar" is self-contained, while "Foo.Baz" references "Foo.Bar". Assuming I do the following: Use ILMerge to merge "Foo.Bar.dll" with "Foo.Baz.dll" into "Foo1.dll". Create a new solution containing the entirity of both "Foo.Bar" and "Foo.Baz" (since I have access to their source code), and compile this into "Foo2.dll". Will there be any differences in the performance of Foo1.dll and Foo2.dll when using their functionality from an external project? If so, how significant is this performance difference, and is it a once-off (on load?) or ongoing difference? Are there any other pros or cons with either approach?

    Read the article

  • .NET 3.5 SP1 prerequisite, MS giving the clients 4.0

    - by Matt Bridges
    I have been using an MSI to install a WPF application using the .NET Framework 3.5 SP1. I have set up .NET 3.5 as a prerequisite in the MSI, and what has been happening for ages is that when the user does not have .NET 3.5 SP1, the MSI first has them download and install that before resuming the installation of my application. Since yesterday when MS released .NET 4.0, when users don't have .net 3.5 SP1, the MSI is directing them to install 4.0 instead. What happens though, is that after they finish installing 4.0, the MSI still detects that they don't have 3.5, and directs them to the 4.0 install site again. So the user has 4.0, but the MSI doesn't ever get to installing my application. What do I have to change in my application? This seems like an error with how MS is handling the prerequisites either on their server or in the MSI in VS 2008.

    Read the article

  • How can I copy a file from VMS to Windows and back again?

    - by Matt Joslin
    I am trying to copy C source files from a vms alpha to a windows machine to allow easier editing of the code. (VMS editor is just a text editor and it would be nice to have syntax highlighting etc) I can copy this across using Exceed FTP and this handles the issue of duplicate filenames with version suffix that vms has: File.c;1 File.c;2 Flle.c;3 But when I open a file I've transferred, all the line breaks have been lost and the entire file is just one line. Can anyone recommend a solution to this or offer any hints? Thanks in advance ps. I need to be able to copy the files back to vms and still maintain format.

    Read the article

  • Find a name in a list if the name is spelt wrong

    - by Matt
    I've got a list of names which some code checks against to see if the person exists, and if so do some stuff.. My issue is that I want to handle the case of the name being entered incorrectly.. I.e. I have a list of names Bob Frank Tom Tim John If I type in Joohn, I want it to ask me if I meant John. If I type Tm, I get asked if I meant Tim, if I say no, it asks if i meant Tom.. Etc.. Has anyone done something like this before?

    Read the article

  • Passing IDisposable objects through constructor chains

    - by Matt Enright
    I've got a small hierarchy of objects that in general gets constructed from data in a Stream, but for some particular subclasses, can be synthesized from a simpler argument list. In chaining the constructors from the subclasses, I'm running into an issue with ensuring the disposal of the synthesized stream that the base class constructor needs. Its not escaped me that the use of IDisposable objects this way is possibly just dirty pool (plz advise?) for reasons I've not considered, but, this issue aside, it seems fairly straightforward (and good encapsulation). Codes: abstract class Node { protected Node (Stream raw) { // calculate/generate some base class properties } } class FilesystemNode : Node { public FilesystemNode (FileStream fs) : base (fs) { // all good here; disposing of fs not our responsibility } } class CompositeNode : Node { public CompositeNode (IEnumerable some_stuff) : base (GenerateRaw (some_stuff)) { // rogue stream from GenerateRaw now loose in the wild! } static Stream GenerateRaw (IEnumerable some_stuff) { var content = new MemoryStream (); // molest elements of some_stuff into proper format, write to stream content.Seek (0, SeekOrigin.Begin); return content; } } I realize that not disposing of a MemoryStream is not exactly a world-stopping case of bad CLR citizenship, but it still gives me the heebie-jeebies (not to mention that I may not always be using a MemoryStream for other subtypes). It's not in scope, so I can't explicitly Dispose () it later in the constructor, and adding a using statement in GenerateRaw () is self-defeating since I need the stream returned. Is there a better way to do this? Preemptive strikes: yes, the properties calculated in the Node constructor should be part of the base class, and should not be calculated by (or accessible in) the subclasses I won't require that a stream be passed into CompositeNode (its format should be irrelevant to the caller) The previous iteration had the value calculation in the base class as a separate protected method, which I then just called at the end of each subtype constructor, moved the body of GenerateRaw () into a using statement in the body of the CompositeNode constructor. But the repetition of requiring that call for each constructor and not being able to guarantee that it be run for every subtype ever (a Node is not a Node, semantically, without these properties initialized) gave me heebie-jeebies far worse than the (potential) resource leak here does.

    Read the article

  • NSTableview not loading

    - by Matt S.
    I have an NSTableView that is inside an NSView. The whole view is being controlled by a class that has a superclass of NSObject. I send some data over to that class from another one, however, the tableview isn't refreshing, even with [myTable reloadData] The table's delegates and all that fancy stuff is connected to that NSObject class.

    Read the article

  • Function call within XAML code?

    - by Matt H.
    I'd like to set a style on all my TextBox controls that does the following when it receives keyboard focus: 1) Change the background color 2) Call .SelectAll() to highlight all text I have this so far: <Style TargetType="TextBox"> <Style.Triggers> <Trigger Property="IsKeyboardFocusWithin" Value="True"> <Setter Property="Background"> <Setter.Value> <SolidColorBrush Color="#FFFFD1D9"/> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> Is there a way to also call .SelectAll() ? Thanks.

    Read the article

  • jQuery .val Enigma between two input boxes

    - by Matt
    I'm trying to get it so that if I move a red div-square around the screen using jQuery UI and jQuery, then an input field updates with the position of the div. I got that working with a simple .val. But, it's hard to explain why, but I need to make it so that when I move the square, it updates my input box, and when the input box value is changed, another input box reflects the new value of the old input box. Do I make any sense, coz I'm confusing myself :). I made a jsfiddle, so perhaps it'll make more sense there. If you move the red square, then the input box directly above it updates, but the input box above that does not, even though it is programmed to reflect the value of the input box below itself. P.S. Is this specific to only jQuery, or is this problem present in all of JavaScript. Thanks! http://jsfiddle.net/xmCsq/27/

    Read the article

  • WCF reuse types in referenced assemblies does not reuse the ServiceContract Interface

    - by Matt
    I have three seperate projects: -MyUserControl (Needs a reference to a service implementing IMyService) -MyService (Implements IMyService) -MySharedInterfaces (IMyUserControl and IMyService) -MyWebApp The user control needs to be dynamically loaded at runtime. This implements IMyUserControl and has a property of type IMyService which will be set at runtime. The trouble is even with the option to reuse types the WebApp isn't reusing the IMyServiceType, it always generates it again from the Service Reference. This wouldn't be an issue if I could cast it to MySharedInterfaces.IMyService (which I can't understand, since it should be exactly the same). The user control is expecting something of type IMyService, is there anyway to either cast the WebServiceReference.IMyService back to MySharedInterface.IMyServiceReference or force the WebServiceReference to reuse the MySharedInterface.IMyServiceReference? Thanks

    Read the article

  • Frontend Intertag Communication

    - by Matt
    Hey all, I've had a question that I've been wondering for a while. I'm making a templating system for front-ends where tags are interpretted (like Smarty). I was wondering if there is value in having the tags be able to communicate with the HTML document and other "Smartyish" tags. I was hoping that the community would have some thoughts on this situation. Benefits: More power (tags can tell other tags how to look) Better structure (smartyish tags behave and look just like html tags) Tags can manipulate any element on the page Drawbacks: Tags can manipulate any element on the page Tags can interfere with other tags Code time will increase

    Read the article

  • rake db:migrate not executing new migrations

    - by Matt H
    Hi guys. I'm trying to add some columns to an existing table, so I generated a migration that did so. When I run db:migrate the new migration isn't run and the table isn't updated. I've had this problem many times before, and it's getting bloody annoying. Output from rake db:migrate $ rake db:migrate --trace (in /Users/one/app) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment ** Execute db:migrate ** Invoke db:schema:dump (first_time) ** Invoke environment ** Execute db:schema:dump

    Read the article

  • WCF Architectural Debate

    - by Matt Ruwe
    When building a WCF service for a large scale application, which is better: In both cases, assume that the business logic layer is separated into a different assembly. Using your business logic layer as a service implementation i.e. with no code behind and no wrapper <%@ ServiceHost Language="CS" Service="MyApp.BusinessLogic.BusLogicImpl" %> or Using the codebehind of the WCF service that wraps calls into your business logic layer. <%@ ServiceHost Language="CS" Service="MyApp.WebServiceHost.Service" CodeBehind="Service.svc.cs" %>

    Read the article

  • C - circular character buffer w/ pthreads

    - by Matt
    I have a homework assignment where I have to implement a circular buffer and add and remove chars with separate threads: #include <pthread.h> #include <stdio.h> #define QSIZE 10 pthread_cond_t full,/* count == QSIZE */ empty,/* count == 0 */ ready; pthread_mutex_t m, n; /* implements critical section */ unsigned int iBuf, /* tail of circular queue */ oBuf; /* head of circular queue */ int count; /* count characters */ char buf [QSIZE]; /* the circular queue */ void Put(char s[]) {/* add "ch"; wait if full */ pthread_mutex_lock(&m); int size = sizeof(s)/sizeof(char); printf("size: %d", size); int i; for(i = 0; i < size; i++) { while (count >= QSIZE) pthread_cond_wait(&full, &m);/* is there empty slot? */ buf[iBuf] = s[i]; /* store the character */ iBuf = (iBuf+1) % QSIZE; /* increment mod QSIZE */ count++; if (count == 1) pthread_cond_signal(&empty);/* new character available */ } pthread_mutex_unlock(&m); } char Get() {/* remove "ch" from queue; wait if empty */ char ch; pthread_mutex_lock(&m); while (count <= 0) pthread_cond_wait(&empty, &m);/* is a character present? */ ch = buf[oBuf]; /* retrieve from the head of the queue */ oBuf = (oBuf+1) % QSIZE; count--; if (count == QSIZE-1) pthread_cond_signal(&full);/* signal existence of a slot */ pthread_mutex_unlock(&m); return ch; } void * p1(void *arg) { int i; for (i = 0; i < 5; i++) { Put("hella"); } } void * p2(void *arg) { int i; for (i = 0; i < 5; i++) { Put("goodby"); } } int main() { pthread_t t1, t2; void *r1, *r2; oBuf = 0; iBuf = 0; count=0; /* all slots are empty */ pthread_cond_init(&full, NULL); pthread_cond_init(&empty, NULL); pthread_mutex_init(&m, NULL); pthread_create(&t1, NULL, p1, &r1); pthread_create(&t2, NULL, p2, &r2); printf("Main"); char c; int i = 0; while (i < 55) { c = Get(); printf("%c",c); i++; } pthread_join(t1, &r1); pthread_join(t2, &r2); return 0; } I shouldn't have to change the logic much at all, the requirements are pretty specific. I think my problem lies in the Put() method. I think the first thread is going in and blocking the critical section and causing a deadlock. I was thinking I should make a scheduling attribute? Of course I could be wrong. I am pretty new to pthreads and concurrent programming, so I could really use some help spotting my error.

    Read the article

  • Blocks and Yields in Ruby

    - by Matt
    I am trying to understand blocks and yields and how they work in Ruby. How is a yield used and most of the rails applications use yields in a weird way. Can someone explain to me or show me where to go to understand them.

    Read the article

  • Pure-JavaScript projects in NetBeans?

    - by Matt Zukowski
    This seems like it ought to be obvious, yet I can't figure it out. I do a lot of JavaScript coding, and I really like NetBeans. Unfortunately I can't figure out how to create a "JavaScript" project in NetBeans. If I go to File - New Project, my only options are "Java", "Ruby", and "NetBeans Modules". I don't want any of these. My project consists mostly of JavaScript, with a little bit of CSS. I ususally just end up creating a "Ruby" project, but this seems retarded, since I don't actually have any Ruby code. Why isn't there an option to create a "JavaScript" or "Web" project, or at least a "Generic" project that doesn't revolve around a specific language? Am I missing something here?

    Read the article

  • LINQ to SQL: On load processing of lazy loaded associations

    - by Matt Holmes
    If I have an object that lazy loads an association with very large objects, is there a way I can do processing at the time the lazy load occurs? I thought I could use AssociateWith or LoadWith from DataLoadOptions, but there are very, very specific restrictions on what you can do in those. Basically I need to be notified when an EntitySet< decides it's time to load the associated object, so I can catch that event and do some processing on the loaded object. I don't want to simply walk through the EntitySet when I load the parent object, because that will force all the lazy loaded items to load (defeating the purpose of lazy loading entirely).

    Read the article

  • MySQL query pulling from two tables, display in correct fields

    - by Matt Nathanson
    I'm trying to select all fields in two separate tables as long as they're sharing a common ID. //mysql query $result = mysql_query("SELECT * FROM project, links WHERE project.id = links.id and project.id = $clientID") //displaying the link if ($row['url'] != null){ echo "<div class='clientsection' id='links'>Links</div>"; echo "<a class='clientlink' id='link1' href='" . $row['url'] . "'>" . $row['name'] . "</a>"; } else { echo "<a class='clientlink' id='link1' href='" . $row['url'] . "' style='display:none;'>" . $row['name'] . "</a>"; }; As you can see, my tables are "projects", and "links" Each is sharing a common field "id" for reference. It looks as though where both links.id and project.id are equal, it outputs anything, but when there is no links.id associated with a given $clientID the container relative to the $clientID doesn't display at all. Essentially I'm using this to add links dynamically to a specific client in this CMS and if there are no links, I want the container to show up anyway. Hopefully I've expressed myself clearly, any pointers in the right direction are appreciated. Thanks!

    Read the article

  • If you delete a DOM element, do any events that started with that element continue to bubble?

    - by Matt
    What behavior should I expect if I delete a DOM element that was used to start an event bubble, or whose child started the event bubble - will it continue to bubble if the element is removed? For example - lets say you have a table, and want to detect click events on the table cells. Another piece of JS has executed an AJAX request that will eventually replace the table, in full, once the request is complete. What happens if I click the table, and immediately after the table gets replaced by a successful completion of an AJAX request? I ask because I am seeing some behavior where the click events don't seem to be bubbling - but it is hard to duplicate. I am watching the event on a parent element of the table (instead of attaching the event to every TD), and it just doesn't seem to reach it sometimes.

    Read the article

  • Django Grouping Query

    - by Matt
    I have the following (simplified) models: class Donation(models.Model): entry_date = models.DateTimeField() class Category(models.Model): name = models.CharField() class Item(models.Model): donation = models.ForeignKey(Donation) category = models.ForeignKey(Category) I'm trying to display the total number of items, per category, grouped by the donation year. I've tried this: Donation.objects.extra(select={'year': "django_date_trunc('year', %s.entry_date)" % Donation._meta.db_table}).values('year', 'item__category__name').annotate(items=Sum('item__quantity')) But I get a Field Error on item__category__name. I've also tried: Item.objects.extra(select={"year": "django_date_trunc('year', entry_date)"}, tables=["donations_donation"]).values("year", "category__name").annotate(items=Sum("quantity")).order_by() Which generally gets me what I want, but the item quantity count is multiplied by the number of donation records. Any ideas? Basically I want to display this: 2010 - Category 1: 10 items - Category 2: 17 items 2009 - Category 1: 5 items - Category 3: 8 items

    Read the article

  • xml dom node children

    - by matt
    Need some help I've got lots of code and i want to make it shorter i know there's a way but I can't remember it this is code example: <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="cooking"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="children"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="web"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49.99</price> </book> <book category="web" cover="paperback"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> </bookstore As you can see the different nodes, children now is there a way to make this code smaller so I don't have to keep writing the nodes and children

    Read the article

  • what are the advantages of C# over Python

    - by Matt
    I like Python mostly for the great portability and the ease of coding, but I was wondering, what are some of the advantages that C# has over Python? The reason I ask is that one of my friends runs a private server for an online game (UO), and he offered to make me a dev if I wanted, but the software for the server is all written in C#. I'd love to do this, but I don't really have time to do multiple languages, and I was just after a few more reasons to justify taking C# over Python to myself. I'm doing this all self-taught as a hobby, btw

    Read the article

  • Looping through siblings of a specific row/setting up function

    - by Matt
    Trying to work through my javascript book I am referencing to learn the language and got stuck on looping through siblings of a specific row. W3schools and W3 didnt have what i was looking for. Below is a function walk-through... It reads: Create the countRecords() function. The purpose of this function is to count the number of visible rows in the data table after the table headings. The total is then displayed in the table cell with the id "records". Add the follow commands to the function: a. Create a object named headRow that points to the table row with the id "titleRow". Create a variable named rowCount, setting its initial value to 0. b. Create a for loop that uses familial references starting with the first sibling of headRow and moving to the next sibling until there are no siblings left. Within the for loop. test whether the node name of the currentnext sibling until there are no sibilings left. Within the for loop test whether the node name of the current node is equal to "TR". If it is, test wheter the value of its display style is equal to an empty text string. If it is (indicating that it is visible in the document) increate the value of the rowCount variable by 1. c. Change the text of the "records" table cell to the value of the rowCount variable. Don't use innerHTML. Create a text node that contains the value of the rowCount variable and assign it to a variable called txt. Create a variable called record to store the reference to the element "records" table cell. d. Insert an if condition that test whether the "records" cell has any child nodes. If it does, replace the replace the text node of the "record" table cell with the created text node (txt). If it doesn't append the text node to the cell. var headRow; // part a var rowCount = 0; //part b this is where I get lost. I know I need to access the id titleRow but unsure how to set my loop up specifically for this headRow = document.getElementById("titleRow"); for(var i=0; i<headrow.length; i++) { if (something is not equal == "TH") { make code happen here } if (is "TR" == ""){ rowCount = +1; } //part c var txt = document.createTextNode(rowCount); var record = document.getElementsById("records") //part d holding off on this part until I get a,b,c figured out. The HTML supporting snippet: <table id="filters"> <tr><th colspan="2">Filter Product List</th></tr> <tr> <td>Records: </td> <td id="records"></td> </tr> <table id="prodTable"> <tr><th colspan="8">Digital Cameras</th></tr> <tr id="titleRow"> <th>Model</th> <th>Manufacturer</th> <th>Resolution</th> <th>Zoom</th> <th>Media</th> <th>Video</th> <th>Microphone</th> </tr> Thanks for the help!

    Read the article

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