rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Don't attempt to write all this at one time. Code a little bit, compile, correct errors, then repeat. Many new programmers make the mistake of attempting to write everything all at one time, which can lead to millions of error messages as a lot of confusion. So take it in small steps, evern professional programmers do that when they write large programs.

Amen to that AD! After 30+ years of software development, I still write things a bit at a time. If the structures and interfaces are complex, I stub them out first until I am ready to add substance to them.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Have you read the documentation and wikis on the lightsquid web site? Go to http://lightsquid.sourceforge.net/ for more information.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You say you have an SSD, yet you also say that you hear the HDD spin up... Huh? SSD's (solid-state discs) don't spin up.

In any case, if you get no post and no beeps, then I think you either have a power supply or motherboard problem. Time to take it into the repair depot.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I've been using a pair to bridge my downstairs office with router, switch, and DSL modem to our upstairs WiFi access point and my wife's office switch for almost 5 years. No problems whatsoever.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

By now, people should realize that we are not here to help you cheat on your homework! Try to solve the problems first, and then we MIGHT decide to help you sort out your problems... :-(

NathanOliver commented: I guess we all need walt-p's boiler plate +10
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a couple of problems here. One is that the pointer you passed to doSomething() is a reference to a concrete object. When you allocate the array to that, you have corrupted memory - BOOM! SEGFAULT...

You need to pass a pointer to a pointer, and then you can allocate your array. IE,

#include <stdio.h>
#include <stdlib.h>

typedef struct
{
    int value;
} Thing;

void doSomething(Thing **ptr)
{
    int i;
    *ptr = (Thing *)calloc(5, sizeof(Thing));
    for(i = 0; i < 5; i++)
    {
        (*ptr)[i].value = i;
    }
}
int main()
{
    Thing* t = 0;
    int i;
    doSomething(&t);

    for (i = 0; i < 5; i++)
    {
        printf("Thing[%d].value == %d\n", i, t[i].value);
    }
    return 0;
}

A couple of points in addition.

  1. Make sure main() returns an integer value.
  2. Initialize variables (especially pointer types) before you use them.
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

New to C programming are we? You need to learn how C program files use headers to describe/define structures and interfaces. This is basic computer science and programming 101. For example, if I have a C source file that implements some API (functions) that other programs may use, I will create a header file that specifies the signature of the functions (API) so other applications can use them. Example:

#ifndef MY_C_HEADER_H
#define MY_C_HEADER_H

typedef struct {
int int_member1;
char array_member2[100];
} mytype_t;

extern void myfunction(int arg1, const mytype_t* pArg2);
.
.
.
#endif /* MY_C_HEADER_H */

In this case I am defining a structure and making it a proper type (mytype_t), and then I am declaring that my code includes the function myfunction(...), in a manner that other programs can use it if they link to my code.

If you don't understand all of what I am saying here, you have some serious studying to do... :-)

Good luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, you are saying that your notebook display only works for a second or two on boot, but if you have an external display (tv, etc) then that will continue to work? If so, then I believe the LCD driver hardware is faulty. Send it in to the Asus repair depot for repair. Hopefully it is still under warranty. Even if not, then make a big stink - they might still repair it to keep you a happy customer! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do what the others said, but do this also.

  1. Shut down your computer (he may have infected it with a keystroke recorder).
  2. Go to another computer that you have NEVER used or communicated with before (the local library is a good option).
  3. Change all of your accounts - names, passwords, etc. Not only bank accounts, but also your facebook, google, and other online accounts.
  4. Only let your MOST TRUSTED friends/family know what your new accounts are, and ONLY after you are sure they have not been hacked by this nutjob! Telling them in person, post, or by phone is reasonable - but NOT online!

Good luck!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Try a Google search. I'm sure there are many tools/packages for that out there. Some may even be open sourced.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, if this is a usb -> serial port dongle then before you connect it, look at /dev/usb, /dev/pts, and /dev/tty* and then after. You should see the new device ID's, assuming that the appropriate driver has installed them. In any case, what is the dongle (type, make, manufacture, model, etc)?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I assume this is a USB dongle. Try the "lsusb -v" command.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are books that go into this in detail. As a software engineer, I just use the appropriate macro functions that convert network-to-os order and vice-versa. I don't bother with the rest. That said, I used to teach basic internetworking to AT&T techs so I had to lecture on all of that cruft - a couple of days of 5 hour lectures and exercises just to deal with network addressing, bit/byte orders, and all that. You have a couple of days? I only charge $200USD / hour for that sort of training... :-)

P.S. They got college credit for the class.

BTW, is ANYONE still using Token Ring any longer? I still have some Arcnet boards laying around my basement if you want antique gear.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Well, upgrading your Symbian phone from Anna to Belle had zip to do with your computer problem - a red herring if you will. I am a senior systems engineer at Nokia Mobile Phones so I have some understanding of that - one of my phones is an N8 Symbian phone that I upgraded earlier this year to Belle... :-)

