« first day (1429 days earlier)      last day (3534 days later) » 

12:04 AM
When I declare an int variable, does it automatically initialize it to 0?
nvm, thanks google.
 
 
3 hours later…
3:25 AM
@KendallFrey ok man I wrote that program you told me to do for practice
I even did the bonus add a computer opponent part.
 
 
1 hour later…
4:47 AM
Hey guys is there such a thing as a service that can compile c#. Net winforms code and show you a picture of the output online? Kinda like jsfiddle but for c# winforms
 
 
6 hours later…
10:19 AM
Wow you guys are quiet tonight lol.
 
11:09 AM
Why OwinStartup doesnt work with Individual Authentication in ASP.NET MVC 5?
I am new in ASP.NET MVC and I want to make a chat application using SignalR. I have successfully crated a sample application with No Authentication by following Asp.net tutorial guid. Now I am trying to make that same application but, with Individual Authentication. So, user can log in and start chatting.
____
The problem what i am getting is that when i use OwinStartup attribute to make my class as startup class it doesn't work. It doesn't get started. If i try to use that same code in another application which is created with **No Authentication**. then it works fine.
 
 
3 hours later…
1:58 PM
@baeltazor This room is dead on weekends and nights. I think most people use it as a workplace distraction.
 
 
1 hour later…
3:10 PM
Hello
Why does this not work:
public static String Format(this String str, object[] args)
        {
            return String.Format(str, args);
        }
"Hello {0}".Format("World");
And this does:
public static string Join<T>(this IEnumerable<T> items, string sep = ",")
        {
            return string.Join(sep, items.Select(x => x.ToString()));
        }
MyList.Join(",");
> Cannot access static method 'Format' in non-static context
@KendallFrey hilf
 
how can i convert a aspx to pdf . i need to convert only partial not full page..like i dont want o convert the nav anf menu etc items
any body please help
!
 
@Mosho does string.Format have an overload that takes those arguments? (Try varargs)
Look up the params keyword
 
3:50 PM
Anyone want to review some async?
 
4:26 PM
@Greg Do I have to understand it?
 
