|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1036 |
Member
![]() Posts: 15
Karma: 10
Join Date: May 2019
Device: KT4
|
Ok, @NiLuJe and @ilovejedd, thanks a lot for your work so far!
|
![]() |
![]() |
![]() |
#1037 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 827
Karma: 135782
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 03:51 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#1038 | |
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 06:03 PM. |
|
![]() |
![]() |
![]() |
#1040 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,473
Karma: 15260606
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
|
Duh. Stupidly simple indeed! Thanks, Frenzie!
|
![]() |
![]() |
Advert | |
|
![]() |
#1041 | |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 492
Karma: 1245300
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW3[300dpi] , 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 11:08 AM. |
|
![]() |
![]() |
![]() |
#1042 |
cosiñeiro
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 257
Karma: 25889
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;} |
![]() |
![]() |
![]() |
#1043 |
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 492
Karma: 1245300
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW3[300dpi] , 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 ![]() ![]() |
![]() |
![]() |
![]() |
#1044 | |||
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 827
Karma: 135782
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 12:17 PM. |
|||
![]() |
![]() |
![]() |
#1045 |
Junior Member
![]() Posts: 8
Karma: 10
Join Date: Aug 2019
Device: PW2
|
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.
|
![]() |
![]() |
![]() |
#1046 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,473
Karma: 15260606
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
|
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
|
![]() |
![]() |
![]() |
Tags |
application, k5 tools, kindle, launcher add-ons, lua, reader, touch |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PocketBook-KOReader: a document reader for PDF, DJVU, EPUB, FB2, CBZ, ... (AGPLv3) | chrox | KOReader | 195 | 11-28-2019 10:37 AM |
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) | hawhill | Kindle Developer's Corner | 1138 | 07-27-2019 10:52 AM |
KPV: a PDF reader for Kindle, based on muPDF, GPLv3 | hawhill | Kindle Developer's Corner | 1056 | 11-11-2017 04:07 AM |
Hacked Up Reader for epub/fb2/txt/rtf/html/pdb/etc | bhaak | Kindle Developer's Corner | 296 | 10-01-2016 02:11 PM |
A real PDF to epub/djvu/rtf/html software?. | DsOft | ePub | 35 | 01-02-2011 04:57 PM |