Tuesday, March 11, 2014

Laga Big Maatch Liga Champion Bayern Munchen vs Arsenal 12 Maret 2014

Laga Big Maatch Liga Champion Bayern Munchen vs Arsenal 12 Maret 2014 - Prediksi Munchen vs Arsenal - Kali ini Munchen akan menjamu tamunya Arsenal untuk untuk berlaga.Pada 5 pertandingan terakhirnya Munche selalu memenangkan pertandingan. Hasil pertandingan Munchen melawan tim-tim Inggris adalah 10 kemenangan, lima imbang, dan tiga kekalahan. Total rekor Munchen melawan tim-tim Inggris adalah 16 kemenangan, 14 imbang, dan 12 kekalahan.

Sedangkan Arsenal berhasil meraih lima kemenangan, empat imbang, dan lima kekalahan. Total rekor Arsenal melawan tim-tim Jerman adalah 14 kemenangan, lima imbang, dan 10 kekalahan.

Prediksi Bayern Munchen vs Arsenal

Sejak menelan kekalahan kandang dari Arsenal musim lalu, Munchen tidak pernah gagal mencetak gol pada 54 laga terakhirnya di semua kompetisi resmi. Arsenal harus mengulangi performa musim lalu, Prediksi Atletico Madrid vs AC Milan dengan mengalahkan Munchen di Allianz-Arena untuk menjaga harapan lolos ke babak berikutnya.Bicara soal statistik kedua tim, maka bukan hal yang tidak adil jika menjadikan Bayern Munchen sebagai tim unggulan dalam pertemuan kedua tim ini. Bermain di kandang sendiri, Bayern hanya membutuhkan hasil imbang untuk bisa lolos ke babak berikutnya, karena pada pertemuan pertama di kandang Arsenal, Bayern mampu menang dengan skor 3-1.

Berbekal kemenangan 3-1 ini, Bayern bisa dikatakan sudah berada di atas angin, apalagi mereka akan memainkan laga penentu di kandang sendiri. Dan rasanya bukan tipe permainan Bayern Munchen untuk bermain bertahan demi mendapatkan hasil imbang. Frank Ribery dan kawan-kawan sepertinya masih akan tetap bermain sejak awal, mengimbangi permainan Arsenal yang tentunya juga akan menyerang sejak menit awal demi mengejar agregat yang sangat jauh.

Sayangnya Arsenal sepertinya tidak akan mudah menaklukkan Bayern di kandang mereka sendiri, selain bermain di hadapan pendukung sendiri, Bayern juga terlihat masih terlalu superior dibandingkan dengan Arsenal, baik secara permainan maupun skuat yang ada dalam tim. Tidak ada jalan lain bagi Arsenal selain bermain agresif sejak menit awal demi menghidupkan peluang lolos ke babak berikutnya.

Head 2 Head Bayern Munchen vs Arsenal:

20 Feb 2014 : Arsenal 0-2 Bayern Munchen (Liga Champions)
14 Mar 2013 : Bayern Munchen 0-2 Arsenal (Liga Champions)
20 Feb 2013 : Arsenal 1-3 Bayern Munchen (Liga Champions)

5 pertandingan terakhir Bayern Munchen :

8  Mar 2014 : Wolfsburg 1-6 Bayern Munchen (Bundesliga)
2  Mar 2014 : Bayern Munchen 5-1 Schalke (Bundesliga)
23 Feb 2014 : Hannover 0-4 Bayern Munchen (Bundesliga)
20 Feb 2014 : Arsenal 0-2 Bayern Munchen (Liga Champions)
15 Feb 2014 : Bayern Munchen 4-0 Freiburg (Bundesliga)

5 pertandingan terakhir Arsenal :

8  Mar 2014 : Arsenal 4-1 Everton (Piala FA)
1  Mar 2014 : Stoke City 1-0 Arsenal (EPL)
22 Feb 2014 : Arsenal 4-1 Sunderland (EPL)
20 Feb 2014 : Arsenal 0-2 Bayern Munchen (Liga Champions)
16 Feb 2014 : Arsenal 2-1 Liverpool (Piala FA)

