![]() |
#121 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
I have one question: why the loading time of C apps (without modifying registry.xml) much longer than Lua?
I found one weird problem. My C apps, if not integrated into registry.xml, will take much long loading time (may over one minute), and LED will keep flashing if not manually stopped. Lua script, even without modifying registry.xml, it only takes about ten seconds to load, and LED won't flash. Why the difference? Any ideas? |
![]() |
![]() |
![]() |
#122 | |
JSR FFD2
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Quote:
![]() Seriously, it must be something in the way your app is coded. I did a small C gtk app once, it started in 7-8 seconds. Some ideas and guesses:
PS: xx has an option to delay the display refreshing: when you do 'myapp | xx -p -s6 ' , the refreshings starts after 6 seconds, possibly avoiding some needless refreshes while myapp is starting... Last edited by hansel; 11-17-2009 at 03:00 AM. Reason: typos |
|
![]() |
![]() |
Advert | |
|
![]() |
#123 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
Thanx for the detailed instructions.
1. As to the flashing LED, I can imagine that xx suppresses LED. I also remember that xepdmgr has the similiar code. Maybe my memory serves me wrong. 2. I will try to disable cursor blinking later. To make the problem more clear, I have an example. When I port FBReader to iLiad, if I modify registry.xml to integrate FBReader, FBReader can be launched in about 30 seconds. If registry.xml not modified, it takes about two minutes or longer for FBReader to launch. Last edited by ericshliao; 11-17-2009 at 04:23 AM. |
![]() |
![]() |
![]() |
#124 |
JSR FFD2
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Some (educated
![]() EDIT 18 nov: this is probably not correct? PS: This gives me a cool idea: if I add the Lua interpreter to contentlister (I've been planning this for a long time), and 'preload' lgob (including the gtk libs, which is already available in contenlister), then it should be possible to start Lua apps and tools very quickly... A Lua enabled contentlister would also be much easier to modify / extend... Last edited by hansel; 11-18-2009 at 04:23 AM. |
![]() |
![]() |
![]() |
#125 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Quote:
First I'm going to release a simple file manager (Fedora 12 has been announced today so it won't be as soon as I thought ![]() I have lot of ideas but as I would use some of the features I'm testing in this file manager I prefer waiting for your comments. Btw, a Lua question: I have some options in the file "program.ini" (f.e. "OPTION1 = true\nOPTION2 = false ..."). Is there a simple way to read this file using "loadfile" or similar and get a table with those options without parsing the file line by line => opts = { OPTIONS1 = true, OPTIONS2 = false, ... }, opts been a table defined in _G from the calling code? Iņigo |
|
![]() |
![]() |
Advert | |
|
![]() |
#126 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() Posts: 976
Karma: 687
Join Date: Nov 2007
Device: Dell X51v; iLiad v2
|
Quote:
|
|
![]() |
![]() |
![]() |
#127 | |
JSR FFD2
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Quote:
![]() Personally I prefer to store settings in xml file (that's what always do at work). If you choose to store values in attributs (not in tags) (like <Opts option1='true' option2='false'/>), then converting Lua (nested) hashes to and from xml is quite simple... Last edited by hansel; 11-18-2009 at 04:47 AM. |
|
![]() |
![]() |
![]() |
#128 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
|
Excuse me for the silence, too much work these days...
Quote:
For the record, here you have the code I'm finally using: Code:
local buf = "OPT1 = 1,OPT2 = 2" local txt = "{\n" for k, v in buf:gfind("([^%s]+)%s*=%s*([^\n]+)") do txt = txt .. k .. " = " .. v .. ",\n" end txt = txt:sub(1, -3) .. "\n}" print(txt) print("***************************************************************************") r = assert(loadstring("return " .. txt)) pr(r()) |
|
![]() |
![]() |
![]() |
#129 | |
JSR FFD2
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 305
Karma: 1045
Join Date: Aug 2008
Location: Rotterdam, Netherlands, Europe, Sol 3
Device: iliad
|
Quote:
There are JSON implementations for Lua, like http://json.luaforge.net/ (I did not try it) |
|
![]() |
![]() |
![]() |
Tags |
gtk+, iliad, lgob, lua, networking, xml |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pandigital announce the black Novel | Nate the great | News | 0 | 08-18-2010 05:21 PM |
iLiad China iLiad users can get developer package. | ericshliao | iRex Developer's Corner | 35 | 03-20-2010 05:21 AM |
iLiad Announce: Glade4Lua, develop graphical apps for the Iliad | hansel | iRex Developer's Corner | 1 | 10-27-2009 05:00 PM |
Sony to announce colour e-book ? | markiehill | News | 11 | 08-22-2009 12:45 PM |
Proud to announce our new moderator! | Alexander Turcic | Announcements | 5 | 12-08-2003 11:18 PM |