rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You may need to build from source for that. I do know that my Linux version of ffmpeg (binary installation) has the x264 lib installed by default. Don't know about the Windows version though.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Disc space, the final frontier! RAM is just an aspect of that... RAM is only an issue if you run out of it and the system has to use virtual RAM (swap space) which, as it resides on disc, is relatively sloooooowwww... If you can monitor your system resource usage and see that you are not using swap space, then more RAM will not speed things up. If it is, then adding more RAM is a wise (and relatively inexpensive) choice.

FWIW, both my laptop and workstation have 8GB of RAM, and I run virtual machines on both, without hitting the swap space. Occasionally I would like more RAM, so I can run multiple virtual machines at one time, but that is a "nice-to-have" option, not a requirement... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As mat1998x said. However, BlackBox (the company) has a lot of really neat adapters that may work for you, to use your laptop as a video output device. Ok, looked at their web site and found nothing (after a quick search) that will suit your needs. :-( You can look yourself: www.blackbox.com

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can do that with either hardware, or software RAID tools. If the system has hardware RAID capabilities (accessible via the bios usually - enable verbose boot so you can get into the RAID bios) then you can set it up to use 2 drives as a single disc image, and the other 2 as the mirror device. If not, then you will need to use the Windows Sever RAID tools to do the same, which should be accessible when you run the installer disc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Take it to the local Apple Store for repair.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"can't find it" -> "can find it" online... :-) Danged keyboards! Never type what we intended!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One final option, is that Ubuntu has a Windows installer, and will install it as a dual-boot system, but the Ubuntu/Linux partition is a virtual disc that resides in the Windows file system. IE, it won't require any physical partitions, but it WILL alter the boot sector of the drive to use the grub2 boot code, and will provide a boot menu that will let you chose from Windows or Ubuntu at startup. You just need enough disc space on your windows file system for the Ubuntu virtual disc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Normally, USB devices such as flash drives should auto-mount, though I don't use the Chrome OS per se (my normal operating systems are Red Hat Linux clones). In cases where they don't auto-mount, you can do this.

  1. Before inserting the device in a USB port, look at the drives in /dev, as in "ls /dev/sd?"
  2. Insert device.
  3. Look at /dev/sd? again (after a few seconds to allow the system to detect it) to see the new device ID. IE, if before you had /dev/sda and /dev/sdb, then after you should see /dev/sdc.
  4. Once the system has detected the device, you can mount it to an empty directory of your chosing, such as /mnt/usbdrive: sudo mount /dev/sdc1 /mnt/usbdrive

This last bit assumes that the device has a partition which would be seen as /dev/sdc1. You can tell with the command "ls /dev/sdc*', assuming that that device is detected as /dev/sdc. In any case, this would be pretty normal. Note the use of the "sudo" command - that allows you to run a command, such as "mount" as the system administrator (root) account.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We don't solve school work problems for you. Make an effort to solve them yourself, and we may decide to help you correct/fix them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One of the main reasons to use references rather than pointers is that you don't need to check for a null pointer. The object must exist to get a reference to it. A pointer may or may not point to a real object (null if not).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Did you configure your VirtualBox network interface to use a NAT address, or a bridged address?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, I have to ask, what EXACTLY are you trying to do?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

On my system, the 'transforms' command doesn't exist, so the output of this command is always '0'. I looked in all of my application repositories, and could not find it - even trying to install what I thought might be relevant packages. Still no luck! Anyway, let's look at the processes in detail.

  1. The command 'echo ${0}' returns the command name that executed - in this case, 'bash' - the shell command that I am running.
  2. That is piped into the command "grep '/transforms/'" - which due to the path specified, must exist in the / (root) directory of your system - unlikely...
  3. The output of that is piped to the 'wc -l' command which would return the number of lines from the '/transforms/' command. Since that (/transforms/) doesn't exist, the output is '0'.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of well-known methods of generating a GUID (Globally Unique IDentifier) which can be used as account numbers. Here is a link to a Wikipedia article about that subject: http://en.wikipedia.org/wiki/GUID

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Those weren't questions... They were requests to solve a problem for you, not for help understanding the domain...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Didn't I answer this in another post?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you want 100% control over your software build process, then the only option is (IMO) make w/ appropriate Makefiles, standard compiler, and a command line debugger. I've used many IDE tools such as Visual Studio, Eclipse, Code-Blocks, and others. I always revert to make+Makefile for my serious work.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read Knuth, Wirth, et al. FWIW, no one knows it all...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  • 10% of his income for life... :-)
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I've had this happen with one of my Dell laptops. It required a motherboard replacement on one occasion, and a disc drive replacement on another. If cleaning the vents and removing the dust from the motherboard doesn't deal with the situation, then more serious repairs are indicated.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My opinion? Install CentOS 6 (a clone of Red Hat Enterprise Linux, but without license/support fees). RAID? Optional, but more reliable than LVM. I'd recommend a 4 disc RAID 5 array with hot-swap capabilities. That way, when one disc goes south for the winter (a technical term for failure), it will continue to operate until you replace the drive, and then rebuild the drive automatically, returning you to full operation without much effort on your part, other than swapping out the failed drive.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Why do you want to switch it off? If you need to keep an object in memory, then assign it to a global variable that can keep it in reference. Disabling reference counting is a sure fire way to have serious memory leaks...

