storing and modifying an optional within a struct
i'm writing some code that writes content to files that are rotated hourly. my current approach has a struct that holds an option<std::io::bufwriter<std::fs::file>> and a number representing the current hour.

i wish to make the current\_file optional so that it doesn't create an empty file when the …
how about this?

fn write\_some\_content(&mut self, hour: u32) -> result<(), std::io::error> {

if self.current\_hour != hour {

if let some(writer) = self.current\_file.as\_mut() {

writer.flush()?;

}

self.current\_file = none;

self.current\_hour = hour;

}

…
[image] dueck456:

is there an easy way to detect when new code is flashed to the device so i can reinitialize the retained variables?

below is a link to a post by [@rickkas7](/u/rickkas7) about storing retained data in a struct.

[image] dueck456:

saving a know value to eeprom jumps to mind

there is … From the [Library Reference](http://docs.python.org/2/library/stdtypes.html#set-types-set-frozenset):



> 
> The set type is mutable — the contents can be changed using methods like add() and remove().
> 
> 
> hi

we can do that by defining a string variable in the very beginning of the process with assign activity or by defining that in variable panel in the studio at the bottom the window

but make sure that we are not assigning any value to that variable later across the workflow

if we assign later th… hello,

there are more possibilities how write output to file. first is by standard methods of jscript by “scripting.filesystemobject”.

var fso = new activexobject(“scripting.filesystemobject”);

var forreading = 1;

var forwriting = 2;

if (fso.fileexists(‘c:\test.txt’))

var f1 = fso.opentextfile… hey [@andre601](/u/andre601) ! i think there is a webhook that fires for that:

<https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads#pull_request>

check out the action key in the payload, it has support for state changes between draft and non-draft states. we’re glad to announce that this feature is now available in production on [bitrise.io](http://bitrise.io) :tada:

related [#changelog](/c/6-changelog) / [#announcements](http://discuss.bitrise.io/tags/announcements) :

[image]

[secret env vars and (generic) file storage files: control whether it’s available in pull request builds](http://discuss.bitrise.io/t/secret-env-vars-and-generic-file-storage-files-control-whether-it-s-available-in-pull-request-builds/2790) [changelog](/c/changelog)

related [#feature-r…](/c/9-feature-request) i found the solution, if i select another option in the backup configuration settings, it is possible to enable the "split file" option.

thanks again for your help!

zeno ```
#!/usr/bin/perl
use strict; 
use warnings; 

my $gia = '12tai';

#Capture sequence of digits into one variable,
#capture sequence of non-digits into another variable
my ($number, $name) = $gia =~ m/(\d+)(\D+)/;

print "$number $name\n";#Two values separated by one space
``` hi [@jason.danforth](/u/jason.danforth),

all objects in the document are stored in the objecttable (rhino.docobjects.tables.objecttable). if you just want to select them, you can loop through them and use objecttable.select() method

import rhino

for robj in rhino.rhinodoc.activedoc.objects:

if robj.isnormal:

… the imagej 1.53h20 daily build adds an overlay.xor(indexes) macro function that creates a new roi by xoring all the rois in the overlay with indexes in the array ‘indexes’. here is an example:

run("blobs (25k)");

makeoval(44, 31, 112, 106);

overlay.addselection;

makeoval(86, 74, 112, 106);

…