Search by name and number both within in single search bar [closed] - java

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I want to implement a functionality in java where I can search by both by username or by employee number within a single search bar.
I am looking for a simple solution either at client side or at java side
Thanks in advance

Just perform the first search, if it gives a result use it. If not then do the second search.
If usernames must contain alphabetic characters and employee numbers cannot contain them then you could look at the contents of the string and decide which search to run based on that.

Related

Checking if one list contains all elements of another element [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to check if a List of characters like {a,a,d,e} is contained in a list like {a,d,e} in java. I want the answer to be false but I have no idea how to go about doing this. All help would be appreciated :)
Try using the retainAll() method and check for the result. col1.retainAll(col2) leaves all elements in col1 that are also in col2. If the size of col1 is the same before and after the call, the whole col2 is contained.

How can i search for a specific word(Value) in database? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am making an android app , which scans a text and detects if a certain word is abusive. So i want my abusive words to be stored in database (SQLite).
My question is can i check if my text contains a word which is "forbidden". Should i use loop to check if each word of the text is contained in my database ? I need this to be fast.
Any help will be much appriciated.
Thanks in advance!
EDIT
I want the forbidden word to be displayed or stored in Arraylist.
I would suggest you save your scanned word in database, now use Like query to verify any forbidden word exists. If yes then keep that word otherwise delete it straightaway.
SELECT column_word FROM table WHERE id = "your_word_id" AND (column_word LIKE '%word1%'
OR column_word LIKE '%word2%' OR column_word LIKE '%word3%')
If result cursor have more than zero data then it must have forbidden word.

How to Create Strings Programatically in Java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
So I am creating a program that need to create as many strings and integers as the user says. The amount is stored in wordlength, and I need to create these strings programmatically based on the input. Can somebody help me?
First, ask the user to input how many strings to store. This can be done through a Scanner.
Then, make an array of type String with length equal to the user input number.
Then, fill in the array through a Scanner with a for loop.
I hope next time you search about you problem before you write a question about it.

Search or filter JTable on button click [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
How can I perform a search in JTable?
My CSV file contains:
stdid 001
stdname monish
dob 03/5/1789
And similar records for the rest of the file. I am able to bind using CSV Parser and get data into JTable. I want to perform a search on it the table using input from a JTextField. How can I perform this?
You can use a RowFilter/RowSorter. You can read more at Sorting and Filtering from the How to use Tables tutorial.
You can can also see a working example in the question posted here.
The accepted answer also provides a solution for case-insensitive filtering, if you're interested in that functionality

How to categorize a text paragraph into predefined categories? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I have a list of categories like Sports,Game,Religion,Finance,Market Rates,I.T,Health,Adult,Business,B2B, government, politics, education etc..
now I want to categorise a text paragraph into these categories, actually I extract whole text from a particular URL and want to categorize text into my categories, at this time I'm using dbpedia,also I have used many technologies, but unfortunately I'm still not reaching to my aim, can someone help me please...I shall be grateful.
There is an old but very good paper that covers the task of text categorization. It can be very useful for you as an introduction:
Machine Learning in automated Text Categorization, Fabrizio Sebastiani, 2002
http://orb.essex.ac.uk/CE/CE807/Readings/sebastiani02.pdf

Categories