Convert dSPACE ControlDesk measurements to MATLAB/Simulink timeseries (updated)
- With this updated MATLAB script, multiple dSPACE ControlDesk measurements can be imported with a single execution
- The result is saved as a tscollection (collection of timeseries) and all signals are saved with their corresponding name
- Access imported data with Simulink ‘From Workspace’ block and, e.g., dsp_tscs{1}.my_signal
Fix for Latex4CorelDraw with CorelDraw 2017
I was not able to make the official build of Latex4CorelDraw work with CorelDraw 2017 (and Windows 10). The ‘Latex’ Docker window was always empty. The solution was to recompile it with Visual Studio 2017 Community.
Convert dSPACE ControlDesk measurement to MATLAB timeseries that can be used in Simulink
- dSPACE ControlDesk can export measurements to mdf4 files or mat files
- mat file exports can be converted to timeseries with this MATLAB script
- The timeseries can then be imported into Simulink with the ‘From Workspace’ blog
- Multiple signals can be imported at once
Example output:
>> import_dspace_mat_to_simulink_ts --Imported dSPACE mat file C:\Users\Nicolai\Nextcloud\foo.mat into workspace variable dsp_ts --Time: 0.000000 s to 42.399572 s, 423980 steps --2 variables are in dsp_ts: 'In1' 'In1_1'
Robust sync between Android phone and Linux computer
I already tried quite a few methods to reliably sync data (e.g. backups) between my Android phone and a Linux computer. Most were not good, some were horrible (MTP…). I just tried one that has proven to be the best, by far: installing an SSH server on the phone and then syncing with rsync. I
Django DetailView with pagination for related objects
This is an example of a DetailView of a User that can have a paginated list of Purchases: from django.views.generic.detail import DetailView from django.core import paginator @method_decorator(staff_member_required(login_url=’user_login’), name=’dispatch’) class UserDetailView(DetailView): model = User template_name = “user_detail.html” purchases_paginate_by = 5 def get_context_data(self, **kwargs): context = super(UserDetailView, self).get_context_data(**kwargs) purchases_page = self.request.GET.get(“purchases_page”) purchases = self.object.get_purchases().filter() purchases_paginator = paginator.Paginator(purchases,
Export object_list of a django-filters FilterView to CSV
This is a simple way to allow users to export the data they have just filtered using django-filter as CSV. # Normal View (has a link to export view and keeps GET parameters) @method_decorator(staff_member_required(login_url=’user_login’), name=’dispatch’) class PaymentListView(FilterView): filterset_class = filters.PaymentFilter template_name = “barsys/userarea/payment_list.html” paginate_by = 10 # Export View @method_decorator(staff_member_required(login_url=’user_login’), name=’dispatch’) class PaymentExportView(FilterView): filterset_class = filters.PaymentFilter
Running multiple Django projects on one Apache instance with mod_wsgi
I did not yet find a page with a concise but complete description of how to run multiple Django instances/projects on one server with Apache. This method is similar to the one in the Django docs, but the docs version does not run the Django instance in a daemon process, therefore it does not work
Analytical convolution integral (Analytische Faltung) with Matlab and Maple
With and
Function 1 (e.g. input signal/Eingangssignal):
Function 2 (e.g. impulse response/Stoßantwort):
Automatically convert videos in Powerpoint file (pptx) to a different format
I have been trying to convert a lot of embedded videos in pptx files to a different format lately due to compatibility issues on some systems, but have not found an easy and fast way – so I wrote this bash script.
The goal was to have a pptx with videos that can be played using Powerpoint 2010 or later on Windows as well as OS X without plugins. That seems to only be the case for MPG videos (mpeg1video codec).
To convert videos in a presentation
- make sure that ffmpeg and a zip/unzip application is installed (ffmpeg can easily be replaced by avconv, but avconv somehow could not convert some files that were no problem for ffmpeg during my tests)
- download the bash file and make it executable
- edit the options at the beginning of the file, if you want to (mainly video output format and bitrate)
- Change to the directory with the pptx file(s) and start the conversion with /path/to/pptx_video_convert.sh myPresentation.pptx
- Check if everything worked by looking at myPresentation_converted.pptx or the logs
3D printed Arduino Nano case
I put a a practical Arduino Nano case on Thingiverse.
It can be downloaded here: https://www.thingiverse.com/thing:959057