rch1231 169 Posting Shark

Hello,

The only thing I have ever notice is that when you query a view from another view is that it can be slower if the first view creates a large amount of output. You might want to simply add the query as an outer select to the syntax for the first view.

rch1231 169 Posting Shark

Hello,

The problem is you are missing the ON that tells the join how to connect the two tables. There has to be a reference field in employees to link it to job titles but your query will look something like this.

use Dwight_wk2
Select * from employees
Left Join Job_Titles on Job_Titles.Job_Title_ID = employee.Job_Title_ID
WHERE employee.Salary BETWEEN 20000 and 35000

You will probably want to change the specific fields you are getting from employee and job_titles so you only get the fields you want to show. Without the tables I am guessing at the names.

use Dwight_wk2
Select 
employees.Lastname
employees.Firstname
employees.salary
job_titles.job_title
from employees
Left Join Job_Titles on Job_Titles.Job_Title_ID = employee.Job_Title_ID
WHERE employee.Salary BETWEEN 20000 and 35000
rch1231 169 Posting Shark

Communications speeds when transferring data are usually, but not always, measured in bits per second. A bit is a binary or logical 1 or 0. Data transfer speeds when transferring data, etc. in a computer, such as between memory and a hard disk drive, are often, but not always, measured in bytes per second. A byte of data is a chunk of bits used to represent a character, but not always. There are usually eight bits in a byte, but not always. So, roughly speaking in general and common terms, one byte equals eight bits. Bytes are abbreviated with a capital B and bits are abbreviated with lower-case b, but not always. Microsoft Windows often shows communications speeds in bytes per second. Thus the confusion, which I hoped this unscrambled a little.

However, to complicate matters even more... The Hertz is often used as a unit in the measurement of data transfers. A Hertz is one cycle per second. A cycle is a single occurrence of a periodically repeating phenomenon. For example, one revolution of a bicycle wheel is a cycle. Plot the vertical height (amplitude) of a spot on the tire versus distance or time on a graph and you will have a sinusoidal waveform. Your house electrical power is a sinusoidal wave.

A communications waveform may have a repeated shape. For example, the Ethernet can be measured in cycles per second (Hz). Roughly speaking, and for measurement purposes, it can be considered a repeated "square wave," …

rch1231 169 Posting Shark
rch1231 169 Posting Shark

Hello,

There is a cool tool called jdiskreport which will show you where all of your disk space is being used. You can download it through download.com by CNET.

rch1231 169 Posting Shark

Hello,

What you need to do is to select your records and do the join with the C_ID and Inst_No and then use the WHERE to select a subset of the data where the fields are not equal. Something like:

SELECT Table_1.C_ID, 
Table_1.Inst_No,  
Table_1.Paid_Dt, 
Table_2.C_ID 
Table_2.Inst_No 
Table_2.Today_Dt
From Table_1 Inner Join Table_2 on Table_1.C_ID = Table_2.C_ID 
AND
Table_1.Inst_No = Table_2.Inst_No
WHERE 
Table_1.Paid_Dt <> Table_2.Today_Dt
rch1231 169 Posting Shark

Hello,

Ok. I see a couple of things that are a little off:

1. Why do you have a number as part of the field name? And do you have an ID field (record number that auto-increments)?

2. There should be a space after each field name.

3. A semi-colon (the one after "Photo); " and before "VALUES" ) ends a sql statement so instead of one you have two separate statements that are missing the other half. Remove the semi-colon.

4. Your field list shows you inserting to Last_Name then First_Name but your value list starts with
1, 'Smith', 'Janet'

So the system is trying to insert 1 into the Last_name field.

5. You have your dates in two different formats which may cause a problem depending on the version of MySQL.


If I may.... try this instead:


INSERT INTO employees
(Last_Name, First_Name, Title, Title_of_Courtesy, BD, Hire_Date, Address, City, State, Zip, Country, Extension, Notes, Reports_to, Photo)
VALUES ('Smith', 'Janet', 'Sales Manager', 'Mrs.', '12-30-1974', '08/05/2000', '123 My Street', 'canton', 'OH', '44720', 'USA', '4632', 'MBA from Ashland University', 'Andrew Fuller', 'No Photo Available Yet');

rch1231 169 Posting Shark

Hello