FWIW, I designed and built a reference counting garbage collection suite for C++ that allowed us to have 10M lince of application code, and zero deletes (at the application level), yet no memory leaks. It is a subject I have spent considerable time on research and development.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try this:

#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
    int maxArray[10];
    int maxValue=0;
    for(int j=0; j<4; j++)
    {
        cout<<"Enter a number: ";
        cin>>maxArray[j];
    }
    for (int j = 0; j < 4; j++)
    {
        if(maxArray[j]>maxValue)
        {
            maxValue=maxArray[j];
        }   
    }
    cout << "The highest value is: " << maxValue << endl;
    getch();
    return 0;
}

Yes, you could evaluate the maxvalue in the first loop, but I like to keep my input, evaluation, and output loops separate. Just personal preference, and it helps me to keep "domains of responsibility" distinct.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It sounds like you want to convert a text-based / command-line program to run in a GUI. Correct? Then there will be a lot of cruft to deal with to make it work that way, coding wise. Not difficult - just tedious. The functional logic won't change, but include files and changing main() for WinMain(), etc. will be some of the differences you will encounter. As we say in the business - RTFM! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, your question is... what?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You missed the "then" clause in this block: if [ ${i} == "Screenshot*png" ]

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your question is? If this is homework, please make an effort to solve the problem. We aren't here to help you cheat!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I stand by what I said originally. In my experience (about 15 years) with Dell, they don't overcharge for repairs - board replacements or whatever, and you know that it will work when you get it back. If you are an engineering genius (like my grandson), then you might try to fix it yourself. I am a serious EE and I don't bother to futz with this stuff - it just isn't worth my time! Also, although my grandson can do miraculous stuff with systems and motherboards, occasionally he screws the pooch, and needs me to bail him out (usually to the tune of a couple hundred $$)... :-) That said, most of the time his soldering skills are up to the challenge!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What L7Sqr said. The attributes you set on the directory means that anyone can, read, write, and access, files there. That may or may not be what you really wanted to do. It doesn't mean that they can modify files that already exist there, though that may be the situation depending upon the user id of the web server process.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It was working before you cleaned it up? Check again for broken connections and such. Make sure all socketed chips are well seated and that their connections are clean also. A can of compressed air is your friend here... :-) I think it is worth a second pass on the cleanup. If it still doesn't boot, then it is time either for replacement (something other than HP), or a visit to the HP repair depot.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is likely that the attributes on the directory in question don't allow this. You need to enable the read, write, and execute permissions accordingly, assuming that the directory is not owned by the writing process(es).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Glad to help. As the man page notes, most of this stuff is compliant with the iso standards for the C-preprocessor, so (at least in my experience), the internal stuff is relevant to most system compilers, including Visual C/C++. In any case, I never had an issue with that in many years of cross-platform software development.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is a copy of the Linux C Preprocesor man page (it is a bit long):

CPP(1)                                GNU                               CPP(1)

NAME
       cpp - The C Preprocessor

SYNOPSIS
       cpp [-Dmacro[=defn]...] [-Umacro]
           [-Idir...] [-iquotedir...]
           [-Wwarn...]
           [-M|-MM] [-MG] [-MF filename]
           [-MP] [-MQ target...]
           [-MT target...]
           [-P] [-fno-working-directory]
           [-x language] [-std=standard]
           infile outfile

       Only the most useful options are listed here; see below for the remainder.

DESCRIPTION
       The C preprocessor, often known as cpp, is a macro processor that is used automatically by the C compiler to
       transform your program before compilation.  It is called a macro processor because it allows you to define
       macros, which are brief abbreviations for longer constructs.

       The C preprocessor is intended to be used only with C, C++, and Objective-C source code.  In the past, it has
       been abused as a general text processor.  It will choke on input which does not obey C’s lexical rules.  For
       example, apostrophes will be interpreted as the beginning of character constants, and cause errors.  Also, you
       cannot rely on it preserving characteristics of the input which are not significant to C-family languages.  If
       a Makefile is preprocessed, all the hard tabs will be removed, and the Makefile will not work.

       Having said that, you can often get away with using cpp on things which are not C.  Other Algol-ish programming
       languages are often safe (Pascal, Ada, etc.) So is assembly, with caution.  -traditional-cpp mode preserves
       more white space, and is otherwise more permissive.  Many of the problems can be avoided by …
