« first day (1601 days earlier)      last day (3352 days later) » 

6:00 PM
if you like watching one dude grope another dude, maybe
mostly just awkward though lol
 
Did you watch to the end?
 
I do occasionally, yes. Though mine is a convertible as opposed to a "true" laptop
 
@Sippy ofc he did :)
 
@Sippy it's pretty simple. It's basically an extremely stripped down enterprise architecture tool
 
@ton.yeung Yes. But, it's a convertible.
I swirl it around 180 degrees and use it to play visual novels :D
 
6:10 PM
Programming has ruined me
 
@KendallFrey eh?
 
In math I learned = means "equals", then in C# I learned "equals" means ==, and now I'm typing == for assignment
 
@ton.yeung scrolling mostly
And zooming
the trackpad isn't very good at those
Especially in the "built for touch" apps
 
Hm, trying to decipher this code.
 
@ton.yeung No, it's a HP device. A HP EliteBook is memory serves.
Pretty much. When I use keyboard/mouse, I rarely use the touch screen. Mostly only to test pinches and whatnot.
 
6:20 PM
Can someone explain this to me:

if(GiftCardApplied)
{
     if(discount > (subTotal + shipAnd))
          return Math.Round(subTotal + shipAnd, 2, MidpointRounding.AwayFromZero);

     else
         return Math.Round(discount, 2, MidpointRounding.AwayFromZero);
The first part makes sense, if a gift card is applied, got ya.
 
Touch on a regular notebook is a bit of a gimmick. Good for development, not good for productivity. If you can swirl the screen and use it as a mini TV, game platform, tablet, etc, then it is nice. Honestly I don't miss anything using a non-touchscreen notebook.
 
But, the part that is confusing, why the difference between subTotal / Ship and the discount?
 
@ton.yeung Some of the bing apps (news in particular), games obviously. Even visual studio is easier to scroll by touch though
 
return Math.Round(Math.Min(discount, subTotal + shipAnd), 2, MidpointRounding.AwayFromZero);
much nicer
 
@KendallFrey Yeah, but I'm trying to decipher what they're intent is.
 
6:22 PM
basically the smaller of the two
 
                else if (GiftCardApplied) {

                    if (_OrderLevelDiscount > (subTotal + shipAnd)) {
                        return Math.Round(subTotal + shipAnd,2, MidpointRounding.AwayFromZero);
                    }
                    else {
                        return Math.Round(_OrderLevelDiscount, 2, MidpointRounding.AwayFromZero);
                    }
                }
                else {
                    return Math.Round(_OrderLevelDiscount, 2, MidpointRounding.AwayFromZero);
 
without more context, it's impossible to determine what they mean
 
Basically, its that.
 
it's worse than I thought
someone needs to learn DRY
basically, if giftcard and discount > total, show total otherwise discount
 
@KendallFrey DRY?
@KendallFrey I'm just trying to figure out wtf is going on.
 
6:27 PM
!!tell Greg google dry programming
 
@KendallFrey Ah, thank you.
 
@Greg Well I can't tell you anything that's not in the code
 
@KendallFrey Yeah, it is one giant property.
        public decimal OrderLevelDiscount
        {
            get
            {
                decimal subTotal = SubTotal;
                decimal shipAnd = OrderLevelTaxes;
                if (VAT > 0 && ShippingCost == 0) { shipAnd += VAT; }
                else { shipAnd += ShippingCost; }

                if (_OrderLevelDiscount > subTotal && !GiftCardApplied) {
                    return Math.Round(subTotal,2);
                }
                else if (_OrderLevelDiscount <= subTotal && !GiftCardApplied) {
 
@ton.yeung right
 
6:29 PM
holy shit is right
 
Huh... expands to full text HOLY SHIT
 
@Greg Someone isn't using ReSharper there.
 
so it gets the total discount, which has a maximum of the subtotal except when it's a giftcard, because giftcards will cover shipping&tax
 
@Pheonixblade9 @ton.yeung @KendallFrey Yeah, I'm trying to fix an issue and it stems from this lovely property. But I'm all like uh-
@RoelvanUden This is the type of code I frequently encounter when I'm fixing stuff.
 
I'd be madly hitting CTRL+E, CTRL+C
CLEAN THIS SHIT UP RESHARPER PLEASEEE!!!
 
6:31 PM
@ton.yeung Yeah, quite a bit actually
 
@ton.yeung Well, now that I encounter it I agree.
 
decimal maxDiscount = GiftCardApplied ? subTotal + shippingAnd : subTotal;
return Math.Round(Math.Min(_OrderLevelDiscount, maxDiscount), 2);
it's a two-liner
ignoring the midpoint rounding
 
I'm used to code like this
 
The other part that complicates stuff, is the random values or properties.
@KendallFrey I'm not :/
 
6:34 PM
random?
 
no, more like in airports/planes
 
guys I had my first day with F# on linux and it wasnt that bad
 
even my desk is pretty full, so its hard to find space for a mouse
 
Well, Vat, ShippingCost are two other variables
 
Yeah, I assumed those would stay in the calculation
that part is fine
 
6:35 PM
I was able to use snmp and script it nicely, as well ftp client with folder scan, and also http request, rest client etc
I just cant find working NRPE client
 
@KendallFrey Yeah, basically I'm trying to add this to that property to properly calculate giftcard / promotional codes.
        protected decimal GetDiscountTotal()
        {
            var total = 0.00M;
            var amount = 0.00M;
            var discount = 0.00M;
            var promotional = HttpContext.Current.Session["promotionalDiscount"] as String;
            var giftCard = (List<GiftCard>)HttpContext.Current.Session["giftCardsUsed"];

            if (!string.IsNullOrEmpty(promotional))
                if (decimal.TryParse(promotional, out amount))
                    total = total + amount;

            if (giftCard.Count > 0)
 
someone needs to learn about the && operator
 
so...
MVC or SPA/Angular?
 
so much redundancy
if (giftCard.Count > 0) // WTF
    foreach (var card in giftCard)
 
it kind of is a single page application is the thing, haha
 
6:37 PM
remove that shit
 
there is a login page and then there is just a single page where you do everything
well
 
@KendallFrey If you try to iterate through a empty session it will NRE die
 
Someone also need to learn +=
 
mvc is still easier on the surface
 
@Pheonixblade9 if (deadline.Days < 5) UseFamiliarTechnology();
 
6:38 PM
@Greg no
 
@RoelvanUden hehe, deadline is 3 weeks
 
@KendallFrey How would you correct that?
 
@RoelvanUden no doubt
 
correct what?
 
errr, I guess deadline is 2 days to replatform
 
6:39 PM
The above method.
 
gotcha
probably a good idea
there's a lot of data binding stuff, but I'll just do the first pass with AJAX stuff
weird... no MVC5 template in visual studio
did MVC5 and WebAPI converge?
 
if (!string.IsNullOrEmpty(promotional)) is useless
 
its just asp.net now
 
if (giftCard.Count > 0) is useless
 
or web or seomthing, they put it together
 
6:40 PM
@ton.yeung laravel? I am trying to move away from PHP :P
 
+= ftw
 
ohh that's right - you just select ASP.NET web application and it comes up with the options
 
discount variable is useless
 
@ton.yeung I am trying to take the PHP site and rewrite it in ASP in 2 days
 
assigning amount is useless
 
6:41 PM
+= ftw where?
 
@Pheonixblade9 ASP.NET MVC with EF seems like a solid bet for something simple. You know it, we all know it, so it's pretty quick to rebuild something.
 
@Greg total = total + ...
in fact the loop could be replaced with LINQ
 
yeah. The reason I'm considering WebAPI is because they do want a mobile app eventually
 
@KendallFrey?
 
@ton.yeung it's written in PHP and Javascript
no frameworks
it's basically a beefy POC
 
6:43 PM
@Greg Sum
 
yeah, it's written by a business architect guy who hasn't written code since COBOL days
he did a pretty decent job for someone who doesn't write code daily, to be honest
what about the mobile ability?
I'd like it to be SOA if possible
 
haha :)
sorry, I have typically used WebAPI when I want web services
 
@KendallFrey I didn't see sum I intended to do it.
 
so... instead of using Models, I just use Razor with a bunch of AJAX callers?
can you expand upon what you just said?
 
6:45 PM
@Greg what?
 
@KendallFrey So your saying it should be: total += amount
 
basically have a DAO layer and use that as my "services" in ActionResults?
 
@Greg yeah
 
@KendallFrey I didn't see sum for Linq with the List<T>
 
interesting
so I just have the Web Services (methods) decorated with [WebMethod] and access them from the page?
well, the page is already written, I am basically porting it
hmm
 
6:48 PM
@Greg using System.Linq;?
 
@KendallFrey I thought this person added Linq but no they didn't
 
I see
 
@Greg Greg, really, get ReSharper. It can do all the little things of adding using statements for you as you type. You're pretty much not even getting half a decent experience without it :P
 
@ton.yeung The reason I was leaning towards WebAPI is because that's how the page is basically already written, just as a JS/HTML page with a bunch of services... but hmm
 
@RoelvanUden I'll see if I can talk my boss into it.
 
6:51 PM
if I'm not learning/using Angular, just a WebAPI project with an SPA, does that introduce significant overhead?
sorry if these are stupid questions
I just want to make sure I understand the decision before I make it
 
@KendallFrey Were you thinking:
discount += giftCard.Sum(i => i.TotalApply);
 
so, how does using an SPA with just jQuery and AJAX for CRUD differ from using MVC? It just seems like WebAPI decouples it more
 
@Greg ya
so I'm using MVVM for the first time in my life
 
does that question make more sense?
 
@KendallFrey I appreciate your analysis
 
6:56 PM
ok nod
my goal is to make all the services easily accessible for a mobile app, as well. Is it pretty simple to do that with MVC?
 
Should I use INPC and ObservableCollection even if my ViewModel will never change?
 
yeah my user base is like... 10 people (for now)
 
@KendallFrey It's perfectly reasonable to add them if you want, but it's absolutely not necessary. You can add INPC and INCC later if you need them.
 
@ton.yeung is it relatively easy to have partials for things like modals popping up with just regular MVC?
nod
what about passing data in the HTML body via JSON rather than in the URL?
yeah I agree - modals are only for the admin stuff
 
@RoelvanUden I'm a bit worried, because "later" will be other devs.
 
7:00 PM
say I have a save action - I can easily parse JSON from an HTML body right?
that sounds like a stupid question after I ask it
 
I'm basically making a prototype
 
@KendallFrey Then it makes sense to use the "correct" approach everywhere. Allow for binding on everything, so other devs get the idea.
 
I know they won't be changing the VM code though
 
@ton.yeung yeah I just don't know angular very well yet :/
I've only ever used it in one small POC
I think so. probably will have lots of questions
Thanks :)
:) cya
 
7:27 PM
ugh account stuff is always a pain
 
I'm basically pulling all the crap for this site I don't want out
 
I have a Json i want to make a Class of , but sometimes the Json need this : public Pc_Requirements pc_requirements { get; set; }
public Mac_Requirements mac_requirements { get; set; }
public Linux_Requirements linux_requirements { get; set; }
And Sometime it need this :
public object[] pc_requirements { get; set; }
public object[] mac_requirements { get; set; }
public object[] linux_requirements { get; set; }
how do i make it so it accept both input ? :O
 
@Pedram that's not a very well stated question... make what accept both?
 
The Deserializer in Newton.Json
        var searchJS = JsonConvert.DeserializeObject<AppInfo>(AppInfoJson);
 
7:35 PM
uh, you can't. They're different object types
you'd need to create a cast or convert for the object
 
damn ... there is like 16000 AppID , i Extracted them all , and The User can select a few of them and Ask for The Detailed Description of that AppID , it contain name of Game Price of Game and such
but some of them have some extra info , some of them don't , and so it gives error , and i can not check all 16000 to make them different ofcourse :|
For Example on AppID 220 , if i use object[] , i get all the info about Half-Life 2 , while on another game with System requirement , i get Error , and if i fix that error ! Half Life 2 give error :|
can i just delete the whole 3 system requirement and it just skip them on Deserializing ? it's not like i need to show system requirement at all , i just need Price and maybe Screenshots ...
@ton.yeung i Gave an Example bro , let me give u the Links , the Json is from this link : store.steampowered.com/api/appdetails/?appids=220 , User select game name , and from what he chosse i change the URL and Recieve the Json ( 220 for example is half life 2 )
k let me check how to convert to dynamic, i hope it works for this work that i want
tnx
 
7:52 PM
:)
 
d:
 
angular can be pretty cool sometimes. you can do some funky stuff with ng-transclude
 
In a WinForms app, I have class ABC (non-UI layer) that creates a directory if it doesn't already exist. If it does exist, I want to alert the user with a MessageBox. Should I show the MessageBox from class ABC, or throw an exception from ABC up to the UI/forms layer and show the MessageBox there? Latter seems like the correct approach but maybe overkill.
@ton.yeung Should the UI know about an IOException, though?
 
GG ! I Spent 2 hours trying to find a fix json deserilizer for accepting both system Requirement types , but then i just deleted it and it works fine now :P its nice that it ignore whatever class u don't have !
 
8:03 PM
@Breems Sure, if you are telling the user about it. You could always just raise a custom event instead of throwing as well
 
I need a name for a class which represents a pair of events - start and end - in a profiler.
I've got ProfiledTask, but that seems weird
any better ideas?
wot
 
I think I'm gonna do db-first, then flip it to code-first
 
ProfileEventPair
 
any of you guys ever do that?
it seems easier to do the initial DB work - creating tables, etc. then just keep it in C#
I'm doing EF
 
@Pheonixblade9 I did that for a very small project. That's my favorite approach thus far.
 
8:12 PM
I don't wanna learn a whole new DBMS in this short time period
lol yeah
I'm gonna stick with the basic ASP.NET stuff
yeah, there is no upgrade path
 
i cri
why cs:go queue broken
 
is it bad to use await in a loop?
yeah it is
but i don't expect it to throw
 
Why would it be bad?
 
i could get a list of tasks in the loop, then await them afterwards, so it's more async
 
It's more parallel*
 
8:16 PM
Any way of Getting System.Net.WebClient Store Coockies ? or something ?
 
yeah, thats better wording
var message = await getMethodsForServiceBus.GetMessage( queueName );
while ( !string.IsNullOrEmpty( message ) )
{
messages.Add( message );

message = await getMethodsForServiceBus.GetMessage( queueName );
}
the first await works fine, the one in the loop throws
maybe i'm using it wrong, let me dig in a little deeper
 
@Steve - web or non web?
 
winforms
 
I think you might be slightly misunderstanding the use of await in winforms. Using await allows the thread to not block, which means the UI doesn't block. While you may not be doing everything in parallel as Roel notes, you are at least keeping the UI active so using await, even in the loop in that context, is still important.
 
@Steve awaiting in a loop is fine, but in general it's a good idea to await as late as possible.
 
8:19 PM
@ton.yeung - setMethodsForServiceBus :)
 
i'm just dicking around
hence the terrible method names
 
Playing with async?
 
i just named the ref the same as the class, named the class the same as an azure book example
not production code
i started playing around with it, then realized i didn't know enough about async / await to do this, learned async await, now i'm back to this :p
one class has all of the examples for reading from a service bus queue, one for managing the queue, one for sending messages
not saying its right, just saying i'm following the examples
and i have a typo :p
 
peeps can be so lazy
 
@Steve - Run this code in a different format than .net fiddle as it doesn't do well with threads. dotnetfiddle.net/cP2Crv It is a good look at where async comes from pre 4.5
@CharlieBrown - iaintlzy
 
8:28 PM
converting to EF... "Can I just make only the properties on the class I need for now?" "Uh, yeah, so you mean screw the next guy?"
takes like 1 minute to type out 10 props in a class
 
@CharlieBrown - Makes sense if you only want to fetch a certain set of the full set. Almost as if you were selecting only those properties. You could think of it as a "projection" I guess ;)
 
