Get access to bucket from lambda

Environment information
System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1 Pro
  Memory: 122.17 MB / 16.00 GB
  Shell: /bin/zsh
Binaries:
  Node: 22.3.0 - /opt/homebrew/bin/node
  Yarn: undefined - undefined
  npm: 10.8.1 - /opt/homebrew/bin/npm
  pnpm: undefined - undefined
NPM Packages:
  @aws-amplify/auth-construct: 1.2.0
  @aws-amplify/backend: 1.0.5
  @aws-amplify/backend-auth: 1.1.1
  @aws-amplify/backend-cli: 1.2.2
  @aws-amplify/backend-data: 1.1.0
  @aws-amplify/backend-deployer: 1.0.3
  @aws-amplify/backend-function: 1.3.1
  @aws-amplify/backend-output-schemas: 1.1.0
  @aws-amplify/backend-output-storage: 1.0.2
  @aws-amplify/backend-secret: 1.0.1
  @aws-amplify/backend-storage: 1.0.4
  @aws-amplify/cli-core: 1.1.1
  @aws-amplify/client-config: 1.1.3
  @aws-amplify/deployed-backend-client: 1.3.0
  @aws-amplify/form-generator: 1.0.0
  @aws-amplify/model-generator: 1.0.4
  @aws-amplify/platform-core: 1.0.5
  @aws-amplify/plugin-types: 1.1.1
  @aws-amplify/sandbox: 1.1.1
  @aws-amplify/schema-generator: 1.2.0
  aws-amplify: 6.4.3
  aws-cdk: 2.151.0
  aws-cdk-lib: 2.151.0
  typescript: 5.5.4
AWS environment variables:
  AWS_STS_REGIONAL_ENDPOINTS = regional
  AWS_NODEJS_CONNECTION_REUSE_ENABLED = 1
  AWS_SDK_LOAD_CONFIG = 1
No CDK environment variables

Description
`lambdaResource.ts
export const textToAudio = defineFunction({
name: 'textToAudio',
entry: './handler.ts',
timeoutSeconds: 60,
environment: {
BUCKET_NAME:"amplify-some-bucet-name-XXXX"
}
});
lambdaHandler.ts
export const handler: Schema = async (event, context) => {
val bucketName = env.BUCKET_NAME
}
`
There is only one way haw to pass name of bucket to lambda, is to manually pass name to variable after first deploy, but this approach is bad as bucket should be created before. Also it is not possible to deploy multiple stacks, because name of buckets will be different.
Question: How to get access to bucket name from lambda to be able run som s3 commands?

Hey @yegenpres, if the storage was created using defineStorage you should be able to use the access property to provide access to the function.
import { defineStorage } from '@aws-amplify/backend';
import { myFunction } from './my-function/resource'

export const storage = defineStorage({
  name: 'myStorage',
  access: (allow) => ({
    'media/*': [allow.resource(myFunction).to(['read', 'write', 'delete'])]
  })
});

which should provide an environment variable with the format <storage-name>_BUCKET_NAME in the function.
refer to the documentation providing this information: https://docs.amplify.aws/react/build-a-backend/storage/authorization/

@ykethan look at this error: https://github.com/aws-amplify/amplify-backend/issues/1769
this approach does not work

Hey @yegenpres, thank you for providing us the definition used. Could you provide us the full error message you are observing? Does the error state on resource-based policy or the identity-based policy as the access denied error may also occur if the  Block Public Access settings on the account.
For reference refer to this document: https://docs.aws.amazon.com/AmazonS3/latest/userguide/troubleshoot-403-errors.html#access-denied-message-examples

Hey @yegenpres, interesting. Would you be open a for a quick chat on discord to dive into this? my handle on discord is ykethan

@ykethan that is all what cloud watch shows. Nothing more. Cloud x trails are empty.
I don't know how show You more
You can easy reproduce this error from empty amplify project.
Just make some function and try to put object to s3. Set up iam policy like me.

@yegenpres did try to reproduce this using the following
import { env } from "$amplify/env/api-function";
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
import { APIGatewayProxyHandler } from "aws-lambda";

const s3Client = new S3Client({
  region: env.AWS_DEFAULT_REGION || "us-east-1",
});

const bucketName = env.APP_STORAGE_BUCKET_NAME;

export const handler: APIGatewayProxyHandler = async (event, _context) => {
  try {
    const fileName = "example.txt"; // Example file name
    const fileContent = "This is a sample file content"; // Example file content

    const params = {
      Bucket: bucketName,
      Key: `audio/${fileName}`,
      Body: fileContent,
      ContentType: "text/plain",
    };

    const command = new PutObjectCommand(params);
    const result = await s3Client.send(command);

    return {
      statusCode: 200,
      body: JSON.stringify({
        message: "File uploaded successfully",
        location: `https://${bucketName}.s3.amazonaws.com/audio/${fileName}`,
      }),
    };
  } catch (error) {
    console.error("Error uploading file: ", error);

    let errorMessage = "Unknown error";

    if (error instanceof Error) {
      errorMessage = error.message;
    }

    return {
      statusCode: 500,
      body: JSON.stringify({
        message: "Error uploading file",
        error: errorMessage,
      }),
    };
  }
};

on storage resource
import { defineStorage } from "@aws-amplify/backend";
import { myApiFunction } from "../functions/test-function/resource";

export const storage = defineStorage({
  name: "appStorage",
  access: (allow) => ({
    "as_images/*": [allow.authenticated.to(["read", "write", "delete"])],
    "audio/*": [
      allow.resource(myApiFunction).to(["read", "write", "delete"]),
      allow.authenticated.to(["read", "write", "delete"]),
    ],
  }),
});

then invoked the function on the console for a test which showed
{
  "statusCode": 200,
  "body": "{\"message\":\"File uploaded successfully\",\"location\":\"<bucketName>/audio/example.txt\"}"
}

