rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@ddanbe - how do you convert newton-feet to furlongs-in-a-fortnight? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In some cases, you want to escalate warnings to errors, or at least warnings over a certain level. Most compilers can do this. If you are building safety/mission-critical systems that should be required. Then there was the missing semi-colon that caused a satellite to crash into the sun instead of orbiting it... Oops!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can also remove line 28 altogether and get rid of that qualification, which is the basic effect of what @ryantroop did is equivalent to what is there now if strProfile is NULL - and remember that on some database systems an empty string is NOT considered NULL. Just get rid of that line, and since you would not be using strProfile any longer, you can eliminate that argument in the "Create Procedure" line.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can also set your compiler to use (for gcc) the -S option, which will generate assembly code as the output. Then, you can look at what that does. Other compilers have similar options, depending upon the operating system and such. There are also gcc options to generate mips code on non-mips systems, so you can also add the -march=mipsNN where NN is the version of mips chip you want code for such as mips1, mips2, mips64r2, etc. You can use the -EB option for big-endian code or -EL for little-endian code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, given a specific input, show the output.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show what your web page in the browser does show.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FWIW, you will probably have to write the rules.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Except at the most fundamental level, chemistry is not math. You can do this with a rules-based language or API that "understands" chemical interactions and can transform your input (left side of the equation) into the output (right side). Not simple, but a very good senior or graduate level (masters degree perhaps) project.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

No code? No real help. What language is the program written in?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When you edit a text file, such as a bash script, the changes go into the same physical file (determined by the file's inode). If you want to change it, but not impact the running program, then copy it, edit the copy, and then copy back to the original file name. That will have a new inode and the running program will continue to use the original script until you restart it. At that point, the old one goes away (the inode is freed) and the new one becomes the script that the system sees.

This is how Linux can update programs and shared libraries without restarting the system and programs in question.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can edit a running bash script, but it will probably crash, or you will have to restart it in any case. In any case, post the original code, and yours here for better comments and feedback.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming your web server is running with PHP, there is a rand() function that you can use to generate a random number for each entry, and sort it by that. Here is the manual page: http://php.net/manual/en/function.rand.php

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And speaking of laptop batteries, my Dell D-630's battery is completely dead and has to run on wall power! It won't take a charge at all... :-( I will be ordering a new battery tonight I think.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Lithium Ion batteries such are commonly used in laptops and other mobile devices have a 1-2 year life expectency. IE, if your system is over a year old, you probably need a new battery. You can purchase one from the system manufacturer for probably a hundred USD, but most are available from 3rd party vendors such as Rakuten.com (formerly Buy.com) for much less, some from the manufacturer of the system (such as HP or Dell) and some from OEM manufacturers. Go with the ones with the best warranty... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some channels are defaults (6 and 11 typically) so as more people connect over those channels, the performance drops. When both are in use you should be able to select the channel your adapter will connect with for that specific SSID. You may not get better speeds, but you may be able to get more consistent connections. On my home business WiFi I use channel 9 because all of my neighbors are using channel 6 for the most part - 6 is the normal default. Running on channel 6 would be impacted by the other access points in range.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

No code there for cropping the image. What have you tried? Here is the manual page from php.net for imagecrop(): http://php.net/manual/en/function.imagecrop.php

And yes, Google (or DuckDuckGo) is your friend!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is possible, but not simple or trivial. Try some Internet searching for tools that can extract text from photo images. I'm sure they exist - some commercial, and some (possibly) open source (free).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The mysql api's in PHP have been deprecated in favor of the mysqli api's. You seriously need to change your code if you are running PHP 5.0 or later. If you are running earlier versions of PHP then you are operating out of the Dark Ages!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Design
  2. Code
  3. Debug
  4. Re-design
  5. Re-code
  6. Debug
  7. Goto #4 until stuff works as you wish and any idiot can understand the design.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Save it as a csv file and then do this: http://php.net/manual/en/function.fgetcsv.php
There is also this: https://phpexcel.codeplex.com/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Save it as a csv file and then do this: http://php.net/manual/en/function.fgetcsv.php

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sounds like backuppc is a more friendly front-end to rsync. Sorry, but I have never used it and it doesn't appear in any of my CentOS 6.7 repositories (standard + epel + rpmforge).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a ton of javascript tools / api's out there to do just about anything you want. Use PHP on the server and HTML/JS on the client. Use PHP to build up the output strings with HTML and JS and then send them in a single message to the client - much more efficient than the techniques many web developers use which have WAY too many back-and-forth conversations between client and server, resulting in really bad performance and latencies.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Quicksort (or qsort in C nomenclature) is an array-based sorting algorithm and a standard tool for every C/C++ compiler known. I used to use it for sorting linked lists, but the first thing you have to do is put the list elements in an array, create a compare() function, and then call qsort. After that, you walk through the array and rebuild the list. BTW, you you REALLY need to use a doubly-linked list? A singly-linked list with just pointers to next should be just fine. The end of the list is when you see that pNext is pointing to NULL (0 in C++ terms). For large lists, this method is MUCH faster than what you are doing, which is more of a bubblesort that a quicksort. The only downside is the memory needed for the array of pointers to list elements. IE, 1000 elements == 1000 x sizeof(void*), or on a 64bit system, approximately 8000 bytes - not much in truth! Your use of the pPrev pointer will take the same amount of space for 1000 elements... Only use a doubly-linked list if you REALLY have to traverse the list in a reverse direction.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@ddanbe - Along with the number in the vector, I would associate it with the variable that follows in his case, such a A, B, C, D, etc. Looks like the beginning of writing an infix parser for computing equations? :-) Been there. Done that!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are these sorted arrays? If so, can't you use bsearch to find the position needed? And if you need to insert a new element, then use a modified bsearch algorithm that will return the insert position in a passed pointer or reference variable (depending upon whether you want a C or C++ method). IE, if the function returns NULL (not found), the insert position would be in the passed insert_posn variable. The signature for standard bsearch is void* bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *));
The modified version could be:
void* posn_bsearch(const void *key, const void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *), size_t* insert_posn);
Since this is open source, making a modified version is trivial. I did it myself for sorted collection classes I wrote for the FACTORYworks MES system.