guy has spent all morning asking questions to avoid doing the work, could have mapped 10 classes=> tables by now
someone took normallization to a whole next level in the db, so we 6 joins for nearly everything
almost all strings are stored in lookup tables that are ref'ed from other tables
 
@CharlieBrown - "next level normal"? Is that like 5nf?
I try not to go past 4.
 
feels like 7NF to me
 
7! May the force be with you
 
8:38 PM
yeah, try mapping that with EF. I consider myself an expert at EF, but damn
cant fix stupid
 
lol
 
@TravisJ im actually going outside in the snow this weekend
 
I use some deep mappings even at 4.
For example, this is an idea of some of the Include mapping I use
var xprList = new List<Expression<Func<PL, object>>>();
xprList .Add(pl => pl.C);
xprList .Add(pl => pl.TC.WC.W.P.C);
xprList .Add(pl => pl.W.Select(w => w.T.C));
@CharlieBrown - Nice! Ski? Board?
 
Snowmobile
then its prepping the sailboat in 2 more weeks for launch
 
Sounds like you have a busy weekend ahead of you
Don't try any backflips on your snowmobile :P
 
8:44 PM
I used to ride a lot when i was younger, but not much anymore. Gonna kill me going out with the guys this weekend trying to keep up
 

« first day (1601 days earlier)      last day (3352 days later) »