« first day (4244 days earlier)      last day (687 days later) » 

1:37 AM
lol
format broken
 
 
4 hours later…
5:43 AM
Good morning
@Hector just put these things into tasks. I don't know if this is the way to go yet, but I recently built a very similar construct for reading socket input:
By storing the cts in a tuple together with its task, afterwards I can just access the tuple and cancel like binDaLooper.Token.Cancel
Edited the image so it shows the "token" is actually a cts here lol
Same thing works on a slightly bigger scale with multiple tasks:
 
mr5
guis guis guis
 
Hopefully still not too convoluted here. Main point is I have an async task method I pass a token to and store both the token source and the returned task in a tuple, in this case in a list of tuples.
 
mr5
I have a quston!
 
Very good
 
mr5
<!-- template.html -->
<div>
	<p>{{ model.text }}</p>
	<ul class="a b c">

		{{ listOfObject.forEach (item) -> }}
		<li> {{ item.name }}</li>
	</ul>
</div>
 
5:56 AM
angular?
<li *ngFor="item in listOfObject">{{item.name}}</li>
Kinda like that
Maybe gotta put a let in from of item or something
 
mr5
// JS
var html = parse('template.html', model, listOfObject, ...)
div.content = html
ohh
I am looking for a JS framework that does that kind of thing
Earlier, I have looked at Mustache
but I am not sure which one fits what I have in mind yet
or could it pre-render the html template even though there is no data yet?
 
You want to load the whole thing dynamically?
I mean
 
mr5
<div class="is-template"> will remove is-template later on.
 
This just looks like MVC views with extra steps
 
mr5
yes
I am looking for a client side rendering for dynamic pages
 
6:01 AM
Just use blazor server then
 
mr5
ehh, not possible
 
But how dynamic exactly?
Tbh this looks like a bit overly dynamic here
 
mr5
we do already have vanilla html, in-house server-side renderer to render our dynamic pages
 
Like 100% dynamic, at this point you can just render it on the server
 
mr5
no, creating the dynamic html in server is not a good idea for SPA
 
6:02 AM
100% dynamic pages is not a good idea for SPA either though
 
mr5
it's going to be slow and hellish maintenance
 
You need some kind of structure that you can depend on
 
mr5
yeah but other frameworks are already doing it
I am not sure if angular is client-side rendering
 
Angular is 100% client side rendering
As is blazor WASM
 
mr5
ohh
yep, so I'm looking for something like angluar
 
6:04 AM
In that case I suggest blazor WASM of course :D
 
mr5
I am still canvassing which client-side renderer to use with that approach
do we need to create some server still for it to work?
 
Maybe gotta ask other ppl here too, as I don't know much about react/vue/sveltje
Just need a server for static hosting, no runtime
 
mr5
oh just throw all you know
I can research while waiting for them
@Squirrelkiller what is it going to host?
 
You can even start the SPA by double clicking the index.html
@mr5 index.html, and then some files depending on which framework you use.
 
mr5
ohh I see. We already have that.
My boss sent me a task "mobile planning fy2023" but most of my suggestions are purely web related
 
6:06 AM
For blazor it will host a WASM module ocntaining the mono runtime and a few dll files to load into the browser, and a bootstrapping js file that starts the WASm module
 
mr5
so I suggested we redesign our frontend
 
angular will have all the modules, components, directives you built, minimized in js files
 
mr5
yay, that looks like startup would be slow?
 
Blazor startup is slower than js frontends still
 
mr5
yeah, that could be an option. Will put that in my suggestion
thanks!
 
6:09 AM
@mr5 It's not such a bad idea to build your web apps mobile first so you don't need an extra mobile app, assuming the use case fits.
 
mr5
I mean, we don't have the APIs required to build the mobile app using mobile native tools
so mobile app rn is just a wrapper
I also included the suggestion to build an API for all of data needed to rebuild the app natively in case they want it.
this is one reason server-side rendering is not flexible
everything should be client-side rendering
I mean, generating the data should always be separate to the actual UI
 
For internal purposes, server side rendering can be very useful as it's faster.
Also you can be sure that the UI always fits the API as you don't have two things to update
 
mr5
do you have any thoughts on mustache?
looks a lot simpler as compared with angular
or blazor
 
