Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 09-26-2011, 10:56 AM   #571
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Quote:
Originally Posted by BenChen View Post
Hi kartu,

I have had a look at this problem. I have been able to replicate the error, and I have discovered that for some totally unexplainable reason the AI fails to produce a valid move (even though a valid move is available). I have tried to track the bug in the AI routines down, but I am afraid it is beyond me: that's the problem with using someone else's code! The best I can do is modify the code to output a message like "AI failed. Sorry!"

I have only seen this problem in "slow" mode, so if it happens again and the "AI failed. Sorry!" message appears, the user can manually do a move for black. Then the user can undo (going back 2 steps). If the AI speed is changed to something other than "Slow" then when the user makes the same move that caused the problem in the first place the AI should work properly and the game can continue.

It's a work-around, but it's probably the best I can manage...

Sincerely,
Ben.
Actually, I worked out a way to (temporarily) drop the level of the AI. So if it encounters a situation where "slow" mode fails, it tries "medium" (which works in the case discovered by the person who reported the problem), and if that fails, then it tries "fast" mode. If it still fails, then it outputs an AI failure message.
BenChen is offline   Reply With Quote
Old 09-26-2011, 12:49 PM   #572
VICTORSJG
Addict
VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.
 
Posts: 318
Karma: 1846
Join Date: Dec 2009
Device: PRS-505
Quote:
Originally Posted by Mark Nord View Post
Victor,

I think there is no specific limit on variables, but at the real device there is a limit of somewhat < 100kB for a script. This seems to be true in the Sim too.
calandar.js is getting rather huge (92k) currently.

I would suggest to shorten the code by
  1. removing stale code ( code between /* */)
  2. deleting/shortening comments
  3. shorten var statements to var I=somthing, j, k=anotherting, ....;
  4. shorten var names
HTH
Mark
Mark i've compressed the file, now is 68 k, and i have the same problem. I send you the files compressed and normal.
Attached Files
File Type: rar files.rar (23.2 KB, 195 views)
VICTORSJG is offline   Reply With Quote
Old 09-26-2011, 01:52 PM   #573
kartu
PRS+ author
kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.kartu ought to be getting tired of karma fortunes by now.
 
Posts: 1,637
Karma: 2446233
Join Date: Dec 2007
Device: Sony PRS-300, 505, 600, 650, 950
Quote:
Originally Posted by BenChen View Post
Actually, I worked out a way to (temporarily) drop the level of the AI. So if it encounters a situation where "slow" mode fails, it tries "medium" (which works in the case discovered by the person who reported the problem), and if that fails, then it tries "fast" mode. If it still fails, then it outputs an AI failure message.
kartu is offline   Reply With Quote
Old 09-26-2011, 03:07 PM   #574
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by VICTORSJG View Post
Mark i've compressed the file, now is 68 k, and i have the same problem. I send you the files compressed and normal.
Victor, I can duplicate this problem. There seems to be a limit on variables! But I havn't counted yet.

But number of var's could be easily reduced:
e.g. replace the first lines of language related var's like this:
Code:
	var wordMonth = new Array(L("MONTH_ANUARY"),L("MONTH_FEBRUARY"),L("MONTH_MARCH"),L("MONTH_APRIL"),L("MONTH_MAY"),L("MONTH_JUNE"),L("MONTH_JULY"),L("MONTH_AUGUST"),L("MONTH_SEPTEMBER"),L("MONTH_OCTOBER"),L("MONTH_NOVEMBER"),L("MONTH_DECEMBER"));
	var wordDays = new Array(L("ABBRV_SUNDAY"),L("ABBRV_MONDAY"),L("ABBRV_TUESDAY"),L("ABBRV_WEDNESDAY"),L("ABBRV_THURSDAY"),L("ABBRV_FRIDAY"),L("ABBRV_SATURDAY"));
	var cardinals = new Array(L("CARDINAL_ONE"), L("CARDINAL_TWO"), L("CARDINAL_THREE"), L("CARDINAL_FOUR"), L("CARDINAL_FIVE"));
Regards
Mark
Mark Nord is offline   Reply With Quote
Old 09-26-2011, 10:35 PM   #575
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,896
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by BenChen View Post
Chess puzzles have been fixed. There are now only three files. Changes pushed to apps and default repositories.
I'm curious, how many puzzles are there?
DoctorOhh is online now   Reply With Quote
Old 09-27-2011, 01:44 AM   #576
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by dwanthny View Post
I'm curious, how many puzzles are there?
mate in two:90
mate in three: 180
mat in four: 45

