Search Results

Search found 1441 results on 58 pages for 'brian frost'.

Page 6/58 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Embedded strongly-typed views with ASP.NET MVC

    - by Brian Vallelunga
    I'm working on a plugin-type of system for ASP.NET MVC that loads views from an embedded assembly. I have created a VirtualPathProvider that does the work of retrieving out of the assembly. Everything is working fine except for strongly-typed views. Whenever I try to load one of those, I get an exception of: Could not load type 'System.Web.Mvc.ViewPage'. The problem is that there is no Web.config file under the Views folder. Well, actually there is, but the system doesn't seem to want to read the embedded version. If I manually create the file under the corresponding directory in the web app, everything is fine. This isn't an acceptable workaround however, as each plugin would need its own file in its own specific directory. Does anyone know how I might get ASP to read the embedded Web.config file? Thanks, Brian

    Read the article

  • Double Negation in C++ code.

    - by Brian Gianforcaro
    I just came onto a project with a pretty huge code base. I'm mostly dealing with C++ and a lot of the code they write uses double negation for their boolean logic. if (!!variable && (!!api.lookup("some-string"))) { do_some_stuff(); } I know these guys are intelligent programmers, it's obvious they aren't doing this by accident. I'm no seasoned C++ expert, my only guess at why they are doing this is that they want to make absolutely positive that the value being evaluated is the actual boolean representation. So they negate it, then negate that again to get it back to its actual boolean value. Is this a correct? or am I missing something else? Thanks, Brian Gianforcaro

    Read the article

  • VB.NET - ASP.NET - MS-Access - SQL Statement

    - by Brian
    I have a button which when pressed, sets the user's rights in the db. (If Administrator UserTypeID is set to '2' and if Customer it is set to '1'). However when I run the below code, everything remains the same. I think it's from the SQL statement but I;m not sure. Can anyone help please? Protected Sub btnSetUser_Click(sender As Object, e As System.EventArgs) Handles btnSetUser.Click Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\Brian\Documents\Visual Studio 2010\WebSites\WebSite3\db.mdb;") Dim cmd As OleDbCommand = New OleDbCommand("UPDATE [User] SET [UserTypeID] WHERE Username=?", conn) conn.Open() cmd.Parameters.AddWithValue("@Username", txtUser.Text) If ddUserType.SelectedItem.Text = "Administrator" Then cmd.Parameters.AddWithValue("@UserTypeID", "2") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Administrator." ElseIf ddUserType.SelectedItem.Text = "Customer" Then cmd.Parameters.AddWithValue("@UserTypeID", "1") cmd.ExecuteNonQuery() lblSetUser.Text = txtUser.Text + "was set to Customer." End If conn.Close() End Sub End Class

    Read the article

  • Posting an action works... but no image

    - by Brian Rice
    I'm able to post an open graph action to facebook using the following url: https://graph.facebook.com/me/video.watches with the following post data: video=http://eqnetwork.com/home/video.html?f=8e7b4f27-8cbd-4430-84df-d9ccb46da45f.mp4 It seems to be getting the title from the open graph metatags at the "video" object. But, it's not getting the image (even though one is specified in the metatag "og:image"). Also, if I add this to the post data: picture=http://eqnetwork.com/icons/mgen/overplayThumbnail.ms?drid=14282&subType=ljpg&w=120&h=120&o=1&thumbnail= still no image. Any thoughts? Brian

    Read the article

  • WPF: Binding items added to UserControl's exposed children

    - by Brian
    I have a user control that allows items to be added to it by exposing a Grid's Children property. Any control I add shows up fine but when I try to bind a property on the added item to a control in the main window nothing happens (example): <TextBox Name="txtTest" Text="Success!" /> <mycontrols:CustomUserControl.ExposedGridChildren> <TextBox Text="{Binding ElementName=txtTest, Path=Text, FallbackValue=fail}"/> </mycontrols:CustomUserControl.ExposedGridChildren> This example always results in the TextBox's text showing "fail". Here is how I'm exposing the children in the user control: public UIElementCollection ExposedGridChildren { get { return grdContainer.Children; } } Any thoughts? Is it a scope issue? I know I can't name the elements I add to the children because of scope errors. Thanks, Brian.

    Read the article

  • E4X in ActionScript

    - by Brian Genisio
    Hey all, Looking at the E4X implementation in ActionScript, it occurs to me that they had to figure out how to do three things that I am not sure can be done within ActionScript regularly: Properties/Getters prefixed with @: var myAttribute = xmlPerson.@name; Nameless functions for filtering: xmlData.person.(/* predicate */) lambda syntax for predicates: xmlData.person.(@name == "Brian") So here is my question: Are these just one-off capabilities (much like Vector.<>) they put in just for E4X, therefore keeping out of reach for us? Or do we, as ActionScript developers, have access to these features? More specifically, I'd love to get access to the expression tree of that lambda predicate for my own code (not tied to the XML classes in any way). I figured out that this is called the "filter operator"... but I am not sure how to harness it. Not sure I can... since ActionScript does not allow for operator overloading :(

    Read the article

  • Specifying column names from a list in the data.frame command.

    - by MW Frost
    I have a list called cols with column names in it: cols <- c('Column1','Column2','Column3') I'd like to reproduce this command, but with a call to the list: data.frame(Column1=rnorm(10)) Here's what happens when I try it: > data.frame(cols[1]=rnorm(10)) Error: unexpected '=' in "data.frame(I(cols[1])=" The same thing happens if I wrap cols[1] in I() or eval(). How can I feed that item from the vector into the data.frame() command?

    Read the article

  • Using AJAX to get a specific DOM Element (using Javascript, not jQuery)

    - by Matt Frost
    How do you use AJAX (in plain JavaScript, NOT jQuery) to get a page (same domain) and display just a specific DOM Element? (Such as the DOM element marked with the id of "bodyContent"). I'm working with MediaWiki 1.18, so my methods have to be a little less conventional (I know that a version of jQuery can be enabled for MediaWiki, but I don't have access to do that so I need to look at other options). I apologize if the code is messy, but there's a reason I need to build it this way. I'm mostly interested in seeing what can be done with the Javascript. Here's the HTML code: <div class="mediaWiki-AJAX"><a href="http://www.domain.com/whatever"></a></div> Here's the Javascript I have so far: var AJAXs = document.getElementsByClassName('mediaWiki-AJAX'); if (AJAXs.length > 0) { for (var i = AJAXs.length - 1; i >= 0; i--) { var URL = AJAXs[i].getElementsByTagName('a')[0].href; xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { AJAXs[i].innerHTML = xmlhttp.responseText; } } xmlhttp.open('GET',URL,true); xmlhttp.send(); } }

    Read the article

  • Ajax/PHP - should I use one long running script or polling?

    - by Brian
    Hello, I have a PHP script that is kicked off via ajax. This PHP script uses exec() to run a separate PHP script via the shell. The script that is called via exec() may take 30 seconds or so to complete. I need to update the UI once it is finished. Which of these options is preferred? a) Leave the HTTP connection open for the 30 seconds and wait for it to finish. b) Have exec() run the PHP script in the background and then use ajax polling to check for completion (every 5 seconds or so). c) Something else that I haven't thought of. Thank you, Brian

    Read the article

  • Steps needed to install a PHP application (Mantis) on Windows Home Server - How please?

    - by Brian Frost
    I'm using Windows Home Server and have already managed to install SVN on it to allow me to use Tortoise SVN on client PC's sharing a repository on the server via SVN's service and port. I'd now like to install a bug tracker hosted on this server. I'm not fussy about which one but I saw Mantis - which is a PHP application and looks ok for my purpose. This is where I get weak on such stuff - what steps do I need to do to install and configure PHP (and presumably MySql to get mantis working? It is an http application. As an alternate answer, I'd be happy to use another - more easily installed - bug tracker that has a server service and a port of its own. I'll appreciate any comments.

    Read the article

  • jQuery/javascript events - prototype event handler

    - by Brian M. Hunt
    The following code doesn't work as I intuitively expect it to: function MyObject(input) { input.change(this._foo); this.X = undefined; } MyObject.prototype._foo = function() { alert("This code is never called"); // but if it did this.X = true; } var test_input = $("input#xyz"); // a random, existing input var m = MyObject(test_input); // attach handler (or try to) test_input.change(); // trigger event alert(m.X); // undefined I'd expect that _foo() would be called (and, if that ever happens, that the this variable in _foo() would be an instantiation of MyObject. Does anyone know why this doesn't work, and of any alternative pattern for passing an object to an event handler? Thank you for reading. Brian

    Read the article

  • ASP.NET MVC: How can I explain an invalid type violation to an end-user with Html.ValidationSummary?

    - by Terminal Frost
    Serious n00b warning here; please take mercy! So I finished the Nerd Dinner MVC Tutorial and I'm now in the process of converting a VB.NET application to ASP.NET MVC using the Nerd Dinner program as a sort of rough template. I am using the "IsValid / GetRuleViolations()" pattern to identify invalid user input or values that violate business rules. I am using LINQ to SQL and am taking advantage of the "OnValidate()" hook that allows me to run the validation and throw an application exception upon trying to save changes to the database via the CustomerRepository class. Anyway, everything works well, except that by the time the form values reach my validation method invalid types have already been converted to a default or existing value. (I have a "StreetNumber" property that is an integer, though I imagine this would be a problem for DateTime or any other non-strings as well.) Now, I am guessing that the UpdateModel() method throws an exception and then alters the value because the Html.ValidationMessage is displayed next to the StreetNumber field but my validation method never sees the original input. There are two problems with this: While the Html.ValidationMessage does signal that something is wrong, there is no corresponding entry in the Html.ValidationSummary. If I could even get the exception message to show up there indicating an invalid cast or something that would be better than nothing. My validation method which resides in my Customer partial class never sees the original user input so I do not know if the problem is a missing entry or an invalid type. I can't figure out how I can keep my validation logic nice and neat in one place and still get access to the form values. I could of course write some logic in the View that processes the user input, however that seems like the exact opposite of what I should be doing with MVC. Do I need a new validation pattern or is there some way to pass the original form values to my model class for processing? CustomerController Code // POST: /Customers/Edit/[id] [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(int id, FormCollection formValues) { Customer customer = customerRepository.GetCustomer(id); try { UpdateModel(customer); customerRepository.Save(); return RedirectToAction("Details", new { id = customer.AccountID }); } catch { foreach (var issue in customer.GetRuleViolations()) ModelState.AddModelError(issue.PropertyName, issue.ErrorMessage); } return View(customer); }

    Read the article

  • Minimum OS version number, iPhone app

    - by Michael Frost
    Hi all I've built an iPhone app which is live in the app-store. When originally submitting the app it showed up in App Store as requiring iPhone OS 3.1.3. When later updating the app I made sure my settings in Xcode for the target for the app store build had the Base SDK version set to 3.1.3 and the Deployment Target version set to 3.0, however it still shows up in app store as requiring 3.1.3. From what I've understood the Deployment Target version is the one setting the requirement in app store? Or is there any information concerning this that I should have updated in iTunes Connect when submitting the updated app? Thanks, Michael

    Read the article

  • What is the best method for implementing mouse wheel activity in Delph1 VCL forms?

    - by Brian Frost
    As a long time user of Delphi 7, I've rolled my own mouse wheel handling in a few controls but lately I've noticed that some recent applications only need the mouse cursor to be placed over a control (e.g a list box or tree view) for the mouse wheel activity to cause that control to scroll. This feels nice (as opposed to having to click focus a control before it responds to the wheel. Now I've moved to Delphi 2010 I'm wondering what is the 'correct' behaviour? And what can I use in Delphi that avoids me having to bodge this with my own solutions now? Thanks.

    Read the article

  • Why are these divs repelling each other?

    - by Terminal Frost
    <html> <div style="width:200px;"> <div style="background:red;height:5px"></div> <div style="background:yellow"> Magnets? </div> <div style="background:green;height:5px"></div> </div> </html> Rendering with "Magnets?" wrapped in h3 tags How come the divs cease to be contiguous if "Magnets?" is wrapped in a paragraph or heading tag?

    Read the article

  • Is it possible to smooth a scaled TBitmap in Delphi?

    - by Brian Frost
    I am using Stretched=True on a TBitmap with a 256x256 image. This gets scaled down by 1,2,4 or 8. As expected, text on the bitmap gets more horrible the more I depart from '1'. I notice though that Windows 7 explorer renders a scaled down version of the bitmap 'softer' and more pleasing. Is it possible to 'blur' a TBitmap in this way?

    Read the article

  • How to store and locate multiple interface types within a Delphi TInterfaceList

    - by Brian Frost
    Hi, I'm storing small interfaces from a range of objects into a single TInterfaceList 'store' with the intention of offering list of specific interface types to the end user, so each interface will expose a 'GetName' function but all other methods are unique to that interface type. For example here are two interfaces: IBase = interface //---------------------------------------- function GetName : string; //---------------------------------------- end; IMeasureTemperature = interface(IBase) //------------------------------------ function MeasureTemperature : double; //---------------------------------------- end; IMeasureHumidity = interface(IBase) //---------------------------------------- function MeasureHumidity: double; //---------------------------------------- end; I put several of these interfaces into a single TInterfaceList and then I'd like to scan the list for a specific interface type (e.g. 'IMeasureTemperature') building another list of pointers to the objects exporting those interfaces. I wish to make no assumptions about the locations of those objects, some may export more than one type of interface. I know I could do this with a class hierarchy using something like: If FList[I] is TMeasureTemperature then .. but I'd like to do something simliar with an interface type, Is this possible?

    Read the article

  • What time/date do you stamp your deployed data/exe files when they appear on the target system?

    - by Brian Frost
    It seems a good and clean thing to ensure that your deployed files appear on the target system with a consistent time/date. Many Applications seem to do this but other than for care of overwriting Users' existing data I guess it has no real significance. I'm having a purge on my installer packaging and I'd like to know if there any good reasons for specific date/time handling.

    Read the article

  • Scoping two models on approved

    - by Shaun Frost Duke Jackson
    I have three models (Book,Snippet,User) and I'd like to create a scope for where(:approved = true) I'm doing this so I can use the merit gem to define ranking based on count of approved. I'm thinking that writing this as a scope might be to complex but I don't know as I've just started leaning scopes. I've currently got this in my Book & Snippet Model: scope :approved, -> { where(approved: true) } I've playing around with this in my user model but I don't think it's correct: scope :approved, joins(:books && :snippets) Could anyone help start me off or give me some suggestions on what to read?

    Read the article

  • how to delete all files in a folder, but not the folder itself?

    - by Frost Li
    I try to delete all files including subdirectories in a folder: NSFileManager *deleteMgr = [NSFileManager defaultManager]; NSString *path = @"~/test/"; [deleteMgr removeItemAtPath:path error:&error]; And it deletes everything including the folder itself. But what I expect is an empty folder. Could anyone please help me what did I do wrong? Really thanks your help! :)

    Read the article

  • when to use "willChangeValueForKey" and "didChangeValueForKey"?

    - by Frost Li
    I saw these lines in a demo project, but I couldn't understand why it did that. [self willChangeValueForKey:@"names"]; [self didChangeValueForKey:@"names"]; It called didChangeValueForKey immediately after willChangeeValueForKey. Does it make any sense? Furthermore, when should be the right time to call this two methods? Thanks a lot!! :)

    Read the article

  • No device file for partition on logical volume (Linux LVM)

    - by Brian
    I created a logical volume (scandata) containing a single ext3 partition. It is the only logical volume in its volume group (case4t). Said volume group is comprised by 3 physical volumes, which are three primary partitions on a single block device (/dev/sdb). When I created it, I could mount the partition via the block device /dev/mapper/case4t-scandatap1. Since last reboot the aforementioned block device file has disappeared. It may be of note -- I'm not sure -- that my superior (a college professor) had prompted this reboot by running sudo chmod -R [his name] /usr/bin, which obliterated all suid in its path, preventing the both of us from sudo-ing. That issue has been (temporarily) rectified via this operation. Now I'll cut the chatter and get started with the terminal dumps: $ sudo pvs; sudo vgs; sudo lvs Logging initialised at Sat Jan 8 11:42:34 2011 Set umask to 0077 Scanning for physical volume names PV VG Fmt Attr PSize PFree /dev/sdb1 case4t lvm2 a- 819.32G 0 /dev/sdb2 case4t lvm2 a- 866.40G 0 /dev/sdb3 case4t lvm2 a- 47.09G 0 Wiping internal VG cache Logging initialised at Sat Jan 8 11:42:34 2011 Set umask to 0077 Finding all volume groups Finding volume group "case4t" VG #PV #LV #SN Attr VSize VFree case4t 3 1 0 wz--n- 1.69T 0 Wiping internal VG cache Logging initialised at Sat Jan 8 11:42:34 2011 Set umask to 0077 Finding all logical volumes LV VG Attr LSize Origin Snap% Move Log Copy% Convert scandata case4t -wi-a- 1.69T Wiping internal VG cache $ sudo vgchange -a y Logging initialised at Sat Jan 8 11:43:14 2011 Set umask to 0077 Finding all volume groups Finding volume group "case4t" 1 logical volume(s) in volume group "case4t" already active 1 existing logical volume(s) in volume group "case4t" monitored Found volume group "case4t" Activated logical volumes in volume group "case4t" 1 logical volume(s) in volume group "case4t" now active Wiping internal VG cache $ ls /dev | grep case4t case4t $ ls /dev/mapper case4t-scandata control $ sudo fdisk -l /dev/case4t/scandata Disk /dev/case4t/scandata: 1860.5 GB, 1860584865792 bytes 255 heads, 63 sectors/track, 226203 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00049bf5 Device Boot Start End Blocks Id System /dev/case4t/scandata1 1 226203 1816975566 83 Linux $ sudo parted /dev/case4t/scandata print Model: Linux device-mapper (linear) (dm) Disk /dev/mapper/case4t-scandata: 1861GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 1861GB 1861GB primary ext3 $ sudo fdisk -l /dev/sdb Disk /dev/sdb: 1860.5 GB, 1860593254400 bytes 255 heads, 63 sectors/track, 226204 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x00000081 Device Boot Start End Blocks Id System /dev/sdb1 1 106955 859116006 83 Linux /dev/sdb2 113103 226204 908491815 83 Linux /dev/sdb3 106956 113102 49375777+ 83 Linux Partition table entries are not in disk order $ sudo parted /dev/sdb print Model: DELL PERC 6/i (scsi) Disk /dev/sdb: 1861GB Sector size (logical/physical): 512B/512B Partition Table: msdos Number Start End Size Type File system Flags 1 32.3kB 880GB 880GB primary reiserfs 3 880GB 930GB 50.6GB primary 2 930GB 1861GB 930GB primary I find it a bit strange that partition one above is said to be reiserfs, or if it matters -- it was previously reiserfs, but LVM recognizes it as a PV. To reiterate, neither /dev/mapper/case4t-scandatap1 (which I had used previously) nor /dev/case4t/scandata1 (as printed by fdisk) exists. And /dev/case4t/scandata (no partition number) cannot be mounted: $sudo mount -t ext3 /dev/case4t/scandata /mnt/new mount: wrong fs type, bad option, bad superblock on /dev/mapper/case4t-scandata, missing codepage or helper program, or other error In some cases useful info is found in syslog - try dmesg | tail or so All I get on syslog is: [170059.538137] VFS: Can't find ext3 filesystem on dev dm-0. Thanks in advance for any help you can offer, Brian P.S. I am on Ubuntu GNU/Linux 2.6.28-11-server (Jaunty) (out of date, I know -- that's on the laundry list).

    Read the article

  • Thinking Sphinx and acts_as_taggable_on plugin

    - by Brian Roisentul
    Hi, I installed Sphinx and Thinking Sphinx for ruby on rails 2.3.2. When I search without conditions search works ok. Now, what I'd like to do is filter by tags, so, as I'm using the acts_as_taggable_on plugin, my Announcement model looks like this: class Announcement < ActiveRecord::Base acts_as_taggable_on :tags,:category define_index do indexes title, :as => :title, :sortable => true indexes description, :as => :description, :sortable => true indexes tags.name, :as => :tags indexes category.name, :as => :category has category(:id), :as => :category_ids has tags(:id), :as => :tag_ids end For some reason, when I run the following command, it will bring just one announcement, that has nothing to do with what I expect. I've got many announcements, so I expected a lot of results instead. Announcement.search params[:announcement][:search].to_s, :with => {:tag_ids => 1}, :page => params[:page], :per_page => 10 I guess something is wrong, and it's not searching correctly. Can anyone give my a clue of what's going on? Thanks, Brian

    Read the article

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