Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 06-10-2019, 03:05 PM   #1036
jhh
Member
jhh began at the beginning.
 
Posts: 15
Karma: 10
Join Date: May 2019
Device: KT4
Ok, @NiLuJe and @ilovejedd, thanks a lot for your work so far!
jhh is offline   Reply With Quote
Old 06-10-2019, 03:48 PM   #1037
Frenzie
Guru
Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.
 
Posts: 814
Karma: 135782
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by NiLuJe View Post
Can you try this random shot in the dark patch (based on the fact that the KT4 output looks eerily similar to the one from Kobo's Mk. 7 devices):
That can't work. For a quick test, it should be something like this. (See here why not.)

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.
Frenzie is online now   Reply With Quote
Advert
Old 06-10-2019, 06:01 PM   #1038
jhh
Member
jhh began at the beginning.
 
Posts: 15
Karma: 10
Join Date: May 2019
Device: KT4
Quote:
Originally Posted by Frenzie View Post
That can't work. For a quick test, it should be something like this. (See here why not.)

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
I've modified \koreader\frontend\device\kindle\device.lua according to this patch and now it works perfectly!


(I don't have account at github so I won't comment there.)

Last edited by jhh; 06-10-2019 at 06:03 PM.
jhh is offline   Reply With Quote
Old 06-10-2019, 06:16 PM   #1039
Frenzie
Guru
Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.
 
Posts: 814
Karma: 135782
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Great! As soon as #5071 is merged it'll show up in the following nightly. Until then (in one or two days) it'd be best not to update.
Frenzie is online now   Reply With Quote
Old 06-11-2019, 09:44 AM   #1040
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,383
Karma: 15000336
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, (PW) & PW2; Kobo H2O & Forma
Duh. Stupidly simple indeed! Thanks, Frenzie!
NiLuJe is offline   Reply With Quote
Advert
Old 06-11-2019, 11:05 AM   #1041
shamanNS
Evangelist
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 488
Karma: 1245268
Join Date: Feb 2010
Location: Serbia
Device: Kindle PW3[300dpi] , Kindle PW1
Quote:
Originally Posted by Frenzie View Post
Not only is it not a syntax error, but removing trailing commas is bad practice.

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,
}
If it was not obvious I was referring to that single comma marked in red color.
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.
shamanNS is offline   Reply With Quote
Old 06-11-2019, 11:17 AM   #1042
pazos
cosiñeiro
pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.pazos knows what's going on.
 
Posts: 238
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;
is valid but a bad practice because in the moment of extending one of the statements it will become non-valid.

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;}
We can argue that braces are not needed in this particular example, like the comma in your sample case.
pazos is offline   Reply With Quote
Old 06-11-2019, 11:46 AM   #1043
shamanNS
Evangelist
shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.shamanNS ought to be getting tired of karma fortunes by now.
 
Posts: 488
Karma: 1245268
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
shamanNS is offline   Reply With Quote
Old 06-11-2019, 12:03 PM   #1044
Frenzie
Guru
Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.Frenzie has rectified all his or her action issues with transformational deconfliction.
 
Posts: 814
Karma: 135782
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Quote:
Originally Posted by shamanNS View Post
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?
It's not a syntax error in Java (although it used to be at some point in now ancient implementations), JavaScript (unless you still need <=IE8), C#, Python, Ruby, Perl, PHP, etc. And of course it's not a syntax error in Lua either.

If I'm not mistaken, C89 and C++11 allow for it too. Why older C++ wouldn't… I have no idea.

Quote:
Originally Posted by pazos View Post
We can argue that braces are not needed in this particular example, like the comma in your sample case.
Yup, I'm always annoyed when I come across if statements without curly braces. Not because they are necessary as written because obviously they're not right there and then, but because I have to go about adding braces first instead of just quickly adding whatever I want to add.

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:
Originally Posted by shamanNS View Post
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
I think it's fine (for readability, anyway) if it's indented properly. To take the code from above:

Code:
if(something)
  return true;
else
  return false;
However, the problem now becomes that the indentation is misleading.

Code:
if(something)
  bla;
  // this is always executed
  blabla;
In that sense the way Python works is nice, although mostly it annoys me. I really like being able to do something like:

Code:
if (something) {
  indented();
quick_debug();
  indented_orig();
}
I think that makes it easier to work with.

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.
Frenzie is online now   Reply With Quote
Old 08-04-2019, 02:39 AM   #1045
aaronwi
Junior Member
aaronwi began at the beginning.
 
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.
aaronwi is offline   Reply With Quote
Old 08-04-2019, 03:54 AM   #1046
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 9,383
Karma: 15000336
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
NiLuJe is offline   Reply With Quote
Reply

Tags
application, k5 tools, kindle, launcher add-ons, lua, reader, touch

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PocketBook-KOReader: a document reader for PDF, DJVU, EPUB, FB2, CBZ, ... (AGPLv3) chrox KOReader 194 11-11-2019 06:26 PM
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


All times are GMT -4. The time now is 08:32 AM.


MobileRead.com is a privately owned, operated and funded community.