473,558 Members | 2,997 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Determine winner from two distinct lines

Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontations between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
information

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win

and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
8 1737
create view teamMatchStatus as
select matchResults.co nt_id, matchResults.te am_id,
case sign(team_score - mid)
when 1 then 'win'
when 0 then 'tie'
else 'loss'
end cont_status
from matchResults
join (
select cont_id, avg(team_score) mid
from matchResults
group by cont_id
) matchMids
on matchMids.cont_ id = matchResults.co nt_id

create view teamStandings as
select team_id,
sum(case when cont_status = 'win' then 1 else 0 end) win,
sum(case when cont_status = 'tie' then 1 else 0 end) tie,
sum(case when cont_status = 'loss' then 1 else 0 end) loss,
from teamMatchStatus
group by team_id
"John Grenier" <jg********@hot mail.com> wrote in message
news:40******** **************@ news.newsgroups .ws...
Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontations between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
information

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win

and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #2
"John Grenier" <jg********@hot mail.com> wrote in message
news:40******** **************@ news.newsgroups .ws...
Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontations between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
information

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win
CREATE VIEW TeamMatchStatus (contest, team, result)
AS
SELECT R1.cont_id, R1.team_id,
CASE WHEN R1.contest_resu lt = R2.contest_resu lt
THEN 'tie'
WHEN R1.contest_resu lt > R2.contest_resu lt
THEN 'win'
ELSE 'loss'
END
FROM MatchResults AS R1
INNER JOIN
MatchResults AS R2
ON R1.cont_id = R2.cont_id AND
R1.team_id <> R2.team_id
and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
CREATE VIEW TeamStandings (team, win, loss, tie)
AS
SELECT team,
COUNT(CASE WHEN result = 'win' THEN 1 END),
COUNT(CASE WHEN result = 'loss' THEN 1 END),
COUNT(CASE WHEN result = 'tie' THEN 1 END)
FROM TeamMatchStatus
GROUP BY team

--
JAG
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #3
John,

Here's a sneaky solution that might be more efficient than the other
suggestions, since it doesn't require a self-join of matchResults. It will
work so long as the contest results are integers from 0 to 99999, but that
restriction can be widened.
CREATE TABLE matchResults (
cont_id int,
team_id int,
contest_result int,
primary key (cont_id, team_id)
)
insert into matchResults values (1,1,3)
insert into matchResults values (1,2,5)
insert into matchResults values (2,2,4)
insert into matchResults values (2,3,4)
insert into matchResults values (3,3,3)
insert into matchResults values (3,1,4)
go

create table Two (
n int
)
insert into Two values(-1)
insert into Two values(1)
go

create view results as
select
cont_id,
case when n = 1 then minx else maxx end/100000 as team_id,
case sign(n*(minx%10 0000 - maxx%100000))
when -1 then 'loss' when 0 then 'tie' else 'win' end as result
from (
select
cont_id,
min(team_id*100 000 + contest_result) as minx,
max(team_id*100 000 + contest_result) as maxx
from matchResults
group by cont_id
) M, Two
go

select * from results
order by cont_id, team_id

select *
from (
select
team_id,
count(case when result = 'win' then 1 end) as Win,
count(case when result = 'tie' then 1 end) as Tie,
count(case when result = 'loss' then 1 end) as Loss
from results
group by team_id
) S
order by Win - Loss desc
go

drop view results
drop table Two
drop table matchResults

-- Steve Kass
-- Drew University
-- Ref: 9EA47FEA-D8EE-47E9-8ED7-555BA50BF93A

John Grenier wrote:
Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontations between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
information

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win

and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #4
Very clever indeed. But this business of folding and unfolding is an
overhead, too. I wonder if MSSQL has something similar to analythic
fuctions, so one can write something like this (I am using Oracle syntax):

SELECT cont_id, team_id, CASE WHEN contest_result < highest_score THEN
'loss' WHEN contest_result > lowest_score THEN 'win' ELSE 'tie' END
FROM (
SELECT cont_id, team_id, contest_result,
MAX(contest_res ult) over (PARTITION BY cont_id ) highest_score,
MIN(contest_res ult) over (PARTITION BY cont_id ) lowest_score
FROM matchresults)

"Steve Kass" <sk***@drew.edu > wrote in message
news:CM******** *********@newsr ead1.news.pas.e arthlink.net...
John,

