Saturday
Jan242015

Half-Byte Tiny Basic 2: code examples, random dots

Tiny Basic can be a great way to learn how to program. It is primitive enough to be easy to learn, yet powerful enough to complex things in a small amount of memory.  For today’s example, I’m going to show you how to create the random dot pattern I love to show off.

As the resolution on the Half-Byte Computer Console is really low, heck, it is barely there, it does not take much to make a compelling demo.  We have 80 by 48 dots to play with.  Not much, but more than some very early home computers had. But, today, we are only going to use 80 by 46. (Only because I typed the wrong value into the Y=RND statement and was too lazy to fix it.)

Our demo creates four random numbers, one set to turn on the dots and one set to turn them off.  We will use the x, y, p and q variables for the pixels. A fifth number will be generated, using the variable u, and we will discuss that later.

Our demo will create a four quadrant screen to light up the pixels. This will give you a kaleidoscope effect.  So, that means we have to restrict our work to just one quarter of the screen and then mirror it to the other three. Sounds complicated, but it isn’t.

Have a look at the code below:

100 CLS
110 X=RND(40): Y=RND(23)
120 P=RND(40): Q=RND(23)
130 SET X,Y
140 RESET P,Q
150 SET X,23-Y
160 RESET P, 23-Q
170 SET 40-X,Y
180 RESET 40-P, Q
190 SET 40-X,23-Y
200 RESET 40-P,23-Q
210 U=RND(99)
290 GOTO 110

Lines 110 and 120 generate our random numbers, one pixel, to light up and one pixel to turn off.  Lines 130 through 200 calculate the four quadrant locations to turn on or off.  SET will turn the pixel on, RESET will turn them off.  We figure out where to turn them on or off by using offsets. In our case, the offsets are the width (0 to 40) and height (0 to 23). Study what these lines are doing and you can figure out where on the screen each dot will go.  Take a sheet of graph paper and make an 80 by 46 grid.  Use RANDOM.ORG to generate 2 random numbers, one will be from 0 to 40 and the other will be from 0 to 23. Use the SET statements and figure out which cells on your graph paper to color in and then do so.  After you color in the four squares, you can see just how the code works.  Do that a few more times and you get an interesting design.  Now, key the code into Tiny Basic 2 and run it.  Let it go for a while and you’ll see very interesting patterns emerge. After a while, though, the screen gets busy and ceases to be interesting.  So, we need to do something about it.

We need to clear the screen every now and then and let the patterns regenerate.

So, how do we do this? Well, you can it do it a number of ways…poll the keyboard for a keypress, read the Wii Nunchuck, etc.  The easy way, though, is to just do it randomly.  Good thing we have line 210. Line 210 has already created a random number, we just have not done anything with the number. So…lets do something.

220 IF U=93 GOTO 100

