rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What distribution/version of Linux are you running?

In any case, you will need to fully reinstall the xorg and gnome software, or install kde, xfce, et al and try running one of those first.

Finally, when you try to run startx manually, what errors are you getting? Please post them here.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

These are perl scripts, right? Is the first line something like this?

#! /usr/bin/perl

If it is, then then script should automatically invoke perl. If not, then you need to edit the script accordingly.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This shows that your computer is trying to boot from the network. Go into the BIOS and disable PXE (network) booting.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you know C++, php is pretty simple, and can include HTML code quite nicely. That said, I have encountered some pretty significant php bugs in dealing with HTTP conversations, one of which (dealing with transmitting "chunked" data and URL encoding) required some php code updates. I have posted these changes to the appropriate php / pear web sites, but when/if they will be incorporated into the code base is another question.

FWIW, I used php to write a cell-phone web browser emulator for performance testing of our proxy browsers.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Time to go back to the book! There are plenty of stats texts (hard copy and online) to help you with this, and wikipedia may help as well.

Just remember, there are lies, damned lies, and then there are statistics! In any case (joke not-withstanding), statistical correlations require pretty simple maths, but all stats require a good body of data, otherwise value-skew is inevitable, and that will throw your game off significantly. IE, you can't just take a few points and extrapolate a likely outcome.

Yeah, not the answer you wanted, but the best I could come up with in 2 minutes! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You poor schlub! NEVER let someone plug an unknown device into your computer!!! (emphasis intended)

To help people with recharge problems, keep a wall-powered usb charging cable available. No issue with pwning your systems.

Since this happened, you need to do the following:

  1. Reset your WiFi router to factor settings (may not be sufficient).
  2. Scan ALL of your computers (including your cash registers) for viruses using the latest (and multiple) A/V scanners.
  3. You are in deep!