Here's a sneaky solution that might be more efficient than the other
suggestions, since it doesn't require a self-join of matchResults. It will work so long as the contest results are integers from 0 to 99999, but that
restriction can be widened.
CREATE TABLE matchResults (
cont_id int,
team_id int,
contest_result int,
primary key (cont_id, team_id)
)
insert into matchResults values (1,1,3)
insert into matchResults values (1,2,5)
insert into matchResults values (2,2,4)
insert into matchResults values (2,3,4)
insert into matchResults values (3,3,3)
insert into matchResults values (3,1,4)
go

create table Two (
n int
)
insert into Two values(-1)
insert into Two values(1)
go

create view results as
select
cont_id,
case when n = 1 then minx else maxx end/100000 as team_id,
case sign(n*(minx%10 0000 - maxx%100000))
when -1 then 'loss' when 0 then 'tie' else 'win' end as result
from (
select
cont_id,
min(team_id*100 000 + contest_result) as minx,
max(team_id*100 000 + contest_result) as maxx
from matchResults
group by cont_id
) M, Two
go

select * from results
order by cont_id, team_id

select *
from (
select
team_id,
count(case when result = 'win' then 1 end) as Win,
count(case when result = 'tie' then 1 end) as Tie,
count(case when result = 'loss' then 1 end) as Loss
from results
group by team_id
) S
order by Win - Loss desc
go

drop view results
drop table Two
drop table matchResults

-- Steve Kass
-- Drew University
-- Ref: 9EA47FEA-D8EE-47E9-8ED7-555BA50BF93A

John Grenier wrote:
Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontations between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
information

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win

and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 20 '05 #5
>> I have to determine the "standing" (WIN - TIE - LOSS) from
confrontations between two teams on a contest. The table matchResults
has fields [sic] cont_id, team_id and contest_result (int). <<

Please learn that a column is nothing whatsoever like a field before
you write any more code.

The basic problem is that your data model is fundamentally wrong. A
match has more attributes -- a date, two teams (not the same) and two
scores (them and us) at least. I will bet that EVERY answer you get
from other people will keep your crappy DDL and kludge such a table
for the Matches together inside a query Reject the kludges and fix
the **real** problem. Engineering heueristic: mop up the water, but
fix the leak.

CREATE TABLE Matches
(march_date DATETIME NOT NULL,
home_team INTEGER NOT NULL
REFERENCES Teams(team_nbr) ,
visitor_team INTEGER NOT NULL
REFERENCES Teams(team_nbr) ,
CHECK (home_team <> visitor_team)
home_score INTEGER NOT NULL,
visitor_score INTEGER NOT NULL);

I have a series of articles coming out shortly on splitting facts over
multiple tables, columns and rows. This is a classic example. Are you
a George Carlin fan? You are doing his baseball scores routine in
SQL!
Jul 20 '05 #6
Isaac,

There is overhead, but with only two values of the folded value
per cont_id, it's probably not relevant here. In a different
situation, indexing the analog of
(cont_id, the computed column team_id*100000 + contest_result)
might help.

Analytic functions aren't in SQL Server 2000, but they have been announced
for SQL Server 2005, and I believe they follow the ANSI standard closely, as
Oracle does. I believe they are working in the public beta of SQL Server
2005 Express Edition, which is available now:

http://lab.msdn.microsoft.com/express/sql/default.aspx

The express edition, which will be free and freely distributable, is the
SQL Server 2005 engine minus some of the full version's rich toolset, and
restricted to smaller scale use: 1 CPU, 1 GB of memory, and a size limit
of 4 GB per database.

SK

Isaac Blank wrote:
Very clever indeed. But this business of folding and unfolding is an
overhead, too. I wonder if MSSQL has something similar to analythic
fuctions, so one can write something like this (I am using Oracle syntax):

SELECT cont_id, team_id, CASE WHEN contest_result < highest_score THEN
'loss' WHEN contest_result > lowest_score THEN 'win' ELSE 'tie' END
FROM (
SELECT cont_id, team_id, contest_result,
MAX(contest_res ult) over (PARTITION BY cont_id ) highest_score,
MIN(contest_res ult) over (PARTITION BY cont_id ) lowest_score
FROM matchresults)

"Steve Kass" <sk***@drew.edu > wrote in message
news:CM******** *********@newsr ead1.news.pas.e arthlink.net...
John,

