rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I am a performance engineer for a tier one mobile phone manufacturer in their web browser division. We run virtual mozilla browsers to fetch, process, render, and scale web pages for our users' mobile phones - millions of users all over the world. This situation (slowdown during peak hours) is not uncommon, and has many contributing causes, from the capacity of the phone company (carrier), to our capacity to process the users' requests efficiently, to the capacity of the web sites being accessed. Needless to say, Facebook, Twitter, and Google are those with the biggest loads (and pipes/capacity). But, all things have their limits! That is why we are studying ways to cache those most commonly accessed pages during busy hours so we can provide our users with the snappiest performance possible. We monitor latencies (time to get service and relevant data) at all links in the chain, from the handset to the carrier, to our data centers, to the target web sites, between our server components, and back to the handset, and we exert a LOT of effort to improve the experience continuously.

So, I think my point is, is that there is no simple answer here. Peak times == peak loads == slowest performance. That's just the way it is, unfortunately... :-( Sorry, but our quantum tunneling, time compression technology is just not yet ready for prime (or any other) time! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, check out ffmpeg - free, fast, and converts just about anything to anything else in the video universe. Usually it is used on Linux, but there are Windows builds as well. Here is a link to those: http://ffmpeg.zeranoe.com/builds/

The main ffmpeg site is www.ffmpeg.org.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, your code should be:

while (file.good() && !file.eof())
{
    char buffer[MAX_LINE_SIZE + 1];
    file.getline(buffer, MAX_LINE_SIZE);
}

The signature for getline is this:

istream& getline (char* s, streamsize n );

There may be other issues, but this stood out.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is why I run Linux on all of my systems, and only run Windows in a virtual machine. I install all the Windows cruft that I want, and then take a snapshot of the virtual system. If I get a virus, I just restore to the snapshot - bingo, no more virus and it takes about 10 seconds to do! Alternatively, if I have to run Windows natively, then I install all the cruft I want/need (with Windows updates installed also), at which point I get a good/big external hard drive, boot with a Linux live CD/DVD, and do a bit copy of the entire system disc to a file on the external drive. If I get a really nasty virus like yours that the normal A/V programs can't handle (there are a lot of them these days), then I boot into the live CD/DVD Linux system again, and copy back the bit image I made to the hard drive. That restores EVERYTHING, including the boot loader and everything on the disc. If I have data on the disc that I cannot live without, then I mount the NTFS partition and copy the files to an external drive, where I can scan them with an A/V program after I have restored Windows. Do that before you restore the bit image, however, otherwise you will lose all of your changes since the image was created. I have to say, that this has saved my bacon on a number of occasions …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Easy access to the innards of the system, including disc drives.
  2. Good cooling.
  3. Fully buffered ECC RAM - this is error correcting RAM which will continue to run even if one of the memory sticks fail, allowing you time to take down the system cleanly before you replace the part(s).
  4. A big power supply (750-1000 watts).

I have an 8 core Intel server/workstation and these factors have saved my butt on more than one occasion. If you are going to run Linux, then make sure you install the lm_sensors module so you can actually monitor the CPU and RAM temperatures.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to restore the Windows boot loader, which you can do if you boot from the installation disc and go to the repair/recovery mode. Then, you run the commands from a cmd.exe command line "fixmbr" and/or "fixboot". Here is a link to an Ubuntu How-To posting about how to do this: http://ubuntuforums.org/showthread.php?t=740221

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It would depend upon the GPS device that you have. Some may support installation of a SIM, others a USB cellular modem, and others perhaps neither. In any case, if your GPS device does not support some variety of external communication service, you are SOL.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FWIW, the XOR operator is ^ as in (0xCAFEFACE ^ 0xECAFEFAC). The | symbol is the OR operator.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

See the C function getopt(). Alternatively, iterate over the argv[] array passed on the command line to main(int argc, const char* argv[]). If you don't know about this stuff, you have some studying to do before you try to solve this assignment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Time for you to go to the Oracle Java pages and start reading some of the docs and how-to's.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Web application server such as Tomcat, javascript and/or php for the application, which can easily access the MySql database. Do some google searching - there are a lot of open source applications out there that do similar stuff which you can investigate for code and ideas.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Enjoy your new toy! I know a lot of folks who like Acer laptops. I have a high-end Lenovo at work, but I still prefer my old personal Dell D630.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A final note on this subject from me - an anecdote from about 10 years ago. I was Principal Engineer at a major semiconductor equipment manufacturer, designing and building manufacturing software systems for the semiconductor industry. One of our major customers was Intel. A group of their senior manufacturing engineers were visiting our home office in Massachusetts and at one of our meetings they were asking us to port our Unix MES software to Windows (it would run on Windows for testing purposes, but we never certified it on Windows for production systems for a variety of reasons). They were asking because they wanted their manufacturing software systems to run on Intel gear, and all of the Unix systems we supported were from other manufacturers (DEC, Sun, HP). When I brought up that some of the reasons we didn't support production systems on Windows was that our testing had shown that it 1) didn't perform adequately, and 2) was unreliable for a 6-sigma installation. Their answer? "Well, Windows is plenty fast and reliable, as long as you leave the GUI off of it." ROFLMAO!!!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Java, python, ruby, javascript. Those are the hot buttons right now. That will change, of course, but having those skills will help with job acquisition.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What gusano79 said. A header guard is something like this:

#ifndef MAIN_H
#define MAIN_H
// Contents of file below.
.
.
#endif /* MAIN_H */

This will keep the header contents from being processed more than once, even if included in more that one other header file that you are using.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The original INT 13h was for a real-mode system. Once the operating system has booted into the OS these days, unless you are running MS-DOS/FreeDOS, et al, you will be running in protected mode. You need to check your OS documentation to see if INT 13h will still work for you. You set up some registers for the sector to read, and possibly the address to read the disc into (normally that would be fixed in a real-mode boot loader), execute the interrupt, and there you are. FWIW, the last time I wrote a bootloader (real mode) was in 1986 or 1987. I'd have to pull out my old IBM PC BIOS docs to see what needs to be done for sure...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The large buffer is causing you to crash because it is being allocated on the stack and you don't have enough stack space. If this is Linux/Unix you can fix that with the system ulimit command, unless the sysadmin has restricted you in some way. In any case, this is non-functional code. What does the char* buffer point to? So, you are seeking 210 bytes into the file, and have commented out rewind(), and then read 240 bytes, but it would start there and not at the beginning of the file. So, create a buffer of some reasonable size (up to 1MB may be ok - you are using 10M, and most systems limit stack to 8M or less), seek to the position that you want to start at, and then start reading in a loop until you get to feof(f). If you want to read it all into one buffer, then allocate buffer on the heap using malloc/calloc function calls.

If you want to know where the end of the file may be in bytes from the beginning, then try using fseek(f, 0L, SEEK_END), then ftell(). That will tell you just how much buffer space you need.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I use both, and home and work, but my main systems are all Linux. In point of fact, Linux and Unix (including OS-X) are both more secure than Windows because of how they are designed. That isn't to say that they have no vulnerabilities, but in point of fact it is MUCH more difficult for an attacker to get root access to Linux/Unix than Windows systems. This is a design and implementation issue, not one of popularity per se.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Netbeans is just pure java code. It is neither 32-bit nor 64-bit. The jdk executables that you installed are 64-bit, so your java programs can access more RAM and such. I use 64-bit Java daily in my position as senior systems engineer for a tier-one mobile phone manufacturer, both on Windows 7 as well as on Linux.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, your c++ code needs to open and read the XML file, and then prints out the points in the specified format. To do this, you need to either write your own parser, or you need to use a standard XML parser that can read the file and put the data into the appropriate format. A popular C++ xml parsing library is xerces. I have written generic xml parsers numerous times in the past, and I still do that when I need the fastest possible processing speed and code simplicity, though mostly I reuse what I have written in the past.

So far, you have only the basic class definition for Points, but no functionality nor member variables. You need to add a Point class and a vector<Point> member variable in Points. Example:

class Point
{
private:
    int m_x;
    int m_y;
public:
    Point(int x, int y) : m_x(x), m_y(y) {}
    int getX() const { return m_x; }
    int getY() const { return m_y; }
};

class Points
{
private:
    vector<Point> m_points;

    Point readPoint( ifstream& strm ) const; // Reads a point from the xml file.
    void readPoints( ifstream& strm ); // Reads opened file and populates the vector m_points.
                                       // repeatedly calling readPoint(strm) until strm.eof() is reached.
public:
    Points( const char* filename ); // This is better than a non-const array
    size_t counter() const { return m_points.size(); }
    void print() const;
};

I will leave you the task of implementing the constructor (open file, call readPoints()), and the other …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The onboard flash memory battery has probably died. Can you boot into the BIOS? If not, then you need to replace the battery (a silver-dollar looking thing in a carrier on the motherboard), determine which are the reset jumpers on the motherboard and short across them (the instructions should be in the owners manual, if you still have it) so it will reset the flash and bios to factory settings. At that point, you might be able to power up the system and boot it into the bios so you can reconfigure it to boot from the hard drive. Another issue that arises with systems that are shut down for a long period is a thing called stiction. This is where the drive's read/write heads settle onto the platter of the disc and due to their very flat/smooth character, become bonded to the disc platter. The solution for that is to take the drive out of the case, and holding it tightly in your hands, flip it back and forth in the same plane as the platters are. This causes the platters to rotate, breaking the heads free. The stiction can easily be too strong for the drive motor to break free, so this is the accepted fix. It has worked for me many times in the past.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When this happens with Linux, one generally boots with a recovery or live cd/dvd/usb drive and then run fsck on the partition that is bad. That will fix the file system. If the boot sector has gone bad, you can restore that with the fdisk program on the live/recovery system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Why not install and use Linux? You can boot a Linux live cd/dvd drive, mount your Windows file system, copy your data files to a thumb drive, and then install Linux - it will happily reformat your drive, removing all trace of your virus, and you can use OpenOffice or LibreOffice to read your MS Word, Powerpoint, and other files.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How you do it depends upon whether you just need serial input/output, or if you need some random access to the data. If you need random access to the data, then as Ancient Dragon said, you need support for files >4GB (maximum a 32-bit offset can handle. Current Linux systems support access to very large files, for both 32-bit and 64-bit systems by defining the type fpos_t appropriately.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Re. cscgal: amen to that! Poster has to make the first effort to solve the problem. Then we may decide to help out... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I look at PhP as a scripted version of C++. My advice (just off the top of my head) is to code it entirely in PhP.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

By "new setup" I presume you mean you have a new router? If so, what is the router/gateway address, and what is the NAS address? You may need ot change the NAS address if it is static.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. You need to remove the space between the "PS3=" and the prompt. Also, this just sets an environment variable. It does not output the prompt.

So, propose some alternative options that we can comment on.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It depends upon the operating system that this device is running. If it is running OpenWrt, then this may help: http://wiki.openwrt.org/doc/recipes/3gdongle?s[]=3g&s[]=usb&s[]=dongle

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A fall like that can easily flex the circuit board(s), causing a break in a circuit trace. You need to take this to a competent hardware diagnostic center. It may be fixable, but it may not be. In any case, take the system drive out, plug it into a docking bay, and see if it can be read by another computer that is functional. If it can be, then fix/replace the system, and use the old drive as a backup for your data.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If it is physically write-protected, then you are SOL. If it is software write-protected, then you should be able to disable the write-protect settings.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How are you determining this amount of RAM? Post the output of the "free" command here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What does a locked grub boot loader have to do with using the terminal? If you boot from a live CD/DVD/USB drive and login, you will get a GUI desktop. From that, the terminal program should be available either as an icon on the top menu bar, or as a command in one of the application menus, such as "System Tools" or "Accessories".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When you installed the system, you were able to tell it to sync to the hardware clock, which in the case of a virtual machine, would be the host clock. You can still do that via the System->Preferences menu.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Post the output of the command "lspci" here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried using the sudo command, as in "sudo su"? If it asks for your password, input your user password.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Normally, a Linux system will automount a usb drive when it is detected, although settings in /etc/fstab can override that. Post the contects of /etc/fstab here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How is the KVM switch connected to the computers - via PS/2 keyboard/mouse ports, or USB? Also, given that this problem affects all of the PCs attached to the KVM switch makes me think that the problem is related to the switch; however, have you tried a different keyboard?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You pointed the pointer (sic) to an external variable, which won't go out of scope until the translation unit (source file) terminates. The variable itself will terminate when the function is finished, but the external variable glb1 will retain the value you set inside the call fnCall2().

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you don't have root access, an administrator's account, and are not in the sudoers list (/etc/sudoers) then you are not out of luck, but you are going to need to do several things to get access to the other 130GB of disc space. To do that you will need to

  1. Boot with a live or rescue CD/DVD/USB drive.
  2. Login as root.
  3. Edit the drive partition table with the fdisk command (fdisk /dev/sda) and create a new linux partition.
  4. Create a file system on that partition, such as ext3 or ext4, and give it a label such as "newdata-1".
  5. Mount the system root file system in a temporary location that you create, such as /mnt/oldroot.
  6. Create a mountpoint for your file system in /mnt/oldroot/mnt, such as /mnt/oldroot/mnt/newdata.
  7. Set the permissions on /mnt/oldroot/mnt/newdata to allow users and others full access, as in "chmod ugo+rwx /mnt/oldroot/mnt/newdata"
  8. Edit the file /mnt/oldroot/etc/fstab and add the new file system mount information, such as
LABEL=newdata-1 /mnt/newdata ext4 defaults 1 2

You might want to edit /mnt/oldroot/etc/sudoers and add yourself with all permissions so you can switch to root without knowing the root password. Then you can change the root password and become the new sysadmin. I assume that you have permission/authority to do all this? Anyway, at this point, you can reboot to the system hard drive and you should be in business. You can then create a link in your home directory to /mnt/newdata and drop whatever you want in there.

zeroliken commented: nice +9
mike_2000_17 commented: Very cool! Is that what they call kung-funix? +13
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You still need to post your new code base.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My wife bought one this weekend, but she won't let me within a half-mile of it! She loves it, though after downloading less than 1/2 of her iTunes account to it, there is less than 1/2 of the disc space left... :lol: The resolution is phenominal, and it is incredibly responsive to the touch interface. Needless to say, she is an Apple fan-girl - iPhone (her second, a 3GS - she'd contemplating getting a new 4s), 2 17" Macbook Pros (an old G4 and new i7 system), and now the latest iPad... Me, I'm a Linux/Android fan - I refuse to pay the Apple Tax. I have an Android Nexus One phone, run Linux on my laptops and workstations, and do serious Linux development for a tier-one mobile phone manufacturer.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but I need to know what your price range is in US Dollars. The Galaxy S is a great phone. I have been using a Google (HTC) Nexus One for about 2 years now (Android 2.3 - Gingerbread) - and it has been very reliable for me. I think the Galaxy S is running ICS (Ice Cream Sandwich), which is the latest (possibly greatest) Android version available. In any case, I don't think you will be unhappy with that purchase.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, WinXP works, Win7 does not, correct? If so, then check your network settings for TCP/IP to make sure you are getting a proper DHCP address from the school's network infrastructure, or has a valid static IP address. Look at the XP network settings that work, and make sure your Win7 settings are the same.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Physical address == MAC address - hardwired into the NIC (network card). If you mean your IP address, then either you are not getting a DHCP address from your router/DHCP-server, or if you are using a static IP address, then your network configuration is FUBAR. Is this a Windows system, or is it Linux?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We have a similar setup at my place of work. Sometimes, network access points and/or routers have problems. We had such a situation today at work, very similar to what you are experiencing. So, contact the university IT help desk (you have a contact for them, right?) and let them know what is happening. No squeek, no oil...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That said, your specs are respectable for most gaming purposes. Not top-of-the-line for really graphics intensive games, but decent none-the-less.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you sure this is not a checksum? Have you ever worked with magnetic strip readers before? I have, and usually there is a checksum appended to the data stream, unless you have configured the hardware to leave it off. In any case, the reader should still validate the checksum, although some cheap readers may leave that up to the scanning software. If that is the case, then you need to have a device driver that will deal with that cruft, and present you with either a "bad scan" error, or the correct data string.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Can you boot into the BIOS? If not, then your hardware is starting to fail. If so, then reset to factory defaults and see if it boots. If not, then the hardware is starting to fail...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And I have NO idea what it costs the company! Bear in mind that we are a tier-one mobile phone manufacturer with 100,000+ employees. Compared to my salary, the system is chump change (probably about a week of what I earn).