Looks a lot simpler because it has no logic I guess?
Looks like parameterized html
logic-less doesn't really work for an SPA
 
mr5
6:25 AM
yeah, looks like a very basic parser
y though
 
Because the user is supposed to feel like they're in an actual application. Switch pages, interact with things.
logic-less doesn't do interaction
You'd have to put the interactive part back to the server again, invalidating the whole idea of client side rendering
If you press a button to calculate something and depending on the results you want to switch two different pages - how does that work with something like mustache?
Probably gotta control that from the server, because the frontend doesn't have actual logic, right?
 
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' pleberinos!
 
mr5
wut?
the logic would come from the API requesting the data. This template library would just use that template to merge the data and UI together. There is still logic
 
@mr5 In my example then, who decides which page to switch to? Client or server?
 
mr5
1. index.html contains navigation bar, content is dynamic
2. js/index.js requests for the dynamic content by requesting template.html and data.json (generated from DB of course)
3. js/index.js will merge template.html (or some file ext. from the framework/library) and the data.json
4. user clicks some button from the dynamic content -> same procedure (template2.html + data2.json)
@Squirrelkiller mustache in this case would just render something it doesn't care about. html will do its thing and something from js/index.js will handle the parsing of dynamic content
now for mobile, this adds the benefit of returning something native from it, like XML for Android, and nib/storyboard for iOS
even XAML for Xamarin
 
6:50 AM
So the server doesn't just return the actual data but also a template? That looks to me like the server makes the decision where to go from here.
 
mr5
yeah, no.
 
But the client only renders the template sent from the server?
So the server decides which template to send
 
mr5
> That looks to me like the server makes the decision where to go from here.
what do you mean by this? can you give example?
yes, it's up to the server to decide which template to serve, but it is up to the client which template to request.
 
Say you're on a page where you input some data and then click on "calculate".
Then either the calculation is successful, the client gets results and switches to a new page displaying the data
Or the calculation fails, so the client shows a modal window with an error message and stays on the input page so the user can edit their inputs
How do you decide, whether to switch to the results page or not?
(Pretending we already know how to open a modal in mustache)
 
mr5
oh, well the "navigation" covers the whole page excluding nav bar.
if there is some specific like that, I would say the logic will be placed on the `js/index.js`.
 
6:58 AM
So index.js will make two calls, the first to do the actual calculation and the second to then request the template?
 
mr5
it would be done typically, like $('submit').show('/success-page')
yeah, depends on what this "calculate" really is
 
I guess it depends on what kind of SPA you wanna build then
 
mr5
say, it just needs to 1+1, then it's just local calculation
 
Might be very much logic in this one index.js vey fast
@mr5 Let's pretend it's definitely not local, because you need data form your db to populate the results
Or lets go with a login, I guess a login is ok too for this example
 
mr5
@Squirrelkiller maybe... but in our use case, judging from the cases I have encountered, it's mostly static content (dynamically served)
so I don't see a single js/index.js will grow that much
 
7:02 AM
Result is either success, leading to your profile page. Or failure, with a message like "wrong credentials" or "account locked".
@mr5 We have a controller with > 5k lines of code in our client, just saying
 
mr5
// failed
1. user logs in
2. sends data.json to server
2. server returned failure with message
3. js/index.js shows the message

// success
1. user logs in
2. sends data.json to server
2. server returned success with page to redirect or maybe it's in the URL already
3. redirect by js/index.js
 
So index.js has if(success) redirect('profile') else showMessage(); basically?
 
mr5
yep
 
I might be ok with that for very simple web apps
 
mr5
well, in our actual use case, I plan to implement/suggest this only in the main content. They implemented the login pages completely different so that's another thing to think about.
also, we're using websockets so requesting data appears to be faster
 
7:12 AM
Which lets us circle right back to "might as well use razor pages so at least you have just one application to update"
You have your template in the razor page and an actually statically typed model in your backend
Except in razor pages you also have the redirects in the controller methods so you don't have a big index.js
 
7:53 AM
[Hector] ā¤ļø
[Hector] good morning everyone
[Hector] now I get an exception if I stop and start the task
[Hector] apparently if you cancel it, it's gone forever
[Hector] what the hell
[Hector] Again
[Hector] It keeps removing the xaml file from the project
[Hector] WTF is going on with VS2022
 
