x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Simple Date/Time Clock for Jornada 720

1 2
joval Page Icon Posted 2019-05-31 6:28 AM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:
I was so impressed when I first saw my peers with the Jornada 720 back in 2002...but at 1000 bucks a bit too pricey for me then. Eventually I bought several used in 2007 for a small fraction of that price...but with the onslaught of larger hi-res screened android tablets for surfing the web, my jornadas fell by the wayside I done 'em wrong you might say. It's time I mended my ways.

It is only now that I can appreciate their power and versatility, and quality. So we're back together and I am interested in whatever tricks the little beasties can do. Roll over and play dead is not an option anymore...

As much as the IE browser has seemed totally obsolete for the web...I just recently realized its ability to render HTML 4 and even limited javascript makes it a fun and rewarding and easy (did I say easy) tool to enjoy.

Soooo...download the attached DateTime.htm file and open it in your Jornada IE4 web browser when you want a Date Time (24 hour mode) Clock that refreshes every 10 seconds. If you change it into a plain txt file by renaming it DateTime.txt then you can play with the various refresh rate, font colors, etc. Go on...Throw your pup a bone...and enjoy.



Attachments
----------------
Attachments DateTime.htm (0KB - 33 downloads)
 Top of the page
C:Amie Page Icon Posted 2019-05-31 9:01 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
Good job :)

I don't quite recall what the capabilities of the JS engine in PIE4 were, but you might be able to improve the resolution and reduce the CPU/battery load by using:

<DOCTYPE html> 
<html> 
<head>
</head>
<body bgcolor="pink">
<h1 style = "color:blue"> <font size="10" id="panel"></font></h1>
<script language="javascript">

function tick() {
var today = new Date();
var panel = document.getElementById("panel");
if (panel.firstChild != undefined) {
panel.removeChild(panel.firstChild);
}
panel.appendChild(document.createTextNode(today));
setTimeout(function() { tick() }, 1000);
}
tick();
</script>
</body>
</html>


It removes the page refresh in favour of having JavaScript erase and then re-write the date time every second. The added advantage is that the screen won't flash as it doesn't have to fully re-render. :)
 Top of the page
joval Page Icon Posted 2019-06-01 2:27 PM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:

Wow, thanks!

That scripting is very elegant and runs really well on the Jornada's younger cousin the NEC 900C.

Unfortunately, it does NOT render/work on Jornada 720, evidently due to javascript limitations. I found earlier that the document.getElementbyid function isn't available/doesn't work at all, (doubt the tick function works either). I noted the JS.dll on the 900c is about 50% bigger in size that the 720's...suggesting less functionality in the 720...likely an ealier or slimmed down version.

That's why I specifically mentioned the 720 in naming this thread. It's part of discovering what uses can be made for them.