Here's a sneaky solution that might be more efficient than the other
suggestions , since it doesn't require a self-join of matchResults. It


will
work so long as the contest results are integers from 0 to 99999, but that
restriction can be widened.
CREATE TABLE matchResults (
cont_id int,
team_id int,
contest_result int,
primary key (cont_id, team_id)
)
insert into matchResults values (1,1,3)
insert into matchResults values (1,2,5)
insert into matchResults values (2,2,4)
insert into matchResults values (2,3,4)
insert into matchResults values (3,3,3)
insert into matchResults values (3,1,4)
go

create table Two (
n int
)
insert into Two values(-1)
insert into Two values(1)
go

create view results as
select
cont_id,
case when n = 1 then minx else maxx end/100000 as team_id,
case sign(n*(minx%10 0000 - maxx%100000))
when -1 then 'loss' when 0 then 'tie' else 'win' end as result
from (
select
cont_id,
min(team_id*100 000 + contest_result) as minx,
max(team_id*100 000 + contest_result) as maxx
from matchResults
group by cont_id
) M, Two
go

select * from results
order by cont_id, team_id

select *
from (
select
team_id,
count(case when result = 'win' then 1 end) as Win,
count(case when result = 'tie' then 1 end) as Tie,
count(case when result = 'loss' then 1 end) as Loss
from results
group by team_id
) S
order by Win - Loss desc
go

drop view results
drop table Two
drop table matchResults

-- Steve Kass
-- Drew University
-- Ref: 9EA47FEA-D8EE-47E9-8ED7-555BA50BF93A

John Grenier wrote:
Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontatio ns between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
informatio n

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win

and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!


Jul 20 '05 #7
Steve,

I guess was not clear enough. Of course packing two values into a single
column and ant then unpacking is not a big deal. What I view as overhead
are the steps of assembling the games and then disassembling them back into
original form. Goes against the non-procedural nature of SQL.
"Steve Kass" <sk***@drew.edu > wrote in message
news:Tt******** *********@newsr ead2.news.pas.e arthlink.net...
Isaac,

There is overhead, but with only two values of the folded value
per cont_id, it's probably not relevant here. In a different
situation, indexing the analog of
(cont_id, the computed column team_id*100000 + contest_result)
might help.

Analytic functions aren't in SQL Server 2000, but they have been announced for SQL Server 2005, and I believe they follow the ANSI standard closely, as Oracle does. I believe they are working in the public beta of SQL Server
2005 Express Edition, which is available now:

http://lab.msdn.microsoft.com/express/sql/default.aspx

The express edition, which will be free and freely distributable, is the
SQL Server 2005 engine minus some of the full version's rich toolset, and
restricted to smaller scale use: 1 CPU, 1 GB of memory, and a size limit
of 4 GB per database.

SK

Isaac Blank wrote:
Very clever indeed. But this business of folding and unfolding is an
overhead, too. I wonder if MSSQL has something similar to analythic
fuctions, so one can write something like this (I am using Oracle syntax):
SELECT cont_id, team_id, CASE WHEN contest_result < highest_score THEN
'loss' WHEN contest_result > lowest_score THEN 'win' ELSE 'tie' END
FROM (
SELECT cont_id, team_id, contest_result,
MAX(contest_res ult) over (PARTITION BY cont_id ) highest_score,
MIN(contest_res ult) over (PARTITION BY cont_id ) lowest_score
FROM matchresults)

"Steve Kass" <sk***@drew.edu > wrote in message
news:CM******** *********@newsr ead1.news.pas.e arthlink.net...
John,

Here's a sneaky solution that might be more efficient than the other
suggestions , since it doesn't require a self-join of matchResults. It


will
work so long as the contest results are integers from 0 to 99999, but thatrestriction can be widened.
CREATE TABLE matchResults (
cont_id int,
team_id int,
contest_result int,
primary key (cont_id, team_id)
)
insert into matchResults values (1,1,3)
insert into matchResults values (1,2,5)
insert into matchResults values (2,2,4)
insert into matchResults values (2,3,4)
insert into matchResults values (3,3,3)
insert into matchResults values (3,1,4)
go

create table Two (
n int
)
insert into Two values(-1)
insert into Two values(1)
go

