rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Start Googling, visiting the MS and Dell user forums, and such for a start.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. I thought maybe that's what it was for, but then I never have used a system with that feature! Sounds like something you can live without. Also, there is the distinct possibility that since this media-OS would have to support various DRM functions, it may have been made uncopyable by creating a couple of "bad sectors" that only their software could read/decode, thus preventing it from being cloned. It would not be the first time this has been the case, and there are any number of examples of copy-protected CD's and DVD's that utilize that technique!

So, that takes us back to the registry issue, in fixing it so that the software in question doesn't barf on the missing partition.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, I have been using Dell computers for years, but I'm not familiar with that one! What do they store there? DRM stuff?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Your OS is probably looking for the recovery partition, that is the "hidden" partition, which allows you to recover if your OS is munged for some reason. Are these Sata drivers, or are they older IDE drives? I'm guessing IDE...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, I've never had problems with Apricot's products in the past, but that was long past. I take it, from looking at their web site, that this tool is freeware? I wasn't able to find a price, and it seems to allow unencumbered downloads. Did you run the tool from the .exe installer, or did you run it from the CD ISO image? If from CD, did you remove the CD from the drive? Are there any CD's or DVD's in the drive?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

C++/CLI, it's C++ extended to meet CLI requirements and fit into the .NET framework as a managed language.

It still is NOT C++! It is C++ "extended" to work with C# and other .NET languages. Also, the rest of his code may be valid with .NET, but NO C++ compiler I work with, except possibly Visual Studio .NET (which I avoid like the plague), will compile this code. So, it does not, IMO, belong in this C++ discussion thread.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Re. Deceptikon. True. One could use sizeof(int) to determine where to look, such as ptr2tmp[sizeof(int)-1], which would also work on some embedded systems where sizeof(int) == 2 (16 bits). I just prefer disambiguation to clarify what EXACTLY I am doing. Also, if you are going to do the *(char*)(&unusedvalue) method, as you noted, the original poster's test will be reversed since this looks at the little end of the array. It should be:

int tmpvaluethatwillneverreallybeused=1;
bool bigendian=(*(char*)(&tmpvaluethatwillneverreallybeused)==0);

And finally, my last comment. My point about the code being limited to C++ is still valid. If you want to use this is a C program, then you are SOL and STILL have to place the non-const parts in a function somewhere.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

1. Put your code inside code blocks (see formatting symbols on top of message input window).
2. Show ALL of your code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Huh? What are you trying to accomplish? I don't think this will work, your latest posting. First, test and deal with the empty situation where front (or rear, you can use either) == -1. Next deal with when rear (the "end" of the queue) is at the end of the array, detecting if the queue is full (front == 0). Finally, deal with other situations, detecting if the queue is full ((rear+1) == front). This will allow the front and rear markers to safely wrap around the end of the array, creating a circular queue. The steps I noted here, testing for empty, testing for end-of-array, and finally normal processing, is necessary because you ALWAYS want to detect boundary conditions (empty, end, full) as soon as possible before you get on to normal processing. This is a rule you should learn, and never forget when doing this sort of algorithmic programming.

So, in the words of a professor I once had, "Go home, redo it, and bring the results back to me in the morning!"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In Java 1.5 there were some significant enhancements to the language (particularly Generics) and many classes were updated to use the new language features. Code written before 1.5 still works, but the compiler issues warnings where the code should be updated to the new standards.
If you're still re-hashing the same tired old course material that you've had for 10 years it's easier to suppress the warnings than to update your material - it doesn't matter if you're teaching bad practice.

