« first day (1757 days earlier)      last day (3193 days later) » 

6:36 AM
hi
 
 
4 hours later…
11:16 AM
I hate it when I programmed something, and I don't have a clue anymore about how I got that to work =D
 
Morning.
I have weird problem: In VS 2015 I have MVC 5 project, which itself loads areas that are compiled as separate libraries. The problem is that in razor view files I have intellisense with main project, but it disappears in libraries where areas are defined. Web.config is identical for both.
It seems that intellisense messes up base class with _Page_Default_cshtml class
And what's the weirdest I can't even access System.Object (inside razor views).
 
 
2 hours later…
12:58 PM
hello anyone would like to tell me how can i add 2 number without using any kind of pre defined data types like string etc
?
example 3222222222222222228439934939439434.372328737 + 92328838784374873843848347.872387847 and answer must be perfect hint from my colleague he said that using overloading you can do this but im still stuck there howw any genius here :P
 
1:45 PM
Can I somehow change my WPF DatePicker input format? I want to display my datepicker as dd-MM-yyyy, which works. But when I input 12-03-2015 (12th of march), it gets transformed into 03-12-2015 (3rd of december) as soon as I leave the datepicker control. Any clues as where to look?
 
 
1 hour later…
2:49 PM
Does anyone know if I can set my own error message when a JSON Schema (Newtonsoft.Json.Schema) criteria is not meet, lets say I have minLength: 6 and condition is not meet I want to have my own message instead of default message that is less than informative for a end user; String 'test' is less than minimum length of 6. Path 'param.password', line 1, position 68.
 
3:12 PM
Is there in WinForms an option to catch all KeyUp events? I hate it when something has focus, and then it won't fire my main form's event
 
3:35 PM
@MirzaJhanzaib why would you ever want to do that?
 
3:52 PM
overloading?
that doesn't even mean anything
overloading what?
 
4:08 PM
hi
does anybody have experience in transforming large json files?
 
@StevenLiekens probably what he meant was cast, @MirzaJhanzaib everything will have a underlying type so the question needs to be reformulated so we can understand the question.
And are there any types that support such high number at all?
 
4:25 PM
apparently not in vanilla .NET
you can work with BigInteger and string manipulation to get rid of the decimal points
 
@KendallFrey actully its a task given to me and im still not sure how can i do this :)
 
Is that number the actual value you are working with tho?
those values*
how about a byte array and work your way up through the array and finally convert byte array back to string again.
 
@Joachim no but its kinda like a task to me . my coleuge gave me his exe of console app and its working perfectly i event add 100.100 digits it also give me the right answer in addition
no data type you can use restriction
that is the reason i am stuck
 
but in all honesty I would use a third party math library for this
I got two new followers on twitter today
that's more than I gained in an entire year
 
4:47 PM
@MirzaJhanzaib I'm still a bit confused about the type restriction you are talking about or do you mean you are restricted to certain types?
 
@MirzaJhanzaib Who in the world gave you a task like that?
And more importantly, why?
 
I think he means there is no built-in type that does this already
that would be restricting
restrictive?
 
5:03 PM
yeah @StevenLiekens
 
@MirzaJhanzaib So what exactly are the rules?
What types are you allowed to use?
 
rule are you cannot use any builtin data types like string var etc
 
Can you use built-in types inside your own custom class?
 
no built in will hold 100.100 digit values and their right sum
so we are faild here by using this
 
Yes it will
BigInteger
 
5:08 PM
he means 100 digits and 100 decimal digits
 
BigInteger can do that
 
fixed-point fractional numbers
Just like storing monetary values as an integer of cents rather than a fraction of dollars
 
5:09 PM
buts its an integer what about after . values?
and its not fixed numbr user may can put 101 digits
101.101
 
that changes everything
Why did he say you can't use a string?
 
yes no string we can use :/ dam hard
 
I said why?
 
unless your users plug in their brain directly to a serial port, you're gonna get string input
 
I'm not suggesting you use a string, just wondering why you can't use one
 
5:14 PM
its kinda task rule what else can i say :)
 
Is this homework?
 
How are you initially feeding the numbers when there is no other type that can hold that value initially?
 
Because if not, there has to be a reason for the rule.
 
Sounds like homework to me
 
@scheien homework pufff no way man its just a task from friend he;s saying if you have a great grip in prog you can do this and its seems like im dull :d
 
5:17 PM
@KendallFrey
 
@MirzaJhanzaib: Still seems like homework.
 
i have a regex question, the question is...
 
@SteveG
 
i think what i'm tryign to do with regex is wrong, and if it is, feel free to say so
 
something doesn't add up
 
