« first day (1522 days earlier)      last day (3652 days later) » 

00:05
@Greg - am now, was pacing thinking about some algorithm nuance
@Greg - Just ping and ask, that way if someone else knows they can chime in while you wait too
@Greg - A collection of individual parameters is a collection of items though isn't it?
@TravisJ Well, I suppose I could do JsonResult but can you do the same as an ActionResult? I mean, how annoying would it be to see this:
[HttpPost]
public ActionResult(string first, string last, string middle, string id, string date, string phone, string billing, string ... ... .... ...)
As an example, something huge like that
@stacykeb Did you need help?
@Greg - public ActionResult(DefinedClass model)
public class DefinedClass { first, last, middle, id, date, etc. }
String View Controller
[HttpPost]
public ActionResult SchedulingResults(AutomationVM model)
I do something similar
and in the view, it packages everything into a model that is ajaxed in
@TravisJ So from the View how do you pass such a model?
00:18
@Greg - I create the objects in javascript and then pass them in using
$.ajax({
            url: "@(Url.Action("SchedulingResults","Forecast"))",
            type: 'POST',
            contentType: 'application/json',
            data: JSON.stringify(model),
            traditional: true,
            success: function (result) {
                $("#outputArea").html(result);
            }
        });
Basically I create factories for building the model
var Stage = new function () {
        this.Create = function (order,name,duration) {
            return new this.Stage(order, name, duration);
        };
        this.Stage = function Stage(order, name, duration) {
            this.Order = order;
            this.Name = name;
            this.Duration = duration;
        };
        this.Stage.constructor = this.Stage;
    };
So, how does that know that AutomationVM model is the object from the Ajax?
AutomationVM has a field
class AutomationVM
{
 public List<Stage> Stages { get; set; }
}
among other things
so basically I will make a new model.
var model = new function(){
 this.Stages = [];
};
and then when I make a new stage
var stage = Stage.Create(1,"hello",4);
model.Stages.push(stage);
so in javascript I have an object which contains an array of stages. in c# I have a class with a property that is a list<Stage>. The modelbinder will notice that all properties match, and that all names match, and automagically instantiate the automationvm using the public setters.
So, in JavaScript you pass the JavaScript Object. to the Controller, but... Your defining the Model in JavaScript through a function?
new function instantiates it as an object
the model is an object. it has a property Stages. Essentially the new function code could also be
var model = { Stages : [] };
but for other reasons not shown I am using new function there
so in your case,
var model = {
 first: "name",
 last: "last",
 middle: "middle
};
I'll need a clearer example, the chat isn't distinguishing it well enough for me.
00:29
could be bound server side to
public class Person
{
 public string first { get; set; }
 public string last { get; set; }
 public string middle { get; set; }
}
note that the case and naming is exact
Also note that the name of the model in your javascript data: JSON.stringify(model) must match the name of the parameter in your actionresult (Person model)
lol this was part of the auto translation in the SE blog
> The future by the birth of Stack Overflow Japanese version, it is not necessary to solve the programming problem while struggling with English you.
@TravisJ Hm, well... Alot to research.
Do you know of any examples where I can reverse engineer a bit easier or step by step?
nope :)
So, I've got my C# object built-
Well, my model. Just a series of properties.
Now, I do the JavaScript.
Step 1: Make a class with your desired properties
Step 2: Make your actionresult method accept a type of that class with some name
Step 3: Make a javascript object named the exact name of the actionmethod accepting name
Step 4: Make properties on the javascript object with the exact names as the class properties you defined
Step 5: Use the ajax code I showed above
Step 6: Use the passed information in your actionresult
[HttpGet]
public ActionResult AddCreditCard(CCModel ccModel)
{
    return View();
}
    function ccModel(number, month, year, cvc, cardFirst, cardInitial, cardLast, isCardPresent) {

    }
Like that?
00:43
almost
    function Build(number, month, year, cvc, cardFirst, cardInitial, cardLast, isCardPresent) {
        var ccModel = {

        }
    }