verified the permissions on the function resource policy as well
   "Statement": [
          {
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::<bucket-name>/audio/*",
            "Effect": "Allow"
          },
          {
            "Condition": {
              "StringLike": {
                "s3:prefix": [
                  "audio/*",
                  "audio/"
                ]
              }
            },
            "Action": "s3:ListBucket",
            "Resource": "<bucket-name>",
            "Effect": "Allow"
          },
          {
            "Action": "s3:PutObject",
            "Resource": "<bucket-name>/audio/*",
            "Effect": "Allow"
          },
          {
            "Action": "s3:DeleteObject",
            "Resource": "<bucket-name>/audio/*",
            "Effect": "Allow"
          }

Hi @ykethan
Try also add this permissions to current function. I thing it is a reason, when I try to assign any other permissions by CDK API
`const textToAudioLambda = backend.textToAudio.resources.lambda
const pollyPolicyStatement = new iam.PolicyStatement({
actions: ['polly:'], // Full access to Polly service
resources: [''], // Apply to all resources
})
const translatePolicyStatement = new iam.PolicyStatement({
actions: ['translate:'], // Full access to Translate service
resources: [''], // Apply to all resources
});
textToAudioLambda.addToRolePolicy(pollyPolicyStatement)
textToAudioLambda.addToRolePolicy(translatePolicyStatement)`

@yegenpres did ensure the polly and translate permissions were added as well.

Does the project have any permissions boundary set?
For testing are you invoking the function on the AWS console? if yes does the user logged in to the console have Lambda invoke permissions attached?
additionally, to ensure on the deployed Lambda function under configuration -> role document. Do you observe put object permissions to the audio path?

@yegenpres how is the key for the S3 SDK call being passed in? are using passing it as /audio/<item> or as audio/item?
did notice when using /audio/ the s3 SDK call will provide a Access denied error as this will utilze the root path, when using just the audio/ the call succeeded.
Additionally, the permissions being included will provide the Lambda access to the root and all the nested objects present.
https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html
arn:aws:s3:::${externalBucket.bucket_name},
arn:aws:s3:::${externalBucket.bucket_name}/*

But if you would like to manually pass in the name of the storage as an environment variables to a function you can utilize the addEnvironment method on the function.
backend.myApiFunction.addEnvironment(
  "s3Name",
  backend.storage.resources.bucket.bucketName
);

@ykethan that is my lambda policy when I assign access to s3 from lambda resource.ts file, like documentation sad:
{   "partial": false,   "policies": [     {       "type": "inline",       "name": "storageAccess268C740FB",       "document": {         "Version": "2012-10-17",         "Statement": [           {             "Action": "s3:GetObject",             "Resource": "arn:aws:s3:::<name>/audio/*",             "Effect": "Allow"           },           {             "Condition": {               "StringLike": {                 "s3:prefix": [                   "audio/*",                   "audio/"                 ]               }             },             "Action": "s3:ListBucket",             "Resource": "arn:aws:s3:::<name>/audio/*",             "Effect": "Allow"           },           {             "Action": "s3:PutObject",             "Resource": "arn:aws:s3:::<name>/audio/*",             "Effect": "Allow"           },           {             "Action": "s3:DeleteObject",             "Resource": "arn:aws:s3:::<name>/audio/*",             "Effect": "Allow"           }         ]       }     },     {       "type": "inline",       "name": "textToAudiolambdaServiceRoleDefaultPolicyF5680C55",       "document": {         "Version": "2012-10-17",         "Statement": [           {             "Action": "polly:*",             "Resource": "*",             "Effect": "Allow"           },           {             "Action": "translate:*",             "Resource": "*",             "Effect": "Allow"           },           {             "Action": "ssm:GetParameters",             "Resource": "arn:aws:ssm:eu-central-1:957807784596:parameter/amplify/resource_reference/<path>/APP_STORAGE_BUCKET_NAME",             "Effect": "Allow"           }         ]       }     },     {       "type": "managed",       "name": "AWSLambdaBasicExecutionRole",       "arn": "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole",       "id": "ANPAJNCQGXC42545SKXIK",       "document": {         "Version": "2012-10-17",         "Statement": [           {             "Effect": "Allow",             "Action": [               "logs:CreateLogGroup",               "logs:CreateLogStream",               "logs:PutLogEvents"             ],             "Resource": "*"           }         ]       }     }   ],   "resources": {     "s3": {       "service": {         "name": "Amazon S3",         "icon": "data:image"       },       "statements": [         {           "service": "s3",           "effect": "Allow",           "action": "s3:GetObject",           "resource": "arn:aws:s3:::<name>/audio/*",           "source": {             "policyName": "storageAccess268C740FB",             "policyType": "inline",             "index": "0"           }         },         {           "service": "s3",           "effect": "Allow",           "action": "s3:ListBucket",           "resource": "arn:aws:s3:::<name>",           "source": {             "policyName": "storageAccess268C740FB",             "policyType": "inline",             "index": "1"           }         },         {           "service": "s3",           "effect": "Allow",           "action": "s3:PutObject",           "resource": "arn:aws:s3:::<name>/audio/*",           "source": {             "policyName": "storageAccess268C740FB",             "policyType": "inline",             "index": "2"           }         },         {           "service": "s3",           "effect": "Allow",           "action": "s3:DeleteObject",           "resource": "arn:aws:s3:::<name>/audio/*",           "source": {             "policyName": "storageAccess268C740FB",             "policyType": "inline",             "index": "3"           }         }       ]     },     "polly": {       "service": {         "name": "Amazon Polly",         "icon": "data:image"       },       "statements": [         {           "service": "polly",           "effect": "Allow",           "action": "polly:*",           "resource": "*",           "source": {             "policyName": "textToAudiolambdaServiceRoleDefaultPolicyF5680C55",             "policyType": "inline",             "index": "0"           }         }       ]     },     "translate": {       "service": {         "name": "Amazon Translate",         "icon": "data:image"       },       "statements": [         {           "service": "translate",           "effect": "Allow",           "action": "translate:*",           "resource": "*",           "source": {             "policyName": "textToAudiolambdaServiceRoleDefaultPolicyF5680C55",             "policyType": "inline",             "index": "1"           }         }       ]     },     "ssm": {       "service": {         "name": "AWS Systems Manager",         "icon": "data:image"       },       "statements": [         {           "service": "ssm",           "effect": "Allow",           "action": "ssm:GetParameters",           "resource": "arn:aws:ssm:eu-central-1:957807784596:parameter/amplify/resource_reference/<path>/APP_STORAGE_BUCKET_NAME",           "source": {             "policyName": "textToAudiolambdaServiceRoleDefaultPolicyF5680C55",             "policyType": "inline",             "index": "2"           }         }       ]     },     "logs": {       "service": {         "name": "Amazon CloudWatch Logs",         "icon": "data:image"       },       "statements": [         {           "service": "logs",           "effect": "Allow",           "action": "logs:CreateLogGroup",           "resource": "*",           "source": {             "policyName": "AWSLambdaBasicExecutionRole",             "policyType": "managed",             "index": "0"           }         },         {           "service": "logs",           "effect": "Allow",           "action": "logs:CreateLogStream",           "resource": "*",           "source": {             "policyName": "AWSLambdaBasicExecutionRole",             "policyType": "managed",             "index": "0"           }         },         {           "service": "logs",           "effect": "Allow",           "action": "logs:PutLogEvents",           "resource": "*",           "source": {             "policyName": "AWSLambdaBasicExecutionRole",             "policyType": "managed",             "index": "0"           }         }       ]     }   },   "roleName": "amplify-easywordseditor-a-textToAudiolambdaServiceR-<someId>",   "trustedEntities": [     "lambda.amazonaws.com"   ] }

@yegenpres Thanks for the information the permissions on the function appear to be correct. could you provide us the handler/S3 API for the function to reproduce this issue.

@ykethan
`
export const handler: Schema["textToAudio"]["functionHandler"] = async (event, context) => {
const { text, path } = event.arguments
const params = {
Text: text ?? "",
OutputFormat: OutputFormat.MP3,
VoiceId: VoiceId.Ruth,
LanguageCode: LanguageCode.en_US,
Engine: Engine.NEURAL,
};
try {
const command = new SynthesizeSpeechCommand(params);
    const result = await client.send(command);

    const chunks = [];

  // @ts-ignore
  for await (const chunk of result.AudioStream) {
    chunks.push(chunk);
  }

  const audioBuffer = Buffer.concat(chunks);

const bucketName = env.APP_STORAGE_BUCKET_NAME;
const key = `audio/${path}.mp3`;

const input = {
"Body": audioBuffer,
"Bucket": bucketName,
"Key": key,
"Tagging": "key1=value1&key2=value2",
"ContentType": 'audio/mpeg',
"ContentDisposition": 'inline'
};
const s3res = await s3Client.send( new PutObjectCommand(input));
return {
isSuccess: true,
data: https://${bucketName}.s3.amazonaws.com/${key},
message: ""
}
} catch (error) {
return {
isSuccess: false,
data: "",
message: error?.toString() ?? "som error"
}
}
};`

Hey @yegenpres, thank you for the handler. on testing the handler, I was able to run into the denied error on Tagging policy when running the Query using the AppSync console.
AccessDenied: User: arn:aws:sts:::assumed-role/<role-name> is not authorized to perform: s3:PutObjectTagging on resource: \”<s3-arn>/audio/testa.mp3\" because no identity-based policy allows the s3:PutObjectTagging action

on adding the policy on the function role, I was able to make a success query
const myLambda = backend.myApiFunction.resources.lambda;
myLambda.role?.attachInlinePolicy(
  new iam.Policy(backend.storage.resources.bucket, "allows3PutObjectTagging", {
    statements: [
      new iam.PolicyStatement({
        actions: ["s3:PutObjectTagging"],
        resources: [backend.storage.resources.bucket.bucketArn + "/audio/*"],
      }),
    ],
  })
);

@ykethan thank You so much

Are You going include this policy to amplify "write" action, or any other ways to fix this problem?
For a future how can I get error details just from error object?

@ykethan thank You so much

Are You going include this policy to amplify "write" action, or any other ways to fix this problem?
For a future how can I get error details just from error object?

@yegenpres, marking this as feature request add tagging permissions to the storage resource.
for reproduction i utilized the same example provided
import { env } from "$amplify/env/api-function";
import {
  Engine,
  LanguageCode,
  OutputFormat,
  PollyClient,
  SynthesizeSpeechCommand,
  VoiceId,
} from "@aws-sdk/client-polly";
import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
import type { Schema } from "../../data/resource";

const s3Client = new S3Client({
  region: env.AWS_DEFAULT_REGION || "us-east-1",
});

const client = new PollyClient({
  region: env.AWS_DEFAULT_REGION || "us-east-1",
});

export const handler: Schema["echo"]["functionHandler"] = async (
  event,
  context
) => {
  const { text, path } = event.arguments;

  const params = {
    Text: text ?? "",
    OutputFormat: OutputFormat.MP3,
    VoiceId: VoiceId.Ruth,
    LanguageCode: LanguageCode.en_US,
    Engine: Engine.NEURAL,
  };

  try {
    const command = new SynthesizeSpeechCommand(params);

    const result = await client.send(command);

    const chunks = [];

    // @ts-ignore
    for await (const chunk of result.AudioStream) {
      chunks.push(chunk);
    }

    const audioBuffer = Buffer.concat(chunks);

    const bucketName = env.APP_STORAGE_BUCKET_NAME;

    const key = `audio/${path}.mp3`;

    const input = {
      Body: audioBuffer,
      Bucket: bucketName,
      Key: key,
      Tagging: "key1=value1&key2=value2",
      ContentType: "audio/mpeg",
      ContentDisposition: "inline",
    };

    const s3res = await s3Client.send(new PutObjectCommand(input));
    // console.log(s3res);
    return {
      isSuccess: true,
      data: `https://${bucketName}.s3.amazonaws.com/${key}`,
      message: "",
    };
  } catch (error) {
    return {
      isSuccess: false,
      data: "",
      message: error?.toString() ?? "som error",
    };
  }
};


For recovering page

I think my program is in infinite loop. So, I can not rewrite the code. how can I break this loop and recover page?

Kindly mention in what task you are facing this issue so we can help you. Share the url for that particular task. Thankyou

@dishaspatel please take a look at https://forum.freecodecamp.org/t/free-code-camp-infinite-loop-protection/19550. Closing as not a bug on the site. Happy coding!

@usmandap URL : https://www.freecodecamp.org/challenges/roman-numeral-converter
I am facing infinite loop problem for this particular program.
Thank you


[Beer Factories] Suggestion: Collapsible Build Queue Entries

Rearranging Build Queue jobs via drag'n'drop can be quite a chore because of the slow scrolling. This would be easier if the jobs were collapsible, displaying only the title, progress and buttons but not materials and runtime.

Released with version 1.51.0. Joby are collapsible by clicking the title of the job (also added an indicating icon)


Added code coverage

Added code coverage
Added unique build number from git commit numbers
library is shared
library will have unique number

:+1:  after removing old probet references

@yannick-polius and @shwetabhandare please re-review

:+1:

@KjellKod make sure that code coverage works if the rpm build and tests are executed as root user

:+1:


LUN-28: Deliver Android to Playstore

This pull request belongs to an issue on our bugtracker.
You can find it there by looking for an issue with the key which is mentioned in the title of this pull request.
It starts with the keyword LUN.

@SteffiStuffel there are still some open points (hidden for me though). Especially the package name (which is not necessarily a part of this PR though) and the passing of keystore properties to gradle.

Why are some comments of Max without an option to answer?
About the gradle vars: Changed them to be projects vars, being passed by fastlane - same as in Integreat. Thought it is more intuitive to use them directly, but if you prefer this way, I don't mind. With a short research I did not find any best practices.
About the keystore: We have a dummy/debug-keystore same as in Integreat.
About version number starting: Because I always do it the same way as in Integreat :smile:

Why are some comments of Max without an option to answer?

I guess because those are answers to my initial comments, so you'd have to look there to be able to answer.


Using the mod

Hi friend.
I’m very interested in using this game mode. Currently, I use Arma 3 with some Steam Workshop addons to simulate EFT. However, the scenario is not very well optimized and sometimes doesn’t work in the most optimized way possible. Can your game mode be played locally with AI for PvE modes, or is it necessary for real players to join the game?
Edit: do I need extra steam workshop addons to make it work?

Hello,
Thank you for your interest in my GitHub repo. You can use my gamemode; however, it doesn't work on Arma 3. It's a gamemode for Garry's Mod.

Hi again.
Sure, I mean, I use to simulate EFT on Arma 3 with some addons. In this case I would like to implement your repo on garry's mod, my question is if I have to implement another addon from steam workshop, or can I use it in a "raw" mode? and it can be played locally with AI for PvE modes, or is it necessary for real players to join the game?

I warn you before using it that the gamemode is far from being finished, however, it doesn't require any addons from the workshop.


Sample explorer with z stack + multiple points

Hello (again),
I wonder if there is an elegant way to couple the multi-D Acquisition with the sample explorer?
For example, if one wants to acquire 4x4 tiles with z stack at multiple positions.
Thanks!

Thanks! In the meantime I tried different option without a lot of success:
My first though was to loop through the different position and start a mda but I ended up with the following error which was pointed out somewhere else:
ValueError: Cannot start an MDA while the previous MDA is still running.
code is like that:
for i, pos in enumerate(self.xyz[:,0:2]):
      sequence = MDASequence(
      channels=seq_ch,
      z_plan={"range": z_range, "step": z_step},
      axis_order="tpcz",
      stage_positions=[(pos[0], pos[1], z_AF)]
      )

     self.main_window.mda.set_state(sequence)
     self.main_window.mda._on_run_clicked()

I tried to add a self.core.mda.cancel() at the end, it does go through the all loop but nothing appears in napari.
My second though was to build the mds "myself" (more like a bad copy of what is done):
But, probably because it's a bad copy and I am not exactly sure of what I am doing it doesn't work as expected (mainly the data are not "streaming" into napari but more opening when the acquisition is done:
@ensure_main_thread
def temp_file(core, xyz, w3, z_stack_pos):
    tmp = tempfile.TemporaryDirectory()
    data = np.empty([len(xyz),len(w3.value), len(z_stack_pos), 512, 512])
    dtype = f"uint{core.getImageBitDepth()}"
    shape = data.shape
    tp_viewer = zarr.open(str(tmp.name), shape=shape, dtype=dtype)
    layer = v.add_image(tp_viewer, blending="additive")

@ensure_main_thread
def nd_ac(core, xyz, w3, z_stack_pos):
    for l, xy_pos in enumerate(xyz[:,0:2]):
        core.setXYPosition(xy_pos[0], xy_pos[1])
        for m, ch in enumerate(w3.value):
            core.setConfig("Channel", ch)
            core.setExposure(30)
            for n, z_pos in enumerate(z_stack_pos):
                core.setZPosition(z_pos)
                core.snapImage()
                tp_viewer[l,m,n, :, :] = core.getImage()
                time.sleep(10)
                v.dims.set_point(0,l)
                v.dims.set_point(1,m)
                v.dims.set_point(2,n)

Any advice would be more than welcome :)

You're close! But rather than rebuilding the MDA engine code you should go with the first approach where you construct a useq.MDASequence. The key insight is that rather than starting multiple MDAs you should construct one big MDA with multiple positions. Multiple MDAs aren't allowed because on real hardware this could cause serious issues when you have conflicting commands.
So in your case (If I assume that self.xyz is an Nx3 array and z_AF is a float) I would create an run an MDA like this:
pos = np.asarray(self.xyz)
pos[:, -1] = z_AF

from useq import MDASequence
sequence = MDASequence(
    channels=seq_ch,
    z_plan={"range": z_range, "step": z_step},
    axis_order="tpcz",
    stage_positions=pos
)

also, rather than interacting with the GUI via code I'd suggest directly interacting with the underlying object controlling the hardware. That lives in pymmcore-plus and we have an example of how to use it with this project here: https://pymmcore-plus.readthedocs.io/en/latest/examples/napari-micromanager.html
so in your case instead of programmatically clicking I would do the following:
from pymmcore_plus import CMMCorePlus

core = CMMCorePlus.instance() # get the global singleton. i.e. the same one used by napari-micromangaer

core.run_mda(sequence)

@ianhi thank you so much for your answer! I realized that I forgot a (very) important part. Every nth position I run an autofocus (image base AF).
So z_AF is actually a new focus position:
 z_AF = self.autofocus(ch_AF = ch_AF, z_range_AF=z_range_AF, z_step_AF=z_step_AF)
Thank you for your advice on not programmatically clicking.

You may also find parts of this repo's launch-dev script: https://github.com/tlambert03/napari-micromanager/blob/main/launch-dev.py helpful. It automatically installs the mda-simulator demo camera and such. I tend to copy part of that into a jupyter notebook when im developing these things

Thank you @ianhi for taking the time to give me such a detailed answer. If I understand well..🤯..I think it's exactly what I need.

If I understand well..exploding_head.

It's definitely a lot to take in - as it stands you may be the first person not involved in writing the libraries to try to extend the MDA engine. So feel free to ask quesitons and try to keep track of what is confusing for you so we can use this experience to craft good documentation for the next person who has a go at it!

I think it's exactly what I need.

This is the option that is most difficult to do but also provides the most power. It should be possible to do arbitrarily complex things using this so definitely encompasses your needs. The tricky library design part is figuring a way to provide an easier solution.
Feel free to ask questions as they come up and good luck!

thank you @ianhi!

@ianhi I tried a very simple version of the 2 examples you gave me, it seems that there is no more communication with Napari-micromanager (if I manually run the sequence in the napari GUI it works fine) but if if I run after registering the engine  nothing happens in napari:
class AutoFocus(MDAEngine):
    def __init__(
        self,
        mmc: CMMCorePlus = None,
    ):

        super().__init__(mmc)

    def run(self, sequence: MDASequence) -> None:
        """
        Run the multi-dimensional acquistion defined by `sequence`.
        Most users should not use this directly as it will block further
        execution. Instead use ``run_mda`` on CMMCorePlus which will run on
        a thread.
        Parameters
        ----------
        sequence : MDASequence
            The sequence of events to run.
        """
        self._prepare_to_run(sequence)
        for event in sequence:
            if event.index.get('p') in [0,4,10]:
                event.z_pos += 100
                self._prep_hardware(event)
        self._finish_run(sequence)

With using this for simulator:
import napari
import numpy as np
from useq import MDASequence
from pymmcore_plus import CMMCorePlus
from pymmcore_plus.mda import MDAEngine

try:
    from mda_simulator.mmcore import FakeDemoCamera
except ModuleNotFoundError:
    FakeDemoCamera = None

v = napari.Viewer()
dw, main_window = v.window.add_plugin_dock_widget("napari-micromanager")

core = CMMCorePlus.instance()
core.loadSystemConfiguration("../test_config.cfg")

Here is the sequence:
sequence = MDASequence(
    channels=['FITC'],
    z_plan={"range": 60, "step": 5},
    axis_order="tpcz",
    stage_positions=list(map(tuple, xyz))
)

main_window.mda.set_state(sequence)

And here is how I run it:
engine = AutoFocus()
core.register_mda_engine(engine)
core.run_mda(sequence)

oops nevermind it's much simpler than that.  It should look like this:
        self._prepare_to_run(sequence)
        for event in sequence:
            if event.index.get("p") in [0, 4, 10]:
                event.z_pos += 100
                self._prep_hardware(event)

            # ADDED LINES BELOW
            self._mmc.snapImage()
            img = self._mmc.getImage()
            self._events.frameReady.emit(img, event)
           # END OF ADDED LINES
        self._finish_run(sequence)

Easy enough, I guess I misunderstood how it works, you actually "recreate" the all engine, it's pretty awesome you added that, it makes (relatively) easy (although I am pretty sure I will come back with more questions though...) to create a complex acquisition workflow, thanks!

Hello and thanks again for all your help last week.
So some follow up questions:
I need to create overview images at different position - my plan was/is to move the stage to position XY[0], acquire large image, then move to position XY[1] acquire large image etc.
Here is the backbone of the large image acquisition engine following your help from last week:
def run(self, sequence: MDASequence) -> None:
        """
        Run the multi-dimensional acquistion defined by `sequence`.
        Most users should not use this directly as it will block further
        execution. Instead use ``run_mda`` on CMMCorePlus which will run on
        a thread.
        Parameters
        ----------
        sequence : MDASequence
            The sequence of events to run.
        """
        self._prepare_to_run(sequence)
        nbr_slide = 3

        #Should add in sequence center position of different slides to loop through
        arr = []
        for event in sequence:

            self._mmc.snapImage()
            img = self._mmc.getImage()
            arr.append(img)

        arr_large = self.construct_large(arr)

        self._events.frameReady.emit(arr_large, event)
        self._finish_run(sequence)

So the first time I run it, it works great but then if I run it again, it override the older capture and replace it with a multiple position image :

Is there a way to change that behavior?
It might be related  but how do you actually adjust the name of the layer in napari? At the moment it's automatically set to Exp_....?
Thanks!

Hi @CedricEsp, if you want you can check this PR #180 where I'm adding mda capabilities to the sample explorer.
At the moment, the only change that has to be made in order to make it work is in the useq-schema: https://github.com/tlambert03/useq-schema/pull/44.
It is not perfect yet, I still have few issues solve (e.g. reset_view and viewer.camera.zoom) but the acquisition should work fine.
Let me know if this help!

Thanks @fdrgsp ! I guess it could definitely help, so you are adding one more argument to the MDAsequence?

It might be related but how do you actually adjust the name of the layer in napari? At the moment it's automatically set to Exp_....?

Are you using the exact same MDASequence object when you run the mda? If so the names are the same because the names come from the sequence.uid. A fix could be to just regenerate the sequence before running thus giving it a new uid

Hi @fdrgsp, sorry for the basic/naive question, I wanted to test your PR but I am not sure what is the best way to install napari-micromanager from source?

@CedricEsp you can directly install federico's branch with this command: pip install git+https://github.com/fdrgsp/napari-micromanager@multiD_explorer (https://stackoverflow.com/questions/20101834/pip-install-from-git-repo-branch)
but a more general strategy would be to be make your own fork of this repo, do pip install -e ., then set talley's repo as a remote, then you can check out the PR branch. At that point whatever branch you have checked out in your local copy will be the version your code uses.

@CedricEsp  also remember to install in your environment this branch from the useq-schema or the multiD_explorer won't work: pip install git+https://github.com/fdrgsp/useq-schema@expose_name_in_MDAEvent

Thank you for your help, I have it working nicely locally.
Here is my question now, I created an engine to be able to run autofocus every nth tile in a workflow as per @ianhi advice). Is there a way to use the same engine with the sample explorer instead of multi-D acquisition as a MDASequence?
Now I have something like that:
engine = AutoFocus(viewer=viewer, param=param)
core.register_mda_engine(engine)
core.run_mda(sequence)

To add some context to what I am doing (which works fine):
      with open(path+"param.json", "r") as file:
            param = json.load(file)
    # ROIs where created manually by using the points layer in napari
        coord = np.load(roi)
        for reg in coord:
            XY = list(reg)
            move_load_pos(core=core, XY=XY)
            sequence = create_sequence(param = param, XY = XY, core=core)
            engine = AutoFocus(viewer=viewer, param=param)
            core.register_mda_engine(engine)
            core.run_mda(sequence)
            # I need to add that otherwise not all stack are loaded to the viewer
            while core.mda.is_running():
                time.sleep(0.1)

I wonder instead of looping through the coordinate I could use the Grid you created @fdrgsp ?

@CedricEsp
sorry, I"m trying to understand...where do you use this?
with open(path+"param.json", "r") as file:
           param = json.load(file)
   # ROIs where created manually by using the points layer in napari
       coord = np.load(roi)
       for reg in coord:
           XY = list(reg)
           move_load_pos(core=core, XY=XY)
           sequence = create_sequence(param = param, XY = XY, core=core)
           engine = AutoFocus(viewer=viewer, param=param)
           core.register_mda_engine(engine)
           core.run_mda(sequence)
           # I need to add that otherwise not all stack are loaded to the viewer
           while core.mda.is_running():
               time.sleep(0.1)

Is it to create the list of starting position for the grids (same as adding positions to the Grid Starting Position table in napari-micromanager)?

@fdrgsp I acquire an overview image at low res, then add point on ROI and save these points. (The param.json file is just a dictionary created by the user with the number of tiles, channels, z stack range etc that is use to create the sequence). I then go through the different points/ROIs (you could think about them as the center of the grid) and acquire grid images with z stack and multi channels at higher resolution.

But at the moment I am not using your PR

@CedricEsp some small suggestions:

Only make and register one engine - then pass param to it either a property that can be set: engine.param = new_value or have that be some metadata in the sequence
Instead doing a time.sleept loop just do core.run_mda(sequence).join() this will block until it finishes

Thanks @ianhi, I made the modifications.
The stack are only visible in napari when the acquisition is done (every sequence is 16 np, 4 nc and 20nz), I wonder if it's expected? If I don't loop through the coordinate the viewer stream with the acquisition. Also, it acquires a preview image, I am not sure why?

It works very nicely and as expected, much faster, thanks @ianhi !

A quick question, is it actually possible to run_mda without updating the viewer? napari just get stuck after a few cycle (data are very large). I am saving the data as they are acquired and it works well enough.

Hi - I have a quick question here, I run this multi-slides multi-rois experiments but I was wondering if there is a way add a stop option in def run_many_mda that @ianhi wrote. I suspect a th.stop() would be a potential solution but I don't know how to add a stop button that will communicate in napari-micromanager? Thanks!

Hey @CedricEsp, just to make sure I understand...are you using our napari-micromanager plugin and you are running your own MDAEngine? How are you using the run_many_mda method that you mentioned?
One option could be to use magicgui and add to napari a simple PushButton that uses the  CMMCorePlus.mda.cancel method to stops the current running acquisition when pressed.
You first create the button and the function connected to it:
@magicgui(call_button="Stop Acquisition")
def _stop_acquisition():
    mmcore = CMMCorePlus.instance()
    mmcore.mda.cancel()

And then you add it to the napari viewer as a dockWidget. However the viewer should be the napari-micromanager one if you are using it.
viewer.window.add_dock_widget(_stop_acquisition, area="top")

Hi @fdrgsp , thanks for getting back to me - I am using my own MDAEngine and I run:
from __future__ import annotations
from threading import Thread
import useq

def run_many_mda(mdas: list[useq.MDASequence], core: CMMCorePlus = None) -> Thread:
    """
    run multiple separate MDAs in a loop without blocking the main thread
    """
    core = core or CMMCorePlus.instance()
    if core.mda.is_running():
        raise ValueError("Cannot start an MDA while the previous MDA is still running.")

    def f(mdas):
        for seq in mdas:
            core.mda.run(seq) # this is blocking so don't need to .join()

    th = Thread(target=f, args=(mdas,))
    th.start()
    return th

The issue with mmcore.mda.cancel() is that it only stop one sequence, it will still move to the next one - I wonder if there is a way to stop it...

Ok, I found a solution, not such it's "clean" but it's efficient:
th = Thread(target=f, args=(mdas,))
th.daemon = True
 th.start()

and sys.exit() will do, obviously, it kind of kill napari-micromanager in the process though.


Investigate grub boot manager

See this github repo readme for an example on how to sign the grub booter to allow secure boot. There is also a nice grub configuration here or here for official repo.
for dual booting maybe use this?

Try the matter grub theme and if it doesn't work well, uninstall and use rEFInd.


Use raw strings for regex

Fixes #188

https://github.com/docusign/docusign-esign-python-client/issues/188#issuecomment-2243646267


Update cookies-target.md

Cookie expiration listed incorrectly as two weeks when it is actually two years.

Sorry, we missed this one. We'll review and roll out this change soon.


[Feature][Module Name] Feature title你好，随着databend的使用越来越广泛，是否可以增加databend的连接器

Search before asking

[X] I had searched in the feature and found no similar feature requirement.

Description
随着databend的使用越来越广泛，是否可以增加databend的连接器，或者可以使用哪些连接器是兼容的，谢谢！
Usage Scenario
No response
Related issues
No response
Are you willing to submit a PR?

[X] Yes I am willing to submit a PR!

Code of Conduct

[X] I agree to follow this project's Code of Conduct

Good idea. Let's try it.

thank you!


KOGITO-7078: SWF Viewer - Connector labels

https://issues.redhat.com/browse/KOGITO-7078 (First comment)
Since we don't have orthogonal lines with the new autolayout impl, labels must be fixed as:

Fix the position of the label for vertical (less that 45degreesl) connectors
Also consider the possiblty to reduce the width of the label (in case of overlapping)
Fix the tooltip, which does not appear on mouse hover the label

Hey @domhanak
Ready for QE testing, please!
Thanks!

Hey @domhanak
Ready for QE testing, please!
Thanks!

In general looks good, I need to know if current behavior in case the labels does not overlap is correct. I see them being truncated in any case.

hey @domhanak
Yes, all labels, if long, are truncated, even if not overlapping. We're discussing this with UX and in fact, it was their idea, otherwise having longer and shorter labels across the workflow may look weird.
This way, do you think we can approve this?
Thanks!


No results from dmoz_cat() call for domain where dmoz.com data exists.

All or at least one of the queries below should return a valid category for the www.crazyguyonabike.com domain. I've used the get_dmoz_data() command and the domain is present in the downloaded file, as well as the dmoz.com web site.

dmoz_cat(domains="http://www.crazyguyonabike.com")
domain_name dmoz_category
1 crazyguyonabike.com
dmoz_cat(domains="https://www.crazyguyonabike.com")
domain_name dmoz_category
1 https://www.crazyguyonabike.com
dmoz_cat(domains="www.crazyguyonabike.com")
domain_name dmoz_category
1 crazyguyonabike.com
dmoz_cat(domains="crazyguyonabike.com")
domain_name dmoz_category
1 crazyguyonabike.com

One of the fixes issued via https://github.com/soodoku/domain_classifier/commit/9c0110dd3ad07bb6768bdfd05babe2c23ac83063#diff-3e170c764d9348adeb8a5e2bb1e3f249
So now it works but the function and data still need to be parsed slightly differently.


Whithout package declaration, set the package name to 'default package'.

If a file doesn't contain package declaration, a package is actually created, with the name default package.
The problem initially comes from here : I wanted to parse the test directory of a project but my test files didn't have package declaration, resulting a value Error.
I decided to PR on Javalang because in my opinion, set package to None is wrong, since every Java class have actually a package, although it can be unnamed.
Note: after merging this PR and release a new version, this test should be deleted on Javasphinx.

I believe the current behavior is more correct in this case. The Java Language Specification states that classes without a package declaration are placed in an unnamed packaged, rather than a default package. Additionally, the current behavior mirrors Class#getPackage() which returns null for classes in an unnamed package.
Would you mind opening an issue against Javasphinx instead? I think it would be better to have it handle the unnamed packages explicitly.

Ok.


Gophercloud user-agent should include component version and cluster UUID

/kind feature
The version of the cloud-provider-openstack components and the UUID of the cluster that is running them should be added to the gophercloud user-agent, to be able to group and filter request logs and to provide better information in general.
Setting the version is relatively simple, and can be done in the same way as I am doing in cluster-autoscaler. Unfortunately the cluster UUID can not be passed through from the CLI parameters in main.go to where it is needed, as the function in which the provider is created is only registered with k8s.io/cloud-provider, and not called directly.
Possible solutions are:

Adding the cluster UUID to the config file and struct
Setting a global variable like the version, but for the cluster UUID

The first option seems like it would probably be disruptive to a lot of places that use the same struct.
For the second option the UUID variable could either be stored in its own package like the version, which adds a lot just for a single variable, or the variable could be set right in the package where it needs to be used. For example cmd/openstack-cloud-controller-manager/main.go would set a variable in pkg/cloudprovider/providers/openstack/openstack.go.
Other cmd/*/main.go would have to set the cluster UUID in whichever packages they use, i.e cmd/k8s-keystone-auth -> pkg/identity/keystone/keystone.go.
Should I go ahead with this design?

Hey Thomas, thanks for putting up the issue. As I suggested in the k8s-sig PTG, we have added the user-agent downstream to the main two components we currently use. Realistically, these can be added to almost every project in this repository. We did something along the lines as this (below) for k8s-keystone and the openstack-cloud-manager. At a minimum, out of the box, these changes work, with some obvious additional lines. I was POC'ing adding a field to the [Metadata] section of cloud-config called UserAgent so the user can define what this will report back because not all users will have a cluster-uuid, since not all users use Magnum. However, the in-tree cloudprovider stuff gets really mad when new variables in cloud-config are present so volumes cant provision. However, we can push what we have or you can grab what I have below and add some improvements. I'll be glad to review with you :D
pkg/cloudprovider/providers/openstack/openstack.go
 func NewOpenStack(cfg Config) (*OpenStack, error) {
 	provider, err := openstack.NewClient(cfg.Global.AuthURL)
 	provider.UserAgent.Prepend("k8s-cloud-manager")

` pkg/identity/keystone/config.go````
fs.StringVar(&c.UserAgent, "user-agent", "", "user-agent metadata to apply to requests")
...
pkg/identity/keystone/keystone.go
provider.UserAgent.Prepend("k8s-keystone-auth")
if userAgent != "" {
		provider.UserAgent.Prepend(userAgent)
}

Ah, so you weren't adding version or cluster information at all. That makes it a much smaller patch.
This is what I had done so far. Moving the version into a separate package isn't too much work and it makes it available to all the components, so I think that is worth keeping.
For the cluster UUID it requires changes in each main.go that wants to use it and the associated packages, if done this way, so it's less certain. @strigazi was interested in this as a way to group requests by cluster as using the hostname of the request isn't a reliable way to do it since it changes (I think I'm summarising that correctly). As for the magnum/non-magnum thing, if the parameter isn't set then it doesn't need to be included in the user-agent string, so that shouldn't be an issue. Basically the same as the userAgent in your example.

This is what I had done so far. Moving the version into a separate package isn't too much work and it makes it available to all the components, so I think that is worth keeping.

Absolutely

was interested in this as a way to group requests by cluster as using the hostname of the request isn't a reliable way to do it since it changes (I think I'm summarising that correctly)

Internally, we were POC'ing a mechanism that I didn't fully share to use the stack name with the hash for readability, so its pretty consistent and truly reflects where the requests come from, but some kind of cluster UUID as you and strigazi suggested is reasonable for us too.

Possible solutions are:
Adding the cluster UUID to the config file and struct
Setting a global variable like the version, but for the cluster UUID

The non-magnum/magnum discussion sounds like we're on the same page, I was just going off this comment and pointing out for the thread that non-magnum doesnt have cluster UUID.

This is what I had done so far. Moving the version into a separate package isn't too much work and it makes it available to all the components, so I think that is worth keeping.

Absolutely

was interested in this as a way to group requests by cluster as using the hostname of the request isn't a reliable way to do it since it changes (I think I'm summarising that correctly)

Internally, we were POC'ing a mechanism that I didn't fully share to use the stack name with the short uuid for readability, so its pretty consistent and truly reflects where the requests come from w.r.t. heat, but some kind of cluster UUID as you and strigazi suggested is reasonable for us too.

Possible solutions are:
Adding the cluster UUID to the config file and struct
Setting a global variable like the version, but for the cluster UUID

The non-magnum/magnum discussion sounds like we're on the same page, I was just going off this comment and pointing out for the thread that some non-magnum solutions doesnt have cluster UUID.

Agreed, we should introduce magnum-or-anything specific. I think even for non-magnum use cases, others must have a name or an identifier. Even DIY clusters with kubespray or anything have some kind of name and they would call it 'cluster'. eg cluster/test or cluster/my-kubespray-001. Well the three of us use magnum, so we need to hear from others.

Will be discussed at the Kubecon SIG-Openstack deep dive.


Unhandled Exception occurs when disconnecting from a BLE device on Android OS

When I disconnect from a BLE device, my main.dart class catches unhandled Exception which occurs on Native Android part of the plugin (While the same codebase on iOS doesn't). Device disconnects, but still I'm getting the following error in Logs:
E/flutter (19065): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: 'package:appName/main_development.dart': Failed assertion: line 39 pos 12: 'false': Unhandled error: BleError (Error code: 201, ATT error code: 0, iOS error code: null, Android error code: null, reason: Disconnected from C2:80:ED:C1:6E:B5 with status 0 (GATT_SUCCESS), internal message: null, device ID: C2:80:ED:C1:6E:B5, service UUID: null, characteristic UUID: null, descriptor UUID: null)
E/flutter (19065): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:42:39)
E/flutter (19065): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:38:5)
E/flutter (19065): #2      main.<anonymous closure> (package:appName/main_development.dart:39:12)
E/flutter (19065): #3      _rootRunBinary (dart:async/zone.dart:1150:13)
E/flutter (19065): #4      _CustomZone.runBinary (dart:async/zone.dart:1039:19)
E/flutter (19065): #5      runZoned.<anonymous closure> (dart:async/zone.dart:1481:21)
E/flutter (19065): #6      _CustomZone.handleUncaughtError (dart:async/zone.dart:1005:19)
E/flutter (19065): #7      _nullErrorHandler (dart:async/stream_impl.dart:574:16)
E/flutter (19065): #8      _rootRunBinary (dart:async/zone.dart:1146:38)
E/flutter (19065): #9      _CustomZone.runBinary (dart:async/zone.dart:1039:19)
E/flutter (19065): #10     _CustomZone.runBinaryGuarded (dart:async/zone.dart:941:7)
E/flutter (19065): #11     _BufferingStreamSubscription._sendError.sendError (dart:async/stream_impl.dart:357:15)
E/flutter (19065): #12     _BufferingStreamSubscription._sendError (dart:async/stream_impl.dart:375:16)
E/flutter (19065): #13     _DelayedError.perform (dart:async/stream_impl.dart:604:14)
E/flutter (19065): #14     _StreamImplEvents.handleNext (dart:async/stream_impl.dart:709:11)
E/flutter (19065): #15     _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:669:7)
E/flutter (19065): #16     _rootRun (dart:async/zone.dart:1122:38)
E/flutter (19065): #17     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (19065): #18     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (19065): #19     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter (19065): #20     _rootRun (dart:async/zone.dart:1126:13)
E/flutter (19065): #21     _CustomZone.run (dart:async/zone.dart:1023:19)
E/flutter (19065): #22     _CustomZone.runGuarded (dart:async/zone.dart:925:7)
E/flutter (19065): #23     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:965:23)
E/flutter (19065): #24     _microtaskLoop (dart:async/schedule_microtask.dart:43:21)
E/flutter (19065): #25     _startMicrotaskLoop (dart:async/schedule_microtask.dart:52:5)

The main part of it says: " Unhandled error: BleError (Error code: 201, ATT error code: 0, iOS error code: null, Android error code: null, reason: Disconnected from C2:80:ED:C1:6E:B5 with status 0 (GATT_SUCCESS)"
The main_development.dart class:
void main() {
  WidgetsFlutterBinding.ensureInitialized();
  final FlavorConfig config = FlavorConfig(
    flavor: Flavor.DEVELOPMENT,
    apiBaseUrl: 'https://apisBaseUrl.net',
    appName: 'appName',
  );
  Crashlytics.instance.enableInDevMode = true;

  FlutterError.onError = Crashlytics.instance.recordFlutterError;
  runZoned<Future<void>>(() async {
    registerGlobalDeps(config);
    SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
    runApp(
      App(
        connectivity: getIt<Connectivity>(),
        db: getIt<Database>(),
        apiClient: getIt<ApiClient>(),
        log: getIt<Logger>(),
      ),
    );
  }, onError: (e, i) {
    assert(false, 'Unhandled error: $e');
    Crashlytics.instance.recordError(e, i);
  });
}

Do you know why does this error occur and how to fix it? Thanks in advance.

It comes up in main because you're catching the error there, but the stack trace is incorrect.
201 is peripheral disconnected, so I'm guessing you have some dangling operation, which throws up an error because you've disconnected before it finished. Can't tell more without looking at the BLE code.

Thanks for a quick response, @mikolak . I wasn't unsubscribing from the monitorCharacteristic listeners before disconnecting from the device. After doing so this error had disappeared.
But how to avoid the "Disconnected from C2:80:ED:C1:6E:B5 with status 8 (GATT_INSUF_AUTHORIZATION)" error after the BLE device was turned off in the process of connection?
Unhandled Exception: 'package:appName/main_development.dart': Failed assertion: line 39 pos 12: 'false': Unhandled error: BleError (Error code: 201, ATT error code: 8, iOS error code: null, Android error code: null, reason: Disconnected from C2:80:ED:C1:6E:B5 with status 8 (GATT_INSUF_AUTHORIZATION), internal message: null, device ID: C2:80:ED:C1:6E:B5, service UUID: null, characteristic UUID: null, descriptor UUID: null)

We need to unsubscribe from monitoring characteristics before we actually disconnect. But what to do if the BLE device was turned off manually? The listeners will be listening for characteristics indicate while the connection was lost and we got this exception.

To be honest being disconnected is not that extraordinary, so I guess you should be handling it in all operations, one way or another. User could also turn off BT, which would also result in error being returned by any ongoing operation. Here's the complete list of error codes https://github.com/Polidea/FlutterBleLib/blob/develop/lib/error/ble_error.dart
On Futures you can use .catchError(), and on Streams (like characteristic monitoring) you can pass onError to listen().
If the error cannot be handled (ie. is not any expected issue, like peripheral disconnected), just rethrow it from there.

Thanks for your help! 👍
Maybe this thread will help someone else.
We can close this issue, I think


Unable to expose knative workload

Describe the bug: (a clear and concise description of what the bug is)
To Reproduce
Steps to reproduce the behavior:

Deploy otomi with the minimal-with-team scenario (use GitHub Actions)
Click on create and choose KNative, set image
Click save
Go to services
Click on nginx-ksvc link
Observe 404 HTTP response

Expected behavior: (a clear and concise description of what you expected to happen)
**Additional context
# k get ksvc -n team-demo nginx-ksvc
NAME         URL                                                 LATESTCREATED      LATESTREADY        READY   REASON
nginx-ksvc   http://nginx-ksvc.team-demo.<IP_ADDRESS>.nip.io   nginx-ksvc-00001   nginx-ksvc-00001   True

The ksvc gets automatically generated (by Knatvie engine) URL that does not match expected one, which is
nginx-ksvc-demo.<IP_ADDRESS>.nip.io
Read more: https://knative.dev/docs/serving/services/custom-domains/#procedure

We are going to solve this problem by enforcing the following URL for knative services:
{{.Name}}.{{.NAMESPACE}}.{{domainSuffix}}.
e.g.:
myksvc.team-demo.otomi.net
The knative service should always use default host

well done!


Import django into strawberry namespace

This fixes django symbol resolution in some IDE which was originally reported here:

https://github.com/strawberry-graphql/strawberry-graphql-django/issues/35
https://github.com/strawberry-graphql/strawberry-graphql-django/issues/36

Thanks for adding the RELEASE.md file!

Here's a preview of the changelog:

This release fixes the IDE integration where package strawberry.django could not be find by some editors like vscode.

Tests are passing locally but failing on server. Needs more investigation.

I finally were able to reproduce the problem locally and fix failures.
@patrick91, would you have time to take a look?

Looks good to me! Just added one question, we can merge after "resolving" that one :D

It was fast. Thanks =)


Name regex does not support apostrophes

Jimmy O'Keefe is not currently a valid name.

also just the letter m is a valid username, and I got it :D

This actually works now :)


Daily Note in Quick Switcher

It would be cool if one could add commands like "Open Today's Daily Note" to the native Quick Switcher. I find it a little unintuitive to use the Command Palette for these things.
Another advantage (compared to Command Palette) would be that you can add aliases to quickly access it (for example "d").
Sure you can add keyboard shortcuts, but they are scarce.
If there is one extension that could have the ability to implement this, it would be this one.
The reason is because it already patches the openFile method. All you need to do is create a note with the name of the command and Opener could call the command instead whenever the file is opened.
The other reason is that I'm the both maintaining the Plugin and possibly the only one caring about the feature :D

Hi Luke! This feels a bit outta scope for this plugin and I think good alternatives exist. Have you checked out https://github.com/darlal/obsidian-switcher-plus ? From there you can run commands as well.
To open my daily note, I've set Periodic Notes: Open daily note to Cmd+4. obsidian-opener then does its job of switching to it if it's already open.
I think the really good thing about this plugin is, it's primary function is portable across many different existing extensions, as modifying openFile is what is ultimately used by everything. While creating a note for new commands is a clever idea, it does feel a bit unintuitive with the existing infra.
Let's definitely talk more if no other plugins scratch your itch for this feature though!(: It sounds like you may want to may want to make a new plugin to modify the native Quick Switcher though, if the existing ones don't work for you UX-wise. It just feels a little disjoint from this plugin; openFile should be messed with as little as possible as it isn't part of the "real" API, and if I understand you correctly, it seems like the same thing can be accomplished without messing with openFile.
(You've been killing it btw, again fantastic job!)

Hi @aidan-gibson,
I did try the other switchers a while back but decided to go with the native one as long as possible for a number of reasons. (Mainly: most future proof, best performance) I experimented with them on a vault with about 10,000 linked notes.
Including this here would be the less intrusive way I can think of. It could even be hidden behind a setting/feature flag.
Anyways, have a good one!

@lukemt That makes sense! As long as it isn't default behavior and doesn't break anything else, absolutely feel free

As this is working for atm I'm going to close the issue.
Can be reopened when desired

As this is working for atm I'm going to close the issue.
Can be reopened when desired


Consider adding support for ThemeMode.system?

The current themes are all set in colorScheme, including light and dark modes. It seems difficult to update the theme according to the system.

Great, currently the themeMode.system effect is ok, when I select themeMode.system in my app, it works fine, when the system is light mode, I can switch thememode to thememode.dark, but when my system is dark mode, I switch thememode to thememode.light seems to be invalid.

  shadcn_flutter:
    git:
      url: https://github.com/sunarya-thito/shadcn_flutter.git
      ref: 923da9a4cf95aefa1283f8d9870af65114277f98

flutter sdk:3.24.3
platform: ios

Pushed a commit, can you try

It's exactly what I expected, thank you very much for your support


Remove Sales Opportunity and SalesForecast and related entities.

Out of scope for OMS.

This has been done in another PR


Response.text returns improperly decoded text (requests 1.2.3, python 2.7)

If http server returns Content-type: text/* without encoding, Response.text always decode it as 'ISO-8859-1' text.
It may be valid in RFC2616/3.7.1, but this is wrong in real life in 2013.
I made example page with chinese text:
http://lavr.github.io/python-emails/tests/requests/some-utf8-text.html
All browsers renders this page properly.
But reguests.get returns invalid text.
And here is simple test with that url:
https://gist.github.com/lavr/6572927

To whom it may concern
create file requests_patch.py with following code and import it, then the problem should be solved.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import requests

def monkey_patch():
    prop = requests.models.Response.content
    def content(self):
        _content = prop.fget(self)
        if self.encoding == 'ISO-8859-1':
            encodings = requests.utils.get_encodings_from_content(_content)
            if encodings:
                self.encoding = encodings[0]
            else:
                self.encoding = self.apparent_encoding
            _content = _content.decode(self.encoding, 'replace').encode('utf8', 'replace')
            self._content = _content
        return _content
    requests.models.Response.content = property(content)

monkey_patch()

@lavr (/cc @sigmavirus24), even easier than that, you can simply provide the encoding yourself.
>>> r = requests.get('http://irresponsible-server/')
>>> r.encoding = 'utf-8'

Then, proceed normally.

Thanks for this! Any idea on how to do it in one line?


Fedora 39: Top-Level Steam Menus Disappear on Mouse Move

Hyprland Version
 System/Version info
Hyprland, built from branch HEAD at commit 84ab8d11e8951a6551d1e1bf87796a8589da6d47  (props: bump ver to 0.35.0).
Date: Mon Feb 5 01:59:02 2024
Tag: v0.35.0

flags: (if any)

System Information:
System name: Linux
Node name: fedora
Release: 6.7.4-200.fc39.x86_64
Version: #1 SMP PREEMPT_DYNAMIC Mon Feb  5 22:21:14 UTC 2024

GPU information:
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT] [1002:73df] (rev c5) (prog-if 00 [VGA controller])
11:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raphael [1002:164e] (rev cb) (prog-if 00 [VGA controller])

os-release: NAME="Fedora Linux"
VERSION="39 (Sway)"
ID=fedora
VERSION_ID=39
VERSION_CODENAME=""
PLATFORM_ID="platform:f39"
PRETTY_NAME="Fedora Linux 39 (Sway)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:39"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f39/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://gitlab.com/fedora/sigs/sway/SIG/-/issues"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=39
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=39
SUPPORT_END=2024-11-12
VARIANT="Sway"
VARIANT_ID=sway

plugins:

Bug or Regression?
Bug
Description
When using the Steam client on Fedora 39 with the Hyperland Wayland compositor, hamburger menus associated with top-level navigation items (e.g., "Friends," "Store") disappear immediately upon moving the mouse cursor off the initial hover area. This behavior is not present for bottom-level navigation items (e.g., "Community," "Library").
Importantly, this issue does not occur when using the Sway Wayland compositor, suggesting a potential incompatibility or bug specifically related to Hyperland. I have installed Steam from the RPM Fusion non-free repository.
This may or may not be a steam specific issue being on there end but the fact that this issue isn't present on sway makes me believe that it could be a hyprland issue.
How to reproduce
1. Launch Steam on Fedora 39 with Hyperland running.

2. Hover the mouse cursor over a top-level navigation item like "Store" or "Friends."

3. Observe that the hamburger menu appears as expected.

4. Move the mouse cursor slightly away from the navigation item.

5. Notice that the hamburger menu disappears prematurely, preventing interaction with its options.

Crash reports, logs, images, videos
https://github.com/hyprwm/Hyprland/assets/71953305/667e8f1c-3671-45cf-be1f-5d4202b7da6a

Hey, I use to have the same problem but adding the following two lines to my hyprland.conf file seemed to fix the issue.
windowrulev2 = stayfocused, title:^()$,class:^(steam)$ windowrulev2 = minsize 1 1, title:^()$,class:^(steam)$

Oh interesting, I will for try that. I wonder why this issue occurs on hyrland.

this is fixed in git


Set merge=union Git attribute for CHANGELOG.md

Currently all PRs add a line to CHANGELOG.md, usually at the end. This means
they almost always run into merge conflicts since they are adding different lines at the exact same
place in the file.
With merge=union Git will automatically resolve these merge conflicts by keeping all lines from both sides.

r? @eldruin
(rust-highfive has picked a reviewer for you, use r? to override)

needs a "skip changelog" maybe?


Skeleton

Description
creating a skeleton for the client and server
created a framework before I can start migrations scripts, which will be created in the server.
Fixes # (issue)
Type of change
Please delete options that are not relevant.

[x] New feature (non-breaking change which adds functionality)

Change status

[x] Complete, tested, ready to review and merge

Checklist:

[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] My code has been reviewed by at least one peer
[x] I have commented my code, particularly in hard-to-understand areas
[x] I have made corresponding changes to the documentation
[x] My changes generate no new warnings
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes
[x] There are no merge conflicts

didnt merge frontend will remove the client app from the project


attempt to fix flakiness with notifications

We've been seeing alot of flakiness with notifications related tests.
Here's some examples:
https://github.com/dbt-labs/dbt-cloud/actions/runs/10599739892/job/29377047288?pr=12505#step:12:218
https://github.com/dbt-labs/dbt-cloud/actions/runs/10599739892/job/29380913981?pr=12505#step:12:208
https://github.com/dbt-labs/dbt-cloud/actions/runs/10599739892/job/29381607840?pr=12505#step:12:208
https://github.com/dbt-labs/dbt-cloud/actions/runs/10600515659/job/29379537697?pr=12506#step:11:217
I believe it might all stem from this, potentially.  Somewhat blindly attempting this.
Ran the tests 3 times to try and better ensure this works and doesn't cause any unforeseen problems, and all 3 succeeded.

I don't think that the suggested change will fix it.
What it would do is check that at the end of the test the resource is really destroyed.
But the issues are that when we create a notification and do a GET for it just after, it is not returned by the API. And then, because of earlier failures there were dangling notifications that created different issues.
Should I just deactivate the notification tests for dbt Cloud PRs?

I don't think that the suggested change will fix it.
What it would do is check that at the end of the test the resource is really destroyed.
But the issues are that when we create a notification and do a GET for it just after, it is not returned by the API. And then, because of earlier failures there were dangling notifications that created different issues.
Should I just deactivate the notification tests for dbt Cloud PRs?

Sure thats probably the best thing for now until it can be properly fixed


flux-challenge using re-frame

It's not really an issue, but I don't have a clue how to communicate with re-frame community, so I took the liberty of writing here.
There's flux-challenge that is actually about exploring UI architectures. I've created a very raw re-frame version. I'd be more than grateful for Code Review of more experienced re-frame users.

@jelz   thanks for doing this!   I'd suggest posting your work to the re-frame channel in clojurians http://clojurians.net/
I've had a quick look,  and although I don't understand how the app works, it looks about right on the surface.
I'd probably quibble about a bunch of smaller coding issues .... eg use mapv  instead of (vec (map ...))  etc.  Happy to give that kind of feedback.  Wondering how to provide it.  Comments on the PR?

@mike-thompson-day8 thank you for your response and for re-frame itself :)
The most important thing for me is to provide the solution that's structured and implemented with a compliance with a re-frame way of doing things.
I'm aware that my Clojure coding is far away from being elegant and even proper in some cases, I was dropped into this world not so long ago and it's one of my learning projects. Coding feedback in a form of PR comments will be very much appreciated!

Okay, I've done two passes over the code.
First, I've superficially looked over the code from a re-frame point of view, and I can see no glaring problems. Everything looks fine. Having said that, I've not really grocked the purpose of the app itself yet.  So this pass was shallow.
Second,  I've also done a pass looking at the code from a pure Clojurescript point of view.  Some notes added to the PR.
If I have the time, I'll try to grok the purpose of the app, and look more deeply into the re-frame side of things in a couple of days.

@mike-thompson-day8 Thank you very much for your Code Review. It took a while for me to sit down and write some code again, but I've finally managed to do it.
I've applied your suggestions to my code. I've also did some refactoring on my own - now the solution uses a handler middleware (path simplifies handlers a lot!). I've bumped re-frame to v0.5.0.
PR is merged. I've added link to this wiki page.
Please feel free to close this issue if you don't have anything else to add. Thanks and keep up the good work!

@jelz.  Thanks for doing it!

Looks like we have an accepted solution.  I'll close this.


⚠ Spryr has degraded performance

In febc99b, Spryr (https://spryr.com) experienced degraded performance:

HTTP code: 200
Response time: 5739 ms

Resolved: Spryr performance has improved in d642cec after 7 minutes.


Hint for Zen Mode

I think the Zen Mode is a good option for someone, who just needs vscode as text editor. Maybe the Readme could mention the possibility.
Settings

ZenMode.fullscreen must be false
zenMode.centerlayout should be false

Thanks for the idea, I haven't used that feature before! :)


Small optimizations and fixes

Please consider my changes.

Exploit the fact that we know std::vector size before filling in RowFunctionFromCSR
I suppose here is typo in ClearPredictBuffer. In mine opinion we should use memset in the case when more than a half of elements are non-zeros.

 Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.:x: dmitryikh sign nowYou have signed the CLA already but the status is still pending? Let us recheck it.


earlyoom: 1.8.1 -> 1.8.2

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://repology.org/project/earlyoom/versions.
meta.description for earlyoom is: Early OOM Daemon for Linux
meta.homepage for earlyoom is: https://github.com/rfjakob/earlyoom
Updates performed

Version update

To inspect upstream changes

Compare changes on GitHub

Impact
Checks done

built on NixOS
The tests defined in passthru.tests, if any, passed
found 1.8.2 with grep in /nix/store/l55il8cg6awms75n28nqw9cpwljms32w-earlyoom-1.8.2
found 1.8.2 in filename of file in /nix/store/l55il8cg6awms75n28nqw9cpwljms32w-earlyoom-1.8.2

Rebuild report (if merged into master) (click to expand)

2 total rebuild path(s)

2 package rebuild(s)

First fifty rebuilds by attrpath

earlyoom

Instructions to test this update (click to expand)

Either download from Cachix:
nix-store -r /nix/store/l55il8cg6awms75n28nqw9cpwljms32w-earlyoom-1.8.2 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.
Or, build yourself:
nix-build -A earlyoom https://github.com/r-ryantm/nixpkgs/archive/6fcc749376b257ec3875e7a964ceb78ae68cab61.tar.gz

Or:
nix build github:r-ryantm/nixpkgs/6fcc749376b257ec3875e7a964ceb78ae68cab61#earlyoom

After you've downloaded or built it, look at the files and if there are any, run the binaries:
ls -la /nix/store/l55il8cg6awms75n28nqw9cpwljms32w-earlyoom-1.8.2
ls -la /nix/store/l55il8cg6awms75n28nqw9cpwljms32w-earlyoom-1.8.2/bin

Pre-merge build results
We have automatically built all packages that will get rebuilt due to
this change.
This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.
Result of nixpkgs-review --extra-nixpkgs-config '{ allowInsecurePredicate = x: true; }' run on x86_64-linux 1

2 packages built:

earlyoom
earlyoom.man

Maintainer pings
cc @AndersonTorres for testing.

not tagged, no changelog

I will add a changelog later.

Result of nixpkgs-review pr 310647 run on x86_64-linux 1

2 packages built:

earlyoom
earlyoom.man


fix Monoid booleanConjunction bug

Merged in another PR

The one that you merged is for 1.x, this is for master branch (2.x).

Even better! Thanks.


Can not build the workspace

Hello,
I clone the git repo to my ros2 workspace and colcon build it but it is not compiled and gives the CMake error umrr11_t132_automotivev1.1.1_user_interface
umrr96_t153_automotivev1.2.1_user_interface not found.
As their dependency is mentioned in smartmicro/smartmicro_ros2_radars/simulator/simulation/CMakeLists.txt.
Can you please help me with how can I install the radar drivers in ros2? Also, the radar which I am using has the number UMRR-8F0500, does the given drivers support it?
It will be good to have steps for installation process as per ros2 if possible.

Hey,
UMRR8F is not supported by the driver and regarding the build, prior to the build you should attain the smart access release which would provide with the interface files. Need to run the script.

Hello,
So for UMRR87 are the drivers available?

Hello,
So for UMRR8F are the drivers available?

Nope. It is not supported.

Will the ros 1 driver support UMRR8F?

Nope, it also does not support the UMRR8F.


[SPARK-9164][SQL] codegen hex/unhex

Jira: https://issues.apache.org/jira/browse/SPARK-9164
The diff looks heavy, but I just moved the hex and unhex methods to object Hex.  This allows me to call them from eval and codeGen

Can one of the admins verify this patch?

Test build #1130 has started for   PR 7548 at commit dd91c57.

Can one of the admins verify this patch?

Test build #1130 has finished for   PR 7548 at commit dd91c57.

This patch passes all tests.
This patch merges cleanly.
This patch adds the following public classes (experimental):
trait Nondeterministic
case class Hex(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
case class Unhex(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
abstract class RDG extends LeafExpression with Nondeterministic
case class Rand(seed: Long) extends RDG
case class Randn(seed: Long) extends RDG
case class Ascii(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
case class Base64(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
case class UnBase64(child: Expression) extends UnaryExpression with ImplicitCastInputTypes
class ShuffledRowRDD(

Thanks!  Merged to master.


Text and TTS not working only on P5S

It works fine for other members in my static, but for me cactbot is not working only on this fight (as far as I know, din't try further savage fights yet), Barbariccia and other fights work as always. Is just P5S so far.

Have you looked through #4848?

If this is still happening, I recommend asking questions in the ffxiv act discord.


Fix GPU usage by removing device from Transformers class wrapper to use the device/device_map directly exposed by HF Transformers in kwargs

The issue
Using the device parameter already provided by the Transformers wrapper doesn't work as intended. It first loads the model (by default on CPU) and then pushes the model to the device later. This is inefficient and hasn't been working at all on my end.
Example code snippet for the above:
from guidance import models

# This is confusing since the user can think this is given directly to the wrapped HF transformers class
gpt = models.Transformers('gpt2', device='cuda')

The fix
Removing the device parameter altogether fixes this and removes the confusion of having a device parameter that isn't actually directly being used by HF Transformers but only by the wrapper itself.
Also, it doesn't affect anything else since there is a self.device = self.model_obj.device that gets the device from the model directly. Also, the tests seem to pass.
It is now only necessary to use device_map from HF Transformers directly through kwargs and the model is loaded correctly.
Example code snippet for the above:
from guidance import models

gpt = models.Transformers('gpt2', device_map='auto') # `auto` or any other device map

Thanks @cpcdoy ! This is a great fix. Once the unit tests run I'll go ahead and merge.

Fixes #536

I tried the following
mistral = models.TransformersChat("mistralai/Mistral-7B-Instruct-v0.2", device=0)
mistral = models.Transformers("mistralai/Mistral-7B-Instruct-v0.2", device=0)

Both of those statements resulted in:
TypeError: MistralForCausalLM.__init__() got an unexpected keyword argument 'device'

Is that expected? Running the latest version from this repo: pip install git+https://github.com/guidance-ai/guidance


Update CHANGELOG.md for 1.23 strong mode changes

Did this as a pull request for easier previewing/editing.

Chatted with Leaf, he suggested I merge this then he'll combine with his other 1.23 language changes. Thanks all!


Documentation and type changes

Description
This is in response to #33 With the goal to fix failing tests. Add additional documentation and look over bad types not following the API documentation.
Adds documentation and corrected types to the following Models:

AbsenceTransactions
Assets
Account
AccountChart
Archive
Article
AssetType
AttendanceTransaction
Authorization
CompanyInformation
CompanySettings
Contract
ContractTemplates
CostCenter
Currency
Customer
Inbox

Checklist

[X] Code compiles correctly
[X] Created tests which fail without the change (if possible)
[X] Extended the README / documentation, if necessary

I'll take a look at the failing builds on monday next week when I have access to my work PC.
I think the builds are failing due to some kind of Fortnox update in the Offers module as they were working before but now suddenly started to complain about housework types.
I also think its time to start fixing theese tests once and for all.

I'll take a look at the failing builds on monday next week when I have access to my work PC.
I think the builds are failing due to some kind of Fortnox update in the Offers module as they were working before but now suddenly started to complain about housework types.
I also think its time to start fixing theese tests once and for all.

This seems to be the reason for the failing tests: https://developer.fortnox.se/blog/updates-in-tax-reduction/

This seems to be the reason for the failing tests: https://developer.fortnox.se/blog/updates-in-tax-reduction/

Published Pre-Release version of Fortnox.NET Version 3.0.0 to NuGet: https://www.nuget.org/packages/Fortnox.NET/3.0.0-alpha
This PR will be opened unitll we are done with #33 after discussion with @GGAlanSmithee

Published Pre-Release version of Fortnox.NET Version 3.0.0 to NuGet: https://www.nuget.org/packages/Fortnox.NET/3.0.0-alpha
This PR will be opened unitll we are done with #33 after discussion with @GGAlanSmithee

Published Pre-Release version of Fortnox.NET Version 3.0.0 to NuGet: https://www.nuget.org/packages/Fortnox.NET/3.0.0-alpha2
Resolves #36

Published Pre-Release version of Fortnox.NET Version 3.0.0 to NuGet: https://www.nuget.org/packages/Fortnox.NET/3.0.0-alpha2
Resolves #36

Published Pre-Release version of Fortnox.NET Version 3.0.0 to NuGet: https://www.nuget.org/packages/Fortnox.NET/3.0.0-alpha3
Related to #40

Awesome job @brokenprogrammer


Alter DocumentRoot in 000-default.conf

There's no /var/www/html text to be replaced in the default /etc/apache2/apache2.conf file.
This change will alter the same file as the Vagrant config.

Have you experienced an actual issue here?
The php:7.0-apache image has an apache2.conf file that differs from the one normally installed by Debian/Ubuntu, and which contains a DocumentRoot entry for the default vhost; the configuration we're using here in the Dockerfile updates that entry specifically.
As a test, I just did the following:

Cloned the repository to a new directory
Ran composer install
Ran composer development-enable
Ran docker-compose build
Ran docker-compose up
Visited localhost:8080

All worked as expected, and I was able to see that apache was accepting and responding to my requests.

Can we please get this merged in?
I used:
composer create-project zendframework/skeleton-application test-zend-apache

To install, get 404s unless I do this fix.

I think the issue is valid.
@weierophinney please check your local docker images:
$ docker images

and try update it to the latest version:
$ docker pull php:7.0-apache

For more information please check my comment https://github.com/zfcampus/zf-apigility-skeleton/pull/150#issuecomment-262752400.

I needed this patch today to get the docker container to work.
Without the patch:
docker-compose down
docker-compose build
docker-compose up

http://localhost:8080/
Not Found
The requested URL / was not found on this server.
Apache/2.4.10 (Debian) Server at localhost Port 8080

With the patch:
docker-compose down
docker-compose build
docker-compose up

http://localhost:8080/
... The Skeleton Application is served.

Confirmed


wont run

I would like to test your project but the example wont run.
Neither on your website nor when locally cloned.
Uncaught TypeError: Class constructor Wn cannot be invoked without 'new'
    at MapHeightNodeShader.MapHeightNode [as constructor] (geo-three.js:794)
    at new MapHeightNodeShader (geo-three.js:1339)
    at new MapView (geo-three.js:1699)
    at (index):143
    ```

Hello
Thanks a lot for reporting this issue, it is caused by changed in three.js library.
I will update the library code to be compliant with recent version of three.js
Cheers

A  new version 0.0.7 is now available that should be working correctly


Add example poll_recv impl

This is just an example implementation for how we could go about supporting the use case in https://github.com/smol-rs/async-broadcast/issues/55 without changing the default Stream implementation. I'm not super certain of the logic (I haven't looked into this event listener stuff), so this is more just to present an approach.
Why? Say I have a struct like:
struct MyStreamReceiver<T> {
    inner: async_broadcast::Receiver<T>
}

If I want to be able to write a Stream impl that pulls items from the inner async_broadcast::Receiver<T>, and will notify the user if the stream has overflowed, how can I go about it?
Well, I might try getting and polling a Recv future handed back by receiver.recv(), but this future borrows Receiver<T>, and so I can't store it in my MyStreamReceiver<T> struct.
I might instead try polling Receiver<T> directly, but the Stream implementation for that, unlike the Recv future impl, doesn't provide any information about whether the channel overflowed.
So instead, in this example we add a low level poll_recv method to the Receiver<T> which returns the same value as the .recv() future (hence the name), and which can then be used in the stream impl for MyStreamReceiver<T>.
Anyway; open to thoughts on this sort of approach and whether it's something you'd be up for adding or not :)

I added an example to poll_recv(), and added an OverflowError so that poll_recv() could be more precise rather than returning a RecvError.
@zeenix what do you reckon? :)

I added an example to poll_recv()

Awesome!

and added an OverflowError so that poll_recv() could be more precise rather than returning a RecvError.

Is it worth it? Do we envision any other information going in it other than the count? If not, I'd rather keep things simple and just return the integer. If we need an error type, then we just go with option#1.

This reminds me that it would be good to document possible errors from this method in a Errors section (as per the conventions).

I wasn't sure what you meant here offhand (I can't see any such sections in the repo)

