« first day (2256 days earlier)      last day (2918 days later) » 

06:33
hey
07:14
g'morning.
a morning it is
07:30
it is, indeed, it is.
ohayou
Hi
can someone help me with Aspera API and its integration with c#?
07:54
Never heard of Aspera. If you have a specific, concrete problem, we can probably help.
bluefeet on December 19, 2016
Another year is rapidly coming to an end, which means it's time for some fun. Fun with hats! That's right, it's time for our annual event that brings joy to all and creates hat-fanatics everywhere... Winter Bash!
08:08
is this team fortress 2
Morn all
08:26
i've had like 7 hours sleep but feel like its just 5 hours
what's that shit about
it is about what time you slept at
I've been oversleeping on the weekend
like going to sleep at 12:30 then waking up at 10am
so when I slept normal I guess it's f'd me over. I went to bed at 11pm and woke up at 6:30
haha
stop moaning others had broken sleep
an hour early afternoon sleep (siesta) would be great to overcome :)
I have a three year daughter and in 3 days will have another newborn son. I humbly reject your premise that getting up at 6:30 is early. :)
08:40
@AvnerShahar-Kashtan do you have a minute?
Minutes is all I have.
wow. I didn't know, that the second is so close to born. Congrats!
I'm writing an analyzer/fix that checks that properties notify
I'm not sure about the best code to generate for the equality check before raising
@JohanLarsson Yup. I'm still subscribed to the github notifications. ;)
08:42
:)
public ReferenceType Bar
{
    get
    {
        return this.bar;
    }

    set
    {
        if (ReferenceEquals(value, this.bar))
        {
            return;
        }

        this.bar = value;
        this.OnPropertyChanged(nameof(this.Bar));
    }
}
Reed does not like ReferenceEquals there but I'm not convinced
I think it may be what makes most sense
Wouldn't that override any custom Equals/== logic in a type?
yep
It would always notify if the reference changes
What's the rationale behind it? If someone went to the trouble of defining equality for a type, shouldn't we respect it?
I'm just not sure value semantics is right there
Looking at our code here, it seems we're using if (!EqualityComparer<T>.Default.Equals(backField, value))
08:44
Yeah, that is an alternative
But that's because we have a SetProperty<T> util that updates the value.
Having value semantics can lead to:
var meh = new Meh();
foo.Meh = meh;
meh.Ugh = 3;
// foo.Meh.Ugh != meh.Ugh
Also potential weirdness in bindings not updating
Agreed it would be rare edge cases as it is not too common to override equality for reference types ime
@JohanLarsson I agree that when in doubt, err towards raising more, rather than less.
ok, good, not just me thinking crazy then :)
scary when Reed was so sure
But wait, why would that scenario result in foo.Meh.Ugh != meh.Ugh? meh is a reference type, so both meh and foo.Meh have the same reference, so both have Ugh set to 3, so a value semantic would return ==.
What am I missing?
Value semantics for reference types can result in an Equals() == true result even when ReferenceEquals() == false, not the other way around.
08:52
@AvnerShahar-Kashtan It assumes we have value semantics and check before assigning, i.e. not assigning when doing foo.Meh = meh;
If after you code, you do foo.Meh = new Meh { Ugh = 3}, with value semantics it won't trigger the binding.
if (EqualityComparer<T>.Default.Equals(value, this.meh)) return;
in the setter
But is that the right behavior? If Meh's identity is tied to Ugh, it shouldn't raise.
This naming is not confusing at all.
08:56
i was about to say the same @RoelvanUden
:)
sry about that, early
@RoelvanUden How about Mugh and Ueh?
agh ugh meh :D
I did not mean to stop the discussion, just.. carry on.
@AvnerShahar-Kashtan Never said it was early
09:15
So if I set case.Owner = new Person { Id = 5, Name = "Avner"}, and it was previously a Person with the same ID but a different name, then value semantics won't throw.
how do you mean won't throw?
Won't raise, sorry.
if we have:
Won't trigger the binding.
Of course, that's a logical mismatch, since if I defined Person's equality to be tied to Id, then two different Persons with the same Id shouldn't have a different Name. And if they do, it explicitly doesn't matter.
public Person Owner
{
    get
    {
        return this.bar;
    }

    set
    {
        if (EqualityComparer<Person>.Default.Equals(value, this.owner))
        {
            return;
        }

        this.bar = value;
        this.OnPropertyChanged(nameof(this.Bar));
    }
}
It will not set the property either
it is a pretty common implementation of a notifying property
09:17
Right. Will that be confusing or logical?
I'd say very confusing when it bites me
If I replace hte current Person {Id=5, Name="Avner"} with a new Person {Id=5, Name="Johan"}, what would be the logical behavior, and what will be the confusing behavior?
(The two are not mutually exclusive)
I'm leaning towards expecting a property to be set to what I set it to
Which means, using ReferenceEquals.
yeah, but only leaning
not sure, that is why I harass you guys :)
09:19
I think I agree with you. I hate it when a simple assignment operation fails silently.
09:34
@AvnerShahar-Kashtan thats great
Hey guys im getting the an error with this piece of code:

 xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Worksheets.get_Item(i+1);
                MessageBox.Show(xlWorkSheet.ToString());
                Microsoft.Office.Interop.Excel.Range CR = (Microsoft.Office.Interop.Excel.Range)xlWorkSheet.Cells[1, 1];
                CR.Select();