create view results as
select
cont_id,
case when n = 1 then minx else maxx end/100000 as team_id,
case sign(n*(minx%10 0000 - maxx%100000))
when -1 then 'loss' when 0 then 'tie' else 'win' end as result
from (
select
cont_id,
min(team_id*100 000 + contest_result) as minx,
max(team_id*100 000 + contest_result) as maxx
from matchResults
group by cont_id
) M, Two
go

select * from results
order by cont_id, team_id

select *
from (
select
team_id,
count(case when result = 'win' then 1 end) as Win,
count(case when result = 'tie' then 1 end) as Tie,
count(case when result = 'loss' then 1 end) as Loss
from results
group by team_id
) S
order by Win - Loss desc
go

drop view results
drop table Two
drop table matchResults

-- Steve Kass
-- Drew University
-- Ref: 9EA47FEA-D8EE-47E9-8ED7-555BA50BF93A

John Grenier wrote:

Hi,

I have to determine the "standing" (WIN - TIE - LOSS) from
confrontatio ns between two teams on a contest. The table matchResults
has fields cont_id, team_id and contest_result (int).

TABLE matchResults
cont_id team_id contest_result
1 1 3
1 2 5
2 2 4
2 3 4
3 3 3
3 1 4
What I want is to create a view that determines the following
informatio n

VIEW teamMatchStatus
cont_id team_id cont_status
1 1 loss
1 2 win
2 2 tie
2 3 tie
3 3 loss
3 1 win

and eventualy calculate the standings

TABLE standings
team_id win tie loss
1 1 0 1
2 1 1 0
3 0 1 1
Anyone can help me out with this?

Regards,

Jon

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!



Jul 20 '05 #8


Isaac Blank wrote:
Steve,

I guess was not clear enough. Of course packing two values into a single
column and ant then unpacking is not a big deal. What I view as overhead
are the steps of assembling the games and then disassembling them back into
original form. Goes against the non-procedural nature of SQL.
It does indeed, but but sometimes funny-looking shoes fit just fine. ;)

SK


"Steve Kass" <sk***@drew.edu > wrote in message
news:Tt******** *********@newsr ead2.news.pas.e arthlink.net...
Isaac,

There is overhead, but with only two values of the folded value
per cont_id, it's probably not relevant here. In a different
situation, indexing the analog of
(cont_id, the computed column team_id*100000 + contest_result)
might help.

Analytic functions aren't in SQL Server 2000, but they have been


announced
for SQL Server 2005, and I believe they follow the ANSI standard closely,


as
Oracle does. I believe they are working in the public beta of SQL Server
2005 Express Edition, which is available now:

http://lab.msdn.microsoft.com/express/sql/default.aspx

The express edition, which will be free and freely distributable, is the
SQL Server 2005 engine minus some of the full version's rich toolset, and
restricted to smaller scale use: 1 CPU, 1 GB of memory, and a size limit
of 4 GB per database.

SK

Isaac Blank wrote:

Very clever indeed. But this business of folding and unfolding is an
overhead, too. I wonder if MSSQL has something similar to analythic
fuctions, so one can write something like this (I am using Oracle
syntax):
SELECT cont_id, team_id, CASE WHEN contest_result < highest_score THEN
'loss' WHEN contest_result > lowest_score THEN 'win' ELSE 'tie' END
FROM (
SELECT cont_id, team_id, contest_result,
MAX(contest_ result) over (PARTITION BY cont_id ) highest_score,
MIN(contest_ result) over (PARTITION BY cont_id ) lowest_score
FROM matchresults)

"Steve Kass" <sk***@drew.edu > wrote in message
news:CM***** ************@ne wsread1.news.pa s.earthlink.net ...
John,

Here's a sneaky solution that might be more efficient than the other
suggestions , since it doesn't require a self-join of matchResults. It

will
work so long as the contest results are integers from 0 to 99999, but
that
restricti on can be widened.
CREATE TABLE matchResults (
cont_id int,
team_id int,
contest_result int,
primary key (cont_id, team_id)
)
insert into matchResults values (1,1,3)
insert into matchResults values (1,2,5)
insert into matchResults values (2,2,4)
insert into matchResults values (2,3,4)
insert into matchResults values (3,3,3)
insert into matchResults values (3,1,4)
go

create table Two (
n int
)
insert into Two values(-1)
insert into Two values(1)
go

