I've been having a tough time trying to figure this one out. Wrote a couple of notes on my phone and ended up with this as a result: import java.io.*; import java.util.Scanner; public class Assignment1 { //Returning if a character is a vowel or not. public static boolean isVowel(char c) { boolean bVowel = false; String temp = (c+"").toLowerCase(); c = temp.charAt(0); /* Switch is checking each char setting the variable bVowel to true or false. After that, the method returns the variable bVowel to the main method. */ switch(c) //Used to check each character within the word to determine …

Member Avatar
Member Avatar
+0 forum 5

Hi All, I have a sql query i am trying to get the count of how rows it returned. select a.field1, b.field2, c.field2 from table1 as a, table2 as b, table2 as c where a.field1=b.field1 Considered the above query return 9 rows. I want to get count of '9' in a mysql query. Please help. Thanks in advance.

Member Avatar
Member Avatar
+0 forum 2

Hello i want to calculate three parameters. one X two X three = Y The one is the value of a <input type="number"> the second is default the value '1' and the third is the count of this $sql = "SELECT uid, username, name, profile_pic FROM users"; $result = mysqli_query($db,$sql) or die(mysql_error()); if(mysqli_num_rows($result)) { echo '<ul class="list">'; while($row = mysqli_fetch_array($result)) { $str = strtolower($row['username']); $user_image=$base_url.$upload_path.$row['profile_pic']; echo '<li><a id="'.$row['uid'].'"><img src="'.$user_image.'" /> '.$str.'</a></li>'; } echo "</ul>"; } any help?

Member Avatar
Member Avatar
+0 forum 33

I want to show the total qty of these query (total qty from datagridview where ActualQty value will update the values of Used Column) `SELECT COUNT(Software) AS ActualQty FROM tblswlogs WHERE Software='MS EXCEL'` and (**Total** will appear in textbox) `SELECT MAX(used + initialqty) As Total FROM tblswlist WHERE Software = 'MS EXCEL'`

Member Avatar
Member Avatar
+0 forum 1

Cell C4 has the expression =565+660+709+1093 Is there a function/nest of functions that can output the number of values being added? BIG NOTE: I AM NOT ASKING FOR THE SUM OF THE EXPRESSION!

Member Avatar
Member Avatar
+0 forum 1

Hi Im having a hardtime making my query work the way it should be.i'm getting wrong output. basically what im trying to do is a simple user statistic that will show the user inputed data and user processed data base on the date range the user selected. heres the screenshots for better visualization ![1.jpg](/attachments/large/3/5d026cec4cbfe61d5bb47291bbbda47f.jpg "align-center") and the query for that is. first Get all the user from the user table `Select Name from user GROUP BY Name ORDER BY Name ASC` then i will loop inside the reservations table for the matching username base on the date range selected select …

Member Avatar
Member Avatar
+0 forum 6

Hello, i was wondering if i could get an opinion on the following code as it is giving me a headache: int counter = 498853097; int k = 0; clock_t start, end; float seconds1,seconds2; start = clock(); for (int i = 0; i < counter; i++) { k++; } end = clock(); seconds2 = (float)(end - start) / CLOCKS_PER_SEC; start = clock(); for (int i = 0; i < counter; i++); end = clock(); seconds1 = (float)(end - start) / CLOCKS_PER_SEC; printf("\n Time 2 [%f] - Time 1 [%f] = %f",seconds2,seconds1,seconds2-seconds1); It's the exact same repetition twice, except one of …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys, I am new to XSLT, looking to solve a problem I am facing in filtering XML records. I need to get both the Input XML record position and limit the output XML to a particular number (based on input provided to xsl:param from .net 1.1) Input XML <Parent> <Child>AAA</Child> <Child>ABA</Child> <Child>DAA</Child> <Child>DBAA</Child> <Child>BZA</Child> </Parent> Output XML(Required) <table> <tr> <td id="Row{Position of the record in Input XML}> node value </td> </tr> </table> Eg: SearchParam='D' and Output Limit=1 if I am searching for one text starting with 'D', the output should be <table> <tr> <td id="Row3>DAA</td> </tr> </table> I am …

Member Avatar
Member Avatar
+0 forum 2

Good day everyone! I have the codes for such a problem where, to create a program that counts how many times the second string appears on the first string. Here it is: #include <iostream> #include <conio.h> using namespace std; int main () { char first [100], second; int count; cout <<"Enter 1st String: "; cin.get (first, 100); cout <<"Enter 2nd String: "; cin >> second; for (int i = 0; i < strlen (first); i++) { if (tolower(first[i]) == tolower(second)) { count++; } } cout << "THE STRING " << "'" << second << "'" << " appeared " << …

Member Avatar
Member Avatar
+0 forum 8

