Search Results

Search found 1683 results on 68 pages for 'andrew barber'.

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

  • Windows 8 Data Binding Bug - OnPropertyChanged Updates Wrong Object

    - by Andrew
    I'm experiencing some really weird behavior with data binding in Windows 8. I have a combobox set up like this: <ComboBox VerticalAlignment="Center" Margin="0,18,0,0" HorizontalAlignment="Right" Height="Auto" Width="138" Background="{StaticResource DarkBackgroundBrush}" BorderThickness="0" ItemsSource="{Binding CurrentForum.SortValues}" SelectedItem="{Binding CurrentForum.CurrentSort, Mode=TwoWay}"> <ComboBox.ItemTemplate> <DataTemplate> <TextBlock HorizontalAlignment="Right" Text="{Binding Converter={StaticResource SortValueConverter}}"/> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> Inside of a page with the DataContext set to a statically located ViewModel. When I change that ViewModel's CurrentForm attribute, who's property is implemented like this... public FormViewModel CurrentForm { get { return _currentForm; } set { _currentForm = value; if (!_currentForm.IsLoaded) { _currentSubreddit.Refresh.Execute(null); } RaisePropertyChanged("CurrentForm"); } } ... something really strange happens. The previous FormViewModel's CurrentSort property is changed to the new FormViewModel's current sort property. This happens as the RaisePropertyChanged event is called, through a managed-to-native transition, with native code invoking the setter of CurrentSort of the previous FormViewModel. Does that sound like a bug in Win8's data binding? Am I doing something wrong?

    Read the article

  • Azure Table Storage rejects an entity with a Property whose value is an Interface

    - by Andrew B Schultz
    I have a type called "Comment" that I'm saving to Azure Table Storage. Since a comment can be about any number of other types, I created an interface which all of these types implement, and then put a property of type ICommentable on the comment. So Comment has a property called About of type ICommentable. When I try to save a Comment to Azure Table Storage, if the Comment.About property has a value, I get the worthless invalid input error. However, if there is no value for Comment.About, I have no problem. Why would this be? Comment.About is not the only property that is a reference type. For example, Comment.From is a reference type, but the Comment.About is the only property of a type that is an interface. Fails: var comment = new Comment(); comment.CommentText = "It fails!"; comment.PartitionKey = "TEST"; comment.RowKey = "TEST123"; comment.About = sow1; comment.From = person1; Works: var comment = new Comment(); comment.CommentText = "It works!"; comment.PartitionKey = "TEST"; comment.RowKey = "TEST123"; //comment.About = sow1; comment.From = person1; Thanks!

    Read the article

  • C# StringBuilder question

    - by andrew
    in a C# file i have a class Archiver { [DllImport("Archiver.dll")] public static extern void archive(string data, StringBuilder response); } string data is an input, and StringBuilder response is where the function writes something the archive function prototype (written in C) looks like this: void archive(char * dataChr, char * outChr); and it receives a string in dataChr, and then does a strcpy(outChr,"some big text"); from C# i call it something like this: string message = "some text here"; StringBuilder response = new StringBuilder(10000); Archiver.archive(message,response); this works, but the problem, as you might see is that i give a value to the StringBuilder size, but the archive function might give back a (way) larger text than the size i've given to my StringBuilder. any way to fix this?

    Read the article

  • How do I declare an array as a constant in Objective-c?

    - by Andrew
    The following code is giving me errors: // constants.h extern NSArray const *testArray; // constants.m NSArray const *testArray = [NSArray arrayWithObjects: @"foo", @"bar"]; The error I get is initializer element is not constant Or if I take away the pointer indicator (*) I get: statically allocated instance of Objective-C class 'NSArray'

    Read the article

  • PHP5 getrusage() returning incorrect information?

    - by Andrew
    I'm trying to determine CPU usage of my PHP scripts. I just found this article which details how to find system and user CPU usage time (Section 4). However, when I tried out the examples, I received completely different results. The first example: sleep(3); $data = getrusage(); echo "User time: ". ($data['ru_utime.tv_sec'] + $data['ru_utime.tv_usec'] / 1000000); echo "System time: ". ($data['ru_stime.tv_sec'] + $data['ru_stime.tv_usec'] / 1000000); Results in: User time: 29.53 System time: 2.71 Example 2: for($i=0;$i<10000000;$i++) { } // Same echo statements Results: User time: 16.69 System time: 2.1 Example 3: $start = microtime(true); while(microtime(true) - $start < 3) { } // Same echo statements Results: User time: 34.94 System time: 3.14 Obviously, none of the information is correct except maybe the system time in the third example. So what am I doing wrong? I'd really like to be able to use this information, but it needs to be reliable. I'm using Ubuntu Server 8.04 LTS (32-bit) and this is the output of php -v: PHP 5.2.4-2ubuntu5.10 with Suhosin-Patch 0.9.6.2 (cli) (built: Jan 6 2010 22:01:14) Copyright (c) 1997-2007 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

    Read the article

  • How do I tell which account is trying to access an ASP.NET web service?

    - by Andrew Lewis
    I'm getting a 401 (access denied) calling a method on an internal web service. I'm calling it from an ASP.NET page on our company intranet. I've checked all the configuration and it should be using integrated security with an account that has access to that service, but I'm trying to figure out how to confirm which account it's connecting under. Unfortunately I can't debug the code on the production network. In our dev environment everything is working fine. I know there has to be a difference in the settings, but I'm at a loss with where to start. Any recommendations?

    Read the article

  • How to save email as draft in Outlook 2003 programmatically?

    - by Andrew
    I am working on an VB.NET app which constructs emails programmatically. This app can be used by different people at the same time so I thought that having a "central" email mailbox would be appropriate. The users would then have "links" (not sure of the correct term) to that central mailbox through their local copy of Outlook. I want to be able to save these emails so that all users can see the generated emails in the "Drafts" folder of their Outlook so that they can check the emails first for any errors and then send it off. I was originally simply talking directly to the Outlook app on the server using Microsoft.Office.Interop but have since read that it is not recommended for use in this sort of scenario. Any ideas?

    Read the article

  • Intel MKL memory management and exceptions

    - by Andrew
    Hello everyone, I am trying out Intel MKL and it appears that they have their own memory management (C-style). They suggest using their MKL_malloc/MKL_free pairs for vectors and matrices and I do not know what is a good way to handle it. One of the reasons for that is that memory-alignment is recommended to be at least 16-byte and with these routines it is specified explicitly. I used to rely on auto_ptr and boost::smart_ptr a lot to forget about memory clean-ups. How can I write an exception-safe program with MKL memory management or should I just use regular auto_ptr's and not bother? Thanks in advance. EDIT http://software.intel.com/sites/products/documentation/hpc/mkl/win/index.htm this link may explain why I brought up the question UPDATE I used an idea from the answer below for allocator. This is what I have now: template <typename T, size_t TALIGN=16, size_t TBLOCK=4> class aligned_allocator : public std::allocator<T> { public: pointer allocate(size_type n, const void *hint) { pointer p = NULL; size_t count = sizeof(T) * n; size_t count_left = count % TBLOCK; if( count_left != 0 ) count += TBLOCK - count_left; if ( !hint ) p = reinterpret_cast<pointer>(MKL_malloc (count,TALIGN)); else p = reinterpret_cast<pointer>(MKL_realloc((void*)hint,count,TALIGN)); return p; } void deallocate(pointer p, size_type n){ MKL_free(p); } }; If anybody has any suggestions, feel free to make it better.

    Read the article

  • Is it worth investing time in learning to use emacs?

    - by Andrew
    Right up front: I do not want to start a religious war. I've used vi for as long as I can remember, and the few times I've tried to pick up emacs I've been so lost so quickly I've given up. Lots of people find emacs very powerful, however. Its programmability is somewhat legendary. I'm primarily doing Solaris+Java development, and I'd like to ask a simple question: will my productivity increase if I invest time in getting my head around emacs? Is the functionality that it offers over vim going to be paid back in productivity increases in a reasonable timeframe? Repeat: I don't want a "my editor is better than yours". I just want a yes or no answer as to whether it's worth investing the time or not. Will my productivity really increase?

    Read the article

  • mysql_query -- question about results "location"

    - by Andrew Heath
    Forgive me if this is a particularly stupid question! mysql_query($query) returns a boolean, but you can also assign it to a variable $results = mysql_query($query) and then use the other mysql_ functions to extract data. Out of curiosity, how does mysq_query($query) act as both a boolean and a data container at the same time? What's happening "under the hood" during these steps? (yes, I am a n00b..., please be kind!)

    Read the article

  • wordpress servlet mapping not working

    - by Andrew
    I have the latest wordpress running in tomcat 6.0.26 virtual host with Quercus Servlet php servlet. It works, except when I try to use perm links. A url such as /index.php/my-page-name doesn't seem to ever hit the php server. It gets a browser error that request resource is not available. It's like it isn't matching the servlet urlmapping. I'm using a standard method in the web.xml <servlet-mapping> <servlet-name>Quercus Servlet</servlet-name> <url-pattern>*.php</url-pattern> </servlet-mapping> I see nothing showing up either in the tomcat logs when I use that url above. Any ideas please?

    Read the article

  • query structure - ignoring entries for the same event from multiple users?

    - by Andrew Heath
    One table in my MySQL database tracks game plays. It has the following structure: SCENARIO_VICTORIES [ID] [scenario_id] [game] [timestamp] [user_id] [winning_side] [play_date] ID is the autoincremented primary key. timestamp records the moment of submission for the record. winning_side has one of three possible values: 1, 2, or 0 (meaning a draw) One of the queries done on this table calculates the victory percentage for each scenario, when that scenario's page is viewed. The output is expressed as: Side 1 win % Side 2 win % Draw % and queried with: SELECT winning_side, COUNT(scenario_id) FROM scenario_victories WHERE scenario_id='$scenID' GROUP BY winning_side ORDER BY winning_side ASC and then processed into the percentages and such. Sorry for the long setup. My problem is this: several of my users play each other, and record their mutual results. So these battles are being doubly represented in the victory percentages and result counts. Though this happens infrequently, the userbase isn't large and the double entries do have a noticeable effect on the data. Given the table and query above - does anyone have any suggestions for how I can "collapse" records that have the same play_date & game & scenario_id & winning_side so that they're only counted once?

    Read the article

  • Launching external console application from JAVA

    - by Andrew
    Hi in a java application i need to run an external console application. With the window's ones everything is OK: try { System.out.println("Running..."); Runtime.getRuntime().exec("notepad.exe"); System.out.println("End."); } catch(Exception e) { System.out.println(e.getMessage()); } launches notepad successfully. But if I put "D:\MyProg.exe" or ".bat" or even "cmd.exe" (which is it PATH as notepad is) it does not work. Without any exeptions. Just: Running... End. Can somebody help? Thanx.

    Read the article

  • Bash loop command until file contains n duplicate entries (lines)

    - by Andrew
    Hello, I'm writing a script and I need to create a loop that will execute same commands until file does contain a specified number of duplicate entries. For example, with each loop I will echo random string to file results. And I want loop to stop when there are 10 lines of of the same string. I thought of something like while [ `some command here (maybe using uniq)` -lt 10 ] do command1 command2 command3 done Do you have any idea how can this problem be solved? Using grep can't be done since I don't know what string I need to look for. Thank you for your suggestions.

    Read the article

  • php error reporting - having trouble matching local & web server settings

    - by Andrew Heath
    I'm trying to add a custom error handler to my site, but in doing so have discovered that my webhost's PHP error reporting settings and those of my localhost (default XAMPP) vary considerably. While I thought I was programming to E_STRICT like a good little boy, adding the error handler to my webhost revealed craploads of Runtime Notices. Example: Runtime notice strtotime() [function.strtotime]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/Chicago' for 'CST/-6.0/no DST' instead In /home/... Clearly this isn't a red-alert, showstopping error. But what bothers me is that it doesn't show up on my localhost. I'd certainly like to improve my code by addressing these sorts of issues if I could see them! I've looked through both php.ini files, and my webhost's setting is error_reporting = E_ALL & ~E_NOTICE whereas mine was error_reporting = E_STRICT, which I had thought was better. However, changing mine to match and rebooting the server doesn't seem to have accomplished anything. Could someone please point me in the right direction?

    Read the article

  • Page not rewriting in ExpressionEngine

    - by Andrew
    I recently just launched an ExpressionEngine site and one of the last steps I take is removing index.php from the URL. In the case of this site, the default template group is called "site". Long story short, after removing index.php from the URL, all pages continue to work great with the exception of my contact page, which also lives in the "site" template group. Going to http://example.com/contact/ gives me a 404 while going to http://example.com/site/contact produces the desired result. In past ExpressionEngine site setups (including my own) this has never happened, so does anyone have thoughts on why this might not be working?

    Read the article

  • Keeping asp.net mvc site IIS6 always ready to accept requests

    - by Andrew Florko
    I have asp.net mvc intranet site that is deployed to IIS6. Site is used rarely so app pool tends to shutdown. When user click the page for the very first time 5-10 seconds are passed till page appears (app pool started and site is compiled). Situation repeats for the next page and so on. AFAIK IIS7 has option to disable App pool shutdown but IIS6 lacks it. Nowadays i have special utility that pings site periodically (10 pages) in order to determine if pages are available and keeps site always ready for users this way. Is it normal or may be I've missed something in IIS6 configuration? Do you use such pinger apps in production to notify support/admins if site is not available? Thank you in advance!

    Read the article

  • Presenting collection of structures of strings in grid or similar in WPF - Example? Ideas?

    - by Andrew
    Hi, I have a collection of structures. The structure is just some strings. Example public struct ReportLine { public string Name; public string Address; public string Phone; ...// about 10 other strings } I can't change this part. What I want to do is display it in a simple grid or simlar in WPF. My only requirements are: a) need column headers b) rows must alternate in color c) columns big enough to hold largest datum (which is not know until run time) Can someone point me to an example to get me started? Is the GridView the way to go? Or DataGrid? Or perhaps just the grid? I have the book Pro WPF in C# 2008 and it covers binding ListBox's to collections, but the collections always seem to be collections of one field (ex. a collection of 40 names). Here I have a collection (an array in fact) of a structure. How do I setup the databinding? As you can see, I'm new to this and probably would most benefit from a reference to an article. I've found articles covering collections of 1 field, but no examples covering binding to an array of structures. Also, my intitial research indicates c) can't be easily done, if you demand that the column is big enough for all the data in that column, not just the visible data. Thanks, dave

    Read the article

  • Creating a ListView/TreeView using Category (Control Panel-Like) View

    - by Andrew Moore
    I currently have an application which uses a regular ListView with groups to show a bunch of modules. I would like to use a Category view. Category view is the new view introduced in Windows Vista for the Control Panel: Is there a third party control or a way (via API) to create a ListView which mimics the behavior of the Windows 7 Control Panel? Categories with icons and action links. Separate events for Category Click and Action Click. One or two column layout Separators between action links or lines EDIT: Seems like Windows is using a TreeView (SysTreeView32) control internally for this.

    Read the article

  • ASP.NET MVC. Hot to guess autogenerated id value ?

    - by Andrew Florko
    My web form contains list of dynamic fields that are generated like this: <% for (int i = 0; i < Model.Options.Count; i++) { %> ... <%= Html.Hidden("Options[" + i + "].Id", Model.Options[i].Id)%> <%= Html.CheckBox("Options[" + i + "].Selected", Model.Options[i].Selected)%> ... This maps perfectly on array of controller method parameters as described in Model Binding To A List article. I want to add label for checkboxes to title them, but I have to guess their ids in hmtl layout. Options[" + i + "].Selected turns into Options_0__Selected How can I avoid hardcoding Id generation in-built asp.net mvc rules? Thank you advance.

    Read the article

  • VB.net Enter Key

    - by Andrew
    I was given the following pseudo code in order to get the form that has focus and only allow the form I want to be submitted: <script> var currentForm = document.forms[0];</script> <form ...><input onfocus="currentForm = this.form;"/></form> <form ...><input onfocus="currentForm = this.form;"/></form> function globalKeyPressed(event) { if (event.keyCode == ENTER) { // This is pseudo-code, check how to really do it currentForm.submit(); } } How would I do this for VB.net because VB.net doesn't accept System.Windows.Forms.KeyPressEventArgs. I also wanted to add that I can't have multiple forms on my website as it disrupts the loginview. So my 2 seperate 'forms' are really just a loginview and then an asp:textbox and asp:button by themselves without a form.

    Read the article

  • Div width: auto and IE

    - by Andrew Heath
    I'm using the jQuery qTip to show individual users and their votes when an average rating is mousedover. qTip calls a PHP file which grabs all the users and votes for the item from the MySQL database and builds a 3 column table, which appears as the tooltip. In Firefox, the tooltip displays properly. In IE7 (haven't tested on IE8 yet), the tooltip is the proper height, but the width is only 2 or 3 characters - not the entire table. If I set the width of the div to a fixed number, say width: 300px; I can coax IE into displaying it properly. However, the length of my users' names varies considerably, and I'd rather not nail down the div to its maximum possible width and then have a crapload of whitespace when you look at an item voted on only by "Joe". Using width: auto; has no effect in IE7. Are there alternatives? Sorry if I've overlooked a similar question. I searched for a bit before posting but didn't find anything suitable. EDIT TO ADD CODE: <div style="-moz-border-radius: 0pt 0pt 0pt 0pt; position: absolute; width: 358px; display: none; top: 384.617px; left: 463.5px; z-index: 6000;" class="qtip qtip-defaults" qtip="0"> <div style="position: relative; overflow: hidden; text-align: left;" class="qtip-wrapper"> <div style="overflow: hidden; background: none repeat scroll 0% 0% white; border: 1px solid rgb(211, 211, 211);" class="qtip-contentWrapper"> <div class="qtip-content qtip-content" style="background: none repeat scroll 0% 0% white; color: rgb(17, 17, 17); overflow: hidden; text-align: left; padding: 5px 9px;"> <div id="WhoResults"> <table> <tbody> <tr> <td>guy1</td> <td>guy2</td> <td>guy3</td> </tr> <tr> <td>guy4</td> <td>guy5</td> <td>guy6</td> </tr> </tbody> </table> </div> </div> </div> </div> </div> I have applied no CSS styling. That's all been handled by qTip. I tried to format it as best I could. Thanks for any help you can provide.

    Read the article

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