all are taken from:http://www.wtharvey.com
Mark Nord is offline   Reply With Quote
Old 09-27-2011, 10:47 AM   #577
VICTORSJG
Addict
VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.
 
Posts: 318
Karma: 1846
Join Date: Dec 2009
Device: PRS-505
Quote:
Originally Posted by Mark Nord View Post
Victor, I can duplicate this problem. There seems to be a limit on variables! But I havn't counted yet.

But number of var's could be easily reduced:
e.g. replace the first lines of language related var's like this:
Code:
	var wordMonth = new Array(L("MONTH_ANUARY"),L("MONTH_FEBRUARY"),L("MONTH_MARCH"),L("MONTH_APRIL"),L("MONTH_MAY"),L("MONTH_JUNE"),L("MONTH_JULY"),L("MONTH_AUGUST"),L("MONTH_SEPTEMBER"),L("MONTH_OCTOBER"),L("MONTH_NOVEMBER"),L("MONTH_DECEMBER"));
	var wordDays = new Array(L("ABBRV_SUNDAY"),L("ABBRV_MONDAY"),L("ABBRV_TUESDAY"),L("ABBRV_WEDNESDAY"),L("ABBRV_THURSDAY"),L("ABBRV_FRIDAY"),L("ABBRV_SATURDAY"));
	var cardinals = new Array(L("CARDINAL_ONE"), L("CARDINAL_TWO"), L("CARDINAL_THREE"), L("CARDINAL_FOUR"), L("CARDINAL_FIVE"));
Regards
Mark

Mark with your advice the script works well.

thanks

Last edited by VICTORSJG; 09-27-2011 at 11:01 AM.
VICTORSJG is offline   Reply With Quote
Old 09-28-2011, 09:52 AM   #578
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Hi Mark,

Did you start looking at extending the keyboards in the Calendar app at all? If not, I might have some time to do it.

I was thinking I could extend the number of keys, and then use a dummy character in the keyboard file that would make a key invisible if it was not needed. So this will mean changing the keyboard file format slightly. Then, I will add a new setting so the user can select which keyboard they want to use. This will involve adding some more strings to lang.ods. I also hope I don't run into the variable limit! Then I will need to make some different keyboards.

The other alternative, is simply move the keyboard file to where the settings are saved, and people can customise their own keyboards, like what Victor has done. Much quicker for me!

Do you have any thoughts on the matter?

Sincerely,
Ben.
BenChen is offline   Reply With Quote
Old 09-29-2011, 01:47 AM   #579
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Ben,

there is no progress from my side. Go for it.

Regards
Mark
Mark Nord is offline   Reply With Quote
Old 09-30-2011, 04:26 AM   #580
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Quote:
Originally Posted by Mark Nord View Post
Ben,

there is no progress from my side. Go for it.

Regards
Mark
Hi Mark,

I have been adding multiple keyboard support to the Calendar app, but I have run into a major problem. After adding some code, I think it has become too big to run. I can't get it to work any more in the Sim, and when I tried it on my 600, it gives me the same result.

Now, I am pretty sure there is no serious error in the code. I have looked very hard and not found it. I have opened calendar.js in NetBeans and NetBeans found no formatting errors. And, most tellingly, if I remove one of the big functions required to handle the non-touch readers, either target.EVENTS_DIALOG.moveCursor or target.ntHandleEventsDlg, the code works. But leave them both in, and the code fails.

I am forced to conclude that the Calendar app, as it currently is, is at a dead end.

So, what I am proposing is that the Calendar app is forked: there will be a version for non-touch (basically, version currently in the default repository), and a touch version (with multiple keyboard functionality).

I will push the new version (unmodified, not working in the Sim) to the app repository, so you can take a look at the code, if you want to. But, unless you come up with something brilliant, I think I will have to go with Calendar_nt and Calendar, and modify the build script accordingly.

Sincerely,
Ben.
BenChen is offline   Reply With Quote
Old 09-30-2011, 11:40 AM   #581
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Hi everyone,

Well, for better or worse I have now split the Calendar app into two different versions: touch and non-touch.

The touch version now has the ability to switch between different keyboards on the event pop-up itself. Included: the Western keyboard (now with a "numpad" making use of the expanded keyboard), a Russian keyboard and a Georgian keyboard. You can also have a custom keyboard. Just place a file entitled "custom.kbd" in the Calendar settings folder (where the events file is stored). Make sure the keyboard file is based on one of the other keyboards, and possibly with a little experimentation, you should be able to create a suitable keyboard if the standard ones are not to your liking.

The non-touch version also has a custom keyboard option. The app will create the file (custom_nt.kbd) for you the first time it goes looking for it and doesn't find it. It will be in the Calendar settings folder. Edit this file, and customise your keyboard.

