Mike Askew 131 Veteran Poster Featured Poster

I am sure if you (LastMitch) live longer, you'd live happier.

Until that person is suffering from an incurable disease, at which point your logic is, at best, flawed.

Coming from somebody that is 21 and completely tea-total, you can look at drink/smoking etc from two points of view. Yes both are bad and put pressure on the health industry etc and may harm the body. But on the other hand it is somebodies way of relaxing and chilling out in the evening.

I for example easily spend 20+ hours a week playing video games when I'm not at work, this isn't the best for my health and damages my eyes over time, but it is what makes me happy and thus I do it to chill out. My parents like to have a glass of wine in the evening to relax, they don't consume excessively and its perfectly acceptable.

You for example Michael have alot of interest in sports it seems. While that is all well and good we have recently seen a professional footballer collapse from a heart attack, die and be revived, and live on when they are seen as peak physical condition. While the argument there that sport is good it can also be just as bad for you in terms of body overworked etc.

Everything has its downsides, its all about opinions.

TL:DR - Its all opinionated and nothing more.
Edit - Clarified footballer further, I am referring to 'Fabrice Muamba'

pritaeas commented: Well put. +0
Mike Askew 131 Veteran Poster Featured Poster

I view them from the same view as s.o.s (as long as im interpreting correctly), in that I only really consider the endorsements from those on the forum I have respect for to be of value. For example AD, Rev Jim etc (Not listing all, those are first names to head).

Mike Askew 131 Veteran Poster Featured Poster

Hence the proverb "Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime."

Mike Askew 131 Veteran Poster Featured Poster

One of the best threads on here in a while.

Mike Askew 131 Veteran Poster Featured Poster

Tested it for you diafol, it logs in correctly etc authorising as myself (When I was already logged into Daniweb). Still had your member ID as the default though :( Should get that when you authorise and default to whoever is using :) Just a suggestion :D Else works fine as far as can see

diafol commented: thanks +0
Mike Askew 131 Veteran Poster Featured Poster

This could prove very interesting as the API becomes more extensive :)

Edit: However I need to figure out how to call it from C# first :(

riahc3 commented: I completely agree +0
Mike Askew 131 Veteran Poster Featured Poster

In reply to the partitioning question, there is always the risk of something going wrong, I did mine with a fresh install of OSX (at the time) just to clear the hdd of any rubbish so I didn't really need to back anything up.

I suppose its more for peace of mind as to whether or not you take the risk.

Mike Askew 131 Veteran Poster Featured Poster

It's fine to add to it, it's stickied so that it is seen regardless of how inactive it is :)

Mike Askew 131 Veteran Poster Featured Poster

I've also done something with tab controls before and hooking into the draw at run time to hide the actual tabs showing, then programatically hopping between the two. Would need to google to find it again though.

ChrisHunter commented: I've not done it myself but I've seen it done +4
Mike Askew 131 Veteran Poster Featured Poster

I'm pretty sure it's in my Daniweb contract somewhere that I have to crush dreams on a regular basis.

But but but... the Unicorn/MyLittlePony fills me with hope of happiness!

<M/> commented: haha +0
Mike Askew 131 Veteran Poster Featured Poster

Title states all.

Best wishes, don't think I will be too active over the actual period so shall say it now :)

Mike Askew 131 Veteran Poster Featured Poster

I happen to like the colour purple in general, so I guess im in the same camp as mike_2000_17.

Mike Askew 131 Veteran Poster Featured Poster

See here for a start.

Mike Askew 131 Veteran Poster Featured Poster

@C++

God no, you misinterpret me, its more of a saying.

Mike Askew 131 Veteran Poster Featured Poster

@ c++,

You may well be, but still most members will not, how to word it..., write code for you kind of thing. We are most happy to step in and see what you yourself have managed and assist, but showing some form of effort on your behalf beforehand works wonders trust me.

Mike Askew 131 Veteran Poster Featured Poster

It is also worth noting, c++ultimate, in your posts requesting help, you provide us with no code you have attempted or anything along those lines at all.