christinetom commented: Big help, thanks +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A good example of why you should not declare multiple variables together, but better one per line / declaration statement.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Safe from copying unauthorized data to the drive? Safe from prying eyes (unauthorized access to the data they contain)? Even the CIA has rescinded their ban on the use of USB drives because they are just

  1. Too difficult to control/manage.
  2. Impossible to avoid use of (sneaker net is still a viable means for moving data between systems).

In any case, there are a number of techniques to keep people from copying unauthorized data to the drives, such as access-control lists to limit an individual's access to data they aren't supposed to get to. These can control what type of access they may have as well, such as viewing, printing, copying, copying to a mobile device, etc. SELinux has those capabilities (after all, it was developed originally by the NSA, and we know just how effective that was with Edward Snowden), as I think Windows does also, if enabled / implemented appropriately. As for prying eyes to data on the USB drive, you can easily encrypt the drive contents so that you need to have the key to access it. See www.trucrypt.org for that. There are also means to monitor what data is copied to movable media, sent via email, etc. In that case, you don't limit what people can do, but you can monitor it and deal with data breaches as appropriate, up to and including legal action.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, my previous answer aside, you COULD create a bit of software to emulate such a device. That could be implemented in firmware or a programmable gate-array (LPGA) to do what you want. Much more feasible than creating a custom IC to do it... :-)

In any case, it is apparent that you have some good ideas, but are effectively clueless on how to implement them in reality. In my opinion, you have a LOT of intensive studying to do before you move on to the next step. Good luck! I do mean that. I started my career in much the same manner, asking "why can't we do that?", and searching for methods / means to do so. Fortunately, I had a number of friends to help me on my way, some of whom are stellar lights in the semiconductor field.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

IC's (integrated circuits) are just that, electronic circuits constructed of a myriad number of transistors, capacitors, and resistors. Yes, if you know enough electrical engineering to design a device with discrete components (transistors, capacitors, resistors) to implement the device in question, that could be translated to an integrated circuit; however, the physical processes of building such a device as an IC requires a LOT of specialized equipment. Some major university EE departments have such, so if you are a student at such an institution then you could (might be able to) build the device. If you aren't, then it is effectively impossible unless your work in the R&D department of a major research institution, government lab, or semiconductor manufacturer. FWIW, I have 30+ years developing software for the semiconductor industry, consulting with most all semiconductor manufacturers, and am a director of an IEEE affiliate organization, so this is a subject that I am intimately familiar with.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In truth, the return value of a constructor is the object itself, or a temporary reference to an object that will soon disappear. Whether it is assigned to a variable, or a copy (via reference) is, depends upon whether or not it is used in the declaration of the variable, or in a simple assignment operator. Here is an example:

class foo
{
private:
    int m_bar;
public:
    foo(int aBar = 0 ) : m_bar(aBar) {}
};

int main(void)  // I seem to use this pattern a lot! :-)
{
    foo aFoo0;      // Constructed with default value of 0, m_bar == 0
    foo aFoo1(1);   // Constructs foo with m_bar == 1
    foo aFoo2 = 2;  // Operates like the previous, but m_bar == 2
    foo aFoo3 = foo(3); // Copies foo(3) to aFoo3, treating foo(3) as a reference, m_bar == 3
    foo& aFooRef = aFoo3;   // A reference to aFoo3, m_bar == 3

    // Now, assignment from a temporary reference
    aFoo0 = foo(4);     // aFoo0.m_bar now == 4 since foo(4) (as a reference) was copied to aFoo0.
    aFoo0 = aFooRef;    // aFoo0.m_bar now == 3 since aFoo3 is now copied to aFoo0.
    return 0;
}

I'm sure you are confused now, right! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, after this, if we were to increment the value of m_bar in aFoo before we printed the output, what would the output be? You get my +12 upgrade points if you get it right! :-)

This offer only applies to irfan (the original poster)! Please don't try to answer for him...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The dot (.) operator is to access member variables/functions of an object or reference to an object. The pointer-to (->) operator is to acces member variables/functions of a POINTER to an object. Example:

class foo
{
public:
    int m_bar;
    foo() : bar(0) {}
};

int main(void)
{
    foo aFoo;
    foo& aFooRef = aFoo;
    foo* aFooPtr = &aFoo;
    foo* anotherFooPtr = &aFooRef;
    cout << "aFoo == " << aFoo.m_bar
         << ", aFooRef == " << aFooRef.m_Bar
         << ", aFooPtr == " << aFooPtr->m_Bar
         << ", anotherFooPtr == " << anotherFooPtr->m_bar
         << endl;
    return 0;
}

