Mike Askew 131 Veteran Poster Featured Poster

I realise I have asked the dumbest question ever, just dawned on me the EndGetResponse returns a HttpWebResponse object.... It's early I tell you!

Mike Askew 131 Veteran Poster Featured Poster

Can you not just restrict access to the folder holding your backups via user permissions on the OS?

savedlema commented: Ok, thank you. +2
Mike Askew 131 Veteran Poster Featured Poster

Hi All

We are having an issue where a WSDL is loading another WSDL into it when we call it. This call takes a while on the first call which normally causes failures across the application during testing. One option we are looking into is pre-caching the WSDL in IIS prior to the server becoming available in the load balancer.

Does anybody have any knowledge around how WSDL caching behaves in IIS?

Couple of questions I am trying to figure out:
1) How long does a WSDL stay cached for once it is first called
2) Does IIS cache the WSDLs by default?

Cheers

Mike

Mike Askew 131 Veteran Poster Featured Poster

I like it!

But from a readability perspective in my opinion the for-loop is better. Can't skim read over the given extension example and know what it does too easily.

Mike Askew 131 Veteran Poster Featured Poster

THE issue Prit, god people these days.

xD

Mike Askew 131 Veteran Poster Featured Poster

Been running a couple of article queries this morning.

When running http://www.daniweb.com/api/articles?forum_id=61 I encountered what looks like a bug.

The 11th thread reply coming back in the query is the following:

{
   "title":"please help me  .........",
   "related":[
    {
     "id":""
    }
   ],
   "posters":[
    {
     "id":"1098860"
    },
    {
     "id":"46588"
    },
    {
     "id":"1091071"
    }
   ],
   "uri":"http:\/\/www.daniweb.com\/software-development\/csharp\/threads\/472052\/please-help-me-",
   "id":"472052",
   "forum":{
    "id":"61"
   },
   "replies_count":"2",
   "views_count":"20",
   "first_post":{
    "timestamp":"1390849755",
    "id":"2060455",
    "poster":{
     "username":"0914541592",
     "id":"1098860"
    },
    "raw_message":"2.\tAn integer greater than 1 is said to be prime if it is divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime numbers, but 4, 6, 8 and 9 are not.\na) Write a function that determines whether a number is prime.\nb) Use this function in a program that determines and prints all the prime numbers between 2 and 1,000.\nc) Initially, you might think that n\/2 is the upper limit for which you must test to see whether a number is prime, but you need go only as high as the square root of n. Rewrite the program and run it both ways to show that you get the same result.\n"
   },
   "type":"threads",
   "last_post":{
    "timestamp":"1391014107",
    "id":"2061046",
    "poster":{
     "username":"humorousone"
    }
   }
  },

Note how in the related threads section, it shows a thread is returned however no ID for this thread is actually given (Line 5).

