rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This would be simple in C++ as you can create a number class that you can derive new types from and store a pointer to the base class in a collection. In any case, you should have a two two dimensional array defined like this:

const char* array[][3] = { {"ID", TYPE", "Value"}, {"X", "int", "4"}, ... };

Here is a sample program:

#include <stdio.h>

int main()
{
    const char* array[][3] = {
        {"ID", "TYPE", "Value"},
        {"X", "int", "4"},
        {"Y", "int", "4"},
        {"Z", "float", "0.0"},
        {NULL, NULL, NULL}};
    size_t i = 0;
    for (i = 0; array[i][0] != NULL; i++)
    {
        printf("%s\t%s\t%s\n", array[i][0], array[i][1], array[i][2]);
    }
    return 0;
}

Next you need to add code to turn these strings into real values. In any case, the output of this program is:

ID  TYPE    Value
X   int     4
Y   int     4
Z   float   0.0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have the script defined in it's own page, and include that just once in anything that needs to use it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, you are calling the detailsmodal() script before it is defined up in index.php.

sahilmohile15 commented: Thanks how can i define it other that including footer.php i can't find a way to do it +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, what? Doh! Clueless here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My personal systems are all running Linux. Windows stuff I can't run there (with Wine, etc) I run in a Windows VM (using VirtualBox). That has been good for me. At work, all of our software development is on Linux, in VMware virtual machines, but our office stuff (email, etc) is on Windows. Our laptops run Windows 7 or 10, but our development systems are either Linux VM's or Windows Servers also on VM's.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Usually you flag the post for moderation (upper right of the post) and ask for it the be removed as it was a mistaken post.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show what you have done so far to deal with this - ie, your PHP and HTML code. As with most programming projects, there are multiple approaches to solving every problem. What is best for you depends upon how you are dealing with stuff in general.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What language are you calling this from? In any case, you should be able to use the cast(val,type) mysql function to do what you want. IE:
IN (cast(1001,varchar),cast(a/bb/001,varchar),...)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. See my reply to your other post.
  2. ROM's (usually the BIOS) are custom chips. Some are PROM's (Programmable Read-Only Memory), which must PC/Laptop BIOS chips are so they can be updated when necessary.
  3. To alter a PROM you need a programmer software tool to write and compile the code (usually assembly language) and a PROM burner, or the program to update your system PROM with the new code. Note that this not something for the inexperienced or you will likely turn your system into a nice door stop...
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A ROM (Read-Only Memory) is usually where your BIOS is kept. For PC's, a custom ROM would be an alternative BIOS. Why do you ask?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can easily save multiple playlists as files with VLC. Then, you just open the file with the playlist that you want. I do that all the time.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you checked if you have blocked cookies in your browser for your site?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When do you get that error? When you are trying to compile your code?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The power supply (PSU) is a good candidate.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And if you need wide chars in your C++ string use std::wstring instead of std::string. All that wchar_t is is a wide (2 byte) character that can contain unicode characters. It is a common C type for systems that have to support international languages.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What exactly are you trying to accomplish with the array and ofstream?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And thanks for your post @fallout4player. This may help others as well. I am giving you an upvote for your post.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What @rproffitt said. Also, do you know what a recursive function is?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, the string "Abcd" would be 0x41, 0x62, 0x63, 0x64, and 0x00 (terminating null char) - caps != lower-case...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I would have been a bit more snarky if you said you lived on the Ile de la Cite. :-) I don't think Notre Dame has student housing on the island... I spent a month on the Rive Gauche when I was a teen - even climbed to the top of Notre Dame with my father - no hunchback there though! What a dissapointment!

rproffitt commented: Another for balance. +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you live on the Ile-de-France? Paris is a pretty big place! :-) Where are you going to school?

rproffitt commented: +1 for balance and peas. +8
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming the target is also a wstring type, this should work. IE:
std::wstring newstr = first + L" " + second;

Note that you left off the second colon in your variable definitions. This may be your problem. What error are you getting? The following is a test program that I just wrote to test this on Linux using GCC 4.4.7. It works fine and the output is "John Doe" as expected.

#include <string>
#include <iostream>

int main()
{
    std::wstring first = L"John";
    std::wstring second = L"Doe";
    std::wstring full = first + L" " + second;
    std::wcout << full << std::endl;
    return 0;
}
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what is your purpose for this? Are you trying to put together a tool that you can use to manage a pool of systems without the overhead of direct access to each system? Very dangerous, but possibly doable. Your best choice would be irssi - a command-line interface (CLI) IRC client with scripting (using perl) capabilities. Here is a link to their documentation page: https://irssi.org/documentation/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please properly format your code, indendented appropriately. I won't comment on code like this...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your honeypot needs to be a virtual machine that you can shut down and nuke as required. Also, you can block out-going messages (may not be helpful) and still see what the malware perps are trying to do. I'd tell you exactly how to do that, but since I have never done that, I can't tell you exactly how. A quick google/duckduckgo search should get you that info however.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You have a couple of problems. Both examples are REALLY bad and probably won't work.

Technique #1
char three[] = { '2', '5', '8', '\0');
You can use three as a char*.

Technique #2
Your example won't work because "258" is a const char* and NOT a char*, so the results are not modifiable. If you make three a const char* then it's contents will not be modifiable. If you don't want to modify the string, then your second example would work if it is a const char*.

Note that in my Technique #1 I added a terminating NULL char so that the string is properly terminated. Using "258" does that for you automatically.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what is exactly your problem? You need to make the TempBuffer bigger than 4 chars - you have no room for a terminating null char ('\0') so you are creating a buffer overflow.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

For debugging purposes, output the hash stored in the database and that returned in userLogin(). If they are using a different salt value (based upon date/time by default perhaps), then the hashes may differ. Since I am unfamiliar with the SCryptUtil library I don't know for sure what it is doing. This is a common technique for password hash functions so that two users with the same password don't generate the same hash.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The only way is to spawn multiple threads and do the read in each. That will parallelize the I/O, though throughput will not likely improve over your current serialized approach. You can also put the read/code (try/catch blocks) in a separate function which you would call 3 (or N) times sequentially. That way, you only have 1 try/catch/open/read/close block of code. Useful when you want to go from 3 files to 99 files... :-)