Not sure.
    public class LogToTextfile : ILogger
    {
        #region Private:

        private BlockingCollection<Log> queue = new BlockingCollection<Log>();
        private bool running = false;

        #endregion

        #region Constructor:

        public LogToTextfile(Log loggable)
        {
            if (!File.Exists(ConfigurationManager.AppSettings[@"TextLog"]))
                File.Create(ConfigurationManager.AppSettings[@"TextLog"]);

            var thread = new Thread(() =>
            {
 
Welp
Not sure what the #region thing is.
Actually I don't know what I'm looking at.
I mean my name is Token coding newbie...
 
Well, #region is used to organize your code.
Some people don't like it, as it "hides" code.
 
Ah, I mean I kind of get the code, but I don't if it makes sense.
 
?
 
4:32 PM
I can read it, but I don't get it?
 
don't use regions imo
 
With the region hate.
 
destroys ctrl + m + o
 
Can I show show code? I'm sure it's terrible and I'd like suggestions.
 
put it in a gist if it is big
 
4:33 PM
@JohanLarsson Is that proper Async?
@Tokencodingnewbie Okay.
 
Please be kind.
Kendall Fray had me write it for practice, he said to write bad code to appreciate good code.
It's pretty much one big ifcheck, not sure if that's propoer.
but you know suggests, nudges in the right direction would be sweet.
 
@Tokencodingnewbie Well, you'll appreciate good code when your forced to maintain horrible code.
 
@Greg no async in the sample?
the one where you start a thread?
 
Yeah, is it proper threading. Isn't threading perform similar boost to performance as Async
 
File.Create(ConfigurationManager.AppSettings[@"TextLog"]); // looks strange, pretty sure it returns a stream
@Greg Async is often confused with threads, in clean async no threads are started
 
4:37 PM
Oh, I assumed the same thing.
 
also starting a thread for doing little work most likely hurts performance
with all performace stuff the profiler is your friend
 
Really, well I'm trying to build a logging mechanism that will take a large chunk of logs and separate then write the data out.
 
check out streamwriter's WriteAsync methods
@Tokencodingnewbie I would try to split it up in smaller methods with descriptive names
 
like public void determineHigher()?
Something like that?
 
purrhaps
if (game.guessComp < game.number)
{
    Console.WriteLine("The computer picks a number...");
    game.lastGuessComp = game.guessComp;
    game.playerTurn = true;
}
if (game.guessComp > game.number)
{
    Console.WriteLine("The computer picks a number...");
    game.lastGuessComp = game.guessComp;
    game.playerTurn = true;
}
^ looks strange, why not !=?
 
4:48 PM
I don't know, I just copied and pasted what I wrote above for the player, never thought about that.
k just made it an if else instead.
 
but you do the same thing in both no?
 
why not just one if (game.guessComp != game.number)
 
if (game.guessComp == game.number)
                    {
                        Console.WriteLine("The computer picks a number...");
                        Console.WriteLine("The Computer wins!");
                        Console.ReadLine();
                        game.guessed = true;
                    }
                    else
                    {
                        Console.WriteLine("The computer picks a number...");
                        game.lastGuessComp = game.guessComp;
                        game.playerTurn = true;
 
better
 
4:50 PM
So it isn't excessive ifchecks?
I thought it seemed like a lot of them.
 
I didn't read the code very closely
 
oh ok.
Well at least it didn't set any alarms off haha.
 
Program game = new Program(); This one screws with me
You should put the properties you want into some other class then the Program class
 
So make a game class? Is that wrong how I did it?
 
Ya outside the program class GuessingGame
Then you will make a game of Type GuessingGame
and not a game of Type Pogram
You are close to getting One call of
Console.WriteLine("Guess a number between 1-100\r");
Why not set isFirstPlayerGuess=false outside the loop you can rewrite that first part
 
5:05 PM
I'm not sure what you mean by the last part?
Why would I rewrite it?
 
if (!game.isFirstPlayerGuess)
                    {
                        Console.WriteLine("Guess a number between 1-100\r");
                        Console.WriteLine("Last number guessed " + game.numberTable.Last() + "");
                        if (!game.isHigher)
                        {
                            Console.WriteLine("(lower)");
                            game.guess = int.Parse(Console.ReadLine());
                        }
                        else
                        {
That part to re-write when you know that its the First Guess instead of not knowing
 
You mean to just have it be (if game.isFirstPlayerGuess) instead of !
?
 
Right now you are doing an IF check for one case - When it is the first time they play
 
Yah
I wasn't sure how else to do it, didn't want it printing the other information on the first guess.
 
Console.WriteLine("Guess a number between 1-100\r");

                        if (game.LastGuess > game.ThisGuess)
                        {
                            Console.WriteLine("Last number guessed " + game.numberTable.Last() + "");
                            Console.WriteLine("(lower)");

                        }
                        if (game.LastGuess < game.ThisGuess)
                        {
                            Console.WriteLine("Last number guessed " + game.numberTable.Last() + "");
Using bool is not always the best case
 
5:19 PM
Wouldn't that still print the lower part since it automatically initializes to zero?
 
ya updated it there - ;-)
you should use TryParse not Parse
 
Is it not printing that if checks on the first try because they both = 0?
 
yep
 
@Tokencodingnewbie I only read a fraction
 
5:42 PM
@JohanLarsson I appreciate you even looking at it.
Thank you all.
One question though: Since I want to put all my fields in a separate class do I put the methods for the game logic in there too? or leave that in program? Also why do I want to put the fields in a separate class?
 
put the fields where they are used
would not make much sense to have them in one class and use them from another
the name for that is feature envy
 
Well someone said this above.
Program game = new Program(); This one screws with me
You should put the properties you want into some other class then the Program class
 
This guy raps like his parents jerked him
He sounds like Eric Sermon, the generic version
This whole crowd looks suspicious
Its all dudes in here, except for these bitches
So Im a German, Eh
Thats ok, you look like a fuckin worm with braids
These Leaders of the Free World rookies
Lookie, how can 6 dicks be pussies

Talkin bout shits creek
Bitch, you could be up piss creek
With paddles this deep
Your still gonna sink
Your a disgrace
Yeah, they call me Rabbit
This is a turtle race

He can't get with me spittin this shit
 
 
4 hours later…
9:59 PM
Hey
 
10:10 PM
Hello
Have you ever used a code generator?
 
10:47 PM
class Program
    {
        static Random rand = new Random();
        private int number = rand.Next(1, 100);
        private int guess;
        private int guessComp;
        private int lastGuessComp;
        private int lastGuess;
        private bool guessed;
        private bool playerTurn = true;
        private List<int> numberTable = new List<int>();


        static void Main(string[] args)
        {
            Program game = new Program();
 
No, how come?
 
Why do I have to make an object reference if I'm using all the same propertys of the class?
 

« first day (1429 days earlier)      last day (3534 days later) »