I am fairly adept at HTML5 and CSS (and ardruino C++...but I am new to javascript. Your script has given me some real food for thought. Thanks again.

Here's a working scrolling time/date for the 720 (if I can figure out how to upload it):





Attachments
----------------
Attachments 720ScrollClock.htm (0KB - 35 downloads)
 Top of the page
C:Amie Page Icon Posted 2019-06-01 3:45 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
It might be a result of PIE 3 only support MSJS and not JavaScript. JS and JavaScript are NOT the same thing. It may need to be re-written in MSJS syntax to make use of their DOM parser.

Have you seen DockWare in the SCL by the way? It's an application that does something similar.
 Top of the page
joval Page Icon Posted 2019-06-04 4:10 PM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:
I think when the 720 developed javascript was in its infancy...version 1 or 2, ..then version 3 was skipped...and a major expansion occurred in 2002 which the MP 900c benefits from , version 4 I think...

So, I just ordered for a few bucks the Javascript Bible from 1998 or so to figure out what it could do back then and try it out on the 720. It's being sent from Goodwill in the bay area. I just hope I don't get in trouble for talking 'bout religion or charity on H"PC"Factor...

Edited by joval 2019-06-04 4:13 PM
 Top of the page
C:Amie Page Icon Posted 2019-06-04 9:53 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
Joval that isn't correct I'm afraid.

Like I said. CE supports JScript, not JavaScript. JScript was a stand alone Microsoft version of ECMA, which was separate to Netscape's. I believe the first CE version with JScript support was 2.12 however it was non-standard to ECMA and JavaScript https://web.archive.org/web/20030314033706/http://msdn.microsoft.com...

document.getElementById was standardised JavaScript in 1998 with DOM version 1 ( https://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html#method-get... ). The fact that it was absent in June 2000's CE 3 release highlights the problem.

As for version numbers. There was no version 4 - there was a JScript version 4.
https://www.w3schools.com/Js/js_versions.asp

In fact. JavaScript's version number didn't change between CE 2.12 in 1999 and CE 6.0 R3 in 2009. They just did not implement it properly until they started to try with CE .net.

For your project you want to use an old version of JScript and not fully standardised ECMAScript-262 - for example you would use an ActiveX create object to MSXML to parse HTML.

p.s. if you want MSXML on the 720, you have to get it out of H/PC:Update. It isn't in ROM.
 Top of the page
joval Page Icon Posted 2019-06-05 4:21 AM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:


Wow, great references!. Thanks for taking the time to put that together. I had quickly glanced at the history of Javascript and I see I got the versions and dates wrong.(3 yes 4 no).

Nevertheless, the MP900C evidently did implement JS 2.0 and has the getDocumentById feature included with the HTML4 browser, as it works with your selective rewrite of the datetime ID. Which means the 720 has the html4 browser but with the earlier Jscript version of ECMA262 and your modification doesn't work.

Regarding buying the JavaScript Bible...I can use it for the 900c. You really helped clear things up for my understanding...although I will need time to look at you MSXML, etc. for the 720.

The goal, my friend, is make simple, easily learned, fun projects for any average newbie who chances on this website. Here it is at least 12 years since I landed here and something like a simple browser based date time clock that anyone can quickly customize never popped up or caught my attention...and I have spent mucho tiempo on other less rewarding far more complicated undertakings. I am surprised to see there have been 29 downloads of it since posting already. The 720 can be fun without the internet web connection...leave that to all those cheap android tablets...without keyboards.

Thanks again for your clarifications!
 Top of the page
C:Amie Page Icon Posted 2019-06-05 8:35 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
Quote
joval - 2019-06-05 4:21 AM

Nevertheless, the MP900C evidently did implement JS 2.0 and has the getDocumentById feature included with the HTML4 browser, as it works with your selective rewrite of the datetime ID. Which means the 720 has the html4 browser but with the earlier Jscript version of ECMA262 and your modification doesn't work.
Correct. CE .net was the first release with standardised JavaCript in it because it was based on the IE5.5/6.0 implementation.


Quote
Regarding buying the JavaScript Bible...I can use it for the 900c. You really helped clear things up for my understanding...although I will need time to look at you MSXML, etc. for the 720.

Syntactically, it will be very similar. From a functional perspective it is also similar. Object implementation and class members may however be very different.

Quote
The goal, my friend, is make simple, easily learned, fun projects for any average newbie who chances on this website. Here it is at least 12 years since I landed here and something like a simple browser based date time clock that anyone can quickly customize never popped up or caught my attention...and I have spent mucho tiempo on other less rewarding far more complicated undertakings. I am surprised to see there have been 29 downloads of it since posting already. The 720 can be fun without the internet web connection...leave that to all those cheap android tablets...without keyboards.

Thanks again for your clarifications!

Good motive and good job. Keep playing!
 Top of the page
joval Page Icon Posted 2019-06-12 5:03 PM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:
I did discover that there are several WinCE clock programs on this site...but most were uploaded by Rich Hawley in 2014, and one by you in 2012. I hadn't been on this site much after 2007, maybe a little in 2011. So that explains why I never saw them...anything like that makes the hpc's useful rather than just gathering dust.
 Top of the page
C:Amie Page Icon Posted 2019-06-12 5:31 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
The SCL was the last core service that came on-line. It was released in 2012 although it was 'around' from late 2010, it wasn't public - after the HCL (2000), Forum (2004), Devices & Specifications (2005) and H/PC:Update (2007). So alas, you wouldn't have seen it if you ducked out in 2007.
 Top of the page
joval Page Icon Posted 2019-06-16 11:59 PM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:
Vbscript works in the J720! Microsoft's foray into early web scripting recently dropped from IE11... This allows the date and time variables to be separated (in a similar fashion as javascript clock on the MP900c) with different formats. I will post an example date/time clock later. IMHO, another avenue to explore...
 Top of the page
joval Page Icon Posted 2019-06-26 3:16 PM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:
C:Amie,

Since you've dusted off your J720 and fired it up (although underpowered), how about putting it to use with this vbscript based time/date html file. If you open it with FTX.exe browser and hit <alt x> you will get full screen (to avoid flicker on refresh) and you can change text size for your liking under view option. You can use H-bomb to change refresh rate as you like. It works and is comparable to my soon to be posted MP900 javascript based version(with thanks to you for the improved javascripting)...which doesn't render on the J720.

Please, no more solitary confinement for the J720...



Attachments
----------------
Attachments Joval_vbclockForJ720.htm (0KB - 15 downloads)
 Top of the page
C:Amie Page Icon Posted 2019-06-26 4:00 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
Drop the trailing / from the <meta tag as this is invalid for that HTML version.

You need to work on getting rid of the meta refresh entirely, it causes the screen to flash and wastes a lot of power.

If you are using VBScript, you can break the VBDateTime down into its constituent components via:

 
Dim dateTimeNow 
Dim iYear, iMonth, iDay, iHour, iMinute, iSecond

dateTimeNow = now()
iYear = Year(dateTimeNow)
iMonth = Month(dateTimeNow)
iDay = Day(dateTimeNow)
iHour = Hour(dateTimeNow)
iMinute = Minute(dateTimeNow)
iSecond = Second(dateTimeNow)

document.write(iDay & " " & MonthName(iMonth) & " " & iYear & " at " & Right(("0" & iHour), 2) & ":" & Right(("0" & iMinute), 2) & ":" & Right(("0" & iSecond), 2))
 Top of the page
joval Page Icon Posted 2019-06-27 2:28 AM
#
Avatar image of joval
Subscribers
H/PC Sensei

Posts:
1,010
Location:
Northern California
Status:
C:Amie,

So, like Elon Musk's Tesla...HPC Factor has a Ludicrous mode? Some might suggest slowing down and thinking about one's impact... enjoy the ride, safely, let a passenger suggest a new direction of travel....

My friend, this is a noobie project. If run in the FTX browser there is no flashing in full screen mode as I specified. Yes, the meta tag refresh needs be phased out eventually and I am looking into it, the / tag issue is superfluous...ie, it works fine on the J720. Remember: perfect is the enemy of good.

Who gives a flying rat's posterior about cpu usage and miniscule power consumption...the J720 needs to be plugged in for this use a date/time clock. Please don't knock it til you try it.

The FormatDateTime object is an ideal and simplified approach here (especially for Noobies)...minimal lines of script. The arguements can be explained later.ie (Date,1) and (Time,3)

This gives the J720 a near identical look, equally customizable, as the MP900c date/time clock which is Javascript based and can't be rendered on J720's.

I like these clocks, they are potentially a great learning experience for all, and they give new life and value to these retro hpc's...which have been useless and mothballed by most or us for the last decade.

It took some real time and effort to get the J720 to perform this trick...and as I've said before: roll over and play dead is no longer an option!

And you deserve so much credit for keeping this vehicle, HPCFactor, up and running, fine tuned...and we are all so grateful for that. In our own way, we look forward to driving this baby in some new and creative ways...yes we need guidance, we need to be taught, but hey... even a little fake amazement
or encouragement could go a long way. Best regards always for the fine dedicated job you are doing.

P.S. Sorry about the bitching and moaning...was a long day at the office and I need a vacation... which, thank God, is starting soon.


Edited by joval 2019-06-27 3:20 AM
 Top of the page
C:Amie Page Icon Posted 2019-06-27 8:56 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,974
Location:
United Kingdom
Status:
Lol, ok. Fair due.

I'm trying to encourage you to explore the API and do more with it. I appreciate that finding documentation for JScript 3 is impossible, but most of the standard VBScript 5.0 syntax should work. Why settle for 10 second resolution when it can be 1 second? Why settle for US pre-defined date/time string formatting when there is a whole world of other ways to do it out there.

My sample above shows you how to achieve the same as FormatDateTime without using the (limited) Americanised 4 options of said function. From a newbie perspective I think it's easier to understand as it isn't a black box functional approach - apart from what Right(("0" & xxx), 2) is doing may be*

As for power inefficiency, I personally disagree with your stance completely. In this day an age we should always encourage people to code as efficiently as possible - and learn good practices from day 1; least they take those ideas elsewhere. Having the device fully re-query from the [CF card], file system, parse the string, parse into XML, parse the DOM tree, draw, parse the CSS, draw, register events and then redraw the entire window from the screen buffer is inefficient if it is not needed. Challenging you to look into doing that is what will give you confidence to continue to learn.

Power management is very important on an embedded device, not just because of potential battery drain, but also because CE has notorious real time clock lag issues. The more the CPU gets loaded, the faster the clock lags. That's why ActiveSync updated the RTC every time it connected. Reduce CPU activity, save power, reduce the severity/speed of the clock losing accuracy.
Time accuracy is probably something you'll agree is rather important given what you are trying to achieve here? No?

* It appends a 0 to the Hour, Minute, Second and then extracts only the right two characters e.g.
13:46:23 -> 013:046:023 -> 13:46:23
1:21:3 -> 01:021:03 -> 01:21:03

This ensures that the time printout is always two digits. Without it time could look like:
2:9:1 which of course we want to be 02:09:01
 Top of the page
1 2
Jump to forum:
Seconds to generate: 0.233 - Cached queries : 72 - Executed queries : 12