and then use ccModel
What do you mean?
well, more like this
function Build(number, month, year, cvc, cardFirst, cardInitial, cardLast, isCardPresent) {
  this.number = number;
  this.month = month;
  this.year = year;
  this.cvc = cvc;
  this.cardFirst = cardFirst;
  this.cardInitial = cardInitial;
  this.cardLast = cardLast;
  this.isCardPresent = isCardPresent;
}
var ccModel = new Build(1,2,3,4,"travis","tj","j",true);
@Greg - I only have 10 more minutes
Where are you getting, this.number = number?
number is parameter, but where is this.number?
00:52
@Greg - js 101 ;)
When you use `new` on a function it creates an object. the Build function *expects* new to be used on it. When `new` is used, and the function is an object, you can access that object using `this`. So `this.number` is setting the property on the object that is created to the value passed in with `number` in the function definition.
I did:
    function Build(number, month, year, cvc, cardFirst, cardInitial, cardLast, isCardPresent) {
        var model = {
            "Number": number,
            "Month": month,
            "Year": year,
            "CVC": cvc,
            "CardFirst": cardFirst,
            "CardInitial": cardInitial,
            "CardLast": cardLast,
            "IsCardPresent": isCardPresent
        }

        return model;
    }
you can do that as well, but then you will not use the new keyword
and you would still use
var ccModel = Build(1,2,3,4,"travis","tj","j",true);
@Greg - I have to go
bbt
Wouldn't I do that in Ajax?
Or right before Ajax, when I do my Array?
do that before you ajax
That is what I meant.
00:58
and then in the ajax example before
$.ajax({
            url: "@(Url.Action("AddCreditCard","ControllerName"))",
            type: 'POST',
            contentType: 'application/json',
            data: JSON.stringify(ccModel ),
            traditional: true,
            success: function (result) {
                //use result
            }
        });
so all together
var ccModel = Build(...);
$.ajax(...);
in that order
k, gotta go fur reels
Well, I'd want that to trigger on a button click so:

- Click,
- Build,
Ajax
Later.
right, click -> build -> ajax
\o
01:15
@drch ?
01:58
@Greg hi
yes i need
02:12
Assume hypothetically that I am doing responsive design in WPF, without being able to use the standard panels. The problem I'm running into is that I want the window to size to content, but allow the user to resize it. So when the user resizes it, currently it fires SizeChanged, I update the layout, set SizeToContent, SizeChanged fires again, I update the layout, set SizeToContent, and it won't fire again because it's the same size. So, how do I detect a "cascading" SizeChanged and skip it?
i.e. how do I detect whether SizeChanged is from the user or code?
(I need this because of reasons)
02:23
window.confirm("did you do that?");
1. WPF, not JS. 2. fuck you <3
F4z
F4z
02:56
is anyone familiar with the WPF SpellChecker class?
03:44
@KendallFrey Just set a bool in the SizeChanged event and clear it when you are done
    if (!_changingSize)
	{
	    _changingSize = true;
		//.. do work
		_changingSize = false;
	}
 
2 hours later…
F4z
F4z
05:30
Can i use Regular Expression to go back to a previous search? e.g. Find Previous?
F4z
F4z
05:41
if so can you please explain to me how i can achieve this? I've been wanting to know this for soo long :/
06:06
@stacykeb with what?
 
2 hours later…
07:40
Morning all!
hi
08:08
morning guys
 
1 hour later…
09:33
morning
morning @TomW
09:51
how's everyone doing?
10:05
It's all good, how about you?
good tx
only three more days at work this year
:)
I have to work a couple of more days ;/
but it's from home so it doesnt really matter that much :)
aha yes, 'working' from home...
hehe
As long as the projects and milestones are met, I don't see any problem with people slacking :>
But it will be hard to work when the kids are running around the house making a lot of noise!
Morning
10:19
Hi
10:37
Do you all host on Azure?
No.
Nope
These guys want a concrete annual figure for using Azure and I wonder what I should put as the charge
Doesnt that depend on usage or can you have a fixed charge for each month?
It depends on usage
But I am sure they have a fixed charge for each month as an option but I am just not searching in the right place
Ok I just decided
$1,500 a month x 12 until further notice
10:52
@MoonOwlPrince Afaik Azure doesn't offer fixed pricing.
You should tell them that and calculate based on projected usage figures.
Don't just give them a fixed price if you haven't worked it out ..
Yeah I already used a projected upper bound $27,000 a year
That should be enough for their website
Lol
Yeah if they have that much.
Well, they have $3 million dollars as initial equity with $230,000 a year that was put to marketing
Since Azure charges as you use it only makes sense to use an upper bound which carries over into financial periods
At the end of the decade I will present them with the illusion that hosting is now free for the site and they need not pay for it until further notice
@MoonOwlPrince So it's not a small company then.
Lol
It is not even a company
It is a non-profit organisation that recently started
It is a social project that will use its surplus to help abused women, poverty-striken children and disabled men
11:10
Where the fuck did they get $3m
They got sponsorship from UNWomen
And now you see why non-profit is bullshit. They spend too much on shit.
er, what is the default type for the stuff in an enum?
like, enum Console { PS4, Xbone, PS3, X360, }
11:25
int
That will become 0, 1, 2, 3
@RoelvanUden Absolutely ..
oh, alright, ty
And the guy who runs it takes twice what he'd be paid if it were private
@Sippy Exactly. Grab as much as you can and put out expensive ads for more.
11:53
@JohnKoerner the second SizeChanged fires after, not during
 