Generally when I'm trying to do something new I still have enough intelligence to google around and find some sort of code/api for what is being done and make an attempt at it. Once the attempt it made people can then help you correct what is not working and explain why allowing you to learn.

I personally, and probably speak for the majority here, do not log into this forum daily to write others code for them. I get paid to do that by my employer. I simply provide others with help when they are stuck and show some kind of effort made on their behalf beforehand.

Take your question here for example. I have no knowledge of c++ whatsoever apart from knowing cout writes to console (even then im probably wrong). The post mentions license keys and socket programming. So if you engaged brain a little we could easily work out that going to Google and searching "C++ socket programming" would teach you how to do the linking part with your computer and secondly another Google (shocking I know) of "C++ implementing licensing" returns at least two decent articles on different methods of doing it on the first page. From those two Google's alone and some brain power your question is on its way to being solved. But you have …

Mike Askew 131 Veteran Poster Featured Poster

True I overlooked at factor, presumed he was on about a lunch break :)

LastMitch commented: Yes! =) +0
Mike Askew 131 Veteran Poster Featured Poster

i want to create ap application which generates popup alerts at the day of event ocurs as well as a day before the event will occur in a specific time interval as well.. events are stored in database and they are all date fields .. so i want to link those fields to create popups .. help me .

In order to help you, you must first provide us with what you have achieved. We do not write code for you, simply correct and enlighten on mistakes.

Mike Askew 131 Veteran Poster Featured Poster

Jim you could always try something like http://ideone.com/ to help with the guessing, no clue if it is any good though!

Mike Askew 131 Veteran Poster Featured Poster
articleRichTextBox.SelectAll();
articleRichTextBox.SelectionBackColor = this.BackColor;
articleRichTextBox.DeselectAll();

Is how I've cleared selections in the past.

Raju Hasan commented: I also try this logic.But its not work still.I think i am faching problem to put code at the right position of my program +0
Mike Askew 131 Veteran Poster Featured Poster

As much as I love watching (most definately not stalking -shakes head-) this when I have spare time at work.

Would it be possible to add a drop down at the top which could isolate different sections of the website, for example only see activity occuring in the C# forum? Would be useful for monitoring the forums you can actually respond too :)

Alternatively an array of checkboxes listing all available sections would allow you to customise the feed slightly to be personal to your interests :) (Althought would look quite messy unless theres methods of doing this im not thinking about until writing this such as the ability to hide them when not wanting to change options).

ChrisHunter commented: Good idea +0
Mike Askew 131 Veteran Poster Featured Poster

Michael you and your damn bunnies are taking over! Welcome back Pamcakes. I do believe I've heard of AoC but never looked into it further!

 ,--^----------,--------,-----,-------^--,
 | |||||||||   `--------'     |          O
 `+---------------------------^----------|
   `\_,-------, _________________________|
     / XXXXXX /`|     /
    / XXXXXX /  `\   /
   / XXXXXX /\______(
  / XXXXXX /
 / XXXXXX /
(________(
 `------'

Theres a gun to kill all the bunnies with.

ChrisHunter commented: Well i guess his rabbits are going at it like... rabbits +0
Mike Askew 131 Veteran Poster Featured Poster

Riahc3, it was mentioned earlier you can quote using the '>' character at the start of the quoted sentence. No need for writing out lots of quote tags :)

Demonstration this line is the following. "> Demonstration this line is the following."

Mike Askew 131 Veteran Poster Featured Poster

As far as I am concerned, since you can't post unless you are logged in then you should not be able to enter text.

I do agree here.

Mike Askew 131 Veteran Poster Featured Poster

Technically I could do select all off paper with a scanner though ;)?

Mike Askew 131 Veteran Poster Featured Poster

Huh? How can you do select all from a piece of paper???

AD, it was meant to be read sarcastically. Apparently I didn't make it unachievable enough to easily be spotted as sarcastic :(

