« first day (3636 days earlier)      last day (1298 days later) » 

2:00 PM
@Freerey Laughable.
Senile old twat who should have lost to Bernie.
 
agreed lol
 
Im in general against such old leader
 
I mean have you heard him talk about Corn Pop?
 
they are too old imo
this is a very demanding job
 
My feelings extend as fasr as Biden != Trump therefore ✔
 
2:00 PM
Nelson Mandela was almost as old as them
 
Trump is an Idiot² but it's still better than somebody talking about Corn Pop, the bad black guy.
 
also idk corn pop? you mean the cereal?
 
#AOC2024
 
@Freerey What? Are you not riding for Biden?
XD
 
I may vote for either him or the libertarian
 
2:01 PM
anybody knows what this is in xamrin forms
 
jo jo 2020
 
APT2126:file not found.
 
@c0dem0nkey Sounds like a wildly preemptive presidential campaign
 
lol
 
the joe is missing me
joke*
 
APT 2126
 
Trump gonna win this one no problemo.
Binden to much kaputt in Kopf.
 
if Andrew Yang runs again, I'm voting for him, but I think Bernie's done for good now
 
Trump might be really dumb abut alteast he got his wits.
Yeah Bernie not gonna try again sadly.
He was a great guy for the position.
Shame that that luni made it over him.
 
But maybe next time
3 mins ago, by Captain Obvious
#AOC2024
 
2:04 PM
there won't be a next time mofo
>AOC
I dn't trust anyone with Sanpaku
 
AOC won't be old enough in 2024
 
@CaptainObvious Age of conquerors?
 
you have to be 35
 
Yeah
She will be
Sure it'll be by like 3 weeks
 
plus she needs way more experience before I'm comfortable with her in that kind of position......she should also stop writing legislation in crayon
 
She's 31 in 2 weeks
31+4=35
 
Hussa
Who is that?
 
It's a week before the election. XD
 
The date that matters is inauguration date anyway. Her birthday could be Jan 19th 1990 and she'd still be good
 
yeesshhhh that'd be weird having a 90s kid as president
is she gonna not stfu about how great Hey Arnold is?
and how Ocarina of Time is flawless?
 
2:08 PM
Actually, the date that matters is registering to run as President
soooooo months before the election
 
Negative
 
you can't register to run and be on a ballet unless you meet the requirements
 
Exactly
 
IGNORE ME
 
trust me the green party just found that out the hard way
 
2:09 PM
@Freerey did you see that corn pop vid now?
 
To serve as president, you must be 35 years or older. As presidential service starts from inauguration, it's good
 
@Squirrelintraining We are
 
nooo I didn't; kinda cn't right now
 
@CaptainObvious Aww, cuties. Sorry to hear about you losing one... that hurts like hell, I'm so sorry my man.
 
@Freerey THEN DONT ASK ME WHO CORN POP IS
HE WAS A VERY BAD GUY
Capsih?
 
2:11 PM
Had her for just over 13 years so she did well
 
Oh, yes, a very very respectable age.
 
Wasn't fond of acting her age though, both of them act as if they're about 2 years old constanly
 
Haha a little more snarky but still very puppylike?
 
the sad part is that isn't even the worst video
 
2:14 PM
America is just constant entertainment.
 
America is peak trash reality TV. It's only funny because it's so realistic though
 
I just want the Americans to stay in their own borders.
 
Our cities are on fire
 
@Hozuki It's hard to train that to americans.
(My father is left the country 40 years ago so I must know)
 
2:17 PM
Yeah once they see oil they attack
 
Nooo
Not oil
 
Right. "Spreading freedom"?
 
WeApOnS oF MaSs DeStRuCtiOn
 
Surprised America hasn't invaded my kitchen
 
2:17 PM
Bought 10L of cooking oil from costco the other day
 
@CaptainObvious More like your bathroom.
40 secs ago, by Squirrel in training
WeApOnS oF MaSs DeStRuCtiOn
 
I remember one Biden ad that was like "poor kids deserve the same opportunities as white kids" and it showed a pic of him with some black kids
 
2:18 PM
😏
@Freerey 🤣
Gotta love that dude
 
Wait wait wait, don't we literally provide the military for every European country
 
@Hozuki Missing the US&A Flag :D
 
@CupOfJava Yes and no.
 