Prediksi Skor Pertandingan Bayer Munchen vs Arsenal
: 2 - 0

Sunday, March 9, 2014

Jelang Pertandingan Real Madrid vs Levante 10 Maret 2014

Jelang Pertandingan Real Madrid vs Levante 10 Maret 2014Prediksi Real Madrid vs Levante – Real Madrid dan Levante akan kembali menjalani debutnya dan kali ini adalah pada matchday ke-17 liga primera spanyol, dimana pertandingan ini akan berlangsung di Estadio Santiago Bernabéu — Madrid dan akan disiarkan secara LIVE di RCTI pada pukul 01:00 dinihari Wib.

Prediksi Real Madrid vs Levante

Apabila melihat catatan sejarah dari pertemuan kedua tim, Real Madrid lebih mendominasi dengan memenangkan 4 pertandingan dan sekali mengalami kekalahan saat bentrok di 5 pertandingan terakhir melawan Levante. Terakhir kedua tim berjibaku pada 6 okt 2013, saat itu Levante sebagai tuan rumah takluk 2-3 atas Ronaldo dkk.

Hasil berbeda didapatkan kedua tim pada pertandingan terakhirnya, Prediksi Napoli vs AS Roma dimana Real Madrid berhasil menahan imbang tuan rumah Atletico Madrid dengan skor 2-2 pada lanjuta Liga Spanyol 2 mar 2014, sedangkan Levante menang dengan skor 2-0 saat menjamu Osasuna (2 mar 2014) pada lanjutan La Liga.

Melihat peringkat kedua tim saat ini dipapan klasemen sementara liga spanyol, Real Madrid berada dipuncak klasemen dengan mengoleksi 64 point yang dihasilkan dari 20 kali menang, 4 kali imbang dan 2 kali kalah. Sedangkan Levante bercokol diurutan ke-8 dengan raihan 36 point (9 kali menang, 9 kali imbang dan 8 kali kalah).

Bagaimanakah hasil yang akan didapatkan oleh kedua tim pada laga ini, mampukah Real Madrid sebagai tuan rumah memenangkan pertandingan atau bahkan sebaliknya Levante selaku tim tamu berhasil mencuri kemenangan.

Head to Head Real Madrid vs Levante :

6 Okt 2013 Levante UD 2 – Real Madrid 3 (LL)
6 Apr 2013 Real Madrid 5 – Levante UD 1 (LL)
12 Nov 2012 Levante UD 1 – Real Madrid 2 (LL)
13 Feb 2012 Real Madrid 4 – Levante UD 2 (LL)
19 Sep 2011 Levante UD 1 – Real Madrid 0 (LL)

5 (lima) Pertandingan Terakhir Real Madrid :

2 Mar 2014Atlético Madrid 2 – Real Madrid 2LL
27 Feb 2014Schalke 04 1 – Real Madrid 6UCL
22 Feb 2014Real Madrid 3 – Elche 0LL
16 Feb 2014Getafe 0 – Real Madrid 3LL
12 Feb 2014Atlético Madrid 0 – Real Madrid 2CDR

5 (lima) Pertandingan Terakhir Levante :

2 Mar 2014Levante UD 2 – Osasuna 0LL
22 Feb 2014Real Valladolid 1 – Levante UD 1LL
16 Feb 2014Levante UD 1 – Almeria 0LL
10 Feb 2014Real Sociedad 0 – Levante UD 0LL
2 Feb 2014Levante UD 0 – Rayo Vallecano 0LL

Perkiraan Pemain Real Madrid vs Levante Starting XI :

Real Madrid : Lopez, Marcelo – Ramos – Varane – Carvajal, Di Maria – Alonso – Modric, Cristiano – Benzema – Bale.

Levante : Navas, Vyntra – Juanfran – Navarro – Karabelas, Garcia – Pinto – Adoua – Ivanschiltz, Diawara – Barral.

Prediksi Skor Pertandingan Real Madrid vs Levante = REAL MADRID 4 – 0 LEVANTE

