rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried single-stepping through the code in your debugger? If you don't know how to use a debugger, it is time to learn! We could analyze your code for you, but it is "better to teach one how to fish, than just give them a fish"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
Wh == Watt Hours
Watts == volts * amps
Ah == Amp Hours
Watt Hours == Amp Hours * volts

So, 1200mAh == 1.2Ah which  * 3.7V == 4.44Wh
    950mAh == .95Ah which * 3.7V == 3.51Wh

This is just about what the specs say. They are just rounding down to the nearest decimal place.

So, no. It will not damage your gear. The key is the volts provided. The Amp Hours / Watt Hours is the capacity of the battery. Since they provide the same voltage, the 1200mAh battery will, as seen, provide more capacity to run without charging.

cambalinho commented: thanks for all +3
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please be specific about your needs and situation. I can give good advice (occasionally), but I first need to know what your needs are in order to make that advice suitable for your situation.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you need real security to deal with banking and such, then create/use a bootable liveDVD Linux OS (see Unetbootin). It won't allow any persistent viruses to be stored on the device (the device will be read-only, but temporary data will be stored to RAM disc, which evaporates when you shut down the system). I do this when I have to use an untrusted system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately, Don Graham is pretty much correct. Many DRM (Digital Restrictions Management according to the FSF) versions are not supported in Linux, depending upon version, so you need to run an MS operating system in a virtual machine in order to get your paid for audio/video streams. This is a very sucky situation, and shows why we need to keep pushing back against DRM encumbered streams and data. MS licenses the DRM keys and such (not cheap) so you can use their OS for this stuff. That's why you can play commercial BluRay discs on Windoze, but not on Linux directly.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Hard to say since pastebin says this file is not available. It may be an SELinux issue, which you can disable in order to update the system, but that is just surmise without more information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried Microsoft's Security Essentials? It is free, and does a decent job at cleaning such issues. Also, there is the FOSS (Free and Open Source) tool ClamAV. FWIW, I never use just one cleaner in these cases.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Too much irrelevant code. The timeout code was clear. Please just post the timein code. It should be very much the same as timeout, just with in-time instead of out-time.

Also, PHP is an object-oriented language, very similar to C++. DO NOT mix PHP and HTML/JS. Build up your HTML and JavaScript code strings in your PHP classes as string values, and then output the strings when needed. This provides a couple of major advantages to the mixed domain you are using:

  1. It is easier to debug.
  2. You don't get unintended side-effects.
  3. Changing environment issues are much better dealt with - you can change the strings before they are output.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are several issues here. There are references, const references, pointers, and const pointers. In C++ references of either type are preferred to pointers. Why? Because the function doesn't need to verify that the pointer is null before accessing it. If passed as a reference, the object has to be instantiated (not null), otherwise the compiler will complain.

If a reference is const, then you cannot modify it. If it is not const, then the function can modify the object, and the source object will be changed (they are the same). BTW, for OOP (including C++), functions are static or global. If the function is a class member, then it is a method. They are very different.

FWIW, passing data as a pointer or reference is pretty much equally efficient. As tinstaafl pointed out, passing objects directly can be as efficient, provided they are the size of pointers, or smaller. So, on modern systems where pointers are 64 bits, you can pass any data that is 8 bytes or less with the same overhead; however, changing an object passed directly as such, you get a copy (there is some small performance penalty in this), so changing it will not affect the passed object. Caveat User! :-)

In the end, I prefer to pass data as references (const or non-const as necessary). The const/non-const designation is to indicate my intention whether the called function/method is allowed to change the state of the object.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not a software development issue. It is language/system specific. Please provide the OS and languages you are using, and then please move it to the appropriate forum.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like you need to read the 8086 manual. Sorry, but we don't do your homework for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like you need to read the 8086 manual. Sorry, but we don't do your homework for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like you need to read the 8086 manual. Sorry, but we don't do your homework for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like you need to read the 8086 manual. Sorry, but we don't do your homework for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like you need to read the 8086 manual. Sorry, but we don't do your homework for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, I have to disagree with Mike2K with regard to UML, but that depends upon the tools you use. I employ Sparx Enterprise Architect for my design needs, and then use it to generate source code. If I have to work with existing code, then I used its reverse engineering capabilities to capture the code design into UML diagrams. I have designed major software systems in use for many enterprise systems since the early to mid 1990's using UML or earlier OOP tools (I was there when Booch, et al announced UML 1.0 at OOPSLA in San Jose). Modern tools such as Enterprise Architect, Rose, Tau G2 (Rose and G2 are currently owned by IBM), and such are often capable of forward and reverse engineering from model to code to model. So, there is no doubling of effort, provided you use appropriate tools.

Many of the complex systems I have designed and implemented since the early 1990's would have not been possible without the use of modern design tools (UML, Booch diagrams, CRC cards, etc). The complexity is very much clarified with such tools, allowing one to understand the relationships between classes that would be daunting if you only have source to analyze.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I consider Java and C# to be C++ with training wheels. One of the major advantages of C++ is that you can also write low-level C code with it, such as direct I/O for device control that may be difficult or next to impossible with other languages.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Linus Torvalds uses one, but keeps it at 1 mph, otherwise it interfers with his typing and train of thought. Myself, if I want to take a walk, I take a walk... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you mean CLIP or CLIPS? CLIPS stands for "C Language Integrated Production System" and is used for expert systems (rule based).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I wish there were a way to comment without up/down voting, so I commented on tinstaafl's post about std::sort with an up vote (I didn't feel it deserved a down vote).

Anyway, I had to do this in some production real-time code in the past. What I did was to put the nodes into an array, and then use qsort to sort the nodes, and finally to re-construct the linked list with the sorted nodes. It was efficient, and never caused a problem. There are still factories and US Navy facilities using that code (written in the late 1980's and early 1990's). I think I used it for some code in the US Navy RAMP (Rapid Aquisition of Manufactured Parts) project around 1990-1991.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, in main(), you never set the value of t. You declare it, so it has the default Time value (midnight of whenever). You need to set t's hour, minute, and second values from the input values.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, this is wrong:

 else if (signedNum[0] == (str[0] || str[1]) &&
signedNum[1] == isdigit(signedNum[1]))

You should use

 else if (signedNum[0] == (str[0] || str[1]) && isdigit(signedNum[1]))
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Basically, string::find() is akin to the C function char* strstr(const char* haystack, const char *needle);

There is some argument whether it should return a char* vs a const char* value. The Linux manpage shows it returning a char* - caveate user!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

PHP is a C++ like object-oriented programming language with HTML capabilities that make it suitable for web-based software. It runs on the web server (Apache, et al), so it can be more secure, yet when it emits html, javascript, etc, those parts run on the client (browser). I actually used it to write a complete cell phone emulator when I was at Nokia for testing our performance monitoring tools.

So, the short answer is yes. It has the ability to interface to relational databases such as MySQL, Postgres, Oracle, etc. for data storage/retrieval capabilities which would be necessary for applications such as accounting software. This isn't to suggest that it would be a trivial exercise... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sure. Just write a class or function to do it. There is also RNG code in PHP that will do that for you as well, such as found in http://php.net/manual/en/function.gmp-random.php

And by the way, it took me about 10 seconds to look that and other RNG code up in the PHP web site. Please don't ask questions that you can better answer yourself with a little research.. :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, there are some sub-classes such as the reference counter classes that stuff is derived from, which you will need to remove since that is used by the reference-counting garbage collector which I am not releasing at this time - it is a field I am still doing active research on. It allows programs to use appropriate "smart pointers" to run for years at a time with no deletes. We had 10 million lines of code written with this tech that I invented that had zero deletes, and no memory leaks, that our customers (Samsung, Philips, Intel, Seagate, et al) used for their factories which they would only shut down 1 day a year for preventative maintenance. If the software failed for ANY reason, the costs to them was in excess of $10 million in profits per hour of downtime. Let's just say they would not be happy if that happened!

Vasthor commented: well, that's cool! +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Using Julian date+time values for such is preferred. That way, you can use simple value comparisons to see if one date+time is before/after another, and the conversions to standard date+time using local timezone settings is well documented. There are good documents in Wikipedia for that, and may be a number of open source C++ classes you can use. I wrote my own for a major C++ framework back in the 1990's (before there was such in the FOSS community) and it is working fine today, helping run most semiconductor FABs in the world.

Here is a class (.h and .cpp files) that I wrote for my own use. I am releasing it under a GPLv3 License. IE, you can use it freely, but if you modify it you must provide the modified (and original) source to users who request it.

#ifndef AFS_DATE_H
#define AFS_DATE_H

///////////////////////////////////////////////////////////
//  Date.h
//  Implementation of the Class Date
//  Created on:      16-Nov-2006 4:23:49 PM
//  Original author: William Boyle
///////////////////////////////////////////////////////////

#include <time.h>
#if defined(LINUX) || defined(CYGWIN)
#include <sys/time.h>
#endif

#include "AFS/BASE/Error.h"

namespace AFS
{

    class InvalidDateError : public AfsError
    {
    public:

        InvalidDateError() : AfsError(UtilitySection, InvalidDate) {}
        InvalidDateError( const InvalidDateError& cpy ) : AfsError(cpy) {}
        virtual ~InvalidDateError() throw (LiveObjectError) {}
        InvalidDateError& operator=( const InvalidDateError& rhs )
        { if (this != &rhs) { AfsError::operator=(rhs); } return *this; }

    };

    /**
     * getDateFromString() - if 'ptm' is nil, a local static structure will be returned.
     * This can only be used in re-entrant code if a pointer …
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Each OEM version of Windows XP (or otherwise) has its own drivers, and other cruft that verifies that it is running on the correct hardware. IE, trying to boot a disc from a Dell system on an HP (or vice versa), generally won't work. I have tried running such on XP virtual machines in the past with no luck. You can purchase a version of XP (or could in the past - may have to get Win7 now, which I did) which is not tethered to any specific hardware. I purchase Win7 to run in a virtual machine so I could run some Windows software that I could not in my Linux systems under Wine. Works fine. I think I spent around $100-$130 for the disc. At least Win7 can run XP software pretty well for the most part.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

WiFi access points can run at 2.4 or 5 GHz. It may be that your PC doesn't support the frequency of the AP, such as 5GHz as mentioned, which the Galaxy phone does. If you go to the wireless network settings of the Galaxy, it may tell you what frequency the AP is using.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try ClamWIN. It should work just fine. It is free, and open source.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The short answer is "it depends". Have you consulted the "gurus" at the Apple Store? Or looked online on the Apple web site? Some things may be upgradeable (depending upon model you have), such as RAM or disc size. So, what are you trying to accomplish. Do bear in mind that Apple considers system of more than 2 or 3 years old to be "obsolete"...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some Linux distributions don't use /dev/dsp, such as Red Hat distributions. I am trying to figure out the equivalent but no luck so far, at least pushing an mp3 to the ones I thought might work. The common audio interfaces for Linux are ALSA and PulseAudio. They are generally accessed via system API's and not direct output to a device file.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what goes wrong? The main problem I see is your outer loop. You need to increment qq by 3, not 1, and the limit should be qq < (SCREEN_WIDTH * 3), not qq < SCREEN_WIDTH. IE: for (int qq = 0; qq < (SCREEN_WIDTH * 3); qq += 3) as you need 3 bytes for the 24 bit pixel. Also, properly bracket the contents of the outer loop as you do the inner one, otherwise you will likely be bit by the law of unintended consequences... :-)

Finally, to keep the system from recomputing the width on every outer loop, you can set a loop variable instead, as in for (int qq = 0, xx = (SCREEN_WIDTH * 3); qq < xx; qq += 3). Sometimes compilers will optimize the first example, and sometimes not...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Homework assignment?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Recursion is when a function/method calls itself. This is common for binary search, fibbonacci routines, etc. It is very basic computer science and has nothing to do with Java per se. Read this: http://en.wikipedia.org/wiki/Recursion

JeffGrigg commented: Direct, simple, and correct answer. -1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can set up a database (MySQL, Oracle, Postgres, etc) in the Amazon cloud that your web site can access, and you can get to from anywhere. They all have command-line tools that let you query the data using standard SQL syntax.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Based upon your question, I assume you have a 5.25" disc you want to use? Any box with a 5.25" external bay will include slide to attach to your disc that will let it "slide into" the bay as you wish.

The size of tower you get will limit the size of motherboard you can install, and that will limit the number expansion slots will will have, as well as possibly whether it can handle 1 or 2 CPUs and the number of memory slots available.

Also, for a media server, make sure you get at least a 750va power supply.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You probably can't boot from it on the HP since the CPU and BIOS IDs will have changed, and the HP uses different drivers than the Dell so XP won't like it, but as a second disc, you can access/use it for data storage and installing new software.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What exactly do you mean by "hdd regenerator"? Something to fix or restore a disc image?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might try the open source AV tool ClamWin. Besides scanning files, it can also scan what is loaded into memory.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you know the images are identical to the original except for the markings (btw, you missed the horizontal line under the bird feeder in the second image), then a subtractive algorithm would be appropriate - subtract the pixels in the original from the marked up copies.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

assert() is very useful (and commonly used) in debugging new code or unit testing code. You build it debuggable, run your tests, and if an assert (used for range/bounds checking, valid states and data, etc) triggers, then you can run the code in the debugger and see what is going on directly so it can be fixed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In your code here in main():

for(int i=0;i<n;i++)
{
    g.addEdge(n1,n2);
}

Neither n1 nor n2 are initialized - they just contain garbage data from the stack.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you mean by "hdd-regenerator" software? HDD - Hard Disc Drive? Regenerator - restore file system, disc image, what?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What OS? Did you go to the samsumg website to look for drivers for your device/OS?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please show example of what you are having problems with.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but the terms of service for this site do not allow us to do your homework for you. Make an attempt to solve the problem, then post your code (or pseudo-code) here along with your results, and then we can help you sort things out.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Flex is a lexical analyzer. I suppose you could use it to convert php to pdf, but why? It is a totally inappropriate tool for the job. Most programming editors that can handle php can also generate (write) pdf documents from that text.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not a modem problem. It is a DNS problem. Take your modem back and get a refund. Verify that the TCP/IP settings are pointing at the Comcast DNS servers, and not your router (a common problem for this sort of issue). In most home/small office systems, your router is your DNS server, and it forwards request to resolve internet names (hosts) to IP addresses to your ISP systems. Sometimes they get their memory full, so you can try to fix that by shutting down the router/modem and restarting it/them. That has worked for me. The better alternative is to configure your TCP/IP settings to use the actual DNS server addresses of your ISP (Comcast). That's what I do, and it is a LOT faster (usually) in getting you to the sites you are interested in.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you updated the game to work with Win 8.1? It may need some new software/drivers/whatever to work properly. My best guess is that the igdkm64.sys is out-dated.