We will set up a framework for playing a two-person game in which the two players alternate making moves. The game can normally be represented as a tree where the nodes represent the current status of the game and the arcs represent the moves. The game tree consists of all possible moves for the current players starting at the root and all possible moves for the next player as the children of these nodes, and so forth, as far into the future of the game as desired. The leaves of the game tree represent terminal positions as one where the outcome of the game is clear (a win, a loss, a draw, a payoff). Each terminal position has a score. High scores are good. For example, we may associate 1 with a win, 0 with a draw and -1 with a loss.
31 May
Fact
Facts are statements that describe object properties or relations between objects. Let us imagine we want to encode that Ulysses, Penelope, Telemachus, Achilles, and others are characters of Homer’s ended with a period:
From these examples, we understand that the general form of a Prolog fact is: relation(object1, object2, …, objectn) objects, such as normally strings of letters, digits, or underscores letter. An atom can also be a string beginning with an uppercase letter or including white spaces, but it must be enclosed between quotes. Thus . Symbols or names representingulysses or penelope, are called atoms. Atoms are_”, and begin with a lowercase’Ulysses’ or ’Pallas Athena’ In logic, the name of the symbolic are legal atoms.relation is the predicate, the objects object1 and the number by its name and arity: , object2, . . . , objectn involved in the relation are the arguments,n of the arguments is the arity. Traditionally, a Prolog predicate is indicatedpredicate/arity, for example, character/2, king/3
Iliad and Odyssey. This translates into Prolog facts character(priam, iliad). character(hecuba, iliad).
31 May
An Introduction to Prolog
Prolog was designed in the 1970s by Alain Colmerauer and a team of researchers with the idea – new at that time – that it was possible to use logic to represent knowledge and to write programs. More precisely, Prolog uses a subset of predicate logic and draws its structure from theoretical works of earlier logicians such as Herbrand (1930) and robinson (1965) on the automation of theorem proving. Prolog was originally intended for the writing of natural language processing applications. Because of its conciseness and simplicity, it became popular well beyond this domain and now has adepts in areas such as:
• Formal logic and associated forms of programming
• Reasoning modeling
• Database programming
• Planning, and so on.
31 May
New task has assigned
I am intended to start artificial intelligence programming from today both prolog and c++ environment. So, I will fade out about web development for few days according with my personal website.
31 May
How to get client date time in asp.net
javascript to implement it.
<script type=”text/javascript”>
function displayTime()
{
var localTime = new Date();
var year= localTime.getYear();
var month= localTime.getMonth() +1;
var date = localTime.getDate();
var hours = localTime .getHours();
var minutes = localTime .getMinutes();
var seconds = localTime .getSeconds();
var div=document.getElementById(“div1″);
div.innerText=year+”-”+month+”-”+date+” “+hours+”:”+minutes+”:”+seconds;
}
</script>
Then you can display it at web page.
<body onload=”displayTime();”>
<form id=”form2″ runat=”server”>
<div id=”div2″></div>
</form>
</body>
31 May
Pass value using navigateurl in gridview one page to another in asp.net
Make your hyperlink control like below
<asp:HyperLink ID=”HyperLink1″ runat=”server” NavigateUrl=’<%# “YourNextPage.aspx?id=”+Eval(“BlogId“) %>’ Text=’<%# Bind(“BlogId“) %>’ ></asp:HyperLink>
next page:
protected void Page_Load(object sender, EventArgs e)
{
string newid = Request.QueryString["id"];
Response.Write(newid);
}
23 May
How to show data in itemtemplate in gridview in asp.net by linq
It’s simple. First you need to add gridview with itemtemplate item. Then you can add additional code to display data into item which are given below
<asp:TemplateField HeaderText=”Id” HeaderStyle-HorizontalAlign=”Center”>
<ItemTemplate>
<asp:Label ID=”lblid” runat=”server” Text=’<%# Bind(“Id”)%>’></asp:Label>
</ItemTemplate> <HeaderStyle HorizontalAlign=”Center”></HeaderStyle> <ItemStyle HorizontalAlign=”Center” VerticalAlign=”Middle” Width=”300px” />
</asp:TemplateField>
23 May
Lazy time in summer vacation
Summer vacation in now running. Every bird are flying in open sky with thier own vision. But i am alas!! I am so sorry about my life. What’ s going on. I can’t control my mind. Time are walking his own way. He can not wait for me. Now I am fading……..
No hope, No intention, No dream, No waiting, No work, No tension………. Life is nothing. And I am nothing. Only way to escape from helling life is death. I am walking…..
23 May
Show text into status area located at the bottom of the browser
To show text into status area located at the bottom of the browser foolowing procedure can be used
<body onload=”window.status=’It\’s a testing text’;”>
For Firefox user: Tools->Options->Enable JavaScript->Advanced->Change status bar text
20 May
Connection String of Sql server
This is different kind of conncetion string
- string connStr = ConfigurationManager.ConnectionStrings["TutTestConn"].ToString();
- string sFilePath = AppDomain.CurrentDomain.BaseDirectory + “App_Data\\RAGDatabase.mdf”; string connString = “Data Source=.\\SQLEXPRESS; AttachDbFilename=” + sFilePath + “; Integrated Security=True; User Instance=True”; m_oSqlConnection = new SqlConnection(connString); m_oSqlConnection.Open();
- string connString = “Data Source=server ip; Initial Catalog=database_name; User ID=id;Password=pwd; Trusted_Connection=False;”;
- string connString = “Data Source=erver name; Initial Catalog=database_name; User ID=id;Password=pwd; Trusted_Connection=False;”;