Very good point James. I tend to babble on. Your reply was spot on with regard to Java in particular. I had been out of Java programming for 6-7 years until recently, and have been seeing exactly the sort of warning you speak of when compiling my new company's code base. Because I am now the senior performance engineer for this product line, such warnings are important to me as much now as when I was principal engineer on major C and C++ projects.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are good GUI tools for both python and C++. Most people consider C++ more difficult to learn. To me, each is JAPL - Just Another Programming Language - I have used C, C++, Basic, Visual Basic, Java, PL/SQL (a dialect of ADA), Transact-SQL, Cobol, Dibol, x86 assembler, 8008 assembler, dBase, SQL, Quel, Smalltalk, ksh, sh, csh, bash, perl, python,... At this point, it really doesn't matter to me.

In any case, if you are going to use a GUI and want to use C++ as the language, then check out Qt for the GUI and general development framework.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Note that in my example, there are alternative implementations where resetting the rear indicator is not necessary. However, that is an enhancement. The code I provided shows clearly what you are trying to accomplish, and should do that nicely. Efficiency and code reduction can be done later.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, you aren't accommodating the possibility that front can be > rear when the queue has wrapped around. IE:

void display(){
	if(rear == -1 || front > rear)
		cout << "Queue is empty!";
	else
		for(int i=front; i<=rear; i++)
			cout << queueArr[i] << " ";
}

I guess what I'm saying, is that what you have implemented here is NOT a circular queue! Another observation is that when front has reached the end of the array, it doesn't wrap back around to index 0.

So, break the problem down into discrete operations within each function.

Enqueue:

// Set full indicator flag to false.
bool isfull = false;

// Check if queue is empty.
if (front == -1)
{
  front = rear = 0;
}
else if ((rear+1) == SIZE)
{ // reached end of array - wrap around.
  rear = 0;

  // Check for queue full.
  isfull = (front == 0);
}
else
{
  ++rear;
  if (rear == front)
  {
    // Overflow.
    isfull = true;
  }
}

// Now, test if queue is full.
if (!isfull)
{
  queue[rear] = newvalue;
}
else
{
   // Overflow, reset rear
   if (rear == 0)
   {
     rear = SIZE-1;
   }
   else
   {
     --rear;
   }
   throw QueueOverflowException;
}

This (untested) code should allow for the queue front and rear to wrap around from the end to beginning of the array. This is a common algorithm that is used frequently for circular buffers where you don't want the overhead of a linked list, …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Remember, with recursion, just as with loops, you need a terminating condition that will ALWAYS be reached (unless you want an endless loop), which we sometimes call a barrier condition. You need to test for when you reach a value less than 10, so change your code for D(int) to something like this:

static int D(int n) 
    {
        if (n < 10)
        {
            return 0;
        }
        return (D(n - 10) + n);
    }
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Alternatively, you can use an array of pointers to House. IE:

int numHouses = 100;
House** someHouses = new House*[numHouses];
for (int i = 0; i < numHouses; i++)
{
    someHouses[i] = 0;
}

Now, when you want to see if you have a house there, the contents of that entry in the array will be 0 (null) if it hasn't been used yet.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Probably the new drive doesn't have the same "signature" (configuration, size, whatever) as the old one, so possibly the shell hardware detection service saved some of this information about the boot drive when the system was originally installed, and now is taking its time to decide that everything is ok to boot. These are probably registry entries. Which ones are relevant I have no clue. When you cloned the drive, are you sure it was EXACTLY the same as the original drive? Or is it bigger, a different manufacturer, or ANYTHING that may differ between them? And how did you clone the system? Details please.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Make sure you are dealing with 32-bit integers. If so, then you can do this.

const int unusedvalue = 1;
const char* ptr2tmp = (char*)&unusedvalue;
const bool bigendian = (1 == ptr2tmp[3]);

Why do it this way, instead of how you showed it? Because it is clearer in what you are doing, and will not take any more processor time. It may, in some situations, be safer as well. Do note, however, that this won't work for C since the initializer of the bool value has to be constant, not an expression like this is. You would have to declare it non-const and compute it after you enter main(). This may be better, and it would work with both C and C++.

