« first day (4268 days earlier)      last day (677 days later) » 

mr5
6:50 AM
o/
@Wietlol I know you are here
so I got a question for you
Presumptions:
1. There is a hybrid app where it is used both in browser and wrapped in WebView for "native app".
2. If you navigate to the app's website, it will redirect you to other domain if you are not logged in.
3. Whatever query string you put in the URL will be removed.

Problem:
- It should auto login to the login page when user clicks on a certain link regardless of the device (app or browser).
    - This is not a problem in the "native app" as I can inject JS code.
- Manually typing the link in browser's address bar should not auto login.
The only solution I can think of right now is to fix presumption #3 as I think it is a result of poor design.
 
 
1 hour later…
8:03 AM
> Manually typing the link in browser's address bar should not auto login.
then the url must be different
 
Hello friends!
[Squirrel in Training] We bacc bois
 
mr5
@Wietlol is that your suggested solution?
 
that is the conclusion
the suggested solution is to allow the auto login even when you type the link in the browser
unify the flows for logins on all devices / app flows
 
mr5
Ah sorry. I think it should be "Requirement" instead of "Problem"
 
solution: stop using shite requirements
that is my solution
 
mr5
8:16 AM
well, we could use your suggestion: use a different link. but this will be boilerplate of code.
@Wietlol what would you say to your PO if you encounter this kind of requirement?
 
mr5
:D
well, tbf, there is more to it though than what I wrote here
I think the argument is that "if you click on this link from this page, you will auto login"
 
then the url must be different
 
mr5
if only I could use that ^
this is me challenging the requirement
 
"is it a deliberate choice to make the mobile app and web app work differently regarding this feature? or can we unify these flows to reduce maintenance?"
 
mr5
8:25 AM
wow. that sound professional
 
"yo, this is more maintenance, I wont do this"
 
mr5
I have never said "I wont do this" like ever
do you do that?
I guess I'm a sheep
 
iDunno
I cant remember me ever saying that seriously enough
but I have said before "yea, we better not"
 
mr5
@Wietlol do you chat like this in work? Do you have intention why you are doing that?
 
8:45 AM
botler, restart
ffs
 
mr5
9:08 AM
bork
@CaptainObvious do you always sound professional when you communicate at work?
like using profound words
 
Hello friends!
[Squirrel in Training] JHecking server m8
[Squirrel in Training] I like the unicorn touch <@211519661420838912>
 
bötler!
Botler, die
 
@Wietlol Sorry, I don't know that one.
 
of course you do
 
mr5
y r u ignoring my question wiet
I think I have found out something regarding query string getting lost on redirects.
 
9:19 AM
@mr5 because I challenge the requirements
 
[Captain Obvious] It's dine
[Captain Obvious] I need somebody to remind me later
[Captain Obvious] But I'm hopefully gonna do some work on botler later
 
mr5
window.location.hash.split('?').pop().split('&').map(it => {
    const [value, key] = it.split('=');
    return ([key] = value);
});
How do I translate this to dictionary?
 
[Captain Obvious] what in the fuck
[Captain Obvious] get that js shit out of hhere
[Captain Obvious] oh god it looks like trying to parse out a query string
 
mr5
yeah lol
 
mr5
9:29 AM
turns out the query string is located after the window.location.hash and not in the path
hmm
new URLSearchParams(window.location.hash) not working
 
[milleniumbug] define "not working"
 
mr5
oh. I have to trim this #?
 
[milleniumbug] why are they storing this shit in the fragment identifier
 
mr5
example.com#?data=123
yeah ikr
:D
 
[milleniumbug] fairly sure it can handle that ? too
 
mr5
9:33 AM
I already suggested they use History API but it seems it will not yet proceed
 
[milleniumbug] it's just the # is likely throwing it off the loop
 
mr5
it doesn't seem to work with # or ? on the string though
 
[Hector] morning
[Hector] I've wasted more time the last week trying to fix git shenanigans than working on code
[Hector] cheerios xD
[Hector] today I pulled and pushed, and git is telling me I've added a ton new files that my team has made
[Hector] i dont even know what they are
 
Why did james bot just fly in oô
 
10:02 AM
[Hector] TIL stashing changes doesn't stash your staged stuff, it stashes ALL
[Hector] and now it throws an error when it tries to pop the stash, which makes no fucking sense
[Hector] what do you guys do when you know you never want to commit changes for a file, but ignoring it (or the folder) doesn't hide them?
[Captain Obvious] I think that at this rate
[Captain Obvious] You should just copy your changes to another folder outside the repo
[Captain Obvious] Delete the repo
[Captain Obvious] And reclone
[Hector] i have a problem with that, it's complicated
 