From what you are saying, it sounds like there is a hardware fault with your computer. Get some diagnostic software from the manufacturer (HP and others have programs and disc images for hardware diagnostics) and see if it sees that there is a problem. If it runs, and finds no hardware problem, then try reinstalling the operating system. If it doesn't run or finds a hardware problem, then there you are - sending it into the repair depot or getting a new system.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Do you have any programming experience? Do you know python at all?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And in case you are wondering why I say what I do about this, consider that I am the principal performance engineer for a tier-one cell phone manufacturer and help manage performance and reliability for 4 world-wide data centers with a number of thousands of enterprise servers running in them. I run Red Hat Enterprise Linux (or clones) on all of those machines, in a VM on my company laptop, on my home workstation, and on my personal laptop. I used to run Ubuntu on my personal laptop, but got disgusted with it after 9.04 - that was, in my opinion, the best Ubuntu distribution ever, and it has (again, in my opinion) gone downhill ever since.

So, why do you need a server distribution? If you do, why not Red Hat Enterprise Linux, or a clone such as CentOS or Scientific Linux? Our company does support Ubuntu on engineering workstations, but not for server use. For that, we are strictly an RHEL or certified clone shop.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

First, find wall, place head against wall, pull head away from wall, accelerate head to impact on wall sharply, repeat instructions...

Second (and less painfully), install a virtual machine manager such as VirtualBox on your system, then install Ubuntu Server 12.04 there and go back to "First" above until you get it working correctly. Once you have it running ok in a virtual machine, you will be ready to install it on your system.

FWIW, the only difference between a user workstation installation and a server installation are the tools and programs. You really do not need to install the server version itself unless you need some of the more advanced security features and such. In that case, DO NOT try to update/upgrade your system, but install the server software from scratch.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You aren't providing enough information. For whatever it's worth, building kernel drivers is not for the newbie. All I can reasonably suggest is that you look at the Makefile associated with other, similar, drivers to see how they do it. Also, go to the gnu.org web site and read the documentation for gmake, which is what you have on your Linux system. It is quite complete and helpful. I have been writing very complex make files for entire systems comprised of 100's of modules and 10M+ lines of code, and I still refer to the manual...

One final thing. In order to build a driver, you need the kernel development and kernel headers packages installed on your machine. Have you done that?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Boot with a live cd/dvd/usb drive, mount the root file system on the hard drive to some local mount point such as /mnt/sysroot (you will have to create the directory first), then you can, as root in the live system, edit the /etc/shadow file to remove the password for the user account, then edit the /etc/sudoers file to allow that user to sudo to root. Reboot to the hard drive, login as the user, sudo su - to get to root, and then change root's password.

I know, your eyes are rolling around the back of your head about now, right? :-) So, here are the steps above in a list:

  1. Boot from a live cd/dvd/usb drive
  2. Login to the system as root
  3. Create a mount point for the system drive: mkdir /mnt/sysroot
  4. Mount the system root file system on the new mount point. For Red Hat / Fedora systems, this is usually /dev/sda3, but it may not be. You can see what the system partitions are with the command "fdisk -l /dev/sda". Assuming it is /dev/sda3, do this: mount /dev/sda3 /mnt/sysroot
  5. Edit /mnt/sysroot/etc/shadow with vi and find the user account. If the user's name is jones, then find the line that starts with "jones:" and delete the long bit of gobledygook that follows up to the next colon ':', leaving the rest of the line alone.
  6. Save the file and exit vi.
  7. Edit /mnt/sysroot/etc/sudoers and add this line (assuming that 'jones' is the user account): jones ALL=(ALL) NOPASSWD: ALL
  8. …
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

