Search Results

Search found 1863 results on 75 pages for 'matt fordham'.

Page 40/75 | < Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >

  • Tables with no Primary Key

    - by Matt Hamilton
    I have several tables whose only unique data is a uniqueidentifier (a Guid) column. Because guids are non-sequential (and they're client-side generated so I can't use newsequentialid()), I have made a non-primary, non-clustered index on this ID field rather than giving the tables a clustered primary key. I'm wondering what the performance implications are for this approach. I've seen some people suggest that tables should have an auto-incrementing ("identity") int as a clustered primary key even if it doesn't have any meaning, as it means that the database engine itself can use that value to quickly look up a row instead of having to use a bookmark. My database is merge-replicated across a bunch of servers, so I've shied away from identity int columns as they're a bit hairy to get right in replication. What are your thoughts? Should tables have primary keys? Or is it ok to not have any clustered indexes if there are no sensible columns to index that way?

    Read the article

  • Trouble upgrading to .NET 4 with VS2008. What am I missing?

    - by Matt H.
    I downloaded the .NET 4 framework from miscrosoft here: http://www.microsoft.com/downloads/details.aspx?FamilyID=9cfb2d51-5ff4-4491-b0e5-b386f32c0992&displaylang=en I installed and rebooted. When I go to compile options -- target framework... .NET 4 isn't on the list. Is .net 4 not compatible with VS2008? It would be nice if Microsoft stated that somewhere...

    Read the article

  • Setting a "dependency property" in code

    - by Matt B
    I'm on a roll today... I have the following code delaring a dependency property inside a class called ActionScreen: #region Dependency Properties & Methods public string DescriptionHeader { get { return (string)GetValue(DescriptionHeaderProperty); } set { SetValue(DescriptionHeaderProperty, value); } } // Using a DependencyProperty as the backing store for DescriptionHeader. This enables animation, styling, binding, etc... public static readonly DependencyProperty DescriptionHeaderProperty = DependencyProperty.Register("DescriptionHeader", typeof(string), typeof(ActionScreen), new UIPropertyMetadata("xxx")); #endregion I bind to this property in my Xaml as so: <GridViewColumn DisplayMemberBinding="{Binding Description}" Header="{Binding DescriptionHeader}" Width="350" /> Now I want to be able to set the parameter from my code behind when I recieve an event - but it's not working: public string DescColText { set { this.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(delegate() { DescriptionHeader = value; })); } }

    Read the article

  • installer for distribution visual studio 2008 express

    - by Matt Facer
    Hi guys... I've been doing some research in to installers for visual studio express 2008. I don't much like the standard publish option. I'd rather have a proper windows installer. Am I right in thinking that the only way to do this is to upgrade to the standard edition? Are there any third party tools which can be used? I've tried googling a lot, but don't seem to be getting anywhere!

    Read the article

  • Converting an int64 value to a Number object in JavaScript

    - by Matt
    I have a COM object which has a method that returns an unsigned int64 (VT_UI8) value. We have an HTML page which contains some JavaScript which can load the COM object and make the call to that method, to retrieve the value as such: var foo = MyCOMObject.GetInt64Value(); This value can easily be displayed to the user in a message dialog using: alert(foo); or displayed on the page by: document.getElementById('displayToUser').innerHTML = foo; However, we cannot use this value as a Number (e.g. if we try to multiply it by 2) without the page throwing "Number expected" errors. If we check "typeof(foo)" it returns "unknown". I've found a workaround for this by doing the following: document.getElementById('displayToUser').innerHTML = foo; var bar = parseInt(document.getElementById('displayToUser').innerHTML); alert(bar*2); What I need to know is how to make that process more efficient. Specifically, is there a way to cast foo to a String explicitly, rather than having to set some document element's innerHTML to foo and then retrieve it from that. I wouldn't mind calling something like: alert(parseInt((string)foo) * 2); Even better would be if there is a way to directly convert the int64 to a Number, without going through the String conversion, but I hold out less hope for that.

    Read the article

  • How to stop Lean programming becoming Cowboy Coding?

    - by Matt Howells
    My team has been progressively adopting more and more lightweight methodologies, moving from Scrum to Lean/Kanban where there is less and less formal process. At some point we will be back to Cowboy Coding; indeed I fear we may already be on the border line. Where can the line be drawn between a very lightweight Lean and Agile process and anarchy? How will we know when we have crossed the line? And how can we prevent ourselves from crossing the line? The question might also be phrased as, 'what processes cannot be safely eliminated in Lean's drive to eliminate waste'?

    Read the article

  • How to structure a Kohana MVC application with dynamically added fields and provide validation and f

    - by Matt H
    I've got a bit of a problem. I have a Kohana application that has dynamically added fields. The fields that are added are called DISA numbers. In the model I look these up and the result is returned as an array. I encode the array into a JSON string and use JQuery to populate them The View knows the length of the array and so creates as many DISA elements as required before display. See the code below for a summary of how that works. What I'm finding is that this is starting to get difficult to manage. The code is becoming messy. Error handling of this type of dynamic content is ending up being spread all over the place. Not only that, it doesn't work how I want. What you see here is just a small snippet of code. For error handling I am using the validation library. I started by using add_rules on all the fields that come back in the post. As they are always phone numbers I set a required rule (when it's there) and a digit rule on the validation-as_array() keys. That works. The difficulty is actually giving it back to the view. i.e. dynamically added javascript field. Submits back to form. Save contents into a session. View has to load up fields from database + those from the previous post and signal the fields that have problems. It's all quite messy and I'm getting this code spread through both the view the controller and the model. So my question is. Have you done this before in Kohana and how have you handled it? There must be an easier way right? Code snippet. -- edit.php -- public function phone($id){ ... $this->template->content->disa_numbers = $phones->fetch_disa_numbers($this->account, $id); ... } -- phones.php -- public function fetch_disa_numbers($account, $id) { $query = $this->db->query("SELECT id, cid_in FROM disa WHERE owner_ext=?", array($id)); if (!$query){ return ''; } return $query; } -- edit_phones.php --- <script type="text/javascript"> var disaId = 1; function delDisaNumber(element){ /* Put 'X_' on the front of the element name to mark this for deletion */ $(element).prev().attr('name', 'X_'+$(element).prev().attr('name')); $(element).parent().hide(); } function addDisaNumber(){ /* input name is prepended with 'N_' which means new */ $("#disa_numbers").append("<li><input name='N_disa"+disaId+"' id='disa'"+ "type='text'/><a class='hide' onClick='delDisaNumber(this)'></a></li>"); disaId++; } </script> ... <php echo form::open("edit/saveDisaNumbers/".$phone, array("class"=>"section", "id"=>"disa_form")); echo form::open_fieldset(array("class"=>"balanced-grid")); ?> <ul class="fields" id="disa_numbers"> <?php $disaId = 1; foreach ( $disa_numbers as $disa_number ){ echo '<li>'; echo form::input('disa'.$disaId, $disa_number->cid_in); echo'<a class="hide" onclick="delDisaNumber(this)"></a>'; echo "</li>"; $disaId++; } ?> </ul> <button type="button"onclick="addDisaNumber()"><a class="add"></a>Add number</button> <?php echo form::submit('submit', 'Save'); echo form::close(); ?>

    Read the article

  • Best Practice - Removing item from generic collection in C#

    - by Matt Davis
    I'm using C# in Visual Studio 2008 with .NET 3.5. I have a generic dictionary that maps types of events to a generic list of subscribers. A subscriber can be subscribed to more than one event. private static Dictionary<EventType, List<ISubscriber>> _subscriptions; To remove a subscriber from the subscription list, I can use either of these two options. Option 1: ISubscriber subscriber; // defined elsewhere foreach (EventType event in _subscriptions.Keys) { if (_subscriptions[event].Contains(subscriber)) { _subscriptions[event].Remove(subscriber); } } Option 2: ISubscriber subscriber; // defined elsewhere foreach (EventType event in _subscriptions.Keys) { _subscriptions[event].Remove(subscriber); } I have two questions. First, notice that Option 1 checks for existence before removing the item, while Option 2 uses a brute force removal since Remove() does not throw an exception. Of these two, which is the preferred, "best-practice" way to do this? Second, is there another, "cleaner," more elegant way to do this, perhaps with a lambda expression or using a LINQ extension? I'm still getting acclimated to these two features. Thanks. EDIT Just to clarify, I realize that the choice between Options 1 and 2 is a choice of speed (Option 2) versus maintainability (Option 1). In this particular case, I'm not necessarily trying to optimize the code, although that is certainly a worthy consideration. What I'm trying to understand is if there is a generally well-established practice for doing this. If not, which option would you use in your own code?

    Read the article

  • PHP: using REGEX to get the tablename from a mysql query

    - by Matt
    Hi Guys, Consider these three mysql statements: select * from Users; select id, title, value from Blogs; select id, feelURL, feelTitle from Feeds where id = 1; Now im not very good at REGEX, but i want to get the table name from the mysql query. Could someone possibly create one for me with a little explanation. Thanks,

    Read the article

  • Entropy using Decision Tree's

    - by Matt Clements
    Train a decision tree on the data represented by attributes A1, A2, A3 and outcome C described below: A1 A2 A3 C 1 0 1 0 0 1 1 1 0 0 1 0 For log2(1/3) = 1.6 and log2(2/3) = 0.6, answer the following questions: a) What is the value of entropy H for the given set of training example? b) What is the portion of the positive samples split by attribute A2? c) What is the value of information gain, G(A2), of attribute A2? d) What is IFTHEN rule(s) for the decision tree?

    Read the article

  • Pause and Resume AsyncTasks? (Android)

    - by Matt Swanson
    I have an AsyncTask that acts as a countdown timer for my game. When it completes the countdown it displays the out of time end screen and it also updates the timer displayed on the screen. Everything works fine, except I need to be able to pause and resume this when the pause button in the game is pressed. If I cancel it and try to re-execute it, it crashes with an IllegalStateException. If I cancel it and instantiate a new AsyncTask in its place the old one begins to run again and the new one runs at the same time. Is there a way to cancel/pause the timer and restart it using AsyncTasks or is there a different way I should be going about doing this?

    Read the article

  • How can I reject a Windows "Service Stop" request in ATL 7?

    - by Matt Dillard
    I have a Windows service built upon ATL 7's CAtlServiceModuleT class. This service serves up COM objects that are used by various applications on the system, and these other applications naturally start getting errors if the service is stopped while they are still running. I know that ATL DLLs solve this problem by returning S_OK in DllCanUnloadNow() if CComModule's GetLockCount() returns 0. That is, it checks to make sure no one is currently using any COM objects served up by the DLL. I want equivalent functionality in the service. Here is what I've done in my override of CAtlServiceModuleT::OnStop(): void CMyServiceModule::OnStop() { if( GetLockCount() != 0 ) { return; } BaseClass::OnStop(); } Now, when the user attempts to Stop the service from the Services panel, they are presented with an error message: Windows could not stop the XYZ service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error. If the problem persists, contact your system administrator. The Stop request is indeed refused, but it appears to put the service in a bad state. A second Stop request results in this error message: Windows could not stop the XYZ service on Local Computer. Error 1061: The service cannot accept control messages at this time. Interestingly, the service does actually stop this time (although I'd rather it not, since there are still outstanding COM references). I have two questions: Is it considered bad practice for a service to refuse to stop when asked? Is there a polite way to signify that the Stop request is being refused; one that doesn't put the Service into a bad state?

    Read the article

  • SDK for writing DVD's

    - by Matt Warren
    I need to add DVD writing functionality to an application I'm working on. However it needs to be able to write out files that are being grabbed "live" from a camera, over a long period of time. I can't wait until all the files are captured before I start writing them to the DVD, I need to write them out in chunks as I go along. I've looked at IMAPI v2, but the main problems seems to be that you need to point it to all the files you plan to write out to disk before you start the burning process. I know it has to concept of "sessions", which means you can write to the DVD in several parts, before you finally "close" it. But I was wondering if there were any other DVD writing SDK's that allow you to be constantly writing files to a DVD and in particular files that are only in memory. It would be more efficient if I didn't have to write the captured images out to hard before they are burned to DVD. The solution needs to work under .NET on Windows XP and vista

    Read the article

  • What's the best way to annotate this ggplot2 plot? [R]

    - by Matt Parker
    Here's a plot: library(ggplot2) ggplot(mtcars, aes(x = factor(cyl), y = hp, group = factor(am), color = factor(am))) + stat_smooth(fun.data = "mean_cl_boot", geom = "pointrange") + stat_smooth(fun.data = "mean_cl_boot", geom = "line") + geom_hline(yintercept = 130, color = "red") + annotate("text", label = "130 hp", x = .22, y = 135, size = 4) I've been experimenting with labeling the geom_hline in a few different ways, each of which does something I want but has a problem that the other methods don't have. annotate(), used above, is nice - the text is resizeable, black, and easy to position. But it can only be placed within the plot itself, not outside the plot like the axis labels. It also makes an "a" appear in the legend, which I can't dismiss with legend = FALSE. legend = FALSE works with geom_text, but I can't get geom_text to just be black - it seems to be getting tangled up in the line colorings. grid.text lets me put the text anywhere I want, but I can't seem to resize it. I can definitely accept the text being inside of the plot area, but I'd like to keep the legend clean. I feel like I'm missing something simple, but I'm just fried. Thanks in advance for your consideration.

    Read the article

  • Microsoft SQL Count problem

    - by Matt
    Hey smarties. I'm having trouble with the following SQL statement. I know that I can't do a GROUP BY on the OnlineStatus column, and it makes sense because it's a function call, not an actual column in my table. How would I modify this so that I can get a count of how many users are online? SELECT CASE dbo.fnGetWebUserOnlineStatus(W.Id) WHEN 1 THEN 'Online' WHEN 2 THEN 'Ingame' ELSE 'Offline' END AS OnlineStatus FROM dbo.WebUsers W WHERE W.[Status]=1 GROUP BY OnlineStatus

    Read the article

  • gcov and switch statements

    - by Matt
    I'm running gcov over some C code with a switch statement. I've written test cases to cover every possible path through that switch statement, but it still reports a branch in the switch statement as not taken and less than 100% on the "Taken at least once" stat. Here's some sample code to demonstrate: #include "stdio.h" void foo(int i) { switch(i) { case 1:printf("a\n");break; case 2:printf("b\n");break; case 3:printf("c\n");break; default: printf("other\n"); } } int main() { int i; for(i=0;i<4;++i) foo(i); return 0; } I built with "gcc temp.c -fprofile-arcs -ftest-coverage", ran "a", then did "gcov -b -c temp.c". The output indicates eight branches on the switch and one (branch 6) not taken. What are all those branches and how do I get 100% coverage?

    Read the article

  • Learning web development as I go

    - by Matt Luongo
    Hey everybody, I've been seriously preparing to take the entrepreneurship leap. I've got a great partner, and we're going to take on some minor funding, and do the thing. Our product is web-based- I'll deem it YAWA (Yet Another Web Application). Both my partner and I have database and web development experience, and I've had a front-end developer in mind for a while. Except, well- he just bowed out. I know a fair amount about the associated technologies (XHTML, CSS, Javascript and some JQuery) interface-side, but I've never had to deal with real-world scenarios, eg cross-browser design. Am I going to be able to survive without this guy? Is it realistic to believe that I can learn the details as I go?

    Read the article

  • Adobe Socket Policy File Server Problems

    - by Matt
    Has anyone been able to successfully implement a service to serve the required socket policy file to FlashPlayer? I am running the Python implementation of the service provided by Adobe at http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html and using the following policy file: <?xml version="1.0" encoding="UTF-8"?> <cross-domain-policy> <site-control permitted-cross-domain-policies="master-only"/> <allow-access-from domain="*" to-ports="*" secure="false"/> </cross-domain-policy> and receiving this message from Flash: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2048: Security sandbox violation: http://www.mapopolis.com/family/Tree.swf cannot load data from www.mapopolis.com:1900."] Thanks.

    Read the article

  • How do you stream text to an IRC Channel

    - by Matt
    Hi, does anyone know how you go about streaming text to a IRC server? I have a game server, and i'd like to stream the chat to IRC. I can get the chat as a string within a C# program.. Anyone know how to do this? Or a good resource to look at? Cheers

    Read the article

  • Making File Dialog only accept directories

    - by matt
    I want to have a file dialog only allow directories, here's what I've been trying: fileDialog = QtGui.QFileDialog() fileDialog.setFileMode(QtGui.QFileDialog.ShowDirsOnly) filename = fileDialog.getOpenFileName(self, 'Select USB Drive Location')) Thank You

    Read the article

  • How to force visual styles when using .NET forms Interop from VB6

    - by Matt
    I have created a VB.NET Class Library that exposes some COM Interop sub routines. These in turn show various forms that are contained within the Class Library. When the forms are shown from VB6 they do not inherit the visual styles of the operating system and act like VB6 controls. I gather that this probably by design but is there some way to force/control visual styles manually in the .NET assembly? I would imagine that if I use a manifest in my VB6 app then everything will use the correct style but I would like to be able to control this myself if possible because we are using 3rd party controls in VB6 that do not require a manifest.

    Read the article

< Previous Page | 36 37 38 39 40 41 42 43 44 45 46 47  | Next Page >