rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to post your errors and where they are coming from if you want any reasonable help. Asking for people to analyze 250+ lines of code is not usually received well. In any case I don't have time as I am currently out of the country until after the first of the year and have little time for such.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A perfect example of how to NOT get help on Daniweb...

Aeonix commented: Worked for me thus far! +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is always the speed of light to consider, plus switching time in the necessary optical cable repeaters. That's about 135ms to traverse the world without repeaters, routers, switches, etc. From Amsterdam to NYC you still are looking a 20ms just to cover the distance. There there are all of the routers, spy systems, switches, etc. Longer if you go via satellite. These are barriers that cannot be avoided. So, if your packet from Amsterdam to NYC takes less than 100 ms, consider it a win. Try pinging a server across the Atlantic like that with Speedtest.net to see what is your likely best bet.

Aeonix commented: I see now. Thanks. I guess next "breakthrough" is when we will find out how to travel faster than light. Only 500 billion years to go! +4
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but this is invalid code. i is not initialized before you use it in the switch statement. It will contain random values.

AndrisP commented: Oh, sorry - it can initialize in line 4 by any value except 4 and 5 +5
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What rproffitt said. Also, this is an indication that either the file system is munged, or the disc has too many bad sectors. Back up the data and get a new thumb drive, as advised.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to read up on sed and Linux/Unix regular expressions. The dot (.) has a special meaning - ie, any character. You need to preface each with an escape back slash (in a shell, two back slashes) to tell the tool to consider only a dot. Also, forward slashes are expression separators. They also need to be escaped like the dots. Try some experimentation until the output reflects your intention.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Basic programming stuff. Show your code and I'll show you where you are in error.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You don't show the message in your post, so helping is difficult. Since a lot of system tools depend upon Java these days, it should be installed on your system. You need to do a thorough system virus/malware scan, preferable using multiple A/V tools.

rproffitt commented: Reminds me of folk that need car parts but don't tell make, model, year, etc. +11
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My advice is to not try and do a direct translation from Fortran to C++, but to first analyze what the code does, and then re-implement that in C++. There are tools, such as Enterprise Architect that can reverse engineer code into UML models, state machines, etc. which can help with this process.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you mean as in a print screen capability? All versions of Win7 should be able to capture a screen up to the full resolution of the display. What precisely is your problem? And what screen capture program are you using?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not asking for much are you? You figure out what game you want to code, and then you write the code. Post code and such here when you have run into problems. Sorry, but we don't do your work (or homework) for you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How you code this depends upon how the lights are integrated into the system. If directly connected to I/O ports of the computer, then you would use io-in and io-out instructions to read or set their states (on or off). If other such as serial ports, the problem is a bit more complicated but not too difficult. What you have posted so far is useless for us to help you.

rproffitt commented: Lights += 1; +11
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What JamesCherrill is saying - do the work and when you are still having problems, show the work (code) to us for review. We DO NOT do your homework for you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Get a copy of K&R (Kernighan and Ritchie) and read a lot of code. Then, find a mentor you can talk to when you are having problems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
rproffitt commented: !] +11
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Asking people to analyze over 400 lines of code is disrespectful IMO. Eliminate the unnecessary cruft such as many of your getter/setter methods for this class that do no touch the $url member.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Date and time output formatting can easily be done with a format string in the query. Check the MySQL online documentation for your version for details: www.mysql.com

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The principal user of a computer should (under most circumstances) be a member of the Administrator group for that PC (only) so they can do these things without a lot of futzing around.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, remember there are two MySQL api's for PHP. One is the mysql api (deprecated and no longer supported), and the newer mysqli api which is the currently supported one. You will find documentation for them on the PHP web site documentation pages.

