Rather than posting a link to pastebin, post it here directly. That will make it simpler for us to post modifications for you.
Also, post your class structures.
Rather than posting a link to pastebin, post it here directly. That will make it simpler for us to post modifications for you.
Also, post your class structures.
Not reading your code, collision detection isn't as much a matter of coordinates, as it is a matter of vectors - current location + direction (in 3 dimensions) + speed of all relevant airplanes. If the vectors intersect, then you have the possibility of a collision. If they don't then ok, though vectors can change due to wind speed/direction, etc.
So, dust off your vector algebra (trigonometry & analytical geometry), and try again! :-)
Try to boot from a Linux Live CD/DVD, then try to mount the Windows file system and see if you can access any of your data. Regarding Vista, it is notoriously unreliable. If you MUST use Windows, then upgrade to Windows 7 - it is much more stable. Otherwise, switch to Linux.
Performance engineering. Add C++ to your skill set - consider Java as C++ with training wheels (like a kid's bike). I make a good 6 figure salary doing performance engineering for a world-wide networking operation. I use C++ w/ C to develop network and application performance monitoring and diagnostic tools. Why C++ and C? Because we want these tools to have minimal impact (memory and CPU) on the systems they run on, yet be as efficient (fast) as possible. In the past, our engineers used Java and scripting languages to perform these functions, but they are too heavyweight and slow to be sustainable. The tools I design and write have been shown to have negligible impact on the systems and networks they run on.
Another skill to gain these days is "big data" - Hadoop, HBase, OpenTSDB (time-series data), etc. And make sure your skills include Linux/Unix systems engineering. 90%+ of network servers running today are Linux systems.
The bitwise & operator looks at the left-hand-side (lhs) and the right-hand-side (rhs) of the expression and returns a word that has the common bits set (all the bits in the lhs that are 1's that correspond to the same bits that are 1's in the rhs). So, in your example, bFlag1 will respond to true if any bits are set, but in the second version, the rhs !(var == 1) will only set the first bit to a 1 if true, so the & operator will only return a set value if the first bit in bFlag1 is set.
IE, these expressions CANNOT be equivalent except under VERY specific circumstances. This is a great example of "doing what you mean, not what you say"... :-)
P.S. My advice is to take a course in formal (boolean) logic.
Most android applications are Dalvik ones. Dalvik applications are written with Java code, but compiled with the Dalvik compiler to the Dalvik virtual machine byte code, just like the Java compiler compiles the code to the Java virtual machine (JVM) byte code. IE, the language is the same, but the compilers and runtime systems are not. So, which is best/better? Probably neither.
I'm happy for you, getting your money back for the new OS discs. At least they finally did "the right thing"... :-)
I've been running Cygwin for many years, and doing serious cross-platform development in that environment. Most of the GNU and Linux tools are available for download and installation via the Cygwin installation tool, including the compiler/development suite and all the tools that come with that. When you run an application built in Cygwin, it will also use some dynamic interface libraries (Windows DLL's) that get installed with Cygwin. If you want more native applications, but built with a GCC compiler, then look into MingW. That doesn't require the Cygwin runtime libraries and applications built with it can be copied and run on just about any compatible Windows system.
The thing about phone tech these days is if you wait a week, a bunch of really great new cruft comes on the market! :-)
I agree that the Windows phone app market place is not as vibrant as the iPhone and Android ones, but the basic stuff is there, and the mapping and navigation apps are second to none, and completely free. I was able to navigate my way to a little out-of-the-way hotel in Puebla Mexico, and it guided me directly to the front door of the place, and handled all the 1-way streets correctly. Because you can download the maps directly to the phone, it will still navigate correctly even when you are out of cell tower range, which Google Maps cannot do yet (though I understand they are working on that).
Well, I have to believe that the testing tool is not using your public key, or it is not configured to know where your private key is located.
However, since the p7mviewer is working when you send an encrypted message yourself, but not when the test tool does, I suspect the former, that it is using a different key to encrypt it.
There is a Linux application call shred which will erase a file after filling it with random bytes and finally with zeros. Since this is an open source program, I expect it is also available for the Mac.
Is it using your private, or your public key to encrypt it?
Current Windows systems (7 & 8) sometimes seem to lose the ability to recognize USB drives. You can try to remove all of the USB devices from the Device Management control panel and then rebooting. That will re-install the devices, and it has worked for me an others that I have advised to do this with the same problem.
First, you need to "root" the drive. Then you can update as you prefer, but realize that the device may not support 4.2. Go to cyanogenmog.org for more help, possibly.
Glad to hear that at the worst you'll get your $$ back. I have a dual 24" display setup (1920x1200). Both are Dell displays, but not the same model, so getting the colors and saturation equal is not really possible - close, but not the same. However, they both look good and I can't hardly tell the difference when running videos. I've been running this setup for over 6 1/2 years on an nVidia 8800GT card. Knock on wood, but it has been totally reliable since I installed the system at the beginning of 2007. The older (left-hand) monitor is a couple of years older than the other. So, 6+ years on one, and 8+ on the other - I really can't complain! No "lost" pixels either! :-)
On Red Hat systems it is /etc/sysconfig/network-scripts/ifcfg-Auto_ethN (where N is the NIC you want to set - usually eth0). You would edit that file to change the static IP address (IPADDR=IPV4address, such as 192.168.1.100 - you can't do this with DHCP) and then run the "service network restart". Bingo! Your address has now been changed.
For Ubuntu, you would go to /etc/NetworkManager/system-connections. Each NIC (hardware or WiFi) will appear as the file named "* connection N" where the leading asterisk is "wired" for a hardwire connection, and the trailing N is a number for the connection #, such as 0 for eth0, 1 for eth1, etc). I'm not sure what a WiFi would appear as since I am running this in a virtual machine without WiFi... :-)
In the appropriate file you will find the section [ipv4] and an entry "addresses1=YourIPV4Address;YourGatewayAddress". Example (from my VM):
[ipv4]
method=manual
dns=68.94.156.1;
addresses1=192.168.1.50;24;192.168.1.254;
may-fail=false
So, change the IPV4 address (leave the gateway alone), and then, as mentioned above, restart the network services, except that for Ubuntu you would use "service restart network-manager" either as root, or with sudo. Oops. I mean "service network-manager restart"... :-) Danged keyboard keeps mistyping for me!
Samsung makes good drives, so if it works, you should be golden... :-)
How do you mean? Reset to factory specs, or to totally format the internal "drive"? Any why on earth would you want to wipe your phone completely?
I don't know, but there should be profilers like valgrind or Quantify (IBM) for .NET applications. Have you tried any of those?
There is no way to tell. You could contact Sony and find out if they support that chip. They may or may not tell you, in which case you would have to find out the hard way. Sony Vaio's tend to be pretty proprietary as to what hardware you can use with the system, or at least used to be.
I agree with jwenting, at a fun-damental level! :-) However, with practicality speaking, I have to say it depends upon what your needs are. I have both an Android and a Windows phone, and my wife will give up her iPhone when I pry it from her cold, dead hands! FWIW, the Android is my personal phone (a gift from Google at a Linux conference a few years ago). The Windows phone (a Nokia Lumia 920) is my work phone (I work for Nokia). There are things on each that I prefer to the other. Nokia's mapping and navigation tech is second to none, and our camera tech is also. Our proxy browser tech also helps to significantly reduce your data load when browsing the internet (60-90% less data usage), though our biggest competitor in that field, Opera Mobile, is similar in performance (sorry boss, but I had to say that). Because our maps are fully downloadable, and can navigate solely from GPS, you can still navigate accurately even when in "dark country" (out of range of cell towers), which you cannot with Google Maps (or at least not yet). We also cover pretty much the entire world. I have used our maps for Central America and Mexico to get to some pretty far out (of the way) places - and the maps and service are free! :-)
C# is NOT cross platform! Yes there is Mono for Linux, but it is not really ready for prime time... Consider it a Windows-only tool. If working in the Windows environment is what you want, then fine, but realize that even on Windows phone systems, Java is still the language of choice.
So, ss125 writes keyloggers? Is he a blackhat hacker, works for the NSA, or just someone who likes to see what others are doing, behind their back? :-(
So, double post and mark other as solved? Which is it? :-(
Normally, you don't create .exe files with java. You create .jar files which the JVM will execute. There are compilers which will take java code and/or jar files and turn them into native executable images. For Linux there is GCJ (gnu compiler for java) which will happily do that for you. For Windows there are the Cygwin and MingW compilers. Here is a link to the Gnu Java Compiler web site that explains a lot: http://gcc.gnu.org/java/
The key thing about C++ is object-orientation. Learn how to model your classes, their relationships, and behaviors. Then, turning that into class structures and code becomes a lot simpler. I can say this without reservation after 20+ years of C++ and object-oriented system design and development as senior and principal software engineer for major global companies and software systems used to run some of the biggest manufacturing and other systems in the world. My current CV is available in my DaniWeb profile. :-)
As for books, I heartily recommend the "Annotated Reference Manual" of C++ by Ellis and Stroustrup (the inventor of C++).
Look in the constructor name::name(const char* s1)
this is what you do:
name::name(const char * s1){
if (s!=NULL)
{
delete [] s;
s=NULL;
}
len = strlen(s1)+1;
s=new char [len]; // back***
strcpy(s,s1);
}
Do this instead:
name::name(const char * s1)
: s(0),
len(0)
{
if (s1)
{
len = ::strlen(s1)+1;
s=new char[len]; // back***
::strcpy(s,s1);
}
}
Note the use of the initializers before the body of the constructor - you also should do this in the default constructor. Also, since the s and len variable values are 0, you don't want to test/delete here. It makes sense in the setName()
method, but not here... :-)
Also note my use of the :: leader for C library calls (strlen, strcpy, et al). That will make sure that the C library functions are used, and not a possible class method of the same name!
Well, chips go bad... It may be as simple as a broken circuit board trace, a bad solder point, ... Get a replacement of the monitor would be my advice, especially since you have verified that it is the monitor and not the video card.
FWIW, I have (in the deep dark past) been a fully qualified repair tech for IBM, AT&T, Zenith, and Apple... :-)
Talk about comparing apples (sic) to oranges... :rolleyes:
Go see the "gurus" at your local Apple Store?
I just installed Debian 7.0 in a virtual machine, and dealing with grub2 is just such a PITA! The original grub (which fortunately RHEL still uses) was SO much simpler to deal with. I'm still trying to figure out how to deal with grub2. I did some such successfully a year or two ago when I was running Ubuntu on my laptop, but I dropped that in favor of Scientific Linux when Ubuntu stopped supporting my wireless cruft out-of-the-box. Yes, with SL/RHEL I still have to manually install the drivers and such, but it works, and I don't have to futz with grub2... :-(
Debian uses grub2, which is a real pita to reconfigure, though it is possible. Do you get the grub splash screen when it is booting? If so, then what happens when you hit the spacebar before Windows (or whatever) boots up? Usually you have only a couple of seconds to do that (it should show the boot menu with the installed systems displayed), though that can be reconfigured as well.
Do you have the same problem with the second display if you swap them around (plug monitor 1 into monitor 2's port, and vice-versa)? If you still have the same problem with the same physical monitor, then the monitor is bad. If you have the same problem, but with the other monitor, then possibly the card is defective. Another possibility is the cable.
Sorry, but are you using a translation service for your postings? They really are nonsensical in English! I'm trying (and failing) to understand precisely what you are trying to accomplish.
@Schol-R-LEA
As I said before, I write software in a LOT of languages, but for the system tools I am paid to write, I prefer C++. Most of our servers are Java and C++, and our client systems are embedded java,so a lot of our engineers prefer Java, if only because that is the language they have spent most of their time with. Because the tools I develop have to be "lean and mean" - ie, small memory and cpu footprint, but do a lot of string and mathematical processing, I use C++ with appropriate functions in C. I have been able to reduce old Java-based tools that took megabytes of memory and significant CPU resourses, and were very non-deterministic (mostly due to Java's garbage collection algorithms), to using a few kilobytes (or megabytes at worst - a megabyte being today's version of a kilobyte in the 1980s) of RAM and so little CPU that they almost cannot be detected!
As an example, I wrote a data collector that aggregates more than 1 billion data points per day of system resource usage, application statistics, and SNMP data from 500+ servers in a single data center (we have 5 or 6 such data centers, world-wide that support 100M+ users). We use 3 collectors for redundancy and load balancing; however, even if we shut 2 down and only stream all that data to a single collector, we use less than 3% of the collector system's CPU, and only a couple of …
Sorry, but your question isn't too clear. However, to try and answer the implied question from the subject: how to shut down a unix/linux computer from the command line. First, you either have to be logged in as root (not advisable), or have sudo privileges for system shutdown. IE:
# as root
shutdown -h now
# as normal user w/ sudo privileges
sudo shutdown -h now
This will shut down the system instantly. If you want to let other users time to finish their work, either leave off the 'now' option, or specify a time when the system will shut down. You can also specify a message that will be sent to all logged in users as a last argument to the shutdown command.
Comparison of non-identical types is not simple. You need to know which elements of each should be compared. In truth, this is an equivalence function. Create a class::compare(const otherclass& other)
function and then iterate through the instances (this and other) until they don't compare equal, and return 1 or -1 as appropriate, otherwise at the end return 0. Use this compare function in the operator==
and operator!=
functions, and return true/false as appropriate.
Ok. Try this:
printf("%d", oct[i] & 0x07);
If you need more than one character printed, then you will have to print/shift/print...
This isn't complete. The variables currentBestScore
and positions
are not defined here. Did you mean currentBest
, and square
instead?
It isn't helpful to post a link to a site that requires registration and login to view the contents. Please post a copy or snapshot of the question here.
Do you have code to post? A description of the algorithm? What you are saying is not enough to help you.
If you want to print the number in octal format, then in your printf()
statement, use %o
for the format specifier. IE,
/* Instead of this */
printf("%d", oct[i]);
/* Do this */
printf("%o", oct[i]);
Actually, to modify my earlier post, rather than a loop, you can use the C "strcpy()" or "memmove()" functions instead, eliminating the inner loop. It will also be faster, especially since x86 processors have very efficient string handling primitives that gcc (or Visual Studio) will hopefully utilize.
Run it in the debugger, or add some debug output statements, so you know where it is generating the exception.
I assume that it worked after the screen was replaced? Early failure of electronics is common. If it worked after replacement, but doesn't now, then send it back for warranty repair.
:-) LOL! Correct! ... You need to use the -L option with find to follow symbolic links. From the "find" man page:
-L Follow symbolic links. When find examines or prints information about files, the information used shall be taken
from the properties of the file to which the link points, not from the link itself (unless it is a broken symbolic
link or find is unable to examine the file to which the link points). Use of this option implies -noleaf. If you
later use the -P option, -noleaf will still be in effect. If -L is in effect and find discovers a symbolic link
to a subdirectory during its search, the subdirectory pointed to by the symbolic link will be searched.
When the -L option is in effect, the -type predicate will always match against the type of the file that a sym-
bolic link points to rather than the link itself (unless the symbolic link is broken). Using -L causes the -lname
and -ilname predicates always to return false.
Without your code, we can't help you much... :-(
nitin1 makes some good suggestions. I'd only add that we don't do your homework for you! First, try to solve the problem, and then show us your code. We will happily point out your errors, if we can...
What sepp2k said, with an addendum: if you have a name + score, and you want it sorted by name, then use the std::map template class. Assuming name is a string, and score is an integer, you would do this:
std::map<string,int> scores;
for (size_t i = 0; i < maxscores; i++)
{
scores[name[i]] = score[i];
// This assumes that you have two arrays,
// one with the name, and the other with the score for that name.
}
The std::map<KeyType,ValueType> class will automatically sort the items inserted on the first value (name in this case). If you may have multiple scores for a single name, then use std::multimap<K,V> instead.
Please clarify. This description is not helpful, to me at least. Are you trying to understand enums (enumerated data types)? What exactly are you trying to accomplish?
What Ktsuekiame said, plus this:
in your first loop, you are only moving the next element to the space. You need top move ALL of the data one character toward the head of the string, not just one. This requires another loop inside the first one. I think your teacher is trying to instruct you on nested loops... :-)