« first day (1430 days earlier)      last day (3521 days later) » 

12:48 AM
Is it because Main is static?
 
1:20 AM
Hi @Tokencodingnewbie, I just saw your code. If you wanted to save a bit of time with typing, instead of declaring `private int` a million times, you can just do it once, like this:

`private int number = rand.Next(1, 100), guess, guessComp, lastGuessComp, lastGuess;`
 
@baeltazor Oh sweet, thanks!
With the = sign?
 
@Tokencodingnewbie If you have a look at the first private int in your code sample above, notice how you're assigning a value to it? You're assigning rand.Next(1, 100) to private int number. So if you don't wanna assign anything to it, you can just have private int number, guess, guessComp, lastGuessComp, lastGuess; :)
= is the assignment operator in C#, so (I think you already know...) when you wanna assign a value to a variable, you do (e.g.): private int number = value;
 
ok for some reason I was thinking it would assign everything to the right of it.
 
You only need the = sign if you want to assign a value to a variable right away.
Nah, because you're separating it all with the commas
 
I understand now.
Any other suggestions?
 
1:26 AM
@Token Your question, it's for a Console app, right?
 
Yes.
I figured it's best to practice without messing with the damn UI
 
Lol, yeah. If you don't need the UI, then Console is must simpler and quicker to test things.
So can you explain what you'
're trying to do in this line here?

Program game = new Program();
 
I didn't know how to access my fields without it.
When I don't have it it gives me this
Error	15	An object reference is required for the non-static field, method, or property 'ConsoleApplication2.Program.guessed'
 
@Tokencodingnewbie You'll need to make your fields private static - not just private.
Then you can get rid of Program game = new Program();
 
Why would I make them static though? Is that proper?
I thought static meant they never changed.
 
1:39 AM
I think it's fine. I don't really remember if it's proper or not but I think it's better than creating a new instance of Program. Alternatively, you can do this which will give you your desired result:

static void Main(string[] args)
{
Program game;

if(game.guessed) { Console.WriteLine("Yay"); } else { Console.WriteLine("Aw :("); }
}
 
Well you are not the first to bring up the object reference in that first line.
 
@Tokencodingnewbie Yeah, it's been a while for me, so I'm a little rusty with some details. Sorry about that.
 
It's fine.
I suppose I should change it.
Is there a way in visual studio that I could change all my game references to Program instead.
instead of doing it manually
 
The only difference really between static and non-static is that static code cannot be instantiated. So I really don't see why there would be any problem with using static variables outside of Main in a Console app. Plus, you can still access them if they're private static so you've got the code safety there still too
 
Oh I found a way to do it.
Sweet
 
1:54 AM
@Tokencodingnewbie I just realised I missed one of your messages. You said you thought that static variables couldn't be changed. That's not right. static variables can be changed. But they cannot be instantiated. For example, you cannot do something like:

static class game() { ... } static void Main(string[] args){ game g = new game(); } with static.

But if it's not static, then yes, you can do this: game g = new game();

I think what you were thinking was const. You can't change const. const = constant, so by definition, it cannot be changed.
 
So why not use static for everything?
 
@Tokencodingnewbie well, like with everything else, there's always a reason not to use it. E.g. static classes should only be used if its members themselves are static. msdn.microsoft.com/en-us/library/79b3xss3(VS.80).aspx has more info
 
Hows it looking now?
I glanced over that, reading doesn't make much sense to me without putting it into practice.
 
It's looking good.
You can safely remove Program. from things like Program.playerTurn and Program.lastGuess etc, because you're using static fields. You can leave Program there if you like but it will save you a bit of typing in the long run
 
2:11 AM
Sweet, so I guess this practice code is done.
Now what? haha
 
Lol, well I guess you could expand on it... Maybe limit the number of guesses the player has and keep a scoring (scoreboard) system?
and maybe save scores/points to file so you can load history next time you play
 
Hi all,
Can any one help me out..
I wanted to have a Line Chart .. The Data to be loaded from sqlserver to that Line Chart..
One can drag the Line chart values and adjust them..
Once after adjustment of line chart, the Values to be updated to the same table..
Is there any tools available for this ?
 
2:29 AM
hi, I have a more architectural type question. I have a web app that has a form on just about every page. In order to make sure each form renders the same, as to make changes easier, I want to render all of my form controls in c# in a central place so if I need to add a class to the input or change something, I only have to do it once.

