rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can use the command "stty -a" and parse out the number of columns. Example, in my command-line window stty -a shows this:

speed 38400 baud; rows 50; columns 132; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = M-^?; eol2 = M-^?; swtch = M-^?; start = ^Q; stop = ^S; susp = ^Z;
rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 hupcl -cstopb cread -clocal -crtscts -cdtrdsr
-ignbrk brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc ixany imaxbel iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

Note the "columns 132" entry. That says that my window is 132 characters wide.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The "./" means "use the current directory where your application is running". The dot is the current directory. If it was "../" it would point to the directory above where you are. If it was "~/" then it would point to your home directory.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

XOR'g with what? A key? If you used a key to XOR your data, then using the same key in the same order to XOR the encrypted data should result in the original plain text. This is cryptography 0.001. And what is the cruft about primes? Describe your algorithm and not the code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is a procedural problem. Think about how you would solve the conundrum. There are a couple of options:

  1. Before appending a file to the data set, forward to the last line and remove it.
  2. After appending a file to the data set, forward to the last line and remove it.
  3. Append each line of a source file to the destination file, and when you find the "End of Report" line, don't write it to the destination file.

Are we seeing a pattern here? To do this, you need to open the file for read+write options, not append-only. It isn't difficult, and definitely not rocket science.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It may be that the StreamWriter class is buffering the output data and won't write the remainder until you close or flush the stream.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@pritaeas
Myself, I prefer more bigger screens! :-) I have dual 24" 1920x1200 displays that I use with both Linux and Windows, using a KVM switch to move from one OS to the other. Windows runs on a company laptop. Linux runs on my 8 core Intel box.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are not showing enough code, such as how you would create the third file "OutPut3.exe". In addition, even if you did that, the system would probably not be happy as your "executable" would contain two main() functions and it would probably just execute the first found, if it didn't give you a runtime error.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is it possible that your ISP is throttling your data due to exceeding data caps? You might want to look into that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Arbitrary precision math. An interesting problem. Look at the source code for the Boost libraries. I worked on this about 30 years ago and gave up for lack of time (ie, I got a job).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How do you think you could do it? If you understand the capabilities of the module, then try some experimentation and don't steal from the experts until you have some understanding of what you are doing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What do you want to do? I would have thought that you had read the book by now as your exam is coming up. We are not mind readers and the subject is vast. See Niklaus Wirth's seminal text "Algorithms + Data Stuctures = Programs".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Why did you have to restart? Linux is not like Windows where you need to reboot after installing software. One other thing, Fedora 14 used the old grub bootloader. Your current debian installations uses grub2 (depending upon version - what is it?).

