473,626 Members | 3,320 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sorting

Let's suppose I have this sample document:

<root>
<entry id="1"
<date>2003-08-03</date>
<param_1>5</param_1>
<param_2>10</param_2>
</entry>
<entry id="2">
...
</entry>
</root>

Given some template to apply to this data, firstly I want to sort these
entries according to content of "date" element. Secondly, I would like to
split the result tree into two parts - the documents which are newer than 30
days and the rest, and following that I need to sort these groups according
to value of param_2 and param_1 (in the given order). The code I have tried
looks like this:

<xsl:apply-templates select="entry[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]">
<xsl:sort select="param_2 " order="descendi ng"/>
<xsl:sort select="param_1 " order="descendi ng"/>
<xsl:sort select="date" order="descendi ng"/>
</xsl:apply-templates>

But there's some caveat: the data gets sorted by param_2 and if there are
two entries with equal value, they are not sorted further by param_1. The
same applies the level below - if there are two entries with equal values of
param_1, they don't get sorted by date. What's wrong here? How can I make
this work the way I want it to?

I use PHP 4.3.2 with DOM XML.
--

__ .: Radoslaw Loboda :. | Cool stuff !!!
(oo) rl*****@bojko.k rakow.pl | --------------------
/ \/ \ | www.tigerhomes.org
`V__V' | www.suncam.tv

Jul 20 '05 #1
9 3619
Can you provide a complete (but the smallest possible) example --
source.xml, your transformation, the result and how it doesn't meet
your expectations.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"p0wer" <p0wer@bojko_kr akow_pl> wrote in message news:<3f******* *@news.vogel.pl >...
Let's suppose I have this sample document:

<root>
<entry id="1"
<date>2003-08-03</date>
<param_1>5</param_1>
<param_2>10</param_2>
</entry>
<entry id="2">
...
</entry>
</root>

Given some template to apply to this data, firstly I want to sort these
entries according to content of "date" element. Secondly, I would like to
split the result tree into two parts - the documents which are newer than 30
days and the rest, and following that I need to sort these groups according
to value of param_2 and param_1 (in the given order). The code I have tried
looks like this:

<xsl:apply-templates select="entry[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]">
<xsl:sort select="param_2 " order="descendi ng"/>
<xsl:sort select="param_1 " order="descendi ng"/>
<xsl:sort select="date" order="descendi ng"/>
</xsl:apply-templates>

But there's some caveat: the data gets sorted by param_2 and if there are
two entries with equal value, they are not sorted further by param_1. The
same applies the level below - if there are two entries with equal values of
param_1, they don't get sorted by date. What's wrong here? How can I make
this work the way I want it to?

I use PHP 4.3.2 with DOM XML.

Jul 20 '05 #2
> Can you provide a complete (but the smallest possible) example --
source.xml, your transformation, the result and how it doesn't meet
your expectations.


It is a basic link list built with XML:

<?xml version="1.0" encoding="UTF-8"?>
<LinkList>
<Entries>
<Entry id="1">
<SomeTags/>
<Date>2003-08-01</Date>
<SomeTags/>
<LinkData>
<Hits count="10"/>
<Rates>
<rate>6</rate>
<rate>4</rate>
</Rates>
<SomeTags/>
</LinkData>
</Entry>
<Entry id="2">
<SomeTags/>
<Date>2003-09-10</Date>
<SomeTags/>
<LinkData>
<Hits count="5"/>
<Rates>
<rate>9</rate>
<rate>1</rate>
</Rates>
<SomeTags/>
</LinkData>
</Entry>
</Entries>
<SomeTags/>
</LinkList>

What I want is to simply generate a list, where:
- newest entries (let's say not older than 30 days) are placed on the top of
the list
- newest entries and the rest are sorted separately
- sorting order of each group is Hits-Rate (which is a simple average of all
rates)
- each output page displays a defined number of links (passed as param by
PHP)

Seems like I can't get it the recursive way because XSLT does not allow to
reassign variable values. I have managed though to make it sort the entries
in the top-level approach, that means I have first sorted them according to
Hits, then Rate and Date coming last. But trying to output all the new
entries first, and then the rest, still maintaining the order and limiting
the number of links per page seems too hard for me.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso88 59-1" indent="yes"
standalone="yes "/>

<!-- Variables used in document -->
<xsl:param name="style_css "/>
<xsl:param name="start_id" >0</xsl:param>
<xsl:param name="end_id">0 </xsl:param>
<xsl:param name="date"/>
<xsl:param name="new_days" >30</xsl:param>

<xsl:template match="/">
<html>
<head>
<link rel="stylesheet " href="{$style_c ss}"/>
</head>
<body scroll="auto">
<table width="100%" height="100%" border="0" cellpadding="3"
cellspacing="0" >
<tbody>
<tr>
<td height="100%" align="center" valign="top">

<xsl:call-template name="date_chec k"/>

</td>
</tr>
</tbody>
</table>
</body>
</html>
</xsl:template>

<xsl:template name="date_chec k">
<xsl:param name="new">0</xsl:param>
<xsl:for-each select="/LinkList/Entries/Entry">
<xsl:sort select="LinkDat a/Hits/@count" order="descendi ng"/>
<xsl:sort select="sum(Lin kData/Rates/rate) div count(LinkData/Rates/rate)"
order="descendi ng"/>
<xsl:sort select="Date" order="descendi ng"/>
<xsl:value-of select="positio n()"/>
<xsl:if test="$end_id = 0 or (position() &gt;= $start_id and position()
&lt;= $end_id)">
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
($date - $new_days)]"/>
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]"/>
</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template match="Entry">
<xsl:variable name="entry_dat e">
<xsl:value-of select="number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) )"/>
</xsl:variable>

<!-- This is just simple display - trimmed down -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"
style="border:n one">
<tbody>
<tr>
<td align="left" valign="middle" >
<a>
<xsl:attribut e name="href">
<xsl:text>?acti on=view&amp;id= </xsl:text>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:value-of select="Title"/>
</a>
<xsl:if test="$entry_da te &gt;= ($date - 30)">
 <span class="red">NEW !</span>
</xsl:if>
</td
<td align="center" width="80" height="40">
<div class="red">
<xsl:value-of select="LinkDat a/Hits/@count"/>
</div>
<span class="small">
<br/>(<xsl:value-of select="Date"/>)
</span>
</td>
<td align="center" width="40">
<span class="red">

<xsl:value-of select="format-number( ( sum(LinkData/Rates/rate) ) div
( count(LinkData/Rates/rate) ),'0.0')"/>

</span>
</td>
</tr>
</tbody>
</table>
</xsl:template>

Let's say we have this data:
- id=1 & id=2 are old entries
- id=3 & id=4 are new entries
- id=2 has hits=2
- id=3 has rate=2
- 2 links per page
After sorting the order is 2-3-4-1, which is correct. But right now I get it
only this way. What I need is 3-4-2-1... The two entries for apply-templates
were used for some conditional choices, but it didn't work out exactly what
was expected. The selects are working, but now I need to put them somewhere
else to group the nodes.
--

__ .: Radoslaw Loboda :. | Cool stuff !!!
(oo) rl*****@bojko.k rakow.pl | --------------------
/ \/ \ | www.tigerhomes.org
`V__V' | www.suncam.tv