At the moment, I am just using a load of static classes like TextInputHelper, CheckboxInputHelper etc that use StringBuilder to build up the HTML and returns a string to my view.
 
 
5 hours later…
7:40 AM
dead in here
 
Nah, monday morning, the moment when the zombies begin to live again.
 
Oh, I thought nobody was here.
Mornin'
 
What's the point in having a custom event handler based on an action performed when you already need and have an event handler in order to raise your custom event??? I want my own event for a Switch control called "Switched" but it gets fired when you click the control. But in order to raise my own event, I have to subscribe to the MouseClicked event, so basically it's just adding an extra step before the function gets called.
what I mean is...

when user clicks control > launch custom event > then fire off the code

that's kinda useless
 
8:24 AM
where's Squiggle when you need him T_T
 
8:35 AM
hi, morning all
 
o/
@RoelvanUden You ain't kidding.
@Steve Yes it's called don't use web forms.
 
mornin sipps
 
Moooornin'
 
ffs
I can't install SDK components
 
for?
 
8:45 AM
windows 7 and .net framework 4
 
Why?
 
not sure, I keep getting an error which gives no information at all
 
Which is what?
 
What's in ConfigDetails.htm?
 
8:53 AM
can't find it anywhere
 
@RoelvanUden Do you use n-architecture for yo' projects?
@Shaun Not sure really, consult google :D
Is that relevant?
 
@Sippy Sort of.
But not really in the formal sense.
 
@RoelvanUden How d'you mean?
 
@Sippy I don't have a dedicated logic tier.
 
I've only been taught to use no architecture, or to use formal n-architecture so far, just wondering how else people do it :)
Ah so you have a DAL and a model project then do business logic inside your application project?
 
9:01 AM
@Sippy In MVC I use Views, Controllers and an abstracted UoW/Repository directly tied to an EF context. I don't decouple that any further, my controllers have Linq queries in them and I think that's OK :-)
If I have a complex query I repeat, I make a query object.
 
@RoelvanUden Fair enough, that's what this project looks like almost exactly, cos I did it when I didn't understand n-architecture entirely. Just wondered what kinda flexibility there is around it ^_^
My point is that if it isn't wrong then I needn't change it.
 
@Sippy Whatever you prefer, depending on the size of the project and team. If you want to have multiple teams working on it, you probably want a more formal n-tier. If you have a smaller team (less than 10 people or so I'd say), then this is more than fine.
 
@RoelvanUden I'm a 1 man team! :D
For this project anyway, it's one of those throwaway temp applications that ends up getting used for a decade.
 
That's often how it goes, yes..
That's what my context looks like :P
 
I've never used that # notation before, or that method of defining a context haha
Will have to read up on contexts
 
9:07 AM
Well I just have a bunch of IQueryables
 
Hmm
My paging buttons in gridmvc aren't using their css
>_>
 
Is windows SDK generally installed when you install vs?
 
9:27 AM
@Shaun PASS.
 
9:43 AM
Hi. Anyone please have a minute to help me implement my Javacript plugin into MVC Page?
 
9:54 AM
@RoelvanUden Getting a bit better with this gridmvc plugin now, SO POWAFUL
I freakin love it
 
Hi guys, any resource reference for how to maintain versions and release notes for a enterprise apps ?
 
@Yoda ?
 
10:10 AM
@Sippy I want to learn how to properly manage versions/releases of web and apis for enterprise apps.
stuff like assembly version, product version, etc.
 
where's squig when you need him ._.
 
Mornin' all
 
does MVC and shit use tracing?
@Sippy
 
@Shaun Tracing?
 
oh, I guess it's a wcf thing
System.Diagnostics.XmlWriterTraceListener
ActivityTracing etc o-O
 
10:17 AM
It exists in MVC but I've never used it.
 
Oh.
Has anyone else?
 
@RoelvanUden might've done.
@Yoda uhhhm, there's a best practice doc for RESTful APIs somewhere, I'll see if I can find it.
 
@Sippy ok thanks. I've found this stackoverflow.com/a/3905443/1211329 which is a good starting point
 
That's the best design practices for RESTful API docs, including how to deal with versioning
 
cheers. I'll read that pdf.
 
10:27 AM
Ah I think you might be asking a different question than I just answered, actually.
 
got tracing working \o/
 
In MVC?
 
WCF
 
Ooo
 
think they work the same way tho
 
10:44 AM
No idea
I'll be coming to you on that one if I ever need it ;)
 
fine ;D
when it says No symbols have been loaded for this document when debugging
does that mean debug is not going to work ._. @Sippy
 
Means you did something wrong
 
I still get an error when I try to debug tho
so do I just ignore that chat bubble thing
or whatever the fuck it's meant to be
 
Do you have layers?
Like I was talking to roel about earlier
 
I have no idea what those are
 
10:51 AM
Separate projects in your solution
For different things
 
oh yes
two projects
 
Clean and build all of them
 
okie
 
See if that makes a diff.
 
nope :c
 
10:55 AM
Are both of the projects applications?
You might need multiple startups
 
well technically there's 3 projects
1 which is all UI, service, then relayservice
when I downloaded it from tfs the startup project was set to service
would that setting carry on over or is that just the default?
 
Dunno
But if your UI calls stuff from the relay service and the relay service isn't running, then no symbols.
So maybe ask someone on that project how you'd go about debugging it.
 
11:51 AM
Hey everyone :) How you all?
 