My advice? Forget it! Licensing software (or using DRM) only keeps the honest honest, but irritated (when the software fails because the license or DRM software is fubar, that is a quick way to lose customers). Most customers of commercial software are perfectly happy to pay, and are more than willing to do so when the software meets a need, and does not get in the way of their work/operations. As a business person and professional software developer, I refuse to purchase any software that requires DRM or licensing that may obstruct my use of the tool for which I have paid serious $$. That isn't to say that I don't use licensed software (I do), but if it EVER refuses to run because it thinks I don't have a valid license, I will drop that product in a heartbeat! And speaking from personal experience, this is harder to do (write license-enabled software that won't screw your customers) than you imagine!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not a good idea. The better option would be to increase the priority of your program so it will pre-empt other processes that are running at a lower priority. From your question, I assume you are running Windows. With Linux this is trivial, by decreasing the 'nice' factor of your program. Not sure how to do that programmatically with Windows... Sorry.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

How do you know it isn't a problem with your internet provider? I assume you are using a home router? If not, does your ISP have a limit on the number of active connections?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

And you know this, how? Are you sure it is not a software problem?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It seems you can only maximize the height, but the width you have to go to preferences and set the windows width manually. I was able to set mine to 256 chars, or more.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

I did this as a self-teaching exercise about 27 years ago.

  1. Create a static array of primes up to 10,000 using the Sieve of Aristhostenes.
  2. Utilize a RECURSIVE, binary partitioning algorithm to determin if a number is prime.

First, find the largest prime number <= 1/2 of the new number (or old one if it is not even) and see if that is a factor. If so, the results of dividing the source by the prime is your new number.
Second, keep going back to the Second step until you can't any longer.

Using this algorithm, I was able to factorize any number into primes up to the biggest integer value supported by a 64-bit floating point number. If I was ambitions, I would have used an 80-bit integer value in the 8087 math co-processor I had in my computer at the time. It was VERY fast. A number up to 10^7 would take well under 30 discrete computations!

The original C source code resides on archived floppy discs in my home office, but finding it would take more time than I can allocate right now!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, how long ago did you get this assignment? Here it is, less than 2 days until it is due, and it doesn't appear to be a trivial problem. Sorry, but we don't help you cheat. You have to do this on your own. We'll help once you have made some REASONABLE attempt to solve it yourself, in that we will critique your code, or point you in the (hopefully) right direction. So far, you just want someone to solve your conundrum for you... :-(

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Just do one wait() in the parent process in a loop - not one for each child pid - until it receives the SIGCHLD signal for each forked child process. Waiting 3 times in the same while() loop is counter-productive. Alternatively, you can use waitpid() instead, to wait for a specific process to die.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, what is this header file for? If available for Ubuntu, but not for Windows, then you may have to port the library it supports to Windows yourself. What does winscard do? Why are you using it?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Walk through your logic, identifying each component step critical to the final calculation. Make sure each step completes correctly. As you do this exercise, you will find where your problems are.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

1000! == 4.023872601e+2567 - a value that will overflow ANY normal computer numeric variable. My guess is that 2000, 3000, etc worked because of numeric overflow on the integers resulted in a valid (NOT correct) value. To work with such large numbers, you need specialized math software libraries, such as Boost, that support arbitrary precision math. IE, you are trying to use a rubber-band powered airplane model to achieve Mars orbit - ain't gonna work!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Also, please put your code in code blocks so it is properly indented. It is very hard to read as-is.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Look at the patterns. Each parameter in the config file has an '=' sign in it. The part before the '=' is the parameter, and the part after is the parameter value. So, do this.

  1. Read line into buffer.
  2. Check for comment character ('#')
  3. if no comment, look for '=' using strchr(buffer, '=')
  4. if return value from strchr is not null, you now know you have a parameter + value.

I leave the bit about extracting the parameter+value up to you. I only help with school problems - I don't solve them for you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster
  1. Use << endl output manipulators after each output line so that the output is flushed to the display, and it appears on its own line.
  2. The loop is simple:

    while (soda != 6)
    {
    // 1. display menu
    // 2. decode input to decide what to do.
    // 3. done!
    }

Look at the switch() statement - that is better (in my opinion) than if/else if/else logic to handle this sort of situation.

So, keep at it - you are making progress!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

You make some interesting points c1c2c3c4c (can I just call you checksum?). Any technical problem, once it is proven solvable, is amenable to improvements, and cost/prices is mostly a matter of scale - the more devices of the specific type that exist and are sold in the market, the lower the price gets, and the faster the technology is moved forward, mostly by those who want to make a profit out of the "new thing".