Jul 20 '05 #3
Your problem is that you are combining several problems in one and are
trying to solve them at once.

This can be solved by addressing each problem individually and then
combining the solutions. Probably a multi-pass solution will be one of the
easiest possible.

However, the problem in your code is not at all the sorting.

It seems to me that your date arithmetic is not OK.

In particular:
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
($date - $new_days)]"/>
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]"/>

the above calculation of "new" and "old" links will not work correctly in
most of the cases.
So, I would recommend that you try to split the task into sub-problems,
which are more realistic and manageable and then you have greater chances to
succeed.

You may find a dates/time library of templates useful. One such library is
the datetime_lib.xs l library, which comes with the XSelerator and can be
downloaded with the trial version of the product.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

"p0wer" <p0wer@bojko_kr akow_pl> wrote in message
news:3f******@n ews.vogel.pl...
Can you provide a complete (but the smallest possible) example --
source.xml, your transformation, the result and how it doesn't meet
your expectations.


It is a basic link list built with XML:

<?xml version="1.0" encoding="UTF-8"?>
<LinkList>
<Entries>
<Entry id="1">
<SomeTags/>
<Date>2003-08-01</Date>
<SomeTags/>
<LinkData>
<Hits count="10"/>
<Rates>
<rate>6</rate>
<rate>4</rate>
</Rates>
<SomeTags/>
</LinkData>
</Entry>
<Entry id="2">
<SomeTags/>
<Date>2003-09-10</Date>
<SomeTags/>
<LinkData>
<Hits count="5"/>
<Rates>
<rate>9</rate>
<rate>1</rate>
</Rates>
<SomeTags/>
</LinkData>
</Entry>
</Entries>
<SomeTags/>
</LinkList>

