I have been beating my head into the desk with this issue, and I don't think it's a simple 'uniq' or 'sort' issue. I have a file, with many duplicate values in them. File ---------- dog dog cat owl owl turkey weasel giraffe giraffe rooster The output I am looking for would only have the following from the above file: Output: ---------- cat turkey weasel rooster Everything I've found so far either removes all the dupes, and keeping one copy of 'owl' or 'dog', which is not what I need. If it's duplicated, I don't want it at all in …

Member Avatar
Member Avatar
+0 forum 4

I have two forms the first one is as follows: ![5364b88b6acff4f96bf8734c448984c4](/attachments/large/4/5364b88b6acff4f96bf8734c448984c4.jpg "5364b88b6acff4f96bf8734c448984c4") In the first one, I enter the customer details and the type of house he wants, and the number of rooms he has, and I have set a session once I hit the next button. This is spanning over two tables(storing the entered info as in client details in one, and ), one table I take a reference id for my session and the customer details, and the other for storing number of rooms. The first form when I enter the number of rooms required, I can get …

Member Avatar
Member Avatar
+0 forum 10

I have these codes for the insertion of data into mysql database in php, unfortunately when I insert the data into the database they are duplicated. Any suggestion on what could be wrong with the codes. <?php // create short variable names $Database=$HTTP_POST_VARS['Database']; $Publication_Date=$HTTP_POST_VARS['Publication_Date']; $Title=$HTTP_POST_VARS['Title']; $Write_Up=$HTTP_POST_VARS['Publication']; if (!$Publication_Date || !$Title || !$Write_Up) { echo '<h4>You have not entered all the required details.<br /></h4>'; echo '<h4>Please go back and try again.</h4>'; exit; } $Publication_Date = addslashes($Publication_Date); $Title = addslashes($Title); $Write_Up = addslashes($Write_Up); include 'dbconnect.inc'; $query = "INSERT INTO $Database (Publication_Date, Title, Write_Up) ". "VALUES ('$Publication_Date', '$Title', '$Write_Up')"; mysql_query($query) or die('Error, query …

Member Avatar
Member Avatar
+0 forum 2

Hi all. my code is below: [code] <script type="text/javascript"> function gu_gid() { var ggid = document.getElementById("gid"); if(ggid.value != "" && ggid.value != "select") { $().ready(function() { $("#autocomplete").autocomplete("test.jsp?gid=" + ggid.value, { max: 50, width: 300, matchContains: true, selectFirst: false }); }); } } </script> . . . <form action="#" autocomplete="on"> <div> <select name="gid" id="gid"> <option value="select">Select</option> <% Class.forName("org.postgresql.Driver"); String url = "jdbc:postgresql://localhost:8080/test"; Connection conn = DriverManager.getConnection(url, "root", "root"); Statement stmt = conn.createStatement(); ResultSet rs = stmt.executeQuery("select gid, sgg_eng_nm from test"); while (rs.next()) { String str = rs.getString("sgg_eng_nm"); int gid = rs.getInt("gid"); %> <option value="<%=gid%>"><%=str%></option> <% } %> </select> </div> <input type="text" …

Member Avatar
Member Avatar
+0 forum 1

Dear All, I am a C code to calculate prices in stock market. I pass a two dimensional array to a function as [CODE] #define DIM 3000 void grid(double tree[][DIM]); int main(){ double tree[DIM][DIM]; grid(tree ); return 0; } void grid(double tree[DIM][DIM]){ /* and do sutff on tree * } [/CODE] Since tree is a large 2D array, 3000*3000, should be afraid about memory duplication when tree[][] is being passed as an argument to function grid(). I actually was afraid of that, and I wrote a reference & to the argument, but the compiler gave an error for that and …

Member Avatar
Member Avatar
+0 forum 13

.the program is running .display the frequency of words and sort them from highest count to lowest. my problem is about the duplication of the counts or value of the words.if the value of the word are same it only display the first word&value ...can some one help here is the program #include <iostream> #include <map> #include <fstream> #include <string> #include <algorithm> #include <vector> #include <utility> #include <iterator> #include <set> using namespace std; struct sortPairSecond { bool operator()(const pair<string, int> &lhs, const pair<string, int> &rhs) { return rhs.second < lhs.second; } }; typedef map<string,int> word_count_list; int main() { word_count_list word_count; …

Member Avatar
Member Avatar
+0 forum 5

The End.