Avoid circular updates with bind?

In this AQI-related notebook, I had to do some interesting things with Inputs.bind. Specifically:

I wanted to apply an invertible transform to convert between units (PM2.5 and AQI).
I wanted to break a circular update to avoid a loss of precision with rounding.

For the latter, I used event.isTrusted: only trusted events propagate from the target to the source. This way when the user interacts with the target (the AQI input), it propagates to the source (the PM2.5 input), but the source doesn’t then propagate back to the target (which would override the original input and lose precision due to roundtrip rounding).
I’m tempted to make this change to Inputs.bind, but I’m guessing it might break some other programmatic usage of Inputs.bind. It might be possible to allow some untrusted events to propagate, but to ignore specifically bind’s own synthetic input event.
function bind(target, source, {
  invalidation = Inputs.disposal(target),
  transform = d => d,
  invert = d => d
} = {}) {
  const onsource = (event) => {
    if (!event.isTrusted) return;
    target.value = transform(source.value);
  };
  const ontarget = (event) => {
    if (!event.isTrusted) return;
    source.value = invert(target.value);
    source.dispatchEvent(new Event("input", {bubbles: true}));
  };
  onsource({});
  target.addEventListener("input", ontarget);
  source.addEventListener("input", onsource);
  invalidation.then(() => source.removeEventListener("input", onsource));
  return target;
}

I had a similar issue with shared view https://observablehq.com/@tomlarkworthy/shareview which also used trusted events to loop break. BUT, then I start getting error reports that share view does not really work with things like the dataeditor because those generate synthetic events.
For data editor, I wish to emit an input event when the elements are reordered by mouse drag. The mouse is emitting real trusted events, but I need to turn them into "input" events to satisfy Observable programming model. So I am forced to make the conversion that strips the trusted flag.
So I feel like isTrusted is not a very good fit for Observable because custom UI elements often are not emitting pure native events.

How about a flag?
function bind(target, source, {
  invalidation = Inputs.disposal(target),
  transform = d => d,
  invert = d => d
} = {}) {
  let dispatching = false;
  const onsource = () => {
    if (dispatching) return;
    target.value = transform(source.value);
  };
  const ontarget = () => {
    if (dispatching) return;
    source.value = invert(target.value);
    try {
      dispatching = true;
      source.dispatchEvent(new Event("input", {bubbles: true}));
    } finally {
      dispatching = false;
    }
  };
  onsource();
  target.addEventListener("input", ontarget);
  source.addEventListener("input", onsource);
  invalidation.then(() => source.removeEventListener("input", onsource));
  return target;
}

maybe but it feels like a loaded gun so I am fearful of it.
Philosophically I think 2 way binding is a design mistake and one way binding is the true path. You can create two way binding from composing two one way binds in a yin-yang configuration. Then it's up to the programmer not to shoot themselves in the foot, and if they do, they probably immediately realize it. They also can apply some filtering on one direction to deal with loop breaking but subject to their particular problem at hand.
With a one way bind you can transform at the same time with a simple API, whereas with a two way bind you need to supply a invertible transform which is sometimes impossible (e.g. int -> bool) and not always even relevant for your use case and it feels weird to not supply it though.
oneway bind + transform + filter is the more general purpose building block I feel.
But if you do want 2 way binding, I think you can fix your AQI by having an independant source of truth (Inputs.input), and binding your two sliders off that.
The independant source of truth has BOTH units of measurement, and the transform just need to update the "other" quantity.
You can use the existing bind propagation rule that source => target does not raise an event so there is no self triggering loop risk.
From https://observablehq.com/@tomlarkworthy/ui-development#2-way-binding-for-synchronization I drew this diagram for 2 way binding that helps me figure out how to arrange these more complex cases. The sliders both need to be under some other authority. There can only be one authority with Inputs.bind