int isBigEndian(void)
{
    static const int unusedvalue = 1;
    static const char* ptr2tmp = 0;
    static int bigendian = 0;

    if (ptr2tmp == 0) /* Uninitialized - compute bigendian */
    {
        ptr2tmp = (const char*)&unusedvalue;
        bigendian = (1 == ptr2tmp[3]);
    }
    return bigendian;
}

The value of bigendian is only computed once, and is thereafter easy to determine by simply calling isBigEndian(), plus this code can be used as-is in either a C or C++ program.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is C++? Not on any planet I am familiar with, and I have only been programming C++ for 20 years, professionally!

One question though, bogus syntax notwithstanding - what is gcnew? Is that a garbage-collecting operator new allocator? From what I know, this is a .NET term, which has zip, zero, zilch to do with C++. So, if this question is for a C# program, then post it to that discussion thread!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is C++ exercise? You show code, but no data structures (classes) for modeling this problem. This means that you are going backward, from code to structure. You need to design the classes you are going to use in terms of their contained data (attributes/properties) and behavior (methods/functions). So, what do you need?

1. A class for the queue I think.
2. A class for members of the queue.

The queue class should probably have a pointer to a member of the queue. Each member should have a pointer to the next member in the queue, and the last will point back to the first. That way, a pointer to any member in the queue object itself will be sufficient to reach any other member, so call that the "current active member"?

Anyway, your code as you show it now is C code, not C++. No classes == C code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Any programming language would let you do this. Which ones are you familiar with? Which are you most comfortable with, and why?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My rule is NEVER to suppress warnings! They are there for a reason, and sometimes they give good indications that some code is going to be problematic. Your professor may suppress them for class projects because he knows they are "noise". Myself, I have to design and build systems that support quite literally millions of users, and that have to run ABSOLUTELY 24x365 with zero downtime (results are not fatal in my current position like they could have been in my previous job, but really irritate our users, who can easily switch to another service). So, our goal is to build code with zero warnings, and if there are, they need to be documented and explained.

So, use your discretion, but realize that the habits you learn today will be what guide you in your career, and if that is going to be systems or software engineering, then it can be a problem for you if you start cutting corners now. FWIW, I am Senior Systems Engineer for one of the biggest mobile phone companies in the world, and in a previous incarnation was Principal Architect and Engineer for the manufacturing execution system that runs most of the semiconductor, flat-screen display, and disc drive manufacturing plants in the world today. There, we would not tolerate suppressing warnings from compilers - our customers would lose over $10M USD in profits for every hour their systems were down, and a 5 minute software glitch could result in hours of fab downtime. …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

BTW, didn't you disconnect the system from the mains before you installed the RAM modules?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you switched from 230v to 110v, or 110v to 230v? If 110v to 230v then cooked motherboard is what you have. Do you want fries with that? :-( When you switched it and turned it on, it is likely the voltage to the system was too low and as a result, a HUGE surge of current hit it. The technical term for this situation is "letting the smoke out". I think it is time for a new computer...

If you were running on 230v and switched to 110v, it may have only cooked the PSU, but chances are a surge hit the motherboard before the fuses/circuit breakers reacted, resulting in same situation of "letting the smoke out".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You also need to scan your disc for bad sectors. They may be readable after a few retries, so checkdisk/f may still succeed, even though the disc is starting to go off the road.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just about any current PCI-E x16 card will work, which these days means that mostly you get either AMD/ATI or nVidia cards. Myself, I prefer nVidia cards, but that's because they have better Linux support and I only run Linux systems. I used ATI cards exclusively back in the deep, dark past, and still have a couple on older systems that I keep around in my "computer museum"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Windows does this when copying large amounts of data to USB flash devices and thumb drives. I have experienced this frequently on my Windows 7 work system. I think that it is not responding properly to buffer-full conditions on the flash device. I remove the drive, and plug it in, restarting the copy from where it stopped. I had to do this numerous times recently when copying about 20GB of training videos to a USB flash drive for my company. Never had this issue with XP, but then I haven't used it for such purposes for a long time. My main OS is Linux and it doesn't have this problem! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These are the kernels installed on the system. As you update with yum, new kernels, with security and other fixes in them, they are added to the boot menu, with the latest as the default. The others are there so that if the new kernel causes you problems, you can reboot to the older one(s). Also, they don't take much space, and the system will delete the oldest after a certain number are installed. In any case, DO NOT remove the recovery one.