That’s all we need to do. Evaluate the value of U and, if it matches our magic number (which can be anything from 0 to 99 as dictated by line 210.  You can put 10000 in there if you like. The random number limit and the number after the equal sign are entirely arbitrary.  But, the higher the numbers, the longer it could take to hit that random number.  It doesn’t matter. For our demo, I chose 99 and 93.  Go ahead, break the program if it is still running and then type in line 220 above. Re-run the program. You will see it switch patterns frequently.

Pretty cool, huh?

Play with the numbers a little. You can limit the pattern to just one quadrant. Change the x and y values in 110 to 20 and 12 (you will need to change line 120 as well.) Then, in the code, everywhere you see 40, change it 20 and change all of the 23 to 12. Run the demo.  You should see the same thing as before, only smaller and in one corner of the screen.  Experiment with this, what do you have to do to put it in, say, the lower right of the screen?  Hint: you will need to offset your set and reset locations.  Look at lines 190 and 200 for a clue. Post your solution in the comments.

I have posted a video here.

In an upcoming example, we will use the Wii Nunchuck to control the drawing.

Saturday
Jan242015

Windows 10, the consumer rules

Win10_Windows_ProductFamily_WebMicrosoft unveiled a near complete Windows 10 platform at an event they hosted this past week (Jan 21, 2015.)  During the keynotes, several key features were shown off, which are sure to make just about everyone happy about the new addition to the Windows family.  Among the features highlighted were:

  • Continuum, the ability to rather seamlessly transition from desktop mode to tablet and back again, depending on whether or not you have your tablet docked or not.
  • Cortana, the Windows Phone assistant now comes to the desktop and tablet experiences as well.
  • Universal apps, which have been talked about for a long time, are a reality. These apps will work on phone, tablet or PC and the experience will be very similar across devices.
  • Spartan, the ‘new’ browser based on the old browser’s Javascript and rendering engines.
  • Clean and consistent user interface spans all types of devices, from phone to XBOX One.

Windows 10: The Next Chapter press event (day 2 of 2)Windows 10 not only gives desktop features to mobile devices, but some of those features are headed to PC land (and some to XBOX as well) including the notification area. On phone, you swipe down from the top edge of the screen. On PC, it will be near the tray. Either way, you will see the same things. And, perhaps the biggest feature of all, Cortana, the Siri like assistant, comes to the desktop.

There were also two huge announcements made, that really kind of overshadow all of the other stuff:  Windows as a service and Windows 10 upgrades will be free to Windows 7, 8.1 and Windows Phone 8.1 users, for the first year the product is available.  Yes, that gives you a year to get off your seat and upgrade those Windows 7 computers.  For free.

Windows as a service is currently aimed at the business area, but it could to consumer land at some point. The Windows as a service plan is very much like Office 365 and, in fact, includes Office 365 for business.  Pricing was not announced, but it is speculated to be around $12 per user per month.

Perhaps an overlooked aspect of the announcements Win10_Xbox_Devices_Webwas the XBOX One.  Windows 10 will be coming to that platform as well. And it will require a new interface…the XBOX controller.  Game streaming from XBOX One to any Windows 10 device will be baked in. You will be able to start a game on your console, continue on your tablet or desktop and finish back on your console.  The XBOX app for Windows will also be included and will be very similar to the Xbox 360 and Xbox One apps that are out today.

Microsoft will be releasing two huge Windows 10 computers, a 55 inch and an 84 inch device that is ‘tuned’ for conferencing and aimed at business (which means they will be expensive.) They will be from the Perceptive Pixel company that Microsoft purchased a while back. Called Surface Hub, you can see them in action here.

Oh, and there was one more thing…

Win10_HoloLens_LivingRoom_WebHOLOLENS. HoloLens is an augmented reality headset in the form of glasses. Among the things it can do…use your eye as a mouse.  This device is very intriguing and nothing I write here will convey that, so…I will point you to Youtube and to Engadget, where they had some hands on with the device and a nice write up too boot.

 

OFFICE

Win10_Windows_Mail_PrintA new version of Office was briefly shown. Office for Windows 10 is a touch enabled version of the productivity suite.  It will be available for all Windows devices (not sure about XBOX) and will be consistent across them.  Outlook on Mobile will use the Word engine so you will be able to, finally, create really nice email messages on your phone.  The suite will be available for free on all device that are under 8 inches.  Pricing for the other devices was not revealed.

If  you want to play around with the new bits, you can enter the preview program and download Windows 10 for your computer today.  The mobile version is coming out in February of 2015.

Thursday
Jan152015

A look back at Hard Rock Park, Myrtle Beach, SC

Not tech, but I frequently write about theme parks so, here’s a look back at a terrific little theme park that used to exist in Myrtle Beach, South Carolina.  Hard Rock Park was open, as Hard Rock, for one season. It shut down early that year but was re-opened in 2009 as Freestyle Music Park.  I was fortunate enough to go there, twice, when it was Hard Rock Park. My son and I enjoyed the park and got to ride all of the rollercoasters and he rode most of the ‘flat’ rides. It was a charming place and I’m really sorry to see it fail.  It’s story is convoluted and twisted with many shady deals and missed opportunities. What’s left of the park, the rides, are mostly on their way or are already in a theme park in Vietnam. Rumor has it that that park is a near copy of the Myrtle Beach location, layout wise and ride wise.  So, enjoy the following photo album.  The photos, and I have to apologize for the quality, were taken in August of 2008.  I have a video on YouTube as well.

Tuesday
Jan132015

CES 2015: webOS, tablets and funky tv’s

The 2015 International CES is over.  Among the products and product lines shown off were curved Televisions, 4K TV, ‘quantum dot’ TV, TV dongles, tablets, smartphones and accessories, self driving cars and more computers-of all shapes and sizes. Oh, and smart watches and fitness bands. Lots of them.

So, where do we start?  Well, lets start with one of my favorite operating systems. This OS is now in televisions, phones and … soon, smart watches.  Yep, webOS is making a splash with LG spearheading the way.  They purchased the OS from HP in 2013 and began adapting it for use in smart televisions.  The first effort, while it sold five million televisions, was less than stallear. webOS 2.0, however, is said to be fast and easier to code for than the previous release.  It has also been shrunk down to watch size.  LG has, seemingly, teamed with Audi to produce a watch that can open the car doors, place calls and a plethora of things.  LG denies it and Audi was just trying to show off the car.  The Verge reports seeing an ‘about’ screen that shows the webOS version.  For a dead OS, it sure is making a splash.  The interesting thing is that, at the current rate, LG will have more webOS devices in the wild than Palm/HP Palm ever could.

Intel showed off its Compute Stick, an HDMI dongle for your Television that is a complete Windows computer on a stick.  Selling for $149, the Compute Stick features an Atom processor, 2GB of RAM, 32GB of storage and features a micro-SD slot for future expansion. So, it is a rather spartan PC, but, it is very portable and Wifi enabled,so you could just throw it in a bag, your pocket, whatever and take it with you instead of a laptop. The drawbacks, of course, are that you do need a keyboard and mouse AND an HDMI enabled display. But, if you don’t mind these limitations, the Stick might just be your travelling companion.  A cheaper, $89 version running Linux will also be available.  Though, the Linux version sports half the RAM and only 8GB of storage.

I’m no Sony fan, but, I would definitely purchase their newest 65 inch set. This thing is 4.9 mm thick. The 4K set is thinner than most current smartphones.  It is edge to edge awesomness.

In a big nod to Microsoft’s Surface tablets, a group of former Google engineers introduced the Remix. To be offered up next month via a Kickstarter campaign, the device has many of the same features of Surface, looks like the Surface and its software, another Android fork, even resembles Windows 8 applications and its mail client is a rip off of Windows 8 mail.  Still, It says much about Surface that these gentlemen would decide to ‘me too’ the tablet.

Speaking of tablets, there were plenty to choose from. From a six inch Windows tablet all the way up to a 65 inch, 4k enabled tablet from FUHU.  Perhaps the most interesting ones, however, are the under $150 Windows tablets which are going to be available in the next month or so.  There were no new Kindles, but there were a bunch of Android tablets as well. No one tablet really stood out (well, maybe that 65 incher) but they were all well represented.  Have a look on CNet’s News.Com for more.

For a complete wrap up of the events at CES, the Verge has a good summary.

Tuesday
Jan132015

Amazon’s Kindle: eReader, internet device and cheese slicer

WP_20150113_22_49_26_ProFunny thing happens when you buy a piece of technology that, at the time, seems to be cutting edge. Yet, in just a few short years, it will become obsolete, regardless if it is still useful or not. Such a wonder is the original Amazon Kindle.

Introduced in 2007, the innovative Kindle eReader was an ugly and expensive device.  It languished a bit until Oprah Winfrey devoted an entire show to the device. Jeff Bezos came on and explained the device, Ms. Winfrey had a family explain how much they loved it and, best of all, the device was made available at a substantial discount if you used the magic code from the Oprah show. Each studio audience member also got one for free.  The device took off after that and so did the eReader category. Within a year or two, there dozens of devices available at a wide range of cost, from $99 to $500. 

The original Kindle was all white, used e-ink display technology and had a cell radio and something called Whispersync, which allowed for over the cell-air purchase and downloading of content. It would also keep your device in synch with other Kindle devices, be it a computer or another Kindle.  The cell radio was on the Sprint network and worked reasonably well. You could turn the radio off to conserve power.  Speaking of power, the device sipped the juice very conservatively. One could go weeks on a charge, as long as the radio was off.

The design of the device was unique.  Wedge shaped, it feature this funky ‘elevator’ controlWP_20150113_22_49_01_Pro that you would use to select lines or options. One would ‘click’ the wheel to make a selection.  There were lots of buttons, including a full but split qwerty keyboard and very large next and previous page buttons.

The on device software was fairly complete and featured a very crude web browser (something later Kindles would eschew) and a basic mp3 player that would play music while you read.  The browser, believe it or not, came in very handy during several storms and hurricanes. In fact, at one point during a hurricane in 2012, it was the only way we could get news while we were home. All of the cell phones had run out of battery power, and there was no internet so the iPad was kind of useless. I broke out the Kindle, which was about half charged, and not only caught up on the news, but was able to check the power company web site to see if restoration was near.

Amazon realized, by the time the Kindle 2 came out, that giving away life time service from Sprint was a costly thing to do and made the browser only work via Wi-Fi in later devices.  However, I’ve had my original Kindle since its introduction and STILL have the Whispersync service, even though another company services Amazon along with the grandfathered Sprint devices.

Overall, the original Kindle, while ugly, was a great device. It has since been made obsolete by newer and better devices from Amazon, Sony, Barnes and Noble, Samsung and others but this first device will always have a soft spot in my heart.