Thursday, March 14, 2013

Object Relational Database Features Implemented with Oracle

Oracle is a modern and feature-full database that supports many features of an object relational database system. Oracle supports type definition, type inheritance, collection type, member function, nested table, association and aggregation relationships. In this article, I have implemented all features other than association and aggregation relationships.

1. Database Structure
I have considered a database for a simple ecommerce site. The database will consist of different type of products having a bunch of attributes inherited from Products table whereas each table will have some other attributes of its own. So here I have a product object and a Clothes table that inherits the product object. Each clothe is available in multiple sizes. Further, each clothe tuple is available in multiple colors represented by a collection array in this example. For simplicity, I have included only one such table that inherits from products table where there could be other tables like Jewellery, Bags, Cosmetics and so on. Further, each product has multiple categories which is implemented by a nested category table. In our example, we charger 10% extra on the price of each product. Hence I have used a member function that returns 10% extra of the price.

2. Object Relational Structure
Product is an object, not the table, from which another object or type ClotheType is inherited. Product also contains a nested table Category so that each product row contains a reference to an instance of the table Category. Finally we create a table Clothes of the type ClotheType. ClotheType consists of two attributes: clothesize and clothecolor where clothesize is another Type and clothecolor is a collection array.

The object oriented concept of function has been included in ClotheType object which we call member function in Oracle.

3. DDL Script for the Database Objects

Create a type CategoryType
Create or replace type CategoryType as object(
categoryid int,
categoryname varchar2(50)
) not final

Create a table of CategoryType
Create or replace type ProductCategory as Table of CategoryType

Create an inheritable (specified by "not final" construct) object Product
Create or replace type Product as object(
productid int,
productname varchar2(100),
price number(7,2)
) not final

Create type ProductSize
Create or replace type ProductSize as object(
sizecode varchar2(20),
sizevalue varchar2(20)
)

Create collection array for colors
create or replace type ColorArray as varray(20) of varchar2(20)

Create a type ClotheType that inherits from Product
Create or replace type ClotheType under Products(
clothesize productsize,
clothecolor colorarray,
clothecategory productcategory,
member function total_price return number
)

--define the body for the member function total_price
create or replace type body ClotheType as
 member function  total_price return number is
 begin
                 return (price + price * 0.1);  
 end;
end;

Finally create a table of the type ClotheType
create or replace table Clothes of clothetype
nested table clothecategory store as prod_cat

4. Inserting rows into the Clothes table
Now we insert rows into the Clothes table.
  
   insert into clothes
   values(3,'V-neck tshirts with full sleeve',250,
   productsize('M','Medium'),
   colorarray('White','Blue','Black'),
          productcategory(categorytype('1','T-Shirts'),
                     categorytype('2','Men''s Wears')
   )
      );
   
   insert into clothes
   values(2,'Round-neck tshirts',450,
   productsize('L','Large'),colorarray('Red','Black','Green'),
          productcategory(categorytype('1','T-Shirts'),
                     categorytype('2','Men''s Wears')
      )
      );
     
   insert into clothes
   values(1,'Both side design tshirts',600,
   productsize('S','Small'),colorarray('Red','Blue','Black'),
             productcategory(categorytype('1','T-Shirts'),
                     categorytype('2','Men''s Wears')
      )
      );    
5. Querying the table Clothes
a. Normal query to select the columns productid, productname, pirce and productsize's columns sizecode and sizevalue

select c.productid,c.productname,c.price,
 c.clothesize.sizecode,c.clothesize.sizevalue
from clothes c

select from a table in object relational database Oracle


b. Querying the categories in a product from the nested table clothecategory

select c.productid,c.productname,p.categoryid,p.categoryname
 from clothes c,table(c.clothecategory) p
where c.productid=1;

select c.productid,c.productname,p.categoryid,p.categoryname
 from clothes c,table(c.clothecategory) p
where c.productid=2;

select from nested table in object relational database Oracle


c. Querying the colors associated with a product

select c.productid, c.productname,p.*
 from clothes c, table(c.clothecolor) p
where c.productid=2;