I meant adding a # Error heading in the docs of the method and listing all possible errors it can throw.

Is it worth it? Do we envision any other information going in it other than the count? If not, I'd rather keep things simple and just return the integer. If we need an error type, then we just go with option#1.

My arguments for keeping OverflowError would be:

The name of the type makes it clear what it is about (ie an error caused because of overflow)
It acts like the other errors returned in Results in this library, ie it implements Error and can be handled accordingly by libs like anyhow and such.

But happy to go either way if you'd prefer otherwise

I meant adding a # Error heading in the docs of the method and listing all possible errors it can throw.

There are no other Error sections in the library for other functions that return Results, but I did what some of those did and added a bit of text about the error condition. Happy to put that into an # Error section if you like though?

My arguments for keeping OverflowError would be:
* The name of the type makes it clear what it is about (ie an error caused because of overflow)

It's clear enough since it's the Err variant of a Result. :) The docs would remove any confusion (if there is still some). :)

* It acts like the other errors returned in `Result`s throughout this library, ie it implements `Error` and `Display` and can be handled accordingly by libs like anyhow and such.

usize also implements Display so that isn't a good argument but Error impl is. I'd be fine with RecvError here based on this argument.

There are no other Error sections in the library for other functions that return Results,

I didn't realize that but just because we've been lazy so far, doesn't mean we should continue to be so. :) Also in other fallible methods, all variants of the returned result type are possible so it's not as important as when returning an Error and not all variants could be possible (which would be the case for RecvError here).
By "convention", I meant the general conversion in the Rust world (I think it's even recommended in the book).

Happy to put that into an # Error section if you like though?

Yes please.

Done and done!

Done and done!

You're too efficient. Do it again! :laughing:

@jsdw now if you could just update the PR description, I can squash merge with that as the commit message. :pray:

now if you could just update the PR description, I can squash merge with that as the commit message.

@zeenix good to go? :)