What's the error?
I got this code in a for-loop, but when it runs thru it the second time, it give the error: `An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

Additional information: Select method of Range class failed`
1
Q: Fastest way to get an Excel Range of Rows

Gayan DasanayakeIn a VSTO C# project I want to get a range of rows from a set of row indexes. The row indexes can be for example like "7,8,9,12,14". Then I want the range "7:9,12,14" rows. I now do this: Range rng1 = sheet.get_Range("A7:A9,A12,A14", Type.Missing); rng1 = rng1.EntireRow; But it's a bit ine...

xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
they use it that way
but define it at start
ye, but I want my data in multiple sheets
09:42
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
and the xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1); only puts data in sheet 1
This is what I have:

            Microsoft.Office.Interop.Excel.Application xlexcel;
            Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
            Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
            object misValue = System.Reflection.Missing.Value;
            xlexcel = new Microsoft.Office.Interop.Excel.Application();
            xlexcel.Visible = true;
            xlWorkBook = xlexcel.Workbooks.Add();
            for (int i = 0; i < comboBox1.Items.Count; i++)
            {
have a look at page I put up... hes doing what your doing but not fully describing xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Worksheets.get_Item(i+1);
like you have
10:06
@Ggalla1779 thats not the problem
the problem is something with the CR
10:36
ok add in definition also
Microsoft.Office.Interop.Excel.Range xlRange;
nah, its probably because it still got all the data in excel copied
and then in the second loop, it wants to paste it over that data
then step through it to solve it
10:50
Morning guys
Just got a problem with the post action method
go ahead, someone can probably help
Thanks
I want to convert currency from - to after inserting the value for the conversion process. The page renders the partial view but it always returns a value of 0 from the web service!
I can post my action method if you want to look at the code!
 [HttpPost]
        public ActionResult Index(Currencies cur)
        {


            if (cur.FromCurrencyId == cur.ToCurrencyId)
            {
                //do something if same currecnies and return.
                ModelState.AddModelError("", "Can't make the conversion for the same curreny");
            }
            else
            {
                if (ModelState.IsValid)
                {
                    CurrenciesClient Cur = new CurrenciesClient();
                    var listCurrency = Cur.findAll().ToList();
 ViewBag.TheResult = listCurrency.Where(C => C.ToCurrencies == cur.ToCurrencies).FirstOrDefault().ConversionRate * cur.Value;  the Value shows 0
Hi guys, I would like to know, Its possible to Share a content with Facebook sdk ?
I try to find something but I didnt find it
11:08
mornning
morning
@Dodi82 either cur.Value or ConversionRate is 0, which one? Are you sure your data that coming from service is accurate?
11:27
@AlainProfessional Isn't Sharing merely posting a link to a Facebook resource?
Anyone experienced with Azure API management etc
ask thou question and someone will take the challange
@ibubi it is the cur.Value is 0
I am going to cry seriously
Yes, the data shows the Id of each currency but the value is 0
11:55
In an EF Code First "Seed" method how do I get the Id of a previously added entity?

// Add entity
context.Balloons.AddOrUpdate... bla bla

// Use entitys ID
context.Toys.AddOrUpdate(new Toy { ToyId = Balloon.Id }

???
I tried to do

// Create entity
var balloon = new Balloon {..}

// THEN add the balloon entity
context.Balloons.AddOrUpdate...

// Reuse balloon?

But the Id of the balloon property is still 0....
@Dodi82 so get the proper cur value :)
Yes, I am trying but it comes back with a stupid 0 Value!
these are my properties
 public class Currencies
    {
        public int Id { get; set; }
        [Required]
        public int FromCurrencyId { get; set; }
        public SelectList FromCurrencies { get; set; }

        [Required]
        public int ToCurrencyId { get; set; }
        public SelectList ToCurrencies { get; set; }

        public string CurrencyName { get; set; }

        public string CurrencyCountry { get; set; }


        [Required(ErrorMessage ="Please enter a numeric value")]
        public decimal ConversionRate { get; set; }
change int to int?
@misha130 is it me Misha??
12:02
@misha130 Which line achie?
ekhm forget it
check if your database has an identity identifier set to the Id
@JARRRRG why cant you add toy and ballon at same time?
@misha130 Is it me again lol!?
if its me then there is an identifier set on the Id attribute
 
1 hour later…
13:21
can anyone suggest me a best book for learning ASP.NET Core 1.0
@SankarRaj Books are probably a bad way to learn such a new, emerging technology. Publishing takes time. Any books published are probably already out of date.
Then how should i learn? can you suggest me
Searching for "asp.net core 1.0 tutorial" brought me a PluralSight online course, a page on Microsoft Virtual Academy and pages on MSDN and www.asp.net with tutorials.
try to solve a problem, and check stackoverflow.com/documentation/asp.net-core/topics every time, if You are going the right way
I don't know if they're any good, since I never used any, but it's a start.
13:28
@AvnerShahar-Kashtan thank you i will try them.
Would anyone mind discussing with me an architecture issue i'm dealing with?
All my co-devs are off for holiday break
I'm not going to just dive into a huge discussion without some sort of consent that you all would like to hear it ;)
Very considerate.
ha well i've internet-ed in the past. I actually beat the internet once. The end guy is hard.
@CarComp How did you "beat the internet"?
I ran a bbs. I think that counts.
13:36
just like Chuck Norris
ntohl +1
@CarComp Ooh, definitely. What software did you run?
I (briefly) ran a Maximus based BBS. But RemoteAccess was the standard around here.
@AvnerShahar-Kashtan released it break it!
@JohanLarsson Woo!
Googling "final boss of the internet" is an enlightening experience
13:39
I went full OCD and insert the generated backing field with position corresponding to the position of the property :)
I ran a bunch of platforms but finally settled on Turboard
god i couldn't think of the name of it for the life of me
fix all is probably broken, usually is when using the built-in thing
there were (i think) about 3 bbs in existence in indiana that werent long distance when I ran mine. This was between 93 and 97
then the web came and poof. no more bbs.
sort of like iphones "poofed' my car-pc software out of existence.
well, i really could use some discussion on my architecture issue. i've refactored about 4 times now and each time once i get it working, i end up really not liking something about it.
mind if i go into it?
I don't mind but I also don't know how helpful I can be
I'm working on a solution in c# that converts JSON from one CRM to another CRM / CMS
all of the objects are represented by JSON.
13:45
so what's CRM and CMS?
customer relation management and content management system
okay go on
the objects on each end are similar... Firstname, Lastname, Address, etc, but the json structure itself is wildly different.
how so?
let me share the objects with you. hold on.. getting examples
For a customer, here is one side:
http://hastebin.com/ifozokiwep.json

here is the other side:
http://hastebin.com/faleviloco.json
13:49
sorry but those links are blocked at my work "personal network storage"
can you get to pastebin?
Sounds like a classic integration scenario
what can you get to?
probably not
right Tom W
13:49
um nothing that's personal network storage
Doing something similar now
So i've created some property attributes representing each "side" that derive from a base class that holds the json path, its destination type (typeof) and possibly other things.
the path makes hydrating my object in c# from the json SUPER easy
but going back to JSON is proving a little difficult
i should mention i'm using Newtonsoft JSON libs.
now I'm going to ask the silly question, does it need to be json?
yes. the rest API on each end is how the ends communicate. they are already finished
ahahahah finished. well lets just say they were built by others and I can't just change it out.
246
Q: XSLT equivalent for JSON

luvieereIs there an XSLT equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.

13:52
BlueBarren email me and i'll shoot you the data.
It reminds me of... wait, what was the name of the Microsoft enterprise bus tool again?
Could anyone take a look at my question? ^^ stackoverflow.com/questions/41219923/…
For my sins...
@CarComp sure, what's your email?
13:54
One of its core features was an XSLT-based engine for transforming XML messages between formats for different enterprise systems.
Avner ... reading your post
@CarComp Don't forget to delete this message in a second or two. Chat logs are googleable.
@BlueBarren you have it?
eh, i'm pretty sure my email is out there.
@AvnerShahar-Kashtan why the past tense?
13:55
@TomW Because I refuse to acknowledge that BizTalk still exists in 2017.
I'm sort of leaning that way... BizTalk had its time
i'm not wanting to really add a layer of more stuff
@AvnerShahar-Kashtan I've been trying to do the same but as it's my whole job...
@TomW Yeah, I think we've had this conversation before.
XSLT... ah so now i know this exists
For the moment anyway. I do keep trying to convince people that I do do other stuff
13:57
so.. its like a template that can represent the json structure
?
@AvnerShahar-Kashtan come on...dont say it
Well, I can't delete chats
so my email stands for ALL POSTERITY ;)
@CarComp a mod could delete it for you.
got it thanks
@CarComp XSLT is a language for specifying transformation templates for XML. You define a query on the origin XML and a template for what is generated in the output. A similar engine could be built for JSON, I suppose.
14:01
@CarComp Just try not to do it again :)
Nothing to do with the question but the discussion of XML reminded me of the best blog title in history nonodes.spunow.co.uk
I am reading a document about integrating R in to SQL
I somewhat know R and wondering if anyone knows about the SQL part of this?
is there a point
@CarComp that is really confusing xD
or maybe it's just because it's a lot of stuff
so the top and the bottom one are two different json objects then?
yes pretty much, but they represent the same data on each side
some parts map over.. some dont
Basically, what you need is an implemenation of JsonPath/JsonQL/one of those query-languages-for-json things, that are modeled on XPath. So you can define a rule that maps [./Contactor/Address[*]/Line1] to [customer/addresses[*]/street/[0]], or something like that, right?
14:12
its a mess
but its MY mess to deal with ;)
this may sound stupid, but is there any way to just take a json path and generate a JToken object from it?
it would be complicated to do so.. i can imagine the code required to do it...
but excellent if that sort of thing just existed somewhere
Avener just read your post above mine
yes thats what i need something like that.
@CarComp I see now that Newtonsoft JSON.NET supports querying tokens:
right... here is one of my queries custom_attributes[?(@.attribute_code == 'size')].value
its for a product though, so don't expect it in the json i shared, but i post THAT query to demonstrate how it might be nigh impossible to go from that BACK to an object
// name of all products priced 50 and above
IEnumerable<JToken> pricyProducts = o.SelectTokens("$..Products[?(@.Price >= 50)].Name");
i use those in my property attributes
i iterate them in my base class, so all of the objects are query-able from one place
Yeah you're getting into the realm where I can't be of much help
14:17
i was considering this:
Regex pattern2 = new Regex(@"attribute_code == '(?<attribute>\D+)'");
string attrName = pattern2.Match(attr.JsonPath).Groups["attribute"].ToString();
at least i could garner the name back out from the query, but this leads me back to my original statement.... I don't like doing this.
its the one thing i find 'icky'
@AvnerShahar-Kashtan I can appreciate what you are suggesting, but I don't know if my skill level goes that far. I've always struggled with XML, even understanding how it works etc. Something about it just makes me pull my hair out.
complex sql does the same thing.
;)
War
War
do you ever get that feeling that when you are hacking the legacy code base and avoiding using as much of the old infrastructure as possible that you are about to start some huge problem
There is the legendary post about parsing HTML with regex that basically says, HTML is not a regular language so in the general case it's impossible. I don't know the definition of a regular language so not sure whether JSON is another such case
War
War
I really don't have time to learn this mess
But tread carefully with regex
i can count on my queries not to change.. i wrote them.
yes regex is again, one of those 'icky' things i don't like
i wish it was like 1998 again and i could just type "DoEvents" and everything would work right.
14:20
Ahh, VB6.
yes! DoEvents was the magic fairy dust of VB6
code slow? DoEvents?
using too much ram? Did you use DoEvents?
well i can see that I really do have a real challenge. I don't get those often
usually its "can you add this text, HTML is too complicated for me"
@AvnerShahar-Kashtan tell me from 0 to 10 where 10 is 'thats great' and 0 is 'an idiot might try it.. I know that the json structure will not change. Its VERY unlikely due to PCI compliance crap and 'once it works' mentality. If I added properties to my attribute representing where something is using an enum.. for instance .. WhereItIs.Root or WhereItIs.AdditionalAttribute, and switch on that, and build my object using functions
by creating the jtokens i need, then combining them into the master object after iterating ALL of the properties and their attributes, and words, and stuff
this is within my skillset right now
another approach might be to define source and destination POCOs and then use a library like Automapper to translate one to the other
HAH at the description of automapper
I like XSLT but there isn't really a similar story for JSON and trying to cobble an alternative together might be more trouble than it's worth
man it frustrating everyone is gone here. idk why they all take vacation when its -15 outside. I take my vacation in june and go to florida
what could they POSSIBLY be doing
shopping? ugh.
i'm going to look into some of the ideas you all have shared with me. I thank you for your time. I'm going to leave this open though, if anyone wants to pm me, i should hear it. i think.
14:31
I think I'm leaning towards @TomW's solution. Build a C# class that represents FormatA. Build a second class that represents FormatB. Build a code-to-code transformation between the two.
Don't try to map between two JSONs. Instead, map JSON A to an object, object-to-object, and JSON B to object. It'll probably be easier.
DoEvents.. shivers
\o/ I'm finished with meetings for the day.
Whaddup here.
Not much
I'm just passing by
Feeling the pain of using a new framework.
What's up with you @RoelvanUden?
It's started raining.
And I'm heading home in 15 minutes.
And it's started raining.
And I'm on a bike today.
And it's started raining.
Anything new in Holland?
14:43
Nothing much. Rounding up this months sprint, preparing for holidays soon :-P
@scheien What new framework? :P
@AvnerShahar-Kashtan God is in the rain ;P
@RoelvanUden oh, it's not new new per se, but new to me. Aurelia.
And it does not cache viewmodels out of the box (yet).
Aha. I have seen the docs, it looked nice, but never tried it.
so loading routes results in retrieving data all over again
and breaks the looks for mobile navigation
and so fourth
It really like it.
but the good news is that there's some people working on the cache thing, so I guess it will be available in a few weeks.
So tired I'm close to tears. On the other hand, one more day then 13 straight days off
Sounds like a bit of a flaw :D
@TomW Sweet. :D
14:51
Why does one define his own delegate if he can use the built-in Func and Action delegates?
Not the tears part, but the free part.
Haven't you asked this question before @MohamedAhmed?
@MohamedAhmed For clarity. All you know in Action/Func is arg1 arg2 arg3 etc. It can be very verbose and unclear.
And delegate syntax predates Func/Action. You used to have to do it like that because it was the only way.
I don't do it often, but I just defined a CaseSaveAction delegate, which could be expressed as an Action<Case>. But is more explicit.
It also allows me to register an instance of CaseSaveAction in my DI container and later resolve an IEnumerable of all CaseSaveActions and execute them before saving.
14:54
@AvnerShahar-Kashtan i was doing something similar.. but instead of a class for each side, i had one class that could handle each side mapping to a base class object. the property attributes were how i was going to try to handle the mapping
i was never trying to do a 1 to 1 map
i need the in-between object in case i need to make changes before i pass along data
Oh yeah, DI container is a good use case for it, especially if you use delegates a lot. A single implementation for Func<string,string> would not be that helpful, for example.
@TomW I actually think that, but I'm sure I didn't get a reply
@RoelvanUden could you have a look at my question please? stackoverflow.com/questions/41219923/…
grr this kind of coding is so boring
maybe i just have coders-block
after doing this for 6-7 years
somehow i jumped from building 3600 series engines at Caterpillar LEC to becoming a software engineer.
ermahgherd
@CarComp That's the classic timeframe for programmer's burnout.
14:59
oh lovely
posted on December 19, 2016 by ericlippert

Continuing with the question of how to deduce the “type scheme” of letrec map f s = if null s then nil else cons(f(hd s)) (map f (tl s)) Knowing the type schemes of null, nil, and so on. Let’s … Continue reading →

And yeah, sometimes there's no clean and elegant solution. Sometimes you just have to crank out line after line of mapping code.
damn. i wanted a clean and elegant solutino
(thats italian for solution i guess)

« first day (2256 days earlier)      last day (2918 days later) »