rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Windows generally utilizes the entire disc when installed. In such a case, you either need to reduce the size of the C: drive first but since that usually is not a good idea, I recommend that you install Linux in a virtual machine, or install Ubuntu using their Windows installer. In the first case, you can run Windows and Linux at the same time (I do this on my work laptop). In the second case, you will have a dual-boot system, but the Linux data will be stored in a virtual disc that is a file in the Windows file system, and therefor capable of being backed up with normal Windows backup tools. Either approach may work well for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you specifically shared the printer? Are both computers part of the same workgroup?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When a system goes into hibernate mode, usually you need to press the power key to restart it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, unless you are going to limit yourself to Windows systems, don't use backslashes () for directory separators. Use a forward slash (/) instead. Windows will handle that just fine, but the backslash has special meaning in C/C++ programs and it won't work if you want to compile your code in Linux/Unix/OSX, et al.

As for QTreeWidget or QTreeView, it depends upon what you need to do. I assume you are using QT for your UI needs. You really need to first create an abstract tree structure that is not directly aligned with any particular GUI tool set. Then, once you have the tree built that represents the structure as it is, you can use QT, GTK, Wx, or whatever to render it on the display.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That's why you are studing computer science, I presume, so you can learn how to do this stuff? You say you understand the traveling salesman problem? I suspect that if you really did understand it, you could formulate your solution in pseudo code, which could easily be converted into any suitable programmng language, including Java (C++ with training wheels in my opinion). Do that at the least - produce pseudo code to solve the problem, and then we may decide you should be assisted in formulating it in Java... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, in my opinion, this is a nonsensical exercise. I would have my students construct an array with 100 elements that are structures, the first field of which would be the string, and the second would be the count. IE:

struct word_count {
    string word;
    int count;
    };

struct word_count[100] words;
int next_element = 0;

Each word would be looked up in the array, and appended to the array at last_element (with count set to 1), which then would be incremented.

Yes you can use two arrays, but why? If this is required (seems so from the instructions), you would do this:

string words[100];
int word_count[100];
int next_element = 0;

Look up the word from 0 to next_element:

bool found = false;
for (int i = 0; i < next_element && found == false; i++)
{
    if (words[i] == word)
    {
        word_count[i]++;
        found = true;
    }
}
if (!found)
{
    words[next_element] = word;
    word_count[next_element] = 1;
    ++next_element;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can write a program or script that uses inotify to inform you when a file is accessed, opened, modified, created, deleted, etc. See the inotify man page for more information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Back in the 1990's, some ISP's would lock your account to your computer's MAC, so if you changed the computer, or installed a router between your system and the internet, it would not let you connect. The solution was for router manufacturers (Linksys, et al) to allow you to spoof your old MAC address so as far as your ISP was concerned, it was the same device connecting to the Internet via their services. This is pretty much unnecessary any longer as the ISPs quickly realized that the only thing this process did was to alienate their customers.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When booting, hold down one of the function keys (like F2, F12, etc) until you hear a bunch of beeps. That should force the system into the bios setup. Some systems have a special key to do this (Lenovo Thinkpads, for example).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Excellent link! Much better approaches than my suggestion.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

ddanbe - good point! A good engineer can write in 1000 lines what another may not accomplish in 10,000. A great one will reduce that to 100 lines that do no more, and no less, than needed... :-)

This is why most "enlightened" organization measure productivity in "function points" and not lines-of-code. However, that still begs the question as to whether or not those function points are relevant to the comapany's goals - 10 appropriate FPs may be more valuable than 1000 that don't address the organization's needs.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You solve - we critique your solution. We DON'T do your homework for you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ah, building an expression (infix, prefix, postfix) tree! That takes me back! :-) Fortunately, I still have my copy of Knuth handy, including the last volume recently published! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My company hires college interns in their junior or senior year and pairs them with senior engineers to learn and see what they are capable of. The good ones are brought on board as staff engineers when they graduate, and get to keep their internship time as part of their job seniority. A young fellow working with me last year graduated, was hired full time, and after less than a year as full-time employee is celebrating 4 years of seniority! That said, he is exceptionally bright, self-motivated, and prototyped our new Windows phone browser in less than a week...

