Sunday, January 12, 2014

Data from windows App store shows that people download game apps more than any other kind of app. And #2 goes to entertainment apps. We have a lot of work to bring the education to the top.


http://blogs.windows.com/windows/b/appbuilder/archive/2013/12/09/windows-store-trends-nov-2013-update.aspx

Posted on 3:53 PM by Erdem

No comments

I found it extremely complicated to submit an app for windows desktop. For Windows Phone, it's quite straight forward since all you need to do is figure out
https://dev.windowsphone.com/

But for the desktop, it was too complicated for me. So here are some notes to make it easier next time:

First go to:
http://msdn.microsoft.com/en-US/windows/apps/
Second,
Find "Dashboard" on top left and click

If you have never done it before, they ask your phone and send a text to your phone with a code. You enter to code so you can move forward. Once the code thing is done, you access to your developer account for "Windows Desktop Apps"..  Hopefully, you are all set!

I don't have any idea why they had to use separate accounts for windows desktop, phone and etc... Developers are also human. Don't assume they have many many hours to spare to figure out your system


Posted on 3:33 PM by Erdem

No comments

Sunday, January 05, 2014

Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type. When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap. Unboxing extracts the value type from the object. Boxing is implicit; unboxing is explicit. The concept of boxing and unboxing underlies the C# unified view of the type system in which a value of any type can be treated as an object.

See the code below with several boxing and unboxing examples

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BoxingUnboxing
{
    class Program
    {
        static void Main(string[] args)
        {
            // String.Concat example. 
            // String.Concat has many versions. Rest the mouse pointer on  
            // Concat in the following statement to verify that the version 
            // that is used here takes three object arguments. Both 42 and 
            // true must be boxed.
            Console.WriteLine(String.Concat("Answer ", 42, " ", true));
            // burada 42 ve true string seklinde box laniyor


            // List example. 
            // Create a list of objects to hold a heterogeneous collection  
            // of elements.
            List<object> mixedList = new List<object>();

            // Add a string element to the list. 
            mixedList.Add("First Group:");

            // Add some integers to the list.  
            for (int j = 1; j < 5; j++)
            {
                // Rest the mouse pointer over j to verify that you are adding 
                // an int to a list of objects. Each element j is boxed when  
                // you add j to mixedList.
                mixedList.Add(j);
            }

            // Add another string and more integers.
            mixedList.Add("Second Group:");
            for (int j = 5; j < 10; j++)
            {
                mixedList.Add(j);
            }

            // Display the elements in the list. Declare the loop variable by  
            // using var, so that the compiler assigns its type. 
            foreach (var item in mixedList)
            {
                // Rest the mouse pointer over item to verify that the elements 
                // of mixedList are objects.
                //Console.WriteLine(item);
                Console.Write(item); Console.Write(" "); Console.WriteLine(item.GetType());
            }

            // The following loop sums the squares of the first group of boxed 
            // integers in mixedList. The list elements are objects, and cannot 
            // be multiplied or added to the sum until they are unboxed. The 
            // unboxing must be done explicitly. 
            var sum = 0;
            for (var j = 1; j < 5; j++)
            {
                // The following statement causes a compiler error: Operator  
                // '*' cannot be applied to operands of type 'object' and 
                // 'object'.  
                //sum += mixedList[j] * mixedList[j]); 

                // After the list elements are unboxed, the computation does  
                // not cause a compiler error.
                sum += (int)mixedList[j] * (int)mixedList[j];
                // burada da unboxing ornegi var
                // mixedList denen icinde boxed variable lerin oldugu liste burada her biri unbox ediliyor 
                // yeniden gosteriliyor
            }

            Console.ReadKey();
        }
    }

}

Posted on 10:16 PM by Erdem

No comments

Indexer'in pek de bir numarasi yok.. Objeleri array gibi indexlemeye ve bununla beraber, get ve set ile her bir elemani property gibi kullanmaya yariyor. Mesela obje[3] ile bir integer veya stringe ulasmak mumkun ve obje.toplahepsini gibi bir propertyi kullanarak objenin temsil ettigi index degerlernin toplamini vermek de mumkun