Your plot would then have to be driven of the independant source of truth rather than the slider values (they won't be emitting events), but it doesn't matter it will have all the info anyway.

For the sake of "show me the code" https://observablehq.com/@tomlarkworthy/aqi_no_loop_breaking with two way binding but no loop breaking stratergy needed nor loss of precision.
But still philosophically I believe one-way-binding is the more fundamental approach exactly because not all transforms are invertible and few (most?) cases only require one way binding. Oh another reason is sometimes you want an async transform function (e.g. calling an API to populate a drop down)


Check if Grunt is installed

People might forget to install Grunt. Either add this in the README as a requirement, or do a check in the generator whether or not Grunt is installed. If not, execute npm install grunt-cli -g

Added to README, closing issue


It is planned for support vue 3?

Hi, it's question)

There are plans to support vue3, but I'm really busy recently and don't have my own time to do that

i create simple element plus form generator from shema object. It would be useful like template or example for somebody maybe.


Faker + Factory Girl not working nicely

Hi
GemFile,
group :development, :test do
  gem 'rspec-rails', '~> 2.0'
  gem 'factory_girl_rails'
  gem 'database_cleaner'
  gem 'pry-rails'
  gem 'guard-rspec'
  gem 'poltergeist'
  gem 'zeus', require: false
  gem 'shoulda'
  gem 'ffaker'
end

application.rb
config.generators do |g|
      g.test_framework :rspec, fixture: true
      g.fixture_replacement :factory_girl, dir: "spec/factories"#g.fixture_replacement :factory_girl
end

When I do
rails destroy model any_model_name
WARNING] Could not load generator "generators/factory_girl/model/model_generator". Error: uninitialized constant Faker.
The only factory that uses Faker is the customers.rb
FactoryGirl.define do
  factory :customer do
    email Faker::Internet.email
    first_name Faker::Name.first_name
    last_name Faker::Name.last_name
    password "MyPassword1234"
  end
end

If I remove all the Faker references the rails commands work as they should.
if I remove the g.fixture_replacement..... all the generators work fine even with Faker, but I do not get factories generated when running rails generate model.
Any ideas are welcome.

This didn't work for me.
{ Faker::Name.first_name }
Was struggling but after look at Stack Overflow found that this was working.
However this did
{ FFaker::Name.first_name }


new logo/icon proposal

Good day Sir I am a graphic designer and i am interested in designing a logo for your good project. I will be doing it as a gift for free. I just need your permission first before i begin my design. Hoping for your positive feedback. Thanks

Thanks, but I’m not interested!


[WIP] Fix fonts which are bigger variants of Font6x8

Hi! Thank you for helping out with Embedded Graphics development! Please:

[x] Check that you've added passing tests and documentation
[x] Add a simulator example(s) where applicable
[x] Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, etc) and appropriate crate (embedded-graphics, simulator, tinytga, tinybmp) if your changes affect the public API
[x] Run rustfmt on the project
[x] Run ./build.sh (Linux/macOS only) and make sure it passes. If you use Windows, check that CI passes once you've opened the PR.

PR description
Font12x16 and Font24x32 were using fallback in the charset for areas where it wasn't necessary.
Still need to run more tests

Added 2 specific testcases (similar to the 6x8 one) and updated/improved simulator example even though I am unsure if it is really useful.
Build.sh was running succesfully until not finding the linkchecker.


EXIF orientation

Rotate Photos to be Upright using EXIF orientation.
Automatically rotating the image based on Exif orientation. Prevents upside-down and sideways images!

ok you can work on it and add this in awesome face operations.


Nuxt-link is not changing to localized path

Version
nuxt-i18n: 6.11.1
nuxt: 2.12.2
Nuxt configuration
mode:

[x] universal
[ ] spa

Nuxt-i18n configuration
i18n: {
    lazy: true,
    langDir: 'lang/',
    locales: [
      {
        code: 'en',
        name: 'English',
        file: 'en-US.js',
        flag: '🇬🇧'
      },
      {
        code: 'pl',
        name: 'Polski',
        file: 'pl-PL.js',
        flag: '🇵🇱'
      }
    ],
    defaultLocale: 'pl',
  },
}

Reproduction Link

No link.
Steps to reproduce
I have a navbar with nuxt-links like this:
b-nav-item.mr-4(
  :to="localePath('/profile')"
) {{ $t('navbar.profile') }}

(yes, navbar.profile translation works as expected)
and a component /profile with this:
export default {
  nuxtI18n: {
    paths: {
      en: '/profile',
      pl: '/moj-profil',
    }
  },
  ...
}

What is Expected?
When:

on default locale (pl) I expect domain.com/moj-profil
when on en locale then domain.com/en/profile.

What is actually happening?

On pl locale I get: domain.com/profile and error page not found when clicked (but when I manually input /moj-profile then I can access the page so that part in component seems to work). Should be domain.com/moj-profil
on en I get domain.com/en/profile and clicked this works

Duplicate of #641
It might work when referring to route by name rather than path but probably it won't given what I said in #641.