Mike Askew 131 Veteran Poster Featured Poster
Problem One

We could firstly here use a switch statement in the Program class, here is some sudo code for it:

output "Which wood would you like?"
output "1) Mahogany - £160"
output "2) Oak - £110"
output "Choice: "
switch statement using the read input of number 1 or 2
option 1
    set deskWood accordingly
option 2
    set deskwood accordingly

Once you've done this your then left with two guarenteed string values, one for Mahogany and one for Oak. You can then check which one of these it is and apply the appropriate cost.

Problem Two

Make a method in the Desk class that is public (allowing Program class to call it) and returns a double (allows decimal point for currency). This will then return the value of the total of all costs to the program class allowing you to output them.

-

I will happily provide help fixing any code you write from the sudo code above, just didn't want to directly provide answers as it is homework.

ChrisHunter commented: Beat me to it, switch statement would be better in... case too. +4
Mike Askew 131 Veteran Poster Featured Poster

A great example just happened to me of the shitty posting system here.....
I typed up a long post and for some reason, Daniweb logged me out. First, why does Daniweb allow me to write a post if I cant post unless Im logged it? Flaw. Anyways....
I noticed this and I tried to "Select All.........Copy" the textbox. ITS IMPOSSIBLE TO DO. Keyboard shortcuts, select with mouse and right click select/copy, edit select all copy, etc. IT DOESNT SELECT IT AND/OR COPY. And now I have to rewrite the entire post again.
And now a new bug is happening, when I post code, if I click on a certain area in the reply box, text Ive typed before, moves around to the bottom. Its just horrible.....
Let's try this again. What OS and browser are you using and what versions? You've said you're having problems with Chrome, Firefox, and IE, but there's definitely something else going on because nobody can seem to reproduce the issues to the severity that you suggest.

Surely you don't think that we'd release something as bad as the above and claim that it's not broken. :rolleyes:

Its worth noting the select all functionality doesn't work when you print the website out on a piece of paper and try do it. Why doesn't this work Deceptikon :( I want printable functionality.

In other news..

Ctrl+A, Right-Click + Select All, work as intended.

Mike Askew 131 Veteran Poster Featured Poster

I never have issues, literally post my code into the code input window after pressing the code snippet button and it is easy as that

Mike Askew 131 Veteran Poster Featured Poster

Every forum uses your regular [code][/code] but no, not Daniweb. You have to tab your code.

I spend forever tabbing code on StackOverflow.... DaniWeb isn't the only one.

Mike Askew 131 Veteran Poster Featured Poster

So what exactly are you blithering on about?

Mike Askew 131 Veteran Poster Featured Poster
            List<string> Names = new List<string>();
            List<string> SortedRefinedNames = new List<string>();
            StreamReader sr = new StreamReader(@"C:\Users\maskew\Desktop\Names.txt");
            string NameEntry;
            while ((NameEntry = sr.ReadLine()) != null)
            {
                Names.Add(NameEntry);
            }
            sr.Close();

            Console.Write("First letter of name to search: ");
            string Letter = Console.ReadLine();

            foreach (string Name in Names)
            {
                if (Name.Substring(0, 1).ToUpper() == Letter.ToUpper())
                    SortedRefinedNames.Add(Name);

            }

            SortedRefinedNames.Sort();

            foreach (string Name in SortedRefinedNames)
            {
                Console.WriteLine(Name);
            }

            Console.ReadLine();
Mike Askew 131 Veteran Poster Featured Poster

In addition to Ange1's comments the following may be of interest, the web tutorials show everything.

Mike Askew 131 Veteran Poster Featured Poster

@Agile, fair do's then, I wouldn't expect to see a female orientated game to go too far on the professtional scene etc though. Best I could think of is possibly the sims :) Thats neutral/female orientated.

Mike Askew 131 Veteran Poster Featured Poster

If the two arrays are directly in sync, ie. position 0 in array one corresponds to position 0 in array two, you can for-loop through the first array and when you find a match, use the current value of the for-loop to access the related second array value.

