Search Results

Search found 2696 results on 108 pages for 'michael lowe'.

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

  • Apples, oranges, and pointers to the most derived c++ class

    - by Matthew Lowe
    Suppose I have a bunch of fruit: class Fruit { ... }; class Apple : public Fruit { ... }; class Orange: public Fruit { ... }; And some polymorphic functions that operate on said fruit: void Eat(Fruit* f, Pesticide* p) { } void Eat(Apple* f, Pesticide* p) { ingest(f,p); } void Eat(Orange* f, Pesticide* p) { peel(f,p); ingest(f,p); } OK, wait. Stop right there. Note at this point that any sane person would make Eat() a virtual member function of the Fruit classes. But that's not an option, because I am not a sane person. Also, I don't want that Pesticide* in the header file for my fruit class. Sadly, what I want to be able to do next is exactly what member functions and dynamic binding allow: typedef list<Fruit*> Fruits; Fruits fs; ... for(Fruits::iterator i=fs.begin(), e=fs.end(); i!=e; ++i) Eat(*i); And obviously, the problem here is that the pointer we pass to Eat() will be a Fruit*, not an Apple* or an Orange*, therefore nothing will get eaten and we will all be very hungry. So what I really want to be able to do instead of this: Eat(*i); is this: Eat(MAGIC_CAST_TO_MOST_DERIVED_CLASS(*i)); But to my limited knowledge, such magic does not exist, except possibly in the form of a big nasty if-statement full of calls to dynamic_cast. So is there some run-time magic of which I am not aware? Or should I implement and maintain a big nasty if-statement full of dynamic_casts? Or should I suck it up, quit thinking about how I would implement this in Ruby, and allow a little Pesticide to make its way into my fruit header?

    Read the article

  • debugging c# silverlight projects from vb web application

    - by dave lowe
    Hi, I have a problem whereby I cannot debug a c# silverlight application project that is hosted from within a visual basic web application. I add breakpoints to the main App constructor and the symbols are loaded ok but my breakpoints are never hit. I have concluded that it is a vb/c# interop problem as to test i did the following. Created a new c# web application project Added a c# silverlight application Added a new vb web application project Added references to the silverlight project from both web apps set a breakpoint in App.xaml.cs constructor if i run the c# webapp the break points are hit whereas if i run the vb webapp they are not. has anyone come across this before or can anyone suggest a solution please? Many Thanks

    Read the article

  • finding links that are hyper-links in jQuery

    - by Jacob Lowe
    Im trying to take a link either when clicked or hover over be able to grab the attribute href and tell if its a hyper-link or not. Also i want it to be able to tell me if its a hyper-link to my own site. Plus various other filters. The main purpose for this is so that when a internal link is clicked it will tell ajax to grab the content, alot of my links are generated (via wordpress)so I can't modify them too much. Another purpose for this is so i can also make all external links open on a new window. I have a solution that works on a simple test page but when i put into a working page it breaks. I know i am probably making this harder then it should be. Here is my code $(function(){ $('a').live('click', function(){ var x = $(this).attr('href'); $(this).parent('div').append('<div id="test">' + x +'</div>'); $('#test:contains("http")').css('color', 'red'); $('#test:contains("sitename")').css('color', 'black'); $('#test:contains("admin")').css('color', 'red'); if($('#test').css('color') == 'red'){ alert('external link'); $('#test').remove(); return true; }else{ alert('external link'); $('#test').remove(); return false; } }); }); thanks for you help

    Read the article

  • Why doesn't C++ allow you to request a pointer to the most derived class?

    - by Matthew Lowe
    (This question should probably be answered with a reference to Stroustrup.) It seems extremely useful to be able to request a pointer to the most derived class, as in the following: class Base { ... }; class DerivedA { ... }; class DerivedB { ... }; class Processor { public: void Do(Base* b) {...} void Do(DerivedA* d) {...} void Do(DerivedB* d) {...} }; list<Base*> things; Processor p; for(list<Base*>::iterator i=things.begin(), e=things.end(); i!=e; ++i) { p.Do(CAST_TO_MOST_DERIVED_CLASS(*i)); } But this mechanism isn't provided in c++. Why?

    Read the article

  • how to protect telnet access to smtp port 25?

    - by Michael Mao
    Hi all: Please consider the following: 192-168-1-106:~ michael$ telnet <remote_server_ip> 25 Trying <remote_server_ip>... Connected to li*****.linode.com. Escape character is '^]'. 220 mindinscription.net ESMTP Postfix (Ubuntu) quit 221 2.0.0 Bye Connection closed by foreign host. Is this very bad? how to protect port 25 from malicious attackers? I've already set up a firewall, but not very sure what to do in this case. Basically I'd like to use this server to only send emails as alert messages, not receiving any external emails. Many thanks to the help in advance.

    Read the article

  • What do you use to loadbalance IPv6 services?

    - by Michael Renner
    Hi, the current Linux software environment for IPv6 load balancing looks a bit grim. IPVS has rudimentary support for IPv6 but it's far from complete. NAT for IPv6 seems to be a no-go. Are there any other projects which aim for this goal? Does the IPv6 support in other OS look better? Are there any commercial products which have been successfully used in production environments with non-trivial load patterns? Or is it just that the time for IPv6 hasn't come... yet? ;) best regards, Michael

    Read the article

  • Windows 7 Locking up Randomly

    - by Michael Moore
    I've got a Windows 7 machine that is locking up randomly. It can be in the first thirty seconds, or it can be hours later. There is nothing specific I can find that is running when it happens. When it locks, the screen doesn't change, but nothing moves. The waiting icon stops, the mouse stops, keyboard doesn't work, etc. I've even tried the crash on ctrl-scrl registry hack, and it won't even dump the kernel. I've run hardware diagnostics on the RAM and it doesn't find any problems. I would think it is a hardware issue, but on this exact same machine, I can run 64 Bit Ubuntu and it has zero problems. I've even tried reinstalling Windows7 from scratch, and it still happens. Anyone have any ideas? Any good diagnostic tools to recommend? Thanks! Michael

    Read the article

  • Secure copy in Linux

    - by Michael
    Hi all, I wanna simpy exchange 3 directories to a collegue's home directory (I dont have write access to that one) from my home directory, probably using secure copy if possible. I am not good with Linux command line, so I am not sure how to do that and I would very much appreciate it if somebody could help me a bit out with this. I guess it should look something like that scp -r /home/user1/directoy1 /home/user2/directoy1 scp -r /home/user1/directoy2 /home/user2/directoy2 scp -r /home/user1/directoy3 /home/user2/directoy3 Do I need to specify the login name of my collegue so that the files can be copied when he enters his password? Thanks for your help, Michael

    Read the article

  • USB Flash drive corrupt files - Help needed

    - by Michael
    I have a 16gb usb flash drive with 8gb worth of data that I can't afford to lose. When I inserted it into my pc, inside the folder that I was storing the data I saw unintelligible characters and nothing in there would open. I ran, windows scandisk and the files (unfortunately) disappeared. I can see that the drive's space still appears to be taken up with data, about 8gb. What should I do to recover it? Is it possible? Thanks in advance... Michael

    Read the article

  • Virtual hosting in Varnish with individual vcl files for configuration

    - by Michael Sørensen
    I wish to use varnish to put in front of an apache and a tomcat on the same server. Depending on the ip requested, it goes to a different backend. This works. Now for most of the sites the default varnish logic will work just fine. However for some specific sites I wish to use custom VCL code. I can test for host name and include config files for the specific domains, but this only works inside the individual methods recv etc. Is there a way to include a complete set of instructions, in one file, per domain, without having to manage separate files for subdomain_recv, subdomain_fetch etc? And preferably without running seperate instances of varnish. When I try to include a file on the "root level" of default.vcl, I get a compilation error. Best regards, Michael

    Read the article

  • Passing a custom variable to the PayPal API

    - by Michael
    Gday All, I am developing a site that uses PayPal to take online payments. I need to be able to send my client an email with the link to PayPal in order to pay. In this link I need a way to set a unique value (for example bookingId) that I can use to add the receipt number to the correct booking via PayPal's payment notification feature. Does anyone know what custom value I can set in order to achieve this? Cheers, Michael

    Read the article

  • Appcelerator Titanium: Android SDK doesn't load

    - by Michael Gajda
    Hello! I started developing with Titanium and now I really stuck on one part. I downloaded the Adroid SDK and added the path to Titanium: /Users/michael/Downloads/android-sdk-mac_86/ I can open e.g. Kitchen Sink in the iPhone Simulator without problems, but when I want to open it in Android then my screen looks like this: Screenshot Why is down there all the time, even after 2 hours of waiting, the label "loading..." ?

    Read the article

  • jQuery jFlow plugin. How can I have more than one on a single page?

    - by Michael
    Hi, I'm using a very lovely and simple plugin called jFlow that gives me a basic content slider etc. However, I can see no documentation or help on how to get two (or more) on one page at the same time working seperately from one another. At the moment, if I set two up, they almost combine as one, despite having a different configuration from one another. Any help would be great, thanks. Michael.

    Read the article

  • simple yet secure encrypt / decrypt asp to asp.net

    - by Michael
    First post here. I have a asp/vb6 web app that logs in a user I want to encrypt the users identity field and pass(querystring) it to a asp.net app and then decrypt it to do a db lookup. I've google'd it of course and found rot13, not secure enough. I've also found some hits on MD5 / RC4 but did not find any good examples of encrypt / decrypt. Thanks, Michael

    Read the article

  • How can I add one Target (Foundation Tool) to Copy Bundle Resources of another Target in XCode

    - by Michael Ruepp
    Hy everybody, I have two targets in one Project in Xcode. One is a foundation tool which i need in the resources Bin of the other Target, which is a Bundle App. I am not able to add the Target one into the Copy Bundle Resources Build Phase of the Bundle App. Do I need to use a Copy Files Build phase and put the File out of the build/Release Folder into it? Thank you, Michael

    Read the article

  • Sample code for image upload

    - by Michael
    Hi, In would like to write a simple Android application that takes a picture from the camera and uploads it to a webserver. Additionaly, I would like it to print in the screen the response from the server wich is a simple text string. Do you know if there is any sample code that does something like that? Thank you, Michael

    Read the article

  • php mysql array - insert array info into mysql

    - by Michael
    I need to insert mutiple data in the field and then to retrieve it as an array. For example I need to insert "99999" into table item_details , field item_number, and the following data into field bidders associated with item_number : userx usery userz Can you please let me know what sql query should I use to insert the info and what query to retrieve it ? I know that this may be a silly question but I just can't figure it out . thank you in advance, Michael .

    Read the article

  • Determine the urban district from coordinates

    - by Michael Kowhan
    Hi, I am looking for a database that allows to find the name of an urban district from the coordinates. I have tried to use Google Maps or Open Street Map to find that information, but they do not seem to be able to deliver this data. I'm especially looking for a database for Germany Cheers, Michael

    Read the article

  • git: ignore everything except subdirectory

    - by Michael Goerz
    I want to ignore all files in my repository except those that occur in the 'bin' subdirectory. I tried adding the following to my .gitignore * !bin/* This does not have the desired effect, however: I created a new file inside of bin/, but doing 'git status' still "shows nothing to commit (working directory clean)" Any suggestions? Thanks, Michael

    Read the article

  • svn connection timeout

    - by Tom celic
    I have Ubuntu 12.04 running in virtual box inside Windows 7. I have the network adapter set as NAT and everything networking wise seems to be running smoothly (internet / git ect.). However, for some reason, svn always times out when i.e michael@michael-VirtualBox:~/Documents/deleteme$ svn co svn://svn.openwrt.org/openwrt/trunk/ svn: Can't connect to host 'svn.openwrt.org': Connection timed out Somebody suggested to me that I might need to change what ports svn uses. Does anybody have any idea how to diagnose / solve the problem? Thanks!

    Read the article

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