create view results as
select
cont_id,
case when n = 1 then minx else maxx end/100000 as team_id,
case sign(n*(minx%10 0000 - maxx%100000))
when -1 then 'loss' when 0 then 'tie' else 'win' end as result

from (

select
cont_id,
min(team_id*100 000 + contest_result) as minx,
max(team_id*100 000 + contest_result) as maxx
from matchResults
group by cont_id
) M, Two
go

select * from results
order by cont_id, team_id

select *

from (

select
team_id,
count(case when result = 'win' then 1 end) as Win,
count(case when result = 'tie' then 1 end) as Tie,
count(case when result = 'loss' then 1 end) as Loss
from results
group by team_id
) S
order by Win - Loss desc
go

drop view results
drop table Two
drop table matchResults

-- Steve Kass
-- Drew University
-- Ref: 9EA47FEA-D8EE-47E9-8ED7-555BA50BF93A

John Grenier wrote:
>Hi,
>
>I have to determine the "standing" (WIN - TIE - LOSS) from
>confrontat ions between two teams on a contest. The table matchResults
>has fields cont_id, team_id and contest_result (int).
>
>TABLE matchResults
>cont_id team_id contest_result
>1 1 3
>1 2 5
>2 2 4
>2 3 4
>3 3 3
>3 1 4
>
>
>What I want is to create a view that determines the following
>informatio n
>
>VIEW teamMatchStatus
>cont_id team_id cont_status
>1 1 loss
>1 2 win
>2 2 tie
>2 3 tie
>3 3 loss
>3 1 win
>
>and eventualy calculate the standings
>
>TABLE standings
>team_id win tie loss
>1 1 0 1
>2 1 1 0
>3 0 1 1
>
>
>Anyone can help me out with this?
>
>Regards,
>
>Jon
>
>*** Sent via Devdex http://www.devdex.com ***
>Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
2008
by: Alex Mizrahi | last post by:
Hello, All! i have 3mb long XML document with about 150000 lines (i think it has about 200000 elements there) which i want to parse to DOM to work with. first i thought there will be no problems, but there were.. first i tried Python.. there's special interest group that wants to "make Python become the premier language for XML processing"...
1
1517
by: joe | last post by:
If I had a webpage that displayed a database in tabular form, it would be nice to know how many lines of text the browser could display without scrolling, then have the cgi script output the appropriate number of lines of data to fill the screen. I've seen examples of how to get the browser window size in pixels, but is there a way to...
1
14469
by: nfrodsham | last post by:
In Microsoft's help literature, it states: "You can filter out non-unique rows by using the DISTINCT option of an aggregate function" I am trying to do this in Access 2003 with the COUNT aggregate function, but there is no reference, at least that I can find anywhere, of how to do this. I have multiple lines fields for which I would like...
9
19509
by: Adam | last post by:
Can someone please help!! I am trying to figure out what a font is? Assume I am working with a fixed font say Courier 10 point font Question 1: What does this mean 10 point font Question 2: How do I determine how many characters I can get on a line Question 3: How do I determine how many lines I can get on a page. Assume no margins...
6
1706
by: Tom McLaughlin | last post by:
How can I determine the numbers of lines of text that are visible in a textbox? Tom
6
5771
by: magix | last post by:
Hi, when I read entries in file i.e text file, how can I determine the first line and the last line ? I know the first line of entry can be filtered using counter, but how about the last line of entry in EOF while loop ? while (! file.eof() ) { ....
9
1776
by: paktsardines | last post by:
Dear all, As of yesterday I have this function: char ** lines = read_file("filename.txt"); Now, I want to print the contents of lines. A first attempt: int i=0;
6
1589
by: cargo | last post by:
Hello I have a SQL problem that I not sure of how to categorise. I have a table like this - 3 columns (Col_1,Col_2,Col_3) and want to create a 4th column =New_Column Col_1 Col_2 Col_3 New_Column 1 3 15.3 0.3 = 15.3-15.0 1 2 15.8 0.8 15.8-15.0
6
3397
by: BA | last post by:
Hi Everyone, I have an application that sits behind a server farm, the application needs to pass its NLB IP address in the message that it sends to another service. From C# code, how can I determine the IP address of the network load balanced machine that the message is generated from? So, in essence, I have server1, server2 and server3...
0
7629
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7549
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7835
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7593
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6183
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5455
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5172
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.