473,765 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

bubble sort!?

So heres the deal...
I work for a company in which numbers are dropping. The owners created
a game where calling potential clients racks up points for crap like
basketball ticekts and such. The owners called upon me to develop a
system where users could enter information to list user name, data
stamp it, and then add form data such as the person they called and if
it was a cold call or not. All that was pretty easy. Oh, by the by, I
had never programmed anything prior to this. I was strictly html. So I
made the game... Users enter data, gets dropped into a csv in our
_private folder. Then I made it so that the data can be read in html
format, simple fso... Well not for me, but I got it to work... So now,
the owner wants this list to be sortable by the last name of the
agent....
This is where I have the problem.
You see, I have a boss, a programmer. He is in Canada where as I am in
California. He is far to busy to assist me, and his teaching methods
consist of telling me one key word, and leaving me to google the hell
out of it. So his key work was bubble sort.
Now I have been playing with this for,,, well over a week now (a few
days past deadline) and I cannot get it to work properly.
I can get bubble sort to work on an array of pre-defined data...
My problem( which I have taken forever to get to, sorry) is that I need
to get it to look at the whole csv, find out where the eof is, then
read up from there...
I have no idea how to do this, and no jedi like mentor to ask
assistance. I ask for help and either get harped at or a "lol"... Its
getting old...

Here is the code for the game
+++++++++++++++ +++++++++++++++ ++++
<script language="vbscr ipt">
sub referrals_oncha nge()
DIM intCounter
for intCounter = 1 to 5
if CInt(document.a ll.item("referr als").value) >= intCounter
then

document.all.it em("referral_"& intCounter).sty le.display="blo ck"
else
document.all.it em("referral_" &
intCounter).sty le.display="non e"
end if
next
end sub
</script>
</head>

<body>
<table border="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111"
id="AutoNumber1 " bgcolor="#C0C0C 0">
<tr>
<td width="100%" colspan="3">
<img src="../images/1newbanner.jpg" width="513" height="57"><fo rm
method="POST" name="FrontPage _Form1" action="--WEBBOT-SELF--"
target="_self">
<!--webbot bot="SaveResult s" u-file="../_private/game.csv"
s-format="TEXT/CSV" s-label-fields="TRUE" b-reverse-chronology="FAL SE"
s-date-format="%d-%m-%Y" s-time-format="%I:%M:% S %p"
s-builtin-fields="Date Time" startspan --><input TYPE="hidden"
NAME="VTI-GROUP" VALUE="0"><!--webbot bot="SaveResult s" endspan
i-checksum="43374 " --><p>
<font face="Arial" size="2" color="#000066" >Welcome
<!--webbot bot="HTMLMarkup " startspan --><span
id="lblCurrentU serName"></span><!--webbot bot="HTMLMarkup " endspan
--></font></p>
<hr>
<p>
<font face="Arial"><f ont size="2" color="#000066" >Please enter
the name of the agent with whom you made contact:<br>
First Name: </font><font color="#000066" >
<!--webbot bot="Validation " s-data-type="String"
b-allow-letters="TRUE" i-maximum-length="15" --><input type="text"
name="agentFnam e" size="20" maxlength="15"> </font><font size="2"
color="#000066" ><br>
Last Name: </font><font color="#000066" >
<!--webbot bot="Validation " s-data-type="String"
b-allow-letters="TRUE" i-maximum-length="20" --><input type="text"
name="agentLnam e" size="20" maxlength="20"> </font></font></p>
<hr>
<p>
<font face="Arial"><f ont size="2" color="#000066" >Please enter
the agents phone number:<br>
</font><font color="#000066" >
<!--webbot bot="Validation " s-data-type="Number"
s-number-separators="x." b-value-required="TRUE" i-minimum-length="10"
i-maximum-length="10" --><input type="text" name="agentNumb er"
size="20" maxlength="10"> </font><font size="2" color="#000066" >
( </font><font size="1" color="#FF0000" >must have 10 digits
</font><font size="2" color="#000066" >
)</font></font></p>
<p>
<font face="Arial"><f ont size="2" color="#000066" >What is the
agents e-mail address:<br>
</font><font color="#000066" >
<input type="text" name="agentEmai l" size="40"></font></font></p>
<p>
<font face="Arial"><f ont size="2" color="#000066" >Please select a
category which best describes the agent with whom you made
contact:<br>
Active Agent </font><font color="#000066" <input type="radio"
value="active" checked name="agentType "></font><font size="2"
color="#000066" >
Inactive Agent </font><font color="#000066" <input type="radio"
name="agentType " value="inactive "></font><font size="2"
color="#000066" >Cold
Call</font><font color="#000066" ><input type="radio"
name="agentType " value="cold"></font></font></p>
<p>
<font face="Arial" color="#000066" size="2">How many referrals
this agent
give you?<br>
<select size="1" name="referrals ">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></font></p>
<p>
&nbsp;</p>
<p>
<input type="text" name="referral_ 1" size="20"
style="display: none"></p>
<p>
<input type="text" name="referral_ 2" size="20"
style="display: none"></p>
<p>
<input type="text" name="referral_ 3" size="20"
style="display: none"></p>
<p>
<input type="text" name="referral_ 4" size="20"
style="display: none"></p>
<p>
<input type="text" name="referral_ 5" size="20"
style="display: none"></p>
<hr>
<p>
<font color="#000066" face="Arial"><i nput type="submit"
value="Submit" name="B1"><inpu t type="reset" value="Reset"
name="B2"></font></p>
<input type="hidden" name="uname" value="hidden">
</form>
</td>
</tr>
</table>