8:15 AM
[Hector] lots of issues on Google, none of them answered
[Hector] funny, it builds and runs perfectly
[Hector] and the files are where they should be, also referenced in csproj
[Squirrel in Training] its whacky
[Hector] i fixed it by removing the references in csproj, restarting vs, and adding existing item
[Hector] it all works now, but now it's throwing plenty warnings as well
[Hector] srsly, a lot of stuff is breaking here xD
[Hector] now it says something called settings.settings is missing
 
Lol what are you doing to your VS Hector
 
[Captain Obvious] Sounds like something is a bit fucky
 
9:30 AM
 
10:08 AM
[Hector] @Squirrelkiller I literally started a new project yesterday to undo whatever fuckup happened after i rebooted... and today when I booted up it was fucked up again
[Captain Obvious] doing anything whilke VS isa in a fucked up state always ends in tears
[Hector] IDK but it could be a broken installation
[Hector] any way to repair?
[Captain Obvious] Use the installer'#s repair options
[Captain Obvious] which FYI is essentially reinstall
 
 
2 hours later…
11:46 AM
ww
 
www. I won
 
mr5
wwf ftw!
 
hey @all
Hope all is good at everyone end
Unexpected character encountered while parsing value: S. Path '', line 0, position 0.
 
oh nooo. I lost
 
12:00 PM
Can anyone guide me for the same ?
 
it wanted to parse something, but the actual value at that moment is empty
debug what goes in if you have option
 
@User Is your json/xml file empty or in a different encoding maybe?
 
In my case, the data is coming in JSON file.
but the same error is prompting at my end
I am unable to capture data
 
Did you look at the actual json file, does it indeed contain valid json?
 
while(true) { "w" }
 
12:06 PM
Yes , I checked on json lint
its depicting valid json.
 
hmm... sounds like you dont actually have json
 
Does the encoding fit the encoding you're using in the code?
 
what do you get if you do string.Join(" ", Encoding.UTF8.GetBytes(json).Select(it => it.ToString("X2"))) ?
 
What's X2?
 
a string literal value
 
12:11 PM
I was clearly asking for the contextual semantic meaning
 
var test3 = JsonConvert.DeserializeObject<dynamic>(response.ToString());
I am sharing the piece of code that i have used to deserialize
 
it means hexadecimal in 2 digits
 
var test3 = JsonConvert.DeserializeObject<dynamic>(response.ToString());
 
Ah nice
@User Don't use dynamic. If you expect json and don't want to use an actual class, use JToken.
 
can you share the result of string.Join(" ", Encoding.UTF8.GetBytes(response.ToString()).Take(20).Select(it => it.ToString("X2")))
 
12:13 PM
Also...what type is response? Have you looked at what exactly "response.ToString()" returns?
 
can you please provide a sample piece of code for the same.
It will be helpful for me to get to exact point.
 
var data = response.ToString();
var test3 = JsonConvert.DeserializeObject<dynamic>(response.ToString()); // Breakpoint here
Then look at the "data" variable
 
mr5
T as dynamic hmm
I have never tried that actually
 
Ok, let me try with the code @Squirrelkiller.
 
in some cases, it works, in others, it wont
 
12:16 PM
It's the javascript version of jtoken
While jtoken is the javascript version of a dto
 
nah, it is the C# version of javascript Object
 
Fair enough
 
I used dynamic. Handy
 