Math? Important, but not always critical unless you are going into analytics and angling for a position as "data scientist" - we have people with math PhDs for that. Logic (especially formal logic) is, in my opinion, critical for software engineers. So many bugs I have had to track down were due to bad logic, often written by otherwise fine software developers.

My organization works in Java, Java Script, C, C++, Python, PHP, and other languages (bash, Perl, etc). We have a lot of really good Java engineers who are lost with C/C++, and vice-versa. The best don't care about the language - they mostly differ just in syntax and subtle details until you migrate into functional languages (Haskell, et al), but that is an entirely different kettle of fish! :-)

Certifications? We don't pay much attention to those when interviewing people for open positions. If they pass our phone inteviews, …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

To all of your questions, the answer is "it depends"...

Part of the process of "finishing" a programming project is to specify hardware, software, and other requirements to run it. Re. database - does it require an industrial strength RDBMS such as Oracle, or will MySql suffice? Re. graphics - does it require HD video with high framerates, or will lower resolution and lower framerates work (if not as nicely)? How much RAM does it need? If >4GB then it also needs a 64-bit machine and operating system, even if you can use virtual memory (disc swap space), unless the hardware supports PAE to allow the OS to utilize more than 4GB of RAM (processes are still limited to 4GB).

All of these questions need to be considered before you determine if your software can run on a "normal" machine vs. a server or big workstation class system. These days, a "normal" computer can handle just about anything you throw at them, if not as effeciently as one that is sized to handle the specific load your are throwing at it. Example: my personal workstation is a dual 64-bit cpu with 8 3GHz cores, 8GB of RAM, 10+TB disc, dual HD display video. This is far faster and more capable than supercomputers of a few years ago, though I could use some more RAM... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What won't let you upload files? Text files can be attached to DaniWeb postings, or you can directly embed source files in your post.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is NOT x86 assembly code. It is mostly some sort of macro assembler. Without knowing more about the macro language, I personally cannot help you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Image processing is a VERY specialized field. Read some of the literature on the subject, including papers from from the SIGGRAPH group of the ACM. I don't doubt there are people who lurk on these forums who are knowlegable in the field, but there can't be many... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Use the 'find' command with the -exec option where you will move the qualifying files to a specific folder. Example:

find /dirname -type f -name '<pattern>' -exec mv {} /targetdir \;

This will move all files under /dirname to /targetdir. It will skip directories (using the -type f argument) and only apply the command to files.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is perfectly sensible, if not well-written... :-) There are a lot of C++ coding nuances that you are missing, such as when to pass an object vs. reference (const vs. non-const) to a function such as B::method_b(A ab) vs B::method_b(const A& ab) or B::method_b(A& ab). The effects of these different constructs can be significant.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The most common type of recursion is what we call "tail recursion" - a function directly calling itself, which is what you are doing here. There is indirect recursion where a function A calls function B, which somewhere down the line agains calls to function A.

So, yes your FUNCTION is recursive. A recursive program is something else entirely... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Why are you running a 32-bit version of Win7 on this system?
  2. What sort of "bottleneck" are you expecting? The GTX 670 should provide significantly improved performance for your graphics. If your PCIx bus cannot handle the full bandwidth of that card, then you may not experience the full performance of the card, but it should still be better than the GeForce GTS 250 you are using now.
  3. A new CPU won't give you better performance unless you upgrade to and i7 with more cores, and at LEAST the same core speed (3.2GHz).

So, get the new video card, change to a 64-bit OS, and add RAM.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you mean? IE, disallow auto-mounting of the drive when plugged into a Linux system? Look into disabling the autofs service after the service boots up.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you are in your 3rd year and have not yet come up with a good thesis subject then I wish you luck! FWIW, networks imply distributed systems. There are huge numbers of significant problems to solve in that domain. Look at zeromq and similar messaging tools for ideas.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is often the symptom of a virus or trojan, assuming you haven't made significant changes to your system configuration just before this started.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you read Clocksin and Mellish? That is the Prolog bible...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I recently wrote a C++ program to take sar data from a linux system (system activity reports) and convert it into time-series metrics. The code is about 1500 lines. The original code took a few days to write. Getting it into production in a major corporate environment to monitor all of our world-wide servers (2000+ servers in 4 data centers) has taken another 9 months... most of which is politics and smoothing the rough edges (reliability, availability, failure-tolerance).

