Command line arguments for Scratch 1.4 - mit-scratch

I'm using Scratch 1.4 for preparing a course for children.
The course is about controlling real devices (self built traffic lights, modified toys having motors, sensors, etc.)
For interfacing the hardware I'm using the Remote Sensor Protocol and the control-lines of a RS232 interface (3-in/3-out, all digital).
Everything works great, except small inconveniences:
The children have to do many steps manually:
start scratch first,
load a template project which enables remote sensor protocol and defines variables
accept the warning message notifying, that remote sensor protocol is enabled
start RSP-RS232 proxy
I'd like to simplify it by starting scratch from my tool, ask Scratch to perform steps 2,3 by command-line arguments and finally connect to the RSP port.
Is it possible?
If not, is it hard to implement these parameters in Smalltalk for someone with no Smalltalk experience (but other languages like C++)?
Thank you!

Ok, after some readings I could answer my question.
Bad news is: there is obviously no command line argument in Scratch passing a project-file as a start-project.
However good news is, it is not difficult to change the scratch for own needs. Several projects do it, e.g.:
Scratch 4 Arduino
Scratch GPIO
How to do it is described here:
http://wiki.scratch.mit.edu/wiki/Scratch_1.4_Source_Code
Scratch and Squeak
...
To get started, first copy the Scratch application ("Scratch.exe" or
"Scratch.app") from your normal Scratch folder into the Scratch source
code folder. (The Scratch application is actually just a Squeak
virtual machine, so any recent Squeak virtual machine should also
work.) Also, put copy of the Squeak source code file in that folder if
needed (this file is included in the zip file starting with the 1.4
source release). Finally, drop the file "ScratchSourceCode1.4.image"
onto the Scratch application. The Squeak programming environment will
start up, allowing you to view and modify the Scratch source code.
I was able to disable the dialogue notifying that remote sensors protocol is enabled
and to enable remote sensors at start by default. Took me 2 hours.
P.S.:
For those interested, I host my project here: https://github.com/vheinitz/Qratzfest
As I've found out, my Idea was not new (I've looked for this possibility about 3 years ago, but there was nothing). What is different, the proxy-tool is for PC, and is intended to use any hardware, not dedicated only to a specially firmwared Arduino or PI. Currently only control-pins of a serial interface are supported and linked to fixed names.
Soon it will provide the possibility to map any pin to any Scratch-variable.

Related

Pre-packaging settings/extensions for VS code for users of a course

We teach a Deep Learning course on our supercomputers, and one step which is prone for improvement/automation is the connection to the machines and text editing.
Our users come with extremely distinct backgrounds: from people who set up their own linux clusters to people who barely understand the concept of a text editor, given they always edited files on jupyter or collab.
What I would like to do is a double-click package users can download and it configures VS code to connect to our machines, downloads dependencies (like the extension for ssh), generate new ssh keys, and gives support for viewing image files, csv and so on.
My impression is that the way of doing so is, instead of a full package containing vs code and our configurations, would be to make an extension of VS code itself which does that, but I have no idea where to begin or if such a thing even makes sense.
Any pointers are welcome.

Porting of TwinCAT2 to TwinCTA3

I have a running project of twinCAT 2 (made for XP 32bit ) & Its working as required. Now I tried to port this project into TwinCAT3 (windows 10 64bit) for that->
I opened twinCAT 3 Created a new project.
Then add the existing project where I added ".tsm" file of TwinCAT2.
Then I added the PLC file (which have the main program & GUI also)
Then all the mapping for input and output & also changed a few settings in twinCAT for the device.
In the end, I build the program without having any errors.
Then finally I ran the TwinCAT3 program....
The problem I'm facing
If I'm clicking the RUN button TwinCAT3 is getting hanged (don't know the maybe time-related file is creating issue)
I'm not able to see data on GUI (Maybe GUI file not linked with the main program).
Please let me know if any solution you guys have.
Thanks :)
Porting TwinCAT2 plc project with a visualization to TC3 is sometimes a little tricky. You can try to just import the visualization pictures into the plc and let the engineering do the rest automatically (bind libs etc.). Or check the lib-versions of the visu libs manually. Or check the visualization profile in the plc-project properties. In both cases the slogan is "latest greatest" in this scope.
Is the connection to other data from the target also lost? E.g. the current cpu-usage of the cores? If yes, you have a other problem. Mostly endless loop.

U-boot deployment questions

I'am currently developing an application for an embedded system (RTEMS for RPI2). As you may know developing proccess on embedded systems imply:
Modifing the program
Compile it and load it into de SD card
Insert the SD card on the board
It is a tedious process, and you can even break the SD slot for the constant usage. This is the reson why i'am trying to set up a comfortable enviroment for developing and deploying the application on the RPI. My idea is to use Eclipse as IDE for all the proccess (edit, compile and execute). So far these are my ideas for solving the different problems:
Usage of U-boot for loading the application images from TFTP. [That solves the problem of plug & unplug the SD card]
Use CTD eclipse pulgin [That solves the problem of compiling]
Use of Terminal View eclipse plugin instead of putty [That solves the problem of viewing the application console prints]
As you may notice the only problem i have unsolved is the one of executing. The idea is that whenever you compile the compiled file is located at the TFTP server directory, so it is accesible for u-boot client to load. The thing i don´t know how to do is how to tell remotely u-boot to reaload the image (the image would always have the same name). I know i can just simply reset the RPI but i don´t know if that can damage something, and also i'am curious to know if there is a more elegant way to do it.
Another thing i would like to do is to somehow specify if you want to run the application on the target or on a simulator like QEMU.
Thanks in advance

