Casio calculator key press event in MicroPython - event-handling

Is there a way to use a Casio calculator, like 'fx-CG50', that accepts python to listen to pressed keys?
Currently the only way to use user input that I found was the console input. Is there another way?
Casio does not provide any documentation at all. The used libraries like 'casioplot' do not help handling input.
Maybe there is a native way in MicroPython I don't know of, since it runs on the chip itself.

Related

Using EEPROM in STM32f10x

I'm using STM32f103 and in my program, I need to save some bytes in the internal flash memory. But as far as I know, I have to erase a whole page to write in it, which will take time.
This delay causes my display to blink.
Can anybody help me to save my data without consuming so much time?
Here is a list that may help:
1- MCU: STM32f103
2- IDE: Keil vision
3- using HAL driver provided by STM32CubeMx
4- sample data for saving in Flash: {0x53, 0xa0, 0x01, 0x54}
In the link below, you can find the code that I'm using.
FLASH_PAGE for Keil
The code you provide doesn't seem to be implemented well. It basically does 2 things each time you initiate a write operation:
Erase the page (this is the part that takes time)
Start form the given pointer, write until it hits a zero.
This is a very ineffective way of using the flash.
Probably the simplest and the most well-known way is to use the method described in ST's AN2594, although it has some limitations.
Still, at some point a page erase will be necessary regardless the method you use and there is no way to avoid some delay, unless your uC supports dual flash banks (STM32F103 don't have this feature). You need to plan the timing of flash writes and display refresh accordingly. If you need periodic writes to the flash, there is probably some high level error in your design.
To solve this problem, I used another library that STM itself presented. I had to include "eeprom.h" into your project and then add "eeprom.c" to it. You can easily find these files on the Internet.

Is there a way to make Octave send automatic emails?

Suppose I leave a program running in Octave, and I would like to know if it stops running, for example. Is there a not-too-sophisticated way to make Octave automatically send an email to me when certain criterion is met?
Thanks in advance.
There is no built-in functionality for this but it would be very easy to simply make a system call to an email-sending facility.
Traditionally this is sendmail, but you can look around to see if you can find something friendlier. If you're on linux, sendemail seems like a nice, friendly alternative.

Finding special key data of bluetooth HID mouse with AHKHID

I have a Mad catz mouse9 bluetooth mouse. It's software isn't very good. So I have been using ahk, with special keys programmed to shift + f12 or something (to emulate f22 etc. mad catz software does not support f22 directly)
This is not a very good solution, and sometimes causes problems.
So I wanted to not use mad catz software.
I have tried AHKHID's example 2 to find what calls are being made.
When I read for mouse I can get data for special keys, but they seem emty. so there is data being polled but I do not know how to differentiate between different keys
I have tried AHKHID_GetInputData but it seems to not work for mouses.
Is there somemethod to get raw data?
I have also looked for other HID devices connected, but they do not register anything.
I am not good at programming (or scripting in this case), so sorry for any stupid mistakes :)
Example code: https://github.com/jleb/AHKHID/blob/master/examples/example_2.ahk

Create a listener for Siri

I'm at the beginning with swift 3 and I want to ask a questions?It's possible create a listener for Siri?
I mean , a functions that is a loop and is waiting for Siri, and when the user speaks with Siri, my listener need to capture the text and do something.
No, the Siri API doesn't work this way.
If you want to use Siri, please read the documentation here https://developer.apple.com/library/content/documentation/Intents/Conceptual/SiriIntegrationGuide/
On the other hand if you only want Speech-To-Text, without Siri functionalities, you can implement it in your app using SFSpeechRecognizer. A fully working example is here https://developer.apple.com/library/content/samplecode/SpeakToMe/Introduction/Intro.html

Emacs "on-request" completion interface for writing a major mode

I'm writing a major mode for a language and I want to offer completion after '.', or following a keypress. Completions are determined by sending a request to a backgound process using process-send-string and set-process-filter. The returned list of completions is dependent on the background process parsing the current state of the file and being instructed to give completions at that particular point.
I have tried using the popular autocomplete package, but it is really not written with this use case in mind. This is partly because it offers automatic suggetions (i.e. without keypress), which is a nice feature that I don't need. The function that you offer it to call needs to be called synchronously, and emacs process control is asynchronous. I have coded something up along the lines of https://github.com/Golevka/emacs-clang-complete-async, but it doesn't feel robust at all, and has been very fiddly to get it working.
I like the menus used in autocomplete, and would like to know what would fit best with my use-case, preferably while also looking nice.
You can wait synchronously for a background process's output with accept-process-output. You might like to take a look at gud-gdb-completions and gud-gdb-run-command-fetch-lines in a recent enough version of gud.el.