If you want to know more about this, read the Grub documentation. That is the boot-loader that all Red Hat systems use. The kernels and grub configuration files are kept in /boot in case you are interested. In any case, DO NOT remove anything from this directory until you know EXACTLY what you are doing!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

BTW, I hope this device was free (or close to), since IDE drives are REALLY old tech these days, and a docking station or enclosure will run you about $50 USD.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

1. Purchase a USB docking station or enclosure for the drive.
2. Plug it into the system.
3. Go to the (assume you use Windows) disk manager tool and remove any old partitions.
4. Add a new NTFS partition.
5. Format the partition, selecting the "full" vs. "quick" option (or similar).
6. Scan the new file system for bad blocks - the tool will instruct you to reboot to do this since it is done before the system restarts and mounts the new file system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sounds like the hardware is starting to go "wonky" - technical term for random failures. Vacuum/blow the dust out of the system. Let it cool down totally (shut down for at least 1 hour). If the problem persists, then it's time to take it to the repair depot!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

ClamAV works just fine as x86_64. How are you trying to install it? From source? On Fedora or RHEL, you can install x86_64 ClamAV from either the atrpms or epel repositories. Use either of these repositories and you should be able to install it just fine using yum. Most use the epel repository.

FWIW, the epel repository should be in the normal Fedora repositories. Just execute the command "yum install epel-release". Then after you install that, try "yum install clamav.x86_64".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I've found most of those drive-related crypto/security tools pretty worthless. If you want to encrypt your drive, use something like TrueCrypt. It works on Windows from XP through Win7.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The C library read(), write() calls are probably the most efficient. What, exactly, are you trying to accomplish?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Linux AV is useful if you are using your system as a mail, web, or file sharing host, in order to scan files and emails as they are uploaded and stored to the system. Clam is popular for that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, most systems have ClamAV in their repositories so you should only need to execute "yum install clamav" as root from a command-line.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are no drive designations in Linux. Everything is under the root file system, which is / - user directories are under /home, user commands are in /usr/bin, etc. As a simple user, usually you will be working in your /home/userid directory.

As for free anti-virus for Linux, the most commonly used one is ClamAV. You can get that at www.clamav.net

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Hash tables are simply 2-dimension arrays sorted by the key (hash value). The hash value is a mathematical representation of the data stored. There are a number of hashing algorithms that are used these days. The "key" is to select one that will minimize the number of collisions - situations where different data values will result in the same hash value. Hash tables have the ability to deal with this, by having overflow buckets. IE, each hash value can have any number of associated data values, each in a slot in the overflow array. Obviously, if this is a frequent situation, then performance in finding specific items can be seriously impacted, hence the desire to have non-colliding hash algorithms. Generating a good hash can be expensive in terms of CPU time, but cheap in terms of lookup times, especially if the table is stored on disc.

