« first day (1436 days earlier)      last day (3516 days later) » 
07:00 - 23:0023:00 - 00:00

7:32 AM
Morning guys
 
 
3 hours later…
10:28 AM
Morning
 
 
2 hours later…
12:58 PM
gmorning
 
 
1 hour later…
2:17 PM
Yo
 
3:14 PM
Heya
I want to document a HTTP multipart/form-data + JSON Web API, I'm not typically a web person. Anyone know any sites/project with decent documentation that would be good to emulate?
 
Is it the JSON objects you want to document only or .. more?
@user1112560 I was thinking that this is a "good" example: hl7.org/implement/standards/fhir/resourcelist.html
 
Having the JSON objects documented would be a great start.
 
but it is VERY exensive. Click on any link on that page .. to see.
They generate that stuff out of a github repository as far as i know. Based on some obscure office-xml shit.
 
Daamn
Thanks, this looks great.
 
especially if you think of multipart as supporting both XML and JSON content.
But .. if you want it real easy, and you have REST and stuff.. check this out. Click the DEMO button. That is really good documentation too.
http://jsondoc.org/
52
Q: RESTful JSON API Documentation Generator

Arthur MaltsonI'm wondering if anyone has any experience or recommendations for tools that can be used to generate web pages that document and let you play with a RESTful JSON API. I'm thinking of something like the Github Developer API or Google API Console. Looking around, I've found swagger from Wordnik, w...

 
3:36 PM
The fuck is a JSON
Is that like Jason
 
json.org - a cross-platform format for transmitting data.
 
3:48 PM
Yeah, we are trying to figure out how to best document Jason's activities so others can abuse him too.
 