Try
sudo chmod 755 /var/www

Your problem is the third permission which is for every one else. First is the owner, second is the groups permissions and third is everyone else in the world. 755 will set it to rwxr-xr-x (r=4 w=2 and x=1 ) you add them to set each group of permissions.

ls -la /var/www/
total 32
drwxr-xr-x.  8 root      root 4096 2010-04-10 10:22 .
drwxr-xr-x. 27 root      root 4096 2010-08-12 00:28 ..
drwxr-xr-x.  2 root      root 4096 2010-04-10 10:22 cgi-bin
drwxr-xr-x.  3 root      root 4096 2010-07-12 07:15 error
drwxr-xr-x.  7 root      root 4096 2010-08-16 13:50 html
drwxr-xr-x.  3 root      root 4096 2010-07-12 07:15 icons
drwxr-xr-x. 14 root      root 4096 2010-07-12 07:25 manual
drwxr-xr-x.  2 webalizer root 4096 2010-08-08 03:11 usage

It is the next directory down (html) that should be set for apache to read:

ls -la /var/www/html
total 28
drwxr-xr-x.  7 root   root   4096 2010-08-16 13:50 .
drwxr-xr-x.  8 root   root   4096 2010-04-10 10:22 ..
drwxr-xr-x   2 apache apache 4096 2010-07-28 23:27 default.com
drwxr-xr-x  13 rod    apache 4096 2010-08-11 16:20 SmokeDepot
drwxr-xr-x   8 rod    apache 4096 2010-08-21 02:41 smokeshop
rch1231 169 Posting Shark

Hello,

There are several ways to configure the systems. Your best bet if the hard drives are not exactly the same is to use a hard drive cloning program. Take a look at UBCD4WIN (Ultimate Boot CD 4 Windows) It is a free down load that you create on another system using your XP or Vista installation as source to create a Boot CD and there are around 50 utilities for repairing, scannig and copying drives.

Here is a link to a wiki with information on the CD and where to download for free:

http://en.wikipedia.org/wiki/UBCD4Win

rch1231 169 Posting Shark

Normally you cannot connect two computers directly with a standard ethernet cable. You have to have a hub or switch involved to swap the send and receive wires to the right outputs. There are crossed cables available that will do the pin swapping for you but you are better off with a small hub. A standard cable pin one goes straight through to pin one and two to two etc. A crossed cable swaps pin one to pin two, two to one, three to four four to three, etc. so transmit on one computer goes to receive on the other and visa versa. Hubs and switches handle that for you. Some of the newer network adapters are designed to auto detect the cable configuration and allow you to connect without a cross connect cable but the older VIA adapters are not on the list. I bet you are not getting a link light on the network port when they don't connect. And when you get one on the new computer it takes a second to come on instead of the moment you plug it in.

rch1231 169 Posting Shark

I hate to correct someone in Public but Zagga is wrong.
<img src="/images/picture.jpg" /> is not based on the current directory but on the Document Root directory for the web site. For example all the sites on my server are located in /var/www/html/ and have their own directory by domain. My web site resides in /var/www/html/txlinux.com/ which is listed as the document root for the site I can refer to any file in the top directory of the site with <img src="/picture.jpg" /> but the absolute path for the files on the server is /var/ww/html/txlinux.com/picture.jpg. The only time I really need to use this form of the path is when using "Include file.php (i.e. Include /var/www/html/txlinux.com/config/config.php )

"./" is the current directory and "../" is one directory up.

vaultdweller123 commented: well done +1
rch1231 169 Posting Shark

Hello,

This is what I used for reference and it says INT UNSIGNED (4 bytes) which is how mine are defined and they work great.

MySQL has two built-in functions: INET_ATON() and INET_NTOA(). They are actually based on the equivalent inet_aton() and inet_ntoa() which are C library functions present on pretty much every TCP/IP capable system. Why? These two functions are used allover the place in any TCP/IP stack implementation or even application.
The INET_ATON() function converts Internet addresses from the numbers-and-dots notation into a 32-bit unsigned integer, and INET_NTOA() does the opposite. Isn't that handy!

Let's put it to the test:

mysql> SELECT INET_ATON('192.168.0.10') AS ipn;
+------------+
| ipn |
+------------+
| 3232235530 |
+------------+

