rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Are you sure it is properly formatted and has a valid NTFS or FAT file system installed on it?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Convert the date+time into seconds from the "epoch". There are functions to do this in php, java, C/C++, C#, et al. Then you just subtract one from the other to determine the number of seconds between the two values. RTFM.

rproffitt commented: This is fine as it may make the code more portable. +14
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Glad you got it working! Sounds like you have put some real "sweat equity" into this!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can also find all the specs for their cards on www.nvidia.com.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I had to do a bunch of code remediation for PHP 5.5.x with their http output handling (totally broken). Don't know about later versions as I haven't had the time or resources to analyze the code. My guess is that a lot of that has continued, but I cannot say definitively. Definitely not a project for the faint-of-heart, and those who cannot analyze complex C/C++ macros without becoming comatose...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Use a std::map<int,double> that maps the student id to their GPA. It will be sorted for you. The implementation I leave to you. Note that you got 2 down-votes, mostly because WE DO NOT DO YOUR HOMEWORK FOR YOU! Make an effort to solve the problem. Post the code and compiler or runtime output. THEN we may help you more concretely... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You really should not post the same query in multiple forums. I have answered your question elsewhere. :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Depending upon how many files you have added to your system, you may be able to recover most of them. This link may help: http://pcsupport.about.com/od/filerecovery/tp/free-file-recovery-programs.htm

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Besides, they are a small family-owned and operated company, which I would much rather support than Multimega Galacticorp! So, an extra $50-$100 is a price differential I am happy to pay. I am looking to replace my aging Dell D630 laptop with one of theirs soon. The WiFi has been the biggest thorn in my side since I put Linux on it 10 years ago.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I confess to be a friend of the owner of Zareason. One of the main reasons I recommend them for people who want a Linux laptop, desktop, or server is that they guarantee all of the hardware cruft (such as WiFi) to work out-of-the-box with any Linux system they support, which is a bunch. WiFi on laptops is the biggest issue to installing Linux on a lot of big-box laptops because they mostly use proprietary hardware, chip sets, etc. and finding Linux drivers for those can be a PITA.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your assignment is a trivial one. Salary ($50K) + (sales * .15) == total compensation. Java is not difficult. Read some manuals/books/tutorials, all available online...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

OOP - object-oriented programming is just that, programming with objects. The code you show is function-oriented. For OOP you need classes with member variables and methods (functions that work on the data of a particular class). That encapsulates all that code and variables in a single object (or multiple objects of the same class but with different values). There are tonnes of tutorial documentation on OOP on the web, including examples for PHP on the www.php.net web site.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What are you trying to accomplish? You can set up SSH to only use RSA keys, or to allow logins with user id and password. Automated script? Back to the first question...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Go to zareason.com - lots of great linux-compatible laptops, and can ship without an OS installed if you prefer. Good people. Decent prices. Good options.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. You need to be sure that the str variable is big enough to handle your input. You might want to consider using getline() instead. Read the man pages. Are you using this in Windows, or Linux/Unix systems?
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It boggles my mind how so many "universities" teaching computer science are utilizing outdated compilers and tools. It is as though they have never heard of Linux and virtual machines... Best, up-to-date compilers, tools (all free) available.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@happygeek - I read that as well. Here is Bruce Schneier's post about it last Friday: https://www.schneier.com/blog/archives/2016/04/breaking_semant.html