A well documented explanation from MSDN:  http://msdn.microsoft.com/en-us/library/2549tw02.aspx

To declare an indexer on a class or struct, use the this keyword, as in this example:

public int this[int index]    // Indexer declaration
{
    // get and set accessors
}

My Example modified from MSDN's example for indexers:
=============================================

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ExampleForIndexers02
{
    class TempRecord
    {
        // Array of temperature values
        private float[] temps = new float[10] { 56.2F, 56.7F, 56.5F, 56.9F, 58.8F,
                                            61.3F, 65.9F, 62.1F, 59.2F, 57.5F };

        // To enable client code to validate input
        // when accessing your indexer.
        public int Length
        {
            get { return temps.Length; }
        }
        // Indexer declaration.
        // If index is out of range, the temps array will throw the exception.
        public float this[int index]
        {
            get
            {
                return temps[index];
            }

            set
            {
                temps[index] = value;
            }
        }

        public float Total
        {
            get
            {

                float fln = 0;
                for (int i = 0; i < this.Length; i++)
                {
                    fln = fln + this[i];
                }
                return fln;
            }
        }


    }

    class MainClass
    {
        static void Main()
        {
            TempRecord tempRecord = new TempRecord();
            // Use the indexer's set accessor
            tempRecord[3] = 58.3F;
            tempRecord[5] = 60.1F;

            // Use the indexer's get accessor
            for (int i = 0; i < 10; i++)
            {
                System.Console.WriteLine("Element #{0} = {1}", i, tempRecord[i]);
            }

            // Keep the console window open in debug mode.
            System.Console.WriteLine("Press any key to exit.");
            System.Console.WriteLine("{0}",tempRecord.Length);
            System.Console.WriteLine("{0}", tempRecord.Total);
            System.Console.ReadKey();

        }
    }
}

Posted on 10:16 PM by Erdem

No comments


Posted on 3:37 PM by Erdem

No comments

Tuesday, December 31, 2013

http://msdn.microsoft.com/en-us/library/windowsphone/develop/gg442300(v=vs.105).aspx


Posted on 3:19 PM by Erdem

No comments

Friday, December 20, 2013

Posted on 7:57 PM by Erdem

No comments

Wednesday, December 04, 2013

Sub EraseEmptyRows()

Dim rw, i

For i = 1 To 5
' Here the loop is up to 5 meaning the maximum number of rows with no data would be 5
' Increase this number when necessary

For Each rw In Worksheets(1).Range("A1:A50").Rows
' Sweeps all cells in the range. Change the range when necessary
     If (IsEmpty(rw.Cells(1, 1))) Then rw.Delete
' Erases if the cell is empty
Next rw
' End for rw loop
Next
' End for i loop
End Sub

Posted on 7:53 PM by Erdem

No comments

Public Sub Add_Data_to_rows()
' Procedure to add data to rows
' Use this to understand how .Rows work
Dim rw
' Initiate a variable to use as rows object
For Each rw In Worksheets(3).Range("A1:C100").Rows
' Select each row starting from 1 on page 3
     rw.Cells(1, 1).Value = "ABC"
' Set the value to "ABC"
Next rw
' End for loop for rw


End Sub

Posted on 1:18 PM by Erdem

No comments


' Function to erase empty rows in excel
' !!Currently it checks second work sheet!!
' Checks the first cell and erases the entire row if the cell is empty
'Simply copy this macro to your excel file

Sub EraseEmptyRows()

Dim MyCheck, rw, this, i
For i = 1 To 50
' Scan through rows 1 to 50
For Each rw In Worksheets(2).Cells(i, 1).CurrentRegion.Rows
' Select each row starting from 1 on page 2
     this = rw.Cells(1, 1).Value
' Copy the value of A cell
     MyCheck = IsEmpty(this)
' Check if the cell is empty
     If MyCheck Then rw.Delete
' If it is, erase entire row
Next rw
' End for loop for rw
Next i
' End for loop for i

End Sub

Posted on 8:52 AM by Erdem

No comments