Applying A Rule Set To Different Lines Of Text?
Apr 27, 2012
The general purpose of my application simply reads a line of text for example:
1. I have a printer issue
2. I have a software issue
I have a rule set as follows:
'Define the class 'Printer' with 14 values as a string...
Dim Printer(13) As String
'The string 'Printer' gets assigned a value, this is repeated another 13 times...
Printer(0) = "Printing"
[code]....
The code simply uses a number of keywords to detect if the issue is a 'printer', 'software', 'telephone',. or 'password' problem.I want to apply this rule set to 10 issues within the same rich text box, with the results sent to a text file. The exporting to a text file I can do, however the main issue is, i cannot read the lines individually.
View 5 Replies
ADVERTISEMENT
Apr 6, 2011
I have a very simple Business Rules Engine that has only three methods. One gets all the rules for the current operation, one will retrieve a list of parameters for the rules, the last applies the rules. The rules are stored in the database as user defined functions using parameters. The client will call the BRE pass in the operation and a Lot Number and the BRE checks for any rules that apply to this operation for this Lot. The client gets a list of rules that apply (the names of the corresponding UDF's in the database) and at which step in the operation the rule applies. When the material gets to a step that has a rule, it calls BRE to get parameters for the UDF for that operation, fills in the parameters with data contained in the GUI and calls the BRE to apply the rule with this lot's specific data. Multiple lots can share the same rule that is why there are parameters for the UDF. This all works well. However, this is assuming we have a set number of rules for each lot at each operation. If the lot needs a new rule applied at this operation we have to add a new rule and corresponding UDF into the BRE database. This is not a problem, the client will now see two rules, however, it only knows how to apply the parameters for the first rule, and there is no code for applying the parameters for the second rule.
For example: Rule 1 states that only the same Lot number items can be put into a carton. So the UDF expects one parameter called LotID and one parameter called Carton ID. It runs the rule (UDF) with these parameters and checks to ensure the lots match. Now the Lot requires a second rule: Only 25 items can be packed in the carton. We create a new rule and corresponding UDF, but this rule has the CartonID and a quantity associated with it.
The GUI can handle Rule 1 because it knows how to apply the correct data from the GUI to the parameters for the Rule and execute the rule, so LotID from the GUI = LotID in the parameter name in the UDF and CartonID from the GUI = CartonID parameter name in the UDF. Now there is a new rule, the GUI sees this new rule, gets the parameters, but has no way to applying the quantity to the new parameter to execute the rule without having to change the GUI. We don't expect there to be many rule changes, however, when they do occur we don't want to have to recompile the GUI every time. Does anyone have any suggestions on how to create a class that could determine the how to apply set the correct parameters? We have thought about a table in a database that maps the parameter names in the UDF with parameter names in the GUI so when we add a new UDF we update the table with the corresponding data from the GUI. That could work but may get cumbersome and would require us to make sure that, that table is kept current. Another suggestion was to name the parameters in the UDF the same as the parameters in the GUI, but this too, would require us to maintain the names in two locations.
View 5 Replies
Oct 12, 2009
Okay in my program I have users select options and then it writes text to a file. When the user restarts the program, I want it to read from the file and search for specific text like "User is a senior,False." At this point if the file has this text, I would like the program to read from a line in the program.
View 3 Replies
Feb 15, 2012
I'm adding a textbox to my grid as follows and formating it as a date.But reagrdless it doesn't seem to want to format it as a date.Further how would I prevent, for just a single column, the user from entering anything but numbers and "/"'s?[code]
View 5 Replies
Jun 22, 2010
I have written a simple script to get a bunch of lines from a text file (they will be filenames eventually) which are split by new lines and puts each one into an array..
Dim ary() As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If My.Computer.FileSystem.FileExists("C:MenuFiles.txt") Then
[code]....
The only thing I can do for now is either use the substring function to remove the first character from all array values after 0 but I don't like that because it's messy and what if the split "works" as I want it to one one of the lines and knocks of the first character when I don't want it to.
View 1 Replies
Sep 15, 2009
I have a text file containing lines of data (File 1). I need to delete all the lines in another text file (File 2), which are found in file 1.So I could read file 2 line by line. And then once the line has been read, read file 1 line by line to search for a match. But that's going to be painfully slow.Or I could read file 2 into memory. And then read file 1 line by line and REPLACE the lines in file 2 with nothing, therefore deleting them. File 2 could be 100 mb, so I'm not sure about reading it all into memory.
View 16 Replies
Feb 5, 2011
I have an SQL database, and 50 text files, and Visual Basic 2010 Premimum,I need to find a specific line of text in the text files and then take the next 37 lines of text and save them in my database. I need advice as to point me in the right direction
View 2 Replies
May 5, 2012
I'm trying to write a rule to compensate for laziness caused by program changes. Used to be, case numbers for family law cases where I work were written as follows: 12-DR-012345. Now, you can get away with 12DR12345, and the file management program accepts it.
View 1 Replies
Apr 13, 2010
I'm trying to merge two datasets based on these rules:
1. With ds1 and ds2, If the Unique Key from ds1 is not found in ds2, copy it to ds2 and move to next row in the table, else, goto the next part
2. If the unique key in ds2 is found in ds1, check the DateLastEdited row.
a. If DateLastEdited in ds2 is greater then in ds1, copy the row from ds2 to ds1, else , do nothing
I'm just having trouble with the loops. Here's what I have:
Dim ds1 As DataSet = fillNetwork() 'this function fills ds1 with the dataset from a table found on a network
Dim ds2 As DataSet = fillLocal() 'this function fills ds1 with the dataset from a table found on local drive
Dim returnRows() As System.Data.DataRow = Nothing
For Each dtDs1 In ds1.Tables
[Code] .....
This bit of code is just trying to segregate the one that are in both tables from the ones that are just in one table.
View 6 Replies
Oct 15, 2008
I have code to show I tried to do it on my own, to boot!
Private Sub OpenPetProfileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenPetProfileToolStripMenuItem.Click
Dim AllText As String = "", LineOfText As String = ""
[Code].....
This save command works perfectly except for the lstshowresults, which I'm having issues getting to appear in the print line bit, but that's for another time.
View 1 Replies
Apr 25, 2012
I'm using ASP.NET 4 / VB.NET / IIS to build a web application. Folks will access the web application via a URL like so: [URL] So, for example, here is the urls for Jane Doe, John Doe, and James Doe respectively: [URL] I need to somehow pass them off (no matter what name is entered) to a default.aspx page which then pulls in the name portion of the url and uses it to perform a lookup against the database which contains info. about this particular person and displays a personalized page based on that information.
[Code]...
View 1 Replies
Mar 5, 2011
Let's say I have a rtb with a few lines.
line1: (empty)
line2: (empty)
Line3: "blablablablabla"
Line4: ..... etc
How do I get/read the first, only the first line? ("blablablabla")
View 9 Replies
Mar 30, 2011
I have a simple business rules engine that I need to write. I have looked at both Biztalk and Windows Workflow, but they are to much for what we need to do. This is a process that material will come to an operation, the GUI will check for three rules, one for the operation, one for the steps in the operation, and one for the item coming into the operation. These are the only three checks that will be done. It is possible there will be more than one rule for each check. I have a simple database set up to contain all the operations, steps and products and there is a crosstab table that links all the rules to each item. Here is an example of some rules (these are actual rules from the process):
View 5 Replies
Dec 29, 2011
So I'm working on a software in VB.Net where I need to scrape information and process it according to rules. For example, simple string replace rules like making "Det" into "Detached" for a specific field, or a split/join rule, basic string operations. All my scraping rules are RegEx and I store them in a database in rows of rule sets for different situations.What is the best way behind creating/storing rules to manipulate text? I do not want to hardcode the rules into the software, but rather be able to add more as there will be a need for them. I want to store them in a database, but then how do I interpret them?
View 1 Replies
Dec 2, 2010
Is there a dataannotation validate rule for a collection based property? I have the following
<DisplayName("Category")>
<Range(1, Integer.MaxValue, ErrorMessage:="Please select a category")>
Property CategoryId As Integer
<DisplayName("Technical Services")>
Property TechnicalServices As List(Of Integer)
I'm looking for a validator that I can add to the TechnicalServices property to set a minimum for the collection size.
View 1 Replies
Oct 25, 2011
I want to programmatically change ACL for all the subdirectories into a containing one. Specially when ACL of a particolar user is found I want to duplicate that ACL, change the security identifier and add the rule.
Look at this code:
cDirectoryInfo = New DirectoryInfo(strPath)
cDirectorySecurity = cDirectoryInfo.GetAccessControl()
cAuthorizationRuleCollection = cDirectorySecurity.GetAccessRules(True, True,
[Code]....
View 5 Replies
May 22, 2010
how to import different lines of text from a text file in the same directory to different textboxes ?e.g. line one in text file to textbox1.text ect.
View 1 Replies
Dec 8, 2010
I place these 2 questions in this forum simply 'cause those that know GDI+ best are probably .Net vs. VB6 classic users... So here it goes.I'm using GDI+ flat file to generate a textured brush with image attributes. Creating these are no problem, but I can't find documentation that says whether disposing of the brush will dispose the original image & attributes handles I've assigned to the brush or whether I need to destroy those also? I can't locate anything that says whether GDI+ copies the handles or uses the ones I provided. Destroying the handles well before the brush is destroyed does no damage. Thus my assumption is that the handles are copied. But you know what they say about assumptions.
2. Likewise I use a GDI+ function to return the image assigned to a textured brush. Again, I don't know if that returned image handle is to be disposed by me or not. The returned handle changes every time I call the function, so I'm assuming that I should be destroying it. Thanx to all that can shed any light whether from personal experience or pointing me to some black & white documentation.
View 1 Replies
Dec 15, 2011
I want to enforce validation rule in create table statement for a coloumn. im using vb.net as front end and access as back end.
View 2 Replies
Jul 29, 2009
I would like to automatically create an Outlook rule (move email containing something in subject to folder xyz) but dont know how to achieve this. Of course I can create the rule and export it to a .rwz file. This file can be imported manually, but how can I import it automatically?
Can I import a rule through my VSTO 2005 Outlook (2003) Addin? Or can I create the rule from within this addin?
View 2 Replies
May 21, 2011
I need help from the Regex wizards out there. I am trying to write a simple parser that can tokenize the options list of a Snort rule (Snort, the IDS/IPS software). Problem is, I can't seem to find a workable formula that breaks apart the individual rule options based on their terminating semi-colon. The formulas that I have cooked up grab all options between parenthesis into a single capture group.
I am using the excellent RegExr tool at the GSkinner site with some of the below sample rule options from Emerging Threats (I parsed off the rule header -- that's easy to tokenize):
[Code]...
I had to play with a few example regex's that work with quoted strings. Finally realized that I am staring at negative look-behinds that avoid quotes that are escaped. This seems to solve any other escaped character, too, because escaped characters only appear inside unescaped quotes.
View 1 Replies
May 12, 2010
I'm allowing users to change data in a DGV. Is there some kind of built in method for DGVs that updates the table with the new values in my Access database? I have a save button that performs the following:
[Code]....
View 2 Replies
Jun 7, 2011
This is my GUI[url]...
So the line which should contain daniweb.com, it should appear on other textbox.
View 4 Replies
Jun 6, 2009
I've got 1 form, with a TextBox1, where I want the news to pop-up.Now, I've made a kind of admin menu, where there's another TextBox in another form, and I want it in such a way, that when I press the "Accept" button, the text saves itself and shows up in TextBox1.[code]Can I control form 1, with form 2?
View 3 Replies
Feb 11, 2012
In my form load event I am setting the defaultcellstyle formats. They are not taking hold anyone know why? None of the formatting that is expected in the code after I bind the datatable to the grid is getting done even though the code steps through it
Private Sub frmADRORD_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'wire the delegate function for incoming updates
AddHandler m_helper.DataUpdate, AddressOf UpdateGridInvoker
'bind the visual grid with the binding source
[code]....
View 1 Replies
Jun 18, 2012
I'm trying to get the first row in each worksheet to be shaded and have the font bold. Right now, I am able to get the first worksheet changes made, but none of the other worksheets within the same workbook are being changed. Here is what I have written so far for creating the spreadsheet and applying a format.Public Function WRITE_TO_EXCEL(ByVal dt As System.Data.DataTable, ByVal includeheader As Boolean, ByVal worksheet_index As Integer) As Integer
[code]...
View 1 Replies
Jun 6, 2009
I have the following [cod]e...
But the label still shows the [b]! It doesn't want to delete itself..
View 2 Replies
Oct 20, 2009
I have add,update,delete buttons on my form.A message box should appear on the screen "should have values to Add/delete/update/" if user clicks on Add/delete/update buttons without having any values in the textfiled,i have around 20 text fields on my form.
View 7 Replies
Apr 23, 2010
I can't figure out how to edit a single line from a text file and i nep
e.g
file: x.txt
bla bla bla
[code].....
View 2 Replies
Jun 5, 2009
I would like to get the lines or curves from a text. I was looking and I found ExtTextOutW or GetGlyphOutline.
Do you know where is a sample? I found some of vb6 and vc++ but I can not do running.
View 4 Replies