Basically, it all boils down to image analysis and pattern recognition. I used to do crude versions of this back when I was researching image processing algorithms (mid-1980's).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ever use the command line console window on OSX? That is basically the same thing. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Simple: sum all of the data values and divide by the number of nodes in the list. I am guessing that you did not write the functions to add/remove/size the list, etc. We don't do your homework for you. This is very much elementary math... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There is a tool called dd that is on every Linux distribution. Boot from a Linux live CD/DVD and do this (assuming that the Apple drive is /dev/sda): dd if=/dev/zero of=/dev/sda bs=1M
When it is done, the drive will be completely zeroed out. If you want, you can also specify if=/dev/random and wipe multiple times for more secure results.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Ads suck up bandwidth and push data caps that are so ubiquitous these days. Ensure your publishers respect these facts by making their ads mostly static text with minimal graphics and NO video! Then, they can be whitelisted by the major ad blockers. IE, respect the reader/consumer...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to study object-oriented design and development a LOT more before you can deal with this. Consider PHP to be C++ for web programming. In any case, the answer to your question would require a 500 page book to cover in detail... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Suzie999 - you are definitely NOT a noob! In any case, the problem has a couple of components. One is the loading of the DLL in your code - for Linux it is dlopen(), for Windows it is LoadLibrary(). Then there is code to map functions in the shared library to your environment. In most cases, due to name-mangling issues mostly, you can't just use classes in the shared library, but usually only C-style functions. Congratulations, you have just graduated to the next level of software absurdity! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not sure - not my domain of expertise - but don't you need to oauth the facebook site on yours?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Final (hopefully) note. After re-reading your original post, you need to have associated meanings of a word or phrase. This isn't hard. I'm not giving you the answer, but propose a solution and I will critique it - after all, this IS a school exercise, right?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also note, that forwhatever it's worth, sorted linked lists are incredibly inefficient. You basically have to navigate the entire array (doing a comparison at each node) to find the insertion point. Simple to write, but VERY slow! Another thing you can do with either arrays or linked lists (assuming you keep a pointer to the last element of the list) is a head/tail optimization. Before you search, look to see if the inserted item goes at the head or tail. Worst case? 2 comparisons. We found that doing this for creating large sorted lists from sorted input (such as database queries that use an "order by" clause) gave us a 2 orders-of-magnitude speedup - that is 100x faster! When I implemented that in our code our QA people called me to say there was a problem with the new code because it was just so much faster! Yes, the results were correct. The speedup was just not expected! Stuff that could take an hour took a few seconds... Gee, what a shame!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Note that bsearch/qsort use binary search algorithms (see Knuth Vol. 3 - Sorting and Searching Algorithms) which means that finding the insertion point for a 1 million element array is, at max, only 4 searches longer than 64K elements, and 1 billion? Only 10 more comparisons than 1 million! Binary math - ain't it great? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Write an insertion sort routine, based upon bsearch and qsort algorithms. Yes, they are C code, but are easily translated into Java. Basically you use an array - presize it to your expected maximum size + some space for overflow. When you do need to resize it, double the size. So, in your structure/class, you will have the string array, a member that is the maximum size of the array, and the current last element position of the array (starts with 0). As you add members you will find the insertion point, move the following elements down one member, put the new string at that position, and increase index of the current last member, after you have determined that you don't need to resize the array. If you do, then before you insert the new element you will resize the array, copy the old array elements to the new one, delete the old array, and assign the new array to the old member variable.

This isn't a large amount of code, but it is enough to show you are thinking about how to deal with this problem efficiently. I wrote such a routine in C++ some 20 years ago and it was awesomely efficient! It is still used today in commercial software that deals with lists which are over 1 million elements in size.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What operating system are you using? Also, are you using UDP packets, or TCP streams? TCP streams are simple - you connect a monitoring client to the address:port of the server with a Keep-Alive option, and if the server cannot connect or drops the connection, you will know about it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I could not have said it better @AleMonteiro! I too am giving you a "thumbs-up" for your response.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry Justin, but this is a repost of the same cruft that I commented on before... I am downposting this as a result.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

No description of problem - no help. Also, either declare the functions before you use them, or put them above main() and each other as an alternative. You want us to analyze 240 lines of code with no description of what your actual problem is, other than you obviously have a display/output problem, and that you want us to do your work with regard to an update function for different inputs? Sorry. Won't happen...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Lesson #1 - never overreact.
Lesson #2 - do a root-cause analysis of your problem(s).
Lesson #3 - go to lesson #1...

I use Windows when I absolutely have to. Example, if I have to develop software that must run in a Windows-only environment, then I run a Windows environment in a virtual machine, otherwise I run Linux exclusively. It is MUCH more forgiving than Windows, and with Wine, I can run 98% of any needed Windows software (including my high-end software engineering tools) without resorting to a VM.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

@Shantha_mh - good post. A thumbs up from me, and someone else as well. SIP - Session Initiated Protocol, used for VOIP (voice over internet phone) is very important these days. Good reference links are important to understand what this stuff does.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As mentioned in the article posted by @ryantroop, fgets(stream) will also return the newline. If you don't want it, you will either have to trim it or use stream_get_line(). FWIW, you can't use STDIN if your script is being read from stdin... :-) Read this: http://php.net/manual/en/features.commandline.io-streams.php

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What @rproffitt says, however in your case you do need the Windows API for this. What happens? Does it just hang, or does it give the negative answer? Also, what compiler are you using, MS's visual C compiler? Some other compiler that supports the win32 API? Nevermind. I see you are using Dev-C++ which is a non-MS IDE, and by default uses TDM-GCC, a version of the Gnu compiler suite. As rproffitt said, try the MS Visual Studio compiler. It should have no problem with your .C or .CPP/.CC files.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Geeze - people are still using Pascal these days? Are you running a P-machine, or some version of Turbo Pascal? Ok. Better to use a timer interrupt instead of a constant loop, and if you need to do stuff before the timer kicks, then use a loop and check the bit as shown here: http://www.ibrtses.com/embedded/avrtimer.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Make sure you have a high performance USB drive. They are much faster to read than write.
  2. Disable memory swapping in the OS and remove the swap file. The performace of virtual (swap) memory is very dependent upon the write performance of your drive - see #1 above.
  3. Disable automatic updates.