So, the output would be this: aFoo == 0, aFooRef == 0, aFooPtr == 0, anotherFooPtr == 0
In C++ vernacular, a reference is a "shallow copy" - it is a reference to the original object. A pointer is just that, the a pointer to the address of the original object, or in the last example a pointer to the object the second is a reference to. They are ALL accessing the same object! Yes, this is sometimes difficult to wrap your brain around, but it is critical to successfully mastering the subject of C++ programming! Good luck, and keep up with the great questions!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Anyway, that was a great (and informative) question mahesh! Keep asking ones like this, and in 10 or 20 years you will be a C/C++ programming guru! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It mostly has to do with the order of evaluation in your code, which is "implementation defined". IE, on one compiler it may work like you would expect, and another it won't (as this is an example). Consider this, when you call func() the first time, it outputs 0, and returns 1, yet data now has a value of 2 (the value of data before the second increment is placed on the return stack before the increment). The issue is in the line cout<<b.func()<<b.func()<<endl; in main. Since the output is 0231 and not 0123, the compiler is valuating the second call of b.func() before the first (right to left instead of the intuitive left to right), yet the results of the first is output before the return value of the second. Confused yet? :-)

So, the second is evaluated first - printing 0, returning 1. The first is evaluated next, printing 2, returning 3. The return value from the first is then printed in the line in main before the return value of the second, resulting in 0 (from the second), 2 (from the first), 3 (return value from first), and then 1 (return value from second). Confused yet? :-) Welcome to the world of C/C++ compiler quirks!

In any case, this is a good example of a compiler that evaluates arguments to functions in a right-to-left manner (common, due to the use of recursion in building parsers). It is also a good reason to avoid stuff like this: int …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please provide the code, both header and source files, otherwise it will be very difficult to help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It is unfortunately that this has happened to Opera. They are our biggest competitor in the mobile browser arena and we have a LOT of respect for them. The fact is that this can happen to anybody. Let your guards down in any small area for just a minute and some opportunistic creep will exploit it. We learn from our mistakes, and what differentiates the good companies from the bad is how they deal with it. Admit you screwed up, fix it, and move on are the hallmarks of a good company - one you can trust.

That said, we (Nokia) are going to eat Opera's lunch! At least in the mobile universe. :-) At least that's what we'd like to think... :lol:

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some systems do require manufacturer-branded disc drives for the system disc as least. HP has had this issue in the past. I don't personally know about this model. In any case, I don't purchase HP PC's any more, though my company has started to use them instead of the Lenovo systems we have been using for a number of years, and NOBODY likes them, at all! I think that HP just made our purchasing dept. an offer they couldn't refuse... they definitely are cheaper than an equivalent Lenovo. An engineer I have been mentoring on C++ for a year or so spilled coffee on his Lenovo's keyboard a week or so ago, letting the magic smoke out. They gave him an HP as a replacement, and I can't stop his muttering and sub-voce swearing... He is threatening to purchase his own Lenovo (or something other than an HP) for work use! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

2.6.24 eh? Must be Debian Etch. I'll have to dig up my kernel sources for that - they are on a drive currently off-line, so it will probably be next week before I can get back to you about that (going away for the weekend). I use it for an ARM development board I have. In any case, doing that can be very dangerous - caveat programmer! If this is (as is likely) an embedded system and you lock down remote access to it properly, it may not matter, but that is just an observation.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I had one of those once, and found it to be more a hindrance than a help. I agree with Mike2K - mostly snake oil... :-) As CimmerianX says, use trucrypt - it works on Windows, Mac OSX, and Linux. Since it is open source, you can probably port it to BSD as well, if it hasn't been already - the source is available on the trucrypt.org web site.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. What we find is this - there isn't a GCC 4.9 for the Mac as yet. The latest is 4.8. Either you are trying to run a beta version, or you are mistaken - though they have been wrong once or twice before (ok - maybe once). The other thing is that using xcode as a build environment can be a real PITA to configure for tools other than what they (Apple) provide. It depends a lot upon the project according to the boffins at Fermi Lab. IE, you will be playing whack-a-mole for awhile to get it to work. Their recommendation is to revert to "old tech" - a command line terminal and a Makefile... :-) Anyway, that's what they do to build Mac software.

Sorry, but this is a good as I can do to help you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You probably just unplugged it and didn't unmount it or select "safely remove" option from the disc icon. That probably damaged the file system. It can probably be fixed. If you don't need the data on it, you can reformat it. If you do, then you will need to get to a command line window and run fsck on the device/partition to repair the file system. The Mac may have GUI-based tools to do that, but since I don't run Macs that much, I don't know what they would be.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We (wife and I) are conversing via email about this right now. I'll let you know what she says.