FWIW, if you do the threaded approach, you will still need that separate function to deal with file I/O.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Microsoft has happily turned Win10 into a virus - "whatever is yours is ours" seems to be their attitude these days. Disabling this cruft is a total PITA. My attorney who is a very happy Mac user had to get a Win10 system recently and the first thing that happened to him was an infection of adware/malware making the system almost impossible to use. He was NOT a happy camper!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You say it "gets stuck". What do you mean? Does it stop formatting and issue an error message? Does it just stop formatting and sit there seemingly doing nothing? If the latter, is the disc activity light still on? Please be more descriptive. Also, what make/model/size of HDDs are you trying to format? And have you tried from the console command line?

One final thing - what about partitioning the drive, or does the OSX format program do that for you?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What @rproffitt said. Put your code inside a code block and then make sure it is properly formatted, indented, etc. Then we can comment more appropriately.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Start with a Linux virtual machine. Install VirtualBox on your Win7 system and create a Linux virtual machine. That way, you can experiment with a number of different distributions until you find one that you prefer. You can also use them to learn how to use the OS.

rproffitt commented: I like a test drive. +8
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Inshifter(int size) you are never filling the array. Since it was never initialized, the random number stuff is not only doing nothing, but as far as I can tell it is unnecessary. The loop SHOULD be (to my mind at least) like the following:

    for (int i = 0; i < data.length; i++)
    {
        data[i] = i+1;
    }

