rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. Make an effort, show your code, describe your errors, and then we may help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you have other radios on the farm that might interfer with the frequencies that the access point and laptop use (2.4GHz and 5GHz)? If you are using 2.4GHz, and your gear supports 5GHz, you might want to try the higher frequency, though distance will suffer. Since you say that the laptop is only 12 feet from the router/access point then this is not likely to be a problem.

FWIW, both 802.11a and 802.11n support the higher frequency, but you will need to configure your laptop and/or router wifi devices accordingly most likely.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, don't bother writing your own sorting and searching functions - chances are you will get them wrong! Use qsort() and bsearch() instead. These are standard C functions (usable in C++ as well), or if you have to use C++ classes/methods, then things like maps that automatically sort elements are appropriate. IE, these techniques will reduce your code to a few lines...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Actually, in C++, you can use C functions, or C++ stream functions, including doing things like turning off echo in input streams, so you can do the mapping of input characters to things like '*'. The program can still get the real data and process it appropriately.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

VLC supports multiple playlists. You can export a current playlist to a file, and then reload that later via Media->Open File.

Slavi commented: +1 +6
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FTP is useful if you don't want to trust your data to the cloud, but bear in mind that raw FTP is inherently insecure. There are secure FTP versions available. FTP is part of the basic TCP/IP protocol stack.

Most cloud storage solutions have decent security and encryption these days, and they are convenient - all you need is an internet connection to use. Part of the issue is how much storage space will you need, and what is the biggest file you will be storing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In the first example, you have allocated room for 5 characters, but you need 6 to include the string's terminating null byte. Also, you have specified that "Happy" is a wide character string, which requires 12 (2x6) to properly handle it.

As for the difference between the two, you haven't defined what T is as yet. I assume a vector or similar. In the case of t1, that is a pointer, and t2 is an array (a pointer to be sure, but not necessarily in the view of the compiler).

So the issue here is one of consistent treatment of your data. If you are using pointers, then use pointers consistently. If you are using arrays, then use arrays consistently. Yes, they may work together OK, but don't make assumptions you cannot prove!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need a number of tools for this, including a harness that will provide a load similar to what the system would generate. In addition, you need diagnostic tools such as a volt-ohm-ampmeter and possibly a scope. Not a job for the inexperienced or the ill-prepared.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My laptop has an eSata port. I can connect an array with 8+TB of space to it without problem. Unfortunately, a lot of current laptops are moving exclusively to USB 3.0 ports and removing the eSata ones. Pisses the heck out of me! I need to get a net laptop, but none of the ones I am interested in have eSata ports without a USB -> eSata adapter.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The answer is simple: 2^64 - 1. Why bother with the loop?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, itoa() is a non-standard C/C++ language extension. Don't use it. Normally for C++, you would use something like sprintf() instead, like this:

char tpid[33];
int numchars = 0;
numchars = sprintf(tpid, "%d", (int)Processes.at(pindex).pid);
if (numchars > 32)
{
    // sprintf() returns number of chars output, not
    // including the trailing null byte, so check for
    // more than 32 for a 33 char buffer.
    throw(overflow_error);
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That code works except for the initialization of total and the loop limiter. An accumulator in this case is simpler than keeping a register of all the results, but there may be times when you want that information for more complex calculations.

This should work for you:

    Scanner Keyboard = new Scanner(System.in);
    System.out.print("Please enter your number: ");
    double userNum = Keyboard.nextDouble();
    double total = userNum;

    // Only do 4 iterations - the input userNum is the first item.
    for(int i = 1; i < 5; i++)
    {
        // Print previous userNum amount.
        System.out.println(userNum);
        userNum = (userNum/2.0);
        total += userNum;
    }
    // Print final userNum.
    System.out.println(userNum);
    System.out.println("your total is " + total);
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You really don't need to downvote a person who is trying to help you "learn to fish". What about my post didn't you understand? Downvoting should be used only when you think someone is totally out of line. I don't think I was.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

From the department of sarcasm department: Windows 10 will be ready when Windows 11 ships... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Services can be disabled from autostarting in the control panel, and you can remove other auto-started applications by removing them from the Start menu's All Programs Startup folder.

cambalinho commented: thanks +3
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What diafol said. Mixing html and php like that is just asking for trouble. First, build up your output html in php classes and variables. Then when you are ready, output the data. You can take the data/age input from another page, and call this one with the data you need for display and other purposes. This may help: https://www.daniweb.com/web-development/php/tutorials/484310/why-you-dont-want-to-mix-php-and-html-directly-

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. We don't do your homework for you.
  2. See #1
  3. See #2
    .
    .
    .
    Post your work, errors, problems, etc and we may be able to help.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It depends upon the system. Linux can handle timing in the nanosecond realm. You need to run both algorithms many times, accumulate the time, and then compare. Just comparing on one run that may only take nano, micro, or milliseconds is not sufficient since other stuff is also taking system time. Your process is not the ONLY process running...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. Post your questions, code, errors, and problems (incorrect results or output) here and we will help if possible.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It depends upon the usage. For personal and gaming systems, mostly Debian and derivatives (Ubuntu, Mint, et al). For enterprise servers, mostly RHEL and clones (CentOS, Scientific Linux, Oracle Linux).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I'm not sure there is much we can help you with here. Part of the issue with algorithm development is the math and the logic. If you aren't strong with those, then you are going to have problems. Start by writing out the problem, and then your solutions, using plain language. Next, when you think you have the domain properly understood and a possible solution, write it out in computer pseudo code, along with the logic and math to support it. Be as detailed as possible. I think 90% of the time will be getting this to where you are sure you understand and have a solution to the problem. Only 10% will be writing the code. BUT DO NOT START WITH CODE!

ddanbe commented: Exellent advice. +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most routers have 100mbps ethernet links, so if your WiFi is 802.11n, it will have close to that speed. The advantages of a wired connection are these:

  1. More reliable and stable data stream.
  2. No radio interference (w/ accompanying speed degradation) from neighbors' access points (AP).
  3. If someone connects to your AP/router with a slower connection type, such as 802.11b, then you won't be impacted.
  4. Less chance of being "hacked" by a drive-by road warrior.
JorgeM commented: +1 yes, exactly.. +12
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Per David W's post, modular arithmetic returns the remainer of a division operation, so 4%2 is the remainder of 4/2 which is 0. If there are 30 days in a month, then if it is the 15th of the month, the remainder of 15/30 is 15, so 15%30 == 15. If we are using the day of the year to determine the month, and day of the month, assuming all months have 30 days, then if the day is 250, the month is 250/30 == 8 with a remainder of 10. So 250%30 == 10. IE, the date would be the 10th of the 9th month (September 8th) as the 8th month (August) is complete.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And remember, we don't do your homework for you. We get really cranky when people post the assignment, but not their work...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, are you having a problem? The code looks ok, functionally, although you should probably add conditions that test for equality as your code won't trigger if it finds an equality condition. IE, if (a >= b && a >= c) { if (a==b) printf(a and b > c); }, etc. It does get more complicated that that, since you also have to check for equality with c, so if a, b, and c are all equal, you might want to note that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How depends upon the operating system. If it is a simple program, then with Windows, you add it to your Start menu. If Linux, you can add it to /etc/rc.local. If it is a service, then for Windows you add it to the Services list to be autostarted. If Linux you add it to the rc.<runlevel> files with the chkconfig command (as root or sudo). Read the Linux chkconfig manpage for more details.

As for Windows programming / GUI programming, that is another topic entirely, and I suggest you create a new thread for that! :-) And good luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It depends upon the system. Usually you need to access the computer manufacturer/vendor's website and support page for such information. In some systems, you can do that by removing the external power, remove the battery, and hold the power button on for some period of time (30 seconds usually will work) - a lot of Toshibas work this way. Others require that you remove the power (and battery if a laptop), and short a couple of contacts on the motherboard for some number of seconds. A lot of HP laptops require this latter technique. My attorney gave my grandson an HP laptop that had the BIOS locked with his fingerprint. My grandson, who is an engineering genius, removed the keyboard cover, shorted the required contacts, and had Windows 7 installed, all in less than an hour! I gave him the system, sat down to talk with my daughter, and after a bit he brought the system into the living room, which proviously was running XP, to show it running Win7. Heck, it would have taken me at least 2-3 hours to do the same! :-)

cambalinho commented: thanks for all +3
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The strstr() function returns a pointer to the start of the results string that matches the target string in the source string. Since they are both pointers, you simply subtract the source string address from the results string (pointer math) and you get the offset of the target in the source in bytes. IE, this will be the position of your target. This is the most efficient method, and one I use regularly with log file data in order to extract the bits I am interested in. See the man page for the strstr() function. If you need a copy, let me know and I'll post it here.

Here is an example:

