rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This sort of low-level exception is frequently caused by unaligned variables in your structures. As decepticon notes, you need to provide some of your source, including structures and where they are used.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

#ifndef is also frequently used to "guard" header files from being included multiple times, which can be a real problem. Example (myheader.h):

#ifndef MY_HEADER_H
#define MY_HEADER_H
.
.
.
#endif /* MY_HEADER_H */
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The simplest is a character substitution algorithm, sometimes called the "Caesor Cypher". Anyway, read Bruce Schneier's "Applied Cryptography". Here is a link to another text (free) that Schneier has provided and recommends: http://cacr.uwaterloo.ca/hac/index.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately the Iterator interface, and ListIterator class do not have a rewind() method, so I think you will have to construct new iterator instances as per JamesCherrill's post.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this stock as in what is in a store, or is it stock as in "1000 shares of Microsoft"? These are VERY different domains, and the solutions are very different (speaking as someone who has developed both sorts of systems).

That said, read what AncientDragon wrote. That is the basis of either sort of system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is this on a corporate network? If so, then the problem is likely that you need to deal with the proxy server that allows out-bound access to the internet. Look at your browser proxy settings to see how it is configured.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Indeed, what deceptikon asks, or do you mean "read the file from back to front"?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

On some file managers in Linux, you can specify that an executable is open in a terminal window until you specifically close it. I do that to run tools like par2repair.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Of course, if the user/player uses a binary search algorithm (start at 50, then 75, then 88) They will win in a maximum of 3 moves... Anyway, what NathanOliver said - what is your definition of "score"? Is it the number of attempts? Another observation: after your loop, you test the value of GusNum again. This is not necessary since you don't break out of the loop until the player guesses "88".

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The idea of a token ring local area network (LAN) is to allow all computers on the LAN equal opportunity to transmit their data. A "token" is passed around from system to system, and only the system holding the token can transmit. Yes, the token-ring network invented by IBM is a true ring. There is also the ARCnet token bus where instead of a physical ring, all systems connect to hubs, and each hub is connected to one or more other hubs, allowing multiple redundant paths between systems, thus increasing the overall reliability in face of hardware failure or cable breakage/detachment. Token ring itself is not fully deterministic real-time capable, whereas ARCnet is.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Make an honest effort to solve the problem, post the code here, and we can then take some time to help. In the mean time, it is time to do some internet searches. Wikipedia has a tonne of great articles on many related subjects. Here are a couple of useful links:

http://en.wikipedia.org/wiki/Priority_queue
http://www.cs.cornell.edu/courses/cs312/2007sp/lectures/lec25.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The text of your post is "Hi all, I need some help regarding dynamic vector." - where are you using vectors (std::vector<type>) in your code?

What about your "area computation" algorithm? Have you accomodated the possibility of range over-run?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And, your problem is...?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The specs are decent, but how old (in human years) is the system? And why are you selling it? A current model 4-core CPU w/ 8GB of RAM and 1TB system disc (operating system not-withstanding) would be worth about what you think it is worth ($500-600 USD). With a registered version of Windows (XP - nothing, Win7 - about $100) then it may be worth what you are asking. In my opinion, this is a GREAT Linux system for someone, but at about $300-400 USD.

What I usually do in this sort of situation (may or may not be viable in your location) is to donate it to charity (a school, library, or whatever) and take the tax deduction.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need an internet connection to activate it (Win7). If you don't have an internet connection, then I would suggest that you switch to Linux... :-) Windows will give you some time (about 30 days or so, I think) to activate it, before it "bricks" your system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

AND, we don't do your homework for you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What about using Eclipse with the CDT plugins? That is quite nice as an IDE for C/C++, AND you can use it with Java and other languages as well! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Pretty correct. This is code for a Date class that has been validated at many levels:

bool Date::isLeapYear() const
{
    bool retval = false;
    if (isValid())
    {
        int yr = year();
        retval = ((yr % 4) == 0 && ((yr % 100) != 0 || (yr % 400) == 0));
    }
    return retval;
}

