Search Results

Search found 23 results on 1 pages for 'doron'.

Page 1/1 | 1 

  • sendmail on ubuntu (9.10) machine "stopped" sending mail

    - by Doron
    I'm developing on my ubuntu 9.10 machine for the web (php). I'm using it sendmail for sending mails, and while developing on my local machine, I send local mails (to my user 'doron'). Up until a few days ago, I was able to send mails both from php's mail() function, and from the command line using the mail command. I'm using sendmail with mailutils. Since the last few days, it seems like it stopped working. When I try to send mail from the command line, I get the following in my syslog (and mail.info, and mail.log): Mar 3 13:27:58 doron-desktop sendmail[4693]: o23BRwlA004693: from=doron, size=84, class=0, nrcpts=1, msgid=<201003031127.o23BRwlA004693@doron-desktop.>, relay=doron@localhost Mar 3 13:27:58 doron-desktop sm-mta[4694]: o23BRwtQ004694: ruleset=check_rcpt, arg1=<doron@doron-desktop>, relay=localhost [127.0.0.1], reject=553 5.1.8 <doron@doron-desktop>... Domain of sender address doron@doron-desktop does not exist Mar 3 13:27:58 doron-desktop sendmail[4693]: o23BRwlA004693: to=<doron@doron-desktop>, ctladdr=doron (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30084, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown Mar 3 13:27:58 doron-desktop sm-mta[4694]: o23BRwtQ004694: from=<doron@doron-desktop>, size=84, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1] Trying to telnet locally to port 25 results in the following (same output for doron@doron-desktop): doron@doron-desktop:/var/mail$ telnet localhost 25 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 doron-desktop. ESMTP Sendmail 8.14.3/8.14.3/Debian-9ubuntu1; Wed, 3 Mar 2010 13:26:06 +0200; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1] helo localhost 250 doron-desktop. Hello localhost [127.0.0.1], pleased to meet you mail from: doron@localhost 250 2.1.0 doron@localhost... Sender ok rcpt to: root@localhost 553 5.1.8 root@localhost... Domain of sender address doron@doron-desktop does not exist However - if I do the same, but use [email protected] in the mail from field, I get: 250 2.1.5 root... Recipient ok My /etc/hosts file: 127.0.0.1 localhost 127.0.1.1 doron-desktop doron-desktop. (If I don't have the "doron-desktop." (with the ending dot), the mail command takes a lot of time (around 30 seconds) until it responds, but the results are the same.)

    Read the article

  • sendmail on ubuntu (9.10) machine "stopped" sending mail

    - by Doron
    I'm developing on my ubuntu 9.10 machine for the web (php). I'm using it sendmail for sending mails, and while developing on my local machine, I send local mails (to my user 'doron'). Up until a few days ago, I was able to send mails both from php's mail() function, and from the command line using the mail command. I'm using sendmail with mailutils. Since the last few days, it seems like it stopped working. When I try to send mail from the command line, I get the following in my syslog (and mail.info, and mail.log): Mar 3 13:27:58 doron-desktop sendmail[4693]: o23BRwlA004693: from=doron, size=84, class=0, nrcpts=1, msgid=<201003031127.o23BRwlA004693@doron-desktop.>, relay=doron@localhost Mar 3 13:27:58 doron-desktop sm-mta[4694]: o23BRwtQ004694: ruleset=check_rcpt, arg1=<doron@doron-desktop>, relay=localhost [127.0.0.1], reject=553 5.1.8 <doron@doron-desktop>... Domain of sender address doron@doron-desktop does not exist Mar 3 13:27:58 doron-desktop sendmail[4693]: o23BRwlA004693: to=<doron@doron-desktop>, ctladdr=doron (1000/1000), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30084, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.8, stat=User unknown Mar 3 13:27:58 doron-desktop sm-mta[4694]: o23BRwtQ004694: from=<doron@doron-desktop>, size=84, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1] Trying to telnet locally to port 25 results in the following (same output for doron@doron-desktop): doron@doron-desktop:/var/mail$ telnet localhost 25 Trying ::1... Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 220 doron-desktop. ESMTP Sendmail 8.14.3/8.14.3/Debian-9ubuntu1; Wed, 3 Mar 2010 13:26:06 +0200; (No UCE/UBE) logging access from: localhost(OK)-localhost [127.0.0.1] helo localhost 250 doron-desktop. Hello localhost [127.0.0.1], pleased to meet you mail from: doron@localhost 250 2.1.0 doron@localhost... Sender ok rcpt to: root@localhost 553 5.1.8 root@localhost... Domain of sender address doron@doron-desktop does not exist However - if I do the same, but use [email protected] in the mail from field, I get: 250 2.1.5 root... Recipient ok My /etc/hosts file: 127.0.0.1 localhost 127.0.1.1 doron-desktop doron-desktop. (If I don't have the "doron-desktop." (with the ending dot), the mail command takes a lot of time (around 30 seconds) until it responds, but the results are the same.)

    Read the article

  • inconsistent ERRORLEVEL in a batch file

    - by Doron
    In a batch file, I have an inconsistent errorlevel behavior: The IP address 10.1.1.2 always replies. The following code always gives errorlevel 0 in one location (somewhere in the middle - exactly where i need it) inside the batch file. I copied only this snippet and placed it in the beginning and at the end of the batch file. In those locations, the result is always 1. Here is the code snippet: ping 10.1.1.2|Findstr /I /C:"timed out" /C:"host unreachable" echo %errorlevel% Any idea how to make it work also in the middle of the file? What am I doing wrong? I would hate to solve it with GOTOs(to the end of the file and back to where I need the result.)

    Read the article

  • How do I set up an sftp user to login with a password to an EC2 ubuntu server ?

    - by Doron
    Hello, I have an Ubuntu Server running on an EC2 instance. To login to that server I use a certificate file without any password. I've installed and configured vsftpd and created a user (let's call him "testuser") for which I've set a /bin/false ssh terminal so it will only be able to connect via sftp and upload/access files on his home directory. However - when I try to connect to the server from my computer, running sftp testuser@my-ec2-server I get Permission denied (publickey). Connection closed messages so I can't log in. How can I remove the certificate requirement for this user only (meaning, the "ubuntu" user will still have to use the certificate file to login via ssh), so normal sftp clients will be able to connect using a username and a password ? Thank you. PS Using Ubuntu Server 10.10 official AMI from canonical, 64bit on a micro instance.

    Read the article

  • Destination host unreachable, but the errorlevel is 0 (from a win7)

    - by Doron
    From a windows 7 machine, I ping a non existing ip address. C:ping 192.168.1.222 Pinging 192.168.1.222 with 32 bytes of data: Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Ping statistics for 192.168.1.222: Packets: Sent = 3, Received = 3, Lost = 0 (0% loss) Even though there is no reply, the errorlevel is set to 0. *what I am trying to do, is figure out if a remote machine is replying to ping. One of my test is to turn off the machine and ping it. For some reason, ping sets errorlevel to 0 *

    Read the article

  • Connecting to a VirtualBox machine from the host, using an ip address

    - by Doron
    Hello, In a macbook host, I run VirtualBox having a guest ubuntu server, with a NAT network setting. In the virtual machine application "Parallels", I would get on the host an IP address of the guest, to which I could later set hostnames and access it directly. However, I couldn't find a way to accomplish this using VirtualBox. The only solution VirtualBox has for me, is to set port forwarding, and access "localhost" with these ports. How can I have the desired behavior set up, without having to change to a bridged network settings, and expose my guest computer to the network my host computer is connected to ? Thanks.

    Read the article

  • Can I run ubuntu server 64 bit in a VirtualBox on a macbook host ?

    - by Doron
    Hello, I have a macbook pro with Intel Core 2 Due (It's actually not Pro, but it's a January 2009 unibody macbook - when there were both a unibody macbook, and a unibody macbook pro). I'm a php developer. I just installed a new hard drive, and in an effort to create a better development environment, I decided I'll try to create a virtual machine running ubuntu server. Since I need it to work fast (and since, well - it's just better, even if by a little) and I'll already have a delay due to the nature of the apache server being on a virtual host - I want to install a 64 bit version of ubuntu server. Can VirtualBox handle it? Is it s good idea to create such a development environment ? Thank you.

    Read the article

  • Ping from windows 7 get no reply but sets errorlevel to 0

    - by Doron
    From a Windows 7 machine, I ping an IP address of a turned-off machine. C:\>ping 192.168.1.222 Pinging 192.168.1.222 with 32 bytes of data: Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Reply from 192.168.1.222: Destination host unreachable. Ping statistics for 192.168.1.222: Packets: Sent = 3, Received = 3, Lost = 0 (0% loss) Even though there is no reply, the errorlevel is set to 0. What I am trying to do, is figure out if a remote machine is replying to ping. One of my tests is to turn off the machine and ping it. For some reason, ping sets errorlevel to 0.

    Read the article

  • Apache will not start after IP change

    - by Doron
    I'm running CentOS 5.8 and I had to change my server's IP address. Afterwards, I'm unable start Apache. I am also running virtualmin. The error I'm receiving is: Failed to start service Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using 184.106.146.125 for ServerName (99) Cannot assign requested address: make_sock: could not bind to address 50.56.33.100:8080 no listening sockets available, shutting down Unable to open logs I edited my httpd.conf to point to the new IP address like such: #Listen 12.34.56.78:80 Listen 184.106.146.125:80 And looking at the error it still seems to be referring to the old ip address (50.*).

    Read the article

  • Installing .NET 3.5 SP1 on server broke WCF

    - by Doron
    I installed .NET 3.5 SP1 on server which previously had .NET 3.0 SP2. Before install site was working perfectly. After install and subsequeny server restart, site displays but anything that makes use of the WCF service has stopped working. The exception log reports exceptions like the following when any calls are made to the client proxy: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. The server's application event log gave the following errors after the install: Configuration section system.serviceModel.activation already exists in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config. Configuration section system.runtime.serialization already exists in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config. Configuration section system.serviceModel already exists in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Config\machine.config. which seems to be inline with the fact that anything WCF related has stopped working. I am not experienced in server configurations or WCF so looking for any assistance with this. Thanks!! From machine.config: <sectionGroup name="system.serviceModel" type="System.ServiceModel.Configuration.ServiceModelSectionGroup, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="behaviors" type="System.ServiceModel.Configuration.BehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="bindings" type="System.ServiceModel.Configuration.BindingsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="client" type="System.ServiceModel.Configuration.ClientSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="comContracts" type="System.ServiceModel.Configuration.ComContractsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="commonBehaviors" type="System.ServiceModel.Configuration.CommonBehaviorsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/> <section name="diagnostics" type="System.ServiceModel.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="extensions" type="System.ServiceModel.Configuration.ExtensionsSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="machineSettings" type="System.ServiceModel.Configuration.MachineSettingsSection, SMDiagnostics, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowDefinition="MachineOnly" allowExeDefinition="MachineOnly"/> <section name="serviceHostingEnvironment" type="System.ServiceModel.Configuration.ServiceHostingEnvironmentSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="services" type="System.ServiceModel.Configuration.ServicesSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectionGroup> <sectionGroup name="system.serviceModel.activation" type="System.ServiceModel.Activation.Configuration.ServiceModelActivationSectionGroup, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="diagnostics" type="System.ServiceModel.Activation.Configuration.DiagnosticSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="net.pipe" type="System.ServiceModel.Activation.Configuration.NetPipeSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> <section name="net.tcp" type="System.ServiceModel.Activation.Configuration.NetTcpSection, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectionGroup> <sectionGroup name="system.runtime.serialization" type="System.Runtime.Serialization.Configuration.SerializationSectionGroup, System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <section name="dataContractSerializer" type="System.Runtime.Serialization.Configuration.DataContractSerializerSection, System.Runtime.Serialization, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/> </sectionGroup> from site's web.config <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" /> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" /> </sectionGroup> </sectionGroup> </sectionGroup> . . . <system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IService" closeTimeout="00:03:00" openTimeout="00:03:00" receiveTimeout="00:10:00" sendTimeout="00:03:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="131072" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="some address" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService" contract="some contact" name="WSHttpBinding_IService" /> </client> Pertinant Exception Section: Exception information: Exception type: TypeLoadException Exception message: Could not load type 'System.Web.UI.ScriptReferenceBase' from assembly 'System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

    Read the article

  • Error: Expected specifier-qualifier-list before ... in XCode Core Data

    - by Doron Katz
    Hi guys, I keep on getting this error "error: expected specifier-qualifier-list for core data code im working with, in the app delegate. Now when i get this error and about 40 other errors relating to managedobjectcontext etc, i thought maybe the library needs to be imported. Now i havent done this before, but i went to Frameworks group and add existing frameworks and it added CoreData.framework. I re-build and it still came up with the error. Do I need to import anything in the headers explicitly or is there some other step i need to do? Thanks

    Read the article

  • What is the autoload class names structure, for the root "library" dir in a Zend Framework 1.10.2 pr

    - by Doron
    I have a project I created with Zend Framework 1.10.2. I usually use the application/models directory for new model files I create, and the auto loading is fine, so for example - My_Model_SampleClass is located application/models/SampleClass.php. However, I have just created a custom Exception class, and it does not fit in the models directory inside the application dir (at least the way I see it, I could be logically wrong), so I've created it in the root "library" dir, but I can't seem to find the correct class name + file name to use, so auto loading will be done correctly. BTW, I use a namespace for all custom classes I use, let's assume it's "My".

    Read the article

  • Getting a "No default module defined for this application" exception while running controller unit t

    - by Doron
    I have an application with the default directory structure, for an application without custom modules (see structure figure at the end). I have written a ControllerTestCase.php file as instructed in many tutorials, and I've created the appropriate bootstrap file as well (once again, see figures at the end). I've written some model tests which run just fine, but when I started writing the index controller test file, with only one test in it, with only one line in it ("$this-dispatch('/');"), I'm getting the following exception when running phpunit (but navigating with the browser to the same location - all is good and working): 1) IndexControllerTest::test_indexAction_noParams Zend_Controller_Exception: No default module defined for this application Why is this ? What have I done wrong ? Appendixes: Directory structure: -proj/ -application/ -controllers/ -IndexController.php -ErrorController.php -config/ -layouts/ -models/ -views/ -helpers/ -scripts/ -error/ -error.phtml -index/ -index.phtml -Bootstrap.php -library/ -tests/ -application/ -controllers/ -IndexControllerTest.php -models/ -bootstrap.php -ControllerTestCase.php -library/ -phpunit.xml -public/ -index.php (Basically I have some more files in the models directory, but that's not relevant to this question.) application.ini file: [production] phpSettings.display_startup_errors = 0 phpSettings.display_errors = 0 includePaths.library = APPLICATION_PATH "/../library" bootstrap.path = APPLICATION_PATH "/Bootstrap.php" bootstrap.class = "Bootstrap" appnamespace = "My" resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 0 resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" resources.view[] = phpSettings.date.timezone = "America/Los_Angeles" [staging : production] [testing : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 [development : production] phpSettings.display_startup_errors = 1 phpSettings.display_errors = 1 resources.frontController.params.displayExceptions = 1 tests/application/bootstrap.php file <?php error_reporting(E_ALL); // Define path to application directory defined('APPLICATION_PATH') || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../application')); // Define application environment defined('APPLICATION_ENV') || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'testing')); // Ensure library/ is on include_path set_include_path(implode(PATH_SEPARATOR, array( realpath(APPLICATION_PATH . '/../library'), // this project' library get_include_path(), ))); /** Zend_Application */ require_once 'Zend/Application.php'; require_once 'ControllerTestCase.php';

    Read the article

  • What is the status of ZendX (Specifically ZendX_JQuery) ?

    - by Doron
    I need to have an autocomplete functionality using jquery, and I've encountered ZendX_JQuery which has such functionality available. However, I've noticed that the entire ZendX_JQuery classes, are a bit old (the default jquery version is 1.3.2, and jquery ui 1.7.1). (see http://framework.zend.com/svn/framework/extras/branches/release-1.10/library/ZendX/JQuery.php) Should I use that instead of my own written code to include the jquery library and etc., and should I use the ZendX_JQuery_View_Helper_AutoComplete class for such functionality ?

    Read the article

  • Is ZendX still active (Specifically ZendX_JQuery) ?

    - by Doron
    I need to have an autocomplete functionality using jquery, and I've encountered ZendX_JQuery which has such functionality available. However, I've noticed that the entire ZendX_JQuery classes, are a bit old (the default jquery version is 1.3.2, and jquery ui 1.7.1). (see http://framework.zend.com/svn/framework/extras/branches/release-1.10/library/ZendX/JQuery.php) Should I use that instead of my own written code to include the jquery library and etc., and should I use the ZendX_JQuery_View_Helper_AutoComplete class for such functionality ?

    Read the article

  • How stable or unstable is symfony 2.0 ?

    - by Doron
    Well, I know it's a preview, and I know it says that it's not yet ready for production, and yet I dare ask the question. I need to start building a pretty big application, which is planned to go live at around sep-oct 2010. Lets say I will not release the application to production until the stable version of symfony 2.0 will be released - is it a good idea (well, I'll settle for a viable idea) for me to start building the application using the 2.0 version ? How big is the chance I will need to rewrite/replace code I've written due to core changes in the framework ? Thanks. Edit: the other option right now, is to use symfony 1.4. I have thought and tried Zend Framework, but I refuse to re-invent each and every module, which will cost me a lot of programming hours (if not days/weeks).

    Read the article

  • Need help understanding the MVC design pattern

    - by Doron Sinai
    Hi, I am trying to find a ood example of MVC design pattern in java. This is what i understood from reading about it, please correct me if I am wrong: I have the Model part which is the logic behind the program, let's say if we have a phonebook, so adding and removing contact from the Array will be the model. The Gui is the view and it contains buttons that upon clicking them, the model is changing. What I am trying to undersand what is the controller part, is it the ActionListeners? how to you seperate those modules in practice. thank you

    Read the article

  • Copying a Polymorphic object in C++

    - by doron
    I have base-class Base from which is derived Derived1, Derived2 and Derived3. I have constructed an instance for one of the the derived classes which I store as Base* a. I now need to make a deep copy of the object which I will store as Base* b. As far as I know, the normal way of copying a class is to use copy constructors and to overload operator=. However since I don't know whether a is of type Derived1, Derived2 or Derived3, I cannot think of a way of using either the copy constructor or operator=. The only way I can think of to cleanly make this work is to implement something like: class Base { public: virtual Base* Clone() = 0; }; and the implement Clone in in the derived class as in: class Derivedn : public Base { public: Base* Clone() { Derived1* ret = new Derived1; copy all the data members } }; Java tends to use Clone quite a bit is there more of a C++ way of doing this?

    Read the article

  • Floating point equality and tolerances

    - by doron
    Comparing two floating point number by something like a_float == b_float is looking for trouble since a_float / 3.0 * 3.0 might not be equal to a_float due to round off error. What one normally does is something like fabs(a_float - b_float) < tol. How does one calculate tol? Ideally tolerance should be just larger than the value of one or two of the least significant figures. So if the single precision floating point number is use tol = 10E-6 should be about right. However this does not work well for the general case where a_float might be very small or might be very large. How does one calculate tol correctly for all general cases? I am interested in C or C++ cases specifically.

    Read the article

  • How do i convert from milliseconds to seconds units to be shown in a Label?

    - by Doron Muzar
    I have this code: private void Form1_MouseWheel(object sender, MouseEventArgs e) { if (leave == true) { if (e.Delta > 0) { if (timer1.Interval < 5000) { timer1.Interval += 1000; label2.Text = (timer1.Interval/1000).ToString(); } } else { if (timer1.Interval == 1000) { timer1.Interval -= 100; label2.Text = (timer1.Interval / 1000).ToString(); } } } } The original timer1 interval in the designer is set to 1000 milliseconds. In the mouse wheel event i did that it will show in the label2 the untis in seconds. And indeed when i move the mouse wheel up its slowing the timer and show it in seconds 1 2 3 4 5 The problem is with the second part i wanted that when its getting to 1 second or 1000 milliseconds if i will keep wheel it down it will show the units in 100 and change the timer1.interval in 100 units. So in label2 if it was on 1 second so now i will see 900 800 700 600 500 un till 100. And also the timer1 interval should be change to 900 milliseconds 800 700 600 untill 100. When its get to 100 just stop there dont keep getting under 100. The problem is with this part: if (timer1.Interval == 1000) { timer1.Interval -= 100; label2.Text = (timer1.Interval / 1000).ToString(); } Its not working at all. EDIT** My code now: if (leave == true) { if (e.Delta > 0) { if (timer1.Interval < 5000) { timer1.Interval += 1000; label2.Text = (timer1.Interval / 1000).ToString(); } } else { if (timer1.Interval > 1000) { timer1.Interval -= 1000; label2.Text = (timer1.Interval / 1000).ToString(); } else if (timer1.Interval <= 1000 && timer1.Interval > 100) { timer1.Interval -= 100; label2.Text = (timer1.Interval / (double)1000).ToString(); } } } But now if i was at 5 seconds(5000 milliseconds) now i move the wheel back down its counting 5 4 3 2 1 0 and stop on 0 It dosent show under 1 ...0.9 0.8 0.7 as it did before.

    Read the article

1