char* pStart = source_string_address;
char* pTarget = target_string_address;
char* pResults = strstr(pStart, pTarget);
// Assuming that pResults is not null
ssize_t results_location = pResults - pStart;
Gà_1 commented: Seem that your method is for counting (find pos) at characters. Can you please expain more about how this method work at counting at words(in OP's pb) +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Read the data file into a single string, replacing new lines with spaces.
  2. For each string in the query file, use strstr() to find the position in the string from the data file.
  3. Done.
Gà_1 commented: Much better than my idea. But can you please explain more how can we find "position by number" using strstr(). +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read this tutorial on random number generators and you will understand better how all this works: http://www.phy.ornl.gov/csep/CSEP/RN/RN.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is not enough to go on. Are these sensors built into your computer? External sensors with some sort of network connectivity? What? Have you contacted the sensor manufacturer's web site for libraries/api's and such to communicate with them, or even to get their technical specifications?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please read the terms of service/use for these forums. We do not do your homework for you. When you have written the code to solve the assignment, and you are having errors or problems, then post it here and we may be able to help.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

On Windows systems, Cygwin provides a Linux-type command environment with all the usual tools, including GCC compilers, bash shell, c-shell, and such. It works very well. I used to use its xorg X-Windows server in order to run X applications on remote servers that I had connected to with ssh or Putty (using the -X option to forward X-Windows protocol messages to Cygwin).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My advice? Just build optimized code and strip it before shipping. Trying to make it impossible to reverse engineer is a waste of time and resources. Yes, you could encrypt it, and require a proprietary key to decrypt it as it is loaded into memory, but once in memory, it is still vulnerable. We tried this once in the past, and the results, while pretty secure, was a serious PITA and we dropped it PDQ. That code runs most of the semiconductor, flat-panel display, and disc drive plants world wide, and we never in 20 years have seen anyone try to "steal" the code. It just isn't worth it!

If you have something really unique and solves problems in non-obvious ways, then patent it. That's the best protection for really original work. I know, I have one for adaptive systems as sole inventor. That patent is currently owned by Applied Materials, the 800lb gorilla of semiconductor equipment and software.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Scheme is basically Lisp. Sounds like you need to do some more study here. This may not be school work, but it looks a lot like homework for a course you are taking, even if an online one. Do you know how to write a recursive Scheme function? That is what you need to do for the fib() function.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@XP78USER - the /all flag should not be necessary to find the gateway address. What it will do is generate a lot of confusing data for a new user. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Part of your problem is that you are using the same name for the global Numero_de_Materias as well as the argument name for a number of functions. DON'T DO THAT! use different names. This is why I try to indicate that a variable is global with a leading g_Name or static with s_Name. That will keep things clean. If you want to continue this discussion via private mail yo puedo hablar espanol con fluencia.

That said, I haven't analyized the code enough to know why it is failing for you as yet.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Remove the HDD. Boot from live media. Put HDD in an external carrier (either Sata or USB), plug it in, and then erase the drive (after backing up data if you can). The key here is to boot before attaching the HDD.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As Mike2K said, dd will happily wipe any disc, file system, or file as needed. That said, did you try to use fsck to fix the file system? FWIW, you can only do a fix if the file system isn't mounted, otherwise it will only to a read-only analysis to tell you what is wrong. Boot a live cd/dvd/usb drive, and then run fsck on the file system that is problematic, such as /dev/sda1, or whatever it is. That will, if possible, fix the file system. If you think there may be bad blocks on the drive, then add the -c option to fsck. That will check for bad blocks, and map them out of use, after trying to relocate the data.

I have used this technique a number of times in the past to recover failing drives until I could get a replacement delivered.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Name: My First Loan Program
Logo: A dollar sign with wings flying away

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Glad to help! :-) Sometimes just asking the question leads us to the answer!

Tcll commented: especially if you're like me! lol +4
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Really! Please don't ask us to help you cheat!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ok. This is a python script. There is a Makefile, and running "make" will put the script and stuff in the build directory. Then if you run "sudo make install" it will put all the stuff in the proper places so you can run vol.py to run it - it is put in /usr/bin/vol.py. There may be missing python modules that you will need to install. In my case, there were several.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Is there a Makefile? I'll download and check it out to better help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you aren't a competent programmer, especially with Java skills, then you aren't going to become a good Android developer. Android Dalvik applications ARE Java. Focus on object-oriented design and programming, which is what Java is all about.

Without the basics, you are going to be stuck with elementary skills.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Back in the "dark ages", when I needed to sort a linked list, I would put the nodes into an array, then use qsort to sort that, and then rebuild the list from the array. Worked well. Was simple. And it was quite fast. It also met the KISS principle.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Asking people to debug 600+ lines of code isn't fair. Write out the algorithm you are using (pseudo code and logic you used), and where you think the problem is occuring in your code. Then we may be able to help.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A lot of the ignoring of these issues is due to management not wanting to deal with the costs involved. They seem to take the stance that "we aren't being hacked, so why pay the price?". The old addage of "penny wise, but pound foolish" comes to mind...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you are booting a recovery or live CD/DVD/USB drive, the system hard drive will not be mounted. Since you seem to be getting similar errors in these cases, you either have a memory or motherboard/CPU problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I agree with Suzie999. First index is the number of "rows", and the second is the number of "colums" in the row, although either way will work if programmed correctly, though this way is simpler in that you can do this:

for (int i = 0; i < rows; i++)
{
    for (int j = 0; j < columns; j++)
    {
        sometype colval = array[i][j];
        cout << "row " << dec << i << ", column " << j " == " << array[i][j] << endl;
    }
}

I'm sure someone will point out that I am incorrect in some of this, but it seems to work for me! :-)