So, it is basically the same as yours except that you need to properly "scope" the last 2 terms. IE, if ((year%4) == 0 && ((year%100) != 0 || (year%400) == 0))

FWIW, I wrote that code in the early 1990's, about 20 years ago... It also was validated in a full-scale Y2K assessment. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

BTW, you don't say if this is a laptop, or desktop type of system. My home workstation was having similar problems a few years ago, tracked down to overheating memory sticks. By re-arranging them to get better airflow, I was able to fix the problem. Five years later, I have had no further problems. :-)

And by re-arranging them, I mean that I have 4x2GB sticks, but have 8 slots. They were originally in adjacent slots. By installing them in every-other slot (an empty slot between each), the overheating problem was resolved, even under heavy system load.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your system board is failing/overheating. Time to get it replaced... There is no non-mechanical fix for this. It may be simply some capacitors that are failing (a competent repair shop can deal with that), or it may be an integrated circuit (even the CPU) that is failing. Even if not under warranty, you might want to check with the manufacturer to see what their repair policies/prices are, and then decide if you want to fix it (under warranty? Get it fixed. Not? How much $$ will it cost?) or just replace it. Given the current prices of new systems, if it isn't still under warranty, it may be cheaper to replace it with a new unit.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately, unless you violate Answers #2 (download someone else's software) I can't help you; however, if you can install Cygwin (a Linux environment for Windows), then you can do this, and very easily. You would use the copy -ri dir1/* dir2 command/format which will copy all of the contents of dir1 into dir2, and ask you if you want to overwrite duplicate files (of the same name). This command (cp) is a standard part of cygwin (and Unix/Linux). It is a command-line function, and does not have a GUI component...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read the documentation for this yet? What about Google/Oracle?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Huh?? Do you want to elaborate on this? The algorithm is embedded in the function, but naturally matlab doesn't provide source for you. Have you tried Googling this yet? :-)

BTW, we don't do your homework for you. Work it out, and post the code here. We will then be much more amenible to helping you fix your logic problems...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Homework, right? Sorry, but we don't do your work for you. So, what IS the question? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes, it may be too late to recover your data... :-( However, in the future DO NOT try to use Windows to recover Windows data!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Trying to recover a Windows disc with Windows is like trying to fix a broken window with a hammer! This is what I do (and have never been thwarted in this):

  1. Boot a Linux Live CD/DVD
  2. Attach a USB or other drive and mount it under linux.
  3. Mount your Windows disc (also under Linux).
  4. Either copy the data / files you need (if you are going to re-image the system), or make a bit-image backup of the data using the Linux dd (disc dump) command.

FWIW, Windows (all versions) is notorious for farking the users when "stuff" goes wrong!

I know - it is too late for this, but maybe not! If you

  1. See #1 above.
  2. Run the fsck command on the NT partition that contains your data (probably /dev/sda1 or /dev/sda2) - that may restore the data to where you can read it.
  3. If #2 is successful, copy your data to a USB or other external drive.

Sorry, but data recovery is not an exact science, and I should know - I do this regularly for private clients. My day job is as senior systems engineer for a tier-one tech company. My side-line (and previous business) is as a software and data recovery consultant.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The best of the lot (and FOSS - Free and Open Source) is ffmpeg. Here is a link to the Windows version: http://ffmpeg.zeranoe.com/builds/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What James said. In addition, a lot of the time there are JNI (Java Native Interfaces) methods/classes that are wrappers to interface with native code that is distinctly platform dependent. If you write "pure" Java, then it is platform independent - the underlying JVM (Java Virtual Machine) takes care of the platform-specific issues, such as byte order for numbers, file and network system interfacing, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If this professor worked for me, I'd fire him! This is a perfect example of "Those who can, do. Those who can't, teach."... He is trying to be overly cleaver and illustrate how you can twist meaning in programming logic. 1) it violates the KISS principal. 2) it doesn't really teach the student proper programming practices. 3) has this person EVER written a significant program that has had any social or other impact?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

From the code you did paste, you are missing a terminating '}' in npc_22000(). So, if this is not the issue, as per AD, please post ALL of your code... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You aren't creating a complex number inside of main(). You take in the real and imaginary parts, but that is all. You don't construct a Complex object from that input (c1 and c2).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is the 'c' variable? Do you mean 'counter'? IE, your code is not functional. Also, if you mean 'counter' instead of 'c', then you are setting a[*counter] to 0, so the value scanned would be set to 0, before being set to what was found int the stdin stream...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The nice thing about Windows, is that no 2 systems behave the same... :-)