What I want is to simply generate a list, where:
- newest entries (let's say not older than 30 days) are placed on the top

of the list
- newest entries and the rest are sorted separately
- sorting order of each group is Hits-Rate (which is a simple average of all rates)
- each output page displays a defined number of links (passed as param by
PHP)

Seems like I can't get it the recursive way because XSLT does not allow to
reassign variable values. I have managed though to make it sort the entries in the top-level approach, that means I have first sorted them according to Hits, then Rate and Date coming last. But trying to output all the new
entries first, and then the rest, still maintaining the order and limiting
the number of links per page seems too hard for me.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="iso88 59-1" indent="yes"
standalone="yes "/>

<!-- Variables used in document -->
<xsl:param name="style_css "/>
<xsl:param name="start_id" >0</xsl:param>
<xsl:param name="end_id">0 </xsl:param>
<xsl:param name="date"/>
<xsl:param name="new_days" >30</xsl:param>

<xsl:template match="/">
<html>
<head>
<link rel="stylesheet " href="{$style_c ss}"/>
</head>
<body scroll="auto">
<table width="100%" height="100%" border="0" cellpadding="3"
cellspacing="0" >
<tbody>
<tr>
<td height="100%" align="center" valign="top">

<xsl:call-template name="date_chec k"/>

</td>
</tr>
</tbody>
</table>
</body>
</html>
</xsl:template>

<xsl:template name="date_chec k">
<xsl:param name="new">0</xsl:param>
<xsl:for-each select="/LinkList/Entries/Entry">
<xsl:sort select="LinkDat a/Hits/@count" order="descendi ng"/>
<xsl:sort select="sum(Lin kData/Rates/rate) div count(LinkData/Rates/rate)" order="descendi ng"/>
<xsl:sort select="Date" order="descendi ng"/>
<xsl:value-of select="positio n()"/>
<xsl:if test="$end_id = 0 or (position() &gt;= $start_id and position()
&lt;= $end_id)">
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
($date - $new_days)]"/>
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]"/>
</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template match="Entry">
<xsl:variable name="entry_dat e">
<xsl:value-of select="number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) )"/>
</xsl:variable>

<!-- This is just simple display - trimmed down -->
<table width="100%" border="0" cellpadding="0" cellspacing="0"
style="border:n one">
<tbody>
<tr>
<td align="left" valign="middle" >
<a>
<xsl:attribut e name="href">
<xsl:text>?acti on=view&amp;id= </xsl:text>
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:value-of select="Title"/>
</a>
<xsl:if test="$entry_da te &gt;= ($date - 30)">
 <span class="red">NEW !</span>
</xsl:if>
</td
<td align="center" width="80" height="40">
<div class="red">
<xsl:value-of select="LinkDat a/Hits/@count"/>
</div>
<span class="small">
<br/>(<xsl:value-of select="Date"/>)
</span>
</td>
<td align="center" width="40">
<span class="red">

<xsl:value-of select="format-number( ( sum(LinkData/Rates/rate) ) div
( count(LinkData/Rates/rate) ),'0.0')"/>

</span>
</td>
</tr>
</tbody>
</table>
</xsl:template>

Let's say we have this data:
- id=1 & id=2 are old entries
- id=3 & id=4 are new entries
- id=2 has hits=2
- id=3 has rate=2
- 2 links per page
After sorting the order is 2-3-4-1, which is correct. But right now I get it only this way. What I need is 3-4-2-1... The two entries for apply-templates were used for some conditional choices, but it didn't work out exactly what was expected. The selects are working, but now I need to put them somewhere else to group the nodes.
--

__ .: Radoslaw Loboda :. | Cool stuff !!!
(oo) rl*****@bojko.k rakow.pl | --------------------
/ \/ \ | www.tigerhomes.org
`V__V' | www.suncam.tv

Jul 20 '05 #4
Użytkownik "Dimitre Novatchev" <dn********@yah oo.com> napisał w wiadomości
news:bj******** ****@ID-152440.news.uni-berlin.de...
Your problem is that you are combining several problems in one and are
trying to solve them at once.

This can be solved by addressing each problem individually and then
combining the solutions. Probably a multi-pass solution will be one of the
easiest possible.
And trying to do multi-pass in one XSLT document? Interesting, have some
good/advanced examples?
However, the problem in your code is not at all the sorting.

It seems to me that your date arithmetic is not OK.

In particular:
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
($date - $new_days)]"/>
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]"/>

the above calculation of "new" and "old" links will not work correctly in
most of the cases.


I said it works OK. I know that when I want one month back I have to pass
100 as new_days. I suppose you thought that a bit better would be supplying
a timestamp and playing with it. Anyway, the select staatements could be
used in some other place, but still trying to make up where will they fit...
So, I would recommend that you try to split the task into sub-problems,
which are more realistic and manageable and then you have greater chances to succeed.
The version which I have supplied is indeed a mix of all the separate stuff.
You may find a dates/time library of templates useful. One such library is
the datetime_lib.xs l library, which comes with the XSelerator and can be
downloaded with the trial version of the product.


I might try installing some extensions, but what if I move it to the server
which does not support them? Admins are unlikely to do it for one user and
this site is made for other person. Instead, I am trying to get it work
without any extensions...
--

__ .: Radoslaw Loboda :. | Cool stuff !!!
(oo) rl*****@bojko.k rakow.pl | --------------------
/ \/ \ | www.tigerhomes.org
`V__V' | www.suncam.tv