Anyway, I see what you are saying about encoding data in trinary vs. binary trees. This is a VERY old technique in database programming. I was writing multi-order balanced trees (see Knuth Vol.3, Sorting and Searching) back in the 1980's to rapidly sort random data sets. What you are getting at, I think, is a system where each bit can encode 3 instead of 2 values. To me, that is another animal entirely! That said, I will be the first to admit that I don't know everything in this domain, even after 30+ years doing bleeding edge software engineering. So, this 3-value vs. 2-value encoding thing is why I mentioned quantum computing, which does just that, at a sub-atomic level. I think you need to do some reading in that area of tech, assuming that you haven't already (I am probably wrong, correct?).

Interesting conversation. I'm interested in continuing. :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

So, this doesn't happen with Firefox? I assume you are using Norton in on-access-scan mode? This may interfer with IE if IE thinks it is taking too long to access some web content or load necessary ActiveX controls, dll's, etc. Try disabling that feature temporarily to see if that makes your problem disappear. If so, you might try another AV product.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

All the documentation you need should be on your system (see the man and info commands), and you can find a lot more either online, or from the supporting web sites (Google is your friend). For FTP you need to know about xinetd and also whether or not you want vanilla FTP, secure FTP, or some other version. For a web server, there are several, including Apache/Tomcat, Ruby-On-Rails, and others. For Samba (CIFS support for Linux/Unix/OSX) there is Samba.

In any case, asking how to deploy these system components is not useful until you have a better understanding of the Linux operating system. Start learning by using/reading/trying/failing and then when you have made some progress, ask again.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

The purpose of these class exercises in algorithm development is to get you thinking about problems and how to analyze and approach and then solve them. Don't ask us to help you cheat! And that is what you are doing! Make an honest effort, and we may decide to critique your work, and point you in a different direction if you are too far off-beam, but DO NOT ask us to do your work for you!

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If you can't connect the monitor to another computer or video card to test if it is the culprit, see if you can see the problem when you run the monitor's built-in diagnostics. If it persists, it is the monitor. If it doesn't, then it is the video card - possibly with degrading video RAM.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

There are a lot of factors. The data (videos) are stored across many computers. How fast some (or parts) are accessed depends upon the load (cpu, network, i/o) on specific components. You need to understand how big-data (Hadoop and Google's mass storage) read-mostly systems work. If you did, you would not be asking this question, but it is a good one nonetheless.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Isn't this kind of where we are going with quantum computing, where a bit can encode more than 2 (0 or 1) values? Anyway, most of the cost would be involved with providing compatibility. Yes a 3-state computer could interpret (if instructed to do so) dual-state data, but it wouldn't be easy (or fast) to go the otherway, so anything generated using 3-state logic with a trinary computer would not be accessible by common 2-state machines...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

If there are no user-accessible accounts with administrator privileges, then you will have to reinstall the system. I don't know of any way to change the administrator account password without logging in as the administrator directly. However, if a user-accessible account has administrator privileges, then they can do anything needed with the system, other than chaning the administrator account password...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Some C header files are not C++ safe. If you get compiler and/or linker errors when you try to do so, then "guard" the #include <someCheader.h> directives with extern "C" {...}. Example:

#ifndef MYCPPHEADER_H
#define MYCPPHEADER_H
// My C++ header file
extern "C" {
#include <someCheader.h>
}
.
.
.
#endif // MYCPPHEADER_H
rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

It looks like you are using JNI for low level interfacing, correct?

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Speed, speed, speed. That is the question. Can you find another ISP and/or device that can give you better throughput? Since you are using Virgin, I assume you are in the UK? I am in the US, so I don't know what will work best over the pond.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Go to the device manager, and remove the entries for your wireless, if they appear. Then reboot. The system should reinstall the drivers and this will often fix the problem.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

BTW, please stop SHOUTING! Bad netiquete.

Usually, this sort of situation is done via firewall rules. You don't mention what you are using for a firewall - hardware (make/model), server software (what program/service), what? Without more information, there isn't much we can tell you that may work in your environment.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Please provide your definition of the dlist structure. I can infer it from the code, that that is not really reliable...

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Go from back to front, and use a temporary buffer to hold the data until done. IE,

for (int i = strlen(input) - 1, j = 0; i <= 0; i--, j++)
{
    temp[j] = input[i];
}
temp[j] = 0;
output = temp;

Just FYI, this won't work, but it is close. The changes are your exercise! :-)

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

Not enough info, but since this is a school project, I have to ask, what do you know about database management and file sharing? IE, the subject is to broad to approach in any meaningful manner until you start to restrict it to some reasonable parameters.

rubberman 1,355 Nearly a Posting Virtuoso Featured Poster

??? What EXACTLY are you trying to accomplish? SEO can mean many thing to different people.