CodeQL automatically runs Autobuild for Go during analyze step

I've removed Autobuild step from our project, but it seems that Autobuild still during analyze step regardless of the explicit step in workflow yaml.

This behaviour is pretty confusing, is it expected? I've removed Autobuild step since it wanted to build the project with Makefile and this assumption didn't suite us, but it still tries to build it via Makefile but now via analyze step.

To get Go to use a custom build step rather than simply scanning for all .go files in the repo, which is the behaviour you're seeing here, you need to set CODEQL_EXTRACTOR_GO_BUILD_TRACING=on in the environment. For example, you can see a (third-party) project doing this here: https://github.com/triggermesh/eventstore/blob/4423a6197688e2abd4e75e869ac7f245ac58c7d9/.github/workflows/codeql.yaml#L12
Medium-term we want to make the user experience more like other compiled languages, in that simply replacing the autobuild step as you have done will be sufficient; I'll flag this issue to the relevant team.

Thanks for the quick answer and clarification! Yeah, I see know, I think it's probably worth mentioning in the docs, or maybe I missed it? (or it's deliberately undocumented?).
Agree that it would be better to have a uniform experience across compiled languages, thank you!
I think we can close this one then?


give context to render_breadcrumbs template

allow us to access to request processors values in the render_breadcrumbs template