I will be trying the touch version on my 600 soon. But I have no way to check the non-touch version. I am assuming it is OK (since it works in the Sim!) so my next task is to modify the build file and push the changes to the default repository.

Sincerely,
Ben.
Attached Thumbnails
Click image for larger version

Name:	2011-09-30_193715.jpg
Views:	245
Size:	106.3 KB
ID:	77180  
BenChen is offline   Reply With Quote
Old 09-30-2011, 01:50 PM   #582
VICTORSJG
Addict
VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.VICTORSJG once ate a cherry pie in a record 7 seconds.
 
Posts: 318
Karma: 1846
Join Date: Dec 2009
Device: PRS-505
In this cases, the non-touch devices have only one keyboard at the same time, and to change the keyboards will be necessary to conect the reader to pc and edit the file custom_nt.kbd. This metod is the same to edit the name.kbd, that was made actully.

Last edited by VICTORSJG; 09-30-2011 at 01:59 PM.
VICTORSJG is offline   Reply With Quote
Old 09-30-2011, 02:46 PM   #583
BenChen
EPUB Metadata ******
BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.BenChen is not intimidated by interfenestral monkeys.
 
Posts: 525
Karma: 26874
Join Date: Dec 2010
Device: Kobo Glo HD
Quote:
Originally Posted by VICTORSJG View Post
In this cases, the non-touch devices have only one keyboard at the same time, and to change the keyboards will be necessary to conect the reader to pc and edit the file custom_nt.kbd. This metod is the same to edit the name.kbd, that was made actully.
Hi Victor,

Yes, unfortunately, non-touch devices can only have one keyboard. I ran out of memory, or something. The program just got too big. (It is because so much computer code is needed to replace the absence of a touch screen!)

The difference with the custom_nt.kbd is that now the file is stored in a place users can access when their readers are attached to a PC. Before, you would have to do a custom-build.

Sincerely,
Ben.
BenChen is offline   Reply With Quote
Old 09-30-2011, 02:57 PM   #584
Mark Nord
2B || !2B
Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.Mark Nord ought to be getting tired of karma fortunes by now.
 
Posts: 854
Karma: 327896
Join Date: Feb 2010
Location: Austria
Device: Sony PRS505/650/T1/tolino vision 5
Quote:
Originally Posted by BenChen View Post
Hi Mark,
... But, unless you come up with something brilliant, I think I will have to go with Calendar_nt and Calendar, and modify the build script accordingly.
Hello Ben,

Will have a look,
ATM there are two ideas:
1) generalize NT-handling by putting the objects (or references) into an array along with info about how to handle them (e.g.mouseEnter, a.s.o) this should shorten the needed code a lot,
2) by using behavior ...
<script on="mouseDown"
and saving a timestamp, it should be possible to get something like "tap-and-hold" (and using hold-center for nt) to bring up a additional popup for special-characters (see standard behaviour of 600/x50 and hold-digit used in the dictionary-app for 300/505)

Not to be done tomorrow but will try.
Regards
Mark

PS: While forking the code why not use quisvirs approch of kbook.model.openLineInput for the newer touch-models? This should bring up the correct system keyboard.

Last edited by Mark Nord; 09-30-2011 at 03:07 PM. Reason: typo
Mark Nord is offline   Reply With Quote
Old 10-01-2011, 12:26 AM   #585
Lenikus
Junior Member
Lenikus began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Oct 2011
Device: PRS-300
Non Keyboard Dictionary

Hello:

I'm the owner of a PRS 300 (and I live in Argentina, please sorry my english). I recently install PRS+ on it, after using the Ebook Applications alternative firmware for a while.

The Ebook Application firmware installs a very simple dictionary that allow the user to highlight the desired word, and searching it in the dictionary pressing the enter key. It starts inside the book you are reading, and can be use standalone also.

It's a very useful dictionary so I need to know if there is a way to implement it on the PRS+. It's appears to be an exe file related to the ebrmain platform.

Thanks a lot.
Lenikus is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fsk error, code = -13 Brian Charles Sony Reader 4 04-23-2010 04:21 PM
Fsk error code= -43 shrktank Sony Reader 1 12-24-2009 09:32 AM
Just a silly tweak: AUTORUN.INF for Windows Rootman Kindle Developer's Corner 3 12-04-2009 10:17 AM
Request for test in Windows XP kovidgoyal Calibre 5 08-26-2009 01:14 PM
Windows Develpment Environment issue itimpi Calibre 20 01-17-2009 07:15 PM


All times are GMT -4. The time now is 02:30 PM.


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