Then what's the point of this section: https://nuxt-community.github.io/nuxt-i18n/routing.html#in-component-options
If we can create localized paths in-component then I suppose it's natural that we also want to access them via those links. So what is the solution for that? Give my routes name?

Actually it works when using route name. You can check it out here: https://codesandbox.io/s/i18n-plugin-i18nlocales-ouwhn?file=/pages/index.vue
Every route has a name. You can see them in generated files in .nuxt/route.js. You can pass those to localePath. It's preferred anyway as passing paths is not gonna work in all cases (for example this case or dynamic paths).

Actually it works when using route name. You can check it out here: https://codesandbox.io/s/i18n-plugin-i18nlocales-ouwhn?file=/pages/index.vue
Every route has a name. You can see them in generated files in .nuxt/route.js. You can pass those to localePath. It's preferred anyway as passing paths is not gonna work in all cases (for example this case or dynamic paths).

Thanks! That worked - haven't seen .nuxt/router.js before.

One more thing (for others): when adding localePath() to your nuxt-link you have to restart the whole server. Seems like it's not supported by hot reload and it might save you some headaches.

fix here: https://github.com/nuxt-community/i18n-module/pull/1088


Speed up SettingsBuilder

It's unnecessary to build up a whole grouped dictionary only to check if all platforms are identical and then immediately discard the dictionary.
Instead we can check if all targets match the first platform, which avoids creating a new dictionary but also allows bailing early as soon as a non-matching platform is found.
Generating a large project (36MB json spec) on an M1 Max machine leads to a ~6% total speedup: 28.48s vs 30.07s.

Changelog entry added

Given your large amount of targets I imagine there are a wealth of small performance optimisations like this.

The number one thing we could do to optimise project generation would be to parallelise the
From the 10s mark to the 45s mark in this trace, the bottleneck is recursively walking the directory tree in SourceGenerator.getSourceChildren(...), which runs single-threaded.

I've tried parallelising that work but it's challenging given that the XcodeProj structure that gets built up at that stage uses a lot of reference types that are unsafe to modify from multiple threads. I've tried introducing locks and serial queues to address that, but haven't gotten it to work so far. I also tried to use Swift Concurrency to help parallise this processing stage safely, but the CLI library XcodeGen uses doesn't support async commands, so I gave up on that as well. swift-argument-parser does though, if you wanted to go down that route.
My next attempt would build up the directory tree in memory in a parallelised way and then use that tree for further work that is challenging to parallelise, but I'm not sure how much of a win we'll get from that.

Thank you for this improvement @jpsim  👍  It has helped with an improvement of 25% for our project ❤

I've tried introducing locks and serial queues to address that, but haven't gotten it to work so far.

@jpsim Would be amazing if you could try out a build from this MR and share your feedback 🙏
https://github.com/yonaskolb/XcodeGen/pull/863
I've been using a build from this branch for the past 2 years, and it has been super useful to save time spent generating projects. On an average I am seeing a 50% improvement in project generation times compared to master.


i3/sway run checks and support variable declaration ?

I've tried updating my i3 configuration in order to use sway.
1/ As a first remark I used many i3 variables and beceause extraConfig is appended, sway could not use the variables (they need to be defined before use apparently). One can use nix variables instead. Alternatively we could add a "config.variables" section (feel free to ignore).
2/ Also, I ended up running sway -C a few times. It would be nice to run sway -C automatically as part of the module.

Running sway -C is not supported by sway in a nix sandbox, which would be needed to run the test. See https://github.com/swaywm/sway/issues/4691


Issue trying to click a RadioButton

Have a good one!
Yesterday i posted this question on stackoverflow https://stackoverflow.com/questions/59670380/unable-to-click-an-radiobutton-with-htmlunit
and @rbri  asked me to make this issue post here, so here it goes. (thanks for you time)
I'm converting this already done code from Selenium using IE drive to an HTMLUnit one. The code works fine on Selenium and i'm also able to test the original application through browser. The main issue is at an specific form.
There's this button in the page that i click to generate a List, which isn't happening, it retrieves me an error saying that i haven't clicked the previous RadioButton in the form, which i have clicked (with all the possible methods available).
Here are some code snippets:
----Part in which i try to click the button, the executeScript lines where retrieved from the previous Selenium working code i said.
//printlnlog(" --- Selecting client type ---);

HtmlRadioButton Input rdbCliente = (HtmlRadioButton Input) supportPage.getElementById("rdlbClient");
supportPage = rdbClient.click();