I'll tag a new release in a few hours, thanks!


sex.porno800.com

I believe this domain is an Adult(-related) domain --> that have to be blocked as..
Domains
Only add the needed one See also #12
porno800.com
sex.porno800.com
www.sex.porno800.com

Content sources
(Please see #35)

External sources (reference)

Screenshots
Screenshot required

Logger output
External Info

All Submissions:

[x] Have you checked to ensure there aren't other open Merge Requests (MR) or Issues for the same update/change?
[x] Added a Screenshot for prove of Adult contents

Todo

[ ] Added to Source file?
[ ] Added to the RPZ zone adult.mypdns.cloud (@spirillen)

Hey @Rygle
What DNS servers are you using?? for this domain is actually non existing....
whois sexporno800.com
No match for domain "SEXPORNO800.COM".
>>> Last update of whois database: 2020-10-10T15:09:37Z <<<

Corrected a typo. Should have stuck to copy and paste! 😉

Even, it is a very weird domain setup....
sex.porno800.com
www.sex.porno800.com

Using www as fourth level domain for a website.
I'll add it when the test => distribution of yesterdays work is published

Closed with 2c9a198


introduce the cfregion lib to read and write file series in less space

This defines a basic compression option for stored series that accumulates a type-directed statistical model of recorded data to drive a basic arithmetic (entropy) encoder/decoder.

Some rough details -- with these last couple of changes to improve performance, I ran a test program that recorded 10 million values of type '{x:int, y:byte, c:|Red,Green,Blue,Magenta|, |jimmy:int, bob:[char]|, nats:[long]}' both in "raw" form (the way we usually record data) and also in this "compressed" form.
The raw recording process took 15.4 seconds and produced a 1.4GB file.  Running gzip on this file took an additional 20.5 seconds and reduced the file to 109MB.  So a total of ~36 seconds and reduction to 7% of raw file size.
With this compression method, I recorded the same data in 26.3 seconds and produced a 158MB file.  So ~37% faster this way, but ~45% more bloat (than the final gzipped output).
I think that it's probably worth using this option intraday for very large files that are otherwise unwieldy when written/queried uncompressed (which was the reason for this PR).  But probably for most files, we are better off writing uncompressed.

Would you humor me and measure the time required to bzip2 your 1.4GB sample?

Strictly speaking, the escape probabilities here are overly conservative (implemented as  / 256).  Since we will know that some of those 256 symbols are already accounted for in the non-escape set, we can reduce the escape symbol range proportionally.
In my tests, implementing escape probability this way only shrunk the compressed file by 0.7% (157MB instead of 158MB) but added 3% to run time (27.1s versus 26.3s) so probably isn't worth it.

Hi Brian,
Sure, I ran bzip2 on the raw 1.4GB file and it took 1m35s and compressed down to 58MB.  So that's 322% slower than this method but 36% of the file size.
Also I ran xz on the raw 1.4GB file.  It took 7m8s and compressed down to 26MB.  So that's 1527% slower than this method but ~16% of the file size.
I'm not sure if there's a good way to make those methods incremental or support the other couple of requirements we have in this case (kill and resume the writing process, seek to batches quickly).
There's no doubt that this method is not optimal for final file size (even when compared to gzip, let alone bzip or xz).  It's pretty fast though, and gets our largest intraday file sizes down to a tolerable level -- we can still batch compress at the end of the day for optimal archive file sizes.

Yes, I wasn't suggestion a different algo for on the fly, but we may want to consider using xz for offline compression.

Agreed.


Fix stop a node

Follow-up to https://github.com/cockroachdb/docs/pull/2275.

This change is

http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/96e7234c342386a165193420431ad10a9369056a/

http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/1a9c37c67798a7f7cdc7452dcce68101877f2f98/

http://cockroach-docs-review.s3-website-us-east-1.amazonaws.com/3bbec5f80e85d776eba0410879bd48a351f3c5c4/


Added a business entity search engine

A search engine of corporations and LLCs in the USA and their related info.

I don't see any open/public datasets.  Are they hidden somewhere or is the search engine the only thing? (if so, probably not a good fit for this list)

Oh like a data dump option? I don't think there is one. OK good point.
On Sun, Jan 31, 2016 at 10:47 PM, Tom Morris<EMAIL_ADDRESS>wrote:

I don't see any open/public datasets. Are they hidden somewhere or is the
search engine the only thing? (if so, probably not a good fit for this list)
—
Reply to this email directly or view it on GitHub
https://github.com/caesar0301/awesome-public-datasets/pull/161#issuecomment-177808334
.


Correct dtrace argument for jdk15

Dtrace does not accept the "auto" option on jdk15, and configure
fails if it is set. Changing this so it matches the other usages
in the same groovy file.
Signed-off-by: Adam Farley<EMAIL_ADDRESS>

@karianna Adding you as a reviewer - this is causing a build break on https://ci.adoptopenjdk.net/job/build-scripts/job/jobs/job/jdk15/job/jdk15-linux-aarch64-openj9-linuxXL/ as a result of https://github.com/AdoptOpenJDK/openjdk-build/pull/1988 and makes it consistent with the changes originally made in https://github.com/AdoptOpenJDK/openjdk-build/pull/1731

Rebased.


Feature Request: "Always Show Pictures for address/domain"

As well as the "always show for contacts" option for pictures, can we also have some sort of whitelisting to work alongside?
I get a number of genuine advertising type mailing lists, most of which I would like to see the pictures for. But to show pictures for these at the moment, I either have to press the button every time, add them to my contact list, or allow pictures always.
Adding them to my contacts would be OK if the contacts were only for use in K9,  but it appears to be wanting to add a global phone contact, which is silly for this purpose.

Class UI/messageView/MessageTopView
Methode : shouldAutomaticallyLoadPictures
return showPicturesSetting == ShowPictures.ALWAYS || shouldShowPicturesFromSender(showPicturesSetting, message) || isTrustedSender(message.getFrom());
then add methode isTrustedSender and return true the send is in the trusted list.

Please provide patches as pull requests not in issue comments.

Sorry, just proposing a way to resolve the issue. The general solution may be more complete.

I second this enhancement and think that this is the only thing really missing from K9.
I don't want to add every potentially whitelisted address/domain to my phone's contacts but I also don't want to allow images from all addresses/domains coming into a particular email account.
A global or per-account whitelist for all the address/domains for which pictures are shown automatically would really cut down on having to press "Show Images" about 70% of the time in one of my email accounts.

I would like this feature as well.

I agree. I use K9 for several years and this missing feature is the only reason I look at other clients right now.

+1! I am CONSTANTLY having to hit the "Show Pictures" for messages who are being sent from accounts or domains who I do not have in my contacts, either because they are send only accounts or are sent from multiple senders from a domain I trust, but don't have EVERY sender in my contacts. This would be a MUCH improved user experience!

Bump: can't this please get assigned to someone to implement? This has been requested for a LONG time!

I was about to propose this feature, so I was quite happy to see it had just been assigned... Though I am guessing that is probably a joke? :smiling_face_with_tear:

Not a very good joke either. This feature is BADLY needed.

We don't prioritize features by listening to who shouts the loudest. But it's an open source project. So there's at least the possibility of implementing the feature yourself (or paying someone to write the code for you).
Adding a comment requesting that something should happen does nothing to get the feature implemented any faster. It probably has the opposite effect, because it takes time to read such comments and maybe respond to them. That's also the reason why such comments will be hidden. The fact that someone needs this feature badly, is not relevant when a developer finally gets around to implementing the feature. I don't want anyone to have to waste time reading those comments (again).