06-10-2019, 02:48 PM | #1036 | |
Wizard
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
Quote:
Code:
diff --git a/frontend/device/kindle/device.lua b/frontend/device/kindle/device.lua index 501d0735..2505f8dc 100644 --- a/frontend/device/kindle/device.lua +++ b/frontend/device/kindle/device.lua @@ -755,6 +755,7 @@ function KindleBasic3:init() Kindle.init(self) + self.input.snow_protocol = true self.input.open(self.touch_dev) self.input.open("fake_events") end Last edited by Frenzie; 06-10-2019 at 02:51 PM. |
|
06-10-2019, 05:01 PM | #1037 | |
Member
Posts: 15
Karma: 10
Join Date: May 2019
Device: KT4
|
Quote:
(I don't have account at github so I won't comment there.) Last edited by jhh; 06-10-2019 at 05:03 PM. |
|
Advert | |
|
06-11-2019, 08:44 AM | #1039 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Duh. Stupidly simple indeed! Thanks, Frenzie!
|
06-11-2019, 10:05 AM | #1040 | |
Guru
Posts: 885
Karma: 10113994
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5 [bricked], Kindle PW1
|
Quote:
Code:
return {
["cre_header_status_font_size"] = 40,
["copt_line_spacing"] = 110,
["disable_double_tap"] = true,
["copt_render_dpi"] = 300,
["start_with"] = "last",
["disable_kobolight"] = true,
["cre_header_status_font_size"] = 30,
["full_refresh_count"] = 12,
["larger_tap_area_to_follow_links"] = true,
["copt_b_page_margin"] = 10,
}
So, are you telling me that Lua (or whatever language's 'data structure' / collection/list/array type that code snippet represents) is different than almost any other language under the Sun (even CSS properties list! respect those same conventions) where any type of "enumerating stuff" shouldn't end with a comma as that results in syntax error or parsing error? Even when returning multiple things as separate objects you wouldn't end that statement with a comma. Last edited by shamanNS; 06-11-2019 at 10:08 AM. |
|
Advert | |
|
06-11-2019, 10:17 AM | #1041 |
cosiñeiro
Posts: 1,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
|
It is a bad practice because a) it isn't needed and b) can cause problems if someone adds a n+1 element to the returned table.
It is like in C, where Code:
if(something) return true; else return false; So unless you're sure that you always want a single return statement then the following is recommended Code:
if(something) {return true;} else {return false;} |
06-11-2019, 10:46 AM | #1042 |
Guru
Posts: 885
Karma: 10113994
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW5 [bricked], Kindle PW1
|
I personally hate people that are omitting curly braces for single statement if/else blocks just as much as I hate people that are omitting parentheses when assigning "arrow functions" that take only one argument to a variable or a constant (even though that particular case is mainly "just" offence in regards to code readability /glanceability. )
But this comma convention thing (in most language that is not optional...) is one of the rare things that are shared between most of the languages... or so I believed |
06-11-2019, 11:03 AM | #1043 | |||
Wizard
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
Quote:
If I'm not mistaken, C89 and C++11 allow for it too. Why older C++ wouldn't… I have no idea. Quote:
Besides avoiding some hopefully minor annoyance (although with curly braces you can get undetected wrong behavior), both curly braces and trailing commas have the diff issue, in that you get some useless noise in your diffs. Again not a big deal, but still a minor annoyance that's nicer to do without. So: 1. Fewer unintended errors, whether benign (syntax) or harmful (behavior). 2. Cleaner diffs. 3. Less effort. You could see this as a restatement of 1 and 2, but not exactly. I think I'm fairly safe these days from harmful errors introduced by 1 (through bad experience!), but I'm still annoyed at the minor effort of having to add braces or commas. You could also sort the list alphabetically using your editor if desired without running into 1, so I think it's worth making it a separate point. Therefore languages that don't allow for trailing commas slightly annoy me. CSS is a bit different though, depending on the specifics. I'm not generally annoyed by it. Quote:
Code:
if(something) return true; else return false; Code:
if(something) bla; // this is always executed blabla; Code:
if (something) { indented(); quick_debug(); indented_orig(); } tl;dr I prefer Lua over Python in many ways even though they seem superficially similar, and this is one of them. Last edited by Frenzie; 06-11-2019 at 11:17 AM. |
|||
08-04-2019, 01:39 AM | #1044 |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2019
Device: N/A
|
Is there a way to make koreader the default opener for files on the pw2? seems quite tedious to open kual then koreader, then file manager, and go through author folders to find the file.
|
08-04-2019, 02:54 AM | #1045 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
That'd be KPVBooklet, which is documented in the GitHub Wiki, and should behave mostly fine (spoiler alert: never used it myself) as long as you stay away from FW >= 5.8
|
02-09-2020, 08:50 AM | #1046 |
Connoisseur
Posts: 78
Karma: 10000
Join Date: Jul 2012
Location: Israel
Device: KA1, KLH2O, Oasis 3
|
On the latest version 2020.01, the menu items "Autosuspend timeout" and "Autoshutdown timeout" disappeared. Version for Kobo and for Kindle.
In the forum thread for Kobo, I have already talked about this problem. Everything worked out there, thanks PAZOC. But for the Kindle PW2 it doesn’t work. No plugins "Autosuspend timeout" end "Autoshutdown timeout" listed. |
02-09-2020, 08:55 AM | #1047 |
Wizard
Posts: 1,613
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
That's correct, it's only enabled on select devices:
https://github.com/koreader/koreader...main.lua#L3-L5 |
02-09-2020, 09:11 AM | #1048 |
Connoisseur
Posts: 78
Karma: 10000
Join Date: Jul 2012
Location: Israel
Device: KA1, KLH2O, Oasis 3
|
Too bad there is no for KPW2. I hope someday will be.
|
02-09-2020, 11:42 AM | #1049 |
BLAM!
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
PRs welcome .
(Kindles are known to have some wonky rtcs and/or a couple of 'em in some cases, which would make supporting more than one specific model potentially non-trivial). Plus, the fact that the stock system is still alive behind us would *probably* render this kind of thing inoperable anyway ^^. |
02-23-2020, 11:23 AM | #1050 |
Wizard
Posts: 1,058
Karma: 3581267
Join Date: Sep 2014
Location: Ukraine
Device: Kindle PW2, PW3, PW4, Voyage
|
Can I have popup footnotes in fb2?
"Links - Show footnotes in popup" doesn't affect. Also would like to recommend to add the following string to fb2.css Code:
body[name="notes"] section p { display: inline } |
Tags |
application, k5 tools, kindle, launcher add-ons, lua, reader, touch |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PocketBook-KOReader: a document reader for PDF, DJVU, EPUB, FB2, CBZ, ... (AGPLv3) | chrox | KOReader | 566 | Today 05:28 AM |
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) | hawhill | Kindle Developer's Corner | 1268 | 02-27-2024 11:49 AM |
KPV: a PDF reader for Kindle, based on muPDF, GPLv3 | hawhill | Kindle Developer's Corner | 1056 | 11-11-2017 03:07 AM |
Hacked Up Reader for epub/fb2/txt/rtf/html/pdb/etc | bhaak | Kindle Developer's Corner | 296 | 10-01-2016 01:11 PM |
A real PDF to epub/djvu/rtf/html software?. | DsOft | ePub | 35 | 01-02-2011 03:57 PM |