Alternatively you could implement a 2D array to store both name and value in one array.

Mike Askew 131 Veteran Poster Featured Poster

Welcome.

Do you know King Julian? He is also from Madagascar or so the film says :o

71139_26416503057_4870330_n

Sahil89 commented: :D +0
Mike Askew 131 Veteran Poster Featured Poster

There has been a noticeable increase in people asking where to start C# recently. So I have been across a couple of forums and pulled together a list of some useful links and resources.

Web Tutorials

Home and Learn Tutorial

CodeProject Tutorial P1
CodeProject Tutorial P2
CodeProject Tutorial P3
CodeProject Tutorial P4
CodeProject Tutorial P5

DreamInCode - Debugging

Helpful Tips

DreamInCode - How to efficiently search the Internet
DreamInCode - Debugging Tips
Little Wonders and Little Pitfalls

Useful Resources

These may be slightly more advanced than 'beginner'
C# Book Downloads
Blog - Mastering VS2010 debugging
Blog - VS2010 Debugging Improvements

MSDN resources:

C# Language Specification
Visual C# Resources
C# Reference
C# Programming Guide

LMGTFY's

Google
Bing

Feel free to contribute more / criticise current links and I will add/remove them.

ddanbe commented: Keep up the good work! +14
kvprajapati commented: Good resources indeed! +14
tux4life commented: Cookies for opening a thread to gather resources ;) +13
urvisha commented: thanks its too useful for me +0
Mike Askew 131 Veteran Poster Featured Poster
ChrisHunter commented: Couldn't be more spot on if you tried +0
Mike Askew 131 Veteran Poster Featured Poster

Because the XML is loaded on the main form we will need to do the refreshing there. You will need to refresh and then reload all the data into the right places however as just reloading the file wont do that.

If it isnt working ensure youve set the dialog result values of the apply changes button to OK if using my code.

sundog1 commented: great help! +2
Mike Askew 131 Veteran Poster Featured Poster
Mike Askew 131 Veteran Poster Featured Poster

@AD, Just tried it on my IE8, the escape doesnt work while the code box has focus, however if you click in the grayed out area around it and then press escape it closes for me.

I do have to agree though a little [x] to close it would be much more obvious to those who haven't been told how to shut it.

Mike Askew 131 Veteran Poster Featured Poster

Great minds think alike, so they say @nmaillet

nmaillet commented: Sure do. +5
Mike Askew 131 Veteran Poster Featured Poster
public class Profile
    {
        public Profile()
        {
        }
        // method
        public string getMSG()
        {
            return "What do you look like";
        }

        private string _eyecolor;
        public string eyeColor
        { // Missing this opening bracket for a property
            get { return _eyecolor; }
            set
            {
                if (!string.IsNullOrEmpty(value))
                {
                    _eyecolor = value.Substring(0, 1).ToUpper() + value.Substring(1); // Substring had a small s not S
                }
                else
                {
                    _eyecolor = value; // Typo, _eycolor not _eyecolor
                }
            }
        }

        public string getEyeColor()
        {
            return "Eye color: " + _eyecolor + "Complexion color:"; // Typo, _eycolor not _eyecolor
        }

        public string _ccomplexion;
        public string cComplexion // Again property not setup correctly
        {
            get { return _ccomplexion; } // Added get { }
        }

        private string _haircolor; // Missing semi colon
        public string hairColor
        {
            get
            {
                return "Hair Color: " + _haircolor + "Age: ";
            }
            set { _haircolor = value; }
        }

        private int _age;
        public int age
        {
            get { return _age; }
            set { _age = value; }
        }

        public string getFullProfile()
        {
        return "For a " + _eyecolor + " , "+ _ccomplexion+" and "+ _haircolor+"We suggest the following outfit"+"<br /><br /> " + "click Here"; // Missing " marks and +
        }
    }

All the errors we're completely careless ones that you could of fixed yourself. Most of them were property construction (which you managed to do perfectly once so god knows why the others were wrong) and typos.

