Is there a way to make Octave send automatic emails? - email

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.

Related

Retrieving packets by tshark until it gets a specific packet?

While using tshark, I want to capture a packet that contains a specific string.
After executing tshark, I want it to stop receiving packets immediately when it receives a packet that contains the specific string and return it.
What parameters should I use to do this operation?
I think you're looking for something like trigcap, which is part of the Wireshark project, but not currently being shipped to my knowledge because it apparently doesn't work on Windows and may have problems on other platforms now too since it hasn't seen any active development in quite a long time AFAIK.
You can try to compile it yourself to see if it meets your needs. Read more about it at:
Bug 2039 - Triggered Capture
what is the work of trigcap?
If you're on Windows, you might want to take a look at the dumpcap.bat file posted on the Wireshark wiki Tools page.
All of these solutions rely on BPF (pcap-filters), so whatever string you're looking for as your stop condition needs to somehow be manipulated into that format, which may not be easy to do.

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.

Make an arbitrary function safe to run?

I'm writing the docs of my program online, in a wiki, and my intent is to rip that content from the program itself, either from time to time or on demand.
For extra leetness, it would be cool to the get the display functions themselves online, but this I cannot do unless I'm assured that they are safe to run, ie, they won't modify important variables, make system calls, nor steal information from the user. Is this implemented on Elisp or implementable?
It sounds like you want to be able to run your elisp code in a sandbox. A bit of googling lead me to sandbox.el. I haven't tried it, but it might be a good place to start.

imitate user activity / prevent automatic afk detection

Is there a way to simulate user activity on desktop on Windows? This is the situation: A friend of mine works from his home. His company recently decided to provide their employees with a communication tool which they have to keep running in the background. Apart from its main functionality it also has a very intimidating side effect: It tracks user activity. This means that the programm monitors keystrokes and mouse movements. If a user is idle for say 5 minutes or something, an icon next to his name indicates his idle status to all other users, much similar to instant messengers like skype for example. Now while this may be useful in IM programms, we both find it a bit disturbing in a work related context, for obvious reasons.
Doing some google search only gave me shareware links or cheating tools for MMORPGs. But maybe I searched for the wrong terms. My first guess would have been to have a small process running in the background which imitates keystrokes or mouse movement in regular intervals. But maybe there is another way to deal with this. (Oh, and complaining about lack of privacy to the employer is not an option ;) Also please note that I don't want to promote laziness or question an employer's rights over his employees.)
Any comments and help appreaciated. Thanks!
There is an easy way to make cursor move in C++.
its something like:
pos.X = 10;
pos.Y = 10;
I dont know if this is the best way, but it works.
If you dont want to program your own program, Im sure there are a lot of programs on the internet. You just need to google :) .

Real-time data in Matlab

I'm trying to get data from a server. Right now, I am polling the server every couple of seconds for the current values. I am wondering if it is possible to have Matlab get the data in real-time or if I am stuck with my current implementation. Has anyone done anything like this? If so, maybe you can tell me how you got started with it.
Any help would be greatly appreciated. Thanks!
If you're on Windows, you can listen to ActiveX (COM) events using REGISTEREVENT. You would need to provide an ActiveX control (servers might work too, I'm not sure) that triggers the event, which would invoke your MATLAB function.
Matlab timers work well for periodic events. You'll want to be careful about making sure your function executes in less time than the periodicity of the timer, though settings for the behavior when that doesn't hold do exist.