12:01 PM
Hi
 
Ohai bael
 3 Everyone else who worked on this is shit at coding - sep 11 at 16:10 by Sippy
 2 You're like the Roel van Uden of web services. - sep 12 at 13:00 by Sippy
 3 stackoverflow.com/questions/25750930/… - sep 10 at 16:30 by Sippy
Look at all my staaars
i so popula
 
HOLY FUCKING DATABALLS
I HAVE DATA
I HAEV FUCKING DATA HOLY SHIT
tears in eyes
IT'S BEAUTIFUL
 
"HOLY FUCKING DATABALLS" might be the best phrase of the day.
bravo.
 
hi guys
 
 
12:14 PM
Was so sure that said Gotaglove then.
 
hahaha @Sippy what you sipping on today haha
 
Goatlove
 
haha yyou all just trolling today huh? @Shaun
 
I'm a happy man mr goatlove
I HAVE DATA
 
Lol.
I ain't even got a drink today
:<
 
12:18 PM
haha #dead
 
I'm all out of water
but it's fine because I have fucking DATA
(also going to get some more water)
@Sippy how do I use my data in js
that beautiful delicious data
 
How d'you mean?
 
I've got the static data that's tableData
I need to replace that with reservationsList
how do I call that o.O
 
AJAX
 
YE I DONE THE AJAX M8
HOW DO I CALL IN JS M8
 
12:21 PM
O_o
 
uh
how do I reference the ajax should I say
 
In ajax success method
 
....go on
 
reservationsList = data passed back
 
@Sippy cough
 
12:22 PM
You will probably need to serialize your response with a JSON serializer
 
BEEN THERE DONE THAT
 
Y U CAPSLOCK
NERD
 
COZ
what next
i'll be so happy if this works
like almost tears happy
 
I dunno, is reservationList populated after your ajax shit?
 
populated in a class in c#
 
12:23 PM
No
 
the ajax passes the reservationlist
 
Populated clientside
wat
What are you trying to do
 
