Here in Holland our zip code has this format: "1234 AA". Zip codes are stored in the database as "1234AA" and with the use of a decorator it shows with the space in a view. I have a search field and I want the user to be able to search for "1234 AA" to find zip codes of "1234AA". How can I create a search scope in the model to do this?
In your controller, where you handle the search-related logic, can't you just strip the whitespace ?
Related
,
I read lots of answer here and learn something about this topic but I need more help.Some pages in my project are getting the html(page body) from database.For my controls I use resx files and it works great, but now I need save the html values with multi-lang in my database.
I have a admin panel for my project and I edit sometimes the html or text or pictures in my editor and save it back to DB.I cache the html values in my website and get better performance for my project.But the html text parts is yet in my default lang I will create multi-lang.
I thought of a few possible solutions,
First solution was copying all of the same HTML data and create for all lang one by one
First solution problem : But later this doesnt make sense If I copy the values and create for other lang, then I had be repeating unnecessarily in my database the html values.
My second solution was like this :
this I hid it in the normal way in my DB (only a part of html in one column)
<li>Hello World</li>
<li>Hello Me</li>
Solution :
<li>[HelloWorld]</li>
<li>[HelloMe]</li>
string newHtmlValue = oldValue.ReplaceByLang("[HelloWorld]", GetCulture();,"Hallo Welt");
***// GetCulture(); return for this example german !
I create a new table for the replace text like the key is [HelloWorld]
1(ROW)- [HelloWorld] eng Hello World
2(ROW)- [HelloWorld] german Hallo Welt
3(ROW)- [HelloWorld] fr bonjour tout le monde
and in my project I select the right html value by culture lang.
Now my question is have you any better idea ?
I hope I've been clear and not messy, but if you need more informations I'll be glad to tell you more.Sorry for english.
I would prefer to store all your localized string in single repository like - DB or Satellite assembly.
For Example if you choose DB as repository - Define 3 tables (minimal structure)
1.Locale - Define your locale
2.Resourcemaster - Define your source string and reference Key and this key should be unique in you application and define a standard format like Module_Control_Section ..
3.LocalizedResource - Define your localized sting of Resourcemaster with Locale Key. Foreign key with ResourceMaster and Locale
In front End you can resole any string like control , Html string with localized string and Unique reference key.
Also Implement UI Caching / API caching for better performance.
Regards
Abdul
I am looking to put settings data values like user/password in one file. I seen it before. I need some assistant to do it in VB.NET
Text file would be formatted like bellow:
[TAG]
[USERS]
JOHN DOE,1234,1
JANE DOE,4321,2
[COLOR]
RED,1
WHITE,2
BLUE,3
[/TAG]
How could I read in between these tags in a text file?
My Favorite, aside from writing a custom parser for very easy files, would be to use the Nini library.
In particular, look at this page that shows your exact file type.
Hope that helps!
I've searched the net and can not find simple HTMLAgilityPack example to extract 1 information from webpage. Most of the examples are in C# and code convertors don't work properly. Also developer's forum wasn't helpful.
Anyways, I am trying to extract “Consumer Defensive” string from this URL “http://quotes.morningstar.com/stock/c-company-profile?t=dltr” and this text “Dollar Tree Stores, Inc., operates discount variety stores in United States and Canada. Its stores offer merchandise at fixed price of $1.00 and C$1.25. The company operates stores under the names of Dollar Tree, Deal$, Dollar Tree Canada, etc. “ from same webpage.
Tried code on this link : https://stackoverflow.com/questions/13147749/html-agility-pack-with-vb-net-parsing but GetPageHTML is not declared.
This one is in C# HTML Agility pack - parsing tables
and so on.
Thanks.
The HTML returned from that URL is translated to XML with 2 root nodes, so it can not be transformed directly to an XML document.
For the values you wish to retrieve it may be easier to simply retrieve the HTML document and search for the start and end tags of the strings you wish to extract.
I have already downloaded the jar files to eclipse.
http://opennlp.apache.org/documentation/1.5.3/apidocs/opennlp-tools/index.html
How do I do the following:
1.) Be able to add my own names and tags.
2.) Be able to get the names and tags that were in the dictionary.
3.) Configure between case sensitive and insensitive.
For example, let's say, I add the name "Mike Smith" with name tag "Author".
If I have text that has that name, it should be able to recognize that its there along with the tag.
Please give actual java code!!!
I have asked a very similar question here:
Is it possible to conduct 'Context Analysis' for precise entity extraction with OpenNLP?
general concensus is that its 2 steps, first to identify if your sentence contains Author, the second to find the name.
I too would like to do it in 1 step (where the analysis of the corpus includes the words within itself as a way to determine the context of the name)
I need to search with FTSearch something like this - MS004790(419411/10). But it thorws NotesException: Notes error: Query is not understandable (MS004790(419411/10))
So maybe there is some trick to search strings like that or maybe I need to parse it somehow?
Tnx for help!
TL;DR: Wrap your search in quotes.
Full Text search has two modes. Web Search and Notes Search. In your notes preferences you can set this.
Web search is just like a text search. Notes search attempts to parse the search term.
However the client can fall back to Notes search terms if it sees the first characters are capitals (or capital reserved keywords like "FIELD"). So to prevent it from parsing you need to wrap it in quotes.
For example
(LotusScript)
searchString = |"MS004790(419411/10)"|
(Java)
searchString = "\"MS004790(419411/10)\""
If it is still failing after that, manually try the search in the FT search bar. Once you have that working the code should work the same way.
If it is still failing at that point it may be related to the UNK table. If so see the following:
Lotus Domino: After changing TYPE of a field, Full Text Search won't work for this field