« first day (4428 days earlier)      last day (503 days later) » 

8:04 AM
Good moaning
 
 
2 hours later…
9:35 AM
Good morning
 
 
1 hour later…
10:43 AM
Good mourning
 
10:54 AM
hi
 
!~cat
 
 
1 hour later…
12:24 PM
[Captain Obvious] yo yo yo
 
ya ya ya
 
ye ye ye
 
 
1 hour later…
1:51 PM
[Hector] good afternoon
[Hector] i waste more time fixing broken builds than typing new code lol
 
Well maybe you shouldn't break the build with every small code change then :P
 
+1 for not breaking the build. Just make it always work. Then you won't need to keep fixing it.
EZ
/s
 
[Captain Obvious] Or maybe
[Hector] I've tracked commits back to master
 
2:08 PM
Ryan Donovan on November 30, 2022
Dynamic application security testing (DAST) can help catch security flaws in your code. And it can do it automatically in your build process.
 
[Hector] there's one that says "update a whole ton of package references" where some idiot updated ALL the references for ALL the projects in 37 solutions
[Hector] now i have several duplicate references
[Captain Obvious] always fun when that happens
 
2:28 PM
[Hector] 4 architects were instructed to come help me, I also invited those who are the in the same boat as me, and boy, the room is on fire xD
 
@Botler So, this is fine?
 
[Hector] nah they are quite alarmed xd
 
2:44 PM
So I added a curl http:localhost/health to my post build events to spin up the API on each build, but somehow it both returns the expected data but also exits with -1 so VS says build failed - any idea what's wrong here?
 
curl might just always return -1
 
[Hector] are you requesting data from your own endpoint?
[Hector] i mean did you write the API
[Hector] i would say that -1 is coded in your response
[Captain Obvious] Now I'm doing my favourite
[Captain Obvious] Drawing receipts in GDI
 
weee
I would just generate html, then use an html-to-pdf converter
 
[Captain Obvious] That's way too expensive
 
is it though?
 
2:50 PM
[Hector] WPF or Core?
[Captain Obvious] Well the printing is done through System.Drawing.Printing.PrintDocument so
 
@Botler I am indeed returning data, basically a js file but in plaintext, and the output is shown in the build log too.
 
[Hector] Core is particularly nasty for GDI
[Hector] its missing a lot of stuff
 
> Last updated 5/6/2015
website down
 
@CaptainObvious Why not QuestPDF?
 
2:52 PM
[Captain Obvious] I don't want pdfs though lmao
[Hector] When I made my OCR I went for WPF because Framework had access to functionality that UWP didn't have
 
[Captain Obvious] I need shit out of a thermal printer at speed
 
then use Java :P
 
Java is deprecated
4
 
Isn't PDF best for printing though?
 
2:53 PM
every language is deprecated
 
[Captain Obvious] not necessarilyt
 
do you at least use an email or actual printer or a weird receipt printing machine?
 
[Captain Obvious] I don't have an actual printer to test with me, but the receipts will be printed directly to an actual thermal printer
 
ew
 
[Captain Obvious] I'll be testing shit tomorrow
[Captain Obvious] With this ugly af UI
[Hector] I did ticketing shit back in the day
[Hector] those UIs are aged, all of them
[Hector] most systems were designed a long-ass time ago and people refuse to invest money on facelifting them
[Hector] they already work, and tickets needn't look fancy so why would they
[Captain Obvious] The current ones that I did about 5 years ago look not bad actually
[Captain Obvious] UNfortunately the code that spits it out is trash and I can't be bothered mkaking it look nice yet
 
3:10 PM
posted on November 30, 2022 by ericlippert

It’s been almost two years since my last update here. A lot has happened. I hope you all are continuing to weather the ongoing multiple global pandemics and other anthropogenic crises. Apologies that this is so long; I didn’t have … Continue reading →

 
@Feeds \o/ Eric Lippert
 
3:27 PM
[Captain Obvious] oh yeah you know this is the best receipt youve ever seen
 
The total is wrong.
(just joking. Made you look, right?)
 
It is totally wrong ;)
 
[Captain Obvious] WHY CANT IT WORK OUT HOW WIDE THE PAGE IS
[Captain Obvious] I think it's down to shitty margins but I won't really know until it's on a real printer
 
dont you specify how wide the page is?
 
[Captain Obvious] I mean the printer is probably 70mm wide
[Captain Obvious] But I'm trying to keep it flexible
 
3:38 PM
also, generating html, then converting it to pdf with Java takes approximately 20ms ... I assumed it would take longer than that...
 
[Captain Obvious] like I'm trying to use the width of the page to calculate how many characters wide fit
[Captain Obvious] width in the "printer" settings is 70mm, which agrees with the output
 
for the horizontal line?
 
[Captain Obvious] and other buts but yeah
[Captain Obvious] Like the prices should be right aligned
 
width: 100%; border-bottom: 1px solid black; :P
 
[Captain Obvious] Each character is about 2mm wide according to GDI, and the pagewidth is 70, they both check out
 
3:47 PM
char width + spacing?
 
[Captain Obvious] I fucked up the next line
 
so, 70 / ~2 = 24 in your mind?
 
[Captain Obvious] So it turns out you can't just use MeasureString to measure the width of a single character and it spit out the right value
[Captain Obvious] MeasureString("0") was spittint out a width of ~3mm
[Captain Obvious] But MeasuerString("0123456789")/10 spits out about 2mm
[Captain Obvious] wayy 33 chars per line sounds right
 
23 even
 
[Captain Obvious] Close enough
 
3:50 PM
try (MeasureString("00000000000") - MeasureString("0")) / 10
 
[Captain Obvious] That's an interesting suggestion, why?
 
also, try MeasureString("0") == MeasureString("1")
 
[Captain Obvious] It's using a monospace font so the character shouldn't matter
 
how far does it measure?
to the second or third line?
although, that wouldnt explain the difference between "0" and "0123456789"
 
[Captain Obvious] Interesting
[Captain Obvious] 11-1 != 10
[Captain Obvious] by about 1m,
 
3:54 PM
ok, so "1".width == "0".width at least
then try "0".width and "00".width to compare
see what the difference is
1.96267 is probably the width you want to use per character
make sure to floor on your precision
so 1.9627 would be wrong
 
[Captain Obvious] Well I tried measuring 100 chars and dividing by 100
[Captain Obvious] Results in 1.97325...
[Captain Obvious] There must be some padding it's including
 
did you try measuring 101 - 1 chars and divide it by 100 ?
 
there is some spacing that it uses
you could get the spacing width by doing "00" - "0"*2
 
[Captain Obvious] Oh wait you can just tell it to use a StrignFormat which won't pad
[Captain Obvious] suddenly they all spit out 1.9053
[Captain Obvious] Whether I do 1 character or 100
 
4:00 PM
hmm
if it is consistent...
then yay
 
[Captain Obvious] I'm assuming the variance is down to float accuracy
[Captain Obvious] Wait I still divided it by 10
 
yea, floats arent accurate after 6-7 digits
 
[Captain Obvious] Weird that 10 is different to 1 and 100
 
meh, that is expected
 
[Captain Obvious] Fucking floats man
 
4:05 PM
1.90530979633331298828125 = 0x3FF3E131
1.90530991554260253906250 = 0x3FF3E132
so, ...3098 doesnt exist
 
[Captain Obvious] okay so it's still not perfect
[Captain Obvious] Because that above was only achieved by adjusting the end value down by 1 (it overran, even with a math.floor)
 
you should floor to 6 digits (5 decimals after the point)
 
[Captain Obvious] It's more noticable on A4
[Captain Obvious] Nah I have a plan
 
"It's more noticable on A4"
you have a 70mm A4?
you might be thinking out of the scope of the requirements here
I thought the requirements were just receipt printing
 
[Captain Obvious] It's just a easy way of checking that it worked on other widths
[Captain Obvious] But I have fixed it
[Captain Obvious] And it works on 70mm too
[Captain Obvious] The "Fix" being to simply multiply the character with by 1.026
[Captain Obvious] PRAISE MAGIC NUMBERS
 
4:16 PM
you better comment that magic number
comment on*
 
fair enough
 
[Captain Obvious] I can't believe I spent an hour and a half on producing a receipt like that
[Captain Obvious] An hour of which I spent faffing about trying to measure how wide characters are
 
imagine how many receipts you could have generated using pdf :)
 
[Captain Obvious] I mean it's all well and good generating a PDF
[Captain Obvious] I still need to print it
 
4:26 PM
print the pdf :O
 
[Captain Obvious] Which from my previous experience printing PDFs automatically
[Captain Obvious] The only reason I evne needed to know the character width is because I couldn't be bothered drawing lines pictures shapes etc
[Captain Obvious] So I just wanted to do the whole thing from a stringbuilder
 

« first day (4428 days earlier)      last day (503 days later) »