Search Results

Search found 658 results on 27 pages for 'kyle macfarlane'.

Page 20/27 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Hidden limitations of Google App Engine?

    - by Kyle Cronin
    I've been looking into writing a web app that will run on Google App Engine, but before I commit myself to the platform I'd like to know what, if any, limitations there are. I'm aware of the basic CPU/bandwidth restrictions that Google places on the free service, but I'm wondering more about development restrictions like how BigTable compares to a standard relational database and what Python libraries aren't available on the GAE platform (and what alternatives Google provides). Basically I'm looking for any hidden roadblocks before I commit to the platform. Thanks for your help!

    Read the article

  • How do I write an RSpec test to unit-test this interesting metaprogramming code?

    - by Kyle Kaitan
    Here's some simple code that, for each argument specified, will add specific get/set methods named after that argument. If you write attr_option :foo, :bar, then you will see #foo/foo= and #bar/bar= instance methods on Config: module Configurator class Config def initialize() @options = {} end def self.attr_option(*args) args.each do |a| if not self.method_defined?(a) define_method "#{a}" do @options[:"#{a}"] ||= {} end define_method "#{a}=" do |v| @options[:"#{a}"] = v end else throw Exception.new("already have attr_option for #{a}") end end end end end So far, so good. I want to write some RSpec tests to verify this code is actually doing what it's supposed to. But there's a problem! If I invoke attr_option :foo in one of the test methods, that method is now forever defined in Config. So a subsequent test will fail when it shouldn't, because foo is already defined: it "should support a specified option" do c = Configurator::Config c.attr_option :foo # ... end it "should support multiple options" do c = Configurator::Config c.attr_option :foo, :bar, :baz # Error! :foo already defined # by a previous test. # ... end Is there a way I can give each test an anonymous "clone" of the Config class which is independent of the others?

    Read the article

  • Bash variable kills script execusion

    - by Kyle Terry
    Sorry if this is better suited at serverfault, but I think it learns more towards the programming side of things. I have some code that's going into /etc/rc.local to detect what type of touch screen monitor is plugged in and changes out the xorg.conf before launching X. Here is a small snippet: CURRENT_MONITOR=`ls /dev/usb | grep 'egalax_touch\|quanta_touch'` case $CURRENT_MONITOR in '') CURRENT_MONITOR='none' ;; esac If one of those two touch screens is plugged in, it works just fine. If any other monitor is plugged in, it stops at the "CURRENT_MONITOR=ls /dev/usb | grep 'egalax_touch\|quanta_touch'." For testing I touched two files. One before creating CURRENT_MONITOR and one after CURRENT_MONITOR and only file touched before is created. I'm not a bash programmer so this might be something very obvious.

    Read the article

  • jQuery add border to table.

    - by Kyle Sevenoaks
    Hi, I'm a jQuery noob, I tried this: <input value="1" type="checkbox" name="mytable" id="checkbox2" style="float:left;" /> {literal} <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(function() { //checkbox $(".mytable").click(function(){ $(".mytable").toggleClass('mytableborders'); }); }); </script> {/literal} <table class="mytable" id="cart">....</table> But it doesn't work, I want the checkbox to change the class of the table from .mytable to .mytableborders. Thanks :)

    Read the article

  • HTML Select, force direction down.

    - by Kyle Sevenoaks
    Is there a way to force the dropdown direction of a select element in HTML down? At the moment we have a product display page, the select box appears below the halfway mark of the screen in a widescreen resolution and therefore makes the dropdown go up. Is this possible? Thanks.

    Read the article

  • .NET WebService IPC - Should it be done to minimise some expensive operations?

    - by Kyle
    I'm looking at a few different approaches to a problem: Client requests work, some stuff gets done, and a result (ok/error) is returned. A .NET web service definitely seems like the way to go, my only issue is that the "stuff" will involve building up and tearing down a session for each request. Does abstracting the "stuff" out to an app (which would keep a single session active, and process the request from the web service) seem like the right way to go? (and if so, what communication method) The work time is negligible, my concern is the hammering the transaction servers in question will probably get if I create/drop a session for each job. Is some form of IPC or socket based communication a feasible solution here? Thoughts/comments/experiences much appreciated. Edit: After a bit more research, it seems like hosting a WCF service in a Windows Service is probably a better way to go...

    Read the article

  • Why does GCC need extra declarations in templates when VS does not?

    - by Kyle
    template<typename T> class Base { protected: Base() {} T& get() { return t; } T t; }; template<typename T> class Derived : public Base<T> { public: Base<T>::get; // Line A Base<T>::t; // Line B void foo() { t = 4; get(); } }; int main() { return 0; } If I comment out lines A and B, this code compiles fine under Visual Studio 2008. Yet when I compile under GCC 4.1 with lines A and B commented, I get these errors: In member function ‘void TemplateDerived::foo()’: error: ‘t’ was not declared in this scope error: there are no arguments to ‘get’ that depend on a template parameter, so a declaration of ‘get’ must be available Why would one compiler require lines A and B while the other doesn't? Is there a way to simplify this? In other words, if derived classes use 20 things from the base class, I have to put 20 lines of declarations for every class deriving from Base! Is there a way around this that doesn't require so many declarations?

    Read the article

  • How to use boost::fusion::transform on heterogeneous containers?

    - by Kyle
    Boost.org's example given for fusion::transform is as follows: struct triple { typedef int result_type; int operator()(int t) const { return t * 3; }; }; // ... assert(transform(make_vector(1,2,3), triple()) == make_vector(3,6,9)); Yet I'm not "getting it." The vector in their example contains elements all of the same type, but a major point of using fusion is containers of heterogeneous types. What if they had used make_vector(1, 'a', "howdy") instead? int operator()(int t) would need to become template<typename T> T& operator()(T& const t) But how would I write the result_type? template<typename T> typedef T& result_type certainly isn't valid syntax, and it wouldn't make sense even if it was, because it's not tied to the function.

    Read the article

  • Bash variable kills script execution

    - by Kyle Terry
    Sorry if this is better suited at serverfault, but I think it learns more towards the programming side of things. I have some code that's going into /etc/rc.local to detect what type of touch screen monitor is plugged in and changes out the xorg.conf before launching X. Here is a small snippet: CURRENT_MONITOR=`ls /dev/usb | grep 'egalax_touch\|quanta_touch'` case $CURRENT_MONITOR in '') CURRENT_MONITOR='none' ;; esac If one of those two touch screens is plugged in, it works just fine. If any other monitor is plugged in, it stops at the "CURRENT_MONITOR=ls /dev/usb | grep 'egalax_touch\|quanta_touch'." For testing I touched two files. One before creating CURRENT_MONITOR and one after CURRENT_MONITOR and only file touched before is created. I'm not a bash programmer so this might be something very obvious.

    Read the article

  • Android Camera intent creating two files

    - by Kyle Ramstad
    I am making a program that takes a picture and then shows it's thumbnail. When using the emulator all goes well and the discard button deletes the photo. But on a real device the camera intent saves the image at the imageUri variable and a second one that is named like if I had just opened up the camera and took a picture by itself. private static final int CAMERA_PIC_REQUEST = 1337; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camera); //start camera values = new ContentValues(); values.put(MediaStore.Images.Media.TITLE, "New Picture"); values.put(MediaStore.Images.Media.DESCRIPTION,"From your Camera"); imageUri = getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, values); image = (ImageView) findViewById(R.id.ImageView01); Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri); startActivityForResult(intent, CAMERA_PIC_REQUEST); //save the image buttons Button save = (Button) findViewById(R.id.Button01); Button close = (Button) findViewById(R.id.Button02); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == CAMERA_PIC_REQUEST && resultCode == RESULT_OK) { try{ thumbnail = MediaStore.Images.Media.getBitmap(getContentResolver(), imageUri); image.setImageBitmap(thumbnail); } catch(Exception e){ e.printStackTrace(); } } else{ finish(); } } public void myClickHandler(View view) { switch (view.getId()) { case R.id.Button01: finish(); break; case R.id.Button02: dicard(); } } private void dicard(){ getContentResolver().delete(imageUri, null, null); finish(); }

    Read the article

  • Where can I find boost::fusion articles, examples, guides, tutorials?

    - by Kyle
    I am going to go ahead and shamelessly duplicate this question because the accepted answer is essentially "nope, no guides" and it's been nearly a year now since it's been asked. Does anyone know of any useful articles, guides, tutorials, etc. for boost::fusion besides the barebones documentation on boost.org? (which I'm sure is great as a reference after one has learned the library.) I'm completely open to, say, a link to a book on Amazon. Searched for it myself just now but all I came up with was green tea. The top links on Google aren't much better.

    Read the article

  • Smarty iteration: is there a similar function when not in a foreach loop?

    - by Kyle Sevenoaks
    Hi, I'm trying to add a JS fly to basket plugin to the site I'm working on, but the plugin needs unique productID numbers, is there a way to iterate this in Smarty when not in a foreach loop? Something like: {$smarty.foreach.foo.iteration} Here's the code I need to itrate: <span id="slidingProd57404045"> <a href="{link controller=order action=addToCart id=$product.ID returnPath=true}" rel="nofollow" class="addToCart" title="Bestill" onclick="addToBasket(57404045); return false;" id="fly_to_basket">&nbsp;</a> </span> The 57404045 needs to be iterated. Thanks.

    Read the article

  • OpenGL ES 2.0 Rendering with a Texture

    - by Kyle
    The iPhone SDK has an example of using ES 2.0 with a set of (Vertex & Fragment) GLSL shaders to render a varying colored box. Is there an example out there on how to render a simple texture using this API? I basically want to take a quad, and draw a texture onto it. The old ES 1.1 API's don't work at all anymore, so I'm needing a bit of help getting started. Most shader references talk mainly about advanced shading topics, but I'm really unsure about how to tell the shader to use the bound texture, and how to reference the UV's. Thanks!

    Read the article

  • Best protocol for client/server communication, from PHP/Perl to C++/Qt4

    - by Kyle
    I'm the author of an Open Source kiosk management system, Libki. The current version, though functional, was very much a learning experience for me. I'm working on a complete rewrite and am having a hard time deciding what protocol to use. The server will be written in PHP or Perl. Most likely PHP because I need to support some uncommon protocols that Library software use, ( SIP and NCIP ). So far I've only found a SIP2 library in PHP. The client is written in C++/Qt4. I'm looking at RPC and REST for client/server communication. I've found RPC client libraries for Qt4, and REST is already part of the Qt4 libraries. Is there an alternative I've missed? So far, REST seems to be the winner.

    Read the article

  • How to handle 'this' pointer in constructor?

    - by Kyle
    I have objects which create other child objects within their constructors, passing 'this' so the child can save a pointer back to its parent. I use boost::shared_ptr extensively in my programming as a safer alternative to std::auto_ptr or raw pointers. So the child would have code such as shared_ptr<Parent>, and boost provides the shared_from_this() method which the parent can give to the child. My problem is that shared_from_this() cannot be used in a constructor, which isn't really a crime because 'this' should not be used in a constructor anyways unless you know what you're doing and don't mind the limitations. Google's C++ Style Guide states that constructors should merely set member variables to their initial values. Any complex initialization should go in an explicit Init() method. This solves the 'this-in-constructor' problem as well as a few others as well. What bothers me is that people using your code now must remember to call Init() every time they construct one of your objects. The only way I can think of to enforce this is by having an assertion that Init() has already been called at the top of every member function, but this is tedious to write and cumbersome to execute. Are there any idioms out there that solve this problem at any step along the way?

    Read the article

  • Parameters in ClickOnce

    - by Kyle Rozendo
    Is it possible in any possible way to add to/change the .application file (or any other way) of a ClickOnce deploy file to allow parameters to be specified without the need for the parameters to be passed via the URL? The assembly can be compiled at run time/resigned/etc, or stated otherwise, I am not worried about the bounds of "what else" I would have to do.

    Read the article

  • OpenLayers FramedCloud Autosizing

    - by Kyle
    According to the documentation, I should be able to configure the size of my OpenLayers popup by declaring an OpenLayers.Size object in the FramedCloud constructor: this.popup = new OpenLayers.Popup.FramedCloud('featurePopup', this.options.feature.geometry.getBounds().getCenterLonLat(), new OpenLayers.Size(80, 60), this.template(this.formattedAttrs()), null, true, this.onPopupClose ); Currently the popup that is rendered is autosized no matter what dimensions I use in the constructor. I've tried manually setting the autosizing attribute of the FramedCloud to false as well as manually adjusting the css styling for the popup without achieving the results I need. I checked and found some similar issues in the OpenLayers 2.11 issues list, but I haven't found a workaround. Any ideas?

    Read the article

  • JavaFX MouseEvent continues when I remove the object it happened on

    - by Kyle
    It took me a while to realize what was going on with mouse events going through my blocking dialog boxes when I closed them, but I finally figured out why. I still don't know any good way to fix it. I have a custom dialog box (that blocks the mouse) with a close button. When I click the close button, I remove the dialog box from the scene, but JavaFx is still processing the MouseEvent and now it finds that there is nothing blocking the screen behind where the cancel button was, so that component receives a MouseEvent. How do I make the mouseEvent stop processing when I see that they pressed cancel and remove the dialog box? Or, is there a way to make the removing of the dialog box not happen until after it is done processing the MouseEvent? Example Code for the problem: import javafx.stage.Stage; import javafx.scene.Scene; import javafx.scene.shape.Rectangle; import javafx.scene.input.MouseEvent; import javafx.scene.control.Button; var theScene:Scene; var btn:Button; Stage { title: "Application title" scene: theScene= Scene { width: 500 height: 200 content: [ Rectangle{ width: bind theScene.width height: bind theScene.height onMouseClicked: function(e:MouseEvent):Void{ println("Rectangle");} }, Button{ layoutX: 20 layoutY: 50 blocksMouse: true text: "JustPrint" action:function():Void{ println("JustPrint");} }, btn = Button{ layoutX: 20 layoutY: 20 blocksMouse: true text: "Cancel" action:function():Void{ println("Cancel"); delete btn from theScene.content;} }, ] } } When you press "JustPrint" you get: JustPrint When you press "Cancel" you get: Cancel Rectangle

    Read the article

  • How do I get a less than in a javascript for loop in XSL to work?

    - by Kyle
    I am using CDATA to escape the script but in IE8's debugger I still get this message: "Expected ')'" in the for loop conditions. I am assuming it still thinks that the ; in the &lt; generated by CDATA is ending the loop conditions. Original script in my XSL template: <script type="text/javascript" language="javascript"> <![CDATA[ function submitform(form){ var oErrorArray = new Array(); for (i=0;i<form.length;i++) eval("oErrorArray["+i+"]=oError"+i); var goForm = true; for(i=0;i<form.length;i++) { oErrorArray[i].innerHTML = ""; if(form[i].value="")){ oErrorArray[i].innerHTML = "Error - input field is blank"; goForm = false; } } if(goForm == true) form.submit(); } function resetform(form){ form.reset(); } ]]> </script> Code generated after transformation (from IE8 debugger): <script type="text/javascript" language="javascript"> function submitform(form){ var oErrorArray = new Array(); for (i=0;i&lt;form.length;i++) eval("oErrorArray["+i+"]=oError"+i); goForm = true; for(i=0;i&lt;form.length;i++) { oErrorArray[i].innerHTML = ""; if(form[i].value="")){ oErrorArray[i].innerHTML = "Error - input field is blank"; goForm = false; } } if(goForm == true) form.submit(); } function resetform(form){ form.reset(); } </script> Error reported by IE8 debugger: Expected ')' login.xml, line 29 character 30 (which is right after the first "form.length")

    Read the article

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