mysql> SELECT INET_NTOA(3232235530) AS ipa;
+--------------+
| ipa |
+--------------+
| 192.168.0.10 |
+--------------+

So you can store an IP address in an INT UNSIGNED (4 bytes) which is of course much more efficient and faster than a CHAR(15). Naturally, you can call the function while you're inserting, so something like this is fine also:

INSERT INTO tbl VALUES (..., INET_ATON('192.168.0.10'), ...)

cereal commented: great post +3
rch1231 169 Posting Shark

Hello,

You should be calling the file from it's actual location instead of the web location. And the reason you are getting emails is you are not redirecting the output from the php script to somewhere. Since there is no terminal cron sends it to you in an email.

For example, the entry

10 17 * 6,7,8 1,5 /usr/bin/ps >> /tmp/psfile 2>&1

in your crontab file schedules the ps command to execute at 5:10 PM (17:10) on every Friday and Monday during June, July, and August.

When using crontab, redirect any output that is normally sent to the terminal to a file. In this example, 2>&1 redirects any error messages to the file psfile.

rch1231 169 Posting Shark

Hello,

I think the error is because you are missing the $ in front of dir2/* and anywhere else you are referencing the variables dir1 dir2 dir3. The only line that should not have the $ is the initial definition when you set them to d1, d2 and d3 respectively.

It would look like this:

#!/bin/bash

dir2="d1"
dir1="d2"
dir3="d3"

for file in $dir2/*; do
    file_in_dir1=$dir1/$(basename ${file})
    if [ ! -e  ${file_in_dir1} ]; then
        # If the file in dir2 does not exist in dir1, copy
        cp ${file} $dir3
    elif ! diff ${file} ${file_in_dir1}; then
        # if the file in dir2 is different then the one in dir1, copy
        cp ${file} $dir3
    fi
done

But that is still off a little in the second test. Also this only tests to see if a there is a new file in d2 that is not in d1. What about new files in d1 not in d2?

You might be able to use the following command to get what is different in the directories and then copy the files.

diff -qr d1 d2
griswolf commented: good to mention diff -qr +1
rch1231 169 Posting Shark

Read the manual........
Like the rest of us did.

rch1231 169 Posting Shark

Hello again,

Well looking at the configuration here is what I would do.

Recap:
SCSI Disk b partition 3 ==>  /dev/sdb3 450G 406G 26G 95% /
SCSI Disk b Partition 2 ==>  Probably Swap space.
SCSI Disk b Partition 1 ==>  /dev/sdb1 99M 17M 78M 18% /boot
SCSI Disk a Partition 1 ==>  /dev/sda1 459G 41G 395G 10% /home2

You have already used 41G on the sda1 partition which is more than the 26G you have available on sdb1.

You have two options depending on what is in /home2. The following steps would need to be done by the user root or with sudo.


OPTION 1: The quick fix.

1) Copy /Backup to /home2/Backup

cp -RP /Backup /home2/
or if you want to monitor the progress.
cp -RPv /Backup /home2/

2) Verify the copy got everything by confirming the directories use the same amount of space. If not find out what is different.

du -s /Backup
du -s /home2/Backup

3) Once you are SURE everything made it run a list command to check you are deleting the right directory then replace the ls with rm :

/bin/ls -R /Backup/*
/bin/rm -R /Backup/*

4) check available disk space

df

5) remove the old /Backup directory now that it is empty and create a link called /Backup that points to /home2/Backup. rmdir will only let you remove an empty directory.

rmdir /Backup

hbmarar commented: solution not one but two and detailed in clearly that it aided me throughout as reference. great. +6
rch1231 169 Posting Shark

Hello,

It is all in the redirects you use. > writes over the file if there is one and >> appends to the file.

echo "second line of code" >> \test.bat

rch1231 169 Posting Shark

1. You have computer parts in your house older than 19.......that you bought new.

2. You have actually used an 8" floppy disk.

3. Your first modem was 300 BAUD.

4. You were a beta tester for Windows 3.1

And I qualify on all counts. Ouch.

LOL

~s.o.s~ commented: +1 for being a beta tester ;-) +0
rch1231 169 Posting Shark

Have you tried changing the channel on the router or setting it to a fixed channel and speed?

Since it is a desktop and is not used with other networks how about giving it a fixed IP address and see if it stays on line.

IF I remember correctly Netgear configures the local IP as 192.168.0.1 and DHCP for the range 192.168.0.100-192.168.0.150. If this is how your is setup the I suggest either setting the desktop at the address below (or setting it under "Alternate Configuration" with it set for DHCP initially):

IP: 192.168.0.50
NM: 255.255.255.0
GW: 192.168.0.1

NS1: 192.168.0.1
NS2: 4.2.2.2

If it down not work can you send the results from running the following commands from the command line:

ipconfig
ping 192.168.0.1 <Or your gateway address>
ping 4.2.2.2
ping google.com
tracert google.com

rch1231 169 Posting Shark

should be

use juggernaught;
rch1231 169 Posting Shark

Hello,

Your problem is that the server you are trying to connect to is not set to accept outside connections from the other server in mysql. Check out the following link at the mysql site more information on howto connect.

http://dev.mysql.com/doc/refman/5.1/en/privilege-system.html

rch1231 169 Posting Shark

You might want to re-read your question:

anyone has ideas? i could cd to %ProgramFiles%... or move folder anotherFolder

No where do you mention the windows shell or what OS. You are correct about the variable provided it has been set in your environment. Try:

echo %ProgramFiles%

from your windows shell and see what you get. If you are trying to move program files to a new location from a system where you do not have Administrative Privileges forget it. You would also not be able to move it if any application is actively running from the directory.

Next time phrase your question correctly and tell us what your goal is and why and I will be your get some better answers.

Salem commented: Yeah, the slow drip of usable information is hard work +20
rch1231 169 Posting Shark

I would drop the Commission field from the Policy table(s) and add a new table called Policy_Reps_Comm:

PRC_ID
Policy_ID
UserID
Date_Started
Date_Ended
Commission_Percent_Of_Total

On the last field it could also be commission_amount instead of a percent of the total.

Splitting the data out into a separate table you can handle things like:
Record 1 rep AAA gets 2.5% on policy 1234's Total_Premium
Record 2 rep BBB gets 2.5% on policy 1234's Total_Premium
Record 3 rep CCC gets 5% on policy 1234's Total_Premium because Rep AAA and BBB work for him.

By having a start and end date and creating a new record if the commission amount changes you have enough data to be able to recreate commissions. It gives a history of Rep AAA was paid r% from this date to this date and s% from this date to this date and t% since then. By having one rep per record you don't have to check for the other fields being filled in when doing your calculations and can make one pass through the table. It will make a lot of things easier in the long run, trust me.

You will be able to create queries that link all of the data together at the time you need it and hopefully very few holes to try and fill in later.

rch1231 169 Posting Shark

Hello,

The answer to that generates a couple of new questions.
What is the maximum number of Reps that share a commission?
How is commission determined (flat rate, percentage of total, etc.)?

Normally in SQL when you have multiple values you spin off a new table and link it back with a record ID. If it is NEVER going to be more than 2 Reps you could create 2 sets of fields in the Policy table to hold the data but it is not the best method. You now have to code to check both fields and output for each. It is better to make a new table. You could decrease the number of tables by combining the Policy tables into one and adding a policy type flag.

rch1231 169 Posting Shark

Hi,

I was looking for some help with how i would go about setting up my commission table.

Basically i have currently:

Users Table
UserID
Username
Password
Email

Clients Table:
ClientId
Client_UserID
FirstName
LastName
Address
PostCode
Tel
Email

Insurance Table:
InsuranceID
Clients_ClientID
Provider
Commission
DatePaid

CarInsurance Table:
CarInsuranceID
Clients_ClientID
Provider
Commission
DatePaid

I want to setup a commission table to track commission due for a user and list the provider and client name.

I am not sure if i should have a UserID column in my insurance tables for this to work?

Could anyone advise on what my structure should be?

I need to query it by dates.

So in the website the user needs to be able to filter the results based on month and year.

So show how much they have made in 2010 or show how much they have made in just the month of April.

Also if possible show how much is due to come in.

So if the datepaid column is null then show the total commission due in, then once it is paid it will change to show paid.

Hope someone can help me with this, appreciate your help.

Many thanks

Hello,

This may not be all you need and is based on what I would do. Remember there is more than one way to solve the issue so review this …