Search Results

Search found 1114 results on 45 pages for 'robert gould'.

Page 27/45 | < Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >

  • Vim + OmniCppComplete and completing members of class members

    - by Robert S. Barnes
    I've noticed that I can't seem to complete members of class members using OmniCppComplete. For example, given the following files: // foo.h #include <string> class foo { public: void set_str(const std::string &); std::string get_str_reverse( void ); private: std::string str; }; // foo.cpp #include "foo.h" using std::string; string foo::get_str_reverse ( void ) { string temp; temp.assign(str); reverse(temp.begin(), temp.end()); return temp; } /* ----- end of method foo::get_str ----- */ void foo::set_str ( const string &s ) { str.assign(s); } /* ----- end of method foo::set_str ----- */ I've set up tags for stdlibc++ and generated the tags for these two files using: ctags -R --c++-kinds=+pl --fields=+iaS --extra=+q . When I type temp. in the cpp I get a list of string member functions as expected. But if I type str. omnicomplete spits out "Pattern Not Found". I've noticed that the temp. completion only works if I have the using std::string; declaration. How do I get completion to work on my class members?

    Read the article

  • parameter error in my Facebook app

    - by Robert
    I have written a small app and put it on facebook. I got an application ID and secret. Then I wrote the following script to access my app (just as told on the facebook page). <?php require './src/facebook.php'; $facebook = new Facebook(array( 'appId' => 'xxxx', 'secret' => 'xxxx', 'cookie' => true, // enable optional cookie support )); try { $me = $facebook->api('/me'); } catch (FacebookApiException $e) { error_log($e); } if ($facebook->getSession()) { echo '<a href="' . $facebook->getLogoutUrl() . '">Logout</a>'; } else { echo '<a href="' . $facebook->getLoginUrl() . '">Login</a>'; } ?> Then I started running this script. It prompted me with the login link, then took me to the facebook login page. However, after I enter my facebook login details, I get this error page: Error. API Error Code: 100 API Error Description: Invalid parameter Error Message: next is not owned by the application. Could anyone help me a little bit please, I am really confused here about what's going on.

    Read the article

  • Android animation's first frame is applied too early on ImageView

    - by Robert
    I have the following View setup in one of my Activities: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/photoLayout" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ImageView android:id="@+id/photoImageView" android:src="@drawable/backyardPhoto" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:scaleType="centerInside" android:padding="45dip" > </ImageView> </LinearLayout> Without an animation set, this displays just fine. However I want to display a very simple animation. So in my Activity's onStart override, I have the following: @Override public void onStart() { super.onStart(); mPhotoImageView = (ImageView) findViewById(R.id.photoImageView); float offset = -25; int top = mPhotoImageView.getTop(); TranslateAnimation anim1 = new TranslateAnimation( Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, top, Animation.ABSOLUTE, offset); anim1.setInterpolator(new AnticipateInterpolator()); anim1.setDuration(1500); anim1.setStartOffset(5000); TranslateAnimation anim2 = new TranslateAnimation( Animation.ABSOLUTE, 0, Animation.ABSOLUTE, 0, Animation.ABSOLUTE, offset, Animation.ABSOLUTE, top); anim2.setInterpolator(new BounceInterpolator()); anim2.setDuration(3500); anim2.setStartOffset(6500); mBouncingAnimation = new AnimationSet(false); mBouncingAnimation.addAnimation(anim1); mBouncingAnimation.addAnimation(anim2); mPhotoImageView.setAnimation(mBouncingAnimation); } The problem is that when the Activity displays for the first time, the initial position of the photo is not in the center of the screen with padding around. It seems like the first frame of the animation is loaded already. Only after the animation is completed, does the photoImageView "snap" back to the intended location. I've looked and looked and could not find how to avoid this problem. I want the photoImageView to start in the center of the screen, and then the animation to happen, and return it to the center of the screen. The animation should happen by itself without interaction from the user.

    Read the article

  • SQL syntax error

    - by Robert
    Im using Microsoft SQL Server which I think is T-SQL or ANSI SQL. I want to search a database with a string. The matches that fit the begging of the string should come first then sort alphabetically. I.e. If the table contains FOO, BAR and RAP a search for the string 'R' should yield: RAP BAR In that order. Here is my attempt: SELECT Name FROM MyTable WHERE (Name LIKE '%' + @name + '%') ORDER BY (IF(Name LIKE @name + '%',1,0)) The error message is: "must declare scalar variable @name"

    Read the article

  • What is the accepted pattern for WPF commanding in MVVM?

    - by Robert S.
    I'm working on a WPF app and I understand the command pattern pretty well, but I've found that there are several different implementations of the command pattern for MVVM. There's Josh Smith's implementation in his WPF sample app, the DelegateCommand from Prism, and the CommandBindings implementation. My question is, what is the generally accepted best practice for using commands with MVVM? My application uses Prism so DelegateCommand is available to us. The devs on my team are arguing about which approach is "best." Some don't like the numerous .cs files generated for each command, others prefer that everything be wired up via CommandBindings. I'm at a loss. Can anyone shed some light?

    Read the article

  • a java applet question

    - by Robert
    Hello there. I have a question on the java applet.I've created a java applet,which is a board game,that can have a 2*2 array with row number and column number both set to 9 by default. Now I want to extend my applet a bit,that the user can specify the size they want on the command-line,then the applet class will create an applet with correspoding size. I try to add a constructor in the applet class,but the Eclipse complains,I also tried another class,which will create an instance of this applet with size as an instance variable,but it is not working. Could anyone help me a little bit on where to put a main() method that can take care of user-specified board sized,then create an array in my applet class accordingly? Thanks a lot. Rob

    Read the article

  • Set compression level when generating a ZIP file using RubyZip

    - by Vincent Robert
    Hi, I have a Ruby program that zips a directory tree of XML files using the rubyzip gem. My problem is that the file is starting to be heavy and I would like to increase the compression level, since compression time is not an issue. I could not find in the rubyzip documentation a way to specify the compression level for the created ZIP file. Anyone know how to change this setting?

    Read the article

  • How to "escape" the JavaScript class keyword to specify a CSS class value.

    - by Robert Claypool
    C# allows a reserved word to be used as a property name via the ampersand. e.g. // In ASP.NET MVC, we use @class to define // the css class attribute for some HtmlHelper methods. var htmlObject = new { readonly = "readonly", @class = "ui-state-highlight" } I want to do the same in JavaScript. e.g. function makeGrid(grid, pager) { grid.jqGrid({ caption: 'Configurations', colNames: ['Id', 'Name'], colModel: [ { name: 'Id', index: 'Id' }, { name: 'Name', index: 'Name', editable: true, editoptions: { readonly: 'readonly', class: 'FormElement readonly' } }, ], pager: pager, url: 'www.example.com/app/configurations") %>', editurl: 'www.example.com/app/configurations/edit") %>' }).navGrid(pager, { edit: true, add: false, del: false, search: false }, {}, {}, {}); } Note class: 'FormElement readonly' is supposed to set the css class value on jqGrid's edit dialog, but IE errors out on the reserved word. Is there an escape character in JavaScript too? #class? @class? &class? Otherwise, how might I tell jqGrid to set the css class on the popup editor? Thank you.

    Read the article

  • Mercurial setup: One central repo or several?

    - by Robert S.
    My company is switching from Subversion to Mercurial. We're using .NET for our product. We have a solution with about a dozen projects that are separate modules with no dependencies on each other. We're using a central repo on a server with push/pull for our integration build. I'm trying to figure out if I should create one central repo with all the projects in it, or if I should create a separate repo for each project. One argument for separate repos is that branching the individual modules would be easier, but an argument for a single repo is easier management and workflow. I'm very new to hg and DVCS, so some guidance is greatly appreciated.

    Read the article

  • Is writing eSQL database independant or not?

    - by Robert Koritnik
    Using EF we can use LINQ to read data which is rather simple (especialy using fluent calls), but we have less control unless we write eSQL on our own. Is writing eSQL database actually data store independant code? So if we decide to change data store, can the same statements still be used? Is writing eSQL strings in your code pose any serious security threats similar to writing TSQL statements in plain strings? So we moved to SPs. Could we still mode eSQL scripts outside of code as well and use some other technique to make them a bit more secure?

    Read the article

  • strerror_r returns trash when I manually set errno during testing

    - by Robert S. Barnes
    During testing I have a mock object which sets errno = ETIMEDOUT; The object I'm testing sees the error and calls strerror_r to get back an error string: if (ret) { if (ret == EAI_SYSTEM) { char err[128]; strerror_r(errno, err, 128); err_string.assign(err); } else { err_string.assign(gai_strerror(ret)); } return ret; } I don't understand why strerror_r is returning trash. I even tried calling strerror_r(ETIMEDOUT, err, 128) directly and still got trash. I must be missing something. It seems I'm getting the gnu version of the function not the posix one, but that shouldn't make any difference in this case.

    Read the article

  • 8GB Compact Flash Corrupted, Boot Sector Lost ?

    - by robert
    I have an 8GB Kingston compact Flash, and when I insert it into my mac it says that card is unredable and ask me for initialization. If i open Utilty Disk it show a card of 2,2 TB Generic Comact Flash, if I try to initialize that it give me error: POSIX reports: impossible to allocate memory. How i can format that ? There's a way with fdisk or smt to get this card work ? Thanks

    Read the article

  • Custom DateTime model binder in Asp.net MVC

    - by Robert Koritnik
    I would like to write my own model binder for DateTime type. First of all I'd like to write a new attribute that I can attach to my model property like: [DateTimeFormat("d.M.yyyy")] public DateTime Birth { get; set,} This is the easy part. But the binder part is a bit more difficult. I would like to add a new model binder for type DateTime. I can either implement IModelBinder interface and write my own BindModel() method inherit from DefaultModelBinder and override BindModel() method My model has a property as seen above (Birth). So when the model tries to bind request data to this property, my model binder's BindModel(controllerContext, bindingContext) gets invoked. Everything ok, but. How do I get property attributes from controller/bindingContext, to parse my date correctly? How can I get to the PropertyDesciptor of property Birth? Edit Because of separation of concerns my model class is defined in an assembly that doesn't (and shouldn't) reference System.Web.MVC assembly. Setting custom binding (similar to Scott Hanselman's example) attributes is a no-go here.

    Read the article

  • Convert text file to dictionary or anonymous type object

    - by Robert Harvey
    I have a text file that looks like this: adapter 1: LPe11002 Factory IEEE: 10000000 C97A83FC Non-Volatile WWPN: 10000000 C93D6A8A , WWNN: 20000000 C93D6A8A adapter 2: LPe11002 Factory IEEE: 10000000 C97A83FD Non-Volatile WWPN: 10000000 C93D6A8B , WWNN: 20000000 C93D6A8B Is there a way to get this information into an anonymous type or dictionary object? The final anonymous type might look something like this, if it were composed in C# by hand: new { adapter1 = new { FactoryIEEE = "10000000 C97A83FC", Non-VolatileWWPN = "10000000 C93D6A8A", WWNN = "20000000 C93D6A8A" } adapter2 = new { FactoryIEEE = "10000000 C97A83FD", Non-VolatileWWPN = "10000000 C93D6A8B", WWNN = "20000000 C93D6A8B" } }

    Read the article

  • Canonical resource for forms-based design in ASP.NET MVC?

    - by Robert Harvey
    Is there a resource on the web that describes various form scenarios in ASP.NET MVC, and gives example solutions within a sensible, consistent design philosophy? Examples of such scenarios might be: One-to-many forms, like invoice data-entry forms. Foreign-table forms such as Add New User in a form that requires specifying a user Forms that require dynamic interaction, using Ajax or JSON. Popup forms Forms requiring multiple data records to be input, without postbacks. Note that there is considerable conceptual and technological overlap among these example scenarios. I am aware that there is a vast patchwork quilt of available technologies and examples out there that provide partial solutions and pieces of solutions, such as jQuery Ajax, CSS, and so forth. But I would like guidance in using these technologies in more effective and consistent ways. I am not considering web forms integration with an ASP.NET MVC application; I would still like my applications to be pure MVC. Nor am I, at the moment, considering a paid solution like Telerik. But I would like to know if someone has already done some of the work combining these technologies into a consistent, cohesive whole, that follows a sensible design philosophy. (an open source framework, perhaps?)

    Read the article

  • What is the motivation behind "Use Extension Methods Sparingly?"

    - by Robert Harvey
    I find them a very natural way to extend existing classes, especially when you just need to "spot-weld" some functionality onto an existing class. Microsoft says, "In general, we recommend that you implement extension methods sparingly and only when you have to." And yet extension methods form the foundation of Linq; in fact, Linq was the reason extension methods were created. Are there specific design criteria where using extension methods are perferred over inheritance or composition? Under what criteria are they discouraged?

    Read the article

  • SQL Server CE 3.5 SP1 Stored Procedures

    - by Robert
    I have been tasked with taking an existing WinForms application and modifying it to work in an "occasionally-connected" mode. This was to be achieved with SQL Server CE 3.5 on a user's laptop and sync the server and client either via SQL Server Merge Replication or utilizing Microsoft's Sync Framework. Currently, the application connects to our SQL Server and retrieves, inserts, updates data using stored procedures. I have read that SQL Server CE does not support stored procedures. Does this mean that all my stored procedures will need to be converted to straight SQL statements, either in my code or as a query inside a tableadapter? If this is true, what are my alternatives?

    Read the article

  • Table with a lot of attributes

    - by Robert
    Hi, I'm planing to build some database project. One of the tables have a lot of attributes. My question is: What is better, to divide the the class into 2 separate tables or put all of them into one table. below is an example create table User { id, name, surname,... show_name, show_photos, ...) or create table User { id, name, surname,... ) create table UserPrivacy {usr_id, show_name, show_photos, ...) The performance i suppose is similar due to i can use index.

    Read the article

  • WinUSB application or User-Mode Driver as a filter driver for USB Analysis/Sniffer/Trending

    - by Robert
    A question to maybe some who have worked extensively with WinUSB APIs or use mode USB drivers - Does anyone know if the WinUSB API or a user mode driver can be used as a passive observer of USB connections, capturing notification of interrupts, control requests, data transfers...etc without interfering with other applications (such as iTunes) which would obviously require concurrent access to the device at the same time my application is monitoring the connection and displaying data on it? Or do you pretty much have to write a kernel-mode filter driver and inject yourself in the USB stack in order to make that happen? In the past, there have been a few credible options (libusb-win32 and usbsnoop to be specific) though both are built around the old DDK, not the Windows Driver Foundation, and are not really supported on a regular basis any more. I'm hesitant to build something significant around them, as a result.

    Read the article

  • What's the most unsound program you've had to maintain?

    - by Robert Rossney
    I periodically am called upon to do maintenance work on a system that was built by a real rocket surgeon. There's so much wrong with it that it's hard to know where to start. No, wait, I'll start at the beginning: in the early days of the project, the designer was told that the system would need to scale, and he'd read that a source of scalability problems was traffic between the application and database servers, so he made sure to minimize this traffic. How? By putting all of the application logic in SQL Server stored procedures. Seriously. The great bulk of the application functions by the HTML front end formulating XML messages. When the middle tier receives an XML message, it uses the document element's tag name as the name of the stored procedure it should call, and calls the SP, passing it the entire XML message as a parameter. It takes the XML message that the SP returns and returns it directly back to the front end. There is no other logic in the application tier. (There was some code in the middle tier to validate the incoming XML messages against a library of schemas. But I removed it, after ascertaining that 1) only a small handful of messages had corresponding schemas, 2) the messages didn't actually conform to these schemas, and 3) after validating the messages, if any errors were encountered, the method discarded them. "This fuse box is a real time-saver - it comes from the factory with pennies pre-installed!") I've seen software that does the wrong thing before. Lots of it. I've written quite a bit. But I've never seen anything like the steely-eyed determination to do the wrong thing, at every possible turn, that's embodied in the design and programming of this system. Well, at least he went with what he knew, right? Um. Apparently, what he knew was Access. And he didn't really understand Access. Or databases. Here's a common pattern in this code: SELECT @TestCodeID FROM TestCode WHERE TestCode = @TestCode SELECT @CountryID FROM Country WHERE CountryAbbr = @CountryAbbr SELECT Invoice.*, TestCode.*, Country.* FROM Invoice JOIN TestCode ON Invoice.TestCodeID = TestCode.ID JOIN Country ON Invoice.CountryID = Country.ID WHERE Invoice.TestCodeID = @TestCodeID AND Invoice.CountryID = @CountryID Okay, fine. You don't trust the query optimizer either. But how about this? (Originally, I was going to post this in What's the best comment in source code you have ever encountered? but I realized that there was so much more to write about than just this one comment, and things just got out of hand.) At the end of many of the utility stored procedures, you'll see code that looks like the following: -- Fix NULLs SET @TargetValue = ISNULL(@TargetValue, -9999) Yes, that code is doing exactly what you can't allow yourself to believe it's doing lest you be driven mad. If the variable contains a NULL, he's alerting the caller by changing its value to -9999. Here's how this number is commonly used: -- Get target value EXEC ap_GetTargetValue @Param1, @Param2, OUTPUT @TargetValue -- Check target value for NULL value IF @TargetValue = -9999 ... Really. For another dimension of this system, see the article on thedailywtf.com entitled I Think I'll Call Them "Transactions". I'm not making any of this up. I swear. I'm often reminded, when I work on this system, of Wolfgang Pauli's famous response to a student: "That isn't right. It isn't even wrong." This can't really be the very worst program ever. It's definitely the worst one I've worked

    Read the article

  • Apache Tuscany 1.6 How do you set the JMS Binding Delivery Mode to NON_PERSISTENT?

    - by Robert Greiner
    I am using Tuscany 1.6 and am trying to set the Delivery Mode JMS Binding to NON_PERSISTENT. I've tried using uri="jms:MyService?deliveryMode=1" (which is what the spec (PDF) says to do) but, I ended up getting the following exception: Unknown token deliveryMode=1 I also tried <headers JMSDeliveryMode="NON_PERSISTENT"/>, although I did not get an exception the messages still got delivered as PERSISTENT. This is the format for the URI jms:<jms-dest>? connectionFactoryName=<Connection-Factory-Name> & destinationType={queue|topic} deliveryMode=<Delivery-Mode> & timeToLive=<Time-To-Live> & priority=<Priority> & <User-Property>=<User-Property-Value> & … This is the example I am using <composite xmlns="http://www.osoa.org/xmlns/sca/1.0" name="MyValueComposite"> <service name="MyValueService"> <interface.java interface="services.myvalue.MyValueService"/> <binding.jms uri="jms:MyValueServiceQueue?activationSpecName=MyValueServiceAS&... "/> </service> <reference name="StockQuoteService"> <interface.java interface="services.stockquote.StockQuoteService"/> <binding.jms uri="jms:StockQuoteServiceQueue?connectionFactoryName=StockQuoteServiceQCF&deliveryMode=1&... "/> </reference> </composite>

    Read the article

  • Drawing Directed Acyclic Graphs: Minimizing edge crossing?

    - by Robert Fraser
    Laying out the verticies in a DAG in a tree form (i.e. verticies with no in-edges on top, verticies dependent only on those on the next level, etc.) is rather simple without graph drawing algorithms such as Efficient Sugimiya. However, is there a simple algorithm to do this that minimizes edge crossing? (For some graphs, it may be impossible to completely eliminate edge crossing.) A picture says a thousand words, so is there an algorithm that would suggest: instead of: EDIT: As the picture suggests, a vertex's inputs are always on top and outputs are always below, which is another barrier to just pasting in an existing layout algorithm.

    Read the article

  • Limit Connections with semaphores

    - by Robert
    I'm trying to limit the number of connections my server will accept using semaphores, but when running, my code doesn't seem to make this restriction - am I using the semaphore correctly? eg. I have hardcoded the number of permit as 2, but I can connect an unlimited number of clients... public class EServer implements Runnable { private ServerSocket serverSocket; private int numberofConnections = 0; private Semaphore sem = new Semaphore(2); private volatile boolean keepProcessing = true; public EServer(int port) throws IOException { serverSocket = new ServerSocket(port); } @Override public void run() { while (keepProcessing) { try { sem.acquire(); Socket socket = serverSocket.accept(); process(socket, getNextConnectionNumber()); } catch (Exception e) { } finally { sem.release(); } } closeIgnoringException(serverSocket); } private synchronized int getNextConnectionNumber() { return ++numberofConnections; } // processing related methods }

    Read the article

< Previous Page | 23 24 25 26 27 28 29 30 31 32 33 34  | Next Page >