Jul 20 '05 #5
> > It seems to me that your date arithmetic is not OK.

In particular:
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &gt;=
($date - $new_days)]"/>
<xsl:apply-templates select="current ()[number( concat(
substring(Date, 1,4),substring( Date,6,2),subst ring(Date,9,2) ) ) &lt;
($date - $new_days)]"/>

the above calculation of "new" and "old" links will not work correctly in most of the cases.


I said it works OK. I know that when I want one month back I have to pass
100 as new_days. I suppose you thought that a bit better would be

supplying a timestamp and playing with it. Anyway, the select staatements could be
used in some other place, but still trying to make up where will they fit...

But one month can be 28, 29, 30 or 31 days...

What about going from December to January?
You may find a dates/time library of templates useful. One such library is the datetime_lib.xs l library, which comes with the XSelerator and can be
downloaded with the trial version of the product.


I might try installing some extensions, but what if I move it to the

server which does not support them? Admins are unlikely to do it for one user and
this site is made for other person. Instead, I am trying to get it work
without any extensions...


What I recommended is not extensions -- it is pure XSLT 1.0 and you don't
have to install anything -- just copy this .xsl file in your folder.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

Jul 20 '05 #6
Użytkownik "Dimitre Novatchev" <dn********@yah oo.com> napisał w wiadomości
news:bj******** ****@ID-152440.news.uni-berlin.de...
But one month can be 28, 29, 30 or 31 days...

What about going from December to January?
The year also changes :) Didn't notice? Stripping slashes gives a number
like 20030911.
What I recommended is not extensions -- it is pure XSLT 1.0 and you don't
have to install anything -- just copy this .xsl file in your folder.


I will give it a try tommorow, although current version of PHP DOMXML
(4.3.2rc3) is said to be having problems with including XSLT's inside other
XSLT's ("The method can not perform an XSLT transformation, where an XSL
uses imported XSL")
--

__ .: Radoslaw Loboda :. | Cool stuff !!!
(oo) rl*****@bojko.k rakow.pl | --------------------
/ \/ \ | www.tigerhomes.org
`V__V' | www.suncam.tv

Jul 20 '05 #7

"p0wer" <p0wer@bojko_kr akow_pl> wrote in message
news:3f******** @news.vogel.pl. ..
Użytkownik "Dimitre Novatchev" <dn********@yah oo.com> napisał w wiadomości
news:bj******** ****@ID-152440.news.uni-berlin.de...
But one month can be 28, 29, 30 or 31 days...

What about going from December to January?


The year also changes :) Didn't notice? Stripping slashes gives a number
like 20030911.


Yes, I know this. But how do you add 15 days to 20021217 ?

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #8
Użytkownik "Dimitre Novatchev" <dn********@yah oo.com> napisał w wiadomości
news:bj******** ****@ID-152440.news.uni-berlin.de...
"p0wer" <p0wer@bojko_kr akow_pl> wrote in message
The year also changes :) Didn't notice? Stripping slashes gives a number
like 20030911.


Yes, I know this. But how do you add 15 days to 20021217 ?


The functions you are talking about are quite nice. In fact I was thinking
exactly the same - julian date can be also calculated as integer part of
(timestamp/86400) (I think so...). I wonder how could I use these functions
for every date in each entry... Define a variable inside foreach? Please
help me with this algorithm...
--

__ .: Radoslaw Loboda :. | Cool stuff !!!
(oo) rl*****@bojko.k rakow.pl | --------------------
/ \/ \ | www.tigerhomes.org
`V__V' | www.suncam.tv

Jul 20 '05 #9