Didn't need me to go through that and correct them all..

Mike Askew 131 Veteran Poster Featured Poster

Yeap I've seen that link also, it is pretty complex. Hence why I didnt look that much into it :)

Mike Askew 131 Veteran Poster Featured Poster

Yeap can do it exactly that way. Adaption to my code above would appear as the following:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace DaniWebWinForm
{
    public partial class Form1 : Form
    {
        DataSet DS = new DataSet();
        bool FormLoading = false;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            FormLoading = true;
            DS.Tables.Add("NameTable"); //Setup table holding names

            DS.Tables["NameTable"].Columns.Add("NameID"); // Primary key
            DS.Tables["NameTable"].Columns.Add("Name");
            DS.Tables["NameTable"].Columns.Add("Age");

            DS.Tables["NameTable"].Rows.Add(1, "Mike Jobs", "23");
            DS.Tables["NameTable"].Rows.Add(2, "Jack Starling", "24");
            DS.Tables["NameTable"].Rows.Add(3, "Sam Eker", "16");
            DS.Tables["NameTable"].Rows.Add(4, "Dani West", "20");
            DS.Tables["NameTable"].Rows.Add(5, "Steve Marvin", "31");

            // Adding the new column and programatically assigning the value
            DS.Tables["NameTable"].Columns.Add("ConCatInfo", typeof(string), "Name + ' | ' + Age");

            comboBox1.DataSource = DS.Tables["NameTable"];
            comboBox1.DisplayMember = "ConCatInfo";
            comboBox1.ValueMember = "NameID";
            FormLoading = false;
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!FormLoading)
                MessageBox.Show(comboBox1.SelectedValue.ToString());
        }


    }
}

With regards to displaying the column headers above, you can just use a label and space out the entries :)

Mike Askew 131 Veteran Poster Featured Poster

Hmm it all depends on whether or not your able to edit the DataTables as to how you approach this.

Its either add a new column to the datatable which contains a concatenation of the data you wish to display or write a custom class that overrides the combobox. Which I know there is code for on google because I've just looked at it :)

Mike Askew 131 Veteran Poster Featured Poster

Yeap I've tried that too! :p

Mike Askew 131 Veteran Poster Featured Poster

Nope the combo box was set to display the name only using the line: comboBox1.DisplayMember = "Name";, I added the Age field simply so I didnt just make two columns and assign each to a property.

Give me a couple of mins to have a play and I'll see :)

Mike Askew 131 Veteran Poster Featured Poster
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OleDb;

namespace DaniWebWinForm
{
    public partial class Form1 : Form
    {
        DataSet DS = new DataSet();
        bool FormLoading = false;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            FormLoading = true;
            DS.Tables.Add("NameTable"); //Setup table holding names

            DS.Tables["NameTable"].Columns.Add("NameID"); // Primary key
            DS.Tables["NameTable"].Columns.Add("Name");
            DS.Tables["NameTable"].Columns.Add("Age");

            DS.Tables["NameTable"].Rows.Add(1, "Mike Jobs", "23");
            DS.Tables["NameTable"].Rows.Add(2, "Jack Starling", "24");
            DS.Tables["NameTable"].Rows.Add(3, "Sam Eker", "16");
            DS.Tables["NameTable"].Rows.Add(4, "Dani West", "20");
            DS.Tables["NameTable"].Rows.Add(5, "Steve Marvin", "31");

            comboBox1.DataSource = DS.Tables["NameTable"];
            comboBox1.DisplayMember = "Name";
            comboBox1.ValueMember = "NameID";
            FormLoading = false;
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (!FormLoading)
                MessageBox.Show(comboBox1.SelectedValue.ToString());
        }


    }
}

Simple WinForms App using one combo box.

Everytime you select a name from the combo box it will display the NameID field value related to that name. Hope that helps you understand :)

Mike Askew 131 Veteran Poster Featured Poster

The DisplayMember and ValueMember settings of the combo-box allow you to make the display value different to the selected one.