rproffitt commented: +1 for noting that. +11
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Floating point math on digital chips is notoriously difficult, and you need to throw away the last bits at the least. My good friend and college buddy Bruce Ravenel designed the architecture of the Intel 8087 math co-processor (https://en.wikipedia.org/wiki/Intel_8086) which was the first implementation of the IEEE floating point standard on a chip. By doing all computations in 80 bits internally (instead of the 64 bit double precision floating point standard), he was able to truncate the result and store to a 64 bit variable without loss of precision like what you see. Here is the specific article on the 8087 chip set which will answer some of your questions: https://en.wikipedia.org/wiki/Intel_8087

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Every major distribution has a section of documentation called How-Tos or FAQs. They also have user forums which are great for getting questions answered like you will have. Then there are the Linux Forums (www.linuxforums.org) which is full of helpful posts on most distributions plus other stuff (networking, programming-scripting, etc).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what exactly is your problem? Have you considered writing a stored procedure in the database that can take the relevant data and do those inserts within the scope of a single transaction? That is a LOT safer than doing the inserts directly in your web code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Knowing more fully what you are trying to acccomplish would be useful.

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

So, what is your problem?

rproffitt commented: So far, it looks like they are new to asking the questions. +10
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read Niklaus Wirth's seminal CS text "Algorithms + Data Structures = Programs". It has had an honored place on my bookshelf for many years.

pritaeas commented: And mine! +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One suggestion is that you always put the numeric value on the left side of the expression. That way, if you accidentally use '=' instead of '==', the compiler will complain. IE:
else if (0.00 = grade && 64.99 >= grade)
This will generate a compiler error for the first term. Also, I think you want to use an 'OR' instead of 'AND' as in
else if (0.00 == grade || 64.99 >= grade) because the grade cannot be both 0.00 and <= 64.99 at the same time (unless it is actually 0.00). Anyway, you really need to re-analyze your code. I don't think it is working the way you want.

Reverend Jim commented: Ah yes. The Yoda conditional. +14
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. What OS and version are you using?
  2. What programming language do you want to use?
  3. How is the modem attached to the computer? Is it a serial modem, or USB?
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We don't do your homework for you. You need to analyze the problem and provided code and then decide upon an approach. Until you do, and make the code enhancements needed to fulfill the assignment, don't ask us to help. Once you do, and post your errors (compiler or runtime) here along with your code, then we can help point you in the right direction.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Like James, I also did a considerable amount of Smalltalk development in the early 1990's. We were in the process of deciding whether to use ST or C++ for the development of FACTORYworks, a major semiconductor factory MES. We did a lot of prototyping in Smalltalk to prove our concepts, but in the end went with C++ for the production software. Because ST is so well designed as an object-oriented language, it was not difficult to take those prototypes and implement them in C++, though we had a LOT of framework stuff to do that ST supported out-of-the-box, such as reference-counted garbage collection, inter-object and inter-process message passing, etc. I managed the design and development of that framework. In the end, we had 10 million lines of production code, not one delete statement, and zero memory leaks. We could also plug in a shared library and voila, instant support for another relational database!

I will always have a tremendous respect for the inventors of the language at Xerox Parc - a place that was home to many of the technical innovations that we now take for granted.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried to convert the hex string to bin (hex2bin()) and then to base-36? Or the binary string to base-36. In any case, it must be a pretty big number to need the base-36 conversion to compress it. Some more information, and the original binary or hex string would help to sort this out. We could try some different approaches to see what works best.

Final question, which version of PHP are you using? I know that with 5.4 I had to do a lot of bug fixing in a number of areas where it was just wrong in order to do my work with Nokia.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is standard stuff. The main things are these: security, accessibility, security, security, security... :-) IE, don't try to do this if you are inexperienced in setting up internet network accessible servers in a secure manner. Accessibility is not so much a problem. You can either make your server fully internet accessible (not a good idea), or poke a hole in your firewall for the ports you need to make your system accessible. In any case, you will start getting probes almost immediately to find weaknesses in your network and server that will allow malware criminals unfettered access to your systems, data, and other resources. These are reasons why using hosting services with good security practices is a great idea when starting out. Trust me, I do this for a living! And the game changes so quickly that even if I were setting up an internet-accessible network server myself, I would use a reliable service provider. When I was at Nokia, we had thousands of servers that were internet accessible, and we had an entire IT security team to deal with this cruft. Even when we migrated from our proprietary server farms to Amazon EC2 systems, our security team worked closely with Amazon experts to secure access to our servers that supported over 100 million customers.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not a good approach. Set up a Sieve of Aristhostenes array (I usually hard code a 10K array) for initial lookup - remembering that a%2 == 0 indicates the number is even, hence not prime. You only have to deal with odd numbers. If the number you are looking at 'a' is bigger than the 10K array limit, then you can easily find with a recursive algorithm that will minimize the number of divisions you need to perform. This is a pretty good article on the subject: https://en.wikipedia.org/wiki/Sieve_of_Eratosthenes