A very good source to study this subject is Knuth, The Art of Computer Programming - Volume 3, Sorting and Searching, published by Addison/Wesley. One of the later chapters deals with hashing in some detail. FWIW, the Berkeley DB libraries for C/C++ are hash-table implementations.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, if the CPU fan is not running, then there may be a power supply (or fan) problem. I doubt your issue is the monitor, though possibly the video board (integrated or otherwise) may be fubar. I assume you get no BIOS splash/boot screen?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, when working as a consultant and computer security professional (back to employed status as Senior Systems Engineer for tier-one mobile phone company), I would always use a Linux system to scan and disinfect Windows drives, and never was not successful in doing so. However, I would use 2-3 different professional-level scanners as they each catch different stuff. Where each intersected, that was a definite problem to be removed. Where 2 of 3 intersected, likely same. Where only one of 3 would find a problem, I would investigate further. I have found that a lot of modern viruses will also infect the shared libraries on the recovery partition, resulting in a reinfection if you try to restore the system to factory settings after trying to clean the infection. In any case, it is getting harder and harder to fix this stuff without a complete wipe and reinstall of the OS from read-only media (DVD). Myself, I only run Linux, and run Windows in virtual machines with current snapshots, so if (when) it is infected, I can restore the system to the last known good image. I do run virus scanners on my Linux systems fairly regularly, but so far, after about 10 years, I have never had a problem. Windows - not so lucky!

As you have probably found, NOT using IE for web browsing (using Chrome or Firefox) is probably the best thing you can do to keep from getting pwned.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My guess is that the router will not deal with NTFS file systems. Try reformatting to either fat-32, or ext2 or ext3. Most consumer routers run a variant of Linux, for which ext2, ext3, or possibly xfs or jfs support is built into the OS. So, try ext2. If that works, then try ext3 (more efficient, faster to recover from crashes). If either of those work, then try xfs and/or jfs. The ext3, xfs, and jfs file systems are journaled file systems that recover quickly from system failures. I have embedded systems that support jfs, and NAS arrays that support xfs. Anyway, changing the file system is a fast operation (relatively), so testing all of these to see what works should not be an unreasonable exercise, and informative. If all of the Linux-capable besides fat-32 don't work, then use fat-32, which while fine for simple data storage, doesn't support Linux user/group/permission metadata so you can't execute programs from it, for example.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, for me, on Linux/Unix systems at least, I MUCH prefer a simple Makefile and the standard C compiler options. If you are using Visual Stupido on Windoze, then you should really use the VS environment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume you installed the CDT plugin for Eclipse? What is your OS, and what compiler are you using? Have you verified that your project is using the correct compiler, etc? Eclipse is picking about that sort of stuff.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, if I understand it correctly, what you mean by FCFS is First Come, First Served, which is really (with some caveats) FIFO, depending upon the length of time required to process the request. Anyway, this is a good exercise for an operating systems class in engineering school. So, assume unlimited memory (no swapping) as per the instructions. Real-time means deterministic. IE, you can determine if a task can be completed in a known time frame. Interactive (non-real-time) processes will be dependent upon available resources, of which the real-time processes have priority.

So, much of this depends upon what you specify are specific performance criteria, such as average (best/worst case) disc access times, time slice allocated per process at runtime, and an entire host of other things. This is a modelling exercise. You need to define ALL limits, constraints, and other hardware and software characteristics before you even get started. FWIW, I hope this is not a freshman class! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Download and use the command-line tool ffmpeg. It can transcode just about any video format into any other. I use it frequently (up to several times a week). It is the best audio/video transcoder that I have found, including ones on Windows and Mac. Go to www.ffmpeg.org for details or to download/install.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The key is in the connectors. Visit the Intel web site to see what other processors use the same connectors. Those should be compatible with your current CPU.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what did you find out? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Gah! I haven't had to look at Cobol code for 25+ years! In fact, I last worked with Dec's Dibol after that! I guess there are still Cobol programmers out there... So, what was the question again? :-)

Anyway, what I think you are asking is how you can limit input of bad item numbers (ITMNO) to 5 in a row, correct?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume this is a broadband LTE modem? You need to make sure you have a very good connection to the appropriate tower. If you don't, then you will get some fraction of the maximum speed the device is capable of. What does the manufacturer documentation say?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A modem requires a "powered" usb port. Some only provide enough juice for things like thumb drives, but many laptops only provide 1 port with enough power for things like broadband modems, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What OS (including version and service pack) are you running, and what make+model is your mouse? Do you have any other weird display issues?