So, if you pass a NULL value for insert_posn, it can behave just like bsearch.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, don't ask us to do your homework for you. Make an effort, post your code and errors/problems you are having, and then we can help you much more effectively.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sometimes we create a class that only has static methods for general procedural functions. Call it MyStaticClass with static methods such as myfunction(int,int), so in your startup class main() function, you would call it as (assuming it returns an int)int results = MyStaticClass.myfunction(x,y);

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, in Java, all methods are part of a class, and may declared in an interface class which has to be implemented somewhere before you can use it. If this is a static method of a class, then you can call it as classname.methodname(arglist);

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In Java you first have to import (similar to #include) the package that defines the method. So no, there is no function prototype AFAIK in Java.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just because a process is "sleeping" doesn't mean it isn't running. It is just waiting for a timer or wakeup event to happen.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Make the disc have a standard Linux file system such as ext3 or ext4.
  2. Have the PI system mount the disc file system in a local directory such as /mnt/backup
  3. Have the PI export the file system (/mnt/backup if as above) as an NFS share.
  4. On your host, mount the shared file system as type NFS.
  5. Copy the files there.

FYI, all current Linux system support NFS sharing and mounting "out-of-the-box". Assuming your PI when off-site is running a VPN, then you would use that to connect to the PI so you can mount the backup file system.

Finally, DO NOT USE anything like backuppc - use standard Linux tools such as rsync, cp, dd, etc. I cannot in good conscience advise to use other such tools are you are trying to use. FWIW, I have over 30 years of Unix and Linux systems programming and management experience. You are making a common newbie mistake in thinking you need "something special" for such activities when Linux systems have most everything you will need as standard tools. The rsync tool can be awesome for this sort of backup activity to backup new/changed files on a scheduled basis. You might want to look into cron and crontabs.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is this for? A senior project?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here is Microsoft's page on setting up their sendmail service - free and easy to use: https://msdn.microsoft.com/en-us/library/aa577662.aspx

FWIW, we use that at Panasonic for our Windows MES servers.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some applications, such as Firefox, remember where they were last opened, and if at that time you had 2 displays, that might explain your experience. Go to the icon bar (usually at the bottom of the screen, right click on the application icon, and select "Move". That should let you move the window for the application to your current display.

Another possibility is that you opened it in another workspace (virtual displays). The thumbnails for those should be at the right side of your bottom panel where the application icons appear. You should see a representation of the application window there if that is what happened.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Connect with and login to master, get the userids and passwords for beta and gamma (comma?), then connect with and login separately to each client database.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show the code that calls/includes this page.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Forget strtok. It is useful for some stuff, but it DOES modify the input string. Write your own parser that walks through the string and extracts the numbers as needed. I do this sort of thing all the time - one of my jobs is to write parsers for customer data in order to provide "sane" data to our MES system. My latest one was to parse work-order CSV files and then push it to the database using a stored procedure for MS SQL Server. The parser runs on Linux. The database on Windows Server 2008.

The interesting wrinkle for that was to determine how to map the data elements to the fields of the stored procedure as each customer may use different mappings for their work order data!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is what internet search engines are for. There are plugins for excel that can "pretty print" your data, but I don't personally know what they are. Others here may be more knowlegable than I am about that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Since an external display works fine, it is not likely a driver or system problem, other than the fact that the display is probably failing. The controller also handles external displays, so it isn't the video controller.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Given the missing system files, I think your system has been infected with some trojan/virus/malware. What is your normal A/V program? And is it active?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but according to the terms of usage for Daniweb (which you agreed to when you signed up) we don't do your homework for you. You need to get started on this, and when you hit a wall with your design and code, then post that with your questions here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Posting links like that here is frowned upon as we have no way to know if it will infect our system with a trojan. Please post the requirements, code, and such here directly.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, map each grade to a number, such as
F == 0
D == 3, D+ == 4, D- == 2
C == 6, C+ == 7, C- == 5
B == 9, B+ == 10, B- == 8
A == 12, A+ == 13, A- == 11

Then, finding the average is simple math. You write the code. This is just a hint.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Here are a some links that may help:

http://code.tutsplus.com/tutorials/how-to-send-text-messages-with-php--net-17693
https://www.clickatell.com/developers/scripts/php-library/
http://www.nowsms.com/doc/submitting-sms-messages/send-sms-text-message-with-php

I found these with a simple DuckDuckGo (Google without the ads) search: Sending SMS messages from PHP
There were a bunch more that came back with in the results.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please be more specific. Linux uses networks just like any operating system, to communicate with other computers, and even itself (localhost).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show what you have done. This is a common CS problem and whether you want the consumers in the same process, other processes on the same host, or other processes on other hosts, will change how you deal with the problem. There are tools to do this, such as MPI and various distributed messaging tools such as RabbitMQ, AMQP (which Rabbit is based on), Kafka, etc. that will provide publish/subscribe message bus tools for distributed systems. They also work well on a single host. You need to do your research. Don't just expect us to "solve" your problem for you. If you describe more precisely what your environment is and what you need to accomplish, then we can provide some advice. That said, DO NOT expect us to do your job / assignment for you!

FYI, I have been doing this stuff for 35 years, including writing distributed message bus tools that are used in major commercial manufacturing software systems.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is a lot to do for that. Better start reading - plenty of resources on the Internet, including online classes that will help learn about this. Get your Googling or DuckDuckGo limbered up for some serious searching.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In this code, as tinstaafl mentions, you may be geting the -1 index of word in the else branch. You need a test for isMobile being less than 0.

            if(i != 0){
                if( word[i] > word[i - 1] ){
                    if(counter == 0){
                        counter++;
                        isMobile = i;
                    }else if ( word[i] > word[isMobile] ){
                        isMobile = i;
                    }
                }
            }
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If the problem persists it could be a faulty battery cell. I've had old batteries do this and could not charge above 60-70%.