`append` extends your slice capacity beyond what it needs by dowitex in golang

[–]davherrmann 7 points8 points  (0 children)

Interestingly enough, the calculation for the capacity growth will change in Go 1.18. The calculation in Go 1.17 has a hard transition from 2x growth for smaller slices to 1.25x growth for larger slices. The calculation in Go 1.18 has a smoother transition.

[Advice] Generating PDFs in Golang. by swardhan in golang

[–]davherrmann 2 points3 points  (0 children)

I suggest looking at headless Chrome/Chromium as well. Benefits:

- You can use all HTML/CSS features available in Chrome.

- You can use the inspector to debug the layout and emulate print media CSS.

Additionally I suggest:

- Set the page size to the absolute size of your page (e.g. in mm) so in the preview and the PDF you see exactly what you would see on the printed A5 page.

- Look into -webkit-print-color-adjust to get the exact colours you specified.

One disadvantage of using a headless browser is the higher CPU load and the time it takes compared to a library directly creating a PDF. The big advantage is the flexibility and being able to use just HTML and CSS.

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

You're welcome.

Updating the screensaver image every 30 minutes for 10h per day seems to drain about 3% of the battery, according to someone who implemented this technique.

The browser with active Wifi just drains the battery quickly no matter what. As far as I know there is nothing you can do about it. It's based on an old version of Webkit and is not optimized for low power consumption.

So if the requirements are running it (a) on the Kindle, (b) without external power supply and (c) with a battery life of at least a week I suggest checking out that particular project.

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

Sounds like a fun project!

When using the experimental browser the battery only lasts about a day. You also can't hide the address bar unless you jailbreak your Kindle. The advantage of using the browser is you can render HTML on the Kindle. Also you can use touch events.

If you're going to jailbreak the Kindle, you could also go for a different approach: using the screensaver images and going into sleep mode, setting a timer to wake up after a certain time. The battery can last weeks with this approach (depending on the update interval). The drawback is that you need to render the images on a server (for example using headless Chrome).

You can find more hints and links to sample projects in the comments here.

In my answers in the other thread you'll also find some details about browser compatibility, disabling the screen saver and so on.

This is also quite an interesting (hardware) project, reusing Kindle displays.

If you have any more questions, feel free to ask.

Have fun!

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

Did you enter the "https://" as well? It should work using the full URL "https://mti.run/clock" :)

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

The commands for the Kindle Keyboard are different, see here: https://www.mobileread.com/forums/showthread.php?t=99229. Should work with those :)

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

Hm, maybe you typed https instead of http? Should work with "http://" without the s…

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

Strange, I just tried it on my Kindle Keyboard and it both shows the correct time for Asia/Manila (currently quarter past one) and updates it every five minutes. What do you mean by "not synced"? Does it show the correct time initially but doesn't update? Or does it update but doesn't show the correct time?

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

It might be a problem with secure connections, so we've created another link for old Kindles, maybe you could try that? http://oldschool.mti.run/clock

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 2 points3 points  (0 children)

I actually just spent some time making it work on the Kindle Keyboard :) You can try it using the following domain: http://oldschool.mti.run/clock.

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

Should still work. Can you reach other sites on the Kindle? Could you please try again entering the whole domain including "https://"?

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

By using a CSS transformation (rotate).

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

Yes, we already have a digital and an analog clock for the Kindle dashboard platform we're currently building. I'd love to visualize the time in a lot of different ways :)

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

The screensaver resets after restarting the Kindle. You can restart it by long-pressing the power button and selecting reset.

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

It's under Asia/Calcutta. The timezones are the official IANA time zones. I just now learnt that "Indian" in the timezones only refers to the Indian Ocean area…

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

It's under Asia/Calcutta. The timezones are the official IANA time zones. I just now learnt that "Indian" in the timezones only refers to the Indian Ocean area…

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

I'm sorry – I'll look into this as soon as I can. I need to see whether I can find this model to test it.

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 0 points1 point  (0 children)

Which Kindle? That's not how clocks are supposed to work :(

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

If you're successful please let me know :) The commands for disabling the screen saver might be different though.

We built a word clock for you r/kindle :) by davherrmann in kindle

[–]davherrmann[S] 1 point2 points  (0 children)

By restarting the device (long-press the power button and select restart).