5:18 PM
but what i want to do is this
 
can't use strings, but you're using a console app to get numbers from a user
 
i have some json, i want to manually remove a wrapper node:

.. <some json>...
someNode: {
<some other json i want to keep>
}
 
@MirzaJhanzaib Well, if it was me, I'd implement a floating-point number using BigInteger as the mantissa and int as the (base 10) exponent
 
i want to write a pattern to match the someNode node, and remove it, but keep the internals of that node
 
regex does sound wrong for that
@StevenLiekens I think that just applies to the math part
 
5:20 PM
@StevenLiekens its not a restriction to display in console or win app question is how
 
thanks
 
@KendallFrey let me try your way too then
 
@SteveG Json.Net?
 
too slow
too much json
 
@SteveG why do you work on saturdays but not fridays
 
5:21 PM
this is a side project, i took pto yesterday
basically, i want to transform json, from an external schema to an internal schema, so i can deserialize it into external dto's, do some manipulation of that data (n^2),then convert all of that to an internal dto schema, just to sererialize it back into json
so inefficient
i could go from external json -> xml -> xslt -> internal xml -> json, but thats also pretty slow, so i figured i could just do some quick regex replaces, but that works for k/v pairs, but not so much for wrappers
 
Remind me to write a JSON regex when I'm bored
 
don't forget to make it readable
 
lol
 
It's almost certainly easier than XML, which isn't impossible
 
5:53 PM
While speaking of json: stackoverflow.com/questions/31895429/… this possible or supported?
 
showing json validation errors to the user seems like a bad idea
I would only ever use that information for debugging
and enforce that the data is valid elsewhere in your app
instead of or in addition to the schema validation
 
Well this information is debugging information, forms have their own validation rules.
Lets say something did manage to screw up, the error that is returned is then readable by an end user.
 
that's basically leaking implementation details
and since you're dealing with security, do you really want that?
;)
 
Well the API for the service is a open API.
 
6:10 PM
using json.net?
 
Yes
 
you can use JsonReaderException.Path to get the name of the field with bad data, then print an error with all validation rules for that field
and let the user figure out why it didn't work
 
Thanks, I use this on a highly experimental web site im creating: db.tt/l3k2WX7q
Just a at-home-for-fun-project where I get to try out all different crazy implementations, so far over 6 years I have sunken a few thousand hours into it and currently working on rewrite 7 or 8 lol.
 
7:19 PM
Hello people! :)
I just learned that you can write expressions as such ((TUser u) => u.UserName). about time.
 
7:41 PM
@diemaus I don't know why you would ever need to do that
 