<iframe src="date_user. asp" width="80%" height=100 frameborder=0
scrolling=no name="date_time " styke="display: none">

</iframe>

+++++++++++++++ +++++++++++++++ ++++++++++++
this is the code for data_user.asp
+++++++++++++++ +++++++++++++++ ++++++++++++
<script language="vbscr ipt">

dim txtUserName
txtUserName = "<% = (Session("UserN ame")) %>"

Sub window_onload()
window.parent.d ocument.all.ite m("uname").valu e = txtUserName
window.parent.d ocument.all.ite m("lblCurrentUs erName").InnerT ext =
txtUserName
end sub

</script>

+++++++++++++++ +++++++++++++++ ++++++
this is the admin page i am trying to create
+++++++++++++++ +++++++++++++++ +++++++

<b><font color="#000066" face="Arial">Ma rketing Contest Results
<%
csv_to_read="../_private/game.csv"
set fso = createobject("s cripting.filesy stemobject")
set act = fso.opentextfil e(server.mappat h(csv_to_read))
imported_text = act.readline
imported_text = replace(importe d_text,chr(13), ",")
imported_text = replace(importe d_text,chr(34), "")
split_text=spli t(imported_text ,",")
num_imported=ub ound(split_text )+1
total_imported_ text = act.readall
total_imported_ text = replace(total_i mported_text,ch r(13),",")
total_imported_ text = replace(total_i mported_text,ch r(34),"")
total_split_tex t=split(total_i mported_text,", ")
total_num_impor ted=ubound(tota l_split_text)
%>
</font>
</b>
<table width="100%"bor der="1" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#1 11111" >
<tr>

<%
for table = 0 to num_imported -1
%>

