rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, have you tried it? Did it work? If not, let us know. Please test these snippits before posting here. If it works, then you are wasting a lot of time. If not, then someone can help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Or a light-weight Linux system, which is basically what a Chromebook is. In any case, they are also much less likely to become infected with malware than a Windows system, plus they are free!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This may help: http://stackoverflow.com/questions/7917905/how-to-use-vlc-live-streams-with-html5-video#7955331

Not a simple solution, but it may work for you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What rproffit said. In places where I worked that had/have guess access points, the router that the guest AP's are connected with are NOT connected to the corporate network, but directly to the internet. If they require access to the corporate network, and are given the means to do so (VPN access), then they can use that to get into the corporate network, but that is not normal. Generally, only company computers that are appropriately screened and scanned for malware are allowed on the corporate network. IE, even remotely, I can ONLY use the corporate laptop to access corporate resources, with some exceptions.

rproffitt commented: That's how it's done. +8
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Rule of thumb for enterprise systems - NEVER do an upgrade to version 0 of anything. PHP 7.0 is no exception to this rule! That said, your feedback to the PHP development community may be helpful.

jkon commented: I agree 100% . It was 7.0.1 and in a small part of production +9
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of solutions to this problem. You can use a std::vector for the array which will happily resize itself as needed. Much better than "rolling your own", which I have done in the past before the STL was available. For automatically resizable arrays these days I use vectors. Simple, and they take care of the care and feeding of the array.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Node.js is simply (AFAIK) a javascript API that allows you to speed up client-side development. Remember, JS runs on the client, and PHP on the server. PHP can serve up javascript to the client, where it is executed, and this includes node.js scripts. So, I don't think it is a matter of one vs. the other, but making them work well together. Keep server-side stuff on the server, and client-side stuff on the client. This sort of "separation of powers" will help with system security, as well as performance. In any case, use PHP on the server as the object-oriented language it was designed to be. Try not to mix HTML/JS with your PHP code, but rather use php to send the HTML and JS code to the client where it will be executed.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You are accessing the array as a 1 dimentional one, but you have defined it as a 2 dimensional array. Your readarray() method is only assigning numbers to array[1][0...9], so your sum loop is wrong.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
// Inheritance example.
using namespace std;
class base
{
private:
    int m_foo;
public:
    base(int afoo = 0) : m_foo(afoo) {}
    virtual ~base() { cout << "~base() called." << endl; }
    int getFoo() const { return m_foo; }
    void setFoo(int afoo) { m_foo = afoo; }
};

class derived : public base
{
private:
    float m_bar;
public:
    derived() : m_bar(0.0) {}
    virtual ~derived() { cout << "~derived() called." << endl; }
    float getBar() const { return m_bar; }
    void setBar(float abar) { m_bar = abar; }
};

This is an example of inheritance and polymorphism. When an instance of a "derived" class is destroyed, you will get this output:

~derived() called.
~base() called.

And no, this won't compile and run - there are missing includes needed - you get to figure that out!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Turbo C/C++ are so far out-of-date that you and your class should NOT be using them! You can download good open source C++ compilers for Windows that ARE up-to-date, such as MingW or GCC in Cygwin. If it doesn't allow string class usage (which is a derivative of basic_string, an STL class) then you are toast! If your teacher insists that you use Turbo C/C++, then you need to take another class...

That said, you CAN use char arrays for what you are doing, but you are using them very incorrectly. When you want to return a string pointer (or array), you are returning a single char. That won't work. You can build up an array in your functions, but then you need to return it as an allocated string which the caller can subsequently delete. IE, where your functions are returning char, they should be returning a char* to an item that has been allocated in the calling function. You COULD use a static array in your functions, and then return that as a char*, but that is not recommended practice!

rproffitt commented: I agree. Same for VB6. +7
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also use classes where your constructor or setter methods can set internal variables that can be accessed with a simple getter method. Add to that @tinstaafl's suggestion about array's of strings, you can do something like obj.wbdisplay(); where the wb value is stored in the object when it is constructed. Also, wbdisplay(int) should return a string and not a char just as tinstaafl showed. It would be much more efficient, and do just what you want.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is DEFINITELY NOT a simple topic. As for computer languages used for AI applications, some of the common ones were (or are still) Lisp, Prolog, Smalltalk, Snowball, and stuff written in languages like C++ or Objective-C that implement CLIPS or neural network protocols. FWIW, I have programmed in Prolog, Smalltalk, some Lisp and Snowball, lots of C++ (I have a patent for adaptive systems software that is a branch of AI), and some neural networking in C++ (I took a class on the subject at MIT years ago).

Anyway, this is a delicious subject! Worth any time you spend studying it. Just don't expect to become an "expert" quickly. A PhD in the subject may just get you started! :-)