The basic project (capture system performance data into a time series database) was not difficult. Less than a week of effort to prove the concept and get valuable data from production systems. Just a lot of string parsing and filtering.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In some cases, mutex locks are preferable. Are you allowed to use those? You can simulate a mutex with semaphores, but it isn't simple.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I guess you aren't a genius! :-) Then, without pondering this problem for awhile, I am not either... Good problem though, so I think I'll try to figure it out, but don't expect me to give you the answer!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How many angels can stand on the head of a pin? :-)

QDOS (Seattle Computer Products - source of MS-DOS)
PC-DOS (IBM from Microsoft)
MS-DOS (derived from QDOS)
CP/M (Digital Research)
TrsDOS (Tandy OS for Trs80 computers)
Multics (predicessor to Unix)
Unix (AT&T - Bell Labs)
Ultrix (first DEC Unix)
DEC 10
DEC 20 (if you don't have 36 bits, you aren't dealing with a full DEC)
DEC VMS (awesome, but incompatible with the rest of the universe)
Thoth (first micro-kernel OS)
QNX (originally Qunix - based upon Thoth - first commercial real-time micro-kernel OS)
BSD Unix (UC Berkeley version of Unix - source of Apple's OSX and iOS)
Linux (too many versions to name)
AIX (IBM's version of Unix)
HPUX (HP's version of Unix)
SunOS and Solaris (Sun's versions of Unix)
SysV Unix (System 5 Unix - source of Solaris)
Windows (name a version from 1.0 to 8)
.
.
.
And we haven't even touched mainframe systems... :-)

In any case, there isn't enough time in the universe to list them all.

FWIW, I currently have computers that run 2 versions of QNX, several versions of Linux, DOS, Windows (XP and 7), Solaris (in a virtual machine), and I'm not really sure what else. Some of the systems haven't been fired up for a few years.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think that what Momerath is saying is DON'T ASK US TO DO YOUR SCHOOL WORK FOR YOU! :rolleyes:

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Depending upon the hash algorithm and the order of the table, collisions are common, so you have to traverse the chain to determine if you have a match if you are doing a lookup/comparison. With a sorted array, searches are nominally slower, but as deceptikon said, range searches and ordered output is a LOT simpler. I have written both types of collections in my past, and except for certain situations (random lookups, and low chance of collision), I have found that sorted arrays are preferable in the general case.

So, the rules are probably thus:

  • if you are doing random lookups and don't need range searches, use a hash table.
  • if you need to acces things in sorted order (range searches, etc), then a sorted array or some sort of B-Tree is preferable.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please show your code. There are a lot of ways to implement timers in Linux, some of which are thread-safe, and others are not. I do a lot of this in the work I do as a systems engineer.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Usually the inability to view YouTube videos is due to missing codec plugins for your browser. What OS and browser (including versions) are you running? Is this a 32-bit, or a 64-bit system? If 64-bit, is your browser 32-bit or 64-bit? All of these questions are important to help you fix this problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Boot into Mint, and then post the output of the command (as root): fdisk -l

If your disc has some unused space, you can increase your Mint partition size, and then resize the file system. Also, you can either create a swap partition (best performance), or create a swap file in the Mint partition. Swap is important when your memory needs exceed your RAM. It can also be used for cache memory.

Anyway, when you post the output of "fdisk -l", I can better advise you on what to do. FWIW, I have to do this at work quite frequently when people don't allocate enough disc space to their file systems. In general, the steps are these:

  1. Use fdisk to increase partition size.
  2. Boot with live cd/dvd.
  3. Run the command: fsck -f /dev/sdxN (the partition with the file system you are going to increase in size).
  4. Run the command "resize2fs /dev/sdxN" to resize the file system. This assumes you are using an ext2/ext3/ext4 file system. It will work with any of them.
  5. Reboot into the native Mint OS.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Alternatively, you may need to reconfigure your router/firewall to allow incoming connections via ports 5060 and 5061. There may be other ports that you need to open as well, but I'm not sure if you need them, for example SIP directory services (port 5059).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Or just:

export PATH=$HOME/bin:/usr/local/bin:${PATH}

This gives precidence to executable files in your personal bin directory, then to those in /usr/local/bin, and finally to the default PATH environment. Note the {} around PATH. That allows a recursive path definition like this, especially if the existing PATH environment is complexly defined. It is safer than not useing the curly braces.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I don't know what the source resolution was, but remember that DVD's are mpeg2 encoded, and limited to 720x480 (US/NTSC) or 720x525 (Europe/PAL). In any case, you aren't providing enough information to tell you why it has lost quality. IE, if you have a HD source (1920x1080) and encode it for DVD, then you are losing a LOT of resolution. The difference is between 2M pixels (HD) and 350K pixels (DVD). IE, you lose about 5/6 of the data. What encoder you use to transcode from HD to mpeg2 makes a lot of difference. A good one will interpolate the data to give the best results possible - ffmpeg is great for this. I don't know what iDVD uses to transcode into an mpeg2 DVD format, but that is likely the cause of your issue.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

PigPaw gave a great synopsis, but for this:

Hard drives basically have unlimited read/write cycles - as long as they are functional, you can read/write data to them without concern. SSDs have a limited number of read/write cycles - NAND flash that most use has a limit of about 10,000 write cycles, although modern SSD controllers (built into the drive) will wear-level the writes in order to increase performance. Consumer-grade products do this pretty simplistically, so they should not be used for system drives (in my opinion) - best for read-mostly applications. Commercial-grade products apply very advanced mathematical algorithms in order to maximize the life expectancy of the drive, and are apparently very reliable and long-lasting. However, the price differential between consumer-grade and commercial-grade drives is very significant. As the old saying goes, "you get what you pay for"... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The main difference between ddr1, ddr2, and ddr3 is the number of I/O channels they support. More channels, the faster they are, megahertz notwithstanding. Whether or not these modules are "fast enough" for you depends upon your usage patterns. What are you using the PC for mostly?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How was the data compressed? Did you write your own LZW compression tool? From what you are saying, it sounds like the string dictionary is out-of-whack, or that you are accessing it incorrectly. Sorry, but I don't have the cycles right now to analyze your code in regards to that last comment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This article may help: http://www.w3.org/International/articles/language-tags/Overview.en.php?changelang=en

Basically, you need to utilize language tags so it is properly decoded, assuming that REGEX supports that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"Or with whatever else you want to initialize it with."

Or nothing at all, and let the initializer for the translation unit call the default constructor, as in:

// myclass.cpp
#include "myclass.h"

std::list<int> MyClass::privateList;

.
.
.

mike_2000_17's approach is equally valid (perhaps more so), and will force it to be initialized, even if there is no other access to the object in this translation unit (.cpp file).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The version of eclipse you are using will be dependent upon specific versions of Java. Make sure you have installed the correct Java SDK and JRE for the version of eclipse you are running.

FWIW, this is the main reason why I generally don't use eclipse, but rather fall back to ant to compile Java projects.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Remember that memory allocations are ALWAYS on word boundaries, and aligning structures that are stored in an opaque buffer requires that you ALWAYS align the structure on a word boundary. This is likely why your math is not working as you expect.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you contacted the Apple iPhone/iOS support line? In any case, this Google search term, "ios upgrade ERROR 3194", returns a number of links to documents and videos on how to fix this problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As PigPaw said, make sure you have cleaned the drive, esp. the lens. Dust over time will degrade its efficacy. Also, if you can alter the write speed to a lower setting, that can help if cleaning the lens and such don't work. I have always found that writing at a speed lower than the drive/disc maximum is MUCH more reliable. IE, I write 16x discs at 8x, and 8x discs at 4x, 4x discs at 2.4x.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do some reading on reflection - the means by which you can use RTTI (runtime type identification) methods to do what you want. Google is your friend...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Better idea? Donate them to a school or other charitable organization and take the tax deduction.

<M/> commented: brilliant idea! +5
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Check the system thermal sensors. It may be overheating.