<td width="<% response.write 100/(num_imported) 'make the cell widths
even %>%"bgcolor="#C 0C0C0">
<font face="Arial" size="1" color="#000066" >
<b><%= split_text(coun t) %></b>
&nbsp;</td>
<%
count=count+1
next
%>
</tr>
<tr>
<font face="Arial" size="1" color="#000066" >
<%
'Reset the counter
count=0
for tablea = 0 to (total_num_impo rted/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

<td width="<%= 100/(num_imported) %>%">

<font face="Arial" size="1" color="#000066" >
<%= total_split_tex t(count)
%>

</font>

&nbsp;</td>
<%
count=count+1
next ' end of the observation
%>
</tr>
<% next 'end of the csv %>
</table>
+++++++++++++++ +++++++++++++++ +++++++++++++++ ++++
so there it is...
I no Im lame...
I have no idea how to do any of this, but do not remember it being in
my job description either.
Either way, I have to learn or Im gone...
All advice will be appreciated.
Thanks very much,
- joe

Oct 27 '06 #1
2 2072
jo*******@gmail .com wrote:
...The owners called upon me to develop a system where
users could enter information to list user name, data
stamp it, and then add form data such as the person
they called and if it was a cold call or not...
Joe,

You will probably get a better response if you clean up your post to include
only the relevant portions of your problem. Nobody wants to wade through a
bunch of markup searching for those clues. It is in your interest to show us
the smallest example that illustrates your problem.

That said, I see a bunch of <!--webbot--tags, which suggest Frontpage.
Consider yourself lucky if you can find someone willing to touch THAT.

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Oct 28 '06 #2

<jo*******@gmai l.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.com.. .
So heres the deal...
<snip to the point>
Users enter data, gets dropped into a csv in our
_private folder.
<snip to the point>
the owner wants this list to be sortable by the last name of the
agent....
This is where I have the problem.
<snip to the point>
My problem( which I have taken forever to get to, sorry) is that I need
to get it to look at the whole csv, find out where the eof is, then
read up from there...
I have no idea how to do this, and no jedi like mentor to ask
assistance.
<snip irrelevant frontpage mess>
>
+++++++++++++++ +++++++++++++++ ++++++
this is the admin page i am trying to create
+++++++++++++++ +++++++++++++++ +++++++
<%
csv_to_read="../_private/game.csv"
set fso = createobject("s cripting.filesy stemobject")
set act = fso.opentextfil e(server.mappat h(csv_to_read))
imported_text = act.readline
imported_text = replace(importe d_text,chr(13), ",")
imported_text = replace(importe d_text,chr(34), "")
split_text=spli t(imported_text ,",")
num_imported=ub ound(split_text )+1
total_imported_ text = act.readall
total_imported_ text = replace(total_i mported_text,ch r(13),",")
total_imported_ text = replace(total_i mported_text,ch r(34),"")
total_split_tex t=split(total_i mported_text,", ")
total_num_impor ted=ubound(tota l_split_text)
for table = 0 to num_imported -1
%>

<td>
<%= split_text(coun t) %></td>
<%
count=count+1
next
%>
</tr>
<tr>
<%
'Reset the counter
count=0
for tablea = 0 to (total_num_impo rted/ (num_imported)-1)
%>
<%
for table = 0 to num_imported -1
%>

<td>

<%= total_split_tex t(count)%>
</td>
<%
count=count+1
next ' end of the observation
%>
</tr>
<% next 'end of the csv %>
</table>
+++++++++++++++ +++++++++++++++ +++++++++++++++ ++++
so there it is...
I no Im lame...
I have no idea how to do any of this, but do not remember it being in
my job description either.
Either way, I have to learn or Im gone...
All advice will be appreciated.
Thanks very much,
- joe
Can you provide the structure of your csv file? Eg. Title, Firstname,
Surname etc...
--
Mike Brind
Oct 28 '06 #3

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

Similar topics

13
10956
by: Gram | last post by:
Hello, Can anyone help out with a bubble sort for strings using ASP? I have a text file of words id like to sort and count. Thanks in advance for any help. Gram.
34
7325
by: Mark Kamoski | last post by:
Hi-- Please help. I need a code sample for bubble sort. Thank you. --Mark
4
3677
by: Chris | last post by:
I have a bubble sort for a 2-dimensional array that sorts a string,number pair based on the number. The code for the sort is as follows: Private Sub SortArray(ByRef roundarray(,) As String) Dim i, j, x As Integer x = roundarray.GetUpperBound(0) Dim tempname, tempnumber As String For i = 0 To x - 1 For j = i + 1 To x
0
4438
by: Slowjam | last post by:
How do I correct the program below to search all the anagrams in a given file. First, for each word, build another word (its key) with all its letters sorted. For instance, build "dorw" for "word", or "eelttr" for "letter". Build an array of all the keys, and sort it using a bubble sort. I have to write a modified version of bubble sort that maintains also the array of the primary words. For instance, if I had , our initial array of keys...
1
5661
by: guest | last post by:
I am doing a program for Intro to Computer Programming where we take an array of strings and we must sort them alphabetically. we are supposed to use a bubble sort, but i know the code if meant for integers. How do i get a bubble sort to put names in alphabetical order?
9
19845
by: mosullivan | last post by:
I can't figure out how to print after every pass through the bubble sort. I'm supposed to display the sort after every pass through the loop. Below is what I have so far. #include <stdio.h> #define MAXWORD 101 void swap(int *i, int *j); int main(void) { int sort;
12
8644
by: midknight5 | last post by:
Hello everyone, I am familiar with a normal bubble sort when dealing with an array of number but I am unsure as how to implement a sort when I have an array that is filled with classes which hold multiple values. I need to make a bubble sort that reaches into an array called Tree which has in each storage location a class called Christmas Tree which have the values Species, Height, trunkDiameter, and costPerFoot. The sort will need to sort...
14
8061
by: xtheendx | last post by:
I am writing a gradbook type program. It first allows the user to enter the number of students they want to enter. then allows them to enter the first name, last name, and grade of each student. The program then should sort the names alphabetically by last name and display a list of all the students names and grades in alphabetical order. I have completed all my functions and classes, but i am getting a god aweful amount of errors and i am not...
7
7148
by: mahdiahmadirad | last post by:
Hi dears! I wrote a simple bubble sort algorithm. it works properly when we compare full arrays but i want to sort a 2d array according to a specific part of array. it has some problem to swapping this array. please help me. my scenario: assume that we have a big 2d char array for example students for 20 persons an 30 character for each person. first 15 chars contains first name and the rest is last name. no i want to sort this array...
0
9566
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9393
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
10153
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...
1
9946
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7371
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
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
5413
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2800
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.