Ahmedn1's Profile User Rating: -----

Reputation: 23 Tradesman
Group:
Contributors
Active Posts:
553 (0.3 per day)
Joined:
04-August 09
Profile Views:
19,324
Last Active:
User is offline Jun 15 2014 08:57 AM
Currently:
Offline

Previous Fields

Country:
EG
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Your Car:
Who Cares
Dream Kudos:
125

Latest Visitors

Icon   Ahmedn1 has not set their status

Posts I've Made

  1. In Topic: Matrix of Buttons Variables

    Posted 15 Jun 2014

    View PostSkydiver, on 15 June 2014 - 07:22 AM, said:

    Please do not give complete solutions to problems. You have enough posts in this forum to know it works: We guide people towards solutions. We don't just spoonfeed them the answer.



    Sorry for that it's been a time since I last posted here so I kinda misreacted
  2. In Topic: Matrix of Buttons Variables

    Posted 14 Jun 2014

    You can simply store the i, j in the buttons Tag property and then get them back again:

    private void Single_Load(object sender, EventArgs e)
            {
                //code here
                for (int i = 0; i < n; i++)
                {
                    for (int j = 0; j < n; j++)
                    {
                        //a lot of working code here
                        b[i, j].Click += new System.EventHandler(ClickButton);
                        b[i, j].Tag = i.ToString() + "," + j.ToString;
                    }
                }
            }
    
    
    


    ClickButton(object sender, EventArgs e)
        {
            string tag = ((Button)sender).Tag.ToString();
            string[] indexes = tag.Split(',');
            int i = int.Parse(indexes[0]);
            int j = int.Parse(indexes[1]);
            if (x%2==0)
                v[i, j] = x; //i and j should be form the matrix of buttons
        }
    
    
  3. In Topic: Hello Programmer I need Some Help ?

    Posted 14 Jun 2014

    As Skydiver said this is a very simple string parsing
    Actually it can be done by many ways. I'll give you examples:

    You can use the simplest solution which is the substring method (gets a part of the string).
    
                //Sample String
                string RxString = "( ST,GS,0, 0.20 kg )";
                //Split separates all the string to groups based on a specific symbol (the comma)
                string[] ss = RxString.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                //remove any white spaces at the start or end of the last item in the array (which is our target)
                string s = ss[ss.Length - 1].Trim();
                //Removes the " Kg" unit from the weight and leaves only the number
                Console.WriteLine(s.Remove(s.IndexOf(' ')));
                Console.ReadKey();
    
    


    You can use the easiest solution (but not the simplest) which is Regex:
    If you don't know regex you can learn about them here
    http://msdn.microsof...ions.regex.aspx
    http://en.wikipedia....ular_expression

    This can be the code:
    using System;
    using System.Text.RegularExpressions;
    
    namespace ConsoleApplication3
    {
        class Program
        {
            static void Main(string[] args)
            {
                //The regular expression is as follows
                /*
                 * + means (one or more)
                 * [\d.]+ means that can be any number of decimal digits with a point symbol (one or more)
                 * \s+ matches one or more white space 
                 * (lbs?|g|kg) means that the white spaces are followed by one of these words
                 * So, that gives us a decimal number followed by a space (or more) followed by a unit which can be (lbs?|g|kg) 
                 * Whenever a string with these characteristics appear in the Given string it will make a match
                 * All you have to do is to get the match and do whatever you want with it
                */
                Regex reg = new Regex ("([\\d.]+)\\s+(lbs?|g|kg) ");
                string RxString = "( ST,GS,0, 0.20 kg )";
                Match m = reg.Match(RxString);
                foreach(Capture c in m.Captures)
                    Console.WriteLine(c.Value.Remove(c.Value.IndexOf(' ')));
                Console.ReadKey();
            }
        }
    }
    
    
    
  4. In Topic: Strange Symbols in my WP8 App

    Posted 23 Jan 2014

    It turns out to be something in the debugger
    because when I tried to just run the app from my phone not from Visual Studio "Run" command the app screen didn't have these numbers.
    They appear only when I run the app on the phone from VS.
  5. In Topic: Strange Symbols in my WP8 App

    Posted 21 Jan 2014

    View PosttlhIn`toq, on 20 January 2014 - 02:33 AM, said:

    Looks like info from the virtual machine. Probably because its in debug mode maybe?

    000 000 001057 003 002 00. 1266
                         ^ Version number maybe  2.00.1266
    


    You say all your apps have this. Are they all built from the same source/skeleton code? Do they appear in 'Release' versions or just 'Debug' ?

    Did you write ALL of the code on your apps from scratch? Or maybe this is something you borrowed without realizing it. 003 could be the depth of navigation. 1057 could be the memory being used.

    These are all just guesses. But the fact is they didn't appear by magic. So either your code is doing it, or you've turned on some debug feature(s), or the virtual machine does it when launched from the compiler. Maybe a flag being passed in.



    I tried the release version but it did the same
    I was using VS 2012 on Windows 7 and 8
    and now VS 2013 on Win 8.1 fresh install

    and every time I build an app for WP it gives me this screen.

    So, I don't think it is something related to the system. And yes I'm building my projects from a scratch I even tried to create a new windows phone project and run it without any modification and these numbers appeared as well.

    I can't run the emulator because I don't have Win 8 Pro so I test on my Lumia 920

My Information

Member Title:
D.I.C Addict
Age:
25 years old
Birthday:
April 17, 1989
Gender:
Location:
Egypt
Interests:
Reading
Computers & Internet
Programming
Travelling
Full Name:
Ahmed Elsaid Mohamed Dawod
Years Programming:
5
Programming Languages:
VB 6
VB.NET
C#
C++
Python
Java SE

Contact Information

E-mail:
Click here to e-mail me
MSN:
MSN  ahmedn12009@hotmail.com
Website URL:
Website URL  http://www.perfectcodes.com
Yahoo:
Yahoo  ahmedn32004
Skype:
Skype  ahmedn12007
Facebook:
Ahmedn1.Dawod
Twitter:
Ahmed_n1

Friends

Comments

Ahmedn1 has no profile comments yet. Why not say hello?