pass the data from reservationList into my javascript
then display it in table
function getReservationList() {
$.ajax({
cache: false,
url: wcfServiceUrl + "GetReservations",
data: "{}",
type: "GET",
contentType: "application/javascript",
dataType: "jsonp",
error: function (errorDetails) {
alert("GetReservations error!");
console.log(errorDetails);
},
success: function (data) {
if (data != null) {
var deserializedData = JSON.parse(data.DataResponse);
console.log(deserializedData);
reservationList = deserializedData;

}
else {
console.log(data.message);
alert(data.Message);
that's my ajax
 
reservationList exists serverside?
how meni times
 
plz don't make me pastebin
 
12:24 PM
must i tell you
 
sipy plz
 
I can't even read dat u nab
 
I have a mvc viewmodel that am using to populate my view.My problem is now getting data posted fromm my view.In my form post data its all empty.This is my pastie pastie.org/9555433
 
So what's your point?
That's right.
 
12:26 PM
what needs to go in the js D;
 
reservationList is now your table data.
 
yah so how do I use it
 
for loop through it
 
urr
var reservationList?
 
don't redefine it
 
12:27 PM
asp mvc anyone :D
 
you confuse me D;
 
Looking* @Gotalove
@Shaun var reservationList would redefine yo' variable.
 
okay waiting :)
 
so reservationList should already exist?
 
Yeah define it before your ajax
Then your ajax will populate it with data
then you can use it.
@Gotalove If you debug the application, is the model populated at runtime?
 
12:29 PM
you said my ajax was fine tho D;
 
@Shaun It is fine.
 
@Sippy is there some sort of .ajax method i'm meant to be using or something
 
Not really sure what's confusing you.
 
the model is populated
 
Ask questions.
 
12:30 PM
Its getting data from the post thats the issue
 
No @Shaun
 
Since on post it returns null
 
You're doing the ajax right.
 
@Sippy okay so I want to use reservationList in js, how do I do that? o.O
 
@Shaun Well.. what? Just use some method or something in the same scope as reservationList lol
Do you know how to use JS?
 
12:32 PM
@Sippy if I create a select box like below in my view will it post any data on form post
<select id="employees">
@foreach (var item in Model.Employees)
{
<option value="@item.EmployeeID">@item.SurName</option>
}
</select>
 
Yeah haha, I just don't know how to use the data passed by reservationList

like I can't use reservationList it says it's not declared
 
@Gotalove Not if you don't use @Html.BeginForm()
@Shaun Have you declared it?
 
I used it
@Sippy
 
@Sippy I have not
 
@Shaun then you need to declare it.
 
12:33 PM
that's what I was asking!!
 
Not very clearly! xD
 
I know, I know :'3
lemme try again
How do I declare it? :'3
 
var reservationList;
Do it in the right place
So that your AJAX can access it
And any other methods can also access it.
 
top of the page?
 
That'll work
 
12:35 PM
I said var reservationList to you earlier and you said that would overwrite it ;p
 
Yeah
If you do it again
I thought you did it once already
 
ooo
oopsie
 
@Gotalove Uhmm, not sure right now
It might come to me.
 
okay
thanks
 
@Gotalove I'm not entirely sure you can use IQueryables as models, try using IEnumerable instead and in your controller using .ToList() on the data set.
Oh wait
That's not the issue is it
Ignore me :D
 
12:42 PM
its not
I was using Ienumerable
 
Can I ask why you swapped?
Not judging, just curious to know as it might affect the way I code something in future :3
 
@Sippy I cant even remember
just switched it back
to ienumerable
works pretty much the same now
 
var reservationList;

$(document).ready(function () {
getReservationList();

console.log(reservationList);
have I fucked up sippy
 
@Gotalove Hmm, if you break on the post method in controller, is the data parameter filled with null values?
 
yes they are all null
only form token is in post
 
12:49 PM
It might be that you need to use Html controls
Or post to the method using AJAX
@Shaun What does getReservationList() do?
 
@Sippy that's the ajax method
 
Oh right
duh
Does it not work?
 
It's not logging anything in teh console
 
Ask in JS
 
okie
 
12:52 PM
i cba going in there anymore ^_^, too much draaaama
 
I went there once and someone got banned and there was 4 swastikas
not my fav place
 
I got suspended the other day
Some idiot was being a dick, so I told him he was a c***.
Then he reported me.
gg.
 
looooooooooool
 
@Sippy...
If someone was being a dick, then why would you call them the opposite? :/
 
u a bad man sipz
 
12:54 PM
@baeltazor lel
 
@Sippy this is where i got iqueryable
11
A: MVC - Passing multiple data tables to a view

Patrick KarcherYes there is, but not quite like that. The way to do what you wish to do is to create a custom ViewModel class. This class (MyPageViewModel) would have two (or more) properties, one for each of your objects. In your view, you would access them using Model.Table1Data and Model.Table2Data. A cu...

 
I had my first day of college today (diploma it systems admin) and it also happened to be the dday I came down with a virus/cold and had a dripping nose all day lol
 
Who in here has created certificates using C#?
And Good Morning!
@KendallFrey!
 
@JLott!
 
Have you ever messed with creating certificates?
 
12:57 PM
nope
 
A co worker of mine is having a hell of a time, and I would really like to help him out
 
I've used OpenSSL once or twice
 
@Gotalove Thanks
 
He came from a C++ background and still tries to use C++ code in C# and it confuses the hell outta me
 
welcome @Sippy
 
12:59 PM
@JLott ewwwwwwww
 

« first day (1430 days earlier)      last day (3521 days later) »