Reasons to Use Prolog

 
Prolog is a unique programming language that was honed by an international team.Prolog (Programming in Logic) is a unique programming language. It was developed in France by researchers who were interested in automatic natural language translation. It was perfected in Scotland by researchers who were interested in automatic theorem provers. It came to world attention when the Japanese chose it as the base language for their “Fifth Generation” Artificial Intelligence (AI) project. There are a lot of good reasons to use Prolog.
Using Prolog
One of the best reasons to use Prolog is that you do not have to tell the computer how to solve a problem—you just have to give the computer the rules involved in solving the problem. Prolog programs consist of a carefully ordered set of rules that look like this: If X and Y and Z then W. This set of rules could be grammar rules (if you are working on natural languages) or rules about mathematics (if you are working on automatic theorem provers) or rules about any domain of interest. The rules must have this form: “If (any number of antecedents—including zero antecedents) then (conclusion).” The antecedents must be connected with the “and” conjunction. Once the rules are in place you can submit a question and the program will answer “yes,” “no” or “can’t tell.”
Quantification
Another reason to use Prolog, is that it is very easy to express things in Prolog that are difficult to express in other languages. It is easy to express facts in Prolog, but it is also easy to express complex relationships because Prolog uses quantification logic instead of the simpler logic used by other languages. Quantification just means that a variable can have attributes—in other words, it is not just “If A and B then C” it can also be “If A(a,b,c) and B(m,n) then C(a,b,n)” where a, b, c, m and n are attributes of A, B and C. For example: If Between(x,y,z) and Between(x,k,y) then Between(x,k,z)” would be hard to express in any other language—it would certainly take more than one line in any other language.
Unification
The reason many people choose Prolog is that it will automatically search for an answer. This can be done in other languages, but it is not automatic and would involve hundreds or thousands of lines of code. Prolog really gets its power from logical tools like quantification and unification. Unification just means that two things do not have to be equal to match as long as they can be made equal by using some list of substitutions. For example, P(j,g) is not equal to P(k,g) but they can be made equal if (j = k) is on the substitute list. Unification makes it easy to search for something because when Prolog answers “yes” or “no” it will also return the substitution list that is needed to make things work. For example, if the fact Dog(rich, benji) is in your data base and you ask the question “Dog(rich, x)”. Prolog will return “yes” and the substitution list (x = benji).

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)

How to Access VBA Query SQL

 
I want to do this! What’s This? ..
 
Learn how to build a SQL query and view its results using VBA.Kutay Tanir/Photodisc/Getty Images Visual Basic for Applications (VBA) is a computer programming language engineered by Microsoft and used to automate routine tasks in Access. Access is a relational database management system included in the Microsoft Office suite. A Structured Query Language (SQL) query is used to retrieve data from a database table. The output results of a SQL query are accessed through a Recordset Object. In a few steps you can write VBA code to create a SQL query and view the records retrieved.

Instructions.1
Open the Northwind Microsoft Office Access database. The Northwind database is included in the Microsoft Office suite.

2
Click “Database Tools,” then select “Visual Basic” to open the Microsoft Visual Basic window. Click the “Insert” field and select “Module.”

3
Copy and paste the following code into your new module to view the first name and business phone number in the “Customer” table:

Private Sub customerQuery()

Dim strSQL As String

Dim custRst As Recordset

Dim dbs As Database

Dim rstCntr As Integer

Dim custStr As String

Set dbs = CurrentDb

strSQL = “SELECT Customers.[First Name], ”

strSQL = strSQL & “Customers.[Business Phone]”

strSQL = strSQL & “FROM Customers;”

Set custRst = dbs.OpenRecordset(strSQL)

custRst.MoveLast

custRst.MoveFirst

For rstCntr = 0 To custRst.RecordCount – 1

custStr = custStr & custRst.Fields(0).Value & _

” is a customer and their business phone is ” & custRst.Fields(1).Value & vbCr

custRst.MoveNext

Next rstCntr

MsgBox custStr

custRst.Close

dbs.Close

End Sub

4
Run your subroutine by pressing “F5.”

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)

Dreamweaver Tutorial in JavaScript
 
I want to do this! What’s This? ..
 
Dreamweaver provides an effortless way to add JavaScript through “behaviors.”Stockbroker/Valueline/Getty Images Adobe Dreamweaver has a feature called a “behavior” that writes JavaScript code in your Web pages for you. Adobe defines a behavior as “a combination of an event and an action triggered by that event.” An “event” occurs when a visitor to your website has done something on a page. An “action” is the response that has been pre-written in JavaScript code. You may, for example, want to provide more information about an item on your Web page if a user requests it. You could link the word “help” to a behavior so that when it is clicked, a window appears with information in it.

Instructions.1
Select a link, image or form element on a Dreamweaver page. Click the “body” tag in the lower-left corner of the document window to attach a behavior to an entire Web page — for example, opening a popup window that welcomes visitors to your website.

2
Select “Behaviors” from the “Window” menu. Click “+” in the Behaviors panel and select an action, such as “Popup Message.”

3
Enter the parameters for your selected action. You can enter “Welcome to my website” for the popup message, for example. Each action has a different dialog box with specific parameters and instructions that apply to the selected action. Click “OK.”

4
Change the event that triggers the action in the Behavior panel if it is not the trigger event that you want. In our popup window event, the onLoad event is the default event. You could change the trigger event to “onUnload” and the message to “Thanks for visiting. Come back soon!”
5
Click “File” and “Save.” Preview your Web page to test your changes by pressing F12.

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)

How do I Create a File From String?
 
I want to do this! What’s This? ..
 
Learn how to save a string variable to a new file using VB.NET.Jupiterimages/Photos.com/Getty Images Knowing how to create a file from a string is useful when you’re developing computer applications and need to write to a file. A string is a sequence of characters saved in what is referred to as a string variable. Microsoft Visual Basic.NET, or VB.NET, is an object-oriented programming language commonly used by programmers for its ease of use. In a few steps you can write VB.NET code to create a file and write a string to the file.
.Difficulty: Moderately Easy
Instructions.Things You’ll Need:
Microsoft Visual Basic Express
1
Start Microsoft Visual Basic Express and click “New Project…” on the left pane of your screen. Double-click “Console Application.” Press “Ctrl” and “A,” then press “Delete” to remove all existing code.

2
Copy and paste the following code to your “Module1.vb” module to create a new text file and save the “writeString” variable to it.

Imports System.IO

Module Module1

Sub Main()

Dim writeString As String

writeString = “This string will be ”

writeString = writeString & “saved in a new create file.”

Using flWrite As StreamWriter = New StreamWriter(“C:\createFile.txt”)

flWrite.WriteLine(writeString)

End Using

End Sub

End Module

3
Press “F5″ to run your VB.NET program.

VN:F [1.9.6_1107]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.6_1107]
Rating: 0 (from 0 votes)
© 2010 Netspider.com Make IT Easy Xml Sitemap by net spider