@CupOfJava No, you force it on us moa or less.
Also get out of Ramstein finally!
+ giff back our teritory that u are using for military practices like near paderborn
WWII IS OVER I TELL YOU!
 
"Force" we tried to pull troops out of Germany and we weren't allowed to
 
2:20 PM
First time I hear of that.
 
Yeah do you know how much we spend on the military a year
 
Imagine spending that on the NASA instead.
Or on society.
How much better would the murrican people be off?
Eh?
 
I think up until recently the US was providing military for Japan?
 
Yeah @CupOfJava I am aware of the insanely high budget of the US Military has.
But what for?

Wars are not worth it anymore, you only cause more tention nowadays and it's just plain right stupid IMO.
 
@Squirrelintraining BuT fREe HeAlTh cARE iS SociALiSm
 
2:23 PM
I feel like that's an oversimplification of how foreign policy works
@Freerey we still are
 
I can't remember who said this, but I remember some authority figure in Japan (might have been the PM) said Japan needs to build up its own military
so he was kicked out of his position circa 2014
 
@Hozuki 🤣
 
@Hozuki well it is, but people are so allergic to the word socialism that it puts them in cardiac arrest and rushes them to the hospital
 
@Freerey IIRC Japan wasn't allowed cuz WWII
 
@Freerey Not surprising. JSDF is called a "self defense force" for a reason.
 
2:25 PM
yeye…some pact we signed
 
@Freerey @CupOfJava what happedn to ObamaCare?
 
basically saying the US would oversee a bunch of military operations worldwide until 2045
it's still around; Trump tried repealing it, but Obama intentionally made it extremely hard to repeal
 
He didn't succeed?
 
nope
 
2:26 PM
the ACA had basically been planned for 5 years before it was set in motion
 
He basically did. He got rid of the individual mandate
 
then it came out, people bitched about it for 15 minutes, and moved on
oh yeah, he got rid of the only part of the ACA that people disliked
 
yeah but it doesn't work without it
 
but the ACA is basically exactly what Richard Nixon wanted anyway, so idk why the GOP is so mad about it
 
Wat is ACA?
 
2:28 PM
affordable care act...that's "Obamacare"'s official name
 
premiums went up drastically after it was removed
 
that figures
 
@Freerey ah
 
@Squirrelintraining I'm not very "pro-war" but I don't understand what makes them different nowadays than years ago
When did they become stupid?
 
because they're fought over resources and not because somebody attacked us? :P
 
2:36 PM
@CupOfJava Because we can acchive more, quicker, and cheaper via trading.
The flow of information is thousand times better and we are connected like never before.
Why attack and take if we can talk and trade?
Less suffering, quicker execution, and less violent.
 
I agree that we have went to war in the past over oil (many times over oil) but the US doesn't really use foreign oil anymore
 
It can be also to make a ressource scarce/harder to jeeet thous driving up the prices.
 
So if it isn't about oil. Why do you think we go to war?
interesting
that could be it
 
I have no Idea why.
Maybe to legitimate that high-ass-military-budget and use the oil as a scape goat?
Coincidentally rise oil prices and maybe maek money back
 
maybe
I'll have to look into it more
but maybe you're right
 
2:46 PM
I am just a random squirrel from the SO chat who has no clue what he is talking about.
And I'm proud of that!
 
And that squirrel is F*cking nuts because he's yelling foreign policy that a cup of coffee :P
The weirdest part is the cup of coffee is talking back
 
Nah, that's just science.
 
If you have code with multiple threads and you're in debug mode, when you hit a breakpoint in one thread, are other threads continuing to run?
 
Depends on whether or not you checked the little checkbox. I think by default they all stop.
 
HAMMERTIME!
 
2:55 PM
@Hypersapien No
 
3:09 PM
Have a nice day of work gurls and dudes
seeing u
 
3:24 PM
cya
 
3:50 PM
Can someone take a look at this for me? I'm fairly inexperienced with threading and I'm not sure if I'm doing this right. Have a class that launches off a separate thread, and I want to make sure that if another thread is created with the same Company/Org/Plan combination while a previous one is still running, the earlier one gets killed.
https://gist.github.com/Hypersapien/6d826c21937ff3d54ad9104ba5daba92
 
4:45 PM
Still working on that?
 
4:57 PM
@Hypersapien you look into BackgroundWorkers?
 
