Search Results

Search found 2532 results on 102 pages for 'chad green'.

Page 22/102 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • Regex not being greedy enough

    - by Chad
    I've got the following regex that was working perfectly until a new situation arose ^.*[?&]U(?:RL)?=(?<URL>.*)$ Basically, it's used against URLs, to grab EVERYTHING after the U=, or URL= and return it in the URL match So, for the following http://localhost?a=b&u=http://otherhost?foo=bar URL = http://otherhost?foo=bar Unfortunately an odd case came up http://localhost?a=b&u=http://otherhost?foo=bar&url=http://someotherhost Ideally, I want URL to be "http://otherhost?foo=bar&url=http://someotherhost", instead, it is just "http://someotherhost"

    Read the article

  • How to control the "flow" of an ASP.NET MVC (3.0) web app that relies on Facebook membership, with Facebook C# SDK?

    - by Chad
    I want to totally remove the standard ASP.NET membership system and use Facebook only for my web app's membership. Note, this is not a Facebook canvas app question. Typically, in an ASP.NET app you have some key properties & methods to control the "flow" of an app. Notably: Request.IsAuthenticated, [Authorize] (in MVC apps), Membership.GetUser() and Roles.IsUserInRole(), among others. It looks like [FacebookAuthorize] is equivalent to [Authorize]. Also, there's some standard work I do across all controllers in my site. So I built a BaseController that overrides OnActionExecuting(FilterContext). Typically, I populate ViewData with the user's profile within this action. Would performance suffer if I made a call to fbApp.Get("me") in this action? I use the Facebook Javascript SDK to do registration, which is nice and easy. But that's all client-side, and I'm having a hard time wrapping my mind around when to use client-side facebook calls versus server-side. There will be a point when I need to grab the user's facebook uid and store it in a "profile" table along with a few other bits of data. That would probably be best handled on the return url from the registration plugin... correct? On a side note, what data is returned from fbApp.Get("me")?

    Read the article

  • XForms: set default selection in dropdown in binding

    - by Purni
    I have a main instance named 'myinstance' which has the element . Color can be 'Red', 'Blue', 'Green' or ''Yellow'. The colors are populated in a drop-down from another instance called 'colorsinstance'. When my form loads, I want the default in the dropdown to be set to 'Green' in the nodeset binding. <instance id="colorsinstance"> <items> <item label="Color1" value="Red"/> <item label="Color2" value="Blue"/> <item label="Color3" value="Green"/> <item label="Color4" value="Yellow"/> </items> </instance> Main instance binding is as follows: <xforms:bind nodeset="instance('myinstance')"> <xforms:bind nodeset="./color" required="true()"/> </xforms:bind>

    Read the article

  • Overloading on return type ???

    - by Green Hyena
    scala> val shares = Map("Apple" -> 23, "MicroSoft" -> 50, "IBM" -> 17) shares: scala.collection.immutable.Map[java.lang.String,Int] = Map(Apple -> 23, MicroSoft -> 50, IBM -> 17) scala> val shareholders = shares map {_._1} shareholders: scala.collection.immutable.Iterable[java.lang.String] = List(Apple, MicroSoft, IBM) scala> val newShares = shares map {case(k, v) => (k, 1.5 * v)} newShares: scala.collection.immutable.Map[java.lang.String,Double] = Map(Apple -> 34.5, MicroSoft -> 75.0, IBM -> 25.5) From this example it seems like the map method is overloaded on return type. Overloading on return type is not possible right? Would somebody please explain what's going on here?

    Read the article

  • Understanding Incrementing

    - by Chad
    For example this: var a = 123; var b = a++; now a contains 124 and b contains 123 I understand that b is taking the value of a and then a is being incremented. However, I don't understand why this is so. The principal reason for why the creators of JavaScript would want this. Is this really more useful than doing it the PHP way? What is the advantage to this other than confusing newbies?

    Read the article

  • Rails-like console for PHP?

    - by Chad Johnson
    Every so often, things work in my local PHP development environment, while in my test environment on my server, things do not. It's a nightmare to debug this. If I had a console like Rails provides, debugging would be much much simpler. Is there anything like the Rails console but for PHP? I should mention that I am using a home-brewn PHP application.

    Read the article

  • Should I dispose GDI+ object before its creation?

    - by serhio
    Should I dispose GDI+ object before its creation? Is recommended to always Dispose GDI+ object after using it. by e.g. Pen p = new Pen(Color.Green); // use 'p' p.Dispose(); now, if I have this situation: Pen p = new Pen(Color.Green); // use green 'p' p = new Pen(Color.Red); // Should I Dispose my 'p' first? // use red 'p' p.Dispose();

    Read the article

  • What is the standard or best way to deal with database branching with Mercurial or Git branches?

    - by Chad Johnson
    This has been a big question mark on my mind. I'm moving to Mercurial or Git very soon for my web software, and sometimes my branches require significant database changes which other branches should not see. This, I can't always share the same database for my branches. Is there some standard way of dealing with database changes for branching and cloning? What do you all do? I'm using MySQL.

    Read the article

  • SEO URL Structure

    - by Neil
    Based on the following example URL structure: mysite.com/mypage.aspx?a=red&b=green&c=blue Pages in the application use ASP.net user controls and some of these controls build a query string. To prevent duplicate keys being created e.g. &pid=12&pid=10, I am researching methods of rewriting the URL: a) mysite.com/mypage.aspx/red/green/blue b) mysite.com/mypage.aspx?controlname=a,red|b,green|c,blue Pages using this structure would be publishing content that I would like to get indexed and ranked - articles and products (8,000 products to start, with thousands more being added later) My gut instinct tells me to go with the first method, but would it would be overkill to add all that infrastructure if the second method will accomplish my goal of getting pages indexed AND ranked. So my question, looking at the pro's and con's, Google Ranking, time to implement etc. which method should I use? Thanks!

    Read the article

  • Cache an FTP connection for use via AJAX?

    - by Chad Johnson
    I'm working on a Ruby web Application that uses the Net::FTP library. One part of it allows users to interact with an FTP site via AJAX. When the user does something, and AJAX call is made, and then Ruby reconnects to the FTP server, performs an action, and outputs information. Every time the AJAX call is made, Ruby has to reconnect to the FTP server, and that's slow. Is there a way I could cache this FTP connection? I've tried caching in the session hash, but "We're sorry, but something went wrong" is displayed, and a TCP dump is outputted in my logs whenever I attempt to store it in the session hash. I haven't tried memcache yet. Any suggestions?

    Read the article

  • SQL - Dervied Foreign Key - Possible?

    - by Chad
    I'm just curious if this is possible, specifically in SQL CE (Express) with support in .NET's Entity Framework: Table1 (primary) -nvarchar(2000) url -... Table2 (with foreign key) -nvarchar(2000) domain -... foreign key on Table2.domain references Table1.url such that Table.url contains Table2.domain e.g. Table1: http://www.google.com/blah/blah http://www.cnn.com/blah/ http://www.google.com/foo Table2: google.com cnn.com Is it possible for this to be scripted and enforced by SQL CE (let alone any relation database) and, if so, can .NET's Entity Framework automatically support this if I import my database into a model?

    Read the article

  • How do I add a function to a specific element type in jQuery?

    - by Chad Johnson
    I can do this jQuery.fn.validate = function(options) { var defaults = { validateOPtions1 : '', validateOPtions2 : '' }; var settings = $.extend({}, defaults, options); return this.each(function() { // you validation code goes here }); }; but that will make validate() available for every element. I could do this to any element: $('some selector').validate(). Is there a way I can make this only available to, say, form elements? eg. $('.mySpecialFormClass').validate()?

    Read the article

  • How do I add a function to an element via jQuery?

    - by Chad Johnson
    I want to do something like this: $('.dynamicHtmlForm').validate = function() { return true; } $('.dynamicHtmlForm .saveButton').click(function() { if (!$(this).closest('.dynamicHtmlForm').validate()) { return false; } return true; }); And then when I have a form of class dynamicHtmlForm, I want to be able to provide a custom validate() function: $('#myDynamicHtmlForm').validate = function() { // do some validation if (there are errors) { return false; } return true; } But I get this when I do this: $(this).closest(".dynamicHtmlForm").validate is not a function Is what I've described even possible? If so, what am I doing wrong?

    Read the article

  • Why must I use local path rather than 'svn://' with SVN bindings?

    - by Chad Johnson
    I'm using the Ruby SVN bindings built with SWIG. Here's a little tutorial. When I do this @repository = Svn::Repos.open('/path/to/repository') I can access the repository fine. But when I do this @repository = Svn::Repos.open('svn://localhost/some/path') It fails with /SourceCache/subversion/subversion-35/subversion/subversion/libsvn_subr/io.c:2710: 2: Can't open file 'svn://localhost/format': No such file or directory When I do this from the command line, I do get output svn ls svn://localhost/some/path Any ideas why I can't use the svn:// protocol?

    Read the article

  • Why Does TFS Allow Orphaned Content and How Do I Get Rid of It?

    - by Chad
    My TfsVersionControl database has grown to 40+ GB in size. We recently did a TFS Destroy on a folder tree that should have cleared up at least 10 GB but instead it seemed to have no effect. When I look at the tables in TfsVersionControl, I am first shocked to see that there are no foreign keys at all in the database. Running a few queries, I see that there is some orphaning going on: tbl_Content has 13.9 GB of records that don't have a related tbl_File record tbl_File and tbl_Content have 2.4 GB that don't have a related tbl_Namespace record The cleanup job seems to be running nightly (prc_DeleteUnusedContent) and running it against the database manually doesn't remove any orphans. I see in the log for the cleanup job that it failed on 3/16, which is the morning after I destroyed the large amount of data. The error was due to a full transaction log. Could that error be the reason I'm left with all this orphaned data that can't be deleted? How can I permanently destroy this unneeded content?

    Read the article

  • .htaccess redirect folders

    - by Chad Whitaker
    Hello I have a link on my site with files at the following link: example.com/community/community/ How can I use htaccess to convert the link to example.com/community/ without moving the files from /community/community/

    Read the article

  • Windows Phone 7: Making ListBox items change dynamically

    - by Chad La Guardia
    I am working on creating a Windows Phone app that will play a series of sound clips selected from a list. I am using the MVVM (Model View View-Model) Design pattern and have designed a model for my data, along with a view model for my page. Here is what the XAML for the ListBox looks like: <ListBox x:Name="MediaListBox" Margin="0,0,-12,0" ItemsSource="{Binding Media}" SelectionChanged="MediaListBox_SelectionChanged" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"> <ListBox.ItemTemplate > <DataTemplate> <StackPanel Margin="0,0,0,17" Width="432" Orientation="Horizontal"> <Image Source="../Media/Images/play.png" /> <StackPanel > <TextBlock Text="{Binding Title}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle}"/> <TextBlock Text="{Binding ShortDescription}" TextWrapping="Wrap" Margin="12,-6,12,0" Visibility="{Binding ShortDescriptionVisibility}" Style="{StaticResource PhoneTextSubtleStyle}"/> <TextBlock Text="{Binding LongDescription}" TextWrapping="Wrap" Visibility="{Binding LongDescriptionVisibility}" /> <StackPanel> <Slider HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Visibility="{Binding LongDescriptionVisibility}" ValueChanged="Slider_ValueChanged" LargeChange="0.25" SmallChange="0.05" /> </StackPanel> </StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> My question is this: I want to be able to expand and collapse part of the items in the ListBox. As you can see, I have a binding for the visibility. That binding is coming from the MediaModel. However, when I change this property in the ObservableCollection, the page is not updated to reflect this. The ViewModel for this page looks like this: public class ListenPageViewModel : INotifyPropertyChanged { public ListenPageViewModel() { this.Media = new ObservableCollection<MediaModel>; } /// <summary> /// A collection for MediaModel objects. /// </summary> public ObservableCollection<MediaModel> Media { get; private set; } public bool IsDataLoaded { get; private set; } /// <summary> /// Creates and adds the media to their respective collections. /// </summary> public void LoadData() { this.Media.Clear(); this.Media.Add(new MediaModel() { Title = "Media 1", ShortDescription = "Short here.", LongDescription = "Long here.", MediaSource = "/Media/test.mp3", LongDescriptionVisibility = Visibility.Collapsed, ShortDescriptionVisibility = Visibility.Visible }); this.Media.Add(new MediaModel() { Title = "Media 2", ShortDescription = "Short here.", LongDescription = "Long here.", MediaSource = "/Media/test2.mp3", LongDescriptionVisibility = Visibility.Collapsed, ShortDescriptionVisibility = Visibility.Visible }); this.IsDataLoaded = true; } public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String propertyName) { PropertyChangedEventHandler handler = PropertyChanged; if (null != handler) { handler(this, new PropertyChangedEventArgs(propertyName)); } } } The bindings work correctly and I am seeing the data displayed; however, when I change the properties, the list does not update. I believe that this may be because when I change things inside the observable collection, the property changed event is not firing. What can I do to remedy this? I have poked around for some info on this, but many of the tutorials don't cover this kind of behavior. Any help would be greatly appreciated! Thanks Edit: As requested, I have added the MediaModel code: public class MediaModel : INotifyPropertyChanged { public string Title { get; set; } public string ShortDescription { get; set; } public string LongDescription { get; set; } public string MediaSource { get; set; } public Visibility LongDescriptionVisibility { get; set; } public Visibility ShortDescriptionVisibility { get; set; } public MediaModel() { } public MediaModel(string Title, string ShortDescription, string LongDescription, string MediaSource, Visibility LongDescriptionVisibility, Visibility ShortDescriptionVisibility) { this.Title = Title; this.ShortDescription = ShortDescription; this.LongDescription = LongDescription; this.MediaSource = MediaSource; this.LongDescriptionVisibility = LongDescriptionVisibility; this.ShortDescriptionVisibility = ShortDescriptionVisibility; } public event PropertyChangedEventHandler PropertyChanged; private void NotifyPropertyChanged(String propertyName) { PropertyChangedEventHandler handler = PropertyChanged; if (null != handler) { handler(this, new PropertyChangedEventArgs(propertyName)); } } } Originally, I did not have this class implement the INotifyPropertyChanged. I did this to see if it would solve the problem. I was hoping this could just be a data object.

    Read the article

  • Java combine parents of two large inheritance chains

    - by Soylent Green
    I have two parent classes in a huge project, let's say ClassA and ClassB. Each class has many subclasses, which in turn have many subclasses, which in turn have many subclasses, etc. My task is to "marry" these two "families" so that both inherit from a SINGLE parent. I need to essentially make ClassA and ClassB one class (parent) to both of their combined subclasses (children). ClassA and ClassB both currently implement Serializable. I am currently trying to make both inheritance chains inherit from ClassA, and then copy all functions and data members from ClassB into ClassA. This is tedious, and I think a terrible solution. What would be the CORRECT way to solve this problem?

    Read the article

  • Pulling international street addresses / phone numbers from free-form text

    - by spitzanator
    Hey, folks. I'm looking for some regular expressions to help grab street addresses and phone numbers from free-form text (a la Gmail). Given some text: "John, I went to the store today, and it was awesome! Did you hear that they moved to 500 Green St.? ... Give me a call at +14252425424 when you get a chance." I'd like to be able to pull out: 500 Green St. (recognized as a street address) +14252425424 (recognized as a phone number) What makes this problem easier is that I don't care about parsing text that gets pulled out. That is, I don't care that Green is the name of the road or that 425 is the area code. I just want to grab strings that "look like" addresses or telephone numbers. Unfortunately, this needs to work internationally, as best as possible. Anyone have any leads? Thanks!

    Read the article

  • Way to check for foreign key references before deleting in MySQL?

    - by Chad Johnson
    I'm working with a content management system, and users are prompted with a confirmation screen before deleting records. Some records are foreign key referenced in other tables, and therefore they cannot be deleted. I would like to display a message beside a given record if it has foreign key references. To know whether I should display the message for a record, I could just query the referencing table and see if there are references. But the problem is, there are about a dozen tables with records potentially referencing this record, and a lookup could take a "long" time. Is there an easy way to tell whether the record is delete-ready (ie. has no foreign key references)?

    Read the article

  • wrap text around image control in C#.Net

    - by Ravi
    Hi, I am working on C#.DotNet windows application project, here i am using Infragistics control. In this project i want to add image over text control. This image contains two portion, 35% of image have white color another 65% of image have green color.In this image 2nd portion(green color) i have to display dynamic string , this string size may dynamically updating. But this string dont go first portion(white color) of image. For that i am using UltraLabel control. I have add image in UltraLabel ImageBackground property and TextHAlign set as Right. But here small 15 charecter string means appear only second portion(green color), 20 charecter string means appeaer second & first portion. I don't want to display first portion of image. Thanks

    Read the article

  • What does "Select Distinct Null As xxxxx" mean?

    - by Soylent Green
    Background: I am mapping Sybase stored procedure return values to java objects using Spring. For example I map a Sybase datatype of varchar as a String type in Java, and a Sybase datatype of int as an int type in Java, etc. I have come across the following code in one of the stored procedures: SELECT DISTINCT A.Col1 AS val1, A.Col2 AS val2, NULL AS someVal, A.col3 AS val3, ... A.col9 AS val9 FROM #SomeTable A ORDER BY Col2, Col3 I have 2 related questions: What does Null mean in this scenario? I am confused as to what is happening here. I am able to determine the data type of Col1, Col2, etc. of course by looking at the table definition of Table A defined earlier in the stored procedure. Thus I know what datatype I can define in my Java object for val1, val2, etc.. But what about "someVal"? What datatype mapping am I supposed to perform for this Null value? I am fairly inexperienced in SQL. Perhaps the answer is much simpler than I realize.

    Read the article

  • antlr: Best practice to integrate generated parser into the system

    - by green
    Here is the background, I am trying to create a DSL to allow customer write simple scripts to query into our mongodb based database. I choose antlr to implement the DSL. From my understanding (and pls let me know if it's not correct) there are 2 approaches to integrate antlr generated parser into the system: Embed code into the grammar file so that the generated parser could be used directly to make query to the database and return result in a certain format (e.g. json encoded) Keep the parser purely a parser, after feed the DSL file to it, and construct the query in another class by retrieving the AST from generated parser class So antlrers, which one do you think is the way I as an antlr newbie should go? Can you list the pros and cos of each approach, or you have other way to recommend?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >