Search Results

Search found 1456 results on 59 pages for 'brian carroll'.

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

  • Ruby ROXML - how to get an array to render its xml?

    - by Brian D.
    I'm trying to create a Messages object that inherits Array. The messages will gather a group of Message objects. I'm trying to create an xml output with ROXML that looks like this: <messages> <message> <type></type> <code></code> <body></body> </message> ... </messages> However, I can't figure out how to get the message objects in the Messages object to display in the xml. Here is the code I've been working with: require 'roxml' class Message include ROXML xml_accessor :type xml_accessor :code xml_accessor :body end class Messages < Array include ROXML # I think this is the problem - but how do I tell ROXML that # the messages are in this instance of array? xml_accessor :messages, :as => [Message] def add(message) self << message end end message = Message.new message.type = "error" message.code = "1234" message.body = "This is a test message." messages = Messages.new messages.add message puts messages.length puts messages.to_xml This outputs: 1 <messages/> So, the message object I added to messages isn't getting displayed. Anyone have any ideas? Or am I going about this the wrong way? Thanks for any help.

    Read the article

  • C++ smart pointer for non-object type?

    - by Brian
    Hi, I'm trying to use smart pointers such as auto_ptr, shared_ptr. However, I don't know how to use it in this situation. CvMemStorage *storage = cvCreateMemStorage(); ... use the pointer ... cvReleaseMemStorage(&storage); I'm not sure, but I think that the storage variable is just malloc'ed memory, not object. Is there a way to use the smart pointers for the storage variable? Thank you.

    Read the article

  • What is the proper way to specify a path to 'app' in a Rails plugin?

    - by Brian Deterling
    This question came about because the cells gem specifies template directories using File.join('app','cells'). That works fine until you run Rails as a daemon (scripts/server -d). The daemon switches directories to / which leaves the cells template paths pointing to the wrong absolute path. My solution was to set the default paths to File.join(RAILS_ROOT, 'app', 'cells'). This works in Rails, but the unit tests for the plugin fail because RAILS_ROOT isn't defined. Using File.join(File.dirname(__FILE__),'..' ... also works but requires about 6 levels of '..' which seems wrong. So my question is what is the proper way to specify the path to a directory under 'app' in a Rails plugin? Or is there something else wrong that would cause daemonizing Rails to fail to find the relative paths?

    Read the article

  • Rails Asset Caching Breaks First few page loads

    - by Brian Armstrong
    We're using Rails asset caching for JS and CSS like this: <%= javascript_include_tag :defaults, 'autocomplete', 'searchbox', 'jqmodal', :cache => set_asset_cache(:admins) %> In our deploy we call rake tmp:assets:clear each time. The problem is that the first few page loads after a deploy come up with no css on the page. I guess until the cached all.js and all.css have been regenerated. We deploy many times per day and this is scary for any users who happen to come across a busted page. Have people found any way to make this smoother so the new cached assets are guaranteed to be there on the first new page load?

    Read the article

  • how to add WHERE clause to Query on android

    - by Brian
    I would like to limit the results to those whose KEY_HOMEID is equal to journalId. I've been on this for a couple days any help would be appreciated. public Cursor fetchAllNotes(String journalId) { return mDb.query(DATABASE_TABLE, new String[] {KEY_ROWID, KEY_HEIGHT, KEY_BODY, KEY_HOMEID},"FROM DATABASE_TABLE WHERE KEY_HOMEID = journalId",null, null, null, null,null); }

    Read the article

  • Javascript function using "this = " gives "Invalid left-hand side in assignment"

    - by Brian M. Hunt
    I am trying to get a Javascript object to use the "this" assignments of another objects' constructor, as well as assume all that objects' prototype functions. Here's an example of what I'm attempting to accomplish: /* The base - contains assignments to 'this', and prototype functions */ function ObjX(a,b) { this.$a = a, $b = b; } ObjX.prototype.getB() { return this.$b; } function ObjY(a,b,c) { // here's what I'm thinking should work: this = ObjX(a, b * 12); /* and by 'work' I mean ObjY should have the following properties: * ObjY.$a == a, ObjY.$b == b * 12, * and ObjY.getB() == ObjX.prototype.getB() * ... unfortunately I get the error: * Uncaught ReferenceError: Invalid left-hand side in assignment */ this.$c = c; // just to further distinguish ObjY from ObjX. } I'd be grateful for your thoughts on how to have ObjY subsume ObjX's assignments to 'this' (i.e. not have to repeat all the this.$* = * assignments in ObjY's constructor) and have ObjY assume ObjX.prototype. My first thought is to try the following: function ObjY(a,b,c) { this.prototype = new ObjX(a,b*12); } Ideally I'd like to learn how to do this in a prototypal way (i.e. not have to use any of those 'classic' OOP substitutes like Base2). It may be noteworthy that ObjY will be anonymous (e.g. factory['ObjX'] = function(a,b,c) { this = ObjX(a,b*12); ... }) -- if I've the terminology right. Thank you.

    Read the article

  • Transport Security with Certificate Authentication

    - by Brian T
    I'm getting the following error when I access my webservice localhost/MyService/MyService.svc The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'Ssl, SslNegotiateCert'. I've following the web.config examples as specified in http://msdn.microsoft.com/en-us/library/ms731074.aspx Here is my wcf server web.config: <?xml version="1.0" encoding="UTF-8"?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <appSettings /> <system.web> <identity impersonate="false" /> <roleManager enabled="true" /> <authentication mode="Windows" /> <customErrors mode="Off" /> <webServices> <protocols> <add name="HttpGet" /> <add name="HttpPost" /> </protocols> </webServices> </system.web> <system.webServer> <directoryBrowse enabled="true" /> <validation validateIntegratedModeConfiguration="false" /> <security> <authorization> <remove users="*" roles="" verbs="" /> <add accessType="Allow" users="*" roles="" /> </authorization> </security> </system.webServer> <system.serviceModel> <services> <service name="AspNetSqlProviderService" behaviorConfiguration="MyServiceBehavior"> <endpoint binding="wsHttpBinding" contract="Interface1" bindingConfiguration="CertificateWithTransportWSHttpBinding" /> <endpoint binding="wsHttpBinding" contract="Interface2" bindingConfiguration="CertificateWithTransportWSHttpBinding" /> <endpoint address="mex" binding="wsHttpBinding" bindingConfiguration="CertificateWithTransportWSHttpBinding" name="Metadata_Exchange" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MyServiceBehavior"> <serviceDebug includeExceptionDetailInFaults="True" /> <serviceMetadata /> <serviceCredentials> <clientCertificate> <authentication trustedStoreLocation="LocalMachine" revocationMode="Online"/> </clientCertificate> </serviceCredentials> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="CertificateWithTransportWSHttpBinding"> <security mode="Transport"> <transport clientCredentialType="Certificate" /> </security> </binding> </wsHttpBinding> </bindings> </system.serviceModel> </configuration> I've configured IIS as follows: https binding added using self signed certificate Under SSL settings, require SSL and accept client certificates is checked The self signed certificate has been added to the Local Computer Trusted Root CA. I can browse and execute the .asmx service definition, but the .svc gives me the error described above.

    Read the article

  • PHP + MYSQLI: Variable parameter/result binding with prepared statements.

    - by Brian Warshaw
    In a project that I'm about to wrap up, I've written and implemented an object-relational mapping solution for PHP. Before the doubters and dreamers cry out "how on earth?", relax -- I haven't found a way to make late static binding work -- I'm just working around it in the best way that I possibly can. Anyway, I'm not currently using prepared statements for querying, because I couldn't come up with a way to pass a variable number of arguments to the bind_params() or bind_result() methods. Why do I need to support a variable number of arguments, you ask? Because the superclass of my models (think of my solution as a hacked-up PHP ActiveRecord wannabe) is where the querying is defined, and so the find() method, for example, doesn't know how many parameters it would need to bind. Now, I've already thought of building an argument list and passing a string to eval(), but I don't like that solution very much -- I'd rather just implement my own security checks and pass on statements. Does anyone have any suggestions (or success stories) about how to get this done? If you can help me solve this first problem, perhaps we can tackle binding the result set (something I suspect will be more difficult, or at least more resource-intensive if it involves an initial query to determine table structure).

    Read the article

  • Create a jQueryUI 1.8 Button menu

    - by Brian M. Hunt
    Now that jQueryUI 1.8 is out, I was browsing through the updates and came across the new Button widget, and in particular one of the demos with the SplitButton with a dropdown. This demo seems to suggest that the Button widget could be used to create a dropdown menu here. As a matter of discussion, I was wondering what ways there are to go about creating a dropdown menu with this new Button widget. Cheers.

    Read the article

  • How do I get user input into a PackageMaker package?

    - by Brian Postow
    I'm trying to create an install package. I've got all my components, and I think I understand most of the process. I want to have an install/set-up script that is run as part of the install. I planned to put it either as a post-install action or a post-install script. The problem is that I need user-input. I can't figure out how to either get user input into the script, or how to add a page in the install UI that has a place for user input and then pass that on to the script. I guess, I could write an apple-script with a dialog to ask the question, and then pass that information on to my shell script (or, write the whole thing in the applescript) but that seems unnecessarily complicated... Is there a normal way to do this? Thanks

    Read the article

  • Creating an application that can open files of a given format

    - by Brian Postow
    I've got an app, written in Obj-C. The info.plist has a list of file types that the app can open. I'm pretty sure that this is working because when I try to drag a file of an unacceptable type, the app doesn't highlight, but when I drag a file of an acceptable type, it does highlight, and lets me drop. When I drop, the app starts up, correctly, however, then I get a dialog saying: The document "foo.tiff" could not be opened. DocView cannot open files in the "TIFF File" format. I DO have this in my info.plist <key>CFBundleTypeExtensions</key> <array> <string>tif</string> <string>tiff</string> </array> <key>CFBundleTypeIconFile</key> <string>TIFFFile.icns</string> <key>CFBundleTypeName</key> <string>TIFF File</string> <key>CFBundleTypeOSTypes</key> <array> <string>TIFF</string> </array> <key>CFBundleTypeRole</key> <string>Viewer</string> <key>LSHandlerRank</key> <string>Documents/</string> Thanks.

    Read the article

  • How can I convert arbitrary strings to CLS-Compliant names?

    - by Brian Hinchey
    Does anyone know of an algorithm (or external library) that I could call to convert an arbitrary string (i.e. outside my control) to be CLS compliant? I am generating a dynamic RDLC (Client Report Definition) for an ASP.Net Report Viewer control and some of the field names need to be based on strings entered by the user. Unfortunately I have little control over the entry of the field names by the client (through a 3rd party CMS). But I am quite flexible around substitutions required to create the compliant string. I have a reactive hack algorithm for now along the lines of: public static string FormatForDynamicRdlc(this string s) { //We need to change this string to be CLS compliant. return s.Replace(Environment.NewLine, string.Empty) .Replace("\t", string.Empty) .Replace(",", string.Empty) .Replace("-", "_") .Replace(" ", "_"); } But I would love something more comprehensive. Any ideas? NOTE: If it is of any help, the algorithm I am using to create the dynamic RDLC is based on the BuildRDLC method found here: http://csharpshooter.blogspot.com/2007/08/revised-dynamic-rdlc-generation.html

    Read the article

  • Does a System.Collection.Collection<T> wrap a IList<T> or enumerate over the IList<T> or simply wra

    - by Brian Triplett
    If I am exposing a internal member via a Collection property via: public Collection<T> Entries { get { return new Collection<T>(this.fieldImplimentingIList<T>); } } When this property is called what happens? For example what happens when the following lines of code are called: T test = instanceOfAbove.Entries[i]; instanceOfAbove[i] = valueOfTypeT; It's clear that each time this property is called a new reference type is created but what acctually happens? Does it simply wrap the IList<T> underneath, does it enumerate over the IList<T> and to create a new Collection<T> instance? I'm concerned about performance if this property is used in a for loop.

    Read the article

  • Javascript iframe caching issue

    - by Brian
    I hava an iframe which loads some javascript via javascript. In internet explorer only, this works if and only if IE has a cached copy of the javascript. This means that reloading the page (or otherwise triggering the script to run again, if it's stuck in a function or whatever) will cause this code to work, otherwise it will not. In particular, the document.write call fails to happen. Main Page: <iframe height = "200" width = "200" id = "happy"> </iframe> <script type="text/javascript"> var a = document.getElementById("happy"); scripttxt = '<a href="#" id="joy">JOY</a><'+'script type="text/javascript" src="fail.js"></'+'script>'; a.src = "about:blank"; a.contentWindow.document.open(); a.contentWindow.document.write("<h3>Preview:</h3>" + scripttxt + ""); a.contentWindow.document.close(); </script> fail.js: document.write(document.getElementById("joy")); I realize I could use conditional comments to have IE skip document.open() and document.close() in the script of Main Page, but having IE skip document.open() and document.close() feels a bit hacky (Edit)...and breaks other things in IE.

    Read the article

  • XCode: compiling doesn't always replace plist?

    - by Brian Postow
    I have an application and I will sometimes just change the plist, say to change the version number. Sometimes I'll actually make a change to the code, AND the version number....in the latter case, SOMETIMES the version number of the resulting app will change, in the former it will never change. The only way I've found that surely does it right is when I delete the .app before compiling. In case it matters, the resulting app is being put in a folder that isn't in the build folder, but I doubt that that's relevant. any thoughts?

    Read the article

  • Joins and subqueries in LINQ

    - by Brian
    I am trying to do a join with a sub query and can't seem to get it. Here is what is looks like working in sql. How do I get to to work in linq? SELECT po.*, p.PermissionID FROM PermissibleObjects po INNER JOIN PermissibleObjects_Permissions po_p ON (po.PermissibleObjectID = po_p.PermissibleObjectID) INNER JOIN Permissions p ON (po_p.PermissionID = p.PermissionID) LEFT OUTER JOIN ( SELECT u_po.PermissionID, u_po.PermissibleObjectID FROM Users_PermissibleObjects u_po WHERE u_po.UserID = '2F160457-7355-4B59-861F-9871A45FD166' ) used ON (p.PermissionID = used.PermissionID AND po.PermissibleObjectID = used.PermissibleObjectID) WHERE used.PermissionID is null

    Read the article

  • What sql server isolation level should I choose to prevent concurrent reads?

    - by Brian Bolton
    I have the following transaction: SQL inserts a 1 new record into a table called tbl_document SQL deletes all records matching a criteria in another table called tbl_attachment SQL inserts multiple records into the tbl_attachment Until this transaction finishes, I don't want others users to be aware of the (1) new records in tbl_document, (2) deleted records in tbl_attachment, and (3) modified records in tbl_attachment. Would Read Committed Isolation be the correct isolation level?

    Read the article

  • Unable to connect to sql database only from asp

    - by Brian
    In a VB6 program: Dim conn As Object Set conn = CreateObject("ADODB.Connection") conn.Open "DRIVER={SQL Server}; Server=(local)\aaa; Database=bbb; UID=ccc; PWD=ddd" In an ASP program: Sub ProcessSqlServer(conn) Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DRIVER={SQL Server}; Server=(local)\aaa; Database=bbb; UID=ccc; PWD=ddd" The VB6 program works, the ASP program does not (see error below). I tried checking the event log for errors, but found nothing. Or more precisely, I did find local an activation permission error, but this was fixed once I added local launch/activation permission for Network Service to the Machine Debug Manager via the component services tool. Error: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC SQL Server Driver]Timeout expired

    Read the article

  • Third party multipart request in playframework

    - by Brian
    I'm making an application to post photos to yfrog and twitpic and I am having a little trouble figuring out how to set the parameters. Here is my code: public static Result index() { HttpClient httpclient = new DefaultHttpClient(); WSRequestHolder holder = WS.url("http://api.twitpic.com/2/upload.json"); holder.setHeader("Authorization", ""); return async(holder.post("").map(new Function<WS.Response, Result>() { public Result apply(WS.Response response) { return ok(response.getBody()); } })); } Now, I don't expect this to actually get an ok response from the server, as I am just testing the responses that I get back from the server, and that is one that says I need to provide the api key. I figured as much, but I'm not sure of the syntax for providing that parameter, as I need to also give the name of the file and the file. I tried setting holder.post("key=somekey"), with the hope that I would get a different error message (like the key you provided is invalid) but I just get the same error. I'm assuming that I probably need to send it in the for of a multipart request, but I am not very experienced with this kind of request and can't find any play documentation on how to create a multipart request, other than in an html form. Any suggestions and help will be much appreciated. And fyi, I do know that there are yfrog and twitpic java classes to handle this kind of stuff, but I want to do it myself, more so for learning how to do this kind of stuff. Thanks in advance!

    Read the article

  • Scala: Matching optional Regular Expression groups

    - by Brian Heylin
    I'm trying to match on an option group in Scala 2.8 (beta 1) with the following code: import scala.xml._ val StatementPattern = """([\w\.]+)\s*:\s*([+-])?(\d+)""".r def buildProperty(input: String): Node = input match { case StatementPattern(name, value) => <propertyWithoutSign /> case StatementPattern(name, sign, value) => <propertyWithSign /> } val withSign = "property.name: +10" val withoutSign = "property.name: 10" buildProperty(withSign) // <propertyWithSign></propertyWithSign> buildProperty(withoutSign) // <propertyWithSign></propertyWithSign> But this is not working. What is the correct way to match optional regex groups?

    Read the article

  • Looking to eventually build a smartphone app...

    - by Brian L
    Hi all- I'm a young, inexperienced programmer (I've had a year of Java, some MATLAB, and HTML/CSS in school) but I've decided that to get better, I'm making it my goal to produce a simple smartphone app of some kind this year- probably either webOS or Android since I'm on a PC and can't afford a Mac just to write an iPhone app. So my question is, where do I start? I've read the threads about How to Write for Android and such, but I'm not sure I have enough Java experience to just jump right in. And then there's webOS which is based on JavaScript, correct? I guess I'd just like some input from more experienced folks. I have some Barnes and Noble book credit I'm looking to get rid of too, so if there's a guide you think would be useful, feel free to request. tl;dr: Programming newbie ultimately wants to build a simple smartphone app. Where do I start?

    Read the article

  • Expression Blend doesn't recognize command objects declared in code behind file

    - by Brian Ensink
    I have a WPF UserControl. The code behind file declares some RoutedUICommand objects which are referenced in the XAML. The application builds and runs just fine. However Expression Blend 3 cannot load the XAML in the designer and gives errors like this one: The member "ResetCameraCommand" is not recognized or accessible. The class and the member are both public. Building and rebuilding the project in Blend and restarting Blend hasn't helped. Any ideas what the problem is? Here are fragments of my XAML ... <UserControl x:Class="CAP.Visual.CameraAndLightingControl" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:CAP.Visual;assembly=VisualApp" Height="100" Width="700"> <UserControl.CommandBindings> <CommandBinding Command="local:CameraAndLightingControl.ResetCameraCommand" Executed="ResetCamera_Executed" CanExecute="ResetCamera_CanExecute"/> </UserControl.CommandBindings> .... ... and the code behind C# namespace CAP.Visual { public partial class CameraAndLightingControl : UserControl { public readonly static RoutedUICommand ResetCameraCommand; static CameraAndLightingControl() { ResetCameraCommand = new RoutedUICommand("Reset Camera", "ResetCamera", typeof(CameraAndLightingControl)); }

    Read the article

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