FWIW, there are tonnes of articles on the Web on the subject. There are also some great books. I recommend anything by Terry Winograd (professor of AI and Software Engineering at Stanford). I learned from him that syntax (the structure of a language) does not lead to the symantics (meaning) of the language, and it is deriving the meaning that is one of the biggest problems in the field. Consider these two sentences - syntactically pretty much identical, but symantically, very very different!

Time flies like an arrow.
Fruit flies like a banana.

(Thank you Terry for the above examples!)

Current AI has a real problem with this sort of stuff unless you have a gazillion special-case rules, which slow the system down incredibly.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Good post. I left a comment using my Discus Rubberman48 ID.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

When I need to do this for clients, I will boot from a Linux live DVD with an external usb drive attached which Linux will auto-mount. Then I use the dd command piped through gzip to get the entire drive image and store the image to the external drive. Example:

dd if=/dev/sda bs=1M | gzip -c >/media/extdrivename/image1.gz

That will get the entire drive, including the boot loader and partition table, compressing it to save space on the external drive. To restore the image to a new system drive (which needs to be of a similar make/size if possible, you go through the boot process again and run this command:

gunzip -c </media/extdrivename/image1.gz | dd of=/dev/sda bs=1M

I have successfully cloned systems this way. As an aside, you will want to disable protected boot (set bios to legacy mode) if your systems have a new UEFI bios (most systems do today) since if it is enabled the installation of Windows 7 and later will write data on installation to the system bios' flash memory. Also, this may not work if you have full drive encryption enabled, but I haven't tried that so I can't say for sure.

rproffitt commented: "This looks like a job for ..." +7
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming you want to keep your data, you install the new drive in the same place as the old one, boot from the CD, install Win7. Then, if you can, install the old drive in another slot, or put it in an external drive bay, connect to the system, and copy your files over to the new drive. You will also have to install new versions of most of your applications.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And do remember, we DO NOT do your homework for you. There are plenty of online resources about simulation software and how to do it. If you want our help, make an effort, post your code along with your problems and errors here, and then we can make the effort to help you. Just remember, most of us have day jobs. In my case, my time is worth around $100-$200 USD per hour, so remember that when I try to help you.

alfadil ahmed commented: thanks a lot for your advise , And sorry for taking your precious time. +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I think it has to do with how the printer deals with color variations. In your printer setup in the Acrobat Reader, you may be able to increase the color acuity, but then the printer may be limited in that. Try changing the line colors to see if that helps - more contrast == better output.

rproffitt commented: Yes! Do that too. For the test, go black then a primary color. +7
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A stack is an abstract concept of, as @DavidW explained, that behaves in a first in, last out manner (or last in, first out if you prefer). To add an element to a stack, you "push" it onto the stack. Subsequent "push" operations will, conceptually, push the previous elements down one, and put the new element at the "top" of the stack. Then, when you "pop" an element off the stack, the last one "pushed" onto the stack will be returned, and the rest moved up one place. In C, this can be very expensive in terms of overhead, especially if the stack gets large. Usually we either use an array, where "push" puts the new element at the end, and the "pop" returns that element. As David mentioned, you can also use a linked list, which is more expensive in terms of memory, but very easy to implement. If you are using C++, the STL (standard template library) has a stack collection type that handles all of the gnarly stuff that has to go on.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These are character (integer values) so the + or - '0' will subtract the ascii value from the left side of the expression. If you are talking about a zero and not a capital Oh, that has a decimal value of 48, so you are subtracting or adding 48. Here is a link to the ascii chart for you to look at: https://duckduckgo.com/?q=ascii+table

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most Intel-based chip sets support 64 bit math (80 bits internally to reducing rounding errors) which gives you up to 16 quadrillion in total values (16,000,000,000,000,000,000) - something less than 20 digits. For larger numbers, you need a library that supports an infinite number of digits - IE, if you need 2000 digits, that will handle it. Doing math on such large number is much slower than the internal math capabilities of the CPU, but still workable. There are dedicated chips (FPGAs mostly) that are designed for computing these numbers in hardware, but you won't find them on most systems as they are dedicated to only one thing - computing public/private keys and supporting the encryption/decryption that RSA and such require.

Since decryption of large messages with RSA and such is very slow, most systems only use the public key encryption to encrypt a smaller symmetric key and then use that to encrypt/decrypt the actual message. IE, the 1024-2048 digit public key is used to encrypt a much smaller (faster) key that is passed to the user who will use their private key to decrypt, and then use that key to decrypt the message.

A great book to read on this subject is Bruce Schneier's "Applied Cryptography" - considered to be a "bible" of the field.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

All program memory allocated on the heap within a program will be returned to the operating system when the program terminates.

As for your line 30, that should be just fine. The results of new Type is a pointer to a Type object, Student in your case, so if you take the'*'away from the variable on line 30, you got the error you saw, which was correct. That all said though, you don't have to pass the pointer around in function calls, but can pass by reference and pass *pS to a function that uses it, declaring the usage as a Student& or const Student& as appropriate. This has a couple of benefits over passing as a pointer.

  1. The called function doesn't need to check the passed pointer for NULL (the compiler will deal with that for you).
  2. If it is passed as a const reference, then the called function cannot modify the object, but can only call public const methods that it provides.
ddanbe commented: Great explanation. +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In any case, it isn't easy to traverse a queue. You can pop the entries out and then push them back, or push them into a temporary queue where you then pop them out and push them back into the now empty main queue. If you don't have to use a queue, then I would suggest using a vector. That is easily traversable. Ditto a deque. Go to http://www.cplusplus.com/reference/ for more information about all of this stuff.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This sounds a lot like a means to pwn an application. Please take your attempts to subvert application security elsewhere!

MandrewP commented: You are wrongly judging me. I'm not trying to do anything illegal or immoral. I just thought that there might be a means provided within the compiler +6
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I run Linux almost exclusively and have not had this problem. What versions of Linux & Firefox are you running?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you run "php --help" you will see that one of the options is to run PHP directly as a web server (no LAMP stack required), which is the "-S <addr>:<port>" option. IE, you can do this directly in PHP by starting it with the correct address and port information. You should then get the data directly. Try this

php -S 1.2.3.4:31334 gettcp.php

directly from the command line. You can do it in the shell. I don't think you have to run it as admin. I used to do this to test my PHP code at Nokia. In some cases, we would just use it as-is and not bother with Apache or Ngnix.

You can also run it in the background, but that isn't necessary.

phpkoder commented: Thanks, It would be great if you check my new answer +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you tried another vga cable? Or another vga monitor? Did you use the same cable on the PS4? If so, then your computer has a problem with the vga adapter or connector.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a number of errors in this code. Nothing major, but a lot of things for you to think about...

    #include <iostream>
    using namespace std;
    // A generic smart pointer class
    template <class T> class SmartPtr
    {
       T *ptr;  // Actual pointer
    public:
       // Constructor
       SmartPtr(T* p = NULL) : ptr(p) {}
       // Destructor
       ~SmartPtr() { delete(ptr); }
       // Overloading dereferncing operator
        const T& operator*() const
        {
            if (!ptr) // throw exception
            else
                return *ptr;
        }
      T& operator*()
        {
            if (!ptr) // throw exception
            else
                return *ptr;
        }
       // Overloding arrow operator so that members of T can be accessed
       // like a pointer (useful if T represents a class or struct or 
       // union type)
       const T* operator->() const { return ptr; }
       T* operator->() { return ptr; }
    };

    int main()
    {
        SmartPtr<int> ptr(new int());
        *ptr = 20;
        cout << *ptr;
        return 0;
    }
  1. Your contents-of operator should have two methods. One is a const method that returns a const reference to the member. The other would be as you did, which is non-const. If it doesn't throw an exception, then you can set the value as shown in main(). See my additions/changes above.
  2. If you have the appropriate setter method, then you can create a pointer to the integer and set it accordingly, or if it already exists you can reset the value as specified.

So, your main problem is that you have not dealt with the possibility of a null pointer to …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I try to stay as far away from Exchange as I can - that is what our IT staff is paid for. So, that is just my way of saying "I don't have a clue". That disclaimer said, it should be possible to move the data store to the external provider; however, I would certainly consult with their technical people as to the appropriate/best ways to do that. There may be caveats to consider that I am personally clueless about.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can disable tar's removal of absolute paths (including, but not limited to '/' and '../'). It does that so that when you extract the files from the tarball it doesn't overwrite stuff you don't intend it to. It will extract the files, by default, into the local directory where you run the command from - not where the tarball is. Overwriting this default behavior of tar is VERY dangerous can can easily bork your system, permanently! Better to extract stuff to the current directory (and DO NOT do that from the root directory, or as the root user!) and then move it as necessary. If you are the root user, it will preserve ownership and permissions of the extracted files and directories. Again, MAKE SURE you are not in the root (/) directory, or other sensitive places such as /etc, etc... :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

PHP is an object oriented language based upon C++. It is most useful, and secure, when used that way. You save your HTML and JavaScript strings in class variables, and then output them when appropriate. DO NOT mix your HTML/JS code with PHP! That is a quick road to perdition.

diafol commented: Good advice +15
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is where a Google or DuckDuckGo search would be a good idea. A short search for "epub editing software" returns a lot of good options.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We do NOT do your homework for you. Make an honest effort to solve the problem / assignment and post what you did here, along with any issues and/or errors you encountered doing it. THEN, and only then, will we consider helping you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Lacking hardware, you can use virtual machines to set up, configure, and manage a network.

knggee commented: Thank you rubberman. +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to fill the strings ttrack and htrace with dashes after you create them. Then your code to substitute the dash with 'T' or 'H' will work. You also need to display the strings after each round of moveRacers(). Also, your code will not set the correct element in the string unless you also keep track of their current position, and set that position with the 'T' or 'H', and not the element at 'tort' or 'hare'. IE, you need to add that computed value to the last position to determine where each is in the race.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need to study UML diagrams and such first. A sequence diagram is basically a visual description of how data and actions propagate between classes and entities in a system. Here is the wikipedia article on that: https://en.wikipedia.org/wiki/Sequence_diagram
And here is an IBM/Rational article: http://www.ibm.com/developerworks/rational/library/3101.html

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sometimes a raid array has so much data that backups are not feasible, which is why I suggested disconnecting the RAID before the update. RAID0 however, is basically a mirrored disc, so backups only need one drive that is as big as one of the RAID devices. My RAID arrays are all RAID5, which is why I was thinking what I did. Backing up 8+TB of space is not always feasible. :-)

rproffitt commented: While it's OK advice the number of times I've seen folk lose it all is too many. If backup is not feasible then my advice is don't do this. +6
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Assuming that the boot/system drive is not on the RAID, then it should not be a problem. That said, you may want to disconnect the RAID before you do the update, "just in case". Unlike Linux systems, you NEVER know exactly what Windows will do in these situations.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Asking people to analyze over 500 lines of code for you is not a "nice" thing to do. As David W. suggests, use std::string objects instead of char arrays. They are much more efficient and C++ capable.

Another non-portable construct is system("cls"); - that is a Windows-only construct. If you do want to do that to clear the terminal, then you should use an

#ifdef _WIN32
   system("cls");
#else
   system ("clear");
#endif

conditional compilation block. That said, since you use this in many places, then you should define your own clear_screen() function that calls the appropriate code to clear the screen. Then, all you need in the rest of the code is to call clear_screen().

Hamza_9 commented: I am sorry that you have to go through all this :P +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Safer, more flexible, most software is free (and open source), and YOU are in control, not the vendor of the operating system!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

We do NOT do your homework for you! Please read the terms of use/service for this site. That is made perfectly clear. Make an honest attempt to solve the problem, post the code and any errors you are getting here, and then we may help you.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry, but we don't do your homework for you. Please try to do it yourself, and if you are still having problems then post your code here and we can try to help you. No effort, no help.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are times when C api's are appropriate in what is mostly a C++ application. Low level system and network programming often require C code. as for STL collections, strings, and such, they are VERY powerful and you would be well served to learn them. They can save you tonnes of coding and time, and be easier to read.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

That's a nice tutorial. I also wrote one for Daniweb a year or so ago when I was doing a lot of PHP programming at Nokia. Here is the link: https://www.daniweb.com/programming/web-development/tutorials/484310/why-you-dont-want-to-mix-php-and-html-directly-

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is a well known problem with floating point numbers. Even if your software displays 0.0000, it is probably a truncated value that may really be 0.00001, hence the mismatch when compairing to 0. Also, 0 is an integer, not a floating point, value which just exacerbates the issue.

So, if you want to compare a float to integer 0, cast the float to an integer first.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Amazing that there are still companies so far behind the wave that they are continuing to run Novell servers... That's almost like using a horse and buggy to commute 60 miles to work... Well, I suppose the Amish would do that, but I prefer my Toyota!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show all of the relevant code, including headers (class definitions and function declarations), as well as implementation code for the classes/functions that are failing. You are not providing enough information. We especially need the entire section of code where the errors are occuring and you are only providing segments.

alek.mieczkowski commented: I'm sorry, Ill update it +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Think of an operating system (Linux) as a seed or nut like an almond or walnut. There is the outer part (the applications and system services), and then there is the inner part that contains all the stuff needed for the rest (the kernel). It is generally (with luck) quite small. They are complex and provide all the services needed to deal with hardware, memory, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Designing a strong hash function is a hard encryption problem. Verifying your own work is futile and usually wrong. Read Bruce Schneier's Applied Cryptography. Until you do, don't even think for a second that your work is "secure". I have written and adapted hashing functions in my work over the years, and I NEVER was able to equal the strength of those worked out by the experts in the field. Good stuff, perhaps. Adequate for our corporate internal use, maybe. But suitable for general use? I'm not that stupid!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Definitely, running an ARM emulator on an x86 box will be slow. Since Android code is just Java using the Dalvik compiler and bit-code interpretor, using an Intel Android emulator will work must faster (or should anyway). Your code should be directly transferable to an ARM system for hardware testing.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How did you delete them?

south51 commented: got frustrated one night and just hit delete on the file +0