1 hour later…
12:54
Twiddlythumbs
Where's Waldo?!
piddlyplums
13:10
Wally*
anyone from india here
I just got back from India...
but no, I wasn't born or raised there.
13:38
hmmmm, well I am looking for a book of C# in urdu
*for someone
no luck so far, so I thought someone from India might know the place..
14:08
Is there a way to download a changeset of a project in TFS as a separate file, like git has download as zip?
@Sippy You can create a zip from a commit in git?
Or from a certain version?
@KendallFrey Iunno I don't use it
I just know you can download it as a zip
I basically have an old changeset which was working and I wanna look at it
Cos I don't think I've changed anything and all of a sudden jQuery tooltips have stopped working altogether :/
You can use Get Specific Version
Yeah but I don't want to do that.
or Compare
14:17
I don't want to change what I have
And compare isn't helping.
I want a self-contained version of the older changeset.
Create a new working directory, and get specific version into that
Right.
Will that break binding if I have changes not submitted at the moment?
Don't want to check in while it's broken, really.
nof if it's a separate workspace
Oh you mean create a whole new directory in TFS
I can't do that cos permissions T_T
you can't create a new workspace on your own PC?
wtf
14:20
I can but then surely
If I bind the TFS directory to that workspace
It'll fuck up everything
Cos then I'd have to rebind to the original workspace
No
A workspace is a workspace, not just a place for files
when you leave a workspace, it remains the same when you come back
Check that out. Export a specific changeset using tfs power tools
It should have been an option without any need for a plug/addin. Like the git thingy you mentioned or the export feature in subversion.
@scheien Where does it export to? O_o
14:32
HM
I would guess the current directory
@scheien uhm ..
Don't you have to run it from a workspace?
Seems like you have to be inside the workspace yes
root folder or some other childfolder
That just seems like the same thing as using Get Specific Version, cos it'd overwrite your shit wouldn't it?
hehe, yep, it may seem like it.
never used that one. I'm into the compare manually thing:p
and revert to a working changeset, and iterate each one until the error occurs
Why isn't compare/diff helping you? or does it take too long?
Too many files.
I don't know what's causing the issue
Maybe NuGet updating something
Basically it's in a form that I finished and then didn't touch again.
I configured the validation to come up as tooltips using an external lib
And now for some reason the entire lib just isn't working.
So I guess I must have updated some dependency which fucked it
14:43
All js stuff are loaded and no error spewed to console?
js are loaded in the correct order
no mumbo jumbo changes in layout.cs or some other masterpage layout?
Trying to figure that out
fuck sake.
I moved jqueryui below bootstrap.js
shoots self in head
You got it working?
Yep.
had a case here where a dev put the async attribute on the jquery script tag, that crashed everything
:p
Thanks for your help dude. cc @KendallFrey @scheien
14:46
np
@scheien trolol
I've had lots of stupid mistakes with JS
same here, and it can take forever to solve what seems to be a simple bug, typo or whatever
Well, I'm off, time to go home.
bb
Seeya mate
Good morning everyone.
15:15
G'day
Any one an expert on routing in MVC
Also, can I give a bounty on non questions
I mean, let's say I asked a question here, some one helped etc. Can I give a bounty to that person directly?
@MyDaftQuestions No, you can upvote their good answers though.
good thinking....
:)
If you need a tut on MVC routing, this might help
wrong link :D
uhhh
@MyDaftQuestions No you can't, you can only upvote on an answer.
I don't need pluralsight, I "have" a sippy :D :D :D he he @Sippy
15:21
@MyDaftQuestions I'm familiar with routing, but not an expert.
I have a question already posted stackoverflow.com/questions/27507325/…
but I was hoping to ask it here and give a bounty. I can't raise a bounty for a few days blah blah
but also, just to see if any one has experienced similar (even if they didn't solve it)
@MyDaftQuestions its b/c of your optional params
but it accepts one of them
not when I add more than 1. It is that bit where I@m lost as to why
15:23
you should define multiple routes, but in general the url generator is not all that smart
b/c your actually defining your route as /{string}/{string}/{string}/{string}
... and the string can be null
?
if the 3rd string is optional, there is no way to have the 4th be there, without the 3rd
so it doesn't know which route to use
so the generator uses parms
you would make your life easier by removing the /home/index requirement and just having /shoes/ladies
well, yes, I did plan to eventually :)
15:26
or make multiple routes like this:
Can you explailn the more routes option
he he, you read my mind!!
this now works