When looking at the actual forum thread (http://www.daniweb.com/software-development/csharp/threads/472052/please-help-me-) there are 10 related articles shown on the side.

Also if I run http://www.daniweb.com/api/articles/472303 which is the direct query …

Mike Askew 131 Veteran Poster Featured Poster

Running Dani's profile as an example I get the JSON back containing:

"education":[
 {
  "key":"education",
  "value":"B.S. Computer Science",
  "organization":"Hofstra University",
  "start":"September 2000",
  "end":"December 2005",
  "description":"I majored in Computer Science and minored in Business Computer Information Systems. I was in Upsilon Pi Epsilon, the Computer Science Honor Society run by the ACM and IEEE. I TA'ed multiple Computer Science courses and also worked as a private tutor. I almost double-minored in chemistry and subsequently won an award from the American Chemical Society. I founded DaniWeb my sophomore year of college after getting frustrated that I was one of the few department tutors and there was no where available for me to get help myself. Upon its success, I finished my last year and a half of school taking part-time night courses and focusing on DaniWeb fulltime, ultimately completing my 4-year degree in 5.5 years with a business to go into upon graduation.",
  "id":"3"
 },

Should it not be:

"education":[
 {
  "DEGREE":"education",
  "SCHOOL":"B.S. Computer Science",
  "organization":"Hofstra University",
  "start":"September 2000",
  "end":"December 2005",
  "description":"I majored in Computer Science and minored in Business Computer Information Systems. I was in Upsilon Pi Epsilon, the Computer Science Honor Society run by the ACM and IEEE. I TA'ed multiple Computer Science courses and also worked as a private tutor. I almost double-minored in chemistry and subsequently won an award from the American Chemical Society. I founded DaniWeb my sophomore year of college after getting frustrated that I was one of the few department tutors and there was …
Mike Askew 131 Veteran Poster Featured Poster

What error do you get and on which line does it occur?

It is difficult to help when you provide us with minimal information regarding the error.

Mike Askew 131 Veteran Poster Featured Poster

Did I miss something in how this works?

Assumption was that it would be like the usual notification emails but allows you to reply to the thread via the email.

Instead I seem to be getting emails allowing me to reply to new threads in the community center than I am not even watching (as email received when they are made)

If the latter is correct and not a bug, I think I will go back to the old fashion method, I prefer not to have too much flooding on my inbox :)

Mike Askew 131 Veteran Poster Featured Poster

i think you can add value of label in query string . and on page load event just check if it is post back then get the value from query string and set to label :P .

This would of course allow it to be changed by the user by editing the URL bar, causing security implications. Not sure if that would cause problems for the OP; Depends upon what information is being maintained between pages.

Otherwise a fine suggestion.

Mike Askew 131 Veteran Poster Featured Poster

A good attempt. Some improvements can be made which should help you progress your programming knowledge.

Firstly when converting anything from one type to another we need some form of exception handling in place. Otherwise if I entered a letter your program would fall over.

Here we can make use of the bool int32.TryParse(string, out int); function to check if the string entered into the console can be converted to an integer.

Using the following code block we can do this:

Console.Write("Enter First Value: ");
while (!Int32.TryParse(Console.ReadLine(), out ValueOne))
{
    Console.WriteLine("Please enter a numeric value!");
    Console.WriteLine();
    Console.Write("Enter First Value: ");
}

We get the first value off the user. The .TryParse then attempts to convert the Console.ReadLine() to an integer, with the out parameter being set to the value of the successful convert.

This method also returns a bool depending on successs or failure. Therefore I can use this to control the while loop that enables multiple entries of the value until it successfully converts to an integer.

One other thing I picked up on was your use of the newline character at the end of your Console.Write() calls. There is infact a method to do this for you called Console.WriteLine() which will automatically drop to a new line at the end of its sentence.

For example:

Console.WriteLine("Before swap ValueOne: {0}; ValueTwo: {1}", ValueOne, ValueTwo);

Here would be the full code for what you did including error handling and the tidy up of Console.Write():

static …
ddanbe commented: Fine explanation. +15
Mike Askew 131 Veteran Poster Featured Poster

Lol, i never use it ;D I am too lazy to click the green check and edit ;D

I guessed, it's quite obvious.

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

Dani has already made that, it is on your toolbar (the green checkmark)

Well it didn't fix yours, I presume it is spelling not grammar :)

Reverend Jim commented: Hah! +0
Mike Askew 131 Veteran Poster Featured Poster

UK, shit, enough said.

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

Don't see the point, would most likely be a drain on the servers and most people would do dev in an IDE.

Maybe we should get an automatic grammar fixing device also :D

Mike Askew 131 Veteran Poster Featured Poster

At least he isn't creating bogus accounts and endorsing himself. That would be pretty low.

Or posting random questions in the Geeks Lounge to boost their ego, forgot that one too!

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

Of course we cannot forget to thank the teacher or whomever of hxn xfir for providing us, bored at work, with this now fun little competition.

I need to tidy my code up a bit and rethink my logic clearly!

Mike Askew 131 Veteran Poster Featured Poster

Haha god damn my method is looking extremely bad now xD

Mine is based off a loop and identifying the last number added to the sequence, was bored and had nothing to do at work :p

static void Main(string[] args)
        {
            // Works up to 10
            int NumberOfNumbersToAdd = 5;

            #region Don't need to change these
            string Output = "";
            int Padding = (NumberOfNumbersToAdd * 2) - 1;
            #endregion

            if (NumberOfNumbersToAdd * 2 >= 20)
                Padding++;

            for (int i = 1; i != NumberOfNumbersToAdd; i++)
            {
                if (Output.Length == 0)
                {
                    Output = "1";
                    Console.WriteLine(Output.PadLeft(Padding, ' '));
                }

                if (Output.Length > 0)
                {
                    int CurNum = Convert.ToInt32(Output[Output.Length / 2].ToString());
                    int NewNum = CurNum + 1;
                    Output = string.Concat(Output.Substring(0, Output.LastIndexOf(CurNum.ToString()) + 1), NewNum, Output.Substring(Output.LastIndexOf(CurNum.ToString())));
                    Console.WriteLine(Output.PadLeft(Padding, ' '));
                }
            }

            for (int i = 1; i != NumberOfNumbersToAdd; i++)
            {
                int CurNum = Convert.ToInt32(Output[Output.Length / 2].ToString());
                Output = string.Concat(Output.Substring(0, Output.LastIndexOf(CurNum.ToString()) - 1), Output.Substring(Output.LastIndexOf(CurNum.ToString()) + 1));
                Console.WriteLine(Output.PadLeft(Padding, ' '));
            }

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

Well I've just done it for fun, was interesting. My code is probably messy but oh well!

Show us what you have done and we can help.

ddanbe commented: naughty! ;) +15
Mike Askew 131 Veteran Poster Featured Poster

I second the opinion that it is a wannabe kid :3

Mike Askew 131 Veteran Poster Featured Poster

I can't replicate your issue.

Works fine with:

            Console.Write("Enter your text: ");
            string Input = Console.ReadLine();
            Input = Input.ToLower();
            string Result = Input.Replace("remove", "");
            Console.WriteLine("Edited text: " + Result);
            Console.ReadLine();

Sentence: "There is one word to remove in this sentence"

Tested with "remove" and "removed", remove worked, removed didn't.

Mike Askew 131 Veteran Poster Featured Poster

Could you highlight which line the error occurs on, Tinstaafl is correct about the alternate way to change the value also though :)

I find it odd that you would get an object not initialised error in the code block you linked as it is specifically initialised on line 4 to be a new empty list.

Mike Askew 131 Veteran Poster Featured Poster

You almost had it and had the correct idea moving the list declaration outside of the switch function, the small details are what caught you out though!

string board = "1";

// Here we declare an empty list called icons
List<string> icons = new List<string>();

switch (board)
{
    // We then re-initialise the list depending upon case
    case "1":
        icons = new List<string>() { "!", "!", "N", "N", ",", ",", "k", "k", "b", "b", "v", "v", "w", "w", "z", "z" };
            break;
    case "2":
        icons = new List<string>() { [Different String Set Here] };
            break;  
}

In the above code we declare the icon list once outside of the switch statement;

Within each case statement we simply re-instanciate the list with a new value set instead of fully re-defining it each time which was the original cause of the error.

Mike Askew 131 Veteran Poster Featured Poster

IIRC, calling something along the lines of this.Refresh(); after line 135 will force the form's redraw event before the thread continues and sound plays.

Mike Askew 131 Veteran Poster Featured Poster

Right so I've done some toying around this morning. Seems I misunderstood how the sound play works slightly. The .wav is played on its own thread automatically.

Mike Askew 131 Veteran Poster Featured Poster

If no one else comes up with the code I will have a toy at work tomorrow if I get time and see if I can get a rough example done

Mike Askew 131 Veteran Poster Featured Poster

The Sleep function will pause the current thread it is called on. As this is the UI thread from what I can see it will simply 'pause' the entire program for that amount of time.

You could use a background worker or second thread to handle the sound being played and then when you sleep that thread it would not impact the turning over of the cards on the main UI thread.

Mike Askew 131 Veteran Poster Featured Poster

http://www.connectionstrings.com/

Why is the application config unsecure in your situation? It is better practice to put the string here than inside the application so that it can be changed without re-compiling as you deploy to different environments.

See the section in this MSDN article where it discusses encrypting the application config connection string.

ddanbe commented: Good advice. +14
Mike Askew 131 Veteran Poster Featured Poster

Putting the connection string the application config file is good practice and will allow for such changes without needing a re-compile of code.

Begginnerdev commented: Yep! +9
Mike Askew 131 Veteran Poster Featured Poster

100+ endorsements, of which a at least 7 in each category are from a subset of accounts that appeared about 7 months ago, endorsed him and upvoted, and then became inactive again and haven't been seen since.

Mike Askew 131 Veteran Poster Featured Poster

i have about 18 years of expirience banging tables :P only reason i dont have a drumkit at home is because of how quiet my neighborhood is , and how much the neighbors would like to keep it that way. I played guitar , until the neck bent and now tunes drop even with half-hours strumming. :(

Get an electronic drum kit, I have a Roland one and you can play through headphones when needed or an amp.

Mike Askew 131 Veteran Poster Featured Poster

Is it possible to stop the chat input box from remembering history? It is highly irritating :D

Tried a quick fix using autocomplete="off" in the <form> tag of the html and it worked fine in terms of turning off the autocomplete however it stopped the chat entry box from clearing on submit so feel there would be a further tweak required.

Mike Askew 131 Veteran Poster Featured Poster

Presume you did a fairly decent google yourself as you have a brain.. I can't find anything either, the User32.dll is required for bringing the window to front as far as I can see, can find a process using the Diagnostics.Process class or through the User32.dll though.

Mike Askew 131 Veteran Poster Featured Poster

Sadly they have invented VPN, so even if the offices are all magically shut due to something we can all still work :(

nitin1 commented: hahha.... :p VPN :p +0
Mike Askew 131 Veteran Poster Featured Poster

I can add my personal experiences here.

I did not go to University either after finishing Sixth Form.

I applied for a Higher Apprenticeship with Capgemini UK while in college along with the usual university applications. The HA programme does not require any prior knowledge of programming at all (however I also studied programming at sixth form) and offered a 10 week intensive course in the language they wished us to know (C# in my case) before dropping us straight into live projects with extensive support mechanisms in place.

I had an offer from my university of choice, Essex, to study computer science. I also however got the opportunity to work for Capgemini after being successful with my application to the programme and have been working for them for two years now. I will still be getting a degree through them over the five year programme at no expense to myself along with earning an alright salary (scaling up with progression through the company) and getting highly valuable industry experience in a Tier 1 consultancy firm.

Best move I have made in my life so far was declining university and doing what I do now, whereas people will be coming out of university with degrees approximately two years before myself I will have 3 years experience over them and nowadays companies look for that also with equal if not more value.

I can only speak from a UK point of view but I am certainly aware of a few companies …

Mike Askew 131 Veteran Poster Featured Poster

Noticed the other week that once you cancel sponsorship (for whatever reason) that you lose all recognition of helping the site at all in terms of running costs.

Can we introduce a 'Past Sponsor' badge or something along those lines so that those who have given but currently can't for whatever reasoning is still acknowledged for what they have done in the past for Daniweb?

Mike Askew 131 Veteran Poster Featured Poster

@Saqlainz, there is no right or wrong in programming, multiple techniques in the end lead to the same result.

Only better/worse practices and more/less efficient techniques.

Mike Askew 131 Veteran Poster Featured Poster

Why resurrect a 5 month old thread that you could've replied to sooner if you wanted to?

Mike Askew 131 Veteran Poster Featured Poster

Your issue lies in the <xsl:otherwise>.

You are selecting the current node Application/Comment with <xsl:apply-templates select="."/> and then applying templates against it, triggering an infinite loop as this simply calls the same template over and over, eventually running out of memory causing the stack overflow you are seeing.

Tested this within Visual Studio debugging the XSL as best I could with the data provided and was able to recreate the issue.

Mike Askew 131 Veteran Poster Featured Poster

As far as I can see, to develop applications using OAuth we need to own server space to host a site?

An application, when registered to DaniWeb, requires a URL to be provided. A desktop application obviously doesn't have one of these.

When sending OAuth requests we have to provide a redirect URL on the domain we registered the application too, therefore if we dont have the domain as its a desktop application, we cant OAuth, correct?

Only way round figured on the IRC was to own web space to allow a page on a webserver as intermediairy for the redirect to go to.

Is this the intended case?

Mike Askew 131 Veteran Poster Featured Poster

What do you think this is? Ancient Rome?!

No, THIS... IS... SPARTA

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

Nope, still not understanding why my hello world isn't working... I think I'm unlearning.

What've you got so far? I'm sure the forum can help you out!

Mike Askew 131 Veteran Poster Featured Poster

In the past year I have moved from a hello world application in c#, to confidently using if-else statements to write different outputs, still including hello world.

Ketsuekiame commented: Absolutely awesome. Wish I could do that! :D +0
Mike Askew 131 Veteran Poster Featured Poster

but I can't speak it and it's not an easy job for me to write in it.

You are doing a good enough job of conveying your points, I've seen alot worse attempts at the English language than yours :)

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

“A session of boasting won't attract any real friends. It will set you up on a pedestal, however, making you a clearer target.”

Richelle E. Goodrich

Mike Askew 131 Veteran Poster Featured Poster

ToS Snippet

Posts contributed to the community immediately become the property of DaniWeb upon submission

You are correct HiHe.

Mike Askew 131 Veteran Poster Featured Poster

Nothing I believe in the case you have shown, however using the second example you can catch specific kinds of exceptions. For example:

try
{
    //Some code
}
catch(NullReferenceException Ex)
{

}

Would catch any exceptions of type NullReferenceException

Mike Askew 131 Veteran Poster Featured Poster

It will probably have to be done along the same lines as this for starting and writing to Wordpad.

Mike Askew 131 Veteran Poster Featured Poster

Adding to Jim's comment, the accounts under suspicion are all the only ones to endorse you in C#, a language you have self-admitted only just starting to learn which is evident by the questions you have posted on trivial issues. Therefore the endorsements are hardly earnt within the forum and it may appear misleading to those who see your name on the bottom of the forum and follow advice you give, if any. Not saying that definately happens but it is a possible outcome.

Mike Askew 131 Veteran Poster Featured Poster

Note the first mention of column is singular and the second is plural. Is that mistake in the code?