This should help.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

NEVER, NEVER, EVER try to manipulate directly the file system other than via normal means, unless you are a real professional and are ready to bork the system entirely!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

DO NOT DO THAT!!! Assuming that /dev/sda1 is the root file system, then the problem is more difficult. If it isn't, then as root you will need to umount that file system with "umount /dev/sda1", and then run "fsck /dev/sda1". If it is the root file system, then you need to boot a live CD/DVD, and as root, do the same thing, except the umount part since it won't be mounted automatically by the live CD/DVD. The fsck command will fix these inode problem. If it says that the file system is clean, then add the "-f" option to force it to scan/fix the file system anyway.

Looking further at your post, you show that /dev/sda1 is mounted on the /mnt directory. So this is what you do:

umount /mnt
fsck -f /dev/sda1
mount /dev/sda1 /mnt

If it mounts cleanly at the end, then you should be fine. You can also add the "-v" (verbose) option to get more information from fsck.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of issues with this, besides the fact that it is a Windows program. You need to create your main window: win = newwin(nlines, ncols, y0, x0);
Before that, you need to call the initscr(); function. Without those things, when I fixed it up (removed the Windows functions) I could build it on Linux, but as expected it dumped core.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please post the contents of the node class.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Note that as I understand it, ffmpeg 2.8.1 and later is capable of streaming .aa and .aax files, as well as converting them I would assume. The Audible player only plays audible files, though producers of media can have them available in a non-DRM manner. This may help: https://en.wikipedia.org/wiki/Audible.com

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is the machine/os you are running audible on? VLC runs on all of them (most likely) and can deal with mp3 files without problems, as can many other audio players. Do you HAVE to use audible?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Line 15, your WINDOW pointer is never allocated, yet you are trying to manipulate it. I would expect that your application would dump core. It would if you initialized it to a null pointer when you declared it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