@Botler add to gitignore, remove from git, get beer
 
[Hector] there are a lot of files that come from an installation with licensing tools that we copy over to the development environment, otherwise the server won't stop complaining
 
iirc, you cant add and then ignore changes
 
[Captain Obvious] ye we went through that one yesterday
[Captain Obvious] or the day before
[Hector] yep, that's where all this bullshit comes from
[Captain Obvious] Oh don't worry SO bois, that's soemthign on my list of things to fix
[Hector] don't ask me why I need to have release DLLs in my debug setup
[Hector] but that, and all the .config files just won't fuck off
[Hector] I just want to ignore
[Captain Obvious] But do they need to be in the repo?
[Hector] nope
[Hector] maybe i can git delete them?
[Captain Obvious] Easiest way:
\[**[Captain Obvious](https://discord.gg/PNMq3pBSUe)**] Delete them from the repo.
Commit the delete (if they are already in there as far as git is aware)
Edit the gitignore to ignore the files, and commit the changes to that
Restore the files, and git won't care
[Hector] I mean they are needed, but they are always there for other people to download
[Hector] IDK what's the point if everyone should be replacing them
[Hector] they kinda work like app.config files
[Hector] you always replace them with yours
[Captain Obvious] If it's specfic to a developer, then there's no point in it beinf in the repo
[Captain Obvious] I guess you could add an ignore for the file already in the repo, I'm not entirely sure but then I think it will ignore subsequent changes to the file, but the original one will aways be in the repo
[Captain Obvious] But the file needs to be unchanged when you commit the change to gitignore
[Captain Obvious] Unrelated: Botler's issue page: github.com/butler1233/stackoverflow-chatbot/issues - I intend to start working through the ones I have labelled "Planned", if you have any worthwhile things to add, let me know
[Captain Obvious] That applies to everyone on both sides of the relay
[Hector] so i guess no alternative
[Hector] the code owners won't approve this change
[Captain Obvious] Well after you've done the gitignore then you can change it as much as your like
[Captain Obvious] Basically as long as there's no diff on the file you want to ignore before you commit the ignore, you're good
[Hector] aw fuck, so I have to commit and/or discard my changes in order to have gitignore kick in?
[Hector] and people claim git is the best VCS... man, so far I'm happy with SVN i think
[Captain Obvious] Well I mean the ignore probably should have been set up correctly a long time ago
[Hector] is there no way to, say, tag a bunch of files with a color so I know i never want to do anything with them, but i want them to be there?
[Captain Obvious] You can just stage just the gitignore, commit that and then you should be good
[Captain Obvious] Put them in th egitignorew
[Hector] I did, bt no good
[Captain Obvious] gitignore is finnicky
[Captain Obvious] you need to get the pathing correct otherwise it won't ignore what you want it to
[Hector] **/[Aa]pp.config should ignore all app.config files everywhere, shouldn't it
[Hector] because that alone doesn't work
[Captain Obvious] It won't start ignoring until it's committed, but toherwise I think that should work
[Hector] I'm gonna branch out and commit everything there
[Hector] I think i found the golden goose
[Hector] git update-index --skip-worktree filename
[Captain Obvious] ooh what does that do
[Hector] apparently, it forces your local copy to believe your changes are up to date so they will be treated as such for the purpose of updating
[Hector] so you tag individual files, and they should be gone from tracking
[Hector] i'll test and report
[Hector] works as advertised
[Hector] beware it's case-sensitive, but autocomplete isn't
[Hector] so if your file is C:\Test\file.exe and you type C:\test\file.exe it will throw a fatal error
 
 
1 hour later…
1:19 PM
[Hector] just to confirm, does everyone else work in their own personal branch and PR when you want to share your changes?
[Hector] because we are currently committing all to the feature branch and that breaks the nightly builds and it's a mess
 
1:34 PM
we generally have 2 branches:
1, master
2, development
we edit in /development and pull request into /master
 
Good for you filthy cat
 
in case of a special feature, breaking change or something weird, we create a new special branch
but in 99% of the cases, just /development is sufficient
we just have a lot of repos and dont really work with multiple people on the same repo that often
 
mr5
@Wietlol that should work for 2 devs, but more than that it's a hell to manage.
 
that works for 2 devs per repo
with 200 repos, that means we have an upper bound of 400 devs
 
mr5
upper bound?
limitation?
 
1:44 PM
yes
 
mr5
y r u making it complicated
 
I am using programming terms
 
mr5
I see, you're using microservices
 
exactly
so, we actually have 200 development branches
we'll be fine :D
 
mr5
1 server: 1 service?
 
1:46 PM
serverless
 
mr5
can you define serverless in lower language?
 
architecture where you dont have to manage servers yourself
 
mr5
is it like console apps with limited lifetime that only runs as needed in a single server?
 
maybe everything runs on one big server
maybe each service runs on its own server
probably somewhere in between
but we dont care... we also have no control over it
we just ask from AWS to run our services when needed
 
mr5
oh so it's like a multitenant microservices
 
1:48 PM
they take care of getting servers up and running
 
mr5
but without the auth I suppose
 
nah, multitenant would be a property of user experience
 
mr5
huh
 
while microservices is more a property of technical architecture
 
mr5
I thought multitenant means sharing of hardware between services
 
1:50 PM
multitenancy is shipping your applications as if they are individual services per customer
for example, AWS' services are almost all multitenant
they are bound to your account
 
mr5
ok
 
so you, as a customer of AWS, have your set of services (your own machines, your own databases, etc)
and I, as a different customer of AWS, have a different set of services (my own machines, my own databases, etc)
 
mr5
but why is there a need to pass an auth when calling APIs between servers/services?
 
there is no need to pass auth between our services internally
unless they connect via a public gateway, which they dont
 
mr5
hmm I maybe confusing it with other then. I thought the whole purpose of mt is to reuse hardwares
is AWS the pioneer of those concepts?
 
1:53 PM
it sort of is
the idea of MT is that you have separation of data
and if you ship your code to different hardware per customer, you can separate that data
but if your code itself supports MT, you can host it on one machine
for example, if you store your customer files under /wwwroot/, then you need separate machines to serve different customers with separated data
but if you store your customer files under /wwwroot/<tenant-id>/ then you can share the same machine for multiple customers or tenants
you'd need to have some sort of permissions system in place to prevent tenants from accessing resources of other tenants though
 
mr5
oh yep that's what I'm referring to
but how come you said you use mt but not required to pass auth between internal API calls?
how do you identify which tenant the API is called from or who requires it?
 
we dont use MT
also, we authorize on entry points
internally, it is the internal authority doing the actions
for example, you, as user, may be authorized to queue some process
the process internally sends reports via email, which you are not allowed to do, but the internal authority is
the entry point (queueing the process) would have to do the authorization check to see if you have the appropriate permissions on the given resources
technically speaking, all the systems support MT, but we dont use it yet
 
mr5
2:13 PM
hey, on a completely different note, if you receive an access_token, that can be use to request for cookie right? If so, where?
 
not sure what you mean
 
mr5
usually, access_token are used for auth between API calls right? Let's say it's part of Authorization: Bearer, access_token
I mean the token that can be found usually when invoking an API with Authorization header
and what I'm not sure about is how do you use this token to request a cookie on a server (which will be used by a browser)
I'm assuming the server would respond with Set-Cookie header which will be managed by a browser internally
 
you dont use the token for the cookie
you use cookies to store the token so you can keep using it for further requests
 HttpContext.Current.Response.StoreCookie(
    LoginTokenCookieAddress,
    loginToken.ToString("D"),
    DateTime.UtcNow.AddHours(LoginTokenDurationHours)
);
 
mr5
but where do you set that cookie?
that would be on server right?
 
the server sets that cookie
cookies are a server side tool that is stored on the client
like the inverse of a remote database, where the data is used by the client, but stored at the server
 
mr5
2:20 PM
but yeah, technically speaking, you can request the server to set the cookie for you "manually"
heh "stored at the server" my ass
it's also stored in the browser
it's just that JS isn't allowed to access the internal HTTP client of browser.
 
I think your database isnt storing the data in your browser
 
mr5
> The Set-Cookie HTTP response header is used to send a cookie from the server to the user agent, so that the user agent can send it back to the server later. To send multiple cookies, multiple Set-Cookie headers should be sent in the same response.
okay I think they have a weird implementation here
because they "manually request" for cookie.
isn't that suppose to happen after authorization request?
@Wietlol is login token the same as access token?
 
pretty much
except the login token is just a guid
 
mr5
anyway, supposedly, I have received a generic token which will allow me to receive a cookie at some certain server. Let's say I have obtained this generic token from A but this A uses an 3rd party IdP that is a requirement to generate that generic token. How do I know which server I should use this generic token? Is it on 3rd party IdP or in A?
if my assumptions here are valid, what if the 3rd party IdP receives it from another IdP?
I think I should just use it on A
I would assume that A should just have the copy of that identity wherever it pulled it from.
 
3:13 PM
hello. my question can be a bit off-topic.
Where can I find good XSL/XSLT reference documentation?
I think the one from w3Schools sucks!
 
3:31 PM
👍
@Botler 👍
 
[Captain Obvious] Generally if it's somethign to do with web, it's probably covered by MDN
 
@Botler Some of it blows.
 
[milleniumbug] of course w3schools suck
[milleniumbug] -inurl:w3schools.com is how you remove it from search results
[Captain Obvious] gfd I just had to go onto SO chat just to see what that reply was sent to
[Captain Obvious] I can't wait to improve this bot
[milleniumbug] alternatively, get used to typing mdn after whatever web related search you're doing
[milleniumbug] like getElementById mdn
 
 
2 hours later…
5:25 PM
posted on June 23, 2022 by Mike Rousos

Introducing preview 2 of incremental ASP.NET migration tooling, including support for shared authentication. The post Incremental ASP.NET Migration Tooling Preview 2 appeared first on .NET Blog.

 
5:35 PM
Hi all
 
Trying to use this code to stitch two PDFs together:
public static byte[] Combine(byte[] first, byte[] second)
{
    byte[] ret = new byte[first.Length + second.Length];
    Buffer.BlockCopy(first, 0, ret, 0, first.Length);
    Buffer.BlockCopy(second, 0, ret, first.Length, second.Length);
    return ret;
}
I feed it two PDFs and it produces a white sheet PDF -- blank
 
[Captain Obvious] You can't just stick two bytearrays together and expect it to worl
[milleniumbug] "I have two briefcases full of documents and I want a single briefcase that contains all of the documents from the two briefcases so I glued the two briefcases together" is what you did
 
Ahh
 
[Captain Obvious] Nah, glued together you can still open them
[milleniumbug] yeah this analogy is a bit flawed
[milleniumbug] anyway what you need is something that can understand the pdf format, read the actual pdf file, get the pages from it, and you doing the same stuff with the two files, putting these pages in the proper order, and then producing another pdf file from that
[milleniumbug] which is, you know, the same as you would do with opening these briefcases and getting the contents from them
[milleniumbug] and then putting them in another briefcase
 
6:04 PM
Thinking iTextSharp is the answer
 
these days I'm starting to question if any normal user ever loads a PDF for anything
 
@Freerey Forms, CVs, some instruction manuals. In corporate environments, PDFs are often printable materials.
 
corporate is the only place I see PDFs being used in my area, and that's because my employer's website needs to generate PDFs full of metallurgical data -- but even for something like a CV, people just use online portfolios
or an email
 
Depends - many places want the CV to be a PDF. Many others accept Word documents but then the formatting could be wonky when opened.
Hence it's just easier to ask for PDF and users can just take their Word document and make it into a PDF
But manuals, documentation, other materials are also common. Worked on a system once for an estate agency that took data for their properties and produced PDFs. They had hard copy versions of these anyways and wanted to have basically the same but for their website, so people could download it, instead of going to their office for one.
 
 
1 hour later…
7:47 PM
okay guys
I need someone to go into the sandbox and star the message "ooh a user left event"
It's already got one star, but I need another
chat.stackoverflow.com/rooms/1/sandbox Here's a link to make it easy
Thanks :)
I didn't think it'd work for more than 1 star,, but it was worth a try
But botler will sync messages being starred in SO to discord
That's the first test of using the messages stored in the DB to do stuff with them after they've been sent
Next is to send edits from Stack to Discord
 
woot
 
8:10 PM
Ayylmao
 
8:41 PM
[Captain Obvious] okay so we should get replies from stack in discord to (although only replies to other stack messages right now)
 
9:05 PM
@CaptainObvious weeee
 
[Wietlol] LIAR!
[Captain Obvious] it works lmao
[Wietlol] my "weeee" was a reply
 
9:33 PM
@Alex If your boss doesn't mind spending money, PDF4NET might also be an answer. I've just noticed now it is being used here for the purposes you want in a large code base of my work o2sol.com/pdf4net/overview.htm
 
9:48 PM
[Captain Obvious] The bot was not running when you did that
[Captain Obvious] I dont it#
 

« first day (4268 days earlier)      last day (677 days later) »