I am trying to get character matching when comparing two strings. The result would display the two words side by side with the matching (and non-matching) characters displayed. This would be similar to mastermind. Example: (test word) - HALE (sample word) - HELP This would be displayed as: H?L? HELP and with each subsequent test word, it would update for matches: H?L? HELP HEL? HELP HELP HELP The code would register each test and display success or failure at the end of the line. I can do that part and even compare the two words. I just need to get …

Member Avatar
Member Avatar
+0 forum 5

I'm trying to create a program, where a user can use the textbox to search for information, and as soon the user begins to type, any matching results will show autofill. I was able to do that, but I also want to make partial word match: words are found that only match partially (Example search: "apple" also finds "pineapple"). Could some one help me in achieveing this? This is what I have so far: Public Class Form1 'Declaration Public Property AutoCompleteMode As AutoCompleteMode Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Create the list to …

Member Avatar
Member Avatar
+0 forum 48

I have the folowing code, but there is a compiling error of: MathProblemRevised.java:25: error: cannot find symbol if (inputCharacter.equals("Y")) { ^ symbol: variable inputCharacter location: class MathProblemRevised 1 error With the code: import static java.lang.System.*; import java.util.Scanner; class MathProblemRevised { public static void main(String args[]) { Scanner keybardInput = new Scanner(System.in); Scanner keybardInput2 = new Scanner(System.in); System.out.println(" What is 5 + 12?"); System.out.print(" "); double inputNumber = keybardInput.nextDouble(); System.out.println(); if (inputNumber == 17){ System.out.println(" You are correct!"); } if (inputNumber != 17){ System.out.println(" You are incorrect!"); System.out.println(" Do you want to give it another try? Y/N"); //String inputCharacter; System.out.print(" "); …

Member Avatar
Member Avatar
+0 forum 11

How I can passing quantifier as variable in this regexp `str.match(/^(\-)?\d+( (\-)?\d+){3}$/)`

Member Avatar
Member Avatar
+0 forum 4

i want to upload the attendance of students i am able to upload a xlsx file and transfer its data to tbl_temp now i have two tables tbl_s_attendance EP_Number Attendance course_id class_id 105078 105076 105075 105077 105079 tbl_Temp EP_Number Attendance 105075 P 105076 P 105077 P 105078 A 105079 A now i have to put attendance from tbl_temp to tbl_s_attendance according to ep number and il get the values of course_id and class_id from dropdown list of my aspx page

Member Avatar
Member Avatar
+0 forum 4

Hi All, I am uisng Mysql DB and i have a task for suggesting Categories based on User keyword input. I have written the query as below but i need to ignore white spaces while matching, how can we achieve it SELECT search.*, MATCH (name) AGAINST ('black' IN BOOLEAN MODE) AS name_match, MATCH (keywords) AGAINST ('black' IN BOOLEAN MODE) AS keyword_match, MATCH (description) AGAINST ('black' IN BOOLEAN MODE) AS description_match FROM search WHERE MATCH (name, keywords, description) AGAINST ('black' IN BOOLEAN MODE) ORDER BY (name_match * 3 + keyword_match * 2 + description_match) DESC LIMIT 0,100; I tried using replace() …

Member Avatar
Member Avatar
+0 forum 3

I'm having trouble with a query. Here's my code. ---------------------------------------------- `"SELECT *` `FROM listings` `WHERE MATCH(title)` `AGAINST('ipod' IN BOOLEAN MODE)` `ORDER` `BY relevance DESC"` ---------------------------------------------- And I get this error: > Unknown column 'relevance' in 'order clause'

Member Avatar
Member Avatar
+0 forum 3

hi (1) e.x: arr1 ["aa.wav","bb.flv","cc.mp3"]; arr2 ["http://www.page.com/q.html","http://www.afaq.com/vb/showthread.php?t=77","http://www.daniweb.com/web-development/javascript-dhtml-ajax"]; if x[i] == any element (arr2) >>> do <iframe......> how to check if x[i] matches any element in arr2 ? (2) what is the best way to learn "javascript, ajax, dhtml, jquery" in the net ? thanks

Member Avatar
Member Avatar
+0 forum 4

Hi every one!! I need help to match user data from database inorder to log in to admin panel. Here is what I am trying. it works ok but it is giving dialog box containing text "Sorry! You have no access to Database" here is the code. Please help String user = jTextField1.getText(); String pwd = new String(jPasswordField1.getPassword()); while (rs.next()) { String uname = rs.getString("User name"); //Username is the coloumn name in the database table String password = rs.getString("Password"); if ((user.equals(uname)) && (pwd.equals(password))) { admin_panel p = new admin_panel(); p.setVisible(true); } else if ((!user.equals(uname)) && (!pwd.equals(password))) { // System.out.println("Sorry! You …

Member Avatar
Member Avatar
+0 forum 5

I have a small database of about 30 names that are all unique. The variable $member equals "Ann" but will change depending on the person to search for. I need to be able to return the exact match of the person's first name. I have tried many combinations of the Where clause but I cannot get it to return "Ann" instead of "Anna" since Anna is in the table before Ann. This returns "Anna" instead of "Ann": $query = "SELECT * FROM board_members where FirstName like '%$member%'"; These returns nothing: $query = "SELECT * FROM board_members where FirstName = '$member'"; …

Member Avatar
Member Avatar
+0 forum 8

I have this Regular Expression in C#: Regex myRegex = new Regex(@"^[a-zA-Z]{1}\s(! | && | \|\| | -> | <->){1}\s[a-zA-Z]{1}$"); if (myRegex.IsMatch(expression)) { validated = true; } else { validated = false; } and I would like to match the following types of Strings: A && B A -> B A || B The Problem is it is evaluating to false. Any Insight on why it is failing and how it can be corrected will be highly apreciated. :)

Member Avatar
Member Avatar
+0 forum 1

Hi i was just wondering how i would do this task. It seems fairly simple but i dont no how to to do it. In my system i have a table where i have a total figure of the stock. what i am trying to do is when my saler order takes 5 i want it to project this in my overal amount. How would i do this. I am not asking for codes just a method of doing it Thank you

Member Avatar
Member Avatar
+0 forum 7

Firstly I will say im a complete and total novice when it comes to XSLT and XML so this could be a very obvious mistake on my behalf. [CODE] <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="node()"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="TestNode"> <RenamedNode> <xsl:copy-of select="."/> </RenamedNode> </xsl:template> </xsl:stylesheet> [/CODE] When running the above, even though <TestNode> exists it does not match and rename the node and I cannot figure out why :/ Is anyone able to shed some light on why this is the case? Thanks in advance

Member Avatar
Member Avatar
+0 forum 4

Hi, i am making a heap sort program using a struct known as Date, anyhow i am getting an error in two lines that i cant figure out how to solve...[CODE]void dahHeap(Date a[], int i){ int n = sizeof(a); int lefty = 2 * i; int righty = 2 * i + 1; int max = 0; if (lefty <= n && a[lefty] > a[i]) //error max = lefty; else max = i; if ((righty <= n) && (a[righty] > a[max])) //error max = righty; if (max != 1){ Date temp = a[i]; a[i] = a[max]; a[max] = temp; dahHeap …

Member Avatar
Member Avatar
+0 forum 2

I've just kind of gotten bored reading over learncpp.com repeatedly, so i decided to attempt to make a couple small programs for my own enjoyment ( and to really test what I'm capable of ). I have been making this little game that I call Implicit Explicit. It's basically the same thing as Cows and Bulls. I have a couple questions commented in the code below. Please help? [CODE]#include <iostream> int Random ( int x ) { // this is completely random.. I don't know how else to do it. x = x * 97; x = x - 24; …

Member Avatar
Member Avatar
+0 forum 4

Hi, A quick question - i have a string containing text like this: [CODE] \\u003cspan class=\\\"someClass\\\">Some text\\u003c\\\/span> [/CODE] How do i get that "Some text" value into an array? I tried [CODE] preg_match_all("/\\\\u003cspan class=\\\\\\\"someClass\\\\\\\">(.*?)\\\\u003c\\\\\\/span>/",$str,$res); [/CODE] Returns nothing. I think there's something wrong with the regex pattern. Maybe anyone can correct me? Thanks

Member Avatar
Member Avatar
+0 forum 1

Hi, I'm trying to add a condition to my htaccess file but it seems to only match if I use [ICODE]%{REQUEST_URI} !^/?.+$[/ICODE]. If however I add [ICODE]%{REQUEST_URI} !^/?B.+$[/ICODE] it will never match. Also the full code showing what I am trying to achieve is as follows: [CODE][B]RewriteEngine On[/B] [B]RewriteRule[/B] ^$ /wiki/index.php [L,QSA] [B]rewriteCond[/B] %{REQUEST_URI} !^/?Botindex/[^/]+/.+$ [NC] [B]RewriteRule[/B] ^([^/]+)$ /wiki/index.php?title=$1 [L][/CODE] Does anybody know why the rewrite condition just won't match on some of the simplest syntaxes. This is really bugging me. Thanks.

Member Avatar
Member Avatar
+0 forum 8

I am trying to move a match from a match collection to another listbox as string. here is my regex code [CODE]Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://localhost/pos/leftpanel.html") Dim response As System.Net.HttpWebResponse = request.GetResponse Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream()) Dim rssourcecode As String = sr.ReadToEnd Dim r As New System.Text.RegularExpressions.Regex("http://localhost/booksmodule/ListContent.php?case=.*&funcfor=.*&funcmod=.*&catid=LM3334443&refid=.*&ccshowid=.*") Dim matches As MatchCollection = r.Matches(rssourcecode) For Each itemcode As Match In matches ListBox1.Items.Add(itemcode) Next[/CODE] I want to copy the listbox1 items that are added as match to another listbox which is listbox2 as string instead of match

Member Avatar
Member Avatar
+1 forum 1

Hi, i want some help on my VB game (school project). My vb is 6.0 and i want do match image. i want do 6 random pictures, if you can help me, tanks

Member Avatar
Member Avatar
+0 forum 6

hi, so i've been looking for a string matching algorithm that gives me a "rating" based on how close the 2 strings match.. luckily, i googled and read this article: [URL="http://www.catalysoft.com/articles/strikeamatch.html"]how to strike a match[/URL] here's the original java class code [CODE=java] package strike_a_match; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class LetterPairSimilarity { /** @return lexical similarity value in the range [0,1] */ public static double compareStrings(String str1, String str2) { ArrayList <String> pairs1 = wordLetterPairs(str1.toUpperCase()); ArrayList <String> pairs2 = wordLetterPairs(str2.toUpperCase()); int intersection = 0; int union = pairs1.size() + pairs2.size(); for (int i=0; i<pairs1.size(); i++) { …

Member Avatar
Member Avatar
+0 forum 2

Hi Folks, I'm a noob but I'm slowly getting addicted to python. I've been hitting a wall for about 4 hours trying various things to no avail. It looks to me like it should work and runs without error but.... I expect the blockcount counter to be high (but it's 1) I expect the accountmatchcounter to be low but it's 131 (looks like they are wrongly placed from the results but I can't see the error in the logic.) Hopefully one of you chaps will be able to have a giggle and set me straight in one minute. (any more …

Member Avatar
Member Avatar
+0 forum 4

Hello, First I would like to say thank you for looking and any help will be greatly appreciated. I am trying to write a code which does the following: 1) Read a file (The file contains list of words) 2) The purpose of the program to ask the user to enter any number of letters; these letters will then be used to find all words that contain them in the input file. First output the words with most letters in them and going all the way down to words that only contain 2. For example: Input file has the following: …

Member Avatar
Member Avatar
+0 forum 1

Hello to everybody I have a problem with a MYSQL query and I almost got it but am stuck for a while now. I would appreciate if anyone could help me or point me in the right direction. I have 3 tables: [icode][B]t1 (products)[/B] id | name ---+------- 1 | john 2 | mark 3 | peter 4 | tom 5 | tracy 6 | fillip [B]t2 (categories)[/B] id | t1_id | cat_id ---+-------+-------- 1 | 1 | 70 2 | 2 | 70 3 | 5 | 70 4 | 5 | 80 5 | 6 | 70 6 …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have the following files and can match but, am having trouble with getting the output to write correctly to a data matrix format that I need and would appreciate any help with getting the code right. File 1 has a list of numbers and Files 2, 3 and 4 have subsets of these numbers along with a column 2 of data. I need to match all the subsets in cols 1 to File 1 and then output a data matrix (file output). see below for file details. File 1: 1000018 10004 1000422 1000428 1000540 1000545 1000548 1000551 1000635 …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone and thank you for helping me... again :icon_neutral: I am trying to perform a MATCH AGAINST sql query on one of my table called "what". [ICODE]id (int 11) PRIMARY org-id (int 11) keyword (varchar 100) FULLTEXT bid (DECIMAL 4,2)[/ICODE] I want to perform a search on the column 'keyword' with a keyword ($keyword) and order the - distinct - results with respect to the column 'bid'. Right now I am using: [ICODE]SELECT DISTINCT `org-id` FROM `what` WHERE MATCH(keyword) AGAINST ('".$keyword."') ORDER BY `bid` DESC[/ICODE] I don't get any error message but I don't get any results neither. I …

Member Avatar
Member Avatar
+0 forum 1

Good afternoon Daniweb, I have a simple (and probably idiotic) problem today, I have a simplistic program that simulates a Train station, trains come in, they go into a stationDock and come out after a while. The stationDocks are an array of trains, either pointing to a train or being NULL (at least that's what it should be, I probly did an error somewhere in the implementation) WideVar.cpp: In static member function ‘static void wideVar::freeDock(int)’: WideVar.cpp:67: error: no match for ‘operator=’ in ‘*(((Train*)(((unsigned int)i) * 36u)) + wideVar::stationDocks) = 0’ Train.h:7: note: candidates are: Train& Train::operator=(const Train&) WideVar.cpp: In static …

Member Avatar
Member Avatar
+0 forum 2

Hi all I need a javascript code that removes all the title="*" attributes in a page, where the star (*) represents a wildcard for the content of the title attribute. So the following would occur: <a href="#" title="test">test</a> would be replaced with <a href="#">test</a> just like: <a href="#" title="">test</a> would be replaced with: <a href="#">Test</a> I know there is a function in javascript called match, but i have no idea how to write the reg expression that would work like the above example. thanks in advance!!

Member Avatar
Member Avatar
+0 forum 3

#include "include.h" #include "extern.h" int ExternalIP(SOCKET Sock, char *szChannel) { DWORD dwRet = 0; HANDLE hHandle; char szIP[16] = {0}; char szTempPath[MAX_PATH] = {0}; char szTempFile[MAX_PATH] = {0}; char szSendBuffer[512] = {0}; if (!szChannel) return false; GetTempPath(sizeof(szTempPath) - 1, szTempPath); GetTempFileName(szTempPath, "Temp", 0, szTempFile); // if (URLDownloadToFile(NULL, "http://www.whatismyip.org", szTempFile, 0, NULL) == S_OK) if (NULL, "http://www.whatismyip.org", szTempFile, 0, NULL) { hHandle = CreateFile(szTempFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (hHandle != INVALID_HANDLE_VALUE) { ReadFile(hHandle, szIP, sizeof(szIP) - 1, &dwRet, NULL); (szSendBuffer, sizeof(szSendBuffer) - 1, "Main-> External IP: %s", szIP); /* IrcMsg(Sock, "PRIVMSG", szChannel, szSendBuffer); irc_privmsg(Target, "Main-> External IP: %s", …

Member Avatar
Member Avatar
+0 forum 2

The End.