I discovered why my Azure free trial was eating cash. It seems that the free trial defaults to reasonable paid service tiers, and not the free development tiers. So when you set up your Microsoft account (MSA) for development purposes, make sure you double and tripple check that the plan you pick starts with an F (for free) and not an S.
When you use bot builder or QnA builder, you might need to go back after you create a project from template and change the "App Service Plan" to something free. If you see your $ decreasing and you're not doing anything - you've configured something incorrectly.
Retrogaming, Single Boards, Natural Language Processing, Computer Programming, Software Engineering
Friday, 13 July 2018
Thursday, 12 July 2018
Building Bots in Azure
I am starting to build Cortana bots. So far its been interesting.
I had trouble building the Azure function bots from template. The node.js example for the simple "echo" bot... First crack, the Azure "Test in Web Chat" didn't work. Errors implied there was a permission issue.
I tried again, and had a deployment error on the bot function template.
I tried again, and on the third try it deployed. To my knowledge, I did nothing differently.
The advantage of a function bot over a web app bot is supposedly pay per invocation (that should be cheaper, right)? The issue with the example code for node.js on the function bot is that every potential used library is embedded in the index.js code where the two line "echo" functionality is embedded in the middle!
WHY? Why? Well, javascript as a language doesn't have a '#include' statement. Client side, you do the includes on the document for your browser to take care of.
In node, we have requires... that allows us to load modules. But why is this not used in the function bot example? I figure its a work around. But the down side is this: every time I edit the function in the portal for this example, I am touching a 200K line file!
Tuesday, 21 March 2017
Pi Zero W
When I installed the SD the Pi Zero W came with from CanaKit, I had a heck of a time getting it working. First, the micro USB hub I had from Amazon basics didn't work.
Then I had to manually load up the wifi config.
I installed libSDL, advmame (thanks Silverman) and fceux and ... performance was crappy.
But I couldn't see anyone else saying Asteroids was broken out the box.
So I tried to install my Pi2 SD...
I learned that older versions of raspbian don't work with the Zero. Not even if you
sudo apt-get update
sudo apt-get install rpi-update
sudo apt-get dist-upgrade
sudo rpi-update
Its because PiZeroW runs best with the latest raspbian build, Jessie. It doesn't like the old build, Wheezy as the wifi is flakey.
So after a couple flips of build, it looks like my original video settings we mangled on the SD card that shipped with the Pi Zero W. My latest attempt work - and Pacman is playable with latest advMame - but asteroid is not. That said, Super Mario works like a charm...
Now I need to discover how to tune the Pi Zero.
And my Orange Pi arrived...
Then I had to manually load up the wifi config.
I installed libSDL, advmame (thanks Silverman) and fceux and ... performance was crappy.
But I couldn't see anyone else saying Asteroids was broken out the box.
So I tried to install my Pi2 SD...
I learned that older versions of raspbian don't work with the Zero. Not even if you
Its because PiZeroW runs best with the latest raspbian build, Jessie. It doesn't like the old build, Wheezy as the wifi is flakey.
So after a couple flips of build, it looks like my original video settings we mangled on the SD card that shipped with the Pi Zero W. My latest attempt work - and Pacman is playable with latest advMame - but asteroid is not. That said, Super Mario works like a charm...
Now I need to discover how to tune the Pi Zero.
And my Orange Pi arrived...
Saturday, 25 February 2017
PiPlay struggles.
The PiPlay interface randomly hangs. Fortunately the web interface allows a reboot.
Setting up a joystick is not intuitive. You need to install the jstest and set the codes in a variety of config files. As far as I can tell, the controller config python script does not work.
For SNES, go to the emulators directory and find the snes9x.cfg file. Update the mappings in there (after you've installed and run jstest to figure out what the buttons are.)
For NES, you need to jump through a few hoops. First, "startx" from CLI. Then, find the fceux directory (in the pimame emulators directory). Start a terminal in X. Run the fceux --inputcfg gamepad1 command and set up the buttons.
For advmame, find the default.cfg and add your joystick settings. You can get a hint what they should be via tab in the emulator.
I finally got sound working on astroblaster and starcastle. The trick is to find the sound samples with the same name as the roms and install it in the sample directory. You can find this in the .advance directory (hidden) in the ~pi directory (that is home). I haven't tried donkey kong yet, but if that works, I'm in heaven.
Setting up a joystick is not intuitive. You need to install the jstest and set the codes in a variety of config files. As far as I can tell, the controller config python script does not work.
For SNES, go to the emulators directory and find the snes9x.cfg file. Update the mappings in there (after you've installed and run jstest to figure out what the buttons are.)
For NES, you need to jump through a few hoops. First, "startx" from CLI. Then, find the fceux directory (in the pimame emulators directory). Start a terminal in X. Run the fceux --inputcfg gamepad1 command and set up the buttons.
For advmame, find the default.cfg and add your joystick settings. You can get a hint what they should be via tab in the emulator.
I finally got sound working on astroblaster and starcastle. The trick is to find the sound samples with the same name as the roms and install it in the sample directory. You can find this in the .advance directory (hidden) in the ~pi directory (that is home). I haven't tried donkey kong yet, but if that works, I'm in heaven.
Sunday, 19 February 2017
PiPlay on Raspberry Pi 2
Yes, I finally got around to it. I installed MAME on my Pi 2. After trying to install it on my existing SD card, I figured I'd just use a pre-existing image. win32diskimager is the tool to backup your old images and image and make new ones. Pick either of these two images.
Add DHCP to the wireless network adapter. Go to raspi-config (tools) and resize the partition to use all 8G. Reboot the thing and install the latest MAME via its home screen. Reboot again. HTTP into the Pi and use the PiPlay upload for ROMs. Have tons of fun.
br> Here is my gear.
Tuesday, 22 November 2016
How to Fix Moto G MTP not working on Windows 10
OMG.
After spending two hours and a long uncomfortable call with Motorola that went nowhere, I finally managed to get MTP working on my new Moto G 4 phone.
Effectively, when I set the phone to MTP mode, the driver failed to load. I could run as PTP, but that didn't give me access to the whole FS...
Device manager told me that the install was incomplete due to a bad inf,
"a service installation section in this INF is invalid"
The advice on the internet was
- update the driver
- reinstall the driver
- turn it off and on again
and a variety of other shamanistic advice, none of which work.
Motorola's advice was to run their Device Manager to reinstall the drivers, but of course, that tool didn't recognize the device being there so... and then the advice was to call Microsoft support. Sigh.
Motorola's advice was to run their Device Manager to reinstall the drivers, but of course, that tool didn't recognize the device being there so... and then the advice was to call Microsoft support. Sigh.
I found the solution myself. For whatever reason, the PNP tools were not actually getting to install the right INF, even when I selected it via "legacy hardware", likely because some other config was getting hit first.
If you have the same issue, simply do this.
- Run an administrator cmd shell
- cd to \windows\inf
C:\Windows\INF>pnputil /?
Microsoft PnP UtilityPNPUTIL [/add-driver <...> | /delete-driver <...> |/export-driver <...> | /enum-drivers | /?]Commands:/add-driver <filename.inf | *.inf> [/subdirs] [/install]Add driver package(s) into the driver store./subdirs - traverse sub directories for driver packages./install - install/update drivers on any matching devices./delete-driver <oem#.inf> [/force]Delete driver package from the driver store./force - delete driver package even when it is in use by devices./export-driver <oem#.inf | *> <target directory>Export driver package(s) from the driver store into a target directory./enum-driversEnumerate all 3rd party driver packages in the driver store./?Show this usage screen.Legacy Commands:[-i] -a <filename.inf> ==> /add-driver <filename.inf> [/install][-f] -d <oem#.inf> ==> /delete-driver <oem#.inf> [/force]-e ==> /enum-driversExamples:pnputil /add-driver x:\driver.inf <- Add driver packagepnputil /add-driver c:\oem\*.inf <- Add multiple driver packagespnputil /add-driver device.inf /install <- Add and install driver packagepnputil /enum-drivers <- Enumerate OEM driver packagespnputil /delete-driver oem0.inf <- Delete driver packagepnputil /delete-driver oem1.inf /force <- Force delete driver packagepnputil /export-driver oem6.inf . <- Export driver packagepnputil /export-driver * c:\backup <- Export all driver packagesC:\Windows\INF>pnputil /add-driver wpdmtp.inf /installMicrosoft PnP UtilityAdding driver package: wpdmtp.infDriver package added successfully.Published Name: wpdmtp.infDriver package matches devices that already have their drivers up to date.Total driver packages: 1Added driver packages: 0C:\Windows\INF>
Tuesday, 13 September 2016
Geek Dad: Teaching the boy to code...
I might have finally gotten my sons attention. I've been trying to teach him to code in Java for a couple years, but I am competing with the instant gratification of Scratch.
First attempt went something like this: "Hey dude, look how you can use state machines and state transition diagrams to write a text adventure like Zork!" He was kind of interested in building the map, but I lost him in implementing an actual game complete with inventory and actions.
Next attempt was: "Hey son, remember Wizard's Quest the board game I showed you? We can write that as multiplayer network game (kind of like Dark Forest when I was a kid)." He learned something about polygons and translation from the game board into the computer, but I lost him in implementing the event loop and game rules.
Finally we have: "Dude, when I was 8, I played this game called Chase on a Data General Nova III, and it was cool because like in Tron, you could maneuver the robots chasing you into the walls and escape the grid!" I think I got him this time, because I was able to spin up a framework in a few hours, and the building blocks are all there for adding animation, time/event based movement, and other elements. Almost instant gratification in a couple pages of code.
The rules. You are in an arena with electric fences and robots. The robots can only move horizontally or vertically, but you can move diagonally. The objective is to run away from the robots and attempt to maneuver them into the walls. You win when all the robots are dead. You loose when you run into a wall, a robot gets you, or you exceed 100 moves.
Robots use the difference between their position and your position when deciding to move vertically or horizontally (50-50). If another robot is in the way, they pick a random direction (that can cause them to bump into another robot or wall). Whatever a robot runs into is destroyed, but when one robot hits another, one survives.
First attempt went something like this: "Hey dude, look how you can use state machines and state transition diagrams to write a text adventure like Zork!" He was kind of interested in building the map, but I lost him in implementing an actual game complete with inventory and actions.
Next attempt was: "Hey son, remember Wizard's Quest the board game I showed you? We can write that as multiplayer network game (kind of like Dark Forest when I was a kid)." He learned something about polygons and translation from the game board into the computer, but I lost him in implementing the event loop and game rules.
Finally we have: "Dude, when I was 8, I played this game called Chase on a Data General Nova III, and it was cool because like in Tron, you could maneuver the robots chasing you into the walls and escape the grid!" I think I got him this time, because I was able to spin up a framework in a few hours, and the building blocks are all there for adding animation, time/event based movement, and other elements. Almost instant gratification in a couple pages of code.
![]() |
The Grid |
The rules. You are in an arena with electric fences and robots. The robots can only move horizontally or vertically, but you can move diagonally. The objective is to run away from the robots and attempt to maneuver them into the walls. You win when all the robots are dead. You loose when you run into a wall, a robot gets you, or you exceed 100 moves.
Robots use the difference between their position and your position when deciding to move vertically or horizontally (50-50). If another robot is in the way, they pick a random direction (that can cause them to bump into another robot or wall). Whatever a robot runs into is destroyed, but when one robot hits another, one survives.
![]() |
The Tron Maneuver |
Subscribe to:
Posts (Atom)