Can Windows Theme files (aero.msstyles) be sideloaded with spyware in their resources, specifically in UI scripts

Short version: see topic
Detailed version:
I want to use a specific 3rd party theme for Windows. I'm already using an open source solution which I've compiled myself to disable Window's restriction on Themes.
In the past, when using 3rd party theme related mods that come with DLLs (for example authui.dll for the login ui, or imageres.dll for modding system icons), I avoid using unknown DLLs by simply copying the unknown DLL's theme related resources (such as Bitmaps, Icon groups or UI scripts) unto it's virgin MS Dll counterpart. I call this resource grafting, where resource are changed but the executable elements of DLLs or exes are left alone.
Going back to the theme I want to install, I used sha256 hashing to determine that only aero.msstyles which is also modifiable by resource hacker. So I did the same thing I usually do and transferred resources from the third party theme to Window's own aero.msstyles. Problem is that I ran into a type of resource that I am unable to read or know the contents of. It's called VARIANT. From some experiments done in a VM, it seems to be some kind of binary UI script that resource hacker is unable to decompile. I usually like to be able to read any UI scripts that I transfer but I am unable to do so with this one.
Would this constitute any real security risks? Can UI scripts be side-loaded with some kind of exploit? Seems unlikely to me since the function of a theme file (msstyle) is to coordinate the appearance of the system UI but I don't know enough about the inner working of the whole theming system to be sure. I thought I'd get some other point of views before I take the theme out of the Virtual Machine.
I used vBinDiff to compare the hex code the altered VARIANT/NORMAL binary to that of the original theme. You can also copy the binhexes and save them to two text files which you would compare with WinMerge.
vBinDiff and WinMerge will highlight what modifications and what additions/substractions were made to the binaries, displaying them side by side. I read through the differences, 90% of them were no larger than 4 octals (4bytes), typically what you would expect to see when modding colors using a hex editor. The biggest divergence was an added 32bytes of code.
There are two possible explanations for the such an addition: (1) the author added extra image resources and added the entries necessary to reference them, (2) there is some kind of unwanted code that has been slipped in.
To address the possibility of 2, I did a search to see how small trojan code can get. How likely is it that a trojan has been stuffed into 32bytes if compiled UI scripts? I found a few mentions of an old 17byte virus from the DOS era called trivial which I disegarded right away because it would become apparent very quickly given it's known behavior. As far as full fledged trojans with backdoor and downloading abilities, the smallest I found was 20kb (trojan tinba), discovered in 2012. There is also Catchy32 which is still considered a Trojan but with simpler and very specific functionalities and that one's about 580 bytes (reference). Based on this info, I established that it is highly unlikely (if not impossible) to slip any code in 32bytes of code and established that the resource in question is clean.
Mind you, this doesn't answer the question I asked (can binary UI script resources in a theme carry mal-code) but it does solve my dilemma. Thought I'd share it.

How to create a CMS that exports to a memory stick that could then update a presentation on another computer

I have been asked to provide a solution for a client of mine. They have asked me to build a presentation for a exhibition in a museum that can be updated. The presentation will essentially be galleries of images/videos with associated captions. This presentation computer will have a poor internet connection at best.
I see the best way forward for my client to update the presentation would be to have created a presentation on another computer. They need to do this remotely from exhibition and there will be no network connection between the CMS and presentation computer.
I need them to then be able to export the presentation file onto a USB stick that they could then take to the exhibition.
Once at the exhibition I would like them to be able to put the USB stick into the computer and then for it to automatically copy the information into a folder on the computer and also update a XML file.
What I'm wondering is what would be the best way to program this? I am pretty experienced Flash and PHP programmer and would normally get round allot of these problems by running it all on networked computers running stuff from servers. I know I could quite easily create a presentation system in flash that would load all the info from a folder but getting that folder from one computer to the other seamlessly is not something I'm familiar with. I really don't want the administrators of the system to have to manually copy a folder from one computer to another. It really needs to be click a button and it exports to USB and click a button and it imports from the USB. When it comes to creating programs that export files and copy folders to and from USB sticks I'm pretty lost!! Would this be something that needed done in C++ or something similar? Any advice would be great!
Many thanks for taking the time to read this!
Cheers,
Craig
I think there are several options for this but one that comes to mind is to install and run a complete stack with CMS, MySQL, webserver from a bootable USB drive/stick.
Also check http://portableapps.com/
http://bitnami.org/ may also have something for you.
Another option is to use a CMS that can export and import its content easily.
e.g. hhttp://share.ez.no/download-develop/downloads/
allows users to create content and that content ( or any section of it ) can be exported as zipped package for import into another instance of the CMS. Usually takes less than a minute each way ( unless the export is very large ). The CMS would be installed at both locations running on the local machine. They don't need to be both running the same OS stack.