routes.MapRoute(
name: "DefaultA",
url: "{controller}/{action}/{product}/{gender}",
defaults: new { controller = "Home", action = "Index", product = UrlParameter.Optional, gender = UrlParameter.Optional }
);

routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{product}",
defaults: new { controller = "Home", action = "Index", product = UrlParameter.Optional }
);
I assume this means that the route.config file can be a messy place with many many routes defined?
You're amazing
15:28
yeah, mine have a good dozen or so routes
@CharlieBrown do you want to answer my question here stackoverflow.com/questions/27507325/…
in your first route make your product required
@MyDaftQuestions posted
So ... who has had to write a CMS with ASP.NET
write code long enough for enough companies, and you will write at least 2 of following:
1. CMS
2. Contact Manager
3. Calendar
@CharlieBrown So true, so true.
15:32
b/c every company thinks they all need their own version
@CharlieBrown Well I am at 1 because I have to write a CMS. I want to wrap up Git as well so I can access it from C#
i just wrote one with nodejs and angular as a POC. it worked pretty decent
"wrap up git"?
@CharlieBrown the depressing thing is that apparently the reason for that is that if you ask IT/ops/whoever for help implementing your needs in the products you already use you're told it's impossible
@TomW oh so true
or too difficult, or bounced around until you give up
15:34
@CharlieBrown, what if (now to make it really hard) I need to have 3 parameters. Shoes Size, Shoe Colour and Gender. All 3 of them are optional and any combination could be selected. Is this still doable in the routes?
@MyDaftQuestions yes, just remember to only have 1 optional in each route and you should be good
only 1 option in the route? Now I'm a little lost. Sorry
If I have only 1 parameter then how can I select 2 options
so 3 routes, the first one is /required/required/optional, the second is /required/optional, the third is /optional
I can't get my head round this, but let me try it first :)
you might be abusing routes at that point
15:36
ah... yes I thought that could be the case
params is the correct method for many multiple
but is shoesize = urlparameter.optional expecting a string or string[] (I assume a string)
yes, thank you, that is what I thought :)
Right, let me abuse it some more, thank you again
if you want string[], dont make a route, just make actionResult methodName([FromUri]string[] shoesize) and you can do /shoes?shoesize=lg&shoesize=md
15:39
wait, that is what is confusing me... I know I can do UrlParameter.Optional, but what do I do for UrlParameter.Required
@CharlieBrown, how do I add the Required?
you just dont do anything, then its required
required is the default
I think I'm getting it, but this means I need to have every combination set up in my route... Now I see why you said it was an abuse of it...
Would you shoot yourself if you saw this?
(new Storage()).SessionAdd("Invoice", invoice.Any(l => char.IsLetter(l)).ToString());
People unterutilise params parameters
I wonder if Java has them
why don't you like it @Greg
the syntax layout?
or did I miss something obvious
15:52
@MyDaftQuestions I like it, it is just incorrectly used in the application I'm working on.
ah I see :)
I used to have the lamdas but, I've gotten used to them now :D
Lambda expressions are essential to readability, productivity and maintainability
I've never heard so much nonsense in my life
sorry @MoonOwlPrince, but no! no no no, reading a => a.something isn't (too many people) easier to read than writing the code out in full
I'm going to have to disagree @MoonOwlPrince.
@Greg i keep getting hung up on (new Storage())
15:56
@MyDaftQuestions It's easier in the simple case of, say x => x.Y
It can be harder to read, plus it can be harder to maintain.
@CharlieBrown Yeah, that parts takes me back to.
@KendallFrey, no it isn't
:)
he he he
In that case, the behaviour is easy to see, whereas if you pass a method name, it'll take you 10 seconds to find the method and read it
right, home time. WPF all day, now to the pub with a mate for all the MVC I learned whilst I should have been doing WPF :(
16:08
nice
@NETscape who the fuck posts a photo of a comic
posting previous message to reference the cloud dilbert.com/strips/comic/2014-12-14 . I'm so hip!
1 message moved to Trash can
16:23
Can I get an architecture question answered.
lol
probably not
Is it bad practice to have a model called CCModel, for user input. Another model that handles that data and extra data and is populated from the database? Or do you just leave some orphaned properties>
MVC to have a Domain models, DB, and View Models User input only
What one should do the validation? the domain?
16:46
So I am going to design a CMS that does not do CSS and does one thing and one thing alone: content
Thanks. I am really loving my job
Validate till it Transaction Commit
of course lambdas are great for reusable code.
@ton.yeung Okay, whew. Wanted to double check.
@Nathvi You don't have to be sarcastic but if you are going to have a private method that will be called once and only once it would rather be a lambda expression
did it?
17:03
posted on December 16, 2014 by Visual Studio Blog

Today we are releasing the RTM version of Bing Developer Assistant for Visual Studio! To get started, download Bing Developer Assistant for Visual Studio 2013 or Bing Developer Assistant for Visual Studio 2012 from the Visual Studio Extension Gallery. This extension provides smart, contextual help to solve every day dev problems like searching for projects, code samples and resolving code error

Joke of the day: I told them to give me two weeks to work on everything and they were surprised
They thought it was a day's work
@MoonOwlPrince That's the standard fare everywhere across the board.
They think developers are slacking off
Hahaha and when I told them that their suggested theme colours clash they just starred at me
How did this guy get the "Run Code Snippet" in this question?
0
Q: sqlquery insert data from one table to other with id from columnname

Aakash KumarI have an old database with some complex joining of the data. As given below Subjects Id Name ------------------------------- 1 Math 2 Science 3 English Results Id StudentId Math MathMax Science Scie...

@MoonOwlPrince The best thing to do is keep working on it and then tell them that you need more time to finish stuff
17:11
since the time they gave you was inadequate to begin with
I am using a prototyped iterative approach
So if they see prototype after prototype up until I am actually done they will get an idea of the work I am doing for them considering I rejected WordPress and told them to not pay for anything that has WordPress or PHP on it
@abhi posted it as HTML I would think - no way to run real sql yet
@juanvan I thought he used sqlfiddle, but then I realized that was not the case.
Yar
<!-- begin snippet: js hide: false -->

<!-- language: lang-html -->

    Id    ResultId      SubjectId      Marks      MaxMarks
    --------------------------------------------------------
    1      1              1              5          10
    2      1              2              6          10
    3      1              3              7          10
    & so one

<!-- end snippet -->
that was his code of input
17:44
morning guys
Good evening sir
goood morning!
Do you mean a good morning, or mean that it is a good morning whether I want it or not; or that you feel good this morning; or that it is a morning to be good on?
I frakking give up
lol
im sorry bud
don't give up, push forward!
hmph, internet y u expensive
ok, that's not quite true. Internet is ok, internet with cable tv is a complete con
17:54
@Steve For nerds, you guys suck with references :P
lol
i'm terrible at them
Ha ha. Oh well :(
@TomW Yeah, and why does land line have to come with the internet? I don't need it
Is this bad JavaScript?
yup
17:56
    $(function () {
        $('.rdoBranch').each(function () {
            if ($(this).click()) {
                $('#btnContinue').removeAttribute('disabled');
                $('#btnContinue').setAttribute('onClick', 'location.href = "/Home/Billing?ccid=' + $(this).val() + '"');
            }
        });
    });
@LewsTherin well, for ADSL it does. Virgin Media tries to flog you one but you can configure a package without
@Greg Frakking bad
@LewsTherin Is it seriously?
@TomW Mmn, but why?
@LewsTherin because ADSL works over phone lines?
17:57
Orly? Interesting
@Greg Nah kidding. Do you always want to enable the one button?
What's the point of iterating through every rdoBranch then?
@TomW Wouldn't that be the same as dial up? Anyways, will google that when I'm bored
@LewsTherin not sure, I think it piggybacks on the 'normal' phone signal or something
we're usually given something called a microfilter that plugs into the phone socket, without that the phone won't work
Yeah I get that as well. I plug that and the phone's into the wall

« first day (1522 days earlier)      last day (3652 days later) »