Until you use it instead of proper inheritance structure and generic methods :(
Thankfully we only have one such abomination left
 
mr5
mustache vs handlebar?
 
12:20 PM
I am getting the same error.

'Unexpected character encountered while parsing value: S. Path '', line 0, position 0.
'
 
The only handlebar I know is on my bicycle
 
@Squirrelkiller, Please have a look.
 
@User What type is "response"?
var t = response.GetType().Name;
 
@Squirrelkiller good catch
 
mr5
186
A: Unexpected character encountered while parsing value

Alexei LevenkovPossibly you are not passing JSON to DeserializeObject. It looks like from File.WriteAllText(tmpfile,... that type of tmpfile is string that contain path to a file. JsonConvert.DeserializeObject takes JSON value, not file path - so it fails trying to convert something like @"c:\temp\fooo" - whic...

 
12:21 PM
System.Net.*
starts with S
 
mr5
it says you are not passing an actual JSON format
 
@User you are not supposed to get an error when trying to share what ToString() returns
first stop trying to deserialize
 
Ok
 
mr5
@Squirrelkiller {{:
 
This is the response type

var response = await HTTPClientWrapper<ApiProduct>.GetJson(Helper.BigcommerceURL, "v3/catalog/products?is_visible=true&id=" + id + "&include=variants,custom_fields,images,primary_image", Helper.BigcommerceHeaders);
 
12:23 PM
"var" is not a type
 
You mean to say var is creating error ?
 
no
 
Ok,
 
I mean to say that your message in which you attempted to share the response type had failed to achieve its intended goal
 
Yeah, I got your point
Which code shall i try as i am stuck in for the solution.
 
12:25 PM
any of the ones we shared
such as var t = response.GetType().Name;
(iirc, there is also FullName, which would be more appropriate)
but primarily var t = response.ToString();
then share whatever the value of t is
 
Ok, let me try
I am getting '"JObject"


'
 
and response.ToString()?
 
Sharing.
please wait.
 
[Captain Obvious] WHY IS EXCEL SO BAD AT OPENING CSVs
 
because it doesnt treat CSV as CSV
 
12:39 PM
[Captain Obvious] But it's in the name
[Captain Obvious] It's like the idiots at Oracle
[Captain Obvious] As reported by yours truly
[Captain Obvious] In particular I had this quite snarky comment: The Comma Separated Values export wizard doesn't Separate Values by Comma, and there isn't an option to.
 
when in the netherlands, Excel will treat Comma Separated Values as values separated by semicolon
 
mr5
12:54 PM
should be Dot Separated Values
 
[Captain Obvious] wait really
[Captain Obvious] you're kidding right
[Captain Obvious] that's fucking dumb
 
it is localized
and it thinks that semicolons are what dutch people want
 
[Captain Obvious] that's whack
[Captain Obvious] It's not "semicolon seperated values"
 
thats Microsoft
 
[Captain Obvious] Speaking of fucking dumb shit
[Captain Obvious] Google are idiots
 
1:04 PM
also when you write number in dutch, keep in mind that 10,000 is not ten thousand
 
[Captain Obvious] why not
[Captain Obvious] that looks like 10k to me when adjusted for the wrong seperator
 
that is 10 comma zero zero zero
(woops :D)
 
[Captain Obvious] fucking 10/10
[Captain Obvious] good job
 
mr5
it must be hard to switch context between English Math vs Dutch Math
 
nah
I can easily convert between billions and milliards
 
mr5
1:06 PM
10,000 + 10.000
 
[Captain Obvious] Don't worry
[Captain Obvious] It gets even more confusing because the monthly presentation at this company seems to switch at random between the units depending on which team wrote the slides
 
I still wonder how they messed that up
10^(6*stage)
aka, 1 = million
2 = billion
3 = trillion
but I guess "billionaire" sounds better than "milliardair"
nvm, no it doesnt
@CaptainObvious at my workplace, I simply reject Excel files atm
 
[Captain Obvious] Oh yeah I don't usually need them,
 
partly because we chose to use spreadsheets over excel, but also because it is whack with localization
 
[Captain Obvious] But I was checking the official list of supported devices from Google Play
 
1:10 PM
it took me a while to convince all the project managers to stop using excel, but at least there are fewer issues now
I suppose you could do the same with the number notation :D
I also reject quotes outside of code blocks in slack messages when they are sent from an apple device
because apple devices will replace normal quotes with weird special quotes
and since most of our devs work on a macbook, I have to deal with apple shit
 
[Captain Obvious] Oh it looks like the offending value is not in the list anymore
 
offending value?
 
[Captain Obvious] FOr some reason the "3GO GT10K3IPS" was attached to the Android Emulator "Device model" string
 
and that is offending?
 
[Captain Obvious] It is when I'm trying to make sure my code to link the model string to a "marketing name"
[Captain Obvious] And then it returns that name for the emulator and I'm all "WTF"
 
1:20 PM
An hour since User started to read their ToString() output, must have exploded or something
 
[Captain Obvious] On a related note
[Captain Obvious] I don't know why both Android and iOS make it so difficult to present a user friendly name for the device the user is using
[Captain Obvious] Especially Apple, because you can't just map the identifiers to a marketing name, because APPLE LOCALISE (parts of) THE MARKETING NAME
 
mr5
@Wietlol what spells did you use to convince them?
 
persistence
 
mr5
do you still remember the exact phrase?
you: "hey people, stop using excel mkay"?
them: "okay?"
 
while (true) {
    Console.WriteLine("stop using excel");
}
 
mr5
1:32 PM
I want to convince the team as well to switch to something more standard, but since I suck at communicating, I just let go of them if my one time persuasion did not convince them.
 
what more standard?
 
mr5
eh, it's different thing
I want to convince the team to use in-app browser instead of the in-house in-app browser they made.
 
1:45 PM
Excel seems more standard.
More seriously now: You can probably deploy an issue tracking system by yourself. Bugzilla or something. Or even get a Trello account and use it for free. Then after a while show it to the team. The idea is to have some real data in there. You can show how many bugs were added, how many were resolved, etc. Some light statistics.
The point is to show why such a system is valuable.
Try to track stuff that's hard to track on a spreadsheet.
 
who would use a spreadsheet for that?
so... when you have a model mapping function, how do you easily return multiple exceptions (probably as an aggregate exception)
 
[Captain Obvious] Maybe return a System.AggregateException
[Captain Obvious] šŸ˜
 
public class User
{
    public string Name { get; }
    public string EmailAddress { get; }
    public DateTime BirthDate { get; }

    public User(string name, string emailAddress, DateTime birthDate)
    {
        Name = name;
        EmailAddress = emailAddress;
        BirthDate = birthDate;
    }
}

public class Model
{
    public IDictionary<string, string> Fields { get; }

    public Model(IDictionary<string, string> fields)
    {
        Fields = fields;
    }

    public User ToUser()
    {
something like this
ToUser will only throw one exception based on which field is the first one that would be missing
how would you neatly gather all the missing fields in an aggregate exception?
 
2:05 PM
Guest Post on May 30, 2022
Ethics isnā€™t just how we build AI systems, it’s about what we let them be used for.
 
[Squirrel in Training] I hate hekcing VS 2022 SO MUCh
[Squirrel in Training] why did they NEED TO CHANGE EVERY CORE DIALOG
[Squirrel in Training] So cant navigater w/o thinking anymore <y,<
[Captain Obvious] Create AggEx at the start, add exceptions for every error, then throw at the end
[Captain Obvious] Works for me, I didn't notice any major changes
[Captain Obvious] Maybe because most of my interactions either haven't changed or were in R# anyway
[Squirrel in Training] Or maybe cuz your simple and use mosue
 
@CaptainObvious but what would the code look like?
 
[Captain Obvious] I don't use mouse tho
[Captain Obvious] one sce
 
one second later...
 
var exceptions = new List<Exception>();

//rinse and repeat this block
try{
	// do somethign risky
}catch(Exception e){
	exceptions.Add(e);
}

throw new AggregateException(exceptions);
Something like that
 
2:16 PM
ew
repeat try catch blocks
 
[Captain Obvious] I said something like this
 
i am looking for something that doesnt require a lot of copying and pasting
 
[Captain Obvious] Bsaically as longa s you can get some collection of Exceptions, you can jam them into to ctor of AggregateException
 
so basically, you'd want a scope where exceptions are collected rather than thrown...
that might be an idea
 
2:32 PM
public User ToUser() =>
    ExceptionScopeThingy.Run(e => new User(
        e.Try(() => Fields["name"]),
        e.Try(() => Fields["email"]),
        e.Try(() => DateTime.Parse(Fields["birthDate"]))
    )).GetOrThrow();
hmm... I guess I like
 
3:13 PM
[Squirrel in Training] so much yuk
[Squirrel in Training] so many strinkz
 
ok, you make it better
 
 
3 hours later…
6:16 PM
[Hector] man what a weird day
[Hector] turns out my new task is about transferring some stored procedures' logic to c#
[Hector] they figured out it was dumb, and they have it all documented
[Hector] with an actual graph showing how maintenance increases exponentially
 
 
3 hours later…
9:08 PM
 
 
1 hour later…
mr5
10:17 PM
@Wietlol how about serialize the model using STJ, analyze model via reflection if it has empty values and throw
 

« first day (4244 days earlier)      last day (687 days later) »