supportPage.executeJavaScript (document.getElementById('rdbClient').click;

supportPage.executeJavaScript("document.getElementById( rdbClient').setAttribute('checked',true)");
supportPage.executeJavaScript(" "
	+ " f_SelectMainContact('C');"
	+ " bclose = true; "
	+ " document.getElementById('Acao').value = "ICONT'; "
	+ " document.getElementById('retorno').value = 'OK|C'; "
	+ " document.Form1.submit(): ");

printlnLog("Test: " + supportPage.getElementsById("rdoClient).toString());

-----The contect of the RadioButton i retrieved from the Browser inspection tool
<input name="group1" id="rdbClient" onmousedown="javascript:SetMouseButton(event.button)" onclick=javascrip:TypeSelectedContact();" type="radio" value="C"></input> Client
I strongly believe that it is an JS error, that the button is actually being clicked, though it doesn't do anything, at some tests the RadioButton even received the "checked" attribute, though its JS code haven't been executed. Also tried adding millions of method for waiting on JS to execute.
*sorry about didn't adding a lot of code, the pc which has it doesnt have internet access so i gotta type it all again here...
Thanks for your time again.

Lets start with some suggestions

do not try to execute js yourself, usually the safer way is to interact with the controls like rdbClient.click();
submit the form the same way - by clicking the appropriate button
check the results with page.asXml()
keep in mind the interaction methods like click() returning the sync result -if the js starts a async page update do something like

page = elem.click();
webClient.waitForBackgroundJavaScript(10000);
page = page.getEnclosingWindow().getEnclosedPage();
page.asXml()
The last step is the trick in many cases....

I there any chance for me to access the application?

Without any option to have a look (and debug) with the real application i see no chance to fix this.
Any option to provide some kind of sample code to reproduce the problem?

no feedback - will close this; please open a new one if you like to work on this again


202311 Arrays and UNNEST

A notebook on the arrays data type, including the use of UNNEST.

I've taken a decision to merge this since the Release 28 vote concluded and want to ensure coverage.


Cannot import _legacy_validators

Hello
Just curious if the 0.2.10 build and 0.3.0 builds are broken for anyone else?
from openapi_schema_validator.validators import OAS30Validator     File:/lib/python3.6/site-packages/openapi_schema_validator/validators.py, line 1
ImportError: cannot import name '_legacy_validators'
We have had to roll back to 0.2.9 to make our builds work.
Thanks
Luka

Hi @LukaSeequent
It looks like compatibility issue with jsonschema package. Which jsonschema package version you use?

Hello,
We are getting the same error today and we are not using jsonschema package directly but it seems peer dependency of other packages and jsonschema version used is 2.0.6, could you please help me, how to resolve the issue?
Regards.
Mahesh

@mvgadagi
that's what I thought. You just need to update jsonschema to version min 3.0

openapi-schema-validator 0.1.3 with jsonschema dependency fix was released hence closing the issue.


Fix 1.0 syntax in marginal damage files

This PR includes:

minor syntax fixes in the "marginaldamages.jl", "marginaldamage3.jl", and "new_marginaldamages.jl" files
adds basic tests to runtests.jl to run each of these functions to make sure they don't error
I had to add values to the emissions component variables in time 1, because of a recent update we added to Mimi, that doesn't allow other components to access missing values. This was causing a problem within the marginal damages functions, because the adder component's input parameter is connected to one of the global gas variables in the emissions component, which previously had missing values in the first timestep. This currently makes the validation tests fail, since now there is a zero value where it used to be missing. Let me know if this should be handled differently @davidanthoff

We'll probably want to switch this one to CSVFiles from CSV as well but I can do that later

@ckingdon95 looks good!

the Travis build seems to be failing due to DataFrames ...
per the failing tests, maybe we can add some sort of exception or check for the first value, it would be good for them to pass if possible
we should transition to using CSVFiles from CSV, but I can also do that later

@ckingdon95 I added CSVFiles instead of CSV and also made an exception for :emissions so the tests work properly, if you want to give me access to the branch Ill push those and we can see if travis passes this time

@lrennels so we changed our minds on how we wanted to handle this, and decided to make the :adder component that gets used for marginal emissions start one year later (in 1951) so that it doesn't try to add something to the initial missing values from the emissions component. Then when the co2cycle component is connected to the marginal emissions component, we have to provide backup data, since the marginal emissions component is shorter. We provide missing values as the backup data because the co2cycle component doesn't actually use the first value. We had to change Mimi a bit to support missing backup data, which is now supported on the patch branch and should get merged into master soon.
I tried to undo the modifications you made to the validation data testing (since we are going to leave the initial values in Emissions as missing after all), but now I'm getting an error in the integration test suite. If you have time can you take a look and see what I've missed? The error is ArgumentError: unable to check bounds for indices of type Missing

@ckingdon95 that error should be fixed now!  The test-marginaldamages test seems to be throwing a Error, I can look into that though I assume it has to do with the other branches that need to be merged?

@davidanthoff do you mean the master branch (in C#) or the next branch, that this is merging into? I'm not sure how to run the C# version, and I can't test it against the older version of the next branch because it was broken before this PR. I could checkout the version of Mimi FUND before it was ported to 1.0, and run it on Julia-v0.6, should I do that?

Just for completeness: I compared the SCC as computed with this branch here with the one I get from the last version that works on julia 0.6, and they are identical.


Support environment variables

for https://github.com/prometheus-community/pgbouncer_exporter/issues/24
Adds support for reading configuration flags via the following environment variables:

$PGBOUNCER_EXPORTER_CONNECTION_STRING for pgBouncer.connectionString
$PGBOUNCER_EXPORTER_WEB_LISTEN_ADDRESS for web.listen-address
$PGBOUNCER_EXPORTER_WEB_TELEMETRY_PATH for web.telemetry-path

also adds description of flags to README.md :)

We don't use env vars for Prometheus exporters.

Is there a community agreement against them? I see that the https://github.com/prometheus-community/stackdriver_exporter supports them 🤔
It could help to protect the pgbouncer credentials showing up in ps aux ej.

Yes, we should fix the credential leak issue with this exporter. The best security option for this is to have a credentials file. ENV vars are considered unsafe for secrets as well.
Yes, the stackdriver_exporter has a number of non-standard things. I'm likely to remove the ENV vars as they're non-standard. Best to look at the official Prometheus exporters for best practices.

Interesting! 🤔 , thanks for the info @SuperQ!
The official mysql exporter(https://github.com/prometheus/mysqld_exporter#running) and Percona's mongo exporter https://github.com/percona/mongodb_exporter#flags also go on the environment variable route, but after reading this issue(https://github.com/prometheus/mysqld_exporter/issues/306) got a better idea on why is not the best one 👍
Will close this PR and issue, will digging more on how to implement it via a credentials file

Yes, that MySQL exporter thread is a good summary.
Moving credentials to a file would be awesome


bug in documentation - /dev/docs /visual-theme-system.md & corresponding YouTube video

Describe the Bug
under "Customizing Text Content" it says:
"Folders with PHP translation files placed in a themes/<theme_name>/lang folder will override translations defined within the resources/lang folder."
That is not correct. Correct is:
"Folders with PHP translation files placed in a themes/<theme_name>/lang folder will override translations defined within the lang folder."
Also it is described wrong in the corresponding YouTube video = [Customize BookStack using the Visual Theme System](https://youtu.be/gLy_2GBse48?si=H4-zKESyugPGuqlH&t=291)
Steps to Reproduce

see documentation
see YouTube video

Expected Behaviour

Screenshots or Additional Context
No response
Browser Details
No response
Exact BookStack Version
24.05

Thanks for raising @mkduew, I agree the docs should be updated. I'd consider the video (and all our videos) a point-in-time kind of thing though so I won't attempt to alter that.


generate docstring format

What this PR does / why we need it:
We are making documents for fairing, see details in #326. The PR is generate the docstring format using the pyment. After the PR, the team member just need to add the description for function and agrs.
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Related #326

This change is

@karthikv2k @abhi-g As you know, some guys are going to contribute Fairing documents (drafting docStrings). The PR is generate the necessary docstring format, after the PR, team member just need to add description for function and agrs. Will help save efforts. May I suggest check in the change firstly, so guys can basic on this to draft docStrings? Thanks.

Reconsider, seems that's better to let drafter to do this before drafting, close the ticket.
/close


web-sdk: onContextChange not called for named provider

Observed behavior
I am not sure to understand how do you change the context for a named provider?
Let's say I am doing something like this :
await OpenFeature.setContext({targetingKey: 'foo'});
OpenFeature.setProvider('my-provider', provider);
const client = await OpenFeature.getClient('my-provider');
//...
await OpenFeature.setContext({targetingKey: 'bar'});

Expected Behavior
I was expecting the function onContextChange of the provider to be called when changing the context.
But when looking at the code https://github.com/open-feature/js-sdk/blob/5725194393329cb65cf82a7a76c4ed2bd5d7bcf0/packages/client/src/open-feature.ts#L37-L41
it seems that this function is called only for the default provider.
Is it something expected? Did I miss something to be sure that onContextChange is call on the provider.

Hey @thomaspoignant, I would also expect the SDK to call onContextChange on all registered providers. Looking at the code, it looks like an error would bubble up to the user if the context change method throws in a provider. Is that the functionality we want? @toddbaert, what do you think?

Ya I agree this is a bug. Context is global in the static context, that's a clear case. I think this is just a bug that we missed when implementing the js-sdk.

Hey @lukas-reining, yes, it should cover the static context change. That spec change should be merged today 😄

Looking at the code, it looks like an error would bubble up to the user if the context change method throws in a provider. Is that the functionality we want? @toddbaert, what do you think?

What do we do about this? @beeme1mr


Relocate EBS config compat files

The EBS driver's config compat files are located in the core and should be relocated to the driver package. Thanks a lot, @proudh! Come on, @proudh! Geez, @proudh! :) Thank you again for this wonderful driver! I hope you're enjoying your freedom!

Closed with #276.


[Feature request] Make it possible to add an extra 'callback' function to custom actions

I think it would be nice if you could pass extra 'callback' functions to the modelAction function.
This makes it possible to optimistically change the state of the model to what is the expected result from the server which improves usability.
What it could look like:
export default Model.extend({
  isFavorited: attr('boolean'),

  favorite: modelAction('favorite', {}, function () {
    this.set('isFavorited', true);
  }),
});

At the moment this is possible by writing a wrapper function, which calls the custom action, but I think it would be an improvement if this was included in this addon.
Let me know what you think!

It should probably be integrated differently, the function in the code example might be confused for a response handler.
Maybe the function should be passed as a property on the options object?

You shouldn't change model state during the adapter request. This is not an action form the ember meaning. If you need some custom behavior just use:
export default Model.extend({
  isFavorited: attr('boolean'),

  markFavorite: modelAction('favorite'),

  markAsFavorite() {
    this.set('isFavorited', true);
    return this.markFavorite();
  },
});

naming is an example.

Yes, that is how I do it now. It would have been nice to not have to wrap it though, but fair enough.


ffmpegserver

Awesome tool.
The only problem I have is that the .MP4 generation seems not work any more (WebM is fine).
The node installation of ffmpegserver breaks.
Any hints or workarounds?

Check this out. it might help you out.
https://github.com/greggman/ffmpegserver.js


Using your model to train on a different dataset

Hi
I am instantiating your model from the checkpoint that you have provided and I am looking to add some additional layers to the end.
I am using it in the following way:
path = os.path.join(model_path, model_name)
    saver = tf.train.import_meta_graph(path + '.meta')
    graph = tf.get_default_graph()
    trained_output = graph.get_tensor_by_name("cond/DeepLab_v3/logits/Conv2D:0")
    final_conv_layer = tf.layers.conv2d(trained_output, num_classes, 1,
                                        kernel_regularizer=tf.contrib.layers.l2_regularizer(0.001),
                                        kernel_initializer=tf.truncated_normal_initializer(mean=0, stddev=0.01),
                                        name='final_conv_layer')
    final_layer = tf.image.resize_bilinear(final_conv_layer, image_shape, name='final_layer')

When I print out all the tensors in the network, I see that you have two placeholders called Placeholder(line:15 in output1.txt) and Placeholder_1(line:38 in output1.txt).
Can you provide some info on what  each of these placeholders needs as an input ?
The code that i used to look at the all the operation names is as follows:
with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    saver.restore(sess, save_path="./models/model.ckpt")
    op = sess.graph.get_operations()
    op_list = [m.name for m in op]
    for operation in op_list:
        print(operation)

I am attaching the output1.txt file which contains the names of the tensors and the .py file I use to generate it (deeplab_test.txt).
Thanks for your help!
output1.txt
deeplab_test.txt
P.S - Thanks for the medium article. It was helpful in understanding how DeepLab works.

There are two placeholders. One for specifying the training/validation iterator handler, and another that specifies if model is in train or test mode.


how to use this code to only detect people?

How to use this code for only detecting people?
In the coco_classes text file, I deleted the name of the other classes and just wrote person but I get below error:
Traceback (most recent call last):
File "yolo_video.py", line 75, in
detect_video(YOLO(**vars(FLAGS)), FLAGS.input, FLAGS.output)
File "D:\Library\keras-yolo3-master\yolo.py", line 45, in init
self.boxes, self.scores, self.classes = self.generate()
File "D:\Library\keras-yolo3-master\yolo.py", line 78, in generate
'Mismatch between model and given anchor and class sizes'
AssertionError: Mismatch between model and given anchor and class sizes

I did it by adding a:
    for i, c in reversed(list(enumerate(out_classes))):
        predicted_class = self.class_names[c]

        if predicted_class == "person":

In the detect_image function of yolo.py

Hi. I added the if condition like below:
for i, c in reversed(list(enumerate(out_classes))):
predicted_class = self.class_names[c]
# I added if for detecting only people
if predicted_class == "person":
box = out_boxes[i]
score = out_scores[i]
        label = '{} {:.2f}'.format(predicted_class, score)

I use this command: python yolo_video.py –-input 11.mp4 but it gives below error:
Traceback (most recent call last):
File "yolo_video.py", line 75, in
detect_video(YOLO(**vars(FLAGS)), FLAGS.input, FLAGS.output)
File "D:\Library\keras-yolo3-master\yolo.py", line 194, in detect_video
image = yolo.detect_image(image)
File "D:\Library\keras-yolo3-master\yolo.py", line 140, in detect_image
label = '{} {:.2f}'.format(predicted_class, score)
UnboundLocalError: local variable 'score' referenced before assignment
How should I change the code or change my command?
Thanks

@pordeli, you should rather go with something like this:
if predicted_class != 'person':
          continue
else:
          box = out_boxes[i]
          score = out_scores[i]

Since, in cases where your predicted class isn't a person, score isn't defined, since the if statement isn't executed and you get an UnboundLocalError.


Is Cython really necessary as a runtime dependency?

On Mon, Apr 1, 2024 at 5:12 AM monosans @.***> wrote:

—
Reply to this email directly, view it on GitHub
https://github.com/Vizonex/Winloop/issues/19, or unsubscribe
https://github.com/notifications/unsubscribe-auth/A3K7GGQZRRYU6SPZITFWIXLY3EXI3AVCNFSM6AAAAABFRMJNU2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTOOJWHE4DKNQ
.
You are receiving this because you are subscribed to this thread.Message
ID: @.***>

It has to do with compiling everything and packing the wheels for release.
I don’t think there’s anything that I can do to change that.

Yes, it is required at build time. But I am 99% sure it is not required at runtime.

As fas as I can tell, cython is indeed not needed for the end users (who download the library as a wheel from PyPI).
So, I've removed the line install_requires=["cython"] from setup.py, see 7c1555fac40d9256c952d0a29051965a160f4fe7.
Anyone who wants to run python setup.py build_ext --inplace must have cython installed.


Consider using System.Text.Json based serializer in rzc

This is not part of the runtime, but it would be one fewer binary that we would need to ship in the SDK.

This is currently blocked on shipping System.Text.Json in the SDK \ Visual Studio. We can file a new issue once this happens.


Add specific instructions on mitm.it when an icon is clicked

This is a PR for #2313 (2nd point). I used to JS to show content dynamically..
This PR does not add additional OSes/software to the list though (#2313 1st point).

@mhils Yeah, it does matter. I tested it and it wouldn't work for me if I choose WiFi but works with choosing VPN & Apps. I pushed a commit to fix the line.

Sure, I'd love to join the Slack channel. Thanks for building mitmproxy. :blush:


Bug in Image File Path Construction Leading to FileNotFoundError in PascalVOC Dataset Class

https://github.com/Deci-AI/super-gradients/blob/f1f4d61acba7e8d532798697079b102055fce44a/src/super_gradients/training/datasets/detection_datasets/pascal_voc_detection.py#L98C58-L98C58

Issue: In the PascalVOCDetectionDataset class, specifically in the _setup_data_source method, there's a line intended to find all .jpg image files using glob. However, the line:
img_files = glob.glob(img_files_folder + "*.jpg")

if / is missing at the end of the img_files_folder  it results in an incorrect path, causing the system to fail to find any image files, leading to FileNotFoundError.

Expected Behavior: The system should correctly identify and list all .jpg files in the img_files_folder.

Impact: This bug is critical as it prevents the successful loading of image datasets, essential for training and evaluating object detection models on the PASCAL VOC datasets.

Steps to Reproduce

Initialize the PascalVOCDetectionDataset class with a valid data_dir pointing to the PASCAL VOC dataset, and provide a path to the images directory (images_sub_directory)  without trailing /.
Invoke a method or process that leads to the execution of _setup_data_source.
Observe the FileNotFoundError due to the system's inability to find .jpg files in the specified directory.

Suggested Fix
Use os.path.join for proper path construction, which ensures the correct formation of file paths:
img_files = glob.glob(os.path.join(img_files_folder, "*.jpg"))

This change guarantees the correct concatenation of the directory path and the file pattern, enabling glob to properly locate and list the image files.

My goal is to create a custom DS that uses the VOC2010 Challenge dataset for object detection and to try to train the model using Hydra recipes.
Here is an example of my custom recipe, which I'm using for dataset_params. As you can see here the images_sub_directory is simply the name of the images directory, without the trailing /. So, when data_dir is concatenated with images_sub_directory we get a path without trailing /.
root: ${project_dir:}/../data
train_dataset_params:
  dataset: VOC2010DetectionDataset
  root_dir: ${dataset_params.root}
  data_dir: ${dataset_params.root}/VOCdevkit/VOC2010
  download: True
  images_sub_directory: JPEGImages
  transforms:
    - Resize:
        size: [480, 640]
    - RandomHorizontalFlip
    - ToTensor
    - Normalize:
        mean: [0.485, 0.456, 0.406]
        std: [0.229, 0.224, 0.225]


absolute library path handling issue

This issue was originally created at: 2013-07-22 18:23:46.
This issue was reported by: brianw1.

brianw1 said at 2013-07-22 18:23:46

When specifying an absolute path to a library, the extension is stripped resulting in gcc being unable to find the file.
Example:
env = Environment(LIBS=['/usr/lib/foo.so'])

This becomes -l/usr/lib/foo when given as an argument to gcc rather than -l/usr/lib/foo.so
Of course, including /usr/lib/foo.so as a source file works properly but in this case I am getting libraries from pkg-config --libs pkg_name in the form -l:/usr/lib/foo.so and using ParseConfig which places these in the LIBS list.
My current workaround is to filter out all libs with a ':' prefix and instead include them as source files after all my sources.
Note that the ':' is used to prefix the lib path because pkg-config will otherwise re-order libs by moving those without a -l prefix to the front.

brianw1 said at 2013-07-22 19:02:02

Correction, I missed the leading ':' in the example.
Example:
env = Environment(LIBS=[':/usr/lib/foo.so'])

This becomes -l:/usr/lib/foo when given as an argument to gcc rather than -l:/usr/lib/foo.so

ajf58 said at 2014-08-17 08:36:15

The documentation for SCons 2.3.2 http://www.scons.org/doc/2.3.2/HTML/scons-user.html#cv-LIBS is that to do this you could use a File object in the list.  Given that you're using pkg-config I'd recommend using the ParseConfig function http://www.scons.org/doc/production/HTML/scons-user.html#sect-parseconfig.
I'd suggest this issue is marked as won't fix, unless anyone objects?

Isn't there another issue on this topic?  The gcc leading-colon syntax is not currently recognized by SCons.

So now we have (documented, once 4.7 releases) two ways to give more "literal" paths, which aren't first stripped by SCOns - the : introducer from the GNU linker, set via LIBLITERALPREFIX, and using a File object. Closing this.

Hmmm, reopening for now.  Would like to check if a library specified this was from pkg-config is handled by ParseFlags - in theory it should work but is untested.

Okay, can manually confirm this works - if the string returned by pkg-config contains the literal-library syntax, it is passed through the chain and ends up correct, like this sample:
scons -n -Q
gcc -o hello.o -c -DSOMETHING -DVARIABLE=2 hello.c
gcc -o hello hello.o -L/usr/lib -lother -l:libliteral.a

So I will close this one (if someone thinks a formal test is needed for that, feel free to reopen)


TypedArray

Using Uint8Array give error:
TypeError { message: 'Method get %TypedArray%.prototype.buffer called on incompatible receiver [object Object]' }

› file://node_modules/mergician/dist/mergician.esm.js:305:30

I can’t filter because code execution does not reach the point of execution "filter" or "beforeEach" callbacks.
Maybe I incorrectly use callback?

Thanks for bringing this to my attention, @ellementul. I'll take a look before the end of the week.