That way, your array is initialized to the numbers you want - 1 through 15 sequentially. Next comes the shifting. Take the number of elements to shift (which come off of the tail of the array), allocate a temporary array of the appropriate size, and put those elements in it. Then, move the elements of the array to the right that number of entries, and replace the front of the array with the contents of the new/temporary array. Bingo, you are done. This is as much as you will get from me (no more code) as this is obviously a homework problem. We will help, but we won't do it for you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is the usual way to sort lists of stuff, and a number of the C++, C#, and Java (as well as other OO languages) use this method to determine where to insert an element in a map or other sorted list.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried running Linux in a virtual machine on the 2012 server and installing OpenVPN on that? I've done that and it works just fine, though you need to use a bridged instead of NAT'd virtual network interface for the VM.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Using a shared pointer to an a in class b means in b's copy constructor you don't need to create a new instance of a. You can simply assign the copied object's p member to the new object's. That's the whole point of shared pointers - that you can have multiple references to the object they point to, and until all references go away, the object will not be deleted.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Repairing a PC board, especially something as complex as a computer motherboard, that has been damaged by an electrical short circuit, is neither simple nor easy. In most cases, special equipment will be needed to determine the actual scope of the damage, and then there is the problem of replacing all the damaged components. If the short also damage the board itself, then complete replacement may be the only solution. In such cases I usually recommend that you either send it back to the manufacturer for repair, or a repair depot certified by the manufacturer.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming the host it is trying to connect to is external to the local network, or is in another subnet, then either the internet proxy or the router (depending upon situation) will need to be reconfigured. You need to have your hosting provider deal with this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your 'input' variable is an array of 512 possible values. Try this for your fscanf function:
fscanf(pToFile,"%d %d %d %d %d",&input[0], &i, &j, &k, &l);
Remember, the number of format items in the format string must be the same as the number of variables that you are passing to take the data. Also, your printf statement should be adusted accordingly, passing 'input[0]' instead of 'input' for the first output argument.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The error is saying that you are trying to access a NULL value, which results in a segfault. You need to determine which variable/argument has a null value.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Your response from MySQL above indicates that the host/server you are trying to connect from is blocked. You need to contact the database administrator about this I think.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You will need to contact candidate host sites directly to see if they support it, or if you can install it. Many today will use either virtual machines for their hosted customers, or containers such as Docker in order to give you a safe environment that will not be interfered with by other users and vice versa. If so, then you should be able to to install PHP 7.x in your hosted environment, or they can.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You aren't providing enough information. You need to show what is in your adjacencyMatrix first of all, and then you need to provide additional code in your application.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

PHP 5.5.4 and later have the ability to run php code directly, even as its own web server (not necessary here I think). Anyway, what RudyM said. On Linux you would use cron to do this. It doesn't have to be a script - it can be in its own cron file in /etc/cron.d, as opposed to using /etc/cron.daily which will require a shell script to run the code.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need a trigger that will run and update the password count and such when a user logs in or out.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Besides, what's to keep someone from installing LibreOffice on a USB stick? They can view/edit most any MS Office document with that, even if Office itself is locked down. It is better to create a guest account and make it so that the guest user cannot run Office applications. I'm not sure that they still could access LibreOffice on a USB stick. So, put all of your document in directories of users other than guest. They will not be able to access them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This should be fine, running an ethernet cable through a PVC pipe, although you will want to check with your city to verify whether you need a permit to do it. Also, make sure you get exterior-class cat 6 or cat 7 cable (not cheap) so that the signal will not degrade over that distance. You also need to consider how it will exit the house and enter into the bungalow so as to keep moisture and rodents (and other pests) out of both facilities. All of this is a major PITA, so an alternative may be roof-mounted WiFi antennas. We used that successfully at a school campus in California a few years ago, and using a yagi antenna at the remote site gave us a totally clean connection in all weather. Yagi-Uda antennas are powerful directional antennas that you aim at the other, standard, transceiver antenna. It may even be less expensive than the cable approach.

Here is a link to a yagi wifi antenna at Amazon.com: http://www.amazon.com/Yagi-WiFi-Antenna-2-4GHz-15dBi/dp/B008Z4DNFC/

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

As stated, no two fingerprint scans will generate the same data/image. Intelligent fp scanning tech identifies notable features in a print and develops a hash of that. When the same finger is scanned again, those features are extracted and used to create a hash. The fact is, that only the hash (a numeric value) is stored in the database. Lookups are very fast as you can easily index that data.

Raw image comparisons are notoriously difficult and most of the time some algorithm such as that mentioned above will be used to identify comparable images, such as photographs of peoples' faces. As mentioned by others, there are API's out there that have done this work already - it is not trivial and requires some major software and image analysis chops.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. In any case, look up the use of the pow() function.