4:12 PM
I have an open source project started. It's a server-solution but needs UI for development/configuration. Any tips on how/where to publish an ad for "open position in open source project" ?
 
 
2 hours later…
5:56 PM
My dog passed away this morning :(
 
6:17 PM
@Tokencodingnewbie Sorry to hear that :-(
 
user1881400
6:47 PM
Here's an interesting question; how do I add two variables of unknown type together? I have a generic method that tries to add two objects of type T. The types can be just about anything, but is it possible to do this without making a bunch of overloaded methods for each known possibility (like one for strings, one for ints, etc.)?
 
What do you mean by 'add'?
(that's a loaded question)
 
excuse my shocking ignorance.. but how do I compile this? i'm wondering if perhaps it's not c sharp.. but then i'm not sure what it is or how to compile it
it is from an answer here stackoverflow.com/questions/3037008/…
 
user1881400
@TomW literally T someObject, someObject2; T result = someObject + someObject2;
 
user1881400
(They are not null and have been initialized)
 
@FizzledOut IIRC the compiler already works out whether two types have a common addition operator or not
@barlop it's C# I'm pretty sure, but it's missing namespace references
 
user1881400
6:50 PM
It doesn't like the syntax, though. It says operator + cannot be applied to operands of type T and T
 
possibly expects some sort of global namespace import
@FizzledOut well that's because it can't
The point of a generic parameter is that it's unknown at compile time
 
user1881400
Am I doomed to making multiple overloaded methods then?
 
Well, what I just said isn't really true
@FizzledOut what are you trying to do?
 
@barlop pastebin.com/5aZExvPE does this compile?
 
user1881400
@TomW Make an extension method to ResourceDictionary for WPF that adds a value to an existing value given a key. It checks to see if the key exists and if nothing is null, then goes ahead and tries to add a value to another value.
 
6:53 PM
I just compiled it with using System.IO;
using System;
using System.Reflection;
yes, thanks
doesn't quite do what I want but it compiles ;-)
 
@FizzledOut yeah, so the problem with that is that there are only a few types for which the concept of addition makes any sense
You can inspect types for the presence of an op__Addition method (that's what represents +) but it'd get really messy and just seems like too much effort
 
user1881400
@TomW Alright, I suppose. It's just that somebody might make their own values and overload the addition operator themselves and I want to enable it. Here's the code: pastebin.com/vaiCbNMW. Thanks for the response.
 
8:11 PM
@gurun Thanks, maybe I can immortalize him in a game when I get that far in my coding career, only 5 more years to go!
 
@Tokencodingnewbie maybe you can create a mod for minecraft and add him as a mob.
 
@gurun I hate minecraft lul
 
8:45 PM
Greetings.
@Tokencodingnewbie how'd you get on with O's and X's?
I feel like making pong again...
 
Taking a break today to play games and yesterday I went out. So I'm pretty much at this still.
public int DetermineRow(int i)
{
return i / 3;
}
Which doesn't divide evenly :P
 
Which is exactly what you want :P
Think about it, given something on row 0, what will the return be?
And then for row 1, what will the result be?
etc
 
See I was counting 1,2,3
Not 0,1,2
 
0 1 2
3 4 5
6 7 8
Well even then, it'd work
you just have to subtract 1 in that case, but you're best sticking with how C++ works: indicies start at 0
 
So top row = 0 and then from there.
That makes sense then.
 
8:54 PM
Yeah :)
So for 0 - 2, the answer will be 0
for 3 - 5, it'll be one
6 - 8, it'll be 2
 
Now how can I use that data in a meaningful way?
 
Well first, we need to get columns sorted too
as just the row is going to be pretty useless
 
So, have a think
 
They are in 3's too, but it wouldn't work the same.
 
8:55 PM
Good, so you've noticed they're in 3's
That is key once again
If you get stuck, ping me and I'll give you a nudge
 
Might as well nudge me now
haha
 
Sure
So, what's 0 / 3? From a maths perspective, not C++
 
0
 
Mmhm
what's 1 over 3?
(this is going somewhere)
 
9:00 PM
1/3
 
Yep
However, in C++, we don't get the fractional, we get how many times it wholly divides, as we just did with the rows
What's the remainder of 1 / 3?
 
Try again
1 / 3 == 0 and what left over?
 
I hate fractions.
.63?
 
How many 3's go into 1?
And what do we have left?
 
9:02 PM
.33?
 
No, the answer will be a whole number
Example
11/10 goes once, with 1 left over
21 / 10 goes twice, with one left over
25 / 10 goes twice, with 5 left over
that "left over" is the remainder
so, for 1 / 3, what's the remainder?
 
It goes into it zero times! How can something remain x_x
 
The bits that don't go in exactly
So, with 1 / 3, 3 goes into 1 0 times (as you said), so we still have our 1 left over.
 
how do I cycle through hubsections?
 
@DemCodeLines what?
 
9:06 PM
So 2/3 has a remainder of 2?
 
YES!
:D
What about 4 / 3?
 
YES :D
You got it
 
@OMGtechy HubSections in XAML.
 
So, look at the following:
0 1 2
3 4 5
6 7 8
@DemCodeLines never heard of em
@Tokencodingnewbie see if you can work out what column it is based upon what I've just told you
 
9:07 PM
ever used office on a windows phone?
 
@DemCodeLines nope, have on Android a little
 
Well it looks like you divide by three 0/3 = 0 1/3 = 1 2/3 = 2
but 3/3 = 1
 
@Tokencodingnewbie that's the remainder, but yeah
and 3 / 3 does not have a remainder 1
 
oh right.
0
 
9:10 PM
yeah
 
putting it back into column zero
 
Mmhm
bingo
 
How the hell would I ever figured that out on my own x_x
 
You get used to it
How old are you?
If you don't mind me asking
 
9:12 PM
Cool
 
21
 
Ugh trade me?
 
NEVER!
 
I wish I started young.
 
9:14 PM
Everyone does
I wish I started younger
You'd never be satisfied
haha
 
Probably not.
 
> Tip: Two section Hubs don’t wrap. This is by design. Having a Hub with fewer than three sections is not recommended UX and supporting wrapping for two section Hubs was very expensive.
That's sad, because Microsoft contradicts that itself on it's Office for Windows Phone app.
 
Haha, sounds about right.
 
I was a big slacker, then I went to culinary school (waste), went into an IT program (waste) never finished either, met my ex fiance and ended up flunking out of school :/
 
9:16 PM
@Tokencodingnewbie At least you've lived a little
Tried different things
 
The IT program lied to me.
Said it was for coding.
Spoilers: It wasn't
I had one coding class where I got an A just for showing uo
 
I had something similar; just ended up being SQL and CompTia
 
We NEVER had assignments.
or tests.
Just show up.
 
I was teaching THEM how to program more often than not, so I just walked out.
 
Lame.
Ok so I now know where each button is in the row and the column
 
9:18 PM
Indeed.
 
public int DetermineRow(int i)
        {
            return i / 3;
        }

        public int DetermineColumn(int i)
        {
            return i % 3;
        }
 
Yeah
You'll typically want both pieces of information together though
do you know what .NET tool you need for that?
 
Fair enough, take a look at Tuple
I will give you no more guidance than that :)
 
Wow the description of what it is, is SO informative.
 
9:21 PM
on getting both results at the same time that is
 
Provides static methods for creating tuple objects.
 
haha
@Tokencodingnewbie read further down the page
 
I am.
I have to start dinner
 
Under remarks
"A tuple is a..."
 
and I said I wasn't going to code so I could finish Dead Rising :P
 
9:22 PM
Coding is productive at least :D
 
Yeah but I wanna finish it D:
I go back for another not fun work week tomorrow :(
 
Well, the more you put in the more you get out
Devote yourself to programming and you'll get better. Eventually, a job if you keep at it.
 
I know but I don't want to get burned out.
Plus I'm slightly hung over.
><
 
Indeed
If your head hurts, you're learning something
 
welp brb dinner
 
10:17 PM
Is there something in c# that would support multiple values in collection such as Dictionary<int, float, string> dictionary ?
 
@Marek depends how you want to use it
For example, how do you expect it to behave? Having a key value system with multiple values begs the question; which value do you want? C++ has a nice solution to this, but I do not know if C# does without the use of a Tuple as a value.
 
@OMGtechy Thanks for that I found that solution with Tuble but I changed the algorithm and will use different approach. Currently I need to find how to sort values in Dictionary by value.
 
Well, do you want to sort in place or get a copy in order?
 
@OMGtechy Well I somehow need to order my static Dictionary<int, float> by float value. And when I order I need to check whether key value or ordered as well :D
 
I'd imagine .Sort(element => element.Value) or something like that
Wait, so you want it ordered by key AND value?
 
10:32 PM
I guess no. I need to order by value first and then check if the key order is ordered too.
Example: <2, 300.56> <1, 600.56> <3, 400.56> First order by float value and then check if key is 1,2,3. Will need to find out some light weight code.
 
Well what is the point in the first order if you're just going to reorder another way anyway?
Or is this in different places in your code?
 
I think I will order for first. Then loop to check if each element key is previous+1
What do you think?
 
I have no idea what you're trying to do. From what you've said, it looks like you're asking for this:

<A, B> - order by B
<A, B> - order by A

What was the point in the first order?
What's your use case here, that may be a better question.
Why are you trying to do this.
 
No.
<A, B> - order by B
Check if A is ascending int like 1,2,3 for each element
My english is not that good hope it is understandable.
How do you make new line in this chat btw?
 
Hold shift
and press enter
 
10:39 PM
very handy
 
So you only want to order by B, and then check how it is ordered by A, not actually reorder?
 
Yes, correct.
 
Ok that makes more sense.
So, do you want the sort to be in place or no?
 
Sorry, dont know what that means. Example:
 
i.e. do you want the order of your container to be affected outside the scope of this method you're writing.
 
10:40 PM
<2, 300.56>
<1, 600.56>
<3, 400.56>
will become
 
Yes, but do you want to get a copy or affect the original container?
 
<2, 300.56>
<3, 400.56>
<1, 600.56>
I can work with original
 
Ok then, just type .Sort(x => x.Value)
I believe
 
I have just discovered this: List<KeyValuePair<int, float>> so I am working with it.
 
Why?
Dictionary does the same job.
Only it's easier to read!
A Dictionary is pretty much that.
 
10:42 PM
I couldn't found method for .Sort in dictionary
 
Type .ToList() after it
so: myDict.ToList().Sort(x => x.Value);
That may be acting upon a copy though
 
Ok.
Delegate 'System.Comparison<System.Collections.Generic.KeyValuePair<int,float>>' does not take 1 arguments :/
 
Or you could write an extention
.Sort((x, y) => x.Value < y.Value))
I'm actually a C++ programmer mainly, so whilst the general idea is fine I might make a syntax error here or there xD
 
Ok will try to find out how is that syntax really :D seems to not thake this either.
 
How many arguments does it take?
 
10:46 PM
dictionary.ToList().OrderBy(key => key.Value);
This sounds good.
Guess that will work in my case.
 
That won't affect the original container
hence why I asked at the start
Otherwise it's pretty much the same as .Sort
 
Ok so I will have to get back to .Sort :D
So it takes Comparison<KeyValuePair<int,float>> comparison
No idea.
I see them working with the KeyValuePair all the time.
 
What's the problem?
A dictionary is essentially a list of key value pairs
 
I got no idea at the moment what should be in Sort function as argument
 
x => x.Value
If that doesn't work, say what goes wrong.
 
10:55 PM
Delegate 'System.Comparison<System.Collections.Generic.KeyValuePair<int,float>>' does not take 1 arguments
It takes: takes Comparison<KeyValuePair<int,float>> comparison
 
What else does it say?
Then create one :P
 
dict.ToList().Sort((first, second) => first.Value.CompareTo(second.Value));
 
@user1112560 I also suggested that
11 mins ago, by OMGtechy
.Sort((x, y) => x.Value < y.Value))
 
@user1112560 that would order by Value?
 
Untested, but pretty certain it will do.
1 sec
 
10:57 PM
It will, hence the Value
 
Thanks
 
I did say this 11 minutes ago :P
 
Sorry :D
 
it's ok :)
 
07:00 - 23:0023:00 - 00:00

« first day (1436 days earlier)      last day (3516 days later) »