I have a case!
Let me sync with github.
No i did not :(
Here is the use-case, but turns out i can just remove the type: github.com/mausworks/MausWorks.MongoDB.Identity-Service/blob/…
 
as in u => u.UserName ?
 
Yes.
@StevenLiekens i think my intellisense was lagging behind when i wrote it the first time, because it errored.
 
you only need to use the expanded form if you're passing 2 or more parameters
 
Yes, i know. But even then you don't need the type.
just ((a, b) => { /* stuff */ })
 
7:48 PM
then I'm not sure why they let you specify a type at all
 
@StevenLiekens as i said, my intellisense must've lagged behind; because before i added it, i got red lines all over. I added it; red lines gone. Now i removed it, no red lines.
 
yeah but why is it possible to specify a type if you never need it?
I mean I guess it's probably used to solve some weird inheritance issues
but I can't think of how that would work
 
8:07 PM
@StevenLiekens yeah, i don't know. It's probably there for a reason, but now i can't come to think of any use-cases either....
 
this is not allowed, is it?
Func<obj, int> intParser = (string s) > int.Parse(s);
int n = intParser("123");
I can never get code formatting to work properly in chat
 
use `
Yep.Func<object, int> intParser = (s => int.Parse(s as string)); must be used.
 
yeah that's what I thought
welp
maybe it works the other way around?
 
hmm
 
Hey guys.
 
8:12 PM
hey @AshSimpson
 
Func<string, int> intParser = (object s) > int.Parse(s.ToString());
object input = (object)"123";
int n = intParser(input);
maybe that works
 
Hey, hows it going? @die maus
 
@StevenLiekens nope:
Func<string, int> intParser = ((object s) => int.Parse(s as string));
is syntax error
@AshSimpson good i guess, working on my Identity + MongoDB implementation.
 
well then I have absolutely no idea why they allow you to specify a type
 
Doesn't @StevenLiekens :(
 
8:14 PM
@die maus I was looking at MongoDB the other day, unfortinately couldn't find a updated tutorial, and the guides on the github didn't match the current version, are you using the MongoDB.Driver Nucket plugin?
 
nucket? :D
 
@AshSimpson yes, that's what i'm using. 2.0.1
 
@die maus Ah, I was using 2.0.1, couldn't get on with it.
 
@AshSimpson everything is async, so you better be using .net 4.5.X
 
@die maus what about 4.6? or does it have to be 4.5?
 
8:16 PM
@AshSimpson of course 4.6 works : p
This class basically implements loads of features from the driver if you need examples: github.com/mausworks/MausWorks.MongoDB.Identity-Service/blob/…
 
@die maus Ah thanks, that will be a good read for tonight when I have nothing better to do aha.
 
8:33 PM
anyone else experiencing caching issues with resharper?
 
@StevenLiekens not using currently, but can't say i have when i did. How do you mean?
 
like it insists that the class I'm using doesn't exist
but it does, and my code compiles just fine
I think it happens when resharper caches my solution and visual studio hasn't restored nuget packages yet
 
8:52 PM
yeah, that's what I'm experiencing
 
Did any of the answers help you?
 
0
Q: Getting The diminsions of the uploaded image in ASp.Net MVC

Ahm NaimHow to get the dimensions of an uploaded image in ASP.NET-MVC. This is my FileHelper class to upload a file using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using System.Web.Mvc; namespace workflow.helpers { public class FileHelper ...

 
made it worse
 
@StevenLiekens that's great!
 
...
kill me
 
8:59 PM
@AhmNaim i can answer your question in a while :)
 
@diemaus I found the fix
 
@StevenLiekens sweet man :)
 
changing this setting fixes it instantly
 
Ah, sweet! :)
 
@diemaus thanks, please answer it.
 
9:08 PM
@AhmNaim somebody answered it, not me. The answer is correct. That is how it's generally done.
 
@diemaus thank you.
 
9:30 PM
@AhmNaim no probs
 
9:45 PM
 
Where to buy that T-Shirt, aha?
 
no idea
the internets
 
Anyone know, in Json.net, how to allow deserialization from (possibly several) alternate names but only serialization to the actual property name? Consider Unity's [FormerlySerializedAs] attribute (blogs.unity3d.com/2015/02/03/renaming-serialized-fields)
 
I can come up with one way
But it may not be the best way
It may not even work
 
I'd prefer to avoid tacking on extra deserialize-only properties that map to the real one
 
9:48 PM
@KendallFrey sounds good!
 
OK, then ignore me
 
I'm becoming more of a Scala fan every moment I deal with C# o_o
 
10:01 PM
@KendallFrey
 
:24975322
:(
 
are you bored yet?
 
appveyor is too slow
everyone stop building plx
 
Your CI is being slow? That's a TRAVISty
 
10:24 PM
@SteveG are you?
 
10:37 PM
Just realized that sometimes, reversing boolean expressions makes it way more readable.
        if (!(i == 0 && newChar == replacementChar) && // To avoid starting-dashes.
            !(i == value.Length - 1 && newChar == replacementChar) && // To avoid ending-dashes.
            !(newChar == replacementChar && prev == replacementChar)) // To avoid double-dashes.
        {
            builder.Append(newChar);
        }
 
 
1 hour later…
11:48 PM
this doesn't work:
DateTime? lastRefresh = callTiming != null ? callTiming.LineUpLastRefresh : null;
this does
DateTime? lastRefresh;
            if(callTiming != null)
            {
                lastRefresh = callTiming.LineUpLastRefresh;
            }
            else
            {
                lastRefresh = null;
            }
first one says can't convert type <null> to type DateTime
is that not weird or what?
 
Try DateTime? lastRefresh = (callTiming != null ? callTiming.LineUpLastRefresh : null);
Any luck @SteveG ?
 
oh i didn't try, one sec
nope same thing
 
Is "LineUpLastRefresh" a datetime or a nullable datetime?
 
a datetime
 
DateTime? lastRefresh = (callTiming != null ? callTiming.LineUpLastRefresh as DateTime? : null);
 
11:57 PM
actually, idk what it is. let me check, ef generated it
 
Are you using C#6?
If you are using C#6 then you can use: DateTime? lastRefresh = callTiming?.LineUpLastRefresh;
 
yeah just a date time
no not 6 yet
 
Then: DateTime? lastRefresh = (callTiming != null ? callTiming.LineUpLastRefresh as DateTime? : null); should do it
Or: DateTime? lastRefresh = (callTiming != null ?(DateTime?)callTiming.LineUpLastRefresh : null); whichever floats your boat ^^
 

« first day (1757 days earlier)      last day (3193 days later) »