My advice? Move to Libre Office instead of MS Office.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And Fortran... My last Fortran programming exercise was in 1967 at the University of Colorado where I was studying mechanical engineering. My wife, a partical physicist, is MUCH more proficient at Fortran than I am, but most of her programming work these days is in C++. I think her last pure fortran coding was in the 1980's or 1990's at Cornell... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The Boost library does some pretty amazing stuff. It is commonly used by the HEP (High Energy Physics) programming community, which should indicate its capability and quality - these are people who would rather program directly in Fortan than C++, but had eschewed Fortran for C++ with Boost over the past 10-20 years. FWIW, my wife is a particle physicist and computing division staff member at Fermi National Lab here in Batavia, Illinois. This is from her lips! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Agree with Mike2k entirely! In the deep, dark past (about 20 years ago) I replaced a linked-list structure with a self-balancing sorted array implementation. The performance increase was at least 2 orders or magnitude, and more for inserting sorted data (I used a head/tail optimized algorithm). When the array needed to be enlarged, I would use a realloc() function and increase the size by 2x. This ended up being very optimal in terms of performance and memory usage, even with quite large collections (thousands to millions of objects). So, I created an adaptation of the bsearch() routine that would return the insert location, and then you can move the remainder of the array down one position (memmove()) quite efficiently. I'd post the code here, but it is the property (now) of Applied Materials.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

P.S. After a hard day of HTTP programming (another area where "standards" are not such), I am pouring myself a nice single-malt scotch whiskey!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok! We have on your right, Assember Wars! :-) AD and M2K, please just agree to disagree, ok?

As for static variable instantiation, I do believe that is a compiler implementation issue. IE, it may be like globals (at compile time), or it may be at run time (when the variable scope is first entered). Personally, I really don't give a darn since the effect (as far as I can tell) is the same...

So, shake hands, and go get a beer!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One of the problems with "code completion" (giving the user the option of selecting previously input items) is that you REALLY need to actively parse the syntax of the language being programmed. IE, is this item a language keyword, a variable, or what? Which it may be depends upon the current statment being edited.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As usual, AD humbles us all! :-)
FWIW, I'm just an OD (Old Dragon) - hit 65 earlier this year!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And your problem is?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What deceptikon said. Adding to that, and giving you a "hint", read the words in the sentence, add them to an array, and then iterate from end to beginning. Have fun! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

tinstaafl, you usually make great postings, and I'm sure when I have a spare 5 minutes I would agree that this is one of those! :-) In any case, it sounds useful, and I WILL test it out when I have those spare 5 minutes!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

PHP is a powerful server-based language (very C++ like, but different enough to drive one wonkers) for web application development (I'm using it now to emulate a cell-phone browser). I am not familiar with Django, so suggesting which is preferable/better is not something I can answer. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What precisely are you trying to accomplish? FWIW, strstr() returns a pointer to where in string1 it found string2, and returns null (0) if not found.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Fair enough. Holler again if you hit a roadblock. Remember, the man pages, like Google, are your friends! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Can you please post what would be your preferred/optimal output?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your phone should be able to download/install updates automatically. As decepticon asked, which verions of the OS do you have? The 7.5 version (Lumia 920 and such), or the 8.x version (Lumia 920 and such). FYI, I am a senior engineer at Nokia Mobile Phones. My personal work phone is a Lumia 920.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I hope i am clear.

Not particularly. Please post your php and shell code here.