So, I am saying that you need to provide more information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Maritimo
You could have simply commented about my lack of knowledge about C++11 in this regard (curly-braces vs parens) instead of a down-vote. The nice thing about "standards" is that there are so many! So, you get one also... :-(

P.S. Let's not let this degrade into a flame-war.

BTW, was there a real reason why the C++11 standard moved from parens to brackets? If so, can you tell me? Reply in private email if you prefer, or here if you wish to educate the rest of the community.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Probably not. Ask Apple... That and $5000 will get you a nice new system!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Do you understand recursive functions? The simplest way is recursive, deleting the items from the tail of the list, otherwise you will have to keep storing the address of the next item, until the 'next' item is null. I'm not going to write your code for you since this is a class assignment. You write what you think is appropriate code, and we will help you debug it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, there are a number of problems with your code. Example, in the class B constructor, this

 B(int i1_, int i2_) : A{i1_}, i2{i2_} {}

should be this

 B(int i1_, int i2_) : A(i1_), i2(i2_) {}

Watch your parens vs brackets!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming that the strings are dynamically allocated (with operator new or the C-style malloc/calloc functions) then they will remain around after the list pointer is deleted. More code would be helpful to enable us to better advise you.

senait.kifle.127 commented: It's a type of linked lists in C++ +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is likely a code editor issue. What editor are you using? The Windows VS editor, Eclipse, or something else?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think your problem is here:

for (int i = 0; i < messageList.Length; i ++)
{
    if (messageUserList[i].Contains("_0"))
    {
        .
        .
        .
    }
}

You probably need to set the guard barrier i < messageList.Length to i <= messageListPos. You have initialized the strings in messageList and messageUserList up to the value of messageUserPos, but everything beyond that is not initialized. The messageList.Length I believe would contain the number of slots in the list, which is the size of 16-bit integer - about 32000 items.

That said, before you start your loops you could first set every slot in messageList and messageUserList to an empty string. It will make your code slower because each iteration through the outer loop will require a full iteration in the inner loop, looking for the "_0" string. So, my advice is to rethink your nesting of these operations to determine if there is a more efficient way to accomplish your purposes.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Walk through the directory structure, looking for files that match the name you input, or that contain data that matches. You can use the grep command (Unix/Linux) to do that. In fact, Linux and Unix have a very neat command line tool called "find" that can handle that very well. I use it for such purposes all the time.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You could write a bash script to start it up on login (calling the script from ~/.bash_profile which is run when you login) to the system where it could ask for the password required. Anything else, keeping it in the script file for example, would not be safe as noted above.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ah! A personal education project? Been there - done that! Post your work here and I'll at least be happy to comment. Remember, every operating system differs, depending upon their low-level GUI tool set. Linux/Unix == X-Windows/Xorg, Windows == whatever, QNX == Neutrino and/or Xorg. If you want to get lower into the process stack, then you will be writing a lot of assembler code to control the specific video devices used as well. IE, don't try to write the entire stack. Work with what is provided as a foundation.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

GUI toolkits are VERY complex. Moschops has identified many of the issues you face. My advice is to study other GUI toolkits, such as Qt, WxWin, etc for some perspective on the issues involved. Also, how many years do you have to spend on this project? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Solved, maybe, but a good discussion nonetheless. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes? And what errors are you getting? Compiler errors, or runtime errors? Show the output. Asking us to analyze 167 lines of beginner code is asking a bit much...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'd up the power supply to 1000w instead of 800 for this size of gear. I presume it is a full-size tower?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

KVM sits right on top of the hardware, so it is much more efficient than VirtualBox or VMware, et al. However, it is not really intended for personal type of use and is not simple to configure properly or for ease of use. I have successfully used VirtualBox on all of my systems for about 7 or 8 years, and use that as well as VMware at work. They are much simpler to configure and use. In truth, KVM is more intended I think for server use.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are several approaches. One that bigger companies use is to lease connections from the branch offices that are part of the company global network. They will be different subnets, but routers keep it all together. Smaller organizations will use standard ISP connections and use VPNs to connect into a bigger network.

As for hackers, that depends upon the applications, servers, routers, and firewalls that you use and more importantly how they are configured. If you don't have good network and systems operations staff, then hire a firm that specializes in that sort of work.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The const getters return a non-mutable reference to the internel properties. The non-const getters (protected) provide a mutable reference to the properties, allowing them to be changed directly. Normally you want to use public setter methods to change properties, which can be coded to test for invalid inputs and throw the appropriate exceptions when necessary.

As for copy constructors and assignment operators, each class has its own. The compiler will create them for you if necessary, but that is not recommended.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I would recommend that you create a support class, call it Person, that encapsulates name, address, city, state, and zipcode. That will simplify the underlying code considerably. IE:

class Person
{
private:
    string name;
    string address;
    string city;
    string state;
    string zipCode;
public:
    Person() {}
    Person(const string& aName,
           const string& anAddress,
           const string& aCity,
           const string& aState,
           const string& aZipCode) : name(aName),
                                     address(anAddress),
                                     city(aCity),
                                     state(aState),
                                     zipCode(aZipCode) {}
    ~Person() {}

    // Getters
    const string& getName() const { return name; }
    const string& getAddress() const { return address; }
    const string& getCity() const { return city; }
    const string& getState() const { return state; }
    const string& getZipCode() const { return zipCode; }

    // Setters
    void setName( const string& aName );
    void setAddress( const string& anAddress );
    void setCity( const string& aCity );
    void setState( const string& aState );
    void setZipCode( const string& aZipCode );
};

class Package
{
private:
    Person sender;
    Person recipient;
public:
    Package();
    Package( const Person& aSender, const Person& aRecipient)
     : sender(aSender), recipient(aRecipient) {}
    virtual ~Package();

    virtual void CalculateCost(void) = 0;
    virtual void Display(void) = 0;

    //setters
    void setSender(const Person& aPerson);
    void setRecipient(const Person& aPerson);

    //getters
    const Person& getSender() const { return sender; }
    const Person& getRecipient() const { return recipient; }
protected:
    Person& getSender() { return sender; }
    Person& getRecipient() { return recipient; }
};

There are a couple of important methods I left out of both classes - a copy constructor and assignment operator. I leave that to you as an exercise! :-)

ddanbe commented: Great recommendation. +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just nitpicking, but this:

#include <vector>
#include "Eggs.h"
#ifndef TRAY_H
#define TRAY_H

should be this:

#ifndef TRAY_H
#define TRAY_H
#include <vector>
#include "Eggs.h"
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Contact the "gurus" at your local Apple Store. They probably have the proper magic wand to fix this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What distribution+version of Linux are you running for a server? The standard python for RedHat Enterprise Linux 6.5 systems and clones (such as CentOS) is version 2.6.6. I'm sure there are newer ones that you can download and install to upgrade if necessary. That said, there are a gazillion python apps that run on these systems very nicely.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try initializing the variable 'i' first before using it.

Ashveen96 commented: I already have initialized it as Dim i as Integer. but still i get the same error. +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you turned off the Windows firewall after reinstalling the OS? What about credentials for enabling RDP?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try this google search: streaming tv server
FWIW, multi-cast is usually not viable outside of a LAN, and your routers need to be configured to allow multi-cast outside of a subnet.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Look at the Lynksys routers when this happens to see if they have exceeded their number of connections - they may not be relinquishing the connection in a timely manner. If this is the case, then you can try changing the lease time to say 12 hours. If one of the sub-routers runs out of available dhcp addresses, then the request would fall back to the Comcast router.

Another issue is where on each floor the router resides. It is possible that some rooms are not connecting to that floor's router, which could contribute to this problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

256 bit AES is good for stuff only you are going to need to decode, otherwise you want to use at least a 1024 bit RSA algorithm such as PGP. Dropbox should have some guidelines for this use.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you mean the Simple and Fast Multimedia Library (SFML)? First I've heard of it, but the best way to check out something like this is to do some prototyping with it and see if it works for you. Since it is open source, do report bugs or usability problems to the development group. Without the feedback of real users, they can't strive to improve it for the rest of the community.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

About A/V scanning, i don't have any thing like that on my pc. I disable anything that isn't usefull and keep a eye on what's running.

I usually use ClamWin for a decent open source scanner that only does on-demand scanning. It can also scan memory which is occasionally useful. Cheap at 2x the price - free! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Same answer. It is your problem to figure out. Describe first here what you think you should do to solve your conundrum. Describe how you might do it, step by step. Plain language is OK - code can come later.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Until you post your code I can only say that we don't do your homework for you. You have the solution algorithm in the pseudo-code. Just apply the language to the solution.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Get more RAM if your laptop can handle it. Also, how are the VM's in VirtualBox configured with regard to number of cores, amount of RAM, etc? I would suspect that your performance issues are related to swapping of virtual memory to disc. A solid-state disc can help there. There is also the issue of on-access virus scanning which most A/V tools implement by default which also causes serious performance issues. Usually you can disable that in the Security Center, but it will make your system nominally more susceptible to virus infections.

So:

  1. More memory.
  2. Better VM configuration.
  3. SSD instead of regular hard drive.
  4. Disable on-access A/V scanning.
  5. Faster CPU with more cores.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Download the free version of the Cloudera Hadoop management tool. It will nicely do all that cruft for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might want to run the full disk check utility (requires rebooting) to see if there are bad sectors on the disk. If the DLL is stored on a bad sector that is having read problems, that could explain this issue.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried running the recovery disk/partition?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When multiple applications try to send/receive data at the same time over the same network link/connection, the network driver will mostly queue them in FIFO (First In, First Out) order. The network hardware will send/receive until it has reached its performance limit, which with modern hardware ports, is as much as 1Gbps (1 gigabit per sercond == 128 mega bytes per second). WiFi is slower, and most internet connections are even more so.

Anyway, there are delays. It is just that they are so short most of the time, you will never notice them. That's why I can stream audio over my internet connection while viewing a YouTube video at the same time, and not notice that there is buffering going on, unless my wife decides to upload another video to YouTube or Facebook at the same time... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Put a space between the '>' and 'records' on line 38. Other than that, what is your problem other than confusion? Show how you are using the vector.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I don't see a Basement to Dining_Room transition. There is a Basement to Closet transition, and a Dining_Room to Basement transition.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have defined State after Machine, but each has a dependency on the other. This is how you can deal with that:

// Forward declaration of the State class.
class State;

class Machine
{
    // Don't put 'class' in front of State here.
    State *current;
.
.
.
};