5:20 PM
@juanvan How do you mean?
 
5:33 PM
@juanvan I looked up BackgroundWorker. Is this something that's ok to use outside of a desktop environment? This is a web application.
 
Ya you can use a background worker anywhere, IIS is just where the BackgroundWorker pools are more common
 
I have multiple C# applications ("workers") running on separate servers. I would like to be able to pause the execution of certain workers, would WebSockets be a good technology to implement this?
 
5:49 PM
I don't see any reason not to, you could kill a worker with an API call if you wanted it
 
"I have remote processes I want to communicate with should I use a network protocol?" Yeah probably. Is websockets a network protocol? Yes it is, can C# do websockets? yes it can.
Is there a better protocol? Well now that reeeeeeeaaaallly depends on a lot of details :)
Something like this (SignlR uses websockets) github.com/andyste1/SignalR.PubSub
 
Lot on what you want to learn
 
6:09 PM
After 2 decades learning line of business application development I can give this piece of invaluable advice: Woody's make the best naval rum.
 
Why is all the rum gone?
 
Cosh I shrunk it alllsssshe he...
 
6:41 PM
@jacks Sounds like you need a message queue instead.
 
 
2 hours later…
8:51 PM
hey all!
 
hi
 
I've got the following method which gets the terms and conditions content of my app from a json file stored in the project. I'm trying to add a way to output a list of subheadings instead of just outputting an object. This is what I've currently got
 public TypedResponse<AppContentResponse> GetContent(string content)
        {
            //Need to store on s3
            var policyFile = new StreamReader("contents.json");
            string json = policyFile.ReadToEnd();

            var policyDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

            if (!policyDic.ContainsKey(content))
                throw new ApiException(HttpStatusCode.BadRequest, "Policy does not exist");

            var policy = policyDic[content];
My current json file contains something like this
{"faq": "`1 APPLICATION OF TERMS `" } so if you hit my get endpoint localhost:44345/api/v2/content/faq it'll output the following : {
    "data": {
        "heading": "faq",
        "content": "`1 APPLICATION OF TERMS `"
    }
}
But I want to change my content.json to something like this   "terms-and-conditions": {
    "1 APPLICATION OF TERMS": "my first test",
    "1.1": "These terms apply to use of the App",
    "1.2": "If you do not agree to these Terms"
  },
which would involve creating a list I'm assuming and outputting the subheadings but not sure how to go ahead with it
 
You're going to make a json file your TOS?
 
usually there is a version for the call with /content and /content/id. This is a version of it, where instead of id, you have "faq"
 
This just sounds umm a practice in patience.
 
9:02 PM
ok. Now I lost you
 
so I just want to output the subheadings
e.g. when a person hits the endpoint faq , it will output all the subheadings and the content
but I'm not sure how to access
those subheadings
 
You want something like that, only with your data
 
@juanvan sorry I dont understand
  "faq": {
    "1 Privacy Test": "test privacy content"
  }
json would look like above
 
9:04 PM
Ya
 
and output would look like this
{
    "data": {
        "heading": "1 Privacy Test",
        "content": "test privacy content"
    }
}
 
JSON-LD Schema Generator
 
but if there's more subheadings it would output more if that makes sense
@juanvan what does that do?
 
Well it's not TOS
It's for google question/answer b/c they want a json to display
 
@ntohl But I'd have to change the response to a array since I'll have multiple subheadings so response would look like this
[
{ heading : string, content : string },
{ heading : string, content : string },
{ heading : string, content : string },
...,
...,
]
I just need to know how to acess further layers in json so I can think of how to output the subheadings and content?
and ideally change my response to a IEnumerable
 
9:09 PM
Is there some kind of spec for this?
 
current spec I had
The Content resource is an array with the following form:

[
{ heading : string, content : string },
{ heading : string, content : string },
{ heading : string, content : string },
...,
...,
]

Where each item is an object with heading and content strings.

A content resource is accessed by a content key via the following route:

/api/v2/content/{ content-key }

The content returned should differ depending on the specified content key. Current content keys are:

terms-and-conditions

privacy-policy
but I can make it a bit more clear
 
you can have Dictionary<string, string> return type for /content, and string for /api/v2/content/{ content-key }
 