I coded the solution to this many years ago and could determine if a number was prime up to 15 digits on an old 80286 / 80287 processor computer in a few milliseconds. With current infinite precision libraries such as Boost these days, you can go to any number of digits in a very short time.

rproffitt commented: Some folk find it odd to use prior works. I think this makes us even. +10
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What AssertNull isn't saying (directly) is that you are breaking the KISS principal. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The simplest solution is to change your network's ssid to some unique name that will not likely be replicated somewhere else. You can keep your password.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you looked into Amazon's S3 storage service?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you really expect us to analyze and comment on almost 1000 lines of code? I'd be happy to for my normal consulting rate of $200 USD per hour... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Study and work in the subject for about 5+ years and you might get a clue. FWIW, VBA and other Visual Basic versions are NOT used for enterprise class software, other than for writing user interface components. They then will typically send transactions to an application server (typically written in C++) to be processed, with the results returned to the VB application.

සශික commented: Thank You Sir :) +1
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Start by writing out the algorithm in non-code terms to be sure you understand it. Then apply the algorithm manually to see if it corresponds to what you can observe directly. Do this for both saturdays and sundays. Once you have verified the algorithm, then you can code it. IMO, you are putting the cart before the horse.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Get a new phone and change all your phone passwords.
  2. Wipe all your systems, including the BIOS flash memory. This would include using an industrial strength disc eraser that will clear the boot / partition sector as well.
  3. Reinstall new / patched operating systems. DO NOT USE WINDOWS!!!!
  4. Virus scan all backed up data.
  5. Use a good hardware hardware router / firewall. Configure it to not allow remote management. Do this BEFORE you connect it to the Internet.
  6. Only open up pinholes in the router for the applications you need, such as your VPN.
  7. Change all your VPN access keys and passwords.
  8. DO NOT use the same passwords on your systems as you did before.
  9. Disable remote root logins to your systems if they don't by default.
  10. Use an industrial strength spam and malware scanner for your email. Gmail is pretty good at this.
  11. Make sure you configure IP Tables and SELinux properly. If the OS you installed doesn't support SELinux, get one that does. Period.

Now you are ready to reconnect to the Internet. I'm sure I forgot a couple of items, but these are the important ones, IMO.

Gribouillis commented: Also use a password manager to generate and store passwords +14
rproffitt commented: For some, this is what it takes. +10
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

No code. No help... Post the relevant code where you are having a problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@cereal's link is a good place to start. A bit of background information - PL/SQL is a derivative of the ADA programming language. It can also call into the Oracle JVM if you need to write some Java code to use in your database procedures.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is no real reason other than "showing off". That said, toupper(int ch) returns an int, so they may have wanted to force it to return a char, which they could have done with a simple (char) cast which is effectively what static_cast<char> does. IE, a waste of space, and it makes the code more difficult to read and parse.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Initialize even and odd to 0 when you declare them. Don't reset them inside of your loop.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

RTFM. There is a lot of eclipse support on the Internet as well on the Eclipse web site.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

it should be if (&anA != p). Sorry, my bad. Dagnabbit keyboard! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@CimmerianX - I prefer to name the partitions so I can mount them in /etc/fstab by name instead of UID. Why? Because if I have to clone the drive due to incipient failure of a drive, I can clone it and the system will immediately recognize the partitions, whereas the UIDs will have changed with the new device - at least that has happened to me in the past.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Standard boot/partition sectors (old style DOS ones) cannot handle more than 2.2TB disc sizes. As the warning states, you need to use a GPT partition table type. I don't know if Windows supports that or not. Also, RHEL systems (5.x and later) can handle NTFS file systems just fine. What version of RedHat are you using? FWIW, Windows may ignore the partition table type in this case, but I don't think you can use FAT for a 3+TB file system - NTFS will be required I think.

CimmerianX commented: Correct, You need a GPT +9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

std::cout << "beep: " << '\07' << std::endl;

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You probably ran out of RAM and don't have adequate swap space configured. Check memory usage, and increase swap space. The system will run slower as the swap file is in use, but it should run. If it continues to happen in much the same way, then you may have a bad RAM chip.

fallout4player commented: yes, maybe. but im pretty sure that i wasnt short of ram. i have 8gb of ddr3 runing at 1333mhz +1