I have a program that creates a right triangle from a loop reading "*". I have used the code to complete the first part, but the second part calls for a manipulation to take the current pattern, flip it upside down, and then add it to the first pattern. Here is the code I have so far. Can anyone guide me through how to do the reverse loop, I was thinking another loop and a nested loop within to call the opposite pattern? public static void main (String[] args) { final int LIMIT = 10; for (int row = 1; …

Member Avatar
Member Avatar
+0 forum 15

Is there a way to get a total counts from the resultset of two unions? This will be for DB2. select count(*) from ( select count(*) from xyz where abc='1' union all select count(*) from x1y1z1 where abc='1' )

Member Avatar
Member Avatar
+0 forum 2

I am needing to write a program for someone that needs it to count by any number they manually enter into the program. I have the menu code written and now just need help with the counnting code. I know i most likely need to use a "for" loop but after that i am not sure.

Member Avatar
Member Avatar
+0 forum 5

Create a form that accepts scores from the user, displays the total, count, and average of the scores, and displays a dialog box that lists the scores.This application should check the number entered by the user to make sure it is a valid integer from 0 to 100. If a value is entered outside this range, the score does not count (and should not be included in the score total, score count, or average). Here's What I have: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Text.RegularExpressions; namespace Scores { public …

Member Avatar
Member Avatar
+0 forum 6

Hi. i am trying to show a hidden element using a button. but i want to make it so that everytime the button is clicked the hidden element get shown that same amount as button clicked. example: <input type="button" value="Click me" id="clickme"> <input type="text" id="textbox"> <script> $(document).ready(function() { var element = $("#textbox").hide(); var count = 0; $("#clickme").on("click", function() { count++;//count button clicked var elem = element.clone(); //then the element will be cloned same amount as button click, stuck here }); }); </script> well I'm stuck there. is the approach wrong? do i use a loop or something? TIA

Member Avatar
Member Avatar
+0 forum 2

Hi, I want to Count the number of occurences of data in a table, then multiply it in a value from other table, After that I want to sum up the product of count and the value from other table, As of now, I cant count and then multiple but I cant Sum them Up. This is my SQL code: SELECT orderline.product_id, COUNT(orderline.product_id) AS counted, products.orig_price, (COUNT(orderline.product_id)*products.orig_price) AS product FROM orderline INNER JOIN products ON products.product_id = orderline.product_id GROUP BY orderline.product_id This will return: product_id | counted | orig_price | product| 1 | 4 | 2 | 8 | 2 …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have 3 tables Description, Item, Transaction Description Item Transaction DeID Name IID Name DeID TranNo Type IID Date 1 Printer 1 Stylus T10 1 1 Repair 1 2 Monitor 2 HP 1 2 Repair 3 3 ViewSonic 2 I need to count how many printers, Monitors etc. are in Item and how many are under repair eg. there are 2 printers in item, and 1 under repair output should be: Description count under repair Printer 2 1 Monitor 1 1 Im using vb.net 2010 and sql server 2008 r2 as much as possible not using stored proc Thanks …

Member Avatar
Member Avatar
+0 forum 2

Hi Friends! If I have number of arrays with fixed size (15), it consist of zeros and non-zeros. eg: array1[15]={5,5,0,0,4,4,4,0,0,0,1,0,0,0,3} array2[15]={1,0,0,0,0,7,7,0,0,3,0,0,0,0,2} array3[15]={6,6,6,0,8,8,8,0,0,0,3,3,0,0,4} ........... How can I count the common zero sequences and there indexes of arrays? sample output for the above arrays: Index Nim_of_zeros 3 1 7 2 12 2 Can any one help me to write a program for the above problem?

Member Avatar
Member Avatar
+0 forum 15

Hello, I have a number of long text files, they took from windows system with specific encoding (windows-1256). Can I count the all different number of words in theses files using Ubuntu commands? For example: If I have three text files contain respectively -Hi, hello. -Hello all. -Good people in all time. The output should be: 7. Thank you

Member Avatar
Member Avatar
+0 forum 5

Friends please help me... I have Three text boxes 1.Bank 2.Acno 3.Name I am selecting record from database where Bank and Acno are =(txtbank.text and txtacno.text) If any record found, the focus should go to the third textbox-'Name' else message "Record not found" should be displayed.I tried the following code but no success. CN.Open() SQL = "SELECT * from Receipts WHERE Bank='" & TxtBank.Text & "'" & "AND Acno='" & TxtAcno.Text & "'" DA = New OleDb.OleDbDataAdapter(SQL, CN) DA.Fill(DS, "Deposit") If DS.Tables(0).Rows.Count = 0 Then MsgBox("No Such Account") Else TxtName.Focus() End If

Member Avatar
Member Avatar
+0 forum 7

Hi I'm creating a website that uses a count query, to see how many things in the database match a variable. Table eg: Whats Liked User Liked By potatoes djiajgi computer djiajgi ......... Now, I'm trying to see people who like the same thing as you do, and am ordering them by the amount of things you have in common. Lets say you like potatoes and computers as well. It will display djiajgi, djiagi two times. I'd like it to appear only once like here http://sqlfiddle.com/#!2/b6f78/8 How would I go about doing this, so if I like computer and potatoes, …

Member Avatar
Member Avatar
+0 forum 1

Hi, i'm trying to select two values from my database. $nc ='North Carolina'; $t ='Hello'; $q = 'SELECT COUNT(state, title) AS c FROM all WHERE state = "' . mysql_real_escape_string($nc) . '" AND title = "' . mysql_real_escape_string($t) . '"'; $rq = mysql_query($q); $fetch = mysql_fetch_assoc($rq); $count = $fetch['c']; echo = "$count"; I need it so it will only echo out the number of posts from North Carolona and with the title Hello. It doesn't echo out nothing.

Member Avatar
Member Avatar
+0 forum 3

I am trying to get a total of all the records for playerid from table1, table2 and table3 by playername. There are 4 tables, table-1, table-2, table-3, and players. I am not great with queries and I expect somebody here can instantly see where I am going wrong. This is what I have: SELECT `table-1`.playerid AS playerid1, COUNT(*) AS count, `table-2`.playerid AS playerid2, COUNT(*) AS count, `table-3`.playerid AS playerid3, COUNT(*) AS count, FROM `players` INNER JOIN `table-1` ON `table-1`.playerid = `players`.playerid INNER JOIN `table-2` ON `table-2`.playerid = `players`.playerid INNER JOIN `table-3` ON `table-3`.playerid = `players`.playerid WHERE `players`.playername = 'Player1' Can …

Member Avatar
Member Avatar
+0 forum 3

Im having a problem with this. I want to echo out the number of post from every city in N.C Example: Wilmington (24) <--*24 is the number of post. Charlotte (35) Raleigh (15) include "connect.php"; $wil ='Wilmington'; $cnt = mysql_num_rows(mysql_query("SELECT add_city FROM dbAdd WHERE $add_city='$wil' ")); echo $cnt; This is the database. CREATE TABLE `dbAdd` ( `id` BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY , `add_user` TEXT NOT NULL , `add_city` VARCHAR( 100 ) NOT NULL ) ENGINE = MYISAM ;

Member Avatar
Member Avatar
+0 forum 4

Hi guys, Im currently working on a java project but ive come across a small minor problem. I have 4 main classes that im working with. TextReader, WordCount, WordCollecter and DisplayWords. The **TextReader** class reads an input file and a method called *readNextWord* will return the next word from the input file. The **WordCount** class provides a way of keeping track of the frequency of a particular word from the input text. The **WordCollector** class will use the **TextReader** to read in the set of words contained in the input text. The **DisplayWords** which will display the words on the …

Member Avatar
Member Avatar
+0 forum 14

I have a query that starts like this... SELECT COUNT(A.FISH), COUNT(B.MEAT), COUNT(C.FRUIT).... now my problem is this, how could I count when I need to consider an expiration date for each column,...and the expiration dates varies for each column... Can I do this in one query? Or is there any other way I can do to consider the dates for each column?????..... Need clarification here... Thank you in advance....

Member Avatar
Member Avatar
+0 forum 2

[CODE] SELECT count(*) FROM information_schema.`COLUMNS` C WHERE table_name = 'your_table_name' AND TABLE_SCHEMA = "your_db_name" [/CODE] TABLE_SCHEMA is required only if table name exists in more than one db

Member Avatar
Member Avatar
+0 forum 3

1) onkeyup send textarea values to script 2) converts textarea value to array 3) loops thru the array 4) uses regex to check if its an email address 5) changes inner html of recipient div

Member Avatar
Member Avatar
+1 forum 3

Hi I'm a newbie in SQL and for scores whose credit is greater than 2, I want to select students with scores of 10 or more .Here is what I wrote and Im having errors(See table below): SELECT Student,COUNT(Score)>=10 AS NumPasses WHERE Credit>2 GROUP BY Student Student Credit Score Tomy 3 11 Tomy 3 8 Tomy 2 13 Tomy 3 14 Dick 3 8 Dick 3 14 Dick 2 12 Dick 3 7 Hary 3 8 Hary 3 7 Hary 2 11 Hary 3 9 I want the query results to be as below Student NumberOfPasses Tomy 2 Dick 1 …

Member Avatar
Member Avatar
+0 forum 12

What is the step count for this in terms of n ? SequentialSearch(a,x,n) { i=n; a [0]=x; while(a [i]!= x) do i = i-1 return i }

Member Avatar
Member Avatar
+0 forum 1

I have a CTE based query, to which I pass about 2600 4-tuple latitude/longitude values using joins - these latitude longitude 4-tuples have been ID tagged and held in a second table called coordinates. These top left and bottom right latitude / longitude values are passed into the CTE in order to display the amount of requests (hourly) made within those coordinates for given two timestamps).- I am able to get the total requests per day within the timestamps given, that is, the total count of user requests on every specified day. (E.g. user opts to see every Wednesday or …

Member Avatar
Member Avatar
+0 forum 1

The End.