how do I access subheading values though? e.g. if I had something like this
  "terms-and-conditions": {
    "1 APPLICATION OF TERMS": "my first test",
    "1.1": "These terms apply to use of the App",
    "1.2": "If you do not agree to these Terms"
  },
 
To access them you need to call them by key
 
terms-and-conditions is the {content-key} and I'd want "1 APPLICATION OF TERMS" to be the heading and "my first test" to be the content
 
9:13 PM
or have some way to rotor over them in javascript in the browser
Terms and condition is the Header
 
yeah. This json format is not ideal. If you can really make an url from that
 
hmm
 
{
  "terms-conditions":{
    "Header" :"Some Data ON TOS",
  "1" : "1 Term",
  "1.1" : "1.1 Term",
    "1.2" : "1.2 Term"

  },
    "faq":{
    "Header" :"Some Data ON faq",
  "1" : "1 faq",
  "1.1" : "1.1 faq",
    "1.2" : "1.2 faq"

  }
}
Something like that?
 
yeah
like that
public TypedResponse<AppContentResponse> GetContent(string content)
        {
            //Need to store on s3
            var policyFile = new StreamReader("contents.json");
            string json = policyFile.ReadToEnd();

            var policyDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

            if (!policyDic.ContainsKey(content))
                throw new ApiException(HttpStatusCode.BadRequest, "Policy does not exist");

            var policy = policyDic[content];
 
9:43 PM
anyone there?
 
Sometimes
Got kids the other times
 
far :(
*fair
 
Ya is lame some days
 
any suggestions on what I've metnioned above
*?
hahah i can imagine the chaos
 
hahaha ya 12hrs in right now
brb diiner
 
9:48 PM
no worries
 
10:15 PM
if anyone can help me currently would be sweet! am super stuck on this
 
10:26 PM
5
A: REST API Best practices: Where to put parameters?

inf3rnoAccording to the URI standard the path is for hierarchical parameters and the query is for non-hierarchical parameters. Ofc. it can be very subjective what is hierarchical for you. In situations where multiple URIs are assigned to the same resource I like to put the parameters - necessary for id...

like this?
 
nah not quite
 
I mean that's my suggestion
 
sorry ignore that one
how would I change my dict to output an array? @ntohl
 
different urls different return types
 
meaning?
its a object currently
 
10:29 PM
as long as the return type is HttpResponseMessage
than it can wrap a dict, and string for /content/1.1
 
if i have this
 public TypedResponse<IEnumerable<AppContentResponse>> GetContent(string content)
        {
            //Need to store on s3
            var policyFile = new StreamReader("contents.json");
            string json = policyFile.ReadToEnd();

            var policyDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

            if (!policyDic.ContainsKey(content))
                throw new ApiException(HttpStatusCode.BadRequest, "Policy does not exist");

            var policy = policyDic[content];
 
I mean /content/1%2E1
 
this should be a quick fix to change from object to array i dont want to change anything els
 
wth is that TypedResponse anyway
 
just a response type thats accepted in the app
 public class TypedResponse<T> {
        public T Data { get; set; }
    }
 
10:34 PM
you are loosing the generic return type of the REST
 
how?
 
like exactly what you are doing
 
its currently been implemented by someone else :?
:/
 
you cannot differentiate between if you have /id=122 or /content<no /id=122>
you need same return type
 
@ntohl do have to use a select or where clause in my code? in order to output as a array?
 
10:35 PM
tho most of REST apis do this differentiation
it's missing the type system to kick in
 
would I do something like public async Task<TypedResponse<IEnumerable<AppContentResponse>>>
 
public Dictionary<string, string> GetTOS()
AND
public string GetTOS(string param)
depending on params different return types
 
what would the return type be in my case?
 
TypedResponse<IEnumerable<AppContentResponse>> and TypedResponse<AppContentResponse> if you really insist
but still. I would go with dict and string
 
thats what i had above though
 
10:39 PM
not or, and. Typo
you have no variant of multiple return types
 
  public TypedResponse<IEnumerable<AppContentResponse>> GetContent(string content)
        {
            //Need to store on s3
            var policyFile = new StreamReader("contents.json");
            string json = policyFile.ReadToEnd();

            var policyDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

            if (!policyDic.ContainsKey(content))
                throw new ApiException(HttpStatusCode.BadRequest, "Policy does not exist");

            var policy = policyDic[content];
I get an error IF i do something like this
 
no. You need 2 bodies
2 different methods
 
Cannot implicitly convert type 'eVouch.Dto.TypedResponse<eVouch.Dto.TermsAndConditions.AppContentResponse>' to 'eVouch.Dto.TypedResponse<System.Collections.Generic.IEnumerable<eVouch.Dto.TermsAndConditions.AppContentResponse
 
routing should kick in
 
oh what why?
 
10:42 PM
REST apis do that.
public Dictionary<string, string> GetContent()
and public string GetContent(string header)
 
and what would be in the public Dictionary<string, string> GetContent()
method?
 
whole routing goes depending on the /content/id or /content
2 hours ago, by rey123
  "terms-and-conditions": {
    "1 APPLICATION OF TERMS": "my first test",
    "1.1": "These terms apply to use of the App",
    "1.2": "If you do not agree to these Terms"
  },
that dictified
 
but I don't understanding why ti can't be done in the same method
you are still going to be passing the same type into that method
in order to get a response
 
no
2 different input
one method accepts 1 param
other none
routing decides which method will be called
 
yeah but dict gets called into the GetContent method right?
 
10:45 PM
dict will be return type
 
doesnt make sense though..
public TypedResponse<IEnumerable<AppContentResponse>> GetContent(string content)
        {
            //Need to store on s3

            GetDictContent();




            return new TypedResponse<AppContentResponse>
            {
                Data = new AppContentResponse()
                {
                    Content  = policy,
                    Heading = content
                }
            };
        }

        public Dictionary<string, string> GetDictContent()
        {
            var policyFile = new StreamReader("contents.json");
 
new Dictionary { ["1 APPLICATION OF TERMS"] = "my first test", ["1.1"] = "These terms apply to use of the App", ....
 
I want to call it from json file
 
json is not a programming language
just return policyDict
 
11:14 PM
still dont understand sorry :/
how would I do my error checks then
could I do something like this @ntohl var policy = policyDic[content].ToList();
public TypedResponse<IEnumerable<AppContentResponse>> GetContent(string content)
        {
            //Need to store on s3
            var policyFile = new StreamReader("contents.json");
            string json = policyFile.ReadToEnd();

            var policyDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

            if (!policyDic.ContainsKey(content))
                throw new ApiException(HttpStatusCode.BadRequest, "Policy does not exist");

            //gets the value from the key value pair
Cannot implicitly convert type 'System.Collections.Generic.List<char>' to 'string' current error I get
 
var data = new List<AppContentResponse>();
foreach (var pair in policyDic)
    data[pair.Key] = pair.Value;
return new TypedResponse<IEnumerable<AppContentResponse>> { Data = data };
something between the lines. Still wrong way
 
but how would you output heading and content?
like so Data = new AppContentResponse()
{
Content = policy,
Heading = content
}
 
11:51 PM
still stuck :/
public TypedResponse<IEnumerable<AppContentResponse>> GetContent(string content)
        {
            //Need to store on s3
            var policyFile = new StreamReader("contents.json");
            string json = policyFile.ReadToEnd();

            var policyDic = JsonConvert.DeserializeObject<Dictionary<string, string>>(json);

            var response = new List<AppContentResponse>();

            foreach (var pair in policyDic)
            {
                var p = JsonConvert.DeserializeObject<AppContentResponse>(pair.Value.ToString());
Content is currently saying can't convert from List to strin
string
 
mr5
what does TypedResponse<T> looks like?
 
 public class TypedResponse<T> {
        public T Data { get; set; }
    }
 
mr5
then wrap it in some T : IEnumerable<AppContentResponse>
 
thats what I've done
return new TypedResponse<IEnumerable<AppContentResponse>>
            {
                Data = new AppContentResponse()
                {
                    Content  = response,
                    Heading = content
                }
            };
 
mr5
typeof(Data) == IEnumerable<AppContentResponse>
in your case, typeof(Data) == AppContentResponse
 
11:57 PM
so you mean do Data = new IEnumerable<AppContentResponse>
 Data = new IEnumerable<AppContentResponse>()
                {
                    Content  = response,
                    Heading = content
                }
            };
 
mr5
yeah something like that but you've got the wrong syntax
also, IEnumerable cannot be constructed.
 

« first day (3636 days earlier)      last day (1298 days later) »