"p0wer" <p0wer@bojko_kr akow_pl> wrote in message
news:3f******** @news.vogel.pl. ..
Użytkownik "Dimitre Novatchev" <dn********@yah oo.com> napisał w wiadomości
news:bj******** ****@ID-152440.news.uni-berlin.de...
"p0wer" <p0wer@bojko_kr akow_pl> wrote in message
The year also changes :) Didn't notice? Stripping slashes gives a number like 20030911.
Yes, I know this. But how do you add 15 days to 20021217 ?


The functions you are talking about are quite nice. In fact I was thinking
exactly the same - julian date can be also calculated as integer part of
(timestamp/86400) (I think so...). I wonder how could I use these

functions for every date in each entry... Define a variable inside foreach? Please
help me with this algorithm...

See the code of my Calendar Application, available at:

http://www.topxml.com/code/default.a...20020711152545

This XSLT app displays the quarters, months, weeks, calendar and weekdays of
the current year. Today's date and any date from the Holidays.xml file are
highlighted. Placing the cursor over a specific holiday produces a tip,
describing this event. You can customize it by editing the Holidays.xml file
and specifying your own holidays/events data there.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Jul 20 '05 #10

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

Similar topics

4
2527
by: dont bother | last post by:
This is really driving me crazy. I have a dictionary feature_vectors{}. I try to sort its keys using #apply sorting on feature_vectors sorted_feature_vector=feature_vectors.keys() sorted_feature_vector.sort() #feature_vector.keys()=sorted_feature_vector
0
2724
by: ck388 | last post by:
For some reason when I enable the callback feature of the gridview I still get a page refresh, that is it seems like there is a postback that occurs, not a callback which is just supposed to update not the whole page, but a portion of the page. Strangely enough the URL below http://beta.asp.net/QUICKSTARTV20/aspnet/doc/ctrlref/data/gridview.aspx (VB GridView Paging and Sorting Callbacks example)
7
3255
by: Federico G. Babelis | last post by:
Hi All: I have this line of code, but the syntax check in VB.NET 2003 and also in VB.NET 2005 Beta 2 shows as unknown: Dim local4 As Byte Fixed(local4 = AddressOf dest(offset)) CType(local4, Short) = CType(src, Short)
19
25448
by: Owen T. Soroke | last post by:
Using VB.NET I have a ListView with several columns. Two columns contain integer values, while the remaining contain string values. I am confused as to how I would provide functionality to sort columns based on the column header the user has clicked in both Ascending and Descending formats.
10
2769
by: Sjaakie | last post by:
Hi, I'm, what it turns out to be, fooling around with 3-tier design. At several websites people get really enthusiastic about using custom dataobjects instead of datasets/-tables. While trying to write such layers myself I got stuck on how to get filtered or sorted data from the data-layer. This is what I got: Objects
4
3094
by: Ambica Jain | last post by:
Hi, I want custom sorting on some of the columns in the datagrid. And i am able to do the same by overriding MouseDown event. However, i need to rebind my datatable to reflect the changes in grid. And with rebinding, sorting image (little triangle on the column header) goes away. I need to show sorting image as well custom sorting. Please help. Thanks
7
4811
by: Kamal | last post by:
Hello all, I have a very simple html table with collapsible rows and sorting capabilities. The collapsible row is hidden with css rule (display:none). When one clicks in the left of the expandable row, the hidden row is made visible with css. The problem is when i sort the rows, the hidden rows get sorted as well which i don't want and want to be moved (while sorting) relative to their parent rows. The following is my complete html code...
1
7182
KevinADC
by: KevinADC | last post by:
Introduction In part one we discussed the default sort function. In part two we will discuss more advanced techniques you can use to sort data. Some of the techniques might introduce unfamiliar methods or syntax to a less experienced perl coder. I will post links to online resources you can read if necessary. Experienced perl coders might find nothing new or useful contained in this article. Short Review In part one I showed you some...
5
3177
by: lemlimlee | last post by:
hello, this is the task i need to do: For this task, you are to develop a Java program that allows a user to search or sort an array of numbers using an algorithm that the user chooses. The search algorithms that can be used are Linear Search and Binary Search. The sorting algorithms are bubble, selection and Insertion sort. First, the user is asked whether he/she wants to perform a search option, a sort operation, or exit the program. If...
5
4932
by: jrod11 | last post by:
hi, I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums there are, it crashes. There are currently 6 columns, and I only want 4. How do I remove the last two (discount and date)? Here is a link: http://www.jaredmoore.com/tablesorter/docs/salestable.html Here is some jquery js that I think...
0
8199
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8705
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8638
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8505
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5574
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2626
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
1
1811
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1511
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.