select from collection array in object relational database Oracle


d. Querying the total price by calling the member function total_price

select p.productid, p.productname,p.price,p.total_price() "Total Price"
 from clothes p;

select using member function in object relational database Oracle


6.Conclusion
we realized and implemented a bunch of object relational features of Oracle database. Some of the features we worked with were type inheritance, type as a column, datatype collection and nested table, as well as member function. We developed DDL script to create such objects and performed select queries. All in all, we got the good glimspe of object oriented programming in Oralce database.

Tuesday, February 19, 2013

Add clickable rows in csharp DataTable and bind to asp.net gridview

Responding to a good demand from a lot of readers, I have now presented a way to create DataTable programmatically where rows accept html and hence they can be made clickable. Complementing to my previous post on creating DataTable programmatically in asp.net, this tips will bind DataTable to an asp.net GridView where one of the columns in each row contains clickable html anchor.

Below is the code snippet in C#.

protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //get data from programmatically created DataTable and bind to GridView
            gvTable.DataSource = CreateTable();
            gvTable.DataBind();
        }
    }


//Create DataTable programmatically
    //In this example, there are three columns
    //namely ID, WebsiteName and URL
    private DataTable CreateTable()
    {
        //create datatable
        DataTable table = new DataTable("Websites");
        
        //add columns to the table
        table.Columns.Add("ID", typeof(int));
        table.Columns.Add("WebsiteName", typeof(string));
        table.Columns.Add("URL", typeof(string));
        //add as many rows as you want
        AddNewRow(1, "dotnetspidor", "http://dotnetspidor.blogspot.com", table);
        AddNewRow(1, "asp.net", "http://asp.net", table);
        AddNewRow(1, "codeplex", "http://codeplex.com", table);
        return table;
    }


//Add new row to a table
    private void AddNewRow(int id,string website, string url,DataTable table)
    {
        DataRow row = table.NewRow();
        row["ID"] = id;
        row["WebsiteName"] = website;
        //get url from GetURL method
        string link = GetURL(website, url);
        row["URL"] = HttpUtility.HtmlDecode(link);
        table.Rows.Add(row);
    }


//create html anchor from website name and it's url
    private string GetURL(string website, string url)
    { 
        return "<a href=\""+url+"\">"+website+"</a>";
    }

Here goes the design code for the GridView. Please note the property HtmlEncode="false" in the third BoundField. This prevents the GridView from rendering encoded html so we retain the html code from our DataTable column.

    <asp:gridview autogeneratecolumns="false" id="gvTable" runat="server" width="500px">  
<columns>
<asp:boundfield datafield="ID" headertext="ID">
<asp:boundfield datafield="WebsiteName" headertext="Website">
<asp:boundfield datafield="URL" headertext="URL" htmlencode="false">
</asp:boundfield></asp:boundfield></asp:boundfield></columns>
</asp:gridview>

The output looks like below.
Fig: Output of programmatically generated DataTable in a gridview - with clickable row
Happy Programming!!
Shout it

Saturday, February 9, 2013

Strip html tags and extract subset of string from text using regular expression in c-sharp

Today I am presenting a quick tips on how to strip html from text using regular expression (with Regex class) in C#. In a scenario like presenting a blurb or summary of certain characters we may need to remove html tags from a html string (of news details, article details etc.). I have following function in my Helper library for the very problem.


    /// 
    /// Strip out html tags from text
    /// 
    /// Source string
    /// 
    public static string StripTagsFromHtml(string source)
    {
        return Regex.Replace(source, "<.*?>", string.Empty);
    }


To extract a number of characters from the source string, we can extend the function as following.

    /// 
    /// Strip out html tags from text and return extract from it
    /// 
    /// Source string
    /// Number of characters to extract
    /// 
    public static string StripTagsFromHtml(string source, int characterCount)
    {
        string stripped = Regex.Replace(source, "<.*?>", string.Empty);
        if (stripped.Length <= characterCount)
            return stripped;
        else
            return stripped.Substring(0, characterCount);
    }

Happy programming!

Shout it

Popular Posts

Recent Articles