FWIW, the Oracle embedded PL/SQL software is a derivative of Ada. It (Ada) was developed by the US Government - our tax dollars at work! The Gnu Ada compiler is probably the best bet - available on Source Forge, it has versions for most every operating system. Here is a link: https://sourceforge.net/projects/gnuada/

Most linux systems have Ada in their standard repositories. It is called gcc-gnat, and there is a GUI front end for it as well called GtkAda.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is better:

#include <stdio.h>

typedef enum {
    anInt = 0,
    aFloat,
    aDouble,
    aString,
    end_of_symbol_types
} symbol_types;

typedef union {
        int intVal;
        double doubleVal;
        float floatVal;
        const char* stringVal;
} sym_val;

typedef struct {
    const char* sname;
    symbol_types stype;
    sym_val sval;
} symbol_t;


int main()
{    
    symbol_t sarray[5];
    sarray[0].sname = "X";
    sarray[0].stype = anInt;
    sarray[0].sval.intVal = 4;

    sarray[1].sname = "Y";
    sarray[1].stype = anInt;
    sarray[1].sval.intVal = 4;

    sarray[2].sname = "Z";
    sarray[2].stype = aFloat;
    sarray[2].sval.floatVal = 10.0F;

    sarray[3].sname = "S";
    sarray[3].stype = aString;
    sarray[3].sval.stringVal = "xyzzy";

    sarray[4].sname = NULL;

    size_t i;
    printf("ID\tTYPE\tVALUE\n");
    for (i = 0; sarray[i].sname != NULL; i++)
    {
        switch (sarray[i].stype)
        {
            case anInt:
                printf("%s\t%s\t%d\n",
                    sarray[i].sname,
                    "int",
                    sarray[i].sval.intVal);
                break;
            case aFloat:
                fprintf(stdout, "%s\t%s\t%f\n",
                    sarray[i].sname,
                    "float",
                    (double)sarray[i].sval.floatVal);
                break;
            case aDouble:
                printf("%s\t%s\t%F\n",
                    sarray[i].sname,
                    "double",
                    (double)sarray[i].sval.doubleVal);
                break;
            case aString:
                printf("%s\t%s\t%s\n",
                    sarray[i].sname,
                    "char",
                    (const char*)sarray[i].sval.stringVal);
                break;
            default: break; /* invalid type */
        }
    }
    return 0;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are some problems with the symbol examples above. I will repost later with corrections. The values were not being properly initialized. Sorry about that... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

From the stype, you can determine how to output the value, and which element of the union where you will find it. Another example:

for (i = 0; sarray[i].sname != NULL; i++)
{
    switch (sarray[i].stype)
    {
        case anInt:
            printf("%s\t%s\t%d\n",
                sarray[i].sname,
                "int",
                sarray[i].intVal);
            break;
        case aFloat:
            printf("%s\t%s\t%F\n",
                sarray[i].sname,
                "float",
                sarray[i].floatVal);
            break;
        case aDouble:
            printf("%s\t%s\t%F\n",
                sarray[i].sname,
                "double",
                sarray[i].doubleVal);
            break;
        case aString:
            printf("%s\t%s\t%d\n",
                sarray[i].sname,
                "char",
                sarray[i].stringVal);
            break;
        default: break; /* invalid type */
    }
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As for the difference between a table like this and a symbol table is that a symbol table would contain symbols. You can use either an enum or #define statements to define your symbols, which can also b used in your array, and typically that data would be stored in a struct which would go into the array. Example:

typedef enum {
    anInt = 0,
    aFloat,
    aDouble,
    aString,
    end_of_symbol_types
} symbol_types;

typedef struct {
    const char* sname;
    symbol_types stype;
    union {
        int intVal;
        float floatVal;
        double doubleVal;
        const char* stringVal;
    };
} symbol_t;

symbol_t sarray[] = {
    { "X", anInt, (int)4 },
    { "Y", anInt, (int)4 },
    { "Z", aFloat, (float)0.0 },
    { NULL, end_of_symbol_types, (int)-1 }};