And yes, doing this - plugging into your computer directly - can allow someone with a "simple" mobile phone, to pwn (own) all systems in your network. Lesson? Listen to your instincts... :-( Remember, that modern phones are fully capable 32 or 64 bit computers with the resources that a super-computer of 10 years ago would be hard-pressed to equal.

P.S. You might want to bring in a professional computer security services company and/or consultant to analyze your systems. Also, contact your banks to be sure your accounts aren't being drained...

One final note - make a police report about this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Although the range extender has an IP address in order to configure it, in operation, that should not appear in the route as it is basically operating as a radio repeater at that point. IE, your computer is (in)directly communicating with the router itself and the extender is simply relaying your signal to the router's access point.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not enough information. What problems are you encountering? What have you tried? What are the details of your project? Etc, ad infinitum.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

RTFM? Go online and look at Oracle's Java documents. It is all covered there. This is not a simple question to answer here without you posting the code with which you have tried to accomplish this.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, array indices in C/C++ are zero-based, not 1 based like some languages we won't mention here, UNLESS you want to skip over the first element...
Secondly, you need to remove the semi-colon from then end of line 1. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Most laptops will either go into sleep or hibernate mode when the lid is closed. In either case, it will not be listening for network connection requests. You need to alter your power settings so that the system stays operational when the top is closed. It will drain the battery, however; so when you do that, you might want to be sure the laptop is plugged into wall power.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What sepp2k said is quite correct, but difficult to understand for noobs. Here is possibly a more understandable example:

int anInt = 5;
int* ptrToAnInt = &anInt;

anInt += 2;
printf("anInt and ptrToAnInt == %d (%d)\n", anInt, *ptrToAnInt);

This should result in the output "anInt and ptrToAnInt == 7 (7)".

Clear as mud yet? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

GNU has a fortran compiler as part of the GCC compiler suite. I don't know if it is 2008 compliant or not, but it is usally fairly up-to-date. What OS are you running on?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Having used this pattern (with the macro cruft) much in the past, I can say that it is very efficacious, but it is not easy when debugging... :-) However, I give Mike2k a thumbs up for suggesting it.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

One of the rpm files in the set that you got will have the gui components for kde, gnome, or other window managers. Installing that rpm will get you where you want to be. I'll have to tell you later when I get home from work what directory they are in in that set you downloaded.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

OOo (and, in my opinion, better version of LibreOffice) should install a link in your KDE or Gnome UI menu system. Look in the "Applications->Office" menu. If it wasn't installed by default, the RPM files have an RPM to do that.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, the Kindle is basically an Android device, though I'm not sure if it supports the Android Store, which probably has something like what you are looking for. FWIW, I have found a bunch of neuroscience dictionaries on Amazon, some of which have Kindle versions. The $64 question is whether or not you can integrate them into the general operation of the device, such as when you are creating/editing a document and need to do spell-checking, etc. Don't know... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What deceptikon said about main(). All modern compilers will require the int return type unless (in some cases) you tell the compiler you are building legacy (old) code. The old K&R compilers would allow void return type for main(), but no longer (by default).

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Sorry - I coded a bug there! :-( Here is corrected code:

public class ObjectArray {
private vector<Object> myObjects;
.
.
.
    public void deleteObjects(int index, int count)
    {
        for(int i = 0, j = myObjects.size(); i < count && index < j; i++, j--)
        {
            myObjects.remove(index);
        }
    }
};

This should (I hope) work better - untested code! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This is very "clunky" code. It does not reset the size (last element) of the array. Use a vector<Object> class and then you can simply call the remove(index) method on it, and all the internal bookkeeping will be done for you. IE, this would be your code:

public class ObjectArray {
private vector<Object> myObjects;
.
.
.
    public void deleteObjects(int index, int count)
    {
        if (index < count){
        for(int i = index; i < index + count; i++)
        {
            myObjects.remove(i);
        }
    }
};

However, if you are trying to emulate how C/C++ would deal with a raw array, then this isn't what you want, although with C++ I would STILL use a vector<type> class these days.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately the Iterator interface, and ListIterator class do not have a rewind() method, so I think you will have to construct new iterator instances as per JamesCherrill's post.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Indeed, what deceptikon asks, or do you mean "read the file from back to front"?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Pretty correct. This is code for a Date class that has been validated at many levels:

bool Date::isLeapYear() const
{
    bool retval = false;
    if (isValid())
    {
        int yr = year();
        retval = ((yr % 4) == 0 && ((yr % 100) != 0 || (yr % 400) == 0));
    }
    return retval;
}

So, it is basically the same as yours except that you need to properly "scope" the last 2 terms. IE, if ((year%4) == 0 && ((year%100) != 0 || (year%400) == 0))

FWIW, I wrote that code in the early 1990's, about 20 years ago... It also was validated in a full-scale Y2K assessment. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Read the documentation for this yet? What about Google/Oracle?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Yes, it may be too late to recover your data... :-( However, in the future DO NOT try to use Windows to recover Windows data!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Trying to recover a Windows disc with Windows is like trying to fix a broken window with a hammer! This is what I do (and have never been thwarted in this):

  1. Boot a Linux Live CD/DVD
  2. Attach a USB or other drive and mount it under linux.
  3. Mount your Windows disc (also under Linux).
  4. Either copy the data / files you need (if you are going to re-image the system), or make a bit-image backup of the data using the Linux dd (disc dump) command.

FWIW, Windows (all versions) is notorious for farking the users when "stuff" goes wrong!

I know - it is too late for this, but maybe not! If you

  1. See #1 above.
  2. Run the fsck command on the NT partition that contains your data (probably /dev/sda1 or /dev/sda2) - that may restore the data to where you can read it.
  3. If #2 is successful, copy your data to a USB or other external drive.

Sorry, but data recovery is not an exact science, and I should know - I do this regularly for private clients. My day job is as senior systems engineer for a tier-one tech company. My side-line (and previous business) is as a software and data recovery consultant.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What James said. In addition, a lot of the time there are JNI (Java Native Interfaces) methods/classes that are wrappers to interface with native code that is distinctly platform dependent. If you write "pure" Java, then it is platform independent - the underlying JVM (Java Virtual Machine) takes care of the platform-specific issues, such as byte order for numbers, file and network system interfacing, etc.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What is the 'c' variable? Do you mean 'counter'? IE, your code is not functional. Also, if you mean 'counter' instead of 'c', then you are setting a[*counter] to 0, so the value scanned would be set to 0, before being set to what was found int the stdin stream...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The nice thing about Windows, is that no 2 systems behave the same... :-)

My advice? Move to Libre Office instead of MS Office.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

An alternative is to create a ram disc big enough to hold those files, and on boot up copy the php file directory there after the ram disc is created (you can do this in /etc/rc.local). Then you point your php to that directory with the include_path environment variable when it starts up, or you can use the php function set_include_path($path) function in your code.

jkon commented: Clean and clear +6
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

What package manager does Kali use?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The operating system should automatically cache those files in memory when read. IE, you should not have to deal with this! The caveat is whether or not you have sufficient RAM to cache these files. 100K is not much these days.

FWIW, upgrading from CentOS 5.x to 6.x will provide MAJOR performance improvements, especially in file caching.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Unfortunately, your description isn't too clear. You say you have the original database (with 2000+ articles), but you munged the virtual machine you wanted to install it on? You will need to reinstall the operating system on the VM. If that is where the data resides, then you need to boot a recovery OS, mount the file system where it resides, and then copy it to another device/media before you reinstall the OS. Clear as mud, right? :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

This may, or may not, be possible, depending upon the software and the licenses that apply. Some free or open source tools can simply have their /programs folder copied to the new system. Others will require re-authentication of the license you hold.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A lot of tech companies hire student interns for these positions, but that usually assumes you have good grades in the relevant subjects. Contact your school's placement office - they should know who in your area are looking for student interns, if only for work-study positions.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

A fully qualified domain name (FQDN) does use the format of server.domain.com.

Actually, it would be 'server.domain.<root>' where '<root>' can be stuff like .com, .net, .org, .co.uk, .co.tv, etc.

FYI, .com and .co.nn are both for commercial sites. The .net and .org qualifiers are for network services and non-commercial organizations only. The example above for .co.tv is because .tv is assigned to the island nation of Tuvalu, which licenses ($$) its id for TV-related sites. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Caperjack makes a good point. The use of a single 8GB SIMM would imply that the laptop supports 16GB, but you say it only supports up to 8GB. So, using 2x4GB SIMMs would seem to be a valid point.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You might try 2x4GB sticks of the supported types/speeds. Some systems require both slots are filled.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You don't ask much, do you? The answers will depend upon what you intend to do with your gear. Myself, I have an almost 7 year old system that still kicks butt! Dual quad-core Intel CPUs, 8GB of fully buffered ECC RAM, 10+TB disc, nVidia 8800GT dual display video w/ dual 1920x1200 24" displays, dual DVD-RW drives, and other goodies. It cost me about $5000USD at the time. It can play dual HD videos (one on each display) at the same time.

Performance hardware? Get an Intel mobo and CPU's (4-6 cores each of up to 2 cpu chips), with good cooling gear, a 1000watt power supply, low-cost nVidia graphics (unless you intend on high-end gaming - the low-end these days will blow your socks off!), plenty of memory (16-32GB), and plenty of sata-3 drives. Blu-ray? Don't bother unless you plan on using it for backup. The encryption of commercial BD discs is a PITA to deal with. DVD's are a no-brainer. It is easy to backup your DVD's, but BD's are another thing - you have to first extract them to MKV format, and/or then convert to the appropriate format to store to either DVD or BD.

Haswell is a low-power bus and Intel Celeron CPU chip intended for mobile systems. Don't bother for a desktop or server system. The current level for desktop/server systems is Sandy Bridge as far as I understand.

There are a lot of motherboard manufacturers out there that make good gear, and they are …

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You need T used inside the class, like this:

template <class T>
class events : public T
{
public:
    events(){}
    ~events(){}
    bool operator==( const T& aTee ) const     // Explicit cast
    { return (aTee == *(static_cast<T*>(this)); }
    const T* getTpart() const { return this; } // Implicit cast
};

The comparison operator is a case where you would preferably use static_cast<T*> instead of a dynamic_cast<T*>.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I haven't written prolog for 30 years, but I think that your problem is that (from what you are indicating) ne(b) is not returning an entity in your database, hence is null, and comparing a non-null with null value is an ERROR as it can't be evaluated either true or false (basic predicate logic). IE, it is doing the right thing, and you need to deal with that possibility.

If you wanted to force an error to return false from a boolean function in C or C++ (and some other languages) you could do something like this (assuming results is a true/false value as the call evaluated and HAVE_ERROR indicates that an error was caught): return (HAVE_ERROR) ? false : results;

Unfortunately I have no clue how you would do that in prolog, and right now I don't have time to dust off my copy of Clocksin & Mellish and look it up... :-)

I hope this is heading you in the right direction in any case.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Mingw is a gcc/g++ (gnu compiler collection) compiler for Windows. It is ansi/posix compliant so the code you write on windows has a better than even chance of running on other systems, such as Linux, Unix, or OSX. It is also open source.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Show the contents of eight.txt.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Did you install a new operating system on the drive? You can't just boot from a new drive - you need an operating system on it, and a valid boot loader installed as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

On linux systems, the shell command to clear the screen is "clear", not "cls". Sometimes a form-feed output will do this as well.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

All great answers. Just remember that K&R is (in internet time) from the dark ages! At the time K&R wrote the book on their invention, the C language, they were using a system (PDP-7 or such as I recall) which had a 16 or 32-bit architecture. Integers (and long ints) were 32-bits, and (as today) shorts were 16-bits and chars 8-bits. Modern systems (64-bit cpus) have 32-bit ints, 64-bit longs, 16-bit shorts (still), and 8-bit chars (still). On 32-bit systems today, you can specify a 64-bit integer as a 'long long int', which should be the same on a 64-bit system, though depending on the compiler, a long long int may be 128 bits on a 64-bit processor system - caveate programmer! :-)

To reiterate my favorite quote - the nice thing about "standards" is that there are so many!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can set the function signature to arrayname[][] and pass the x and y sizes in the argument list. However, this really doesn't work well, and can lead to "unintended results". Since this is C++, I advise that you use C++ STL collection templates instead. You can use a vector of vectors to simulate a 2 dimensional array very easily. I do this all the time with great effect. Since std::vector types are dynamically resized/allocated, you don't need to do much besides add a new element to either the outer or inner vector.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just a cursory glance, but you have defined all of your arrays to have 2 columns. Why are you iterating over the passed column count? Also in your sub() function, you define g as a 2x2 array, yet you overrun the size with your g[3][3] = f - e.

You need to do more studying, and understand what you are doing. It is fundamentally, and fatally flawed at a number of levels.

H_beginner commented: I have studied and solve the problem. I wanted to know if I can make the matrix size entered by the user dynamic. Currently I have fixed it as a 2*2 matrix. +0
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You can also use symmetric encryption, where the same key is used to decrypt the message as is used to encrypt it. Depending upon the encryption algorithm used, this can be more secure than public key encryption when JorgeM talks about. The major issue with this is how to securely exchange keys with the other party. Obviously, if you can make the exchange personally without sending over the network or other public communication medium, then it is a true private key exchange.

In fact, a lot of secure communication is handled this way, after a fashion. The cost to encrypt/decrypt using public key pairs is high in computer cycles and time, so often a symmetric key is transmitted using a public key system (such as PGP). That key is much shorter than a communication that may be hundreds or thousands of pages of data, so you pay a lot for a little message (the symmetric key) and less for the bigger part of the communication.

A great book that covers these subjects in a very readable manner is Bruce Schneier's "Applied Cryptography". First published in 1994, it is the "bible" of many professional security engineers today.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

In virtualbox you have a number of machine settings. One is for the virtual video adapter (Display settings). You need to increase the memory to the max (128MB), and for Linux clients enable 3d acceleration (2d is for Windows operating systems). Doing this I can use a 1920x1200 HD display with full color.

theashman88 commented: Thanks for the help. Quick and clean +1