rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you looked at the router security logs? That may provide some indication of what is going on. It is possible that it is so "smart" that it thinks you are trying to hack in? Sort of a Catch-22?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, from what I can find, this seems to be a european router - most of the links I found in a Google search were in Dutch or were from South Africa. If you are in the USA or UK or Europe, try purchasing a different router/Wifi-AP. They aren't too expensive these days.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

AD is absolutely right Za3mi. You need a newer compiler. You can install the MingW version of the GNU C/C++ compilers for free - it is open source, on most versions of Windows, including XP. If you have enough RAM to run a virtual machine, such as VirtualBox, then install that and some version of Linux that will provide the full-featured GNU compiler suite, plus there are a lot of image processing libraries on Linux that won't cost you a bit.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I've been making a good living in this domain for over 30 years, and have had the opportunity to do some important work, such as work on the US Navy's RAMP project, contribute to the manufacturing systems for the F111 stealth fighter avionics, design and help build the manufacturing systems that makes most chips, disc drives, and flat panel displays in use today. Now, I deal with performance engineering for cell phone web browsers that support more than 100 million people all over the world. How many people can say that their work materially affects 100 million people directly? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Naming conventions... :-) I would suggest that you use something other than Int for your AP class to avoid this sort of confusion, such as APInt, or AnInt, etc. Depending upon the font, it can be difficult to tell int apart from Int, especially for us old farts! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. Show us what you have tried and we can help you find the errors of your ways, and means. Remember, for *nix systems, there are user, group, and "other" permissions on directories as well as files. So, a hint - to list a directory you need r (read) permission on it. To access a file or subdirectory in the directory, you need x (execute) permission. Normally, the owner has all (read/write/execute) permissions on a directory, and they can limit members of the directory's group or others as necessary.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Minor issue AD. You are starting at the terminating null byte and then ending at the head of the string. Better this I think:

for(int i = len-1, j = 0; i >= 0; --i, ++j)
{
    target[j] = source[i];
}
target[len] = 0; // Properly terminate the target string.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My work laptop has a 2 core i7. My personal home workstation (now 6 years old) has dual quad-core E5450 3GHz Penryn processors - out of date now, but still quick enough for my needs. Would I consider the investment? Definitely if I were building a new workstation for my personal use. You also need a motherboard to complement that chip.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read the documentation for the router. You may be able to reset it to factory settings by pressing a recessed button for some period of time, then you can get in with default settings (possibly no password at all) and then reconfigure it to suit. You still didn't answer the question as to what is the make/model of the device. If I know that, I can help you better.

WPA-Personal is decent security, but the problem may be the remote admin capabilities most of these devices provide. That is a back door more and more frequently used by hackers to get access to your personal network. Once they have admin access to the router, then they can easily find out what the WPA password/passphrase may be, AND they can change the admin password so you can't get in to reconfigure the router, sigh... :-(

So, once you know how to do a factory hardware reset, disconnect it from the internet, reset to factory settings, login from your local machine (while connected via wired ethernet, not WiFi), and reconfigure the router to

  1. Disable remote administration services.
  2. Change admin password.
  3. Change the SSID and make it "invisible".
  4. Reset the WPA passphrase to something only you and your family may know.

After all this, reconnect to the internet, connect via WiFi, and verify that you can get to stuff like google.com, et al. Once that is working, reset other home WiFi devices (laptops, phones, tablets, etc) to access the new SSID with …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is it worth the investment? It depends. The Intel "recommended" price for any of them is about $1100 USD. The Xeon E5-2650 has 8 cores and 16 threads (with hyperthreading enabled). There are 2 models. One is a 2Ghz chip with a turbo speed of 2.8Ghz, and a 2.6Ghz model with a 3.4Ghz turbo speed.

What do you mean by "multiplier locked"? Do you refer to the system clock speed? CPU speed? What?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is your WiFi secured? If secured with WEP, change the security to WPA and select a strong passphrase. If not secure, change it to WPA and select a strong passphrase. If already WPA, change the passphrase to a strong one that is difficult to guess.

Also, go into your router web interface and disable remote access/monitoring, and change the admin password.

Finally, what is the make/model of your router/wifi-access-point?

RikTelner commented: Good that you tried to answer. +2
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Mike2k said. Template functions are what you can call "generic programming". You develop an algorithm that works for multiple types, and then code it as a template. Instead of a separate function for each type you want to apply the algorithm to, you only have one template function, and it does the "right thing" for each appropriate type of data you pass to it. A couple of examples would be min/max/avg functions that operate on integers, floating point values, etc. Instead of having a separate function for each type, you only need one, the template function.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are two approaches to this sort of problem (I'm not going to get into details how to do it). One is an iterative computational process - slow when numbers get big. The other is a recursive algorithm where you start with a moderately sized array of the numbers and related values, and use that to leverage the answers to the next set of larger numbers/values. This is a hint - and not simple, but not hard ether! Done properly, the recursive method can be orders of magnitude faster than iterative programming.

FWIW, the programming is the simple part. Understanding the problem is the problem, so to speak! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you want to know exactly how to create an operating system from scratch, there are a number of texts out there to help teach you, such as Andrew Tanenbaum's "Operating Systems: Design and Implementation" - where he shows how the Minix operating system works. This was, as I understand it, the inspiration for Linus Torvalds to create Linux. Since all Linux source code is available to study and adapt, that is another source (so to speak) to draw from.

In any case, to integrate operating system code to various processor architectures, you will need to also be able to write some (not a lot) of assembler language for the target processors. Some things require very low-level access that higher-level languages, even C, don't provide.

The process of getting code onto the hardware is called "bootstrapping".

Your questions are good, but the answers are too complex to cover here in a single post. :-) Try to keep your questions focussed/narrow and they will be easier to answer in a reasonable frame.

BTW, another open source operating system is FreeDOS, an MS-DOS clone. That may be another place to start in your OS explorations!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need a function main(). Here are the valid signatures for main():

int main(void);
int main( int argc, const char** argv);
int main( int argc, const char* argv[]);

Note that the second and third versions are functionally (sic) identical. You can also use non-const arguments for argv, but that is not recommended as command line arguments are generally treated as constant values. In any case, modern compilers will require that main() return an integer (exit code).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Classes are used to model physical or conceptual entities. An example of physical entities may be the class Animal - an abstract base class. Derived from that are classes such as Cat, Dog, Human, Bird, etc. Derived from Cat are things like WildCat (Leopard, Tiger, Lion, Puma), DomesticatedCat (Abysinian, Siamese), et al. You model basic behaviors in the base classes, and then refine those behaviors in the derived classes. Example: all animals eat food. Some animals only eat meat. Others eat meat and vegetables. And others may only eat vegetables and/or fruit. By using virtual inheritance, you can create a class like DomesticatedCat from the generic Cat class, and with a reference to it as simply an instance of Cat, you can ask what it eats - and it will give you the appropriate answer - mice, cat food, milk/cream, etc. If you create an instance of Lion, and reference it as another Cat, then when you ask what it eats it may come back with Gazelle, Deer, UnwaryHuman, etc. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Swap space is used as virtual memory. IE, if your system and applications need more memory than you physically have, then the swapper will move the least-recently used memory blocks to the swap space, freeing that physical memory for active processes. This can be expensive, since it entails physical I/O to move the memory blocks from RAM to disc. When your process that is using a lot of memory is is done, then memory that has been swapped out but still in use by other processes will remain in the swap space until needed, then they will be swapped from disc into RAM. This is an "on-demand" operation. IE, don't mess with it until needed!

So, it may "lag" (show some latency), but unused memory won't "hang around" if that is what you are asking. Myself, I usually allocate a swap partition at least as large as my physical memory, and sometimes larger "just in case". Example: on my personal workstation, I have 8GB of RAM, but I have a 16GB swap partition. This allows me to have up to 24GB of memory for those rare occasions when I may need it for some memory-intensive computations.

Also note that the Linux system agressively caches frequently used file system data, assuming that you are going to ask for it again. That avoids the need to access it on disc, since physical I/O is VERY expensive as compared to RAM memory access. Since I do a lot of disc I/O, on my …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@decepticon
Your observations are true enough, but I was trying to point out that newline characters in the output stream aren't enough to flush the output. Your approach is also valid, but remember that without the flush or endl output manipulator, your output could be intermixed with output from other (background) processes - this has happened to me in the past. If the output stream is cerr, then it is mute since that is automatically flushed on each character, much like a typewriter. Also, output to cout can be emitted after some number of characters fill the output buffer, in which case cout can flush as needed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please show what code you actually wrote. This line is wrong (my bad): vector<TYPE>* list = new vector<TYPE>;

It should be vector<TYPE>* list = new vector<TYPE>();
Sorry about that! :-)

That still won't shut up the compiler - fun with templates!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your question is not clear. What precisely are you trying to do?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As indicated by deceptikon, with the leading double quote, it is legimate C++, but not GOOD C++ code. The newline tokens will not flush the output stream. Instead of the trailing "\n\n" tokens, it should be << endl << endl which will cause the output stream to print the data to the target (console or terminal in this case).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good post Mike2K! Got an up-vote from me for that... :-)

We run Linux servers for our production systems, exclusively, mostly CentOS 6.x - we have thousands of physical servers running in data centers world-wide, and thousands more running on virtual servers in the Amazon cloud. Windows? Well, it runs a lot of our business related stuff (sharepoint, outlook, etc), but NOT our consumer-faced application servers. The ratio of Linux to MS servers in our enterprise (10's of thousands of users, 100+ million customers) is probably 100 to 1, though that is just a guestimate (I really have no idea).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please be more clear. You want a program to use for training programmers? Or something else?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Honestly, I do not recommend dual-booting operating systems. I have found it to be prone to serious problems. Myself, I use a virtual machine manager, such as VirtualBox, to create multiple virtual machines, with their own virtual HD wherever I want it. It preserves the fabled KISS principal. -)

FWIW, Sirajhyd's suggestion about Unetbootin works here as well!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not quite right JorgeM, I think! (Caveate Emptor).

I think the poster is referring to an internet domain, such as xyzzy.com. He has registered his domain (xyzzy.com) and wants it to be visible on the general internet, correct gerhardus01?

To do this, you need a static IP address from your ISP, and then go to your domain registrar to link the address to your domain name. Next, depending upon the services (web, email, etc) you want to allow into your "domain", you will need to allow access to the necessary ports through your firewall (router).

Finally, you will need REALLY good anti-virus and anti-malware tools on your server to make sure you don't get pwnd! :-)

So, move forward, and post more questions here when you need help on these issues.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

NP. Hope my information was helpful to you. Personally, I'd love to say we (Nokia - soon to be Microsoft) had a proxy browser for the iPhone, but it would be a LOT of work and honestly I don't see it happening, at least in any reasonable time frame. Opera's mini-browser would still be my recommendation for now.

For Nokia and Windows phones though, our Xpress browser kicks butt! (a bit of company support here)... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is also enterprise linux, such as Suse (mentioned by Mike2k) as well as Red Hat Enterprise Linux and its clones, CentOS, Scientific Linux, and Oracle Linux. RHEL and Oracle require support subscriptions (they cost you $$), but CentOS and SL do not. I use both on many systems.

Personally, I prefer the virtual machine approach (I use VirtualBox) over dual boot. That way, I can easily experiment with MANY linux distributions without munging with my system drive. So, I let my VM take a portion of my system resources (4 of 8GB RAM, and 1-2 cores of 4-8 cores). Example: on my work laptop (a 2-core Intel i7 processor w/ 8GB of RAM) the native OS is Windows 7. I run CentOS 6.5 in a virtual machine, giving it 1 core and 4GB of RAM - it works very well! At home where my system is Scientific Linux 6.4, I give Windows XP 1 core, and 2GB of RAM - also works very well. Each virtual machine gets an entire display (I have 2 HD displays for both cases) for its use. If I need the display for my system OS, I just minimize the VM!

As for needed disc space, VirtualBox allows you to specify a size of virtual disc, but it only increases the physical size of the disc as necessary. So, an 80GB virtual system disc may only be 5-10GB in real size.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Personally, I think they should rename it as "Not-so-safe Mode"! :-) That is a good way to fubar your system... Hopefully you verified that this is not a file critical to other system functions?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FYI, I manage a couple of AWS accounts that incur expenses in excess of $10,000 USD per month, each. This (out-going data costs) is something I have to report to my divisional VP every month, so I am somewhat familiar with this issue. :-) If the data is coming into the "cloud" or "stays in the cloud", then the cost is $0. Data going out? Not so cheap...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your Windows partition should still be ok, but the boot loader is fubar. You need to boot into the recovery image and then restore the Windows boot image: http://www.howtogeek.com/howto/32523/how-to-manually-repair-windows-7-boot-loader-problems/

The relevant commands are:

  1. bootrec /fixmbr
  2. bootrec /fixboot

Good luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can install the OS on a RAID, but I generally don't recommend that unless it is a mirrored (RAID-1) configuration (for redundancy to protect from a single disc failure). As for file system/disc/array, Windows currently only supports 2 TB configurations, as does standard Linux. However, new BIOS's (EFI/UEFI and GPT MBR's) and such support larger discs and larger active file systems (zfs for example on Linux). Part of the problem is the use of 32-bit values for sizes/offsets, etc. For bigger stuff, you need to use 64-bit values. These are not trivial changes, and are a bit slow in becoming mainstream, although availability of discs from 3-5TB is forcing this issue to be resolved PDQ. These new disc MBR (master boot record) and file system types support discs/arrays/filesystems up to petabytes in size.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, install the the 2GB DDR2-800 in the A2 slot (assuming the current one is in the A1 slot). See if that works. If so, then, install the 1GB SIMM in the B1 slot. If it doesn't work, install the 2GB SIMM in the B1 slot and try again... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your posts are not particularly enlightening (so to speak). I assume you are having difficulties starting your computer. Have you tried holding down the power button for at least a number of seconds until the light goes out? I had that problem the other day with my laptop, and that's what I did, then I pressed the power button again to restart the system. There are times when laptops get into some weird state where the usual approaches don't work.

Alternative, if the above doesn't work - disconnect power brick, remove battery and then hold down the power button for 10-30 seconds. Re-install battery, plug in power brick (if desired) and press power button.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think Reverend Jim gets the punnage award for the week! So, what punnagement would be appropriate for that? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@AD & tinstaafl
:-) Goes to show - any three good programmers will generally come up with 3 valid approaches to any programming problem! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Too much code, and not enough information. What is the "drive" function supposed to do, for example? What do you mean by a "recursive" quick sort? Do you mean a reverse sort - largest to smallest? Or do you mean a recursive sorting algorithm?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This NOT good!
This is better:

class car {
.
.
.
public:
    car(double mpg = 0.0, double capacity = 0.0);
.
.
.   
};

Car::Car(double mpg, double capacity): mpg(mpg), fuel_capacity(capacity)
{}

The way you did it, if someone instantiated a car type with something other than 0.0 for mpg and capacity, they would be fubar'd! Also, inside the constructor, you want to verify that the values passed are NOT less-than-zero. IE:

Car::Car(double mpg, double capacity): mpg(mpg), fuel_capacity(capacity)
{
    if (mpg < 0.0 || capacity < 0.0)
    {
        // Throw an exception - and remember to tag the
        // the declaration of the car constructor in the header
        // to indicate it may throw this exception.
    }
}

Note that I did not add the throw tag to the declaration - I am leaving that to you. What it is depends upon the exception type you decide to throw. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes, it is an instance variable, and only affects the instance you set it in. Make it a class static variable, and that should do what you want.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do note that I don't try to solve all of your problems in one post. However, I do try to get you to see where some of your fundamental problems lay.

Oh, and here is a link to the www.cplusplus.com documentation on list sorting: http://www.cplusplus.com/reference/algorithm/sort/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, here is one problem (starting at line 140):

vector<TYPE> convertToVector(Node<TYPE> *Ptr)
{
    Node<TYPE> *currPtr = headPtr;
    while (currPtr != NULL)
    {
        int i = 0;
        vector<TYPE> list(count);
        list[i] = currPtr->data;
        i++;
        currPtr = currPtr->nextPtr;
    }
    return list;
}

// This would be better.
vector<TYPE>* convertToVector(Node<TYPE> *headPtr)
{
    vector<TYPE>* list = new vector<TYPE>;
    Node<TYPE> *currPtr = headPtr;
    while (currPtr != NULL)
    {
        list->push_back(currPtr->data);
        currPtr = currPtr->nextPtr;
    }
    return list;
}

Note that inside your look, you are creating a new list on each iteration. You need to create the list outside of the loop. Also, by creating an object on the heap (vector<TYPE>*) and returning the pointer, you avoid the overhead of copying the entire list on return.

Also note my change in the function signature. I assume you meant to pass in the head pointer? :-)

Anyway, these are common issues in your code. You are getting there, but you have work to do yet! Keep it up.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You do the work. We help you fix it. Don't ask us to do your homework for you - that is cheating! :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Rik, if you want to run FreeDOS, run it in a virtual machine. It thinks it owns the hardware, so DO NOT try to run it directly on your computer. I've had no problems installing it in a VirtualBox VM. Tell VirtualBox that the Type is "other" and Version is "DOS".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Better! I might change "Informs Availability" to "Answers Query", though that is a nit-pick... :-)

So, just do a review to be sure that you have covered all the points in your use-cases. I'm sure you'll do ok, but you never know. Professors often have their own pre-conceptions how it should be, and look for you to provide a reasonable reflection of that. So, also think about how the professor presented the material in class as well, but don't try to be too much in agreement either. A bit of independent thinking is a good thing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Overall, I think you did pretty well on the interview questions, though you are correct that #9 could have been handled better, such as mentioning that GC in Java has a serious impact upon long-running applications without considerable effort to compartmentalize the GC domains or to provide object caches for frequently used/discarded types such as strings. We do a LOT of java programming in my company, both on mobile devices as well in our servers, and GC has ALWAYS been the biggest performance leech. Mostly that is due to the standard Java/Dalvik GC using mark-and-sweep algorithms which are by nature non-deterministic and unsuitable to hard real-time systems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

"Never mind - God I why do I always figures this crap out right after I post?"

Probably because we all figure out our errors right after we ask someone about them - having a bit of time to rethink what we did... Welcome to the Homer Simpson Society "Doh!". :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What James said. In addition, there are abundant sources of documentation on how to implement b+ trees on the web, and in printed books. Try some Googling on your own! This came up on a quick Google search for b+ trees: http://en.wikipedia.org/wiki/B%2B_tree

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@ Ancient Dragon
I would suggest that the students vector be a static member of the Student class, although your suggestion is also valid. However, having it a static member of the Student class means that other classes and functions can access it, whereas if it is declared in main() it cannot be. I don't like global variables, unless absolutely there is no other way to make some data "globally" accessible, so I am not suggesting that. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One of the easiest cyphers is a simple xor substitution of the source text with letters from the passphrase. You iterate through the source and the passphrase (password) and xor each letter of the source with the current letter of the passphrase. When you get to the end of the passphrase, you wrap around back to the beginning of it.

This is NOT a secure algorithm, but it should be adequate for your class project. Just make sure that your professor understands that you know it is not secure, but just an example of a simple algorithm.

So, the signatures of your encrypt() and decrypt() methods on the Crypto class would look like this (I leave the implementation to you):

string encrypt(string source, string password);
string decrypt(string encrypted, string password);

Note that an xor algorithm is symmetrical. IE, to decrypt what you encrypted, you just do it the same way, applying the xor operation on the encrypted text in just the same way you encrypted the source in the first place. Keeps stuff simple! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@ Red Goose
Your comment "You're doing the calculations before you're getting the number, and since num will be 0 at that point, tens digit and ones digit will always equal zero, no matter what." is not quite correct. As it is currently coded, num will be random garbage (whatever is on the stack at that point), so it may not be zero. As a result, the ones_digit and tens_digit values will definitely be some random number, unless this is running in a debugger! :-) Caveate Programmer! Using unitialized variables is always a roll-of-the-dice, so to speak!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What Red Goose said. This bit of code:

int ones_digit = num%10;
int tens_digit = num/10;

Needs to be AFTER you get "num" from cin. You may have other problems, but that was as far as I looked. Also, you may want to verify that it is a number and a number in the range specified.