Search Results

Search found 1501 results on 61 pages for 'adam stacey'.

Page 8/61 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • ProcessAjaxOpenIdResponse doesn't exist in OpenAuth library?

    - by Stacey
    Using the NerdDinner 2.0 source code, I was trying to emulate its use of OpenID. All was fine and good until I ran into this line of code.. ( seen in the source code at : http://nerddinner.codeplex.com/sourcecontrol/network/Show?projectName=nerddinner&changeSetId=46375#952606 ) - ( trunk/nerddinner/services/OpenIdRelyingPartyService.cs ) public ActionResult ProcessAjaxOpenIdResponse() { return relyingParty.ProcessAjaxOpenIdResponse().AsActionResult(); } ProcessAjaxOpenIdResponse doesn't exist, though! If I download the nerddinner application and follow the dependancies, I can see that the OpenAuth library they use has this method. However, getting the newest version from http://www.dotnetopenauth.net/ - the library does not have this method. Any ideas on what happened to it, and what I should use instead?

    Read the article

  • StyleCop XML Documentation Header - Using 3 /// instead of 2 //

    - by Adam Jenkin
    I am using XML documentation headers on my c# files to pass the StyleCop rule SA1633. Currently, I have to use the 2 slash commenting rule to allow StyleCop to recognize the header. for example: // <copyright file="abc.ascx.cs" company="MyCompany.com"> // MyCompany.com. All rights reserved. // </copyright> // <author>Me</author> This works fine for StyleCop, however I would like to use the 3 slash commenting rule to enable visual studio to understand the comments as XML and provide the XML functionality (highlighting, auto indenting etc) /// <copyright file="abc.ascx.cs" company="MyCompany.com"> /// MyCompany.com. All rights reserved. /// </copyright> /// <author>Me</author> The problem is that when using 3 slashes, StyleCop no longer see's the header and throws the SA1633 warning. Is there anyway to configure stylecop to understand the header is contained in XML using 3 slashes? Thanks, Adam

    Read the article

  • jQuery Sortable .toArray with ASP.NET MVC ActionResult

    - by Stacey
    Third try at fixing this tonight - trying a different approach than before now. Given a jQuery Sortable List.. <ul id="sortable1" class="connectedSortable"> <li class="ui-state-default" id="item1">Item 1</li> <li class="ui-state-default" id="item2">Item 2</li> <li class="ui-state-default">Item 3</li> <li class="ui-state-default ">Item 4</li> <li class="ui-state-default">Item 5</li> </ul> <ul id="sortable2" class="connectedSortable"> </ul> And ASP.NET MVC ActionResult.. [AcceptVerbs(HttpVerbs.Post)] public ActionResult Insert( string[] items ) { return null; } Activated by JavaScript... $("#sortable1, #sortable2").sortable({ connectWith: '.connectedSortable', dropOnEmpty: true, receive: function () { var items = $(this).sortable('toArray'); alert(items); $.ajax({ url: '/Manage/Events/Insert', type: 'post', data: { 'items': items } }); } }).disableSelection(); The 'alert' DOES show the right items. It shows 'item1, item2' etc. But my ASP.NET MVC ActionResult gets nothing. The method DOES fire, but the 'items' parameter comes in null. Any ideas?

    Read the article

  • Errors with shotgun gem and msvcrt-ruby18.dll when running my Sinatra app

    - by Adam Siddhi
    Greetings, Every time I make a change to a Sinatra app I'm working on and try to refresh the browser (located at http://localhost:4567/) the browser will refresh and, the console window seems to restart the WEB brick server. The problem is that the content in the browser window does not change. A friend of mine told me it was a shotgun issue and referred me to rtomayko's shotgun gem: http://github.com/rtomayko/shotgun On this page I read that the shotgun gem would basically solve my problem, allowing the changes made to my app to show up in the browser window after I refresh it. So I installed the shotgun gem. The installation was successful. To activate the shotgun function you have to type shotgun before the file name. In this case my Sinatra app's file name is shortener.rb When I type shotgun shortener.rb to run my Sinatra app I get this error: C:\ruby\sinatrashotgun shortener.rb c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:137:in `': No such f ile or directory - uname (Errno::ENOENT) from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:137:in block in ' from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:136:in each' from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:136:in find' from c:/Ruby19/lib/ruby/gems/1.9.1/gems/shotgun-0.6/bin/shotgun:136:in <top (required)>' from c:/Ruby19/bin/shotgun:19:inload' from c:/Ruby19/bin/shotgun:19:in `' I should also mention that before testing the shotgun method out to see if it worked, I installed the mongrel (I realize I should have checked to see if shotgun worked before doing this as installing mongrel has complicated this problem). So on top of getting the error message above I also get a pop up window from Ruby.exe saying: Ruby.exe - Unable to load component This application has failed to start because msvcrt-ruby18.dll was not found. Re-installing the application may fix this problem. I have no idea what msvcrt-ruby18.dll is but I know that installing either shotgun and/or mongrel created this problem. Where to go from here? Thanks, Adam

    Read the article

  • HOW TO: Draggable legend in matplotlib

    - by Adam Fraser
    QUESTION: I'm drawing a legend on an axes object in matplotlib but the default positioning which claims to place it in a smart place doesn't seem to work. Ideally, I'd like to have the legend be draggable by the user. How can this be done? SOLUTION: Well, I found bits and pieces of the solution scattered among mailing lists. I've come up with a nice modular chunk of code that you can drop in and use... here it is: class DraggableLegend: def __init__(self, legend): self.legend = legend self.gotLegend = False legend.figure.canvas.mpl_connect('motion_notify_event', self.on_motion) legend.figure.canvas.mpl_connect('pick_event', self.on_pick) legend.figure.canvas.mpl_connect('button_release_event', self.on_release) legend.set_picker(self.my_legend_picker) def on_motion(self, evt): if self.gotLegend: dx = evt.x - self.mouse_x dy = evt.y - self.mouse_y loc_in_canvas = self.legend_x + dx, self.legend_y + dy loc_in_norm_axes = self.legend.parent.transAxes.inverted().transform_point(loc_in_canvas) self.legend._loc = tuple(loc_in_norm_axes) self.legend.figure.canvas.draw() def my_legend_picker(self, legend, evt): return self.legend.legendPatch.contains(evt) def on_pick(self, evt): if evt.artist == self.legend: bbox = self.legend.get_window_extent() self.mouse_x = evt.mouseevent.x self.mouse_y = evt.mouseevent.y self.legend_x = bbox.xmin self.legend_y = bbox.ymin self.gotLegend = 1 def on_release(self, event): if self.gotLegend: self.gotLegend = False ...and in your code... def draw(self): ax = self.figure.add_subplot(111) scatter = ax.scatter(np.random.randn(100), np.random.randn(100)) legend = DraggableLegend(ax.legend()) I emailed the Matplotlib-users group and John Hunter was kind enough to add my solution it to SVN HEAD. On Thu, Jan 28, 2010 at 3:02 PM, Adam Fraser wrote: I thought I'd share a solution to the draggable legend problem since it took me forever to assimilate all the scattered knowledge on the mailing lists... Cool -- nice example. I added the code to legend.py. Now you can do leg = ax.legend() leg.draggable() to enable draggable mode. You can repeatedly call this func to toggle the draggable state. I hope this is helpful to people working with matplotlib.

    Read the article

  • WPF Update Binding when Bound directly to DataContext w/ Converter

    - by Adam
    Normally when you want a databound control to 'update,' you use the "PropertyChanged" event to signal to the interface that the data has changed behind the scenes. For instance, you could have a textblock that is bound to the datacontext with a property "DisplayText" <TextBlock Text="{Binding Path=DisplayText}"/> From here, if the DataContext raises the PropertyChanged event with PropertyName "DisplayText," then this textblock's text should update (assuming you didn't change the Mode of the binding). However, I have a more complicated binding that uses many properties off of the datacontext to determine the final look and feel of the control. To accomplish this, I bind directly to the datacontext and use a converter. In this case I am working with an image source. <Image Source="{Binding Converter={StaticResource ImageConverter}}"/> As you can see, I use a {Binding} with no path to bind directly to the datacontext, and I use an ImageConverter to select the image I'm looking for. But now I have no way (that I know of) to tell that binding to update. I tried raising the propertychanged event with "." as the propertyname, which did not work. Is this possible? Do I have to wrap up the converting logic into a property that the binding can attach to, or is there a way to tell the binding to refresh (without explicitly refreshing the binding)? Any help would be greatly appreciated. Thanks! -Adam

    Read the article

  • PostgreSQL: Auto-partition a table

    - by Adam Matan
    Hi, I have a huge database which holds pairs of numbers (A,B), each ranging from 0 to 10,000 and stored as floats. e.g., (1, 9984.4), (2143.44, 124.243), (0.55, 0), ... Since the PostgreSQL table which stores these pairs grew quite large, I have decided to partition it into inheriting sub-tables. I intend to create 100 such tables, each storing a range of 1000x1000. The problem is that these numbers tend to come in large chunks of nearby numbers. It means that in the future, some tables will be nearly empty and some will hold a very large portion of the database. Unfortunately, the distribution of future pairs is yet unknown. I am looking for a way to automatically repartition my table. That means that if a certain subtable holds more than a specific number of pairs, it will be automatically partitioned into four sub-sub tables, and so on. My questions are: Is recursive partitioning and inheritance possible in PostgreSQL 8.3? Will indexes and query plans understand it? What's the best way to split a subtable once it grew too large? I should point out that this isn't a live database, so a downtime of few hours every week is totally acceptable. Thanks in advance, Adam

    Read the article

  • Codility-like sites for code golfs

    - by Adam Matan
    Hi, I've run into codility.com new cool service after listening to one of the recent stackoverflow.com podcasts. In short, it presents the user with a programming riddle to solve, within a given time frame. The user writes code in an online editor, and has the ability to run the program and view the standard output. After final submission, the user sees its final score and which tests failed him. Quoting Joel Spolsky: You are given a programming problem, you can do it in Java, C++, C#, C, Pascal, Python and PHP, which is pretty cool, and you have 30 minutes. And it gives you an editor in a webpage. And you've got to just start typing your code. And it's going to time you, basically you have to do it in a certain amount of time. And it actually runs your code and determines the performance characteristics of your code. It is intended for job interview screenings, but the idea seems very cool for code-golfs and for practicing new languages. Do you know if there's any proper open replacement? Adam

    Read the article

  • jQuery Form, ASP.NET MVC JSon Result

    - by Stacey
    I'm trying to return a json result from a jQuery Form instance - but it keeps prompting me to download a file instead of displaying it in the window like it is supposed to... $("#ajaxImageForm").ajaxForm({ iframe: true, type: "GET", dataType: "json", beforeSubmit: function() { $("#ajaxImageForm").block({ message: '<img src="/content/images/loader.gif" /> Uploading . . .' }); }, success: function(result) { $("#ajaxImageForm").unblock(); $.growlUI(null, result.message); } }); [AcceptVerbs(HttpVerbs.Post)] public JsonResult Edit(FormCollection collection) { // return Json to the jQuery Form Result return new JsonResult { Data = new { message = string.Format("edited successfully.") } }; }

    Read the article

  • dotnetopenauth with asp.net mvc proving too frustrating to use.

    - by Stacey
    I've been trying excessively hard to implement a good open id solution into asp.net mvc - and everywhere I turn is absolute dead ends. DotNetOpenAuth is just too big and I have been thusfar unable to get even the most simplistic, basic, absolute cut and dry implementation of it to work. NerdDinner had a promising implementation, but it is impossible to track down all of the dependant files and scripts. The DotNetOpenAuth website has virtually no information that helps, either, unfortunately. Does ANYONE know of a simple approach to just implementing this that actually explains and details how it is working with some kind of selector? It is talked about so much, but everything I find for it is so difficult to work with that it is really putting my whole team off from even considering it. We want to implement it similar to how stack overflow already does - using a selector that'll popup a login page if it needs to. I realize there is a lot of code that needs to be done for this, but everything just hails and praises dotnetopenauth, and nothing really teaches it. Even the sample projects do not open or compile. It looks like a wonderful library - but it really just isn't clicking for me.

    Read the article

  • jquery toggle, prevent clicking during toggle

    - by Stacey
    Given the following jquery code.. $('#toggle').toggle(function() { // perform something }, function() { // perform something else }); Is there any way to prevent the toggle from being fired again if someone clicks while it is performing the function? I referenced http://stackoverflow.com/questions/2489518/tell-jquery-to-ignore-clicks-during-an-animation-sequence and the technique did not work.

    Read the article

  • Serializing Class Derived from Generic Collection yet Deserializing the Generic Collection

    - by Stacey
    I have a Repository Class with the following method... public T Single<T>(Predicate<T> expression) { using (var list = (Models.Collectable<T>)System.Xml.Serializer.Deserialize(typeof(Models.Collectable<T>), FileName)) { return list.Find(expression); } } Where Collectable is defined.. [Serializable] public class Collectable<T> : List<T>, IDisposable { public Collectable() { } public void Dispose() { } } And an Item that uses it is defined.. [Serializable] [System.Xml.Serialization.XmlRoot("Titles")] public partial class Titles : Collectable<Title> { } The problem is when I call the method, it expects "Collectable" to be the XmlRoot, but the XmlRoot is "Titles" (all of object Title). I have several classes that are collected in .xml files like this, but it seems pointless to rewrite the basic methods for loading each up when the generic accessors do it - but how can I enforce the proper root name for each file without hard coding methods for each one? The [System.Xml.Serialization.XmlRoot] seems to be ignored. When called like this... var titles = Repository.List<Models.Title>(); I get the exception <Titlesxmlns=''> was not expected. The XML is formatted such as. .. <?xml version="1.0" encoding="utf-16"?> <Titles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Title> <Id>442daf7d-193c-4da8-be0b-417cec9dc1c5</Id> </Title> </Titles> Here is the deserialization code. public static T Deserialize<T>(String xmlString) { System.Xml.Serialization.XmlSerializer XmlFormatSerializer = new System.Xml.Serialization.XmlSerializer(typeof(T)); StreamReader XmlStringReader = new StreamReader(xmlString); //XmlTextReader XmlFormatReader = new XmlTextReader(XmlStringReader); try { return (T)XmlFormatSerializer.Deserialize(XmlStringReader); } catch (Exception e) { throw e; } finally { XmlStringReader.Close(); } }

    Read the article

  • How do I best remove the unicode characters that XHTML regards as non-valid using php?

    - by Andrew Stacey
    I run a forum designed to support an international mathematics group. I've recently switched it to unicode for better support of international characters. In debugging this conversion, I've discovered that not all unicode characters are considered as valid XHTML (the relevant website appears to be http://www.w3.org/TR/unicode-xml/). One of the steps that the forum software goes through before presenting the posts to the browser is an XHTML validation/sanitisation step. It seems a reasonable idea that at that stage it should remove any unicode characters that XHTML doesn't like. So my question is: Is there a standard (or best) way of doing this in PHP? (The forum is written in PHP, by the way.) I guess that the failsafe would be a simple str_replace (if that's also the best, do I need to do anything extra to make sure it works properly with unicode?) but that would involve me having to go through the XHTML DTD (or the above-referenced W3 page) carefully to figure out what characters to list in the search part of str_replace, so if this is the best way, has someone already done that so that I can steal, err, copy, it? (Incidentally, the character that caused the problem was U+000C, the 'formfeed', which (according to the W3 page) is valid HTML but invalid XHTML!)

    Read the article

  • Show cue banner for wpf ComboBox with grouping

    - by Adam Duston
    I have a ComboBox in my WPF form: <ComboBox Margin="75,0,15,102" Name="videoFormatCombo" Height="23" VerticalAlignment="Bottom" DataContext="{StaticResource GroupedVideoFormats}" ItemsSource="{Binding}" ItemTemplate="{StaticResource VideoFormatTemplate}"> <ComboBox.GroupStyle> <GroupStyle HeaderTemplate="{StaticResource GroupHeader}"/> </ComboBox.GroupStyle> </ComboBox> As you might be able to guess, GroupedVideoFormats is a CollectionViewSource with grouping. I need to get a cue banner to display for this ComboBox. I've attempted the solution that is (very verbosely) outlined in this blog post, but it will not work for a ComboBox with grouped data. The two solutions outlined in superfluousprefixhttp://stackoverflow.com/questions/2548757/how-can-the-blank-space-in-a-c-combobox-be-filled-as-a-hint-for-the-user are for Windows Forms ComboBoxes only, and won't work with WPF. If it would help to see all the original source, this particular form is on github: superfluousprefixhttp://github.com/8planes/mirovideoconverter/blob/master/MSWindows/Windows/FileSelect.xaml . It's an open-source project, so the entire project is on github: superfluousprefixhttp://github.com/8planes/mirovideoconverter/tree/master/MSWindows . Thank you for any advice! Adam P.S. stackoverflow wouldn't let me make more than one anchor tag in my post, hence the long urls with the superfluous prefix. Sorry!

    Read the article

  • How do I use a custom authentication mechanism for a Java web application with Spring Security?

    - by Adam
    Hi, I'm working on a project to convert an existing Java web application to use Spring Web MVC. As a part of this I will migrate the existing log-on/log-off mechanism to use Spring Security. The idea at this stage is to replicate the existing functionality and replace only the web layer, leaving the service classes and objects in place. The required functionality is simple. Access is controlled to URLs and to access certain pages the user must log on. Authentication is performed with a simple username and password along with an extra static piece of information that comes from the login page. There is no notion of a role: once a user has logged on they have access to all of the pages. Behind the scenes, the service layer has a class with a simple authentication method: doAuthenticate(String username, String password, String info) throws ServiceException An exception is thrown if the login fails. I'd like to leave this existing service object that does the authentication intact but to "plug it into" the Spring Security mechanism. Can somebody suggest the best approach to take for this please? Naturally, I'd like to take the path of least resistance and leave the work where possible to Spring... Thanks in advance, Adam.

    Read the article

  • Html.DescriptionFor<T>

    - by Stacey
    I'm trying to emulate the Html Helper for "LabelFor" to work with the [Description] Attribute. I'm having a lot of trouble figuring out how to get the property from the helper though. This is the current signature... class Something { [Description("Simple Description")] [DisplayName("This is a Display Name, not a Description!")] public string Name { get; set; } } public static MvcHtmlString DescriptionFor<TModel, TValue>(this HtmlHelper<TModel> html, Expression<Func<TModel, TValue>> expression);

    Read the article

  • facebook with openid

    - by Stacey
    Referencing http://stackoverflow.com/questions/1827997/is-facebook-an-openid-provider here. This is kind of an additional question based on it. I have also read the article at : http://stackoverflow.com/questions/2264266/what-is-the-openid-url-of-facebook - but I am still pretty confused on the whole ordeal. The goal is for people who use facebook to easily login to our website, not to neccessarily integrate with facebook and add things to it (yet). I have read the documentation on facebook connect and am still having trouble grasping exactly what we need to do to accomplish this. I notice that it says that facebook accepts openid logins - so in theory someone with a facebook account could login to a site that took other openid logins, correct? Or do I have to code a separate 'facebookconnect' system just to accept logins from facebook accounts?

    Read the article

  • LINQ query code for complex merging of data.

    - by Stacey
    I've posted this before, but I worded it poorly. I'm trying again with a more well thought out structure. Re-writing this a bit to make it more clear. I have the following code and I am trying to figure out the shorter linq expression to do it 'inline'. Please examine the "Run()" method near the bottom. I am attempting to understand how to join two dictionaries together based on a matching identifier in one of the objects - so that I can use the query in this sort of syntax. var selected = from a in items.List() // etc. etc. select a; This is my class structure. The Run() method is what I am trying to simplify. I basically need to do this conversion inline in a couple of places, and I wanted to simplify it a great deal so that I can define it more 'cleanly'. class TModel { public Guid Id { get; set; } } class TModels : List<TModel> { } class TValue { } class TStorage { public Dictionary<Guid, TValue> Items { get; set; } } class TArranged { public Dictionary<TModel, TValue> Items { get; set; } } static class Repository { static public TItem Single<TItem, TCollection>(Predicate<TItem> expression) { return default(TItem); // access logic. } } class Sample { public void Run() { TStorage tStorage = new TStorage(); // access tStorage logic here. Dictionary<TModel, TValue> d = new Dictionary<TModel, TValue>(); foreach (KeyValuePair<Guid, TValue> kv in tStorage.Items) { d.Add(Repository.Single<TModel, TModels>(m => m.Id == kv.Key),kv.Value); } } }

    Read the article

  • How do I remove (or apply) transparency on a gdk-pixbuf?

    - by Andrew Stacey
    I have a c++ program in which a gdk-pixbuf is created. I want to output it as an image, so I call gdk_pixbuf_save_to_stream(pixbuf,stream,type,NULL,&err,NULL). This works fine when "type" is png or tiff, but with jpeg or bmp it just produces a black square. The original pixbuf consists of black-on-transparent (and gdk_pixbuf_get_has_alpha returns true) so I'm guessing that the problem is with the alpha mask. GdkPixbuf has a function to add an alpha channel, but I can't see one that removes it again, or (which might be as good) to invert it. Is there a simple way to get the jpeg and bmp formats to work properly? (I should say that I'm very new to proper programming like this.)

    Read the article

  • Python many-to-one mapping (creating equivalence classes)

    - by Adam Matan
    Hi, I have a project of converting one database to another. One of the original database columns defines the row's category. This coulmn should be mapepd to a new category in the new databse. For example, let's assume the original categories are:parrot, spam, cheese_shop, Cleese, Gilliam, Palin Now that's a little verbose for me, And I want to have these rows categorized as sketch, actor - That is, define all the sketches and all the actors as two equivalence classes. >>> monty={'parrot':'sketch', 'spam':'sketch', 'cheese_shop':'sketch', 'Cleese':'actor', 'Gilliam':'actor', 'Palin':'actor'} >>> monty {'Gilliam': 'actor', 'Cleese': 'actor', 'parrot': 'sketch', 'spam': 'sketch', 'Palin': 'actor', 'cheese_shop': 'sketch'} That's quite awkward- I would prefer having something like: monty={ ('parrot','spam','cheese_shop'): 'sketch', ('Cleese', 'Gilliam', 'Palin') : 'actors'} But this, of course, sets the entire tuple as a key: >>> monty['parrot'] Traceback (most recent call last): File "<pyshell#29>", line 1, in <module> monty['parrot'] KeyError: 'parrot' Any ideas how to create an elegant many-to-one dictionary in Python? Thanks, Adam

    Read the article

  • Get all but first from an array

    - by Stacey
    Is there a one-line easy linq expression to just get everything from a simple array except the first element? for (int i = 1; i <= contents.Length - 1; i++) Message += contents[i]; I just wanted to see if it was easier to condense.

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >