rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Using Julian date+time values for such is preferred. That way, you can use simple value comparisons to see if one date+time is before/after another, and the conversions to standard date+time using local timezone settings is well documented. There are good documents in Wikipedia for that, and may be a number of open source C++ classes you can use. I wrote my own for a major C++ framework back in the 1990's (before there was such in the FOSS community) and it is working fine today, helping run most semiconductor FABs in the world.

Here is a class (.h and .cpp files) that I wrote for my own use. I am releasing it under a GPLv3 License. IE, you can use it freely, but if you modify it you must provide the modified (and original) source to users who request it.

#ifndef AFS_DATE_H
#define AFS_DATE_H

///////////////////////////////////////////////////////////
//  Date.h
//  Implementation of the Class Date
//  Created on:      16-Nov-2006 4:23:49 PM
//  Original author: William Boyle
///////////////////////////////////////////////////////////

#include <time.h>
#if defined(LINUX) || defined(CYGWIN)
#include <sys/time.h>
#endif

#include "AFS/BASE/Error.h"

namespace AFS
{

    class InvalidDateError : public AfsError
    {
    public:

        InvalidDateError() : AfsError(UtilitySection, InvalidDate) {}
        InvalidDateError( const InvalidDateError& cpy ) : AfsError(cpy) {}
        virtual ~InvalidDateError() throw (LiveObjectError) {}
        InvalidDateError& operator=( const InvalidDateError& rhs )
        { if (this != &rhs) { AfsError::operator=(rhs); } return *this; }

    };

    /**
     * getDateFromString() - if 'ptm' is nil, a local static structure will be returned.
     * This can only be used in re-entrant code if a pointer …
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

assert() is very useful (and commonly used) in debugging new code or unit testing code. You build it debuggable, run your tests, and if an assert (used for range/bounds checking, valid states and data, etc) triggers, then you can run the code in the debugger and see what is going on directly so it can be fixed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most of these that have no slip-off access covers, or screws to remove the back, can be pried apart, but will probably require one of those plastic prying tools that can help do that without damaging the case. My Palm Pilot was such, as I recall.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most coding problems with PHP is that people don't use it as it was intended. They try to mix PHP and HTML (which you can do). It is an object-oriented language very similar to C++. Don't just output HTML. Embed it in strings constructed in the methods in your classes. Once everything is ready, then do your output, such as your CSS structures, headers, and then the HTML/JS data. This will allow you to better debug the code and improve performance (less network I/O to the client browser). PHP is a powerful language and can, if used properly, greatly increase the security and flexibility of your web applications.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Look up Knuth's "The Art of Computer Programming". Now 4 volumes (v.4 took a long time to come out - I just got it last year). Covers sorting/searching and many other critical CS topics.

pritaeas commented: The absolute best +14
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Java is C++ with training wheels.
  2. Java doesn't support multiple inheritance, other than via interface types, which in my opinion are really useless. Every concrete class that inherents an interface class has to separately implement each function in the interface! Gah!
  3. C++ doesn't leak memory. Only badly written applications do. I wrote a smart-pointer implementation for C++ that handled recursive object references (in deterministic time suitable for real-time applications) without leaking. No deletes and no leaks in 10M lines of application code! That code is still in use today (has to run 24x365) to run most semiconductor, flat-panel display, and disc drive manufacturing plants. I have seen major Java applications leak like a sieve because of unintended references. Also, the default Java garbage collection tools suck! When you server "stops" for minutes at a time while cleaning up the heap, you are well and totally fubar'd!

And yes, I have written, debugged, and fixed a LOT of major Java code (including standard Java libraries such as Jetty/Netty) in my career, and I once had a (now broken) Java mug given me by none other than James Gosling (the author of Java) himself! Smart guy, but nothing (in my opinion) compared to Stroustrup.

~s.o.s~ commented: Interesting :) +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That is a problem if this is all of your code. Please be more complete... There is nothing regarding to opening the port, writing/reading data to/from it, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What AD says. There are an infinite number of projects that you can write in C or C++. Something that may be useful are tools that can monitor system performance such as CPU usage, file system I/O rates, network usage, etc. That will also help you to learn about operating system interfaces for such. Using C/C++ by itself isn't too useful unless you also utilize it to do something meaningful.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

No.

  1. Read a book.
  2. Study code.
  3. Write code.
  4. See what works for you. Go back to 1.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is a chicken and egg problem. No drive, cd/dvd won't work. You either need to get an external drive, or have someone write it to a USB thumb drive that your system can boot from.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this what you are talking about? https://www.rapid7.com/db/modules/payload/windows/shell/reverse_tcp

In any case, what exactly are you trying to accomplish?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Versionitis? I think that Win7 and Win8 are using very different protocols to communicate with the TV, giving you the effects you are experiencing. Obviously, Win8 can understand the TV, but not vice-versa. I don't know if the TV has the ability to update to Win8 support remotely or not. If not, then you will be stuck using Win7 for now.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

VOB files are mpeg2 DVD files. As the others have said, VLC will have no problems with these. Note that most DVDs have multiple 1GB VOB files associated with a single video, so you will probably want to highlight all the VOBs in a set and drop those on VLC directly. That way, you will get the entire video displayed without breaks. Alternatively, if the video is a full DVD image (VIDEO_VS directory), then open the directory that VIDEO_DS is contained in with VLC, and you will get the entire DVD, menus and all.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

JorgeM is spot on, in my opinion. 1. Back up your data. 2. Install a clean Win7 image. 3. Run Linux or other operating systems in a virtual machine with Win7 as the host. #3 is what I do, using VirtualBox (free). Most of my work-related development work is on Linux, so I run a CentOS (RHEL) 6.5 image in a VBox virtual machine, and other operating systems as needed. Win7 is used for business-related cruf.

Mya:) commented: :) +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assembly programming is rarely needed these days. My last assembler coding was over 20 years ago, to write a device driver for a real-time operating system. These days, you don't often need assembler to do that, with a few exceptions. 98% or more of the Linux kernel is in C, with some assembler for very low-level necessities, such as in the C functions to control DMA, etc. Consider the C language instead to start. It is often considered a "high-level" assembly language.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, if any of the intermediate directories don't exist, you can add the -p option to mkdir. IE,
mkdir -p /red5/webapps/openmeetings/upload/files

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@AD
True enough, but I do like consistency! I find that I make fewer mistakes that way, and IMO consistency is the root to reliable code. I've spent 30+ years (20+ with C++) writing code for ultra-high reliability systems, both embedded real-time and enterprise, where failure (bugs) can either cause a plane to crash, a factory to trash a gazillion $ worth of product, or introduce a fatal defect in a medical device or drug.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you getting an error? Have you properly unmounted the device (safely remove device on Windows) before removing it? Have you run chkdsk (Windows) or fsck (Linux) on the file system contained by the device? Have you formatted it?

As you can see, there are a lot of possibilities. Your question doesn't provide anywhere enough information to help you at this point... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Both AD & Mike2k's answers are good. I just have a small nit to pick with AD regarding proper use of member initializers in a constructor, rather than inside the body of the constructor. IE, instead of his example, I would do this:

    class Foo
    {
    public:
        Foo() : _x(0) {} // inline method
        void setX(int x) {_x = x;} // another inline method
        int getX() {return _x;} // another inline function
    private:
        int _x;
    };

IE, it is always prefereable to have your member variables properly initialized before the constructor is executed. It helps avoid a lot of buggy/invalid code in my experience.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What David_W said. This is not a beginner problem. First, you need to understand something of file system structures. Next, you need to understand how to relate that to program code. Other than re-iterating your class assignment, you haven't done anything that lets us think you understand the scope of the problem, or any approaches that may be fruitful in solving the problem.

One good approach (to give you a hint) is using an extent-based file system. IE, a file consists of one or more extents - locations on the disc where parts of the file exists. The first part of each extent is a header that indicates the size of the current extent, and the disc sector where the next extent is to be found.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I would strongly recommend that you install LibreOffice instead of OpenOffice. It is much more up to date, and compatible with all OO files and file types.

JasonHippy commented: I second that motion! +9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. You don't show what the problem is.
  2. This would be better done with a do {...} while (condition) loop instead of your while() {...} loop. Example: (eliminating the priming read)

    do
    {
    System.out.print( "Enter an integer, or -1 to stop > " );
    number = scan.nextInt( );

    // processing
    if (number != SENTINEL)
    {
        System.out.println( number );
    }
    

    }
    while (number != SENTINEL );

Normally, we don't recomment do...while loops, but there are times when they are called for. This may be an instance of such.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Right... Sorry. How long did you leave the device in a drawer until you needed it again? Or is it REALLY yours? Forgetting your phone unlock code (a 4-digit PIN) is something like forgetting to put your pants on before leaving for work - not really likely, popular jokes notwithstanding... :-(

faroukmuhammad commented: You are right mate +5
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I run a LOT of systems in virtual machines (thousands in the Amazon cloud for example), and we use ssh to connect to these systems. Note that the sshd service on the systems you want to connect with may either limit connections from known hosts, and/or require a private key certificate to connect. We do that to keep unauthorized people from connecting to our servers.

So, read the ssh man page and ask the server admins for the machine(s) you want to connect with what you need to do to get into them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. Give it your best shot and post the code here with questions about problems you are still having. FWIW, I do this stuff for a living. Why should I help you cheat on your homework when I have had to learn this stuff the hard way, by doing it?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This appears to be a system configuration problem. The file /mnt/repodata/repmod.xml is either not available, not readable, or not writeable. In any case, normally, it would not be in /mnt, so I expect that you did something to alter the configuration of yum that caused this.

Since I don't find anything like this on my RHEL systems, I suspect that you may want to create the directory /mnt and try again. FWIW, what version of RHEL are you running?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is a great article and video from the Free Software Foundation (FSF) about using FOSS (Free and Open Source Software) to do complex audio/video editing tasks: http://www.fsf.org/blogs/community/how-i-made-a-video-for-libreplanet-using-all-free-software

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Computer networking? Social networking? Professional networking? What are you talking about? :-)

dennis.ritchie commented: LOL +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you can write C++ code, you can learn and code in python well enough in a day or two to convert this program. The logic will not change - only the program syntax. IE, if you started to learn it when you first posted, you would be done about now, or this time tomorrow at the latest.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Once you start running Oracle you will need more memory. You can do that with virtual memory (swap space), that that will slow down the system terribly! So yes, upgrade to 64-bit Windows and if you can upgrade memory to 8GB. You will be a much more happy camper with that setup. In this case, more memory and 64-bit OS will serve you better than a faster CPU. At least you have two cores - which is equivalent to 2 CPU's. I have a similar setup with my old Dell D630, which has 4GB of RAM, but then I am running 64-bit enterprise Linux on it which works well with 4GB of RAM.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I've always considered Java to be C++ with training wheels, garbage collection notwithstanding. As a matter of fact, Java's garbage collection (gc) is a major contributor to performance issues for Java applications that are long-running and serious resource users. I wrote a reference-counting gc for C++ back in the 1990's that allowed us to run major enterprise applications written in C++ 24x365 with no memory leaks, and NO application-level delete calls! That code is still running most semiconductor, LCD display, and disc drive manufacturing plants today. These are plants where 1 hour of downtime costs about $10M USD in lost profits...

Smart pointers are fine, but unless they are combined with reference-counting life-cycle management, are of limited use. I'm not that familiar with C++11's shared pointers, so it looks like I have some additional research to do. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Re. ipkg for installing .ipk packages. Let me do some research and get back to you on that. I've been running RHEL/CentOS/SL systems for about 8 years now and never ran into that requirement! :-)

Ok. Here is a link to an RPM that will install the ipkg installer on Red Hat 6.x or compatible (such as CentOS) systems: http://rpm.pbone.net/index.php3/stat/4/idpl/21706162/dir/redhat_el_6/com/ipkgbuild-0.8.0-1.el6.pp.noarch.rpm.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As Mike2k said, apt-get/aptitude/synaptic/dpkg are package management tools for Debian-based distributions such as Debian, Ubuntu, Mint, et al. For RedHat-based distributions you can use yum, or rpm. That said, yum is the current preferred package manager for RH distributions as it deals with dependencies much better than rpm, whereas with rpm you are pretty much on your own. There are rare occasions where using rpm is called for, but only in rare, and advanced situations, and then it is a case of caveat developer (developer beware!)... :-)

FYI, Suse distributions use yast, which is also an rpm-based package manager. So, if you want to install an rpm meant for a RedHat system, it may also work on a Suse/OpenSuse system (and vice-versa). Again, caveat developer/user!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I would suggest a strongly recursive language such as prolog, lisp, snobol, APL, etc. :-) Yeah, we are getting into the prehistoric era of programming, but that doesn't say some of those languages aren't appropriate for this purpose!

These days, given the penchant for web-based programming, javascript or some of the newer languages that compile to JS may be appropriate as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'm sure there are some here who speak Portuguez - I speak Spanish and can guess what your comments mean, but others don't. Please translate your post into English as well as you can.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You don't say what country you are in. It looks like a moderate Linux/Android fondle-slab (tablet). Not shabby, but not high-end either. Memory (RAM) is minimal (1GB), and internal memory storage is adequate (16GB), but you can add a 32GB SD card to complement that. It appears to be from the United Arab Emirates. Since I don't know where you are located, this may or may not be helpful.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What deceptikon said. More memory is good - if your system supports it, then 8GB is appropriate, especially once you start running Oracle. BTW, what operating system are you running?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you want us to do your homework for you? Make an effort to solve the problem and we can help you. This is not sufficient... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Telecom companies that sell these devices often install applications that are not in the basic load from the device manufacturer. This is the most likely vector for such infections. Myself, I will NEVER purchase a phone directly from a phone company, but will purchase an unlocked one that I can use with my "preferred" phone company. It costs me more up-front, but much less in the long term since I am not paying a premium for my account and don't need to get a term-limited (2 year typically) contract. You know the old saying - you can pay me now, or you can pay me later... :rolleyes:

Using an unlocked Android phone means that I can get a SIMM in a foreign country, plug it in, and not have to pay international roaming charges. This has saved me hundreds of $$ in the past.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Explain exactly what you mean by "app tracking" and "website tracking".

catcit commented: I want to be able to see a list of the open programs how much time did the user spent using that program actively. The same for websites. +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you (that is cheating). Please make an effort to do the assignment, and we can help you with your mistakes.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, it depends upon the dependencies of the package on Windows-specfic libraries and header files. I can only ask why you would want to do this? Experimentation? Need exact functionality that the netcat on Windows provides?

I have written many cross-platform applications an libraries that run identically on Linux and Windows. It is not necessarily a simple process. Also, Linux compilers will not create .exe files, but executable files - in this case it would be netcat, not netcat.exe, although changing the name wouldn't harm anything, or you could make sure that the Makefile created it as netcat.exe.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For Linux, go into "Sound Preferences" and disable the audio input device. Don't have Win8 so I can't say what to do there, other than what I would do with Win7 - disable the mike in the hardware settings.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

See my response in your duplicate posting...

Reverend Jim commented: Sorry +12
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most of the time, when you install Linux, it already has the drivers you need for your hardware, including video. Linux is NOT Windows! It will interrogate the system on boot and enable the needed drivers at that time. Sometimes you can get better performance with proprietary drivers (nVidia video cards are a good example of that), but don't bother until you really need them.

So,

  1. Don't just download and install drivers until you really need them.
  2. You don't need to mount a driver on disc. Either the package manager will do that for you, or when it is built from source it can be installed directly onto the system disc. Linux has standard ways to do that.

I have installed Linux in various forms on many systems. Usually, I don't need to deal with hardware drivers at all. This includes servers and laptops.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'm not sure I understand your question (#2). I have been programming Linux/Unix systems since 1982, and led the Y2K analysis/remediation effort for a major software company in 1998 (10 million lines of Unix and Windows code). Also, I have written C++ date/time classes that can handle date/time values up to the heat death of the universe, to the millisecond.

So, please be more explicit (and clear) as to what your concerns are.

P.S. The "heat death" of the universe is hypothetical. Let's just say that my date/time classes handle this up to a REALLY big number. :-)

If you want that code, it is now owned by Applied Materials - the 800lb gorilla of the semiconductor manufacturing equipment industry.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Mike2k
Generally, you are spot-on with regard to the old nVidia drivers, but I have been VERY happy with them since 2008 (CentOS 5.x), including on my nVidia laptop (a Dell D630) as well as my personal workstation (8800GT card). I am running Scientific Linux 6.x on both now, and there are ABSOLUTELY no issues running the proprietary drivers, and I do a lot of graphics intensive work on them.

Recently Linus Torvalds gave nVidia a big "thumbs-up" for their recent efforts to be more supportive of the open source Nouveau driver, instead of the big middle finger he gave them last year! Hopefully they will continue in this direction.

FWIW, the Nouveau drivers have improved significantly as a result of nVidia's contributions to Nouveau. I recently upgraded my workstation to SL 6.5 and the Nouveau driver was MUCH better than the old ones. It still had some irritating glitches, so I replaced it with the current nVidia GeForce driver - no glitches and still performs much better than Nouveau. If it weren't for the small, but irritating glitches (such as issues with cursor tracking between multiple screens), I would have kept the Nouveau driver.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Suzie999 was being nice to you. Usually we just say that we don't do your homework for